[PATCH net-next 09/10] netfilter: nftables: generalize set extension to support for several expressions

2020-12-12 Thread Pablo Neira Ayuso
This patch replaces NFT_SET_EXPR by NFT_SET_EXT_EXPRESSIONS. This new extension allows to attach several expressions to one set element (not only one single expression as NFT_SET_EXPR provides). This patch prepares for support for several expressions per set element in the netlink userspace API. S

[PATCH net-next 10/10] netfilter: nftables: netlink support for several set element expressions

2020-12-12 Thread Pablo Neira Ayuso
This patch adds three new netlink attributes to encapsulate a list of expressions per set elements: - NFTA_SET_EXPRESSIONS: this attribute provides the set definition in terms of expressions. New set elements get attached the list of expressions that is specified by this new netlink attribute.

[PATCH net-next 07/10] netfilter: nftables: generalize set expressions support

2020-12-12 Thread Pablo Neira Ayuso
Currently, the set infrastucture allows for one single expressions per element. This patch extends the existing infrastructure to allow for up to two expressions. This is not updating the netlink API yet, this is coming as an initial preparation patch. Signed-off-by: Pablo Neira Ayuso --- includ

[PATCH net-next 08/10] netfilter: nftables: move nft_expr before nft_set

2020-12-12 Thread Pablo Neira Ayuso
Move the nft_expr structure definition before nft_set. Expressions are used by rules and sets, remove unnecessary forward declarations. This comes as preparation to support for multiple expressions per set element. Signed-off-by: Pablo Neira Ayuso --- include/net/netfilter/nf_tables.h | 54 +

[PATCH net-next 05/10] netfilter: use actual socket sk for REJECT action

2020-12-12 Thread Pablo Neira Ayuso
From: Jan Engelhardt True to the message of commit v5.10-rc1-105-g46d6c5ae953c, _do_ actually make use of state->sk when possible, such as in the REJECT modules. Reported-by: Minqiang Chen Cc: Jason A. Donenfeld Signed-off-by: Jan Engelhardt Signed-off-by: Pablo Neira Ayuso --- include/net/

Re: [PATCH] net: bcmgenet: Fix a resource leak in an error handling path in the probe functin

2020-12-12 Thread Florian Fainelli
On 12/12/2020 10:20 AM, Christophe JAILLET wrote: > If the 'register_netdev()' call fails, we must undo a previous > 'bcmgenet_mii_init()' call. > > Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file")> Signed-off-by: > Christophe JAILLET Acked-by: Florian Fainelli > --- > The missi

[PATCH net-next 03/10] netfilter: Remove unnecessary conversion to bool

2020-12-12 Thread Pablo Neira Ayuso
From: Kaixu Xia Here we could use the '!=' expression to fix the following coccicheck warning: ./net/netfilter/xt_nfacct.c:30:41-46: WARNING: conversion to bool not needed here Reported-by: Tosk Robot Signed-off-by: Kaixu Xia Signed-off-by: Pablo Neira Ayuso --- net/netfilter/xt_nfacct.c |

[PATCH net-next 01/10] netfilter: nft_reject_bridge: fix build errors due to code movement

2020-12-12 Thread Pablo Neira Ayuso
From: Randy Dunlap Fix build errors in net/bridge/netfilter/nft_reject_bridge.ko by selecting NF_REJECT_IPV4, which provides the missing symbols. ERROR: modpost: "nf_reject_skb_v4_tcp_reset" [net/bridge/netfilter/nft_reject_bridge.ko] undefined! ERROR: modpost: "nf_reject_skb_v4_unreach" [net/

[PATCH net-next 04/10] netfilter: nfnl_acct: remove data from struct net

2020-12-12 Thread Pablo Neira Ayuso
From: Wang Shanker This patch removes nfnl_acct_list from struct net to reduce the default memory footprint for the netns structure. Signed-off-by: Miao Wang Signed-off-by: Pablo Neira Ayuso --- include/net/net_namespace.h| 3 --- net/netfilter/nfnetlink_acct.c | 38 +

[PATCH net-next 02/10] ipvs: replace atomic_add_return()

2020-12-12 Thread Pablo Neira Ayuso
From: Yejune Deng atomic_inc_return() looks better Signed-off-by: Yejune Deng Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso --- net/netfilter/ipvs/ip_vs_core.c | 2 +- net/netfilter/ipvs/ip_vs_sync.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/n

[PATCH net-next 00/10] Netfilter/IPVS updates for net-next

2020-12-12 Thread Pablo Neira Ayuso
Hi Jakub, David, The following patchset contains Netfilter updates for net-next: 1) Missing dependencies in NFT_BRIDGE_REJECT, from Randy Dunlap. 2) Use atomic_inc_return() instead of atomic_add_return() in IPVS, from Yejune Deng. 3) Simplify check for overquota in xt_nfacct, from Kaixu Xia.

Re: [PATCH v4] net/ipv4/inet_fragment: Batch fqdir destroy works

2020-12-12 Thread Jakub Kicinski
On Fri, 11 Dec 2020 15:36:53 +0100 Eric Dumazet wrote: > On Fri, Dec 11, 2020 at 12:24 PM SeongJae Park wrote: > > From: SeongJae Park > > > > On a few of our systems, I found frequent 'unshare(CLONE_NEWNET)' calls > > make the number of active slab objects including 'sock_inode_cache' type > > r

Re: [Patch bpf-next 0/3] bpf: introduce timeout map

2020-12-12 Thread Cong Wang
On Sat, Dec 12, 2020 at 2:25 PM Cong Wang wrote: > > On Fri, Dec 11, 2020 at 11:55 AM Andrii Nakryiko > wrote: > > > > On Fri, Dec 11, 2020 at 2:28 AM Cong Wang wrote: > > > > > > From: Cong Wang > > > > > > This patchset introduces a new bpf hash map which has timeout. > > > Patch 1 is a prepa

[PATCH net-next] net: vxget: clean up sparse warnings

2020-12-12 Thread Jakub Kicinski
This code is copying strings in 64 bit quantities, the device returns them in big endian. As long as we store in big endian IOW endian on both sides matches, we're good, so swap to_be64, not from be64. This fixes ~60 sparse warnings. Signed-off-by: Jakub Kicinski --- .../net/ethernet/neterion/v

Re: [PATCH] net: check skb partial checksum offset after trim

2020-12-12 Thread Willem de Bruijn
On Sat, Dec 12, 2020 at 5:01 AM Vasily Averin wrote: > > On 12/11/20 6:37 PM, Vasily Averin wrote: > > It seems for me the similar problem can happen in __skb_trim_rcsum(). > > Also I doubt that that skb_checksum_start_offset(skb) checks in > > __skb_postpull_rcsum() and skb_csum_unnecessary() are

Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Andrew Lunn
On Sat, Dec 12, 2020 at 10:18:59PM +, Vladimir Oltean wrote: > On Sat, Dec 12, 2020 at 11:06:41PM +0100, Andrew Lunn wrote: > > > + /* Complication created by the fact that addition has two phases, but > > > + * deletion only has one phase, and we need reference counting. > > > + * The strate

Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Vladimir Oltean
On Sun, Dec 13, 2020 at 01:08:55AM +0100, Andrew Lunn wrote: > > > And you need some way to cleanup the allocated memory when the commit > > > never happens because some other layer has said No! > > > > So this would be a fatal problem with the switchdev transactional model > > if I am not misunder

Re: [PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-12 Thread Willem de Bruijn
> > > afterwards, the error handling in vhost handle_tx() will try to > > > decrease the same refcount again. This is wrong and fix this by delay > > > copying ubuf_info until we're sure there's no errors. > > > > I think the right approach is to address this in the error paths, rather > > than >

Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Andrew Lunn
On Sun, Dec 13, 2020 at 12:14:19AM +, Vladimir Oltean wrote: > On Sun, Dec 13, 2020 at 01:08:55AM +0100, Andrew Lunn wrote: > > > > And you need some way to cleanup the allocated memory when the commit > > > > never happens because some other layer has said No! > > > > > > So this would be a fa

Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Vladimir Oltean
On Sun, Dec 13, 2020 at 01:34:10AM +0100, Andrew Lunn wrote: > On Sun, Dec 13, 2020 at 12:14:19AM +, Vladimir Oltean wrote: > > On Sun, Dec 13, 2020 at 01:08:55AM +0100, Andrew Lunn wrote: > > > > > And you need some way to cleanup the allocated memory when the commit > > > > > never happens be

Re: [PATCH net-next] net: dsa: mt7530: enable MTU normalization

2020-12-12 Thread Jakub Kicinski
On Fri, 11 Dec 2020 01:03:22 +0800 DENG Qingfang wrote: > MT7530 has a global RX length register, so we are actually changing its > MRU. > Enable MTU normalization for this reason. > > Signed-off-by: DENG Qingfang Applied, thanks and thanks for the reviews.

Re: [PATCH net-next] net: x25: Remove unimplemented X.25-over-LLC code stubs

2020-12-12 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Tue, 8 Dec 2020 19:33:46 -0800 you wrote: > According to the X.25 documentation, there was a plan to implement > X.25-over-802.2-LLC. It never finished but left various code stubs in the > X.25 code. At this time it is

Re: [PATCH net-next 3/3] use __netdev_notify_peers in hyperv

2020-12-12 Thread Jakub Kicinski
On Wed, 9 Dec 2020 00:18:11 -0600 Lijun Pan wrote: > Start to use the lockless version of netdev_notify_peers. > > Cc: Haiyang Zhang > Signed-off-by: Lijun Pan > --- > drivers/net/hyperv/netvsc_drv.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/hy

Re: [PATCH v3 net-next] net: dsa: reference count the host mdb addresses

2020-12-12 Thread Florian Fainelli
On 12/12/2020 4:49 PM, Vladimir Oltean wrote: > On Sun, Dec 13, 2020 at 01:34:10AM +0100, Andrew Lunn wrote: >> On Sun, Dec 13, 2020 at 12:14:19AM +, Vladimir Oltean wrote: >>> On Sun, Dec 13, 2020 at 01:08:55AM +0100, Andrew Lunn wrote: >> And you need some way to cleanup the allocated

[PATCH v2 net-next 0/6] Offload software learnt bridge addresses to DSA

2020-12-12 Thread Vladimir Oltean
This small series tries to make DSA behave a bit more sanely when bridged with "foreign" (non-DSA) interfaces. When a station A connected to a DSA switch port needs to talk to another station B connected to a non-DSA port through the Linux bridge, DSA must explicitly add a route for station B towar

[PATCH v2 net-next 3/6] net: dsa: move switchdev event implementation under the same switch/case statement

2020-12-12 Thread Vladimir Oltean
We'll need to start listening to SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE events even for interfaces where dsa_slave_dev_check returns false, so we need that check inside the switch-case statement for SWITCHDEV_FDB_*. This movement also avoids a useless allocation / free of switchdev_work on the untreate

[PATCH v2 net-next 5/6] net: dsa: listen for SWITCHDEV_{FDB,DEL}_ADD_TO_DEVICE on foreign bridge neighbors

2020-12-12 Thread Vladimir Oltean
Some DSA switches (and not only) cannot learn source MAC addresses from packets injected from the CPU. They only perform hardware address learning from inbound traffic. This can be problematic when we have a bridge spanning some DSA switch ports and some non-DSA ports (which we'll call "foreign in

[PATCH v2 net-next 4/6] net: dsa: exit early in dsa_slave_switchdev_event if we can't program the FDB

2020-12-12 Thread Vladimir Oltean
Right now, the following would happen for a switch driver that does not implement .port_fdb_add or .port_fdb_del. dsa_slave_switchdev_event returns NOTIFY_OK and schedules: -> dsa_slave_switchdev_event_work -> dsa_port_fdb_add -> dsa_port_notify(DSA_NOTIFIER_FDB_ADD) -> dsa_switc

[PATCH v2 net-next 6/6] net: dsa: ocelot: request DSA to fix up lack of address learning on CPU port

2020-12-12 Thread Vladimir Oltean
Given the following setup: ip link add br0 type bridge ip link set eno0 master br0 ip link set swp0 master br0 ip link set swp1 master br0 ip link set swp2 master br0 ip link set swp3 master br0 Currently, packets received on a DSA slave interface (such as swp0) which should be routed by the soft

[PATCH v2 net-next 2/6] net: dsa: don't use switchdev_notifier_fdb_info in dsa_switchdev_event_work

2020-12-12 Thread Vladimir Oltean
Currently DSA doesn't add FDB entries on the CPU port, because it only does so through switchdev, which is associated with a net_device, and there are none of those for the CPU port. But actually FDB addresses on the CPU port have some use cases of their own, if the switchdev operations are initia

[PATCH v2 net-next 1/6] net: bridge: notify switchdev of disappearance of old FDB entry upon migration

2020-12-12 Thread Vladimir Oltean
Currently the bridge emits atomic switchdev notifications for dynamically learnt FDB entries. Monitoring these notifications works wonders for switchdev drivers that want to keep their hardware FDB in sync with the bridge's FDB. For example station A wants to talk to station B in the diagram below

[PATCH] net/connector: Add const qualifier to cb_id

2020-12-12 Thread Geoff Levand
The connector driver never modifies any cb_id passed to it, so add a const qualifier to those arguments so callers can declare their struct cb_id as a constant object. Fixes build warnings like these when passing a constant struct cb_id: warning: passing argument 1 of ‘cn_add_callback’ discards

Re: [PATCH v2 net-next 4/6] net: dsa: exit early in dsa_slave_switchdev_event if we can't program the FDB

2020-12-12 Thread Florian Fainelli
On 12/12/2020 6:40 PM, Vladimir Oltean wrote: > Right now, the following would happen for a switch driver that does not > implement .port_fdb_add or .port_fdb_del. > > dsa_slave_switchdev_event returns NOTIFY_OK and schedules: > -> dsa_slave_switchdev_event_work >-> dsa_port_fdb_add >

Re: [PATCH v2 net-next 3/6] net: dsa: move switchdev event implementation under the same switch/case statement

2020-12-12 Thread Florian Fainelli
On 12/12/2020 6:40 PM, Vladimir Oltean wrote: > We'll need to start listening to SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE > events even for interfaces where dsa_slave_dev_check returns false, so > we need that check inside the switch-case statement for SWITCHDEV_FDB_*. > > This movement also avoids a

Re: [PATCH v2 net-next 2/6] net: dsa: don't use switchdev_notifier_fdb_info in dsa_switchdev_event_work

2020-12-12 Thread Florian Fainelli
On 12/12/2020 6:40 PM, Vladimir Oltean wrote: > Currently DSA doesn't add FDB entries on the CPU port, because it only > does so through switchdev, which is associated with a net_device, and > there are none of those for the CPU port. > > But actually FDB addresses on the CPU port have some use

Re: [PATCH v2 net-next 5/6] net: dsa: listen for SWITCHDEV_{FDB,DEL}_ADD_TO_DEVICE on foreign bridge neighbors

2020-12-12 Thread Florian Fainelli
On 12/12/2020 6:40 PM, Vladimir Oltean wrote: > Some DSA switches (and not only) cannot learn source MAC addresses from > packets injected from the CPU. They only perform hardware address > learning from inbound traffic. > > This can be problematic when we have a bridge spanning some DSA switch

Re: [PATCH v2 net-next 6/6] net: dsa: ocelot: request DSA to fix up lack of address learning on CPU port

2020-12-12 Thread Florian Fainelli
On 12/12/2020 6:40 PM, Vladimir Oltean wrote: > Given the following setup: > > ip link add br0 type bridge > ip link set eno0 master br0 > ip link set swp0 master br0 > ip link set swp1 master br0 > ip link set swp2 master br0 > ip link set swp3 master br0 > > Currently, packets received on a

Re: [PATCH v3] Compiler Attributes: remove CONFIG_ENABLE_MUST_CHECK

2020-12-12 Thread Miguel Ojeda
On Sat, Dec 12, 2020 at 5:18 PM Guenter Roeck wrote: > > This patch results in: > > arch/sh/kernel/cpu/sh4a/smp-shx3.c: In function 'shx3_prepare_cpus': > arch/sh/kernel/cpu/sh4a/smp-shx3.c:76:3: error: ignoring return value of > 'request_irq' declared with attribute 'warn_unused_result' > > when

Re: [PATCH net-next v2] GTP: add support for flow based tunneling API

2020-12-12 Thread Jonas Bonn
Hi Pravin, I've been thinking a bit about this and find it more and more interesting. Could you post a bit of information about the ip-route changes you'll make in order to support GTP LWT encapsulation? Could you provide an example command line? I understand the advantages here of couplin

<    1   2