Re: [Patch bpf-next v8 11/16] udp: implement ->read_sock() for sockmap

2021-04-02 Thread Alexei Starovoitov
On Fri, Apr 2, 2021 at 10:12 PM Cong Wang wrote: > > On Wed, Mar 31, 2021 at 11:01 PM John Fastabend > wrote: > > This 'else if' is always true if above is false right? Would be > > impler and clearer IMO as, > > > >if (used <= 0) { > > if (!copied) > >

[PATCH] wireless: iwlwifi: Fix a double free in iwl_txq_dyn_alloc_dma

2021-04-02 Thread Lv Yunlong
In iwl_txq_dyn_alloc_dma, txq->tfds is freed at first time by: iwl_txq_alloc()->goto err_free_tfds->dma_free_coherent(). But it forgot to set txq->tfds to NULL. Then the txq->tfds is freed again in iwl_txq_dyn_alloc_dma by: goto error->iwl_txq_gen2_free_memory()->dma_free_coherent(). My patch set

[Patch bpf-next] udp_bpf: remove some pointless comments

2021-04-02 Thread Cong Wang
From: Cong Wang These comments in udp_bpf_update_proto() are copied from the original TCP code and apparently do not apply to UDP. Just remove them. Reported-by: Jakub Sitnicki Cc: John Fastabend Cc: Daniel Borkmann Cc: Lorenz Bauer Signed-off-by: Cong Wang --- net/ipv4/udp_bpf.c | 2 -- 1

Re: [Patch bpf-next v8 10/16] sock: introduce sk->sk_prot->psock_update_sk_prot()

2021-04-02 Thread Cong Wang
On Fri, Apr 2, 2021 at 3:16 AM Jakub Sitnicki wrote: > > -struct proto *udp_bpf_get_proto(struct sock *sk, struct sk_psock *psock) > > +int udp_bpf_update_proto(struct sock *sk, bool restore) > > { > > int family = sk->sk_family == AF_INET ? UDP_BPF_IPV4 : UDP_BPF_IPV6; > > + struct sk_

Re: [Patch bpf-next v8 11/16] udp: implement ->read_sock() for sockmap

2021-04-02 Thread Cong Wang
On Wed, Mar 31, 2021 at 11:01 PM John Fastabend wrote: > This 'else if' is always true if above is false right? Would be > impler and clearer IMO as, > >if (used <= 0) { > if (!copied) > copied = used; >

[syzbot] WARNING: suspicious RCU usage in find_inlist_lock

2021-04-02 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:1e43c377 Merge tag 'xtensa-20210329' of git://github.com/j.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=114cdd4ad0 kernel config: https://syzkaller.appspot.com/x/.config?x=78ef1d159159890 dash

[PATCH net 2/2] net: hns3: Remove un-necessary 'else-if' in the hclge_reset_event()

2021-04-02 Thread Salil Mehta
Code to defer the reset(which caps the frequency of the reset) schedules the timer and returns. Hence, following 'else-if' looks un-necessary. Fixes: 9de0b86f6444 ("net: hns3: Prevent to request reset frequently") Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ma

[PATCH net 1/2] net: hns3: Remove the left over redundant check & assignment

2021-04-02 Thread Salil Mehta
This removes the left over check and assignment which is no longer used anywhere in the function and should have been removed as part of the below mentioned patch. Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling reset_event") Signed-off-by: Salil Mehta --- drivers/net/ethernet

[PATCH net 0/2] Misc. fixes for hns3 driver

2021-04-02 Thread Salil Mehta
Fixes for the miscellaneous problems found during the review of the code. Salil Mehta (2): net: hns3: Remove the left over redundant check & assignment net: hns3: Remove un-necessary 'else-if' in the hclge_reset_event() drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 +++--- 1 fi

Re: [PATCH v2] ip-nexthop: support flush by id

2021-04-02 Thread David Ahern
On 3/31/21 10:03 PM, Chunmei Xu wrote: > since id is unique for nexthop, it is heavy to dump all nexthops. > use existing delete_nexthop to support flush by id > > Signed-off-by: Chunmei Xu > --- > ip/ipnexthop.c | 20 +++- > 1 file changed, 19 insertions(+), 1 deletion(-) > th

Re: [iproute2-next] tipc: use the libmnl functions in lib/mnl_utils.c

2021-04-02 Thread David Ahern
On 3/31/21 8:34 PM, Hoang Le wrote: > To avoid code duplication, tipc should be converted to use the helper > functions for working with libmnl in lib/mnl_utils.c > > Acked-by: Jon Maloy > Signed-off-by: Hoang Le > --- > tipc/bearer.c| 38 ++ > tipc/cmdl.c | 2 - > tipc/

[PATCH bpf-next] bpf: selftests: Specify CONFIG_DYNAMIC_FTRACE in the testing config

2021-04-02 Thread Martin KaFai Lau
The tracing test and the recent kfunc call test require CONFIG_DYNAMIC_FTRACE. This patch adds it to the config file. Signed-off-by: Martin KaFai Lau --- tools/testing/selftests/bpf/config | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/bpf/config b/tools/testing/se

Re: [PATCH mlx5-next v8 0/4] Dynamically assign MSI-X vectors count

2021-04-02 Thread Bjorn Helgaas
On Sun, Mar 14, 2021 at 02:42:52PM +0200, Leon Romanovsky wrote: > - > Changelog > v8: > * Added "physical/virtual function" words near PF and VF acronyms. > v7: https://lore.kernel.org/linux-pci/20210301075524.441609-

Re: [PATCH mlx5-next v8 1/4] PCI: Add a sysfs file to change the MSI-X table size of SR-IOV VFs

2021-04-02 Thread Bjorn Helgaas
Possible subject, since this adds *two* files, not just "a file": PCI/IOV: Add sysfs MSI-X vector assignment interface On Sun, Mar 14, 2021 at 02:42:53PM +0200, Leon Romanovsky wrote: > A typical cloud provider SR-IOV use case is to create many VFs for use by > guest VMs. The VFs may not be ass

Re: [PATCH -next v2] libbpf: remove redundant semi-colon

2021-04-02 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf-next.git (refs/heads/master): On Fri, 2 Apr 2021 09:26:34 +0800 you wrote: > Remove redundant semi-colon in infinalize_btf_ext(). > > Signed-off-by: Yang Yingliang > --- > v2: > add commit log > > [...] Here is the summary with links: - [-next,v2]

Re: [PATCH] linux/bpf-cgroup.h: Delete repeated struct declaration

2021-04-02 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf-next.git (refs/heads/master): On Thu, 1 Apr 2021 14:46:37 +0800 you wrote: > struct bpf_prog is declared twice. There is one declaration > which is independent on the MACRO at 18th line. > So the below one is not needed though. Remove the duplicate. > >

Re: [Patch bpf-next] bpf: remove unused parameter from ___bpf_prog_run

2021-04-02 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf-next.git (refs/heads/master): On Wed, 31 Mar 2021 07:51:35 + you wrote: > 'stack' parameter is not used in ___bpf_prog_run, > the base address have been set to FP reg. So consequently remove it. > > Signed-off-by: He Fengqing > --- > kernel/bpf/core

Re: [PATCH] linux/bpf.h: Remove repeated struct declaration

2021-04-02 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf-next.git (refs/heads/master): On Thu, 1 Apr 2021 15:20:37 +0800 you wrote: > struct btf_type is declared twice. One is declared at 35th line. > The blew one is not needed. Remove the duplicate. > > Signed-off-by: Wan Jiabing > --- > include/linux/bpf.h

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Alexei Starovoitov
On Fri, Apr 02, 2021 at 02:24:51PM -0700, Cong Wang wrote: > > > where the key is the timer ID and the value is the timer expire > > > timer. > > > > The timer ID is unnecessary. We cannot introduce new IDR for every new > > bpf object. It doesn't scale. > > The IDR is per map, not per timer. Per

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Song Liu
> On Apr 2, 2021, at 1:57 PM, Cong Wang wrote: > > On Fri, Apr 2, 2021 at 12:45 PM Song Liu wrote: >> >> >> >>> On Apr 2, 2021, at 12:08 PM, Cong Wang wrote: >>> >>> On Fri, Apr 2, 2021 at 10:57 AM Song Liu wrote: > On Apr 2, 2021, at 10:34 AM, Cong Wang wrote: >>

Re: [PATCH RFC 2/4] net: sched: fix err handler in tcf_action_init()

2021-04-02 Thread Cong Wang
On Wed, Mar 31, 2021 at 9:41 AM Vlad Buslov wrote: > > With recent changes that separated action module load from action > initialization tcf_action_init() function error handling code was modified > to manually release the loaded modules if loading/initialization of any > further action in same b

Re: [PATCH netfilter] netfilter: xt_IDLETIMER: fix idletimer_tg_helper non-kosher casts

2021-04-02 Thread Maciej Żenczykowski
> > The code is relying on the identical layout of the beginning > > of the v0 and v1 structs, but this can easily lead to code bugs > > if one were to try to extend this further... > > What is the concern? These structs are part of ABI, they > cannot be changed. That is a reasonable point, but t

Re: [PATCH RFC 1/4] net: sched: fix action overwrite reference counting

2021-04-02 Thread Cong Wang
On Wed, Mar 31, 2021 at 9:41 AM Vlad Buslov wrote: > > Action init code increments reference counter when it changes an action. > This is the desired behavior for cls API which needs to obtain action > reference for every classifier that points to action. However, act API just > needs to change th

Re: [PATCH] carl9170: remove get_tid_h

2021-04-02 Thread Christian Lamparter
On 02/04/2021 23:31, Christophe JAILLET wrote: 'get_tid_h()' is the same as 'ieee80211_get_tid()'. So this function can be removed to save a few lines of code. Signed-off-by: Christophe JAILLET Acked-by: Christian Lamparter --- drivers/net/wireless/ath/carl9170/carl9170.h | 7 +-- dr

Re: [PATCH net-next] tcp: reorder tcp_congestion_ops for better cache locality

2021-04-02 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Fri, 2 Apr 2021 11:10:37 -0700 you wrote: > From: Eric Dumazet > > Group all the often used fields in the first cache line, > to reduce cache line misses. > > Signed-off-by: Eric Dumazet > > [...] Here is the summ

Re: [PATCH netfilter] netfilter: xt_IDLETIMER: fix idletimer_tg_helper non-kosher casts

2021-04-02 Thread Florian Westphal
Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > The code is relying on the identical layout of the beginning > of the v0 and v1 structs, but this can easily lead to code bugs > if one were to try to extend this further... What is the concern? These structs are part of ABI, they cann

Re: [PATCH 1/1] net: macb: restore cmp registers on resume path

2021-04-02 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Fri, 2 Apr 2021 15:42:53 +0300 you wrote: > Restore CMP screener registers on resume path. > > Fixes: c1e85c6ce57ef ("net: macb: save/restore the remaining registers and > features") > Signed-off-by: Claudiu Beznea > --- >

[PATCH] carl9170: remove get_tid_h

2021-04-02 Thread Christophe JAILLET
'get_tid_h()' is the same as 'ieee80211_get_tid()'. So this function can be removed to save a few lines of code. Signed-off-by: Christophe JAILLET --- drivers/net/wireless/ath/carl9170/carl9170.h | 7 +-- drivers/net/wireless/ath/carl9170/tx.c | 2 +- 2 files changed, 2 insertions(+),

Re: [PATCH net-next] nfc: pn533: prevent potential memory corruption

2021-04-02 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Fri, 2 Apr 2021 14:44:42 +0300 you wrote: > If the "type_a->nfcid_len" is too large then it would lead to memory > corruption in pn533_target_found_type_a() when we do: > > memcpy(nfc_tgt->nfcid1, tgt_type_a->nfci

Re: [PATCH net-next 00/12] ionic: add PTP and hw clock support

2021-04-02 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (refs/heads/master): On Thu, 1 Apr 2021 10:55:58 -0700 you wrote: > This patchset adds support for accessing the DSC hardware clock and > for offloading PTP timestamping. > > Tx packet timestamping happens through a separate Tx queue set up

Re: [PATCH net-next 0/7] MPTCP: Miscellaneous changes

2021-04-02 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (refs/heads/master): On Thu, 1 Apr 2021 16:19:40 -0700 you wrote: > Here is a collection of patches from the MPTCP tree: > > > Patches 1 and 2 add some helpful MIB counters for connection > information. > > Patch 3 cleans up some unnecessa

Re: [PATCH net-next v2 0/3] dpaa2-eth: add rx copybreak support

2021-04-02 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (refs/heads/master): On Fri, 2 Apr 2021 12:55:29 +0300 you wrote: > From: Ioana Ciornei > > DMA unmapping, allocating a new buffer and DMA mapping it back on the > refill path is really not that efficient. Proper buffer recycling (page > po

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Cong Wang
On Fri, Apr 2, 2021 at 12:28 PM Alexei Starovoitov wrote: > > On Wed, Mar 31, 2021 at 09:26:35PM -0700, Cong Wang wrote: > > > This patch introduces a bpf timer map and a syscall to create bpf timer > > from user-space. > > That will severely limit timer api usability. > I agree with Song here. If

Re: [PATCH] net: initialize local variables in net/ipv6/mcast.c and net/ipv4/igmp.c

2021-04-02 Thread Eric Dumazet
On 4/2/21 10:53 PM, Eric Dumazet wrote: > > > On 4/2/21 8:10 PM, Phillip Potter wrote: >> On Fri, Apr 02, 2021 at 07:49:44PM +0200, Eric Dumazet wrote: >>> >>> >>> On 4/2/21 7:36 PM, Phillip Potter wrote: Use memset to initialize two local buffers in net/ipv6/mcast.c, and another in

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Cong Wang
On Fri, Apr 2, 2021 at 12:45 PM Song Liu wrote: > > > > > On Apr 2, 2021, at 12:08 PM, Cong Wang wrote: > > > > On Fri, Apr 2, 2021 at 10:57 AM Song Liu wrote: > >> > >> > >> > >>> On Apr 2, 2021, at 10:34 AM, Cong Wang wrote: > >>> > >>> On Thu, Apr 1, 2021 at 1:17 PM Song Liu wrote: > >

Re: [PATCH] net: initialize local variables in net/ipv6/mcast.c and net/ipv4/igmp.c

2021-04-02 Thread Eric Dumazet
On 4/2/21 8:10 PM, Phillip Potter wrote: > On Fri, Apr 02, 2021 at 07:49:44PM +0200, Eric Dumazet wrote: >> >> >> On 4/2/21 7:36 PM, Phillip Potter wrote: >>> Use memset to initialize two local buffers in net/ipv6/mcast.c, >>> and another in net/ipv4/igmp.c. Fixes a KMSAN found uninit-value >>>

[PATCH iptables] fix build for missing ETH_ALEN definition

2021-04-02 Thread Maciej Żenczykowski
From: Maciej Żenczykowski (this is needed at least with bionic) Signed-off-by: Maciej Żenczykowski --- libxtables/xtables.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libxtables/xtables.c b/libxtables/xtables.c index bc42ba82..77bc18f6 100644 --- a/libxtables/xtables.c +++ b/libxtable

Re: [PATCH net-next] tcp: reorder tcp_congestion_ops for better cache locality

2021-04-02 Thread Stephen Hemminger
On Fri, 2 Apr 2021 11:10:37 -0700 Eric Dumazet wrote: > From: Eric Dumazet > > Group all the often used fields in the first cache line, > to reduce cache line misses. > > Signed-off-by: Eric Dumazet Makes sense. Acked-by: Stephen Hemminger

[PATCH netfilter] netfilter: xt_IDLETIMER: fix idletimer_tg_helper non-kosher casts

2021-04-02 Thread Maciej Żenczykowski
From: Maciej Żenczykowski The code is relying on the identical layout of the beginning of the v0 and v1 structs, but this can easily lead to code bugs if one were to try to extend this further... I use: char (*plabel)[MAX_IDLETIMER_LABEL_SIZE] instead of: char label[MAX_IDLETIMER_LABEL_SIZE]

[PATCH net v3] atl1c: move tx cleanup processing out of interrupt

2021-04-02 Thread Gatis Peisenieks
Tx queue cleanup happens in interrupt handler on same core as rx queue processing. Both can take considerable amount of processing in high packet-per-second scenarios. Sending big amounts of packets can stall the rx processing which is unfair and also can lead to to out-of-memory condition sin

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Song Liu
> On Apr 2, 2021, at 12:08 PM, Cong Wang wrote: > > On Fri, Apr 2, 2021 at 10:57 AM Song Liu wrote: >> >> >> >>> On Apr 2, 2021, at 10:34 AM, Cong Wang wrote: >>> >>> On Thu, Apr 1, 2021 at 1:17 PM Song Liu wrote: > On Apr 1, 2021, at 10:28 AM, Cong Wang wrote: >>

Re: Packet gets stuck in NOLOCK pfifo_fast qdisc

2021-04-02 Thread Josh Hunt
On 4/2/21 12:25 PM, Jiri Kosina wrote: On Thu, 3 Sep 2020, John Fastabend wrote: At this point I fear we could consider reverting the NOLOCK stuff. I personally would hate doing so, but it looks like NOLOCK benefits are outweighed by its issues. I agree, NOLOCK brings more pains than gains. T

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Alexei Starovoitov
On Wed, Mar 31, 2021 at 09:26:35PM -0700, Cong Wang wrote: > This patch introduces a bpf timer map and a syscall to create bpf timer > from user-space. That will severely limit timer api usability. I agree with Song here. If user space has to create it there is no reason to introduce new sys_bpf

Re: Packet gets stuck in NOLOCK pfifo_fast qdisc

2021-04-02 Thread Jiri Kosina
On Thu, 3 Sep 2020, John Fastabend wrote: > > > At this point I fear we could consider reverting the NOLOCK stuff. > > > I personally would hate doing so, but it looks like NOLOCK benefits are > > > outweighed by its issues. > > > > I agree, NOLOCK brings more pains than gains. There are many rac

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Cong Wang
On Fri, Apr 2, 2021 at 10:57 AM Song Liu wrote: > > > > > On Apr 2, 2021, at 10:34 AM, Cong Wang wrote: > > > > On Thu, Apr 1, 2021 at 1:17 PM Song Liu wrote: > >> > >> > >> > >>> On Apr 1, 2021, at 10:28 AM, Cong Wang wrote: > >>> > >>> On Wed, Mar 31, 2021 at 11:38 PM Song Liu wrote: >

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-02 Thread Kumar Kartikeya Dwivedi
On Sat, Apr 03, 2021 at 12:02:14AM IST, Alexei Starovoitov wrote: > On Fri, Apr 2, 2021 at 8:27 AM Kumar Kartikeya Dwivedi > wrote: > > [...] > > All of these things are messy because of tc legacy. bpf tried to follow tc > style > with cls and act distinction and it didn't quite work. cls with >

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-02 Thread Alexei Starovoitov
On Fri, Apr 2, 2021 at 8:27 AM Kumar Kartikeya Dwivedi wrote: > > This would be fine, because it's not a fast path or anything, but right now we > return the id using the netlink response, otherwise for query we have to open > the socket, prepare the msg, send and recv again. So it's a minor > op

[PATCH] wireless: marvell: mwl8k: Fix a double Free in mwl8k_probe_hw

2021-04-02 Thread Lv Yunlong
In mwl8k_probe_hw, hw->priv->txq is freed at the first time by dma_free_coherent() in the call chain: if(!priv->ap_fw)->mwl8k_init_txqs(hw)->mwl8k_txq_init(hw, i). Then in err_free_queues of mwl8k_probe_hw, hw->priv->txq is freed at the second time by mwl8k_txq_deinit(hw, i)->dma_free_coherent().

[PATCH net-next v2 5/5] mvneta: recycle buffers

2021-04-02 Thread Matteo Croce
From: Matteo Croce Use the new recycling API for page_pool. In a drop rate test, the packet rate increased di 10%, from 269 Kpps to 296 Kpps. perf top on a stock system shows: Overhead Shared Object Symbol 21.78% [kernel] [k] __pi___inval_dcache_area 21.66% [mvneta]

Re: [PATCH net v2] atl1c: move tx cleanup processing out of interrupt

2021-04-02 Thread Eric Dumazet
On 4/2/21 7:20 PM, Gatis Peisenieks wrote: > Tx queue cleanup happens in interrupt handler on same core as rx queue > processing. > Both can take considerable amount of processing in high packet-per-second > scenarios. > ... > @@ -2504,6 +2537,7 @@ static int atl1c_init_netdev(struct net_de

[PATCH net-next v2 4/5] mvpp2: recycle buffers

2021-04-02 Thread Matteo Croce
From: Matteo Croce Use the new recycling API for page_pool. In a drop rate test, the packet rate is more than doubled, from 962 Kpps to 2047 Kpps. perf top on a stock system shows: Overhead Shared Object Symbol 30.67% [kernel] [k] page_pool_release_page 8.37% [kernel]

[PATCH net-next v2 3/5] page_pool: Allow drivers to hint on SKB recycling

2021-04-02 Thread Matteo Croce
From: Ilias Apalodimas Up to now several high speed NICs have custom mechanisms of recycling the allocated memory they use for their payloads. Our page_pool API already has recycling capabilities that are always used when we are running in 'XDP mode'. So let's tweak the API and the kernel networ

Re: [PATCH net-next v8 2/2] net: Add Qcom WWAN control driver

2021-04-02 Thread Loic Poulain
On Fri, 2 Apr 2021 at 17:43, Greg KH wrote: > > On Fri, Apr 02, 2021 at 05:41:01PM +0200, Loic Poulain wrote: > > On Fri, 2 Apr 2021 at 16:05, Greg KH wrote: > > > > > > On Fri, Apr 02, 2021 at 04:06:37PM +0200, Loic Poulain wrote: > > > > The MHI WWWAN control driver allows MHI QCOM-based modems

[PATCH net-next v2 2/5] mm: add a signature in struct page

2021-04-02 Thread Matteo Croce
From: Matteo Croce This is needed by the page_pool to avoid recycling a page not allocated via page_pool. Signed-off-by: Matteo Croce --- include/linux/mm_types.h | 1 + include/net/page_pool.h | 2 ++ net/core/page_pool.c | 4 3 files changed, 7 insertions(+) diff --git a/include/l

[PATCH net-next v2 1/5] xdp: reduce size of struct xdp_mem_info

2021-04-02 Thread Matteo Croce
From: Jesper Dangaard Brouer It is possible to compress/reduce the size of struct xdp_mem_info. This change reduce struct xdp_mem_info from 8 bytes to 4 bytes. The member xdp_mem_info.id can be reduced to u16, as the mem_id_ht rhashtable in net/core/xdp.c is already limited by MEM_ID_MAX=0xFFFE

[PATCH net-next v2 0/5] page_pool: recycle buffers

2021-04-02 Thread Matteo Croce
From: Matteo Croce This is a respin of [1] This patchset shows the plans for allowing page_pool to handle and maintain DMA map/unmap of the pages it serves to the driver. For this to work a return hook in the network core is introduced. The overall purpose is to simplify drivers, by providing

[PATCH net-next] tcp: reorder tcp_congestion_ops for better cache locality

2021-04-02 Thread Eric Dumazet
From: Eric Dumazet Group all the often used fields in the first cache line, to reduce cache line misses. Signed-off-by: Eric Dumazet --- include/net/tcp.h | 42 +++--- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/include/net/tcp.h b/includ

Re: [PATCH] net: initialize local variables in net/ipv6/mcast.c and net/ipv4/igmp.c

2021-04-02 Thread Phillip Potter
On Fri, Apr 02, 2021 at 07:49:44PM +0200, Eric Dumazet wrote: > > > On 4/2/21 7:36 PM, Phillip Potter wrote: > > Use memset to initialize two local buffers in net/ipv6/mcast.c, > > and another in net/ipv4/igmp.c. Fixes a KMSAN found uninit-value > > bug reported by syzbot at: > > https://syzkalle

[PATCH net-next] net: reorganize fields in netns_mib

2021-04-02 Thread Eric Dumazet
From: Eric Dumazet Order fields to increase locality for most used protocols. udplite and icmp are moved at the end. Same for proc_net_devsnmp6 which is not used in fast path. This potentially saves one cache line miss for typical TCP/UDP over IPv4/IPv6. Signed-off-by: Eric Dumazet --- incl

Re: [PATCH net v2] atl1c: move tx cleanup processing out of interrupt

2021-04-02 Thread Eric Dumazet
On 4/2/21 7:20 PM, Gatis Peisenieks wrote: > Tx queue cleanup happens in interrupt handler on same core as rx queue > processing. > Both can take considerable amount of processing in high packet-per-second > scenarios. > > Sending big amounts of packets can stall the rx processing which is un

Re: [PATCH net-next v8 1/2] net: Add a WWAN subsystem

2021-04-02 Thread kernel test robot
Hi Loic, I love your patch! Perhaps something to improve: [auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/Loic-Poulain/net-Add-a-WWAN-subsystem/20210402-220002 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git

[PATCH] net: fix err_cast.cocci warnings

2021-04-02 Thread kernel test robot
: kernel test robot --- url: https://github.com/0day-ci/linux/commits/Loic-Poulain/net-Add-a-WWAN-subsystem/20210402-220002 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git bd78980be1a68d14524c51c4b4170782fada622b wwan_core.c |2 +- 1 file changed, 1 insertion(+), 1

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Song Liu
> On Apr 2, 2021, at 10:34 AM, Cong Wang wrote: > > On Thu, Apr 1, 2021 at 1:17 PM Song Liu wrote: >> >> >> >>> On Apr 1, 2021, at 10:28 AM, Cong Wang wrote: >>> >>> On Wed, Mar 31, 2021 at 11:38 PM Song Liu wrote: > On Mar 31, 2021, at 9:26 PM, Cong Wang wrote: >

Re: [PATCH] net: initialize local variables in net/ipv6/mcast.c and net/ipv4/igmp.c

2021-04-02 Thread Eric Dumazet
On 4/2/21 7:36 PM, Phillip Potter wrote: > Use memset to initialize two local buffers in net/ipv6/mcast.c, > and another in net/ipv4/igmp.c. Fixes a KMSAN found uninit-value > bug reported by syzbot at: > https://syzkaller.appspot.com/bug?id=0766d38c656abeace60621896d705743aeefed51 According t

[PATCH] net: broadcom: bcm4908enet: Fix a double free in bcm4908_enet_dma_alloc

2021-04-02 Thread Lv Yunlong
In bcm4908_enet_dma_alloc, if callee bcm4908_dma_alloc_buf_descs() failed, it will free the ring->cpu_addr by dma_free_coherent() and return error. Then bcm4908_enet_dma_free() will be called, and free the same cpu_addr by dma_free_coherent() again. My patch set ring->cpu_addr to NULL after it is

Re: [PATCH 1/1] net: macb: restore cmp registers on resume path

2021-04-02 Thread Nicolas Ferre
On 02/04/2021 at 14:42, Claudiu Beznea wrote: Restore CMP screener registers on resume path. Fixes: c1e85c6ce57ef ("net: macb: save/restore the remaining registers and features") Signed-off-by: Claudiu Beznea Acked-by: Nicolas Ferre Thanks for this fix Claudiu. Best regards, Nicolas --

[PATCH] net: initialize local variables in net/ipv6/mcast.c and net/ipv4/igmp.c

2021-04-02 Thread Phillip Potter
Use memset to initialize two local buffers in net/ipv6/mcast.c, and another in net/ipv4/igmp.c. Fixes a KMSAN found uninit-value bug reported by syzbot at: https://syzkaller.appspot.com/bug?id=0766d38c656abeace60621896d705743aeefed51 Reported-by: syzbot+001516d86dbe88862...@syzkaller.appspotmail.c

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Cong Wang
On Thu, Apr 1, 2021 at 1:17 PM Song Liu wrote: > > > > > On Apr 1, 2021, at 10:28 AM, Cong Wang wrote: > > > > On Wed, Mar 31, 2021 at 11:38 PM Song Liu wrote: > >> > >> > >> > >>> On Mar 31, 2021, at 9:26 PM, Cong Wang wrote: > >>> > >>> From: Cong Wang > >>> > >>> (This patch is still in ear

Re: [PATCH v2] iplink_rmnet: Allow passing IFLA_RMNET_FLAGS

2021-04-02 Thread Bjorn Andersson
On Mon 15 Mar 11:16 CDT 2021, Alex Elder wrote: > On 3/15/21 10:46 AM, Bjorn Andersson wrote: > > Parse and pass IFLA_RMNET_FLAGS to the kernel, to allow changing the > > flags from the default of ingress-aggregate only. > > To be clear, this default is implemented in the kernel RMNet > driver, n

[PATCH net v2] atl1c: move tx cleanup processing out of interrupt

2021-04-02 Thread Gatis Peisenieks
Tx queue cleanup happens in interrupt handler on same core as rx queue processing. Both can take considerable amount of processing in high packet-per-second scenarios. Sending big amounts of packets can stall the rx processing which is unfair and also can lead to to out-of-memory condition sin

[PATCH] rtlwifi: remove rtl_get_tid_h

2021-04-02 Thread Christophe JAILLET
'rtl_get_tid_h()' is the same as 'ieee80211_get_tid()'. So this function can be removed to save a line of code. Signed-off-by: Christophe JAILLET --- drivers/net/wireless/realtek/rtlwifi/wifi.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/wireless/realtek

Re: [PATCH net-next] net: Allow to specify ifindex when device is moved to another namespace

2021-04-02 Thread Andrei Vagin
On Fri, Apr 02, 2021 at 10:20:14AM +0200, Christian Brauner wrote: > > @@ -11043,6 +11046,11 @@ int dev_change_net_namespace(struct net_device > > *dev, struct net *net, const char > > goto out; > > } > > > > + /* Check that new_ifindex isn't used yet. */ > > + err =

[PATCH 1/1] net: macb: restore cmp registers on resume path

2021-04-02 Thread Claudiu Beznea
Restore CMP screener registers on resume path. Fixes: c1e85c6ce57ef ("net: macb: save/restore the remaining registers and features") Signed-off-by: Claudiu Beznea --- drivers/net/ethernet/cadence/macb_main.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/cadence

Re: net: phylink: phylink_helper_basex_speed issues with 1000base-x

2021-04-02 Thread George McCollister
On Thu, Apr 1, 2021 at 5:33 PM Russell King - ARM Linux admin wrote: > > Hi, > > I hadn't responded earlier because I wanted to think about it more, > but then forgot about this email. > > On Thu, Mar 25, 2021 at 11:36:26AM -0500, George McCollister wrote: > > When I set port 9 on an mv88e6390, a

Re: [PATCH net-next v8 2/2] net: Add Qcom WWAN control driver

2021-04-02 Thread kernel test robot
Hi Loic, I love your patch! Perhaps something to improve: [auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/Loic-Poulain/net-Add-a-WWAN-subsystem/20210402-220002 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git

Re: [PATCH] nfc: s3fwrn5: remove unnecessary label

2021-04-02 Thread Krzysztof Kozlowski
On 02/04/2021 14:15, samirweng1979 wrote: > From: wengjianfeng > > In function s3fwrn5_nci_post_setup, The variable ret is assigned to 0, > then goto out label, but just return ret in out label, so we use > return 0 to replace it. and other goto sentences are similar, we use > return sentences to

Re: [PATCH net-next v8 2/2] net: Add Qcom WWAN control driver

2021-04-02 Thread Greg KH
On Fri, Apr 02, 2021 at 05:41:01PM +0200, Loic Poulain wrote: > On Fri, 2 Apr 2021 at 16:05, Greg KH wrote: > > > > On Fri, Apr 02, 2021 at 04:06:37PM +0200, Loic Poulain wrote: > > > The MHI WWWAN control driver allows MHI QCOM-based modems to expose > > > different modem control protocols/ports

Re: [PATCH net-next v8 2/2] net: Add Qcom WWAN control driver

2021-04-02 Thread Loic Poulain
On Fri, 2 Apr 2021 at 16:05, Greg KH wrote: > > On Fri, Apr 02, 2021 at 04:06:37PM +0200, Loic Poulain wrote: > > The MHI WWWAN control driver allows MHI QCOM-based modems to expose > > different modem control protocols/ports via the WWAN framework, so that > > userspace modem tools or daemon (e.g

Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API

2021-04-02 Thread Kumar Kartikeya Dwivedi
On Fri, Apr 02, 2021 at 05:49:29AM IST, Daniel Borkmann wrote: > On 3/31/21 11:44 AM, Kumar Kartikeya Dwivedi wrote: > > On Wed, Mar 31, 2021 at 02:55:47AM IST, Daniel Borkmann wrote: > > > Do we even need the _block variant? I would rather prefer to take the > > > chance > > > and make it as simp

Re: [PATCH net-next v8 2/2] net: Add Qcom WWAN control driver

2021-04-02 Thread Greg KH
On Fri, Apr 02, 2021 at 04:06:37PM +0200, Loic Poulain wrote: > The MHI WWWAN control driver allows MHI QCOM-based modems to expose > different modem control protocols/ports via the WWAN framework, so that > userspace modem tools or daemon (e.g. ModemManager) can control WWAN > config and state (AP

Re: [PATCH net-next v8 1/2] net: Add a WWAN subsystem

2021-04-02 Thread Greg KH
On Fri, Apr 02, 2021 at 04:06:36PM +0200, Loic Poulain wrote: > This change introduces initial support for a WWAN framework. Given the > complexity and heterogeneity of existing WWAN hardwares and interfaces, > there is no strict definition of what a WWAN device is and how it should > be represente

[PATCH net-next v8 2/2] net: Add Qcom WWAN control driver

2021-04-02 Thread Loic Poulain
The MHI WWWAN control driver allows MHI QCOM-based modems to expose different modem control protocols/ports via the WWAN framework, so that userspace modem tools or daemon (e.g. ModemManager) can control WWAN config and state (APN config, SMS, provider selection...). A QCOM-based modem can expose o

[PATCH net-next v8 1/2] net: Add a WWAN subsystem

2021-04-02 Thread Loic Poulain
This change introduces initial support for a WWAN framework. Given the complexity and heterogeneity of existing WWAN hardwares and interfaces, there is no strict definition of what a WWAN device is and how it should be represented. It's often a collection of multiple devices that perform the global

[PATCH net] virtio_net: Do not pull payload in skb->head

2021-04-02 Thread Eric Dumazet
From: Eric Dumazet Xuan Zhuo reported that commit 3226b158e67c ("net: avoid 32 x truesize under-estimation for tiny skbs") brought a ~10% performance drop. The reason for the performance drop was that GRO was forced to chain sk_buff (using skb_shinfo(skb)->frag_list), which uses more memory but

Re: [PATCH 2/2] net: mdio: support c45 peripherals on c22 busses

2021-04-02 Thread Russell King - ARM Linux admin
On Fri, Apr 02, 2021 at 03:10:49AM +0200, Danilo Krummrich wrote: > On Thu, Apr 01, 2021 at 09:48:58AM +0100, Russell King - ARM Linux admin > wrote: > > Do you actually have a requirement for this? > > > Yes, the Marvell 88Q2112 1000Base-T1 PHY. But actually, I just recognize that > it > should

Re: [PATCH net-next v6 1/2] net: Add a WWAN subsystem

2021-04-02 Thread Greg KH
On Wed, Mar 31, 2021 at 05:30:50PM +0200, Loic Poulain wrote: > > As it is, the code you have here just implements the misc device layer, > > but with a new major number? why??? > > Right, Instead of creating yet another specific character driver for > WWAN (like usb wdm_class), the goal would be

Re: [PATCH net-next v2 2/3] dpaa2-eth: add rx copybreak support

2021-04-02 Thread Andrew Lunn
On Fri, Apr 02, 2021 at 12:55:31PM +0300, Ioana Ciornei wrote: > From: Ioana Ciornei > > DMA unmapping, allocating a new buffer and DMA mapping it back on the > refill path is really not that efficient. Proper buffer recycling (page > pool, flipping the page and using the other half) cannot be do

Re: [PATCH net-next 1/2] net: stmmac: enable 2.5Gbps link speed

2021-04-02 Thread Andrew Lunn
On Fri, Apr 02, 2021 at 07:45:04AM +, Voon, Weifeng wrote: > > > + /* 2.5G mode only support 2500baseT full duplex only */ > > > + if (priv->plat->has_gmac4 && priv->plat->speed_2500_en) { > > > + phylink_set(mac_supported, 2500baseT_Full); > > > + phylink_set(mask, 10baseT_Half

Re: [PATCH 2/2] net: mdio: support c45 peripherals on c22 busses

2021-04-02 Thread Andrew Lunn
> > Do you actually have a requirement for this? > > > Yes, the Marvell 88Q2112 1000Base-T1 PHY. But actually, I just recognize that > it > should be possible to just register it with the compatible string > "ethernet-phy-ieee802.3-c22" instead of "ethernet-phy-ieee802.3-c45", this > should result

[PATCH] ath9k: Fix kernel NULL pointer dereference during ath_reset_internal()

2021-04-02 Thread Pali Rohár
Function ath9k_hw_reset() is dereferencing chan structure pointer, so it needs to be non-NULL pointer. Function ath9k_stop() already contains code which sets ah->curchan to valid non-NULL pointer prior calling ath9k_hw_reset() function. Add same code pattern also into ath_reset_internal() functio

[PATCHv4 bpf-next 4/4] selftests/bpf: add xdp_redirect_multi test

2021-04-02 Thread Hangbin Liu
Add a bpf selftest for new helper xdp_redirect_map_multi(). In this test there are 3 forward groups and 1 exclude group. The test will redirect each interface's packets to all the interfaces in the forward group, and exclude the interface in exclude map. Two maps (DEVMAP, DEVMAP_HASH) and two xdp

[PATCHv4 bpf-next 3/4] sample/bpf: add xdp_redirect_map_multi for redirect_map broadcast test

2021-04-02 Thread Hangbin Liu
This is a sample for xdp redirect broadcast. In the sample we could forward all packets between given interfaces. There is also an option -X that could enable 2nd xdp_prog on egress interface. Signed-off-by: Hangbin Liu --- samples/bpf/Makefile | 3 + samples/bpf/xdp_redir

[PATCHv4 bpf-next 2/4] xdp: extend xdp_redirect_map with broadcast support

2021-04-02 Thread Hangbin Liu
This patch add two flags BPF_F_BROADCAST and BPF_F_EXCLUDE_INGRESS to extend xdp_redirect_map for broadcast support. Keep the general data path in net/core/filter.c and the native data path in kernel/bpf/devmap.c so we can use direct calls to get better performace. Here is the performance result

[PATCHv4 bpf-next 1/4] bpf: run devmap xdp_prog on flush instead of bulk enqueue

2021-04-02 Thread Hangbin Liu
From: Jesper Dangaard Brouer This changes the devmap XDP program support to run the program when the bulk queue is flushed instead of before the frame is enqueued. This has a couple of benefits: - It "sorts" the packets by destination devmap entry, and then runs the same BPF program on all the

[PATCHv4 bpf-next 0/4] xdp: extend xdp_redirect_map with broadcast support

2021-04-02 Thread Hangbin Liu
Hi, This patchset is a new implementation for XDP multicast support based on my previous 2 maps implementation[1]. The reason is that Daniel think the exclude map implementation is missing proper bond support in XDP context. And there is a plan to add native XDP bonding support. Adding a exclude m

[PATCH] nfc: s3fwrn5: remove unnecessary label

2021-04-02 Thread samirweng1979
From: wengjianfeng In function s3fwrn5_nci_post_setup, The variable ret is assigned to 0, then goto out label, but just return ret in out label, so we use return 0 to replace it. and other goto sentences are similar, we use return sentences to replace it and delete out label. Signed-off-by: weng

[PATCH net-next] nfc: pn533: prevent potential memory corruption

2021-04-02 Thread Dan Carpenter
If the "type_a->nfcid_len" is too large then it would lead to memory corruption in pn533_target_found_type_a() when we do: memcpy(nfc_tgt->nfcid1, tgt_type_a->nfcid_data, nfc_tgt->nfcid1_len); Fixes: c3b1e1e8a76f ("NFC: Export NFCID1 from pn533") Signed-off-by: Dan Carpenter --- drivers

Re: [PATCH net-next 9/9] net: enetc: add support for XDP_REDIRECT

2021-04-02 Thread Vladimir Oltean
On Thu, Apr 01, 2021 at 10:38:21PM +0300, Vladimir Oltean wrote: > On Thu, Apr 01, 2021 at 08:01:42PM +0200, Toke Høiland-Jørgensen wrote: > > Vladimir Oltean writes: > > > > > On Thu, Apr 01, 2021 at 01:39:05PM +0200, Toke Høiland-Jørgensen wrote: > > >> Vladimir Oltean writes: > > >> > > >> >

[PATCH] net/Bluetooth - delete unneeded variable initialization

2021-04-02 Thread Kai Ye
Delete unneeded variable initialization. Signed-off-by: Kai Ye --- net/bluetooth/6lowpan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index cff4944..ee4b0ec 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan

[PATCH net] net: octeon: mgmt: fix xmit hang as busy

2021-04-02 Thread Ivan Khoronzhuk
The issue happens only at appropriate circumstances, in my case I faced it only while running crash kernel, when basic kernel worked fine. The code inspection has shown tx_current_fill counter overflow, after one packet or couple packets were sent. That's because tx cleanup tasklet dequeued bunch o

  1   2   >