[PATCH net] gro: fix napi_gro_frags() Fast GRO breakage due to IP alignment check

2021-04-18 Thread Alexander Lobakin
st GRO for napi_gro_frags() that became very slow after the mentioned commit, and preserves the introduced check to avoid silent unaligned accesses. Fixes: 38ec4944b593 ("gro: ensure frag0 meets IP header alignment") Signed-off-by: Alexander Lobakin --- net/core/dev.c | 8 1 file changed

Re: [PATCH v2 bpf-next 0/2] xsk: introduce generic almost-zerocopy xmit

2021-04-18 Thread Alexander Lobakin
2021 16:13:12 +0200, Magnus Karlsson > > wrote: > > > On Wed, Mar 31, 2021 at 2:27 PM Alexander Lobakin wrote: > > > > > > > > This series is based on the exceptional generic zerocopy xmit logics > > > > initially introduced by Xuan Zhuo. It extend

Re: [PATCH net] gro: fix napi_gro_frags() Fast GRO breakage due to IP alignment check

2021-04-19 Thread Alexander Lobakin
From: Eric Dumazet Date: Mon, 19 Apr 2021 13:05:16 +0200 > On Sun, Apr 18, 2021 at 1:43 PM Alexander Lobakin wrote: > > > > Commit 38ec4944b593 ("gro: ensure frag0 meets IP header alignment") > > did the right thing, but missed the fact that napi_g

[PATCH v2 net] gro: fix napi_gro_frags() Fast GRO breakage due to IP alignment check

2021-04-19 Thread Alexander Lobakin
iewed-by from Eric. [0] https://lore.kernel.org/netdev/20210418114200.5839-1-aloba...@pm.me Fixes: 38ec4944b593 ("gro: ensure frag0 meets IP header alignment") Reviewed-by: Eric Dumazet Signed-off-by: Alexander Lobakin --- net/core/dev.c | 8 1 file changed, 4 insertions(+

Re: [PATCH vhost 1/6] virtio_ring: introduce dma map api for page

2024-04-11 Thread Alexander Lobakin
From: Xuan Zhuo Date: Thu, 11 Apr 2024 10:51:22 +0800 > The virtio-net big mode sq will use these APIs to map the pages. > > dma_addr_t virtqueue_dma_map_page_attrs(struct virtqueue *_vq, struct page > *page, >size_t offset, size_t size, >

Re: [PATCH net] virtio-net: fix overflow inside virtnet_rq_alloc

2024-08-20 Thread Alexander Lobakin
From: Xuan Zhuo Date: Tue, 20 Aug 2024 15:19:13 +0800 > leads to regression on VM with the sysctl value of: Where's the beginning of the sentence? You mean, "This overflow leads"? > > - net.core.high_order_alloc_disable=1 This `- ` can be removed - at least some syntax highlighters color it i

Re: [PATCH net-next 0/5] skbuff: introduce skbuff_heads bulking and reusing

2021-01-12 Thread Alexander Lobakin
From: Eric Dumazet Date: Tue, 12 Jan 2021 13:32:56 +0100 > On Tue, Jan 12, 2021 at 11:56 AM Alexander Lobakin wrote: >> > >> >> Ah, I should've mentioned that I use UDP GRO Fraglists, so these >> numbers are for GRO. >> > > Right, this suggests

[PATCH net-next] udp: allow forwarding of plain (non-fraglisted) UDP GRO packets

2021-01-12 Thread Alexander Lobakin
an fraglisted UDP GRO in some cases due to not wasting one skbuff_head per every segment. Signed-off-by: Alexander Lobakin --- net/ipv4/udp_offload.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index ff39e94781bf..9d71df

RE: [PATCH net-next] udp: allow forwarding of plain (non-fraglisted) UDP GRO packets

2021-01-13 Thread Alexander Lobakin
From: "'Alexander Lobakin'" From: Dongseok Yi" Date: Wed, 13 Jan 2021 12:59:45 +0900 > On 2021-01-13 12:10, Alexander Duyck wrote: >> On 1/12/21 1:16 PM, Alexander Lobakin wrote: >>> Commit 9fd1ff5d2ac7 ("udp: Support UDP fraglist GRO/GSO.")

[PATCH v2 net-next] udp: allow forwarding of plain (non-fraglisted) UDP GRO packets

2021-01-13 Thread Alexander Lobakin
very segment. Since v1 [0]: - drop redundant 'if (sk)' check (Alexander Duyck); - add a ref in the commit message to one more commit that was an important step for UDP GRO forwarding. [0] https://lore.kernel.org/netdev/20210112211536.261172-1-aloba...@pm.me Signed-off-by:

[PATCH v2 net-next 0/3] skbuff: introduce skbuff_heads reusing and bulking

2021-01-13 Thread Alexander Lobakin
Alexander Lobakin (3): skbuff: open-code __build_skb() inside __napi_alloc_skb() skbuff: (re)use NAPI skb cache on allocation path skbuff: recycle GRO_MERGED_FREE skbs into NAPI skb cache include/linux/skbuff.h | 1 + net/core/dev.c | 9 + net/core/skbuff.c | 74

[PATCH v2 net-next 2/3] skbuff: (re)use NAPI skb cache on allocation path

2021-01-13 Thread Alexander Lobakin
it's full on skb consuming, bulk-wipe the second half. Also try to balance its size after completing network softirqs (__kfree_skb_flush()). prefetchw() on CONFIG_SLUB is dropped since it makes no sense anymore. Suggested-by: Edward Cree Signed-off-by: Alexander Lobakin --- net/core/skb

[PATCH v2 net-next 3/3] skbuff: recycle GRO_MERGED_FREE skbs into NAPI skb cache

2021-01-13 Thread Alexander Lobakin
. Signed-off-by: Alexander Lobakin --- include/linux/skbuff.h | 1 + net/core/dev.c | 9 + net/core/skbuff.c | 12 +--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 7a057b1f1eb8..507f1598e446

[PATCH v2 net-next 1/3] skbuff: open-code __build_skb() inside __napi_alloc_skb()

2021-01-13 Thread Alexander Lobakin
: Alexander Lobakin --- net/core/skbuff.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 7626a33cce59..dc3300dc2ac4 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -485,6 +485,11 @@ struct sk_buff *__netdev_alloc_skb

Re: [PATCH v2 net-next] udp: allow forwarding of plain (non-fraglisted) UDP GRO packets

2021-01-14 Thread Alexander Lobakin
From: Paolo Abeni Date: Wed, 13 Jan 2021 19:37:18 +0100 > On Wed, 2021-01-13 at 10:32 +0000, Alexander Lobakin wrote: >> Commit 9fd1ff5d2ac7 ("udp: Support UDP fraglist GRO/GSO.") actually >> not only added a support for fraglisted UDP GRO, but also tweaked >&g

Re: [PATCH v2 net-next 2/3] skbuff: (re)use NAPI skb cache on allocation path

2021-01-14 Thread Alexander Lobakin
From: Eric Dumazet Date: Wed, 13 Jan 2021 15:36:05 +0100 > On Wed, Jan 13, 2021 at 2:37 PM Alexander Lobakin wrote: >> >> Instead of calling kmem_cache_alloc() every time when building a NAPI >> skb, (re)use skbuff_heads from napi_alloc_cache.skb_cache. Previously >&g

Re: [PATCH v2 net-next 2/3] skbuff: (re)use NAPI skb cache on allocation path

2021-01-14 Thread Alexander Lobakin
From: Dmitry Vyukov Date: Thu, 14 Jan 2021 12:47:31 +0100 > On Thu, Jan 14, 2021 at 12:41 PM Alexander Lobakin wrote: >> >> From: Eric Dumazet >> Date: Wed, 13 Jan 2021 15:36:05 +0100 >> >>> On Wed, Jan 13, 2021 at 2:37 PM Alexander Lobakin wrote: >>&

Re: [PATCH v2 net-next 2/3] skbuff: (re)use NAPI skb cache on allocation path

2021-01-14 Thread Alexander Lobakin
From: Dmitry Vyukov Date: Thu, 14 Jan 2021 13:50:25 +0100 > On Thu, Jan 14, 2021 at 1:44 PM Alexander Lobakin wrote: >> >> From: Dmitry Vyukov >> Date: Thu, 14 Jan 2021 12:47:31 +0100 >> >>> On Thu, Jan 14, 2021 at 12:41 PM Alexander Lobakin wrote: >>

Re: [PATCH v2 net-next 2/3] skbuff: (re)use NAPI skb cache on allocation path

2021-01-14 Thread Alexander Lobakin
From: Dmitry Vyukov Date: Thu, 14 Jan 2021 13:51:44 +0100 > On Thu, Jan 14, 2021 at 1:50 PM Dmitry Vyukov wrote: >> >> On Thu, Jan 14, 2021 at 1:44 PM Alexander Lobakin wrote: >>> >>> From: Dmitry Vyukov >>> Date: Thu, 14 Jan 2021 12:47:31 +0100

[PATCH net] skbuff: back tiny skbs with kmalloc() in __netdev_alloc_skb() too

2021-01-14 Thread Alexander Lobakin
ed manually via __netdev_alloc_skb(), where the check for size hasn't been changed. Mirror the condition from __napi_alloc_skb() to prevent from that. Fixes: 3226b158e67c ("net: avoid 32 x truesize under-estimation for tiny skbs") Signed-off-by: Alexander Lobakin --- net/core/skbuff.c | 6 +-

Re: [PATCH net] udp: ipv4: manipulate network header of NATed UDP GRO fraglist

2021-01-15 Thread Alexander Lobakin
From: Steffen Klassert Date: Fri, 15 Jan 2021 10:27:52 +0100 > On Fri, Jan 15, 2021 at 05:55:22PM +0900, Dongseok Yi wrote: >> On 2021-01-15 17:12, Steffen Klassert wrote: >>> On Fri, Jan 15, 2021 at 02:58:24PM +0900, Dongseok Yi wrote: UDP/IP header of UDP GROed frag_skbs are not updated ev

RE: [PATCH net] udp: ipv4: manipulate network header of NATed UDP GRO fraglist

2021-01-15 Thread Alexander Lobakin
From: Dongseok Yi Date: Fri, 15 Jan 2021 20:21:06 +0900 > On 2021-01-15 19:51, Alexander Lobakin wrote: >> From: Steffen Klassert >> Date: Fri, 15 Jan 2021 10:27:52 +0100 >> >>> On Fri, Jan 15, 2021 at 05:55:22PM +0900, Dongseok Yi wrote: >>>> O

Re: [PATCH net] skbuff: back tiny skbs with kmalloc() in __netdev_alloc_skb() too

2021-01-15 Thread Alexander Lobakin
From: Eric Dumazet Date: Fri, 15 Jan 2021 15:28:37 +0100 > On Fri, Jan 15, 2021 at 12:55 AM Alexander Lobakin wrote: >> >> Commit 3226b158e67c ("net: avoid 32 x truesize under-estimation for >> tiny skbs") ensured that skbs with data size lower than 1025 bytes

[PATCH v2 net] skbuff: back tiny skbs with kmalloc() in __netdev_alloc_skb() too

2021-01-15 Thread Alexander Lobakin
to handle this case too. Since v1 [0]: - fix "Fixes:" tag; - refine commit message (mention copybreak usecase). [0] https://lore.kernel.org/netdev/20210114235423.232737-1-aloba...@pm.me Fixes: a1c7fff7e18f ("net: netdev_alloc_skb() use build_skb()") Signed-off-by: Alexander

Re: [PATCH net v2] udp: ipv4: manipulate network header of NATed UDP GRO fraglist

2021-01-15 Thread Alexander Lobakin
/ > I was trying to write a quick fix, but it was not easy to forward > segmented list. Currently, assuming DNAT only. > > v2: > Per Steffen Klassert request, move the procedure from > udp4_ufo_fragment to __udp_gso_segment_list and support SNAT. > > To Alexander Lobakin, I'v

[PATCH net-next] mdio, phy: fix -Wshadow warnings triggered by nested container_of()

2021-01-16 Thread Alexander Lobakin
rom linux/{mdio,phy}.h to static inlines to avoid self-shadowing and potentially improve bug-catching. No functional changes implied. Signed-off-by: Alexander Lobakin --- include/linux/mdio.h | 23 ++- include/linux/phy.h | 7 +-- 2 files changed, 23 insertions(+), 7 d

Re: [PATCH net v2] udp: ipv4: manipulate network header of NATed UDP GRO fraglist

2021-01-18 Thread Alexander Lobakin
> From: Steffen Klassert > Date: Mon, 18 Jan 2021 07:37:59 +0100 > > On Fri, Jan 15, 2021 at 05:12:33PM +0000, Alexander Lobakin wrote: >> From: Dongseok Yi >> Date: Fri, 15 Jan 2021 22:20:35 +0900 >> >>> UDP/IP header of UDP GROed frag_skbs are not upda

Re: [PATCH bpf-next] xsk: build skb by page

2021-01-18 Thread Alexander Lobakin
From: Xuan Zhuo Date: Sat, 16 Jan 2021 10:44:53 +0800 > This patch is used to construct skb based on page to save memory copy > overhead. > > This has one problem: > > We construct the skb by fill the data page as a frag into the skb. In > this way, the linear space is empty, and the header inf

Re: [PATCH bpf-next] xsk: build skb by page

2021-01-18 Thread Alexander Lobakin
From: Yunsheng Lin Date: Mon, 18 Jan 2021 20:40:52 +0800 > On 2021/1/16 10:44, Xuan Zhuo wrote: >> This patch is used to construct skb based on page to save memory copy >> overhead. >> >> This has one problem: >> >> We construct the skb by fill the data page as a frag into the skb. In >> this way

Re: [PATCH bpf-next] xsk: build skb by page

2021-01-18 Thread Alexander Lobakin
From: Alexander Lobakin Date: Mon, 18 Jan 2021 13:00:17 + > From: Yunsheng Lin > Date: Mon, 18 Jan 2021 20:40:52 +0800 > >> On 2021/1/16 10:44, Xuan Zhuo wrote: >>> This patch is used to construct skb based on page to save memory copy >>> overhead. >>

Re: [PATCH bpf-next] xsk: build skb by page

2021-01-18 Thread Alexander Lobakin
> From: Magnus Karlsson > Date: Mon, 18 Jan 2021 16:10:40 +0100 > > On Mon, Jan 18, 2021 at 3:47 PM Alexander Lobakin wrote: > > > > From: Alexander Lobakin > > Date: Mon, 18 Jan 2021 13:00:17 + > > > > > From: Yunsheng Lin > > > Date

[PATCH net-next 0/2] udp: allow forwarding of plain (non-fraglisted) UDP GRO packets

2021-01-18 Thread Alexander Lobakin
or UDP GRO forwarding. [0] https://lore.kernel.org/netdev/20210112211536.261172-1-aloba...@pm.me [1] https://lore.kernel.org/netdev/20210113103232.4761-1-aloba...@pm.me Alexander Lobakin (2): net: introduce UDP GRO netdev feature udp: allow forwarding of plain (non-fraglisted) UDP GRO packets

[PATCH net-next 2/2] udp: allow forwarding of plain (non-fraglisted) UDP GRO packets

2021-01-18 Thread Alexander Lobakin
orwarding path, and the new NETIF_F_GRO_UDP is enabled on a receiving netdevice. Note that fraglisted UDP GRO now also depends on this feature, as NETIF_F_GRO_FRAGLIST isn't tied to any particular L4 protocol. Signed-off-by: Alexander Lobakin --- net/ipv4/udp_offload.c | 16 +++- 1

[PATCH net-next 1/2] net: introduce UDP GRO netdev feature

2021-01-18 Thread Alexander Lobakin
Introduce a new netdev_feature, NETIF_F_GRO_UDP, to allow user to turn UDP GRO on and off when there is no socket, e.g. when forwarding. Defaults to off to not change current datapath. Suggested-by: Paolo Abeni Signed-off-by: Alexander Lobakin --- include/linux/netdev_features.h | 4 +++- net

Re: [PATCH bpf-next] xsk: build skb by page

2021-01-19 Thread Alexander Lobakin
From: Xuan Zhuo Date: Sat, 16 Jan 2021 10:44:53 +0800 > This patch is used to construct skb based on page to save memory copy > overhead. > > This has one problem: > > We construct the skb by fill the data page as a frag into the skb. In > this way, the linear space is empty, and the header inf

Re: [PATCH bpf-next v2 3/3] xsk: build skb by page

2021-01-19 Thread Alexander Lobakin
From: Xuan Zhuo Date: Tue, 19 Jan 2021 17:45:12 +0800 > This patch is used to construct skb based on page to save memory copy > overhead. > > This function is implemented based on IFF_TX_SKB_NO_LINEAR. Only the > network card priv_flags supports IFF_TX_SKB_NO_LINEAR will use page to > directly c

Re: [PATCH bpf-next v2 2/3] virtio-net: support IFF_TX_SKB_NO_LINEAR

2021-01-19 Thread Alexander Lobakin
From: Xuan Zhuo Date: Tue, 19 Jan 2021 17:45:11 +0800 > Virtio net supports the case where the skb linear space is empty, so add > priv_flags. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio_net.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/v

Re: [PATCH net-next v2 3/3] xsk: build skb by page

2021-01-20 Thread Alexander Lobakin
From: Xuan Zhuo Date: Wed, 20 Jan 2021 16:30:56 +0800 > This patch is used to construct skb based on page to save memory copy > overhead. > > This function is implemented based on IFF_TX_SKB_NO_LINEAR. Only the > network card priv_flags supports IFF_TX_SKB_NO_LINEAR will use page to > directly c

Re: [PATCH bpf-next v3 1/3] net: add priv_flags for allow tx skb without linear

2021-01-21 Thread Alexander Lobakin
0 00 00 00 00 00 00 00 00 > mlx5_core :3b:00.1 eth1: ERR CQE on SQ: 0x1dbb > > So a priv_flag is added here to indicate whether the network card > supports this feature. > > Signed-off-by: Xuan Zhuo > Suggested-by: Alexander Lobakin Acked-by: Alexander Lobakin

Re: [PATCH net-next 2/2] udp: allow forwarding of plain (non-fraglisted) UDP GRO packets

2021-01-22 Thread Alexander Lobakin
From: Willem de Bruijn Date: Thu, 21 Jan 2021 21:47:47 -0500 > On Mon, Jan 18, 2021 at 2:33 PM Alexander Lobakin wrote: > > > > Commit 9fd1ff5d2ac7 ("udp: Support UDP fraglist GRO/GSO.") actually > > not only added a support for fraglisted UDP GRO, but also tweak

Re: [PATCH bpf-next v3 3/3] xsk: build skb by page

2021-01-22 Thread Alexander Lobakin
From: Eric Dumazet Date: Thu, 21 Jan 2021 16:41:33 +0100 > On 1/21/21 2:47 PM, Xuan Zhuo wrote: > > This patch is used to construct skb based on page to save memory copy > > overhead. > > > > This function is implemented based on IFF_TX_SKB_NO_LINEAR. Only the > > network card priv_flags support

Re: [PATCH bpf-next v3 3/3] xsk: build skb by page

2021-01-22 Thread Alexander Lobakin
From: Alexander Lobakin Date: Fri, 22 Jan 2021 11:47:45 + > From: Eric Dumazet > Date: Thu, 21 Jan 2021 16:41:33 +0100 > > > On 1/21/21 2:47 PM, Xuan Zhuo wrote: > > > This patch is used to construct skb based on page to save memory copy > > > overhe

Re: [PATCH bpf-next v3 3/3] xsk: build skb by page

2021-01-22 Thread Alexander Lobakin
From: Alexander Lobakin Date: Fri, 22 Jan 2021 11:55:35 + > From: Alexander Lobakin > Date: Fri, 22 Jan 2021 11:47:45 + > > > From: Eric Dumazet > > Date: Thu, 21 Jan 2021 16:41:33 +0100 > > > > > On 1/21/21 2:47 PM, Xuan Zhuo wrote: > > >

Re: [PATCH bpf-next v3 3/3] xsk: build skb by page

2021-01-22 Thread Alexander Lobakin
From: Magnus Karlsson Date: Fri, 22 Jan 2021 13:18:47 +0100 > On Fri, Jan 22, 2021 at 12:57 PM Alexander Lobakin wrote: > > > > From: Alexander Lobakin > > Date: Fri, 22 Jan 2021 11:47:45 + > > > > > From: Eric Dumazet > > > Date: Thu, 21 Jan 2

Re: [PATCH bpf-next v3 3/3] xsk: build skb by page

2021-01-22 Thread Alexander Lobakin
From: Xuan Zhuo Date: Fri, 22 Jan 2021 23:36:29 +0800 > On Fri, 22 Jan 2021 12:08:00 +0000, Alexander Lobakin wrote: > > From: Alexander Lobakin > > Date: Fri, 22 Jan 2021 11:55:35 + > > > > > From: Alexander Lobakin > > > Date: Fri, 22 Jan 2021

Re: [PATCH bpf-next v3 3/3] xsk: build skb by page

2021-01-22 Thread Alexander Lobakin
From: Xuan Zhuo Date: Fri, 22 Jan 2021 23:39:15 +0800 > On Fri, 22 Jan 2021 13:55:14 +0100, Magnus Karlsson > wrote: > > On Fri, Jan 22, 2021 at 1:39 PM Alexander Lobakin wrote: > > > > > > From: Magnus Karlsson > > > Date: Fri, 22 Jan 2021 13:18:47 +

Re: [PATCH bpf-next v3 3/3] xsk: build skb by page

2021-01-22 Thread Alexander Lobakin
From: Magnus Karlsson Date: Fri, 22 Jan 2021 19:37:06 +0100 > On Fri, Jan 22, 2021 at 6:26 PM Alexander Lobakin wrote: > > > > From: Xuan Zhuo > > Date: Fri, 22 Jan 2021 23:39:15 +0800 > > > > > On Fri, 22 Jan 2021 13:55:14 +0100, Magnus Karlsson > >

[PATCH v4 net-next 2/2] udp: allow forwarding of plain (non-fraglisted) UDP GRO packets

2021-01-22 Thread Alexander Lobakin
ence. This keeps the current behaviour and is generally more optimal for now, as the number of NICs with hardware USO offload is relatively small. Signed-off-by: Alexander Lobakin --- net/ipv4/udp_offload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/udp_

[PATCH v4 net-next 1/2] net: introduce a netdev feature for UDP GRO forwarding

2021-01-22 Thread Alexander Lobakin
Introduce a new netdev feature, NETIF_F_GRO_UDP_FWD, to allow user to turn UDP GRO on and off for forwarding. Defaults to off to not change current datapath. Suggested-by: Paolo Abeni Signed-off-by: Alexander Lobakin --- include/linux/netdev_features.h | 4 +++- net/ethtool/common.c

[PATCH v4 net-next 0/2] udp: allow forwarding of plain (non-fraglisted) UDP GRO packets

2021-01-22 Thread Alexander Lobakin
forwarding. [0] https://lore.kernel.org/netdev/20210112211536.261172-1-aloba...@pm.me [1] https://lore.kernel.org/netdev/20210113103232.4761-1-aloba...@pm.me [2] https://lore.kernel.org/netdev/20210118193122.87271-1-aloba...@pm.me Alexander Lobakin (2): net: introduce a netdev feature for UDP

Re: [PATCH v5 net-next 09/11] skbuff: allow to optionally use NAPI cache from __alloc_skb()

2021-02-13 Thread Alexander Lobakin
From: Alexander Duyck Date: Thu, 11 Feb 2021 19:18:45 -0800 > On Thu, Feb 11, 2021 at 11:00 AM Alexander Lobakin wrote: > > > > Reuse the old and forgotten SKB_ALLOC_NAPI to add an option to get > > an skbuff_head from the NAPI cache instead of inplace allocation &

Re: [PATCH v5 net-next 06/11] skbuff: remove __kfree_skb_flush()

2021-02-13 Thread Alexander Lobakin
From: Alexander Duyck Date: Thu, 11 Feb 2021 19:28:52 -0800 > On Thu, Feb 11, 2021 at 10:57 AM Alexander Lobakin wrote: > > > > This function isn't much needed as NAPI skb queue gets bulk-freed > > anyway when there's no more room, and even may reduce the ef

[PATCH v6 net-next 00/11] skbuff: introduce skbuff_heads bulking and reusing

2021-02-13 Thread Alexander Lobakin
https://lore.kernel.org/netdev/20210113133523.39205-1-aloba...@pm.me [2] https://lore.kernel.org/netdev/20210209204533.327360-1-aloba...@pm.me [3] https://lore.kernel.org/netdev/20210210162732.80467-1-aloba...@pm.me [4] https://lore.kernel.org/netdev/20210211185220.9753-1-aloba...@pm.me Alexande

[PATCH v6 net-next 03/11] skbuff: make __build_skb_around() return void

2021-02-13 Thread Alexander Lobakin
__build_skb_around() can never fail and always returns passed skb. Make it return void to simplify and optimize the code. Signed-off-by: Alexander Lobakin --- net/core/skbuff.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/core/skbuff.c b/net/core

[PATCH v6 net-next 02/11] skbuff: simplify kmalloc_reserve()

2021-02-13 Thread Alexander Lobakin
Eversince the introduction of __kmalloc_reserve(), "ip" argument hasn't been used. _RET_IP_ is embedded inside kmalloc_node_track_caller(). Remove the redundant macro and rename the function after it. Signed-off-by: Alexander Lobakin --- net/core/skbuff.c | 7 ++- 1

[PATCH v6 net-next 04/11] skbuff: simplify __alloc_skb() a bit

2021-02-13 Thread Alexander Lobakin
Use unlikely() annotations for skbuff_head and data similarly to the two other allocation functions and remove totally redundant goto. Signed-off-by: Alexander Lobakin --- net/core/skbuff.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/net/core/skbuff.c b/net

[PATCH v6 net-next 05/11] skbuff: use __build_skb_around() in __alloc_skb()

2021-02-13 Thread Alexander Lobakin
Just call __build_skb_around() instead of open-coding it. Signed-off-by: Alexander Lobakin --- net/core/skbuff.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 88566de26cd1..1c6f6ef70339 100644 --- a/net/core

[PATCH v6 net-next 01/11] skbuff: move __alloc_skb() next to the other skb allocation functions

2021-02-13 Thread Alexander Lobakin
In preparation before reusing several functions in all three skb allocation variants, move __alloc_skb() next to the __netdev_alloc_skb() and __napi_alloc_skb(). No functional changes. Signed-off-by: Alexander Lobakin --- net/core/skbuff.c | 284 +++--- 1

[PATCH v6 net-next 07/11] skbuff: move NAPI cache declarations upper in the file

2021-02-13 Thread Alexander Lobakin
NAPI cache structures will be used for allocating skbuff_heads, so move their declarations a bit upper. Signed-off-by: Alexander Lobakin --- net/core/skbuff.c | 90 +++ 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/net/core/skbuff.c

[PATCH v6 net-next 08/11] skbuff: introduce {,__}napi_build_skb() which reuses NAPI cache heads

2021-02-13 Thread Alexander Lobakin
, 32}). Suggested-by: Edward Cree # Divide on two halves Suggested-by: Eric Dumazet# KASAN poisoning Cc: Dmitry Vyukov # Help with KASAN Cc: Paolo Abeni # Reduced batch size Signed-off-by: Alexander Lobakin --- include/linux/skbuff.h | 2 + net/core/skbuff.c

[PATCH v6 net-next 10/11] skbuff: allow to use NAPI cache from __napi_alloc_skb()

2021-02-13 Thread Alexander Lobakin
kmalloc and page frag paths. Signed-off-by: Alexander Lobakin --- net/core/skbuff.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index a80581eed7fc..875e1a453f7e 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -562,7

[PATCH v6 net-next 09/11] skbuff: allow to optionally use NAPI cache from __alloc_skb()

2021-02-13 Thread Alexander Lobakin
# Simplified flags check Signed-off-by: Alexander Lobakin --- net/core/skbuff.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 9e1a8ded4acc..a80581eed7fc 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -405,7 +405,11

[PATCH v6 net-next 06/11] skbuff: remove __kfree_skb_flush()

2021-02-13 Thread Alexander Lobakin
ggested-by: Eric Dumazet Signed-off-by: Alexander Lobakin --- include/linux/skbuff.h | 1 - net/core/dev.c | 7 +-- net/core/skbuff.c | 12 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 0a

[PATCH v6 net-next 11/11] skbuff: queue NAPI_MERGED_FREE skbs into NAPI cache instead of freeing

2021-02-13 Thread Alexander Lobakin
() to skbuff.c, so it can drop skbs to NAPI cache. As many drivers call napi_alloc_skb()/napi_get_frags() on their receive path, this becomes especially useful. Signed-off-by: Alexander Lobakin --- include/linux/skbuff.h | 1 + net/core/dev.c | 9 + net/core/skbuff.c | 12

[PATCH v4 bpf-next 0/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-16 Thread Alexander Lobakin
ver.1611236588.git.xuanz...@linux.alibaba.com Alexander Lobakin (3): netdev_priv_flags: add missing IFF_PHONY_HEADROOM self-definition netdevice: check for net_device::priv_flags bitfield overflow xsk: respect device's headroom and tailroom on generic xmit path Xuan Zhuo (3): net: ad

[PATCH v4 bpf-next 2/6] netdevice: check for net_device::priv_flags bitfield overflow

2021-02-16 Thread Alexander Lobakin
We almost ran out of unsigned int bitwidth. Define priv flags and check for potential overflow in the fashion of netdev_features_t. Defined this way, priv_flags can be easily expanded later with just changing its typedef. Signed-off-by: Alexander Lobakin --- include/linux/netdevice.h | 135

[PATCH v4 bpf-next 1/6] netdev_priv_flags: add missing IFF_PHONY_HEADROOM self-definition

2021-02-16 Thread Alexander Lobakin
This is harmless for now, but comes fatal for the subsequent patch. Fixes: 871b642adebe3 ("netdev: introduce ndo_set_rx_headroom") Signed-off-by: Alexander Lobakin --- include/linux/netdevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/netdevice.h b/inc

[PATCH v4 bpf-next 3/6] net: add priv_flags for allow tx skb without linear

2021-02-16 Thread Alexander Lobakin
whether the network card supports this feature. Signed-off-by: Xuan Zhuo Suggested-by: Alexander Lobakin [ alobakin: give a new flag more detailed description ] Signed-off-by: Alexander Lobakin --- include/linux/netdevice.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux

[PATCH v4 bpf-next 5/6] xsk: respect device's headroom and tailroom on generic xmit path

2021-02-16 Thread Alexander Lobakin
but in fact need it (not so rare case). Fixes: 35fcde7f8deb ("xsk: support for Tx") Signed-off-by: Alexander Lobakin --- net/xdp/xsk.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 4faabd1ecfd1..143979ea4165 100644 -

[PATCH v4 bpf-next 6/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-16 Thread Alexander Lobakin
ear ] Signed-off-by: Alexander Lobakin --- net/xdp/xsk.c | 119 -- 1 file changed, 95 insertions(+), 24 deletions(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 143979ea4165..ff7bd06e1241 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@ -445,6 +445

[PATCH v4 bpf-next 4/6] virtio-net: support IFF_TX_SKB_NO_LINEAR

2021-02-16 Thread Alexander Lobakin
From: Xuan Zhuo Virtio net supports the case where the skb linear space is empty, so add priv_flags. Signed-off-by: Xuan Zhuo Acked-by: Michael S. Tsirkin Signed-off-by: Alexander Lobakin --- drivers/net/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

Re: [PATCH v4 bpf-next 6/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-16 Thread Alexander Lobakin
From: Magnus Karlsson Date: Tue, 16 Feb 2021 15:08:26 +0100 > On Tue, Feb 16, 2021 at 12:44 PM Alexander Lobakin wrote: > > > > From: Xuan Zhuo > > > > This patch is used to construct skb based on page to save memory copy > > overhead. > > &g

[PATCH v5 bpf-next 0/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-16 Thread Alexander Lobakin
ivers to avoid potential reallocations; - fix skb->truesize accounting; - misc comment rewords. [0] https://lore.kernel.org/netdev/cover.1611236588.git.xuanz...@linux.alibaba.com [1] https://lore.kernel.org/netdev/20210216113740.62041-1-aloba...@pm.me Alexander Lobakin (3): netdev_priv_flags: add

[PATCH v5 bpf-next 2/6] netdevice: check for net_device::priv_flags bitfield overflow

2021-02-16 Thread Alexander Lobakin
We almost ran out of unsigned int bitwidth. Define priv flags and check for potential overflow in the fashion of netdev_features_t. Defined this way, priv_flags can be easily expanded later with just changing its typedef. Signed-off-by: Alexander Lobakin Reported-by: kernel test robot

[PATCH v5 bpf-next 3/6] net: add priv_flags for allow tx skb without linear

2021-02-16 Thread Alexander Lobakin
whether the network card supports this feature. Signed-off-by: Xuan Zhuo Suggested-by: Alexander Lobakin [ alobakin: give a new flag more detailed description ] Signed-off-by: Alexander Lobakin --- include/linux/netdevice.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux

[PATCH v5 bpf-next 4/6] virtio-net: support IFF_TX_SKB_NO_LINEAR

2021-02-16 Thread Alexander Lobakin
From: Xuan Zhuo Virtio net supports the case where the skb linear space is empty, so add priv_flags. Signed-off-by: Xuan Zhuo Acked-by: Michael S. Tsirkin Signed-off-by: Alexander Lobakin --- drivers/net/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[PATCH v5 bpf-next 1/6] netdev_priv_flags: add missing IFF_PHONY_HEADROOM self-definition

2021-02-16 Thread Alexander Lobakin
This is harmless for now, but comes fatal for the subsequent patch. Fixes: 871b642adebe3 ("netdev: introduce ndo_set_rx_headroom") Signed-off-by: Alexander Lobakin --- include/linux/netdevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/netdevice.h b/inc

[PATCH v5 bpf-next 6/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-16 Thread Alexander Lobakin
ear ] Signed-off-by: Alexander Lobakin Acked-by: Magnus Karlsson --- net/xdp/xsk.c | 119 -- 1 file changed, 95 insertions(+), 24 deletions(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 143979ea4165..ff7bd06e1241 100644 --- a/net/xdp/xsk.c +++ b/

[PATCH v5 bpf-next 5/6] xsk: respect device's headroom and tailroom on generic xmit path

2021-02-16 Thread Alexander Lobakin
but in fact need it (not so rare case). Fixes: 35fcde7f8deb ("xsk: support for Tx") Signed-off-by: Alexander Lobakin Acked-by: Magnus Karlsson --- net/xdp/xsk.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 4faabd1ec

Re: [PATCH v5 bpf-next 6/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-16 Thread Alexander Lobakin
From: Alexander Lobakin Date: Tue, 16 Feb 2021 14:35:02 + > From: Xuan Zhuo > > This patch is used to construct skb based on page to save memory copy > overhead. > > This function is implemented based on IFF_TX_SKB_NO_LINEAR. Only the > network car

[PATCH v6 bpf-next 1/6] netdev_priv_flags: add missing IFF_PHONY_HEADROOM self-definition

2021-02-16 Thread Alexander Lobakin
This is harmless for now, but comes fatal for the subsequent patch. Fixes: 871b642adebe3 ("netdev: introduce ndo_set_rx_headroom") Signed-off-by: Alexander Lobakin --- include/linux/netdevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/netdevice.h b/inc

[PATCH v6 bpf-next 2/6] netdevice: check for net_device::priv_flags bitfield overflow

2021-02-16 Thread Alexander Lobakin
We almost ran out of unsigned int bitwidth. Define priv flags and check for potential overflow in the fashion of netdev_features_t. Defined this way, priv_flags can be easily expanded later with just changing its typedef. Signed-off-by: Alexander Lobakin Reported-by: kernel test robot

[PATCH v6 bpf-next 0/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-16 Thread Alexander Lobakin
041-1-aloba...@pm.me [2] https://lore.kernel.org/netdev/2021021614.5861-1-aloba...@pm.me Alexander Lobakin (3): netdev_priv_flags: add missing IFF_PHONY_HEADROOM self-definition netdevice: check for net_device::priv_flags bitfield overflow xsk: respect device's headroom and tailroom

[PATCH v6 bpf-next 3/6] net: add priv_flags for allow tx skb without linear

2021-02-16 Thread Alexander Lobakin
whether the network card supports this feature. Signed-off-by: Xuan Zhuo Suggested-by: Alexander Lobakin [ alobakin: give a new flag more detailed description ] Signed-off-by: Alexander Lobakin --- include/linux/netdevice.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux

[PATCH v6 bpf-next 4/6] virtio-net: support IFF_TX_SKB_NO_LINEAR

2021-02-16 Thread Alexander Lobakin
From: Xuan Zhuo Virtio net supports the case where the skb linear space is empty, so add priv_flags. Signed-off-by: Xuan Zhuo Acked-by: Michael S. Tsirkin Signed-off-by: Alexander Lobakin --- drivers/net/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[PATCH v6 bpf-next 5/6] xsk: respect device's headroom and tailroom on generic xmit path

2021-02-16 Thread Alexander Lobakin
but in fact need it (not so rare case). Fixes: 35fcde7f8deb ("xsk: support for Tx") Signed-off-by: Alexander Lobakin Acked-by: Magnus Karlsson --- net/xdp/xsk.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 4faabd1ec

[PATCH v6 bpf-next 6/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-16 Thread Alexander Lobakin
ear ] Signed-off-by: Alexander Lobakin Acked-by: Magnus Karlsson --- net/xdp/xsk.c | 120 -- 1 file changed, 96 insertions(+), 24 deletions(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 143979ea4165..a71ed664da0a 100644 --- a/net/xdp/xsk.c +++ b/

[PATCH v7 bpf-next 0/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-17 Thread Alexander Lobakin
netdev/cover.1611236588.git.xuanz...@linux.alibaba.com [1] https://lore.kernel.org/netdev/20210216113740.62041-1-aloba...@pm.me [2] https://lore.kernel.org/netdev/2021021614.5861-1-aloba...@pm.me [3] https://lore.kernel.org/netdev/20210216172640.374487-1-aloba...@pm.me Alexander Lobakin (3):

[PATCH v7 bpf-next 1/6] netdev_priv_flags: add missing IFF_PHONY_HEADROOM self-definition

2021-02-17 Thread Alexander Lobakin
This is harmless for now, but comes fatal for the subsequent patch. Fixes: 871b642adebe3 ("netdev: introduce ndo_set_rx_headroom") Signed-off-by: Alexander Lobakin --- include/linux/netdevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/netdevice.h b/inc

[PATCH v7 bpf-next 3/6] net: add priv_flags for allow tx skb without linear

2021-02-17 Thread Alexander Lobakin
whether the network card supports this feature. Signed-off-by: Xuan Zhuo Suggested-by: Alexander Lobakin [ alobakin: give a new flag more detailed description ] Signed-off-by: Alexander Lobakin --- include/linux/netdevice.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux

[PATCH v7 bpf-next 2/6] netdevice: check for net_device::priv_flags bitfield overflow

2021-02-17 Thread Alexander Lobakin
We almost ran out of unsigned int bitwidth. Define priv flags and check for potential overflow in the fashion of netdev_features_t. Defined this way, priv_flags can be easily expanded later with just changing its typedef. Signed-off-by: Alexander Lobakin Reported-by: kernel test robot

[PATCH v7 bpf-next 4/6] virtio-net: support IFF_TX_SKB_NO_LINEAR

2021-02-17 Thread Alexander Lobakin
From: Xuan Zhuo Virtio net supports the case where the skb linear space is empty, so add priv_flags. Signed-off-by: Xuan Zhuo Acked-by: Michael S. Tsirkin Signed-off-by: Alexander Lobakin --- drivers/net/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[PATCH v7 bpf-next 5/6] xsk: respect device's headroom and tailroom on generic xmit path

2021-02-17 Thread Alexander Lobakin
but in fact need it (not so rare case). Fixes: 35fcde7f8deb ("xsk: support for Tx") Signed-off-by: Alexander Lobakin Acked-by: Magnus Karlsson --- net/xdp/xsk.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 4faabd1ec

[PATCH v7 bpf-next 6/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-17 Thread Alexander Lobakin
ear ] Signed-off-by: Alexander Lobakin Acked-by: Magnus Karlsson --- net/xdp/xsk.c | 120 -- 1 file changed, 96 insertions(+), 24 deletions(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 143979ea4165..a71ed664da0a 100644 --- a/net/xdp/xsk.c +++ b/

[PATCH v8 bpf-next 0/5] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-18 Thread Alexander Lobakin
1-aloba...@pm.me [4] https://lore.kernel.org/netdev/20210217120003.7938-1-aloba...@pm.me Alexander Lobakin (2): netdevice: add missing IFF_PHONY_HEADROOM self-definition xsk: respect device's headroom and tailroom on generic xmit path Xuan Zhuo (3): net: add priv_flags for allow tx skb without

[PATCH v8 bpf-next 1/5] netdevice: add missing IFF_PHONY_HEADROOM self-definition

2021-02-18 Thread Alexander Lobakin
This is harmless for now, but can be fatal for future refactors. Fixes: 871b642adebe3 ("netdev: introduce ndo_set_rx_headroom") Signed-off-by: Alexander Lobakin Acked-by: John Fastabend --- include/linux/netdevice.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/n

[PATCH v8 bpf-next 2/5] net: add priv_flags for allow tx skb without linear

2021-02-18 Thread Alexander Lobakin
whether the network card supports this feature. Signed-off-by: Xuan Zhuo Suggested-by: Alexander Lobakin [ alobakin: give a new flag more detailed description ] Signed-off-by: Alexander Lobakin Acked-by: John Fastabend --- include/linux/netdevice.h | 4 1 file changed, 4 insertions(+) diff

[PATCH v8 bpf-next 3/5] virtio-net: support IFF_TX_SKB_NO_LINEAR

2021-02-18 Thread Alexander Lobakin
From: Xuan Zhuo Virtio net supports the case where the skb linear space is empty, so add priv_flags. Signed-off-by: Xuan Zhuo Acked-by: Michael S. Tsirkin Signed-off-by: Alexander Lobakin Acked-by: John Fastabend --- drivers/net/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH v8 bpf-next 4/5] xsk: respect device's headroom and tailroom on generic xmit path

2021-02-18 Thread Alexander Lobakin
but in fact need it (not so rare case). Fixes: 35fcde7f8deb ("xsk: support for Tx") Signed-off-by: Alexander Lobakin Acked-by: Magnus Karlsson Acked-by: John Fastabend --- net/xdp/xsk.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/xdp/xs

[PATCH v8 bpf-next 5/5] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-18 Thread Alexander Lobakin
ear ] Signed-off-by: Alexander Lobakin Acked-by: Magnus Karlsson Acked-by: John Fastabend --- net/xdp/xsk.c | 120 -- 1 file changed, 96 insertions(+), 24 deletions(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 143979ea4165..a71ed664da0a 100

  1   2   3   4   5   >