sonic-net / DASH

Disaggregated APIs for SONiC Hosts
Apache License 2.0
77 stars 88 forks source link

terminate pipeline when action drop is encountered #585

Open mgheorghe opened 1 month ago

mgheorghe commented 1 month ago

i have a case with eni deny action, but i see BMv2 goes through all the stages irrespective , why is not exiting and dropping the packet right there. dash_ingress.eni_lookup_stage.deny

[20:01:38.109] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_ingress.accept -
[20:01:38.110] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_pipeline271 -
[20:01:38.110] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_ingress.direction_lookup_stage.set_inbound_direction -
[20:01:38.110] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is NoAction -
[20:01:38.110] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is eni_lookup31_0 -
[20:01:38.111] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is eni_lookup31_1 -
[20:01:38.111] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_ingress.eni_lookup_stage.deny -
[20:01:38.111] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is eni_lookup36 -
[20:01:38.111] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_pipeline287 -
[20:01:38.111] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_ingress.deny -
[20:01:38.111] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_pipeline296 -
[20:01:38.112] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is do_tunnel_decap -
[20:01:38.113] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_pipeline305 -
[20:01:38.114] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_pipeline315 -
[20:01:38.115] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_pipeline324 -
[20:01:38.115] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_ingress.set_eni_attrs - 0,0,0,1,0,dd010000,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
[20:01:38.117] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_pipeline337 -
[20:01:38.117] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is act -
[20:01:38.117] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is ha91 -
[20:01:38.118] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_ingress.set_acl_group_attrs - 0,
[20:01:38.118] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_pipeline352 -
[20:01:38.118] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is act_3 -
[20:01:38.118] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is push_vxlan_tunnel_u0 -
[20:01:38.120] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_inbound37 -
[20:01:38.120] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is NoAction -
[20:01:38.120] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is act_4 -
[20:01:38.121] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is routing_action_nat46l27 -
[20:01:38.121] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is act_5 -
[20:01:38.121] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is routing_action_nat64l23 -
[20:01:38.121] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is act_6 -
[20:01:38.121] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is routing_action_static_encap34 -
[20:01:38.121] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_pipeline363 -
[20:01:38.122] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is NoAction -
[20:01:38.122] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is metering_update83 -
[20:01:38.122] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is NoAction -
[20:01:38.122] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is NoAction -
[20:01:38.122] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is NoAction -
[20:01:38.122] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is NoAction -
[20:01:38.122] [bmv2] [D] [thread 25] [27604.0] [cxt 0] Action entry is dash_ingress.drop_action -
KrisNey-MSFT commented 3 weeks ago

Reason: Once we add the flow in the pipeline, then FastPath. If we have resimulation, the flow becomes invalid and needs to transit pipeline again. Get rid of the flow. Next packet will not hit a flow, transit pipeline, hit ACL, etc... this is needed to carry the drop decision all through the pipeline. The worry is that we may see a performance impact. @r12f can change the job function to move the Stage to the Pre-Action Stage.