Re: [PATCH v1 1/1] bitops: Share BYTES_TO_BITS() for everyone

2023-09-11 Thread Alexander Lobakin
From: Yury Norov Date: Sun, 10 Sep 2023 07:07:16 -0700 > On Wed, Sep 06, 2023 at 05:54:26PM +0300, Andy Shevchenko wrote: >> On Wed, Sep 06, 2023 at 04:40:39PM +0200, Alexander Lobakin wrote: >>> From: Andy Shevchenko >>> Date: Thu, 31 Aug 2023 16:21:30 +0300 >>

Re: [PATCH v3] scripts/link-vmlinux.sh: Add alias to duplicate symbols for kallsyms

2023-09-11 Thread Alexander Lobakin
From: Alessandro Carminati (Red Hat) Date: Mon, 28 Aug 2023 08:04:23 + > From: Alessandro Carminati > > It is not uncommon for drivers or modules related to similar peripherals > to have symbols with the exact same name. [...] > Changes from v2: > - Alias tags are created by querying DWAR

[PATCH mips-next] vmlinux.lds.h: catch more UBSAN symbols into .data

2021-02-16 Thread Alexander Lobakin
SAN instrumentation can emit. Catch these into .data with the wildcard as well. [0] https://lore.kernel.org/linux-mm/202102160741.k57gcnsr-...@intel.com Fixes: f41b233de0ae ("vmlinux.lds.h: catch UBSAN's "unnamed data" into data") Reported-by: kernel test robot Signed-o

[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 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 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 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 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 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

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 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 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 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 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 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/

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 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 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 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/

Re: [PATCH mips-next] vmlinux.lds.h: catch more UBSAN symbols into .data

2021-02-16 Thread Alexander Lobakin
From: Nick Desaulniers Date: Tue, 16 Feb 2021 09:56:32 -0800 > On Tue, Feb 16, 2021 at 12:55 AM Alexander Lobakin wrote: > > > > LKP triggered lots of LD orphan warnings [0]: > > Thanks for the patch, just some questions. > > With which linker? Was there a parti

Re: [GIT PULL] clang-lto for v5.12-rc1

2021-02-16 Thread Alexander Lobakin
From: Kees Cook Date: Tue, 16 Feb 2021 12:34:37 -0800 > Hi Linus, > > Please pull this Clang Link Time Optimization series for v5.12-rc1. This > has been in linux-next for the entire last development cycle, and is > built on the work done preparing[0] for LTO by arm64 folks, tracing folks, > etc

[BUG] net: core: netif_receive_skb_list() crash on non-standard ptypes forwarding

2019-03-28 Thread Alexander Lobakin
Hi Edward, Seems like I've found another poisoned skb->next crash with netif_receive_skb_list(). This is similar to the one than has been already fixed in 22f6bbb7bcfc ("net: use skb_list_del_init() to remove from RX sublists"). This one however applies only to non-standard ptypes (in my case -

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

2021-02-11 Thread Alexander Lobakin
From: Paolo Abeni Date: Thu, 11 Feb 2021 15:55:04 +0100 > On Thu, 2021-02-11 at 14:28 +0000, Alexander Lobakin wrote: > > From: Paolo Abeni on Thu, 11 Feb 2021 11:16:40 +0100 > > wrote: > > > What about changing __napi_alloc_skb() to always use > > > the __n

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

2021-02-11 Thread Alexander Lobakin
360-1-aloba...@pm.me [3] https://lore.kernel.org/netdev/20210210162732.80467-1-aloba...@pm.me Alexander Lobakin (11): skbuff: move __alloc_skb() next to the other skb allocation functions skbuff: simplify kmalloc_reserve() skbuff: make __build_skb_around() return void skbuff: simplify __a

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

2021-02-11 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 v5 net-next 02/11] skbuff: simplify kmalloc_reserve()

2021-02-11 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 v5 net-next 05/11] skbuff: use __build_skb_around() in __alloc_skb()

2021-02-11 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 v5 net-next 03/11] skbuff: make __build_skb_around() return void

2021-02-11 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 v5 net-next 06/11] skbuff: remove __kfree_skb_flush()

2021-02-11 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 v5 net-next 04/11] skbuff: simplify __alloc_skb() a bit

2021-02-11 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 v5 net-next 07/11] skbuff: move NAPI cache declarations upper in the file

2021-02-11 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 v5 net-next 08/11] skbuff: introduce {,__}napi_build_skb() which reuses NAPI cache heads

2021-02-11 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 v5 net-next 09/11] skbuff: allow to optionally use NAPI cache from __alloc_skb()

2021-02-11 Thread Alexander Lobakin
: Alexander Lobakin --- net/core/skbuff.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 9e1a8ded4acc..a0b457ae87c2 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -397,15 +397,20 @@ struct sk_buff *__alloc_skb

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

2021-02-11 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 a0b457ae87c2..c8f3ea1d9fbb 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -563,7

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

2021-02-11 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

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 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 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 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 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 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 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 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 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 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 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

Re: linux-next: manual merge of the kspp tree with the mips tree

2021-02-23 Thread Alexander Lobakin
From: Stephen Rothwell Date: Tue, 23 Feb 2021 10:49:50 +1100 > Hi all, Hi, > On Mon, 15 Feb 2021 07:47:26 +1100 Stephen Rothwell > wrote: > > > > On Mon, 18 Jan 2021 15:08:04 +1100 Stephen Rothwell > > wrote: > > > > > > Today's linux-next merge of the kspp tree got a conflict in: > > > > >

[PATCH mips-fixes] vmlinux.lds.h: catch even more instrumentation symbols into .data

2021-02-23 Thread Alexander Lobakin
1' from `init/calibrate.o' being placed in section `.data.$LPBX1' mipsel-linux-ld: warning: orphan section `.data.$LPBX0' from `init/calibrate.o' being placed in section `.data.$LPBX0' [...] Soften the wildcard to .data.$L* to grab these ones into .data too. [0] https:

Re: [PATCH mips-fixes] vmlinux.lds.h: catch even more instrumentation symbols into .data

2021-02-23 Thread Alexander Lobakin
ection `.data.$LPBX0' > > [...] > > Soften the wildcard to .data.$L* to grab these ones into .data too. > > [0] https://lore.kernel.org/lkml/202102231519.lwplpvev-...@intel.com > > Reported-by: kernel test robot > Signed-off-by: Alexander Lobakin > --- > includ

Re: [PATCH mips-fixes] vmlinux.lds.h: catch even more instrumentation symbols into .data

2021-02-23 Thread Alexander Lobakin
From: Thomas Bogendoerfer Date: Tue, 23 Feb 2021 13:21:44 +0100 > On Tue, Feb 23, 2021 at 11:36:41AM +0000, Alexander Lobakin wrote: > > > LKP caught another bunch of orphaned instrumentation symbols [0]: > > > > > > mipsel-linux-ld: warning: orphan section `.data.$

Re: [GIT PULL v2] clang-lto for v5.12-rc1

2021-02-23 Thread Alexander Lobakin
From: Linus Torvalds Date: Tue, 23 Feb 2021 12:33:05 -0800 > On Tue, Feb 23, 2021 at 9:49 AM Linus Torvalds > wrote: > > > > On Mon, Feb 22, 2021 at 3:11 PM Kees Cook wrote: > > > > > > While x86 LTO enablement is done[1], it depends on some objtool > > > clean-ups[2], though it appears those a

Re: [PATCH] arm64: enable GENERIC_FIND_FIRST_BIT

2021-02-24 Thread Alexander Lobakin
From: Yury Norov Date: Sat, 5 Dec 2020 08:54:06 -0800 Hi, > ARM64 doesn't implement find_first_{zero}_bit in arch code and doesn't > enable it in config. It leads to using find_next_bit() which is less > efficient: > > : >0: aa0003e4mov x4, x0 >4: aa0103e0

Re: [v3 net-next 08/10] skbuff: reuse NAPI skb cache on allocation path (__build_skb())

2021-02-10 Thread Alexander Lobakin
From: Paolo Abeni Date: Wed, 10 Feb 2021 11:21:06 +0100 > Hello, Hi! > I'm sorry for the late feedback, I could not step-in before. > > Also adding Jesper for awareness, as he introduced the bulk free > infrastructure. > > On Tue, 2021-02-09 at 20:48 +000

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

2021-02-10 Thread Alexander Lobakin
159-1-aloba...@pm.me [1] https://lore.kernel.org/netdev/20210113133523.39205-1-aloba...@pm.me [2] https://lore.kernel.org/netdev/20210209204533.327360-1-aloba...@pm.me Alexander Lobakin (11): skbuff: move __alloc_skb() next to the other skb allocation functions skbuff: simplify kmalloc_reserve() skbuff: ma

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

2021-02-10 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 v4 net-next 02/11] skbuff: simplify kmalloc_reserve()

2021-02-10 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 v4 net-next 03/11] skbuff: make __build_skb_around() return void

2021-02-10 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 v4 net-next 06/11] skbuff: remove __kfree_skb_flush()

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

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

2021-02-10 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 v4 net-next 08/11] skbuff: introduce {,__}napi_build_skb() which reuses NAPI cache heads

2021-02-10 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 v4 net-next 07/11] skbuff: move NAPI cache declarations upper in the file

2021-02-10 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 v4 net-next 09/11] skbuff: allow to optionally use NAPI cache from __alloc_skb()

2021-02-10 Thread Alexander Lobakin
: Alexander Lobakin --- net/core/skbuff.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 9e1a8ded4acc..750fa1825b28 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -397,15 +397,20 @@ struct sk_buff *__alloc_skb

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

2021-02-10 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 v4 net-next 11/11] skbuff: queue NAPI_MERGED_FREE skbs into NAPI cache instead of freeing

2021-02-10 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 net-next 10/11] skbuff: allow to use NAPI cache from __napi_alloc_skb()

2021-02-10 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 750fa1825b28..ac6e0172f206 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -563,7

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

2021-02-11 Thread Alexander Lobakin
From: Paolo Abeni Date: Thu, 11 Feb 2021 11:16:40 +0100 > On Wed, 2021-02-10 at 16:30 +0000, 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 > > inside __

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

2021-02-11 Thread Alexander Lobakin
From: Jesper Dangaard Brouer Date: Thu, 11 Feb 2021 13:54:59 +0100 > On Wed, 10 Feb 2021 16:30:23 + > Alexander Lobakin wrote: > > > Instead of just bulk-flushing skbuff_heads queued up through > > napi_consume_skb() or __kfree_skb_defer(), try to reuse them &

[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 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 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 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 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 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

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

2021-01-30 Thread Alexander Lobakin
From: Dongseok Yi Date: Sat, 30 Jan 2021 08:13:27 +0900 > UDP/IP header of UDP GROed frag_skbs are not updated even after NAT > forwarding. Only the header of head_skb from ip_finish_output_gso -> > skb_gso_segment is updated but following frag_skbs are not updated. > > A call path skb_mac_gso_s

Re: [PATCH v2 net-next 3/4] net: introduce common dev_page_is_reserved()

2021-01-30 Thread Alexander Lobakin
From: Jakub Kicinski Date: Fri, 29 Jan 2021 18:39:07 -0800 > On Wed, 27 Jan 2021 20:11:23 +0000 Alexander Lobakin wrote: > > + * dev_page_is_reserved - check whether a page can be reused for network Rx > > + * @page: the page to test > > + * > > + * A page shouldn&

Re: [PATCH v2 net-next 3/4] net: introduce common dev_page_is_reserved()

2021-01-30 Thread Alexander Lobakin
From: Jakub Kicinski Date: Sat, 30 Jan 2021 11:07:07 -0800 > On Sat, 30 Jan 2021 15:42:29 +0000 Alexander Lobakin wrote: > > > On Wed, 27 Jan 2021 20:11:23 +0000 Alexander Lobakin wrote: > > > > + * dev_page_is_reserved - check whether a page can be reused

[PATCH v3 net-next 2/5] skbuff: constify skb_propagate_pfmemalloc() "page" argument

2021-01-31 Thread Alexander Lobakin
The function doesn't write anything to the page struct itself, so this argument can be const. Misc: align second argument to the brace while at it. Signed-off-by: Alexander Lobakin Reviewed-by: Jesse Brandeburg Acked-by: David Rientjes --- include/linux/skbuff.h | 4 ++-- 1 file chang

[PATCH v3 net-next 4/5] net: use the new dev_page_is_reusable() instead of private versions

2021-01-31 Thread Alexander Lobakin
Jakub Kicinski Cc: John Hubbard Signed-off-by: Alexander Lobakin --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 17 ++--- drivers/net/ethernet/intel/fm10k/fm10k_main.c | 13 - drivers/net/ethernet/intel/i40e/i40e_txrx.c | 15 +-- drivers/net/ethernet/

[PATCH v3 net-next 5/5] net: page_pool: simplify page recycling condition tests

2021-01-31 Thread Alexander Lobakin
pool_page_reusable() is a leftover from pre-NUMA-aware times. For now, this function is just a redundant wrapper over page_is_pfmemalloc(), so inline it into its sole call site. Signed-off-by: Alexander Lobakin Acked-by: Jesper Dangaard Brouer Reviewed-by: Ilias Apalodimas Reviewed-by: Jesse

Re: [PATCH v3 net-next 5/5] net: page_pool: simplify page recycling condition tests

2021-01-31 Thread Alexander Lobakin
From: Matthew Wilcox Date: Sun, 31 Jan 2021 12:23:48 + > On Sun, Jan 31, 2021 at 12:12:11PM +0000, Alexander Lobakin wrote: > > pool_page_reusable() is a leftover from pre-NUMA-aware times. For now, > > this function is just a redundant wrapper over page_is_pfmemalloc(), &

Re: [PATCH v3 net-next 3/5] net: introduce common dev_page_is_reusable()

2021-01-31 Thread Alexander Lobakin
From: Matthew Wilcox Date: Sun, 31 Jan 2021 12:22:05 + > On Sun, Jan 31, 2021 at 12:11:52PM +0000, Alexander Lobakin wrote: > > A bunch of drivers test the page before reusing/recycling for two > > common conditions: > > - if a page was allocated under memory pres

[PATCH v3 net-next 0/5] net: consolidate page_is_pfmemalloc() usage

2021-01-31 Thread Alexander Lobakin
a...@pm.me [1] https://lore.kernel.org/netdev/20210127201031.98544-1-aloba...@pm.me Alexander Lobakin (5): mm: constify page_is_pfmemalloc() argument skbuff: constify skb_propagate_pfmemalloc() "page" argument net: introduce common dev_page_is_reusable() net: use the new dev_page_is_reusable

[PATCH v3 net-next 1/5] mm: constify page_is_pfmemalloc() argument

2021-01-31 Thread Alexander Lobakin
The function only tests for page->index, so its argument should be const. Signed-off-by: Alexander Lobakin Reviewed-by: Jesse Brandeburg Acked-by: David Rientjes --- include/linux/mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/m

  1   2   3   4   5   6   >