Files
linux/drivers/net/ethernet/intel/ice
Marcin Szycik 0960a27bd4 ice: Add direction metadata
Currently it is possible to create a filter which breaks TX traffic, e.g.:

tc filter add dev $PF1 ingress protocol ip prio 1 flower ip_proto udp
dst_port $PORT action mirred egress redirect dev $VF1_PR

This adds a rule which might match both TX and RX traffic, and in TX path
the PF will actually receive the traffic, which breaks communication.

To fix this, add a match on direction metadata flag when adding a tc rule.

Because of the way metadata is currently handled, a duplicate lookup word
would appear if VLAN metadata is also added. The lookup would still work
correctly, but one word would be wasted. To prevent it, lookup 0 now always
contains all metadata. When any metadata needs to be added, it is added to
lookup 0 and lookup count is not incremented. This way, two flags residing
in the same word will take up one word, instead of two.

Note: the drop action is also affected, i.e. it will now only work in one
direction.

Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2023-08-07 13:01:29 -07:00
..
2023-03-07 13:02:01 -08:00
2023-01-19 08:18:03 -08:00
2023-05-26 13:52:19 -07:00
2023-01-19 08:18:03 -08:00
2022-02-09 09:24:45 -08:00
2022-10-27 13:23:43 +02:00
2023-01-19 08:18:03 -08:00
2023-06-22 10:29:31 -07:00
2023-08-07 13:01:29 -07:00
2023-08-07 13:01:29 -07:00
2023-08-07 13:01:29 -07:00
2023-03-28 09:42:05 -07:00
2023-07-19 09:56:50 -07:00