linux/drivers/net/ethernet
Ong Boon Leong 132c32ee5b net: stmmac: Add TX via XDP zero-copy socket
We add the support of XDP ZC TX submission and cleaning into
stmmac_tx_clean(). The function is made to clean as many TX complete
frames as possible, i.e. limit by priv->dma_tx_size instead of NAPI
budget. For TX ring that is associated with XSK pool, the function
stmmac_xdp_xmit_zc() is introduced to TX frame buffers from XSK pool by
using xsk_tx_peek_desc(). To make stmmac_tx_clean() support the cleaning
of XSK TX frames, STMMAC_TXBUF_T_XSK_TX TX buffer type is introduced.

As stmmac_tx_clean() uses the return value to cue whether NAPI function
should continue to poll, we augment the caller of stmmac_tx_clean() to
pass NAPI budget instead of priv->dma_tx_size through 'budget' input and
made stmmac_tx_clean() to always clean up-to the TX ring size instead.
This allows us to use the return boolean status of stmmac_xdp_xmit_zc()
to decide if XSK TX work is done or not: If true, set 'xmits' to return
'budget - 1' so that NAPI poll may exit. Else, set 'xmits' to return
'budget' to make NAPI poll continue to poll since XSK TX work is not
done. Finally, at the end of stmmac_tx_clean(), the function now take
a maximum value between 'count' and 'xmits' so that status from both
TX cleaning and XSK TX (only for XDP ZC) is considered.

This patch adds a new NAPI poll called stmmac_napi_poll_rxtx() that is
meant to be enabled/disabled for RX and TX ring that are bound to XSK
pool. This NAPI poll function starts with cleaning TX ring, then submits
XSK TX frames to TX ring before proceed to perform RX operations, i.e.
, receiving RX frames and replenishing RX ring with RX free buffers
obtained from XSK pool. Therefore, during XSK RX and TX setup, the driver
enables stmmac_napi_poll_rxtx() for RX and TX operations, then during
XSK RX and TX pool tear-down, the driver reenables the exisiting
independent NAPI poll functions accordingly: stmmac_napi_poll_rx() and
stmmac_napi_poll_tx().

Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-13 15:06:51 -07:00
..
3com
8390
actions net: ethernet: actions: Add Actions Semi Owl Ethernet MAC driver 2021-03-22 12:56:21 -07:00
adaptec
aeroflex of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
agere
alacritech
allwinner of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
alteon
altera of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
amazon net: ena: remove extra words from comments 2021-03-31 14:34:08 -07:00
amd Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-04-09 20:48:35 -07:00
apm
apple
aquantia
arc of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
atheros of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
broadcom of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
brocade bna: Update driver to use ethtool_sprintf 2021-03-17 11:42:31 -07:00
cadence of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
calxeda
cavium of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
chelsio cxgb4: Fix unintentional sign extension issues 2021-04-12 13:13:17 -07:00
cirrus
cisco enic: use module_pci_driver to simplify the code 2021-04-07 15:15:01 -07:00
cortina
davicom of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dec tulip: de2104x: use module_pci_driver to simplify the code 2021-04-07 15:15:01 -07:00
dlink net: sundance: use module_pci_driver to simplify the code 2021-04-07 15:15:01 -07:00
emulex
ezchip of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
faraday Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-03-25 15:31:22 -07:00
freescale of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
fujitsu
google net: gve: remove duplicated allowed 2021-03-25 17:07:58 -07:00
hisilicon of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
huawei hinic: avoid gcc -Wrestrict warning 2021-03-24 18:00:32 -07:00
i825xx
ibm ibmvnic: queue reset work in system_long_wq 2021-04-13 14:56:23 -07:00
intel Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-04-09 20:48:35 -07:00
marvell of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
mediatek of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
mellanox net/mlx5: Add support for DSFP module EEPROM dumps 2021-04-11 16:34:56 -07:00
micrel of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
microchip of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
moxa net: moxa: remove redundant dev_err call in moxart_mac_probe() 2021-03-28 18:06:50 -07:00
mscc time64.h: Consolidated PSEC_PER_SEC definition 2021-04-06 16:32:17 -07:00
myricom ethernet: myri10ge: Fix a use after free in myri10ge_sw_tso 2021-03-29 13:41:17 -07:00
natsemi
neterion net: ethernet: neterion: Fix a typo in the file s2io.c 2021-03-15 12:48:20 -07:00
netronome Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-04-09 20:48:35 -07:00
ni
nvidia
nxp of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
oki-semi ptp_pch: Move 'pch_*()' prototypes to shared header 2021-03-12 17:09:34 -08:00
packetengines
pasemi
pensando ionic: git_ts_info bit shifters 2021-04-13 15:00:33 -07:00
qlogic qede: Use 'skb_add_rx_frag()' instead of hand coding it 2021-04-05 11:59:33 -07:00
qualcomm of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
rdc
realtek r8169: use mac-managed PHY PM 2021-04-09 16:37:05 -07:00
renesas of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
rocker
samsung of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
seeq
sfc sfc: Use 'skb_add_rx_frag()' instead of hand coding it 2021-04-05 11:55:44 -07:00
sgi
silan
sis
smsc net: smsc911x: skip acpi_device_id table when !CONFIG_ACPI 2021-04-05 15:05:02 -07:00
socionext of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
stmicro net: stmmac: Add TX via XDP zero-copy socket 2021-04-13 15:06:51 -07:00
sun Fix a typo 2021-03-18 19:46:19 -07:00
synopsys
tehuti
ti of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
toshiba net: toshiba: fix the trailing format of some block comments 2021-03-31 14:34:09 -07:00
tundra
via net: ethernet: Fix typo of 'network' in comment 2021-03-30 18:14:11 -07:00
wiznet of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
xilinx of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
xircom xircom: remove redundant error check on variable err 2021-04-07 14:48:32 -07:00
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
fealnx.c net: fealnx: use module_pci_driver to simplify the code 2021-04-07 15:15:02 -07:00
jme.c
jme.h
Kconfig net: ethernet: actions: Add Actions Semi Owl Ethernet MAC driver 2021-03-22 12:56:21 -07:00
korina.c
lantiq_etop.c
lantiq_xrx200.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
Makefile net: ethernet: actions: Add Actions Semi Owl Ethernet MAC driver 2021-03-22 12:56:21 -07:00