1
0
Fork 0
alistair23-linux/drivers/net
Jason A. Donenfeld dcfea72e79 net: introduce skb_list_walk_safe for skb segment walking
As part of the continual effort to remove direct usage of skb->next and
skb->prev, this patch adds a helper for iterating through the
singly-linked variant of skb lists, which are used for lists of GSO
packet. The name "skb_list_..." has been chosen to match the existing
function, "kfree_skb_list, which also operates on these singly-linked
lists, and the "..._walk_safe" part is the same idiom as elsewhere in
the kernel.

This patch removes the helper from wireguard and puts it into
linux/skbuff.h, while making it a bit more robust for general usage. In
particular, parenthesis are added around the macro argument usage, and it
now accounts for trying to iterate through an already-null skb pointer,
which will simply run the iteration zero times. This latter enhancement
means it can be used to replace both do { ... } while and while (...)
open-coded idioms.

This should take care of these three possible usages, which match all
current methods of iterations.

skb_list_walk_safe(segs, skb, next) { ... }
skb_list_walk_safe(skb, skb, next) { ... }
skb_list_walk_safe(segs, skb, segs) { ... }

Gcc appears to generate efficient code for each of these.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-08 15:19:54 -08:00
..
appletalk netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
arcnet netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
bonding bonding: rename AD_STATE_* to LACP_STATE_* 2019-12-26 13:09:37 -08:00
caif net: caif: replace BUG_ON with recovery code 2019-12-16 16:29:05 -08:00
can can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices 2019-12-08 12:22:01 +01:00
dsa net: dsa: mv88e6xxx: Unique ATU and VTU IRQ names 2020-01-06 18:30:15 -08:00
ethernet sfc: move common tx code 2020-01-08 13:28:03 -08:00
fddi
fjes Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 15:15:05 -08:00
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 15:15:05 -08:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 09:54:33 -08:00
ieee802154 drivers: net: Fix Kconfig indentation, continued 2019-11-21 11:54:09 -08:00
ipvlan Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-02 13:54:56 -07:00
netdevsim ipv6: Remove old route notifications and convert listeners 2019-12-24 22:37:30 -08:00
phy net: phylink: add support for polling MAC PCS 2020-01-05 23:22:32 -08:00
plip
ppp ppp: Remove redundant BUG_ON() check in ppp_pernet 2019-12-27 16:30:52 -08:00
slip netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
team Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-02 13:54:56 -07:00
usb net: ch9200: remove unnecessary return 2020-01-07 13:30:36 -08:00
vmxnet3 netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
wan drivers: net: cisco_hdlc: use __func__ in debug message 2020-01-07 13:33:35 -08:00
wimax netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
wireguard net: introduce skb_list_walk_safe for skb segment walking 2020-01-08 15:19:54 -08:00
wireless wil6210: get rid of begin() and complete() ethtool_ops 2020-01-06 13:54:55 -08:00
xen-netback xen-netback: support dynamic unbind/bind 2019-12-26 15:16:26 -08:00
Kconfig wireguard: Kconfig: select parent dependency for crypto 2019-12-16 19:22:22 -08:00
LICENSE.SRC
Makefile net: WireGuard secure network tunnel 2019-12-08 17:48:42 -08:00
Space.c
dummy.c net: dummy: use standard dev_lstats_add() and dev_lstats_read() 2019-11-07 20:03:08 -08:00
eql.c
geneve.c treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
gtp.c gtp: simplify error handling code in 'gtp_encap_enable()' 2020-01-06 13:39:35 -08:00
ifb.c
loopback.c net: use u64_stats_t in struct pcpu_lstats 2019-11-07 20:03:08 -08:00
macsec.c
macvlan.c net: macvlan: Use the PHY time stamping interface. 2019-12-25 19:51:33 -08:00
macvtap.c
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c net: nlmon: use standard dev_lstats_add() and dev_lstats_read() 2019-11-07 20:03:08 -08:00
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: fix data-race in gro_normal_list() 2019-11-15 12:46:49 -08:00
veth.c veth: use standard dev_lstats_add() and dev_lstats_read() 2019-11-07 20:03:08 -08:00
virtio_net.c bpf: Convert bpf_prog refcnt to atomic64_t 2019-11-18 11:41:59 +01:00
vrf.c
vsockmon.c vsockmon: use standard dev_lstats_add() and dev_lstats_read() 2019-11-07 20:03:08 -08:00
vxlan.c vxlan: Fix alignment and code style of vxlan.c 2020-01-02 15:41:33 -08:00
xen-netfront.c