Elastic scaling of P4 network functions