Architecture and performance of the KM3NeT front-end firmware