WSL2-Linux-Kernel/Documentation/networking
David Arinzon a087d4b502 net: ena: Add dynamic recycling mechanism for rx buffers
[ Upstream commit f7d625adeb ]

The current implementation allocates page-sized rx buffers.
As traffic may consist of different types and sizes of packets,
in various cases, buffers are not fully used.

This change (Dynamic RX Buffers - DRB) uses part of the allocated rx
page needed for the incoming packet, and returns the rest of the
unused page to be used again as an rx buffer for future packets.
A threshold of 2K for unused space has been set in order to declare
whether the remainder of the page can be reused again as an rx buffer.

As a page may be reused, dma_sync_single_for_cpu() is added in order
to sync the memory to the CPU side after it was owned by the HW.
In addition, when the rx page can no longer be reused, it is being
unmapped using dma_page_unmap(), which implicitly syncs and then
unmaps the entire page. In case the kernel still handles the skbs
pointing to the previous buffers from that rx page, it may access
garbage pointers, caused by the implicit sync overwriting them.
The implicit dma sync is removed by replacing dma_page_unmap() with
dma_unmap_page_attrs() with DMA_ATTR_SKIP_CPU_SYNC flag.

The functionality is disabled for XDP traffic to avoid handling
several descriptors per packet.

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: David Arinzon <darinzon@amazon.com>
Link: https://lore.kernel.org/r/20230612121448.28829-1-darinzon@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 2dc8b1e7177d ("net: ena: Fix redundant device NUMA node override")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-16 13:39:52 +02:00
..
caif tty: cumulate and document tty_struct::flow* members 2021-05-13 16:57:16 +02:00
device_drivers net: ena: Add dynamic recycling mechanism for rx buffers 2024-06-16 13:39:52 +02:00
devlink ice: Print the api_patch as part of the fw.mgmt.api 2021-10-14 10:14:46 -07:00
dsa docs: net: dsa: sja1105: fix reference to sja1105.txt 2021-09-19 12:45:03 +01:00
mac80211_hwsim
6lowpan.rst
6pack.rst
af_xdp.rst xsk: Honor SO_BINDTODEVICE on bind 2023-07-23 13:47:29 +02:00
alias.rst
arcnet-hardware.rst
arcnet.rst
atm.rst
ax25.rst
bareudp.rst
batman-adv.rst batman-adv: Move IRC channel to hackint.org 2021-08-08 20:05:46 +02:00
bonding.rst Bonding: add arp_missed_max option 2023-06-05 09:21:19 +02:00
bridge.rst
can.rst can: add a note that RECV_OWN_MSGS frames are subject to filtering 2021-04-24 14:36:51 +02:00
can_ucan_protocol.rst
cdc_mbim.rst
checksum-offloads.rst
dccp.rst
dctcp.rst
dns_resolver.rst
driver.rst
eql.rst
ethtool-netlink.rst ethtool: add two coalesce attributes for CQE mode 2021-08-24 07:38:28 -07:00
failover.rst
fib_trie.rst
filter.rst bpf: Refactor BPF_PROG_RUN into a function 2021-08-17 00:45:07 +02:00
gen_stats.rst
generic-hdlc.rst
generic_netlink.rst
gtp.rst
ieee802154.rst docs: net: ieee802154.rst: fix C expressions 2020-10-15 07:49:41 +02:00
ila.rst
index.rst Remove DECnet support from kernel 2023-06-21 15:59:15 +02:00
ioam6-sysctl.rst ipv6: ioam: Documentation for new IOAM sysctls 2021-07-21 08:14:33 -07:00
ip-sysctl.rst net: change accept_ra_min_rtr_lft to affect all RA lifetimes 2023-10-19 23:05:35 +02:00
ip_dynaddr.rst
ipddp.rst
ipsec.rst
ipv6.rst
ipvlan.rst
ipvs-sysctl.rst netfilter: ipvs: Fix reuse connection if RS weight is 0 2021-12-01 09:04:45 +01:00
j1939.rst can: j1939: add tables for the CAN identifier and its fields 2020-11-20 09:43:29 +01:00
kapi.rst wimax: move out to staging 2020-10-29 19:27:45 +01:00
kcm.rst
l2tp.rst
lapb-module.rst
mac80211-auth-assoc-deauth.txt
mac80211-injection.rst
mctp.rst mctp: unify sockaddr_mctp types 2021-10-18 13:47:09 +01:00
mpls-sysctl.rst
mptcp-sysctl.rst mptcp: faster active backup recovery 2021-08-14 11:37:25 +01:00
msg_zerocopy.rst
multiqueue.rst
net_dim.rst
net_failover.rst
netconsole.rst
netdev-FAQ.rst docs: networking: netdevsim rules 2021-08-04 12:43:27 +01:00
netdev-features.rst net: hsr: add offloading support 2021-02-11 13:24:44 -08:00
netdevices.rst net: bonding: move ioctl handling to private ndo operation 2021-07-27 20:11:45 +01:00
netfilter-sysctl.rst
netif-msg.rst
nexthop-group-resilient.rst Documentation: net: Document resilient next-hop groups 2021-03-29 13:51:38 -07:00
nf_conntrack-sysctl.rst Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf 2021-09-03 16:20:37 -07:00
nf_flowtable.rst docs: nf_flowtable: fix compilation and warnings 2021-03-25 17:42:02 -07:00
nfc.rst
openvswitch.rst
operstates.rst docs: operstates: document IF_OPER_TESTING 2021-08-02 15:16:04 +01:00
packet_mmap.rst docs: networking: Replace strncpy() with strscpy() 2021-06-04 11:21:43 -06:00
page_pool.rst net: page_pool: Add page_pool_put_page_bulk() to page_pool.rst 2020-11-24 14:56:54 -08:00
phonet.rst
phy.rst net: phy: Add 25G BASE-R interface mode 2021-06-12 13:08:57 -07:00
pktgen.rst pktgen: document the latest pktgen usage options 2021-08-25 13:44:30 +01:00
plip.rst
ppp_generic.rst docs: update ppp_generic.rst to document new ioctls 2020-12-10 13:57:36 -08:00
proc_net_tcp.rst
radiotap-headers.rst
rds.rst
regulatory.rst
rxrpc.rst
scaling.rst docs: networking: update XPS to account for netif_set_xps_queue 2020-10-13 16:21:54 -07:00
sctp.rst
secid.rst
seg6-sysctl.rst doc: move seg6_flowlabel to seg6-sysctl.rst 2021-04-14 13:13:15 -07:00
segmentation-offloads.rst
sfp-phylink.rst net: mdio: Remove of_phy_attach() 2021-02-17 13:17:49 -08:00
snmp_counter.rst net-next: docs: Fix typos in snmp_counter.rst 2021-01-05 17:07:38 -08:00
statistics.rst docs: networking: extend the statistics documentation 2021-04-16 16:59:20 -07:00
strparser.rst
switchdev.rst Documentation: networking: switchdev: add missing "and" word 2021-03-17 12:34:34 -07:00
sysfs-tagging.rst Documentation: better locations for sysfs-pci, sysfs-tagging 2020-10-09 09:33:23 -06:00
tc-actions-env-rules.rst
tcp-thin.rst
team.rst
timestamping.rst dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
tipc.rst Documentation: add more details in tipc.rst 2021-07-01 13:18:18 -07:00
tls-offload-layers.svg
tls-offload-reorder-bad.svg
tls-offload-reorder-good.svg
tls-offload.rst net: Disable NETIF_F_HW_TLS_RX when RXCSUM is disabled 2021-01-19 15:58:05 -08:00
tls.rst
tproxy.rst
tuntap.rst docs: networking: Replace strncpy() with strscpy() 2021-06-04 11:21:43 -06:00
udplite.rst
vrf.rst doc: Document unexpected tcp_l3mdev_accept=1 behavior 2021-08-23 11:53:24 +01:00
vxlan.rst docs: vxlan: add info about device features 2020-09-28 12:50:12 -07:00
x25-iface.rst net: x25: Queue received packets in the drivers instead of per-CPU queues 2021-04-05 11:42:12 -07:00
x25.rst net: x25: Remove unimplemented X.25-over-LLC code stubs 2020-12-12 17:15:33 -08:00
xfrm_device.rst docs: networking: Fix a typo 2021-03-20 19:02:42 -07:00
xfrm_proc.rst
xfrm_sync.rst
xfrm_sysctl.rst