bianbu-linux-6.6/drivers/net/ethernet/intel
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
..
e1000 e1000: Remove unnecessary use of kmap_atomic() 2022-11-02 11:09:13 -07:00
e1000e e1000e: Add @adapter description to kdoc 2023-05-18 09:11:32 -07:00
fm10k fm10k: Remove unnecessary aer.h include 2023-03-08 23:34:39 -08:00
i40e i40e: remove i40e_status 2023-07-31 14:37:25 -07:00
iavf net: flow_dissector: Use 64bits for used_keys 2023-07-31 09:11:24 +01:00
ice ice: Add direction metadata 2023-08-07 13:01:29 -07:00
igb net: flow_dissector: Use 64bits for used_keys 2023-07-31 09:11:24 +01:00
igbvf Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-03-24 10:10:20 -07:00
igc pull-request: bpf-next 2023-08-03 2023-08-03 15:34:36 -07:00
ixgbe vxlan: calculate correct header length for GPE 2023-07-24 09:37:32 +01:00
ixgbevf ixgbevf: Remove unused function declarations 2023-08-04 18:03:00 -07:00
e100.c e100: Fix possible use after free in e100_xmit_prepare 2022-11-23 08:38:22 -08:00
Kconfig ixgb: Remove ixgb driver 2023-03-19 10:51:07 +00:00
Makefile ixgb: Remove ixgb driver 2023-03-19 10:51:07 +00:00