OSDN Git Service

igc: Add support for XDP_REDIRECT action
authorAndre Guedes <andre.guedes@intel.com>
Wed, 10 Mar 2021 07:13:22 +0000 (23:13 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 29 Mar 2021 16:16:35 +0000 (09:16 -0700)
commit4ff3203610928cac82d5627ce803559e78d61b91
tree10381c413b124dd0ac69d33a4d00b2cd7ce0c3f9
parent73f1071c1d2952b8c93cd6cd99744768c59ec840
igc: Add support for XDP_REDIRECT action

Add support for the XDP_REDIRECT action which enables XDP programs to
redirect packets arriving at I225 NIC. It also implements the
ndo_xdp_xmit ops, enabling the igc driver to transmit packets forwarded
to it by xdp programs running on other interfaces.

The patch tweaks the driver's page counting and recycling scheme as
described in the following two commits and implemented by other Intel
drivers in order to properly support XDP_REDIRECT action:
  commit 8ce29c679a6e ("i40e: tweak page counting for XDP_REDIRECT")
  commit 75aab4e10ae6 ("i40e: avoid premature Rx buffer reuse")

This patch has been tested with the sample apps "xdp_redirect_cpu" and
"xdp_redirect_map" located in samples/bpf/.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igc/igc_main.c