+                       switch (act) {
+                       case XDP_PASS:
+                               break;
+                       default:
+                               bpf_warn_invalid_xdp_action(act);
+                       case XDP_DROP:
+                               goto next;
+                       }
+               }

(probably a nit too, but wanted to make sure we don't miss something
here) is the default case preceding the DROP one in purpose? any
special reason to do that?
This is intentional, and legal though unconventional C. Without this
order, the later patches end up with a bit too much copy/paste for my
liking, as in:

case XDP_DROP:
         if (mlx4_en_rx_recycle(ring, frags))
                 goto consumed;
         goto next;
default:
         bpf_warn_invalid_xdp_action(act);
         if (mlx4_en_rx_recycle(ring, frags))
                 goto consumed;
         goto next;
The more critical issue here is the default action. All packets that get unknown/unsupported filter classification will be dropped. I think the XDP_PASS is the better choice here as default action, there are good reasons why it should be, as Jesper already explained in replies to other patch in the series.

Regards,
Tariq

Reply via email to