[PATCH] net: ag71xx: Slightly simplify 'ag71xx_rx_packets()'

2021-04-03 Thread Christophe JAILLET
There is no need to use 'list_for_each_entry_safe' here, as nothing is removed from the list in the 'for' loop. Use 'list_for_each_entry' instead, it is slightly less verbose. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/atheros/ag71xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2

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

2021-04-03 Thread Leon Romanovsky
On Sat, Apr 03, 2021 at 02:35:19AM +0100, Salil Mehta wrote: > 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 call

Re: [PATCH net-next v1 4/9] net: dsa: qca: ar9331: make proper initial port defaults

2021-04-03 Thread Oleksij Rempel
Am 04.04.21 um 02:16 schrieb Vladimir Oltean: > On Sat, Apr 03, 2021 at 01:48:43PM +0200, Oleksij Rempel wrote: >> Make sure that all external port are actually isolated from each other, >> so no packets are leaked. >> >> Signed-off-by: Oleksij Rempel >> --- >> drivers/net/dsa/qca/ar9331.c | 145

Re: [PATCH net-next v1 1/9] net: dsa: add rcv_post call back

2021-04-03 Thread Oleksij Rempel
Am 04.04.21 um 01:21 schrieb Vladimir Oltean: > On Sat, Apr 03, 2021 at 05:05:34PM +0300, Vladimir Oltean wrote: >> On Sat, Apr 03, 2021 at 01:48:40PM +0200, Oleksij Rempel wrote: >>> Some switches (for example ar9331) do not provide enough information >>> about forwarded packets. If the switch dec

Re: [PATCH net-next v1 2/9] net: dsa: tag_ar9331: detect IGMP and MLD packets

2021-04-03 Thread Oleksij Rempel
Am 04.04.21 um 02:02 schrieb Vladimir Oltean: > On Sat, Apr 03, 2021 at 07:14:56PM +0200, Oleksij Rempel wrote: >> Am 03.04.21 um 16:49 schrieb Andrew Lunn: @@ -31,6 +96,13 @@ static struct sk_buff *ar9331_tag_xmit(struct sk_buff *skb, __le16 *phdr; u16 hdr; +

[net-next 16/16] net/mlx5e: Dynamic alloc vlan table for netdev when needed

2021-04-03 Thread Saeed Mahameed
From: Vu Pham Dynamic allocate vlan table in mlx5e_priv for EN netdev when needed. Don't allocate it for representor netdev. Signed-off-by: Vu Pham Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/en/fs.h | 18 +-- .../net/ethernet/mellanox/mlx5/core/en_fs.c | 132 ++

[net-next 15/16] net/mlx5e: Dynamic alloc arfs table for netdev when needed

2021-04-03 Thread Saeed Mahameed
From: Vu Pham Dynamic allocate arfs table in mlx5e_priv for EN netdev when needed. Don't allocate it for representor netdev. Signed-off-by: Vu Pham Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/en/fs.h | 28 +- .../net/ethernet/mellanox/mlx5/core/en_arfs.c | 95 +

[net-next 14/16] net/mlx5e: Reject tc rules which redirect from a VF to itself

2021-04-03 Thread Saeed Mahameed
From: Ariel Levkovich Since there are self loopback prevention mechanisms at the VF level, offloading such rules which redirect from a VF to itself in the eswitch will break the datapath since the packets will be dropped once they go back to the vport they came from. Therefore, offloading such r

[net-next 13/16] net/mlx5: Use ida_alloc_range() instead of ida_simple_alloc()

2021-04-03 Thread Saeed Mahameed
From: Roi Dayan ida_simple_alloc() and remove functions are deprecated. Related change: commit 3264ceec8f17 ("lib/idr.c: document that ida_simple_{get,remove}() are deprecated") Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c |

[net-next 12/16] net/mlx5: E-Switch, move QoS specific fields to existing qos struct

2021-04-03 Thread Saeed Mahameed
From: Parav Pandit Function QoS related fields are already defined in qos related struct. min and max rate are left out to mlx5_vport_info struct. Move them to existing qos struct. Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eswitch.h

[net-next 11/16] net/mlx5: E-Switch, cut down mlx5_vport_info structure size by 8 bytes

2021-04-03 Thread Saeed Mahameed
From: Parav Pandit Structure mlx5_vport_info consumes 40 bytes of space due to a hole in it. After packing it reduces to 32 bytes. Currently: pahole -C mlx5_vport_info drivers/net/ethernet/mellanox/mlx5/core/eswitch.o struct mlx5_vport_info { u8 mac[6];

[net-next 10/16] net/mlx5: Pair mutex_destory with mutex_init for rate limit table

2021-04-03 Thread Saeed Mahameed
From: Parav Pandit Add missing mutex_destroy() to pair with mutex_init(). This should be done only when table is initialized, hence perform mutex_init() only when table is initialized. Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/rl.c

[net-next 09/16] net/mlx5: Allocate rate limit table when rate is configured

2021-04-03 Thread Saeed Mahameed
From: Parav Pandit A device supports 128 rate limiters. A static table allocation consumes 8KB of memory even when rate is not configured. Instead, allocate the table when at least one rate is configured. Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mell

[net-next 07/16] net/mlx5: Use helpers to allocate and free rl table entries

2021-04-03 Thread Saeed Mahameed
From: Parav Pandit User helper routines to allocate and free rate limit table entries. Subsequent patch extends use of these helpers to do allocation during rate entry allocation callback. Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/rl

[net-next 05/16] net/mlx5: Pack mlx5_rl_entry structure

2021-04-03 Thread Saeed Mahameed
From: Parav Pandit mlx5_rl_entry structure is not properly packed as shown below. Due to this an array of size 9144 bytes allocated which is aligned to 16Kbytes. Hence, pack the structure and avoid the wastage. This offers 8Kbytes of saving per mlx5_core_dev struct. pahole -C mlx5_rl_entry dri

[net-next 06/16] net/mlx5: Do not hold mutex while reading table constants

2021-04-03 Thread Saeed Mahameed
From: Parav Pandit Table max_size, min and max rate are constants initialized while table is created. Reading it doesn't need to hold a table mutex. Hence, read them without holding table mutex. Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/c

[net-next 08/16] net/mlx5: Use helper to increment, decrement rate entry refcount

2021-04-03 Thread Saeed Mahameed
From: Parav Pandit Rate limit entry refcount can be incremented uniformly when it is newly allocated or reused. So simplify the code to increment refcount at one place. Use decrement refcount helper in two routines. Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/et

[net-next 04/16] net/mlx5: Use unsigned int for free_count

2021-04-03 Thread Saeed Mahameed
From: Parav Pandit Fix the warning due to missing int. WARNING: Prefer 'unsigned int' to bare use of 'unsigned' + unsigned free_count; Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 2 +- 1 file changed, 1 insertion(+

[net-next 03/16] net/mlx5: E-Switch, move QoS specific fields to existing qos struct

2021-04-03 Thread Saeed Mahameed
From: Parav Pandit Function QoS related fields are already defined in qos related struct. min and max rate are left out to mlx5_vport_info struct. Move them to existing qos struct. Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/eswitch.c | 2

[net-next 02/16] net/mlx5: E-Switch, cut down mlx5_vport_info structure size by 8 bytes

2021-04-03 Thread Saeed Mahameed
From: Parav Pandit Structure mlx5_vport_info consumes 40 bytes of space due to a hole in it. After packing it reduces to 32 bytes. Currently: pahole -C mlx5_vport_info drivers/net/ethernet/mellanox/mlx5/core/eswitch.o struct mlx5_vport_info { u8 mac[6];

[pull request][net-next 00/16] mlx5 updates 2021-04-02

2021-04-03 Thread Saeed Mahameed
From: Saeed Mahameed Hi Dave, Jakub, This series provfides misc updates to mlx5. For more information please see tag log below. Please pull and let me know if there is any problem. Thanks, Saeed. --- The following changes since commit bd78980be1a68d14524c51c4b4170782fada622b: net: usb: ax8

[net-next 01/16] net/mlx5: CT: Add support for matching on ct_state inv and rel flags

2021-04-03 Thread Saeed Mahameed
From: Ariel Levkovich Add support for matching on ct_state inv and rel flags. Currently the support is only for match on -inv and -rel. Matching on +inv and +rel will be rejected. Example: $ tc filter add dev ens1f0_0 ingress prio 1 chain 1 proto ip flower \ ct_state -est-rel+trk \ action m

Re: [PATCH net-next v1 1/9] net: dsa: add rcv_post call back

2021-04-03 Thread Florian Fainelli
On 4/3/2021 16:21, Vladimir Oltean wrote: On Sat, Apr 03, 2021 at 05:05:34PM +0300, Vladimir Oltean wrote: On Sat, Apr 03, 2021 at 01:48:40PM +0200, Oleksij Rempel wrote: Some switches (for example ar9331) do not provide enough information about forwarded packets. If the switch decision was

Re: [PATCH net-next v1 7/9] net: dsa: qca: ar9331: add bridge support

2021-04-03 Thread Florian Fainelli
On 4/3/2021 04:48, Oleksij Rempel wrote: This switch is providing forwarding matrix, with it we can configure individual bridges. Potentially we can configure more then one not VLAN s/then/than/ based bridge on this HW. Signed-off-by: Oleksij Rempel --- drivers/net/dsa/qca/ar9331.c | 7

Re: [PATCH net-next v1 6/9] net: dsa: qca: ar9331: add ageing time support

2021-04-03 Thread Florian Fainelli
On 4/3/2021 04:48, Oleksij Rempel wrote: This switch provides global ageing time configuration, so let DSA use it. Signed-off-by: Oleksij Rempel Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH net-next v1 3/9] net: dsa: qca: ar9331: reorder MDIO write sequence

2021-04-03 Thread Florian Fainelli
On 4/3/2021 04:48, Oleksij Rempel wrote: In case of this switch we work with 32bit registers on top of 16bit bus. Some registers (for example access to forwarding database) have trigger bit on the first 16bit half of request and the result + configuration of request in the second half. Without

Re: [PATCH net-next v1 5/9] net: dsa: qca: ar9331: add forwarding database support

2021-04-03 Thread Andrew Lunn
> > Plus, i'm not actually sure we should be issuing warnings here. What > > does the bridge code do in this case? Is it silent and just does it, > > or does it issue a warning? > > :D > > What Oleksij doesn't know, I bet, is that he's using the bridge bypass > commands: > > bridge fdb add dev l

Re: [PATCH net-next v1 9/9] net: dsa: qca: ar9331: add vlan support

2021-04-03 Thread Vladimir Oltean
On Sat, Apr 03, 2021 at 01:48:48PM +0200, Oleksij Rempel wrote: > This switch provides simple VLAN resolution database for 16 entries (VLANs). > With this database we can cover typical functionalities as port based > VLANs, untagged and tagged egress. Port based ingress filtering. > > The VLAN dat

Re: [PATCH net-next v1 4/9] net: dsa: qca: ar9331: make proper initial port defaults

2021-04-03 Thread Vladimir Oltean
On Sat, Apr 03, 2021 at 01:48:43PM +0200, Oleksij Rempel wrote: > Make sure that all external port are actually isolated from each other, > so no packets are leaked. > > Signed-off-by: Oleksij Rempel > --- > drivers/net/dsa/qca/ar9331.c | 145 ++- > 1 file changed

Re: [PATCH net-next v1 2/9] net: dsa: tag_ar9331: detect IGMP and MLD packets

2021-04-03 Thread Vladimir Oltean
On Sat, Apr 03, 2021 at 07:14:56PM +0200, Oleksij Rempel wrote: > Am 03.04.21 um 16:49 schrieb Andrew Lunn: > >> @@ -31,6 +96,13 @@ static struct sk_buff *ar9331_tag_xmit(struct sk_buff > >> *skb, > >>__le16 *phdr; > >>u16 hdr; > >> > >> + if (dp->stp_state == BR_STATE_BLOCKING) { > >> +

Re: [PATCH net-next v1 5/9] net: dsa: qca: ar9331: add forwarding database support

2021-04-03 Thread Vladimir Oltean
On Sat, Apr 03, 2021 at 05:25:16PM +0200, Andrew Lunn wrote: > > +static int ar9331_sw_port_fdb_rmw(struct ar9331_sw_priv *priv, > > + const unsigned char *mac, > > + u8 port_mask_set, > > + u8 port_mask_clr) > > +{

Re: [PATCH net-next v1 1/9] net: dsa: add rcv_post call back

2021-04-03 Thread Vladimir Oltean
On Sat, Apr 03, 2021 at 05:05:34PM +0300, Vladimir Oltean wrote: > On Sat, Apr 03, 2021 at 01:48:40PM +0200, Oleksij Rempel wrote: > > Some switches (for example ar9331) do not provide enough information > > about forwarded packets. If the switch decision was made based on IPv4 > > or IPv6 header,

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

2021-04-03 Thread Phillip Potter
On Fri, Apr 02, 2021 at 11:12:36PM +0200, Eric Dumazet wrote: > > > 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: > U

Re: [RFC PATCH bpf-next 1/4] bpf: Allow trampoline re-attach

2021-04-03 Thread Alexei Starovoitov
On Sat, Apr 03, 2021 at 01:24:12PM +0200, Toke Høiland-Jørgensen wrote: > > if (!prog->aux->dst_trampoline && !tgt_prog) { > > - err = -ENOENT; > > - goto out_unlock; > > + /* > > +* Allow re-attach for tracing programs, if it's currently > > +

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

2021-04-03 Thread Alexei Starovoitov
On Sat, Apr 03, 2021 at 12:38:06AM +0530, Kumar Kartikeya Dwivedi wrote: > 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 f

Re: [PATCH net-next v1 2/9] net: dsa: tag_ar9331: detect IGMP and MLD packets

2021-04-03 Thread Oleksij Rempel
Am 03.04.21 um 16:49 schrieb Andrew Lunn: >> @@ -31,6 +96,13 @@ static struct sk_buff *ar9331_tag_xmit(struct sk_buff >> *skb, >> __le16 *phdr; >> u16 hdr; >> >> +if (dp->stp_state == BR_STATE_BLOCKING) { >> +/* TODO: should we reflect it in the stats? */ >> +

Re: [PATCH net-next v1 2/9] net: dsa: tag_ar9331: detect IGMP and MLD packets

2021-04-03 Thread Vladimir Oltean
On Sat, Apr 03, 2021 at 05:22:24PM +0200, Oleksij Rempel wrote: > Off-topic question, this patch set stops to work after rebasing against > latest netdev. I get following warning: > ip l s lan0 master test > RTNETLINK answers: Invalid argumen > > Are there some API changes? Yes, it's likely that

Re: [PATCH] net: netlink: fix error check in genl_family_rcv_msg_doit

2021-04-03 Thread Pavel Skripkin
Hi! On Sat, 2021-04-03 at 18:26 +0200, Johannes Berg wrote: > On Sat, 2021-04-03 at 15:13 +, Pavel Skripkin wrote: > > genl_family_rcv_msg_attrs_parse() can return NULL > > pointer: > > > > if (!ops->maxattr) > > return NULL; > > > > But this condition doesn't cause a

Re: [PATCH] net: netlink: fix error check in genl_family_rcv_msg_doit

2021-04-03 Thread Johannes Berg
On Sat, 2021-04-03 at 15:13 +, Pavel Skripkin wrote: > genl_family_rcv_msg_attrs_parse() can return NULL > pointer: > > if (!ops->maxattr) > return NULL; > > But this condition doesn't cause an error in > genl_family_rcv_msg_doit And I'm almost certain that in fact it

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

2021-04-03 Thread Andrii Nakryiko
On Fri, Apr 2, 2021 at 5:31 PM Martin KaFai Lau wrote: > > 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(

Re: [PATCH bpf-next v2] bpf: check flags in 'bpf_ringbuf_discard()' and 'bpf_ringbuf_submit()'

2021-04-03 Thread Andrii Nakryiko
On Sat, Apr 3, 2021 at 6:29 AM Pedro Tammela wrote: > > Em qua., 31 de mar. de 2021 às 04:02, Andrii Nakryiko > escreveu: > > > > On Tue, Mar 30, 2021 at 4:16 PM Alexei Starovoitov > > wrote: > > > > > > On Tue, Mar 30, 2021 at 3:54 PM Pedro Tammela wrote: > > > > > > > > BPF_CALL_2(bpf_ringbu

Re: [PATCH bpf-next] bpf: add 'BPF_RB_MAY_WAKEUP' flag

2021-04-03 Thread Andrii Nakryiko
On Sat, Apr 3, 2021 at 6:34 AM Pedro Tammela wrote: > > Em qua., 31 de mar. de 2021 às 03:54, Andrii Nakryiko > escreveu: > > > > On Sun, Mar 28, 2021 at 9:11 AM Pedro Tammela wrote: > > > > > > The current way to provide a no-op flag to 'bpf_ringbuf_submit()', > > > 'bpf_ringbuf_discard()' and

Re: [PATCH net-next v1 7/9] net: dsa: qca: ar9331: add bridge support

2021-04-03 Thread Andrew Lunn
On Sat, Apr 03, 2021 at 01:48:46PM +0200, Oleksij Rempel wrote: > This switch is providing forwarding matrix, with it we can configure > individual bridges. Potentially we can configure more then one not VLAN > based bridge on this HW. > > Signed-off-by: Oleksij Rempel > --- > drivers/net/dsa/qc

Re: [PATCH net-next v1 6/9] net: dsa: qca: ar9331: add ageing time support

2021-04-03 Thread Andrew Lunn
On Sat, Apr 03, 2021 at 01:48:45PM +0200, Oleksij Rempel wrote: > This switch provides global ageing time configuration, so let DSA use > it. > > Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Andrew

Re: [PATCH net-next v1 5/9] net: dsa: qca: ar9331: add forwarding database support

2021-04-03 Thread Andrew Lunn
> +static int ar9331_sw_port_fdb_rmw(struct ar9331_sw_priv *priv, > + const unsigned char *mac, > + u8 port_mask_set, > + u8 port_mask_clr) > +{ > + port_mask = FIELD_GET(AR9331_SW_AT_DES_PORT, f2); > +

Re: [PATCH net-next v1 2/9] net: dsa: tag_ar9331: detect IGMP and MLD packets

2021-04-03 Thread Oleksij Rempel
On Sat, Apr 03, 2021 at 04:46:06PM +0300, Vladimir Oltean wrote: > On Sat, Apr 03, 2021 at 03:26:36PM +0200, Oleksij Rempel wrote: > > On Sat, Apr 03, 2021 at 04:03:18PM +0300, Vladimir Oltean wrote: > > > Hi Oleksij, > > > > > > On Sat, Apr 03, 2021 at 01:48:41PM +0200, Oleksij Rempel wrote: > >

[PATCH] net: fix NULL ptr dereference in nl802154_del_llsec_key

2021-04-03 Thread Pavel Skripkin
syzbot reported NULL ptr dereference in nl802154_del_llsec_key()[1] The problem was in case of info->attrs[NL802154_ATTR_SEC_KEY] == NULL. nla_parse_nested_deprecated()[2] doesn't check this condition before calling nla_len()[3] Call Trace: nla_len include/net/netlink.h:1148 [inline]

[PATCH] net: netlink: fix error check in genl_family_rcv_msg_doit

2021-04-03 Thread Pavel Skripkin
genl_family_rcv_msg_attrs_parse() can return NULL pointer: if (!ops->maxattr) return NULL; But this condition doesn't cause an error in genl_family_rcv_msg_doit Signed-off-by: Pavel Skripkin --- net/netlink/genetlink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

Re: [PATCH net-next v1 4/9] net: dsa: qca: ar9331: make proper initial port defaults

2021-04-03 Thread Andrew Lunn
On Sat, Apr 03, 2021 at 01:48:43PM +0200, Oleksij Rempel wrote: > Make sure that all external port are actually isolated from each other, > so no packets are leaked. > > Signed-off-by: Oleksij Rempel > --- > drivers/net/dsa/qca/ar9331.c | 145 ++- > 1 file changed

Re: [PATCH net-next v1 3/9] net: dsa: qca: ar9331: reorder MDIO write sequence

2021-04-03 Thread Andrew Lunn
Hi Oleksij Maybe add a short comment about why the order is important. > - ret = __ar9331_mdio_write(sbus, AR9331_SW_MDIO_PHY_MODE_REG, reg, val); > + ret = __ar9331_mdio_write(sbus, AR9331_SW_MDIO_PHY_MODE_REG, reg + 2, > + val >> 16); > if (ret < 0) >

Re: [PATCH net-next v1 2/9] net: dsa: tag_ar9331: detect IGMP and MLD packets

2021-04-03 Thread Andrew Lunn
> @@ -31,6 +96,13 @@ static struct sk_buff *ar9331_tag_xmit(struct sk_buff *skb, > __le16 *phdr; > u16 hdr; > > + if (dp->stp_state == BR_STATE_BLOCKING) { > + /* TODO: should we reflect it in the stats? */ > + netdev_warn_once(dev, "%s:%i dropping blocking

Re: [PATCH net-next v1 5/9] net: dsa: qca: ar9331: add forwarding database support

2021-04-03 Thread kernel test robot
Hi Oleksij, I love your patch! Perhaps something to improve: [auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/Oleksij-Rempel/ar9331-mainline-some-parts-of-switch-functionality/20210403-195131 base: https://git.kernel.org/pub/scm/linux/kernel/git

Re: [PATCH net-next v1 1/9] net: dsa: add rcv_post call back

2021-04-03 Thread Vladimir Oltean
On Sat, Apr 03, 2021 at 01:48:40PM +0200, Oleksij Rempel wrote: > Some switches (for example ar9331) do not provide enough information > about forwarded packets. If the switch decision was made based on IPv4 > or IPv6 header, we need to analyze it and set proper flag. > > Potentially we can do it

Re: [PATCH net-next v1 2/9] net: dsa: tag_ar9331: detect IGMP and MLD packets

2021-04-03 Thread Vladimir Oltean
On Sat, Apr 03, 2021 at 03:26:36PM +0200, Oleksij Rempel wrote: > On Sat, Apr 03, 2021 at 04:03:18PM +0300, Vladimir Oltean wrote: > > Hi Oleksij, > > > > On Sat, Apr 03, 2021 at 01:48:41PM +0200, Oleksij Rempel wrote: > > > The ar9331 switch is not forwarding IGMP and MLD packets if IGMP > > > sn

Re: [PATCH bpf-next] bpf: add 'BPF_RB_MAY_WAKEUP' flag

2021-04-03 Thread Pedro Tammela
Em qua., 31 de mar. de 2021 às 03:54, Andrii Nakryiko escreveu: > > On Sun, Mar 28, 2021 at 9:11 AM Pedro Tammela wrote: > > > > The current way to provide a no-op flag to 'bpf_ringbuf_submit()', > > 'bpf_ringbuf_discard()' and 'bpf_ringbuf_output()' is to provide a '0' > > value. > > > > A '0' v

Re: [PATCH bpf-next v2] bpf: check flags in 'bpf_ringbuf_discard()' and 'bpf_ringbuf_submit()'

2021-04-03 Thread Pedro Tammela
Em qua., 31 de mar. de 2021 às 04:02, Andrii Nakryiko escreveu: > > On Tue, Mar 30, 2021 at 4:16 PM Alexei Starovoitov > wrote: > > > > On Tue, Mar 30, 2021 at 3:54 PM Pedro Tammela wrote: > > > > > > BPF_CALL_2(bpf_ringbuf_submit, void *, sample, u64, flags) > > > { > > > + if (unlikely

Re: [PATCH net-next v1 2/9] net: dsa: tag_ar9331: detect IGMP and MLD packets

2021-04-03 Thread Oleksij Rempel
On Sat, Apr 03, 2021 at 04:03:18PM +0300, Vladimir Oltean wrote: > Hi Oleksij, > > On Sat, Apr 03, 2021 at 01:48:41PM +0200, Oleksij Rempel wrote: > > The ar9331 switch is not forwarding IGMP and MLD packets if IGMP > > snooping is enabled. This patch is trying to mimic the HW heuristic to take >

Re: [PATCH net-next v1 2/9] net: dsa: tag_ar9331: detect IGMP and MLD packets

2021-04-03 Thread Vladimir Oltean
Hi Oleksij, On Sat, Apr 03, 2021 at 01:48:41PM +0200, Oleksij Rempel wrote: > The ar9331 switch is not forwarding IGMP and MLD packets if IGMP > snooping is enabled. This patch is trying to mimic the HW heuristic to take > same decisions as this switch would do to be able to tell the linux > bridg

Re: Packet gets stuck in NOLOCK pfifo_fast qdisc

2021-04-03 Thread Jiri Kosina
On Sat, 3 Apr 2021, Hillf Danton wrote: > >>> Sure. Seems they crept in over time. I had some plans to write a > >>> lockless HTB implementation. But with fq+EDT with BPF it seems that > >>> it is no longer needed, we have a more generic/better solution. So > >>> I dropped it. Also most folks sho

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

2021-04-03 Thread Vladimir Oltean
On Sat, Apr 03, 2021 at 01:07:29PM +0200, Toke Høiland-Jørgensen wrote: > Vladimir Oltean writes: > > > 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

[PATCH net-next v1 5/9] net: dsa: qca: ar9331: add forwarding database support

2021-04-03 Thread Oleksij Rempel
This switch provides simple address resolution table, without VLAN or multicast specific information. With this patch we are able now to read, modify unicast and mulicast addresses. Signed-off-by: Oleksij Rempel --- drivers/net/dsa/qca/ar9331.c | 356 +++ 1 file c

[PATCH net-next v1 7/9] net: dsa: qca: ar9331: add bridge support

2021-04-03 Thread Oleksij Rempel
This switch is providing forwarding matrix, with it we can configure individual bridges. Potentially we can configure more then one not VLAN based bridge on this HW. Signed-off-by: Oleksij Rempel --- drivers/net/dsa/qca/ar9331.c | 73 1 file changed, 73 inser

[PATCH net-next v1 3/9] net: dsa: qca: ar9331: reorder MDIO write sequence

2021-04-03 Thread Oleksij Rempel
In case of this switch we work with 32bit registers on top of 16bit bus. Some registers (for example access to forwarding database) have trigger bit on the first 16bit half of request and the result + configuration of request in the second half. Without this this patch, we would trigger database op

[PATCH net-next v1 6/9] net: dsa: qca: ar9331: add ageing time support

2021-04-03 Thread Oleksij Rempel
This switch provides global ageing time configuration, so let DSA use it. Signed-off-by: Oleksij Rempel --- drivers/net/dsa/qca/ar9331.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/dsa/qca/ar9331.c b/drivers/net/dsa/qca/ar9331.c index 4a98f14f31f4..b2c

[PATCH net-next v1 8/9] net: dsa: qca: ar9331: add STP support

2021-04-03 Thread Oleksij Rempel
According to the datasheet, this switch has configurable STP port states. Suddenly LISTENING and BLOCKING states didn't forwarded packets to the CPU and linux bridge continuously re enabled ports even if a loop was detected. To make it work, I reused bridge functionality to isolate port in LISTENI

[PATCH net-next v1 2/9] net: dsa: tag_ar9331: detect IGMP and MLD packets

2021-04-03 Thread Oleksij Rempel
The ar9331 switch is not forwarding IGMP and MLD packets if IGMP snooping is enabled. This patch is trying to mimic the HW heuristic to take same decisions as this switch would do to be able to tell the linux bridge if some packet was prabably forwarded or not. Signed-off-by: Oleksij Rempel ---

[PATCH net-next v1 1/9] net: dsa: add rcv_post call back

2021-04-03 Thread Oleksij Rempel
Some switches (for example ar9331) do not provide enough information about forwarded packets. If the switch decision was made based on IPv4 or IPv6 header, we need to analyze it and set proper flag. Potentially we can do it in existing rcv path, on other hand we can avoid part of duplicated work a

[PATCH net-next v1 0/9] ar9331: mainline some parts of switch functionality

2021-04-03 Thread Oleksij Rempel
Till now the ar9331 switch was supporting only port multiplexing mode. With this patch set we should be able to bridging, VLAN and STP Oleksij Rempel (9): net: dsa: add rcv_post call back net: dsa: tag_ar9331: detect IGMP and MLD packets net: dsa: qca: ar9331: reorder MDIO write sequence n

[PATCH net-next v1 9/9] net: dsa: qca: ar9331: add vlan support

2021-04-03 Thread Oleksij Rempel
This switch provides simple VLAN resolution database for 16 entries (VLANs). With this database we can cover typical functionalities as port based VLANs, untagged and tagged egress. Port based ingress filtering. The VLAN database is working on top of forwarding database. So, potentially, we can ha

[PATCH net-next v1 4/9] net: dsa: qca: ar9331: make proper initial port defaults

2021-04-03 Thread Oleksij Rempel
Make sure that all external port are actually isolated from each other, so no packets are leaked. Signed-off-by: Oleksij Rempel --- drivers/net/dsa/qca/ar9331.c | 145 ++- 1 file changed, 143 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/qca/ar9331.c

Re: [PATCH rdma-next v2 0/5] Get rid of custom made module dependency

2021-04-03 Thread Leon Romanovsky
On Sat, Apr 03, 2021 at 03:52:13PM +0530, Devesh Sharma wrote: > On Thu, Apr 1, 2021 at 12:27 PM Leon Romanovsky wrote: > > > > From: Leon Romanovsky > > > > Changelog: > > v2: > > * kbuild spotted that I didn't delete all code in patch #5, so deleted > >even more ulp_ops derefences. > > v1:

Re: [RFC PATCH bpf-next 1/4] bpf: Allow trampoline re-attach

2021-04-03 Thread Toke Høiland-Jørgensen
Jiri Olsa writes: > Currently we don't allow re-attaching of trampolines. Once > it's detached, it can't be re-attach even when the program > is still loaded. > > Adding the possibility to re-attach the loaded tracing > kernel program. Hmm, yeah, didn't really consider this case when I added the

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

2021-04-03 Thread Toke Høiland-Jørgensen
Vladimir Oltean writes: > 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

Re: [PATCH rdma-next v2 0/5] Get rid of custom made module dependency

2021-04-03 Thread Devesh Sharma
On Thu, Apr 1, 2021 at 12:27 PM Leon Romanovsky wrote: > > From: Leon Romanovsky > > Changelog: > v2: > * kbuild spotted that I didn't delete all code in patch #5, so deleted >even more ulp_ops derefences. > v1: https://lore.kernel.org/linux-rdma/20210329085212.257771-1-l...@kernel.org > *

Re: Semantics of AF_PACKET sockets on bridge port interface

2021-04-03 Thread Russell King - ARM Linux admin
On Sat, Apr 03, 2021 at 10:54:18AM +0100, Russell King - ARM Linux admin wrote: > Hi, > > This question has probably come up several times before, but there > doesn't seem to be a solution yet. > > Scenario: a network interface, such as a wireless adapter or a > network interface supporting PTP,

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

2021-04-03 Thread Vlad Buslov
On Sat 03 Apr 2021 at 02:14, Cong Wang wrote: > 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 l

Semantics of AF_PACKET sockets on bridge port interface

2021-04-03 Thread Russell King - ARM Linux admin
Hi, This question has probably come up several times before, but there doesn't seem to be a solution yet. Scenario: a network interface, such as a wireless adapter or a network interface supporting PTP, is part of a bridge. Userspace wishes to capture packets sent using a specific Ethernet protoc

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

2021-04-03 Thread Vlad Buslov
On Sat 03 Apr 2021 at 01:13, Cong Wang wrote: > 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 point