[PATCH net-next v3 1/8] Documentation/bindings: net: ocelot: document the PTP bank

2019-07-24 Thread Antoine Tenart
One additional register range needs to be described within the Ocelot device tree node: the PTP. This patch documents the binding needed to do so. Signed-off-by: Antoine Tenart --- Documentation/devicetree/bindings/net/mscc-ocelot.txt | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions

[PATCH net-next v3 4/8] MIPS: dts: mscc: describe the PTP ready interrupt

2019-07-24 Thread Antoine Tenart
This patch adds a description of the PTP ready interrupt, which can be triggered when a PTP timestamp is available on an hardware FIFO. Signed-off-by: Antoine Tenart Acked-by: Paul Burton --- arch/mips/boot/dts/mscc/ocelot.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH net-next v3 3/8] Documentation/bindings: net: ocelot: document the PTP ready IRQ

2019-07-24 Thread Antoine Tenart
One additional interrupt needs to be described within the Ocelot device tree node: the PTP ready one. This patch documents the binding needed to do so. Signed-off-by: Antoine Tenart --- Documentation/devicetree/bindings/net/mscc-ocelot.txt | 11 ++- 1 file changed, 6 insertions(+), 5

[PATCH net-next v3 6/8] net: mscc: improve the frame header parsing readability

2019-07-24 Thread Antoine Tenart
This cosmetic patch improves the frame header parsing readability by introducing a new macro to access and mask its fields. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot_board.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a

[PATCH net-next v3 2/8] MIPS: dts: mscc: describe the PTP register range

2019-07-24 Thread Antoine Tenart
This patch adds one register range within the mscc,vsc7514-switch node, to describe the PTP registers. Signed-off-by: Antoine Tenart Acked-by: Paul Burton --- arch/mips/boot/dts/mscc/ocelot.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/boot/dts/mscc

[PATCH net-next v3 5/8] net: mscc: describe the PTP register range

2019-07-24 Thread Antoine Tenart
This patch adds support for using the PTP register range, and adds a description of its registers. This bank is used when configuring PTP. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot.h | 9 ++ drivers/net/ethernet/mscc/ocelot_board.c | 10 +- drivers/net

[PATCH net-next v3 7/8] net: mscc: remove the frame_info cpuq member

2019-07-24 Thread Antoine Tenart
In struct frame_info, the cpuq member is never used. This cosmetic patch removes it from the structure, and from the parsing of the frame header as it's only set but never used. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot.h | 1 - drivers/net/ethernet

[PATCH net-next v3 8/8] net: mscc: PTP Hardware Clock (PHC) support

2019-07-24 Thread Antoine Tenart
This patch adds support for PTP Hardware Clock (PHC) to the Ocelot switch for both PTP 1-step and 2-step modes. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot.c | 394 ++- drivers/net/ethernet/mscc/ocelot.h | 39 +++ drivers/net/ethernet/mscc

[PATCH net-next v3 0/8] net: mscc: PTP Hardware Clock (PHC) support

2019-07-24 Thread Antoine Tenart
case of ptp_clock_register(). - Added comments on optional dt properties. Antoine Tenart (8): Documentation/bindings: net: ocelot: document the PTP bank MIPS: dts: mscc: describe the PTP register range Documentation/bindings: net: ocelot: document the PTP ready IRQ MIPS: dts: mscc: des

Re: [PATCH net-next v3 8/8] net: mscc: PTP Hardware Clock (PHC) support

2019-07-25 Thread Antoine Tenart
Hi David, On Wed, Jul 24, 2019 at 11:52:26AM -0700, David Miller wrote: > From: Antoine Tenart > Date: Wed, 24 Jul 2019 10:17:15 +0200 > > > +static int ocelot_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) > > +{ > > + struct ocelot *ocelot = cont

[PATCH net-next v4 0/6] net: mscc: PTP Hardware Clock (PHC) support

2019-07-25 Thread Antoine Tenart
se of ptp_clock_register(). - Added comments on optional dt properties. Antoine Tenart (6): Documentation/bindings: net: ocelot: document the PTP bank Documentation/bindings: net: ocelot: document the PTP ready IRQ net: mscc: describe the PTP register range net: mscc: improve the frame h

[PATCH net-next v4 2/6] Documentation/bindings: net: ocelot: document the PTP ready IRQ

2019-07-25 Thread Antoine Tenart
One additional interrupt needs to be described within the Ocelot device tree node: the PTP ready one. This patch documents the binding needed to do so. Signed-off-by: Antoine Tenart --- Documentation/devicetree/bindings/net/mscc-ocelot.txt | 11 ++- 1 file changed, 6 insertions(+), 5

[PATCH net-next v4 3/6] net: mscc: describe the PTP register range

2019-07-25 Thread Antoine Tenart
This patch adds support for using the PTP register range, and adds a description of its registers. This bank is used when configuring PTP. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot.h | 9 ++ drivers/net/ethernet/mscc/ocelot_board.c | 10 +- drivers/net

[PATCH net-next v4 1/6] Documentation/bindings: net: ocelot: document the PTP bank

2019-07-25 Thread Antoine Tenart
One additional register range needs to be described within the Ocelot device tree node: the PTP. This patch documents the binding needed to do so. Signed-off-by: Antoine Tenart --- Documentation/devicetree/bindings/net/mscc-ocelot.txt | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions

[PATCH net-next v4 5/6] net: mscc: remove the frame_info cpuq member

2019-07-25 Thread Antoine Tenart
In struct frame_info, the cpuq member is never used. This cosmetic patch removes it from the structure, and from the parsing of the frame header as it's only set but never used. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot.h | 1 - drivers/net/ethernet

[PATCH net-next v4 6/6] net: mscc: PTP Hardware Clock (PHC) support

2019-07-25 Thread Antoine Tenart
This patch adds support for PTP Hardware Clock (PHC) to the Ocelot switch for both PTP 1-step and 2-step modes. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot.c | 394 ++- drivers/net/ethernet/mscc/ocelot.h | 39 +++ drivers/net/ethernet/mscc

[PATCH net-next v4 4/6] net: mscc: improve the frame header parsing readability

2019-07-25 Thread Antoine Tenart
This cosmetic patch improves the frame header parsing readability by introducing a new macro to access and mask its fields. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot_board.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a

[PATCH net-next v5 2/6] Documentation/bindings: net: ocelot: document the PTP ready IRQ

2019-08-07 Thread Antoine Tenart
One additional interrupt needs to be described within the Ocelot device tree node: the PTP ready one. This patch documents the binding needed to do so. Signed-off-by: Antoine Tenart --- Documentation/devicetree/bindings/net/mscc-ocelot.txt | 11 ++- 1 file changed, 6 insertions(+), 5

[PATCH net-next v5 0/6] net: mscc: PTP Hardware Clock (PHC) support

2019-08-07 Thread Antoine Tenart
ak in ocelot_deinit() by calling dev_kfree_skb_any(). - Fixed a locking issue in get_hwtimestamp(). - Handled the NULL case of ptp_clock_register(). - Added comments on optional dt properties. Antoine Tenart (6): Documentation/bindings: net: ocelot: document the PTP bank Documentation/bin

[PATCH net-next v5 3/6] net: mscc: describe the PTP register range

2019-08-07 Thread Antoine Tenart
This patch adds support for using the PTP register range, and adds a description of its registers. This bank is used when configuring PTP. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot.h | 9 ++ drivers/net/ethernet/mscc/ocelot_board.c | 10 +- drivers/net

[PATCH net-next v5 1/6] Documentation/bindings: net: ocelot: document the PTP bank

2019-08-07 Thread Antoine Tenart
One additional register range needs to be described within the Ocelot device tree node: the PTP. This patch documents the binding needed to do so. Signed-off-by: Antoine Tenart --- Documentation/devicetree/bindings/net/mscc-ocelot.txt | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions

[PATCH net-next v5 4/6] net: mscc: improve the frame header parsing readability

2019-08-07 Thread Antoine Tenart
This cosmetic patch improves the frame header parsing readability by introducing a new macro to access and mask its fields. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot_board.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a

[PATCH net-next v5 5/6] net: mscc: remove the frame_info cpuq member

2019-08-07 Thread Antoine Tenart
In struct frame_info, the cpuq member is never used. This cosmetic patch removes it from the structure, and from the parsing of the frame header as it's only set but never used. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot.h | 1 - drivers/net/ethernet

[PATCH net-next v5 6/6] net: mscc: PTP Hardware Clock (PHC) support

2019-08-07 Thread Antoine Tenart
This patch adds support for PTP Hardware Clock (PHC) to the Ocelot switch for both PTP 1-step and 2-step modes. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot.c | 396 ++- drivers/net/ethernet/mscc/ocelot.h | 39 +++ drivers/net/ethernet/mscc

Re: [PATCH v2 net-next 2/2] net: mvpp2: support multiple comphy lanes

2019-08-09 Thread Antoine Tenart
Hello Matt, On Thu, Aug 08, 2019 at 07:06:06PM -0400, Matt Pelland wrote: > > static void mvpp2_port_enable(struct mvpp2_port *port) > @@ -3389,7 +3412,9 @@ static void mvpp2_stop_dev(struct mvpp2_port *port) > > if (port->phylink) > phylink_stop(port->phylink); > - ph

Re: [PATCH v2 net-next 1/2] net: mvpp2: implement RXAUI support

2019-08-09 Thread Antoine Tenart
Hello Matt, On Thu, Aug 08, 2019 at 07:06:05PM -0400, Matt Pelland wrote: > > +static void mvpp22_gop_init_rxaui(struct mvpp2_port *port) > +{ > + struct mvpp2 *priv = port->priv; > + void __iomem *xpcs; > + u32 val; > + > + xpcs = priv->iface_base + MVPP22_XPCS_BASE(port->gop_id

Re: [PATCH v2 net-next 0/2] net: mvpp2: Implement RXAUI Support

2019-08-09 Thread Antoine Tenart
Hello Matt, One small comment: it seems you made a typo on davem's email address. It's .net, not .com :) Thanks, Antoine On Thu, Aug 08, 2019 at 07:06:04PM -0400, Matt Pelland wrote: > This patch set implements support for configuring Marvell's mvpp2 hardware for > RXAUI operation. There are two

Re: [PATCH v2 net-next 2/2] net: mvpp2: support multiple comphy lanes

2019-08-12 Thread Antoine Tenart
Hello Matt, On Fri, Aug 09, 2019 at 06:20:28PM -0400, Matt Pelland wrote: > On Fri, Aug 09, 2019 at 10:32:50AM +0200, Antoine Tenart wrote: > > On Thu, Aug 08, 2019 at 07:06:06PM -0400, Matt Pelland wrote: > > > @@ -5084,14 +5107,38 @@ static int mvpp2_port_probe(struct >

Re: [PATCH net-next v5 6/6] net: mscc: PTP Hardware Clock (PHC) support

2019-08-12 Thread Antoine Tenart
Hi Andrew, On Sat, Aug 10, 2019 at 07:32:24PM +0200, Andrew Lunn wrote: > > @@ -596,11 +606,53 @@ static int ocelot_port_xmit(struct sk_buff *skb, > > struct net_device *dev) > > > > dev->stats.tx_packets++; > > dev->stats.tx_bytes += skb->len; > > - dev_kfree_skb_any(skb); > > + > >

[PATCH net-next v6 6/6] net: mscc: PTP Hardware Clock (PHC) support

2019-08-12 Thread Antoine Tenart
This patch adds support for PTP Hardware Clock (PHC) to the Ocelot switch for both PTP 1-step and 2-step modes. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot.c | 401 ++- drivers/net/ethernet/mscc/ocelot.h | 39 +++ drivers/net/ethernet/mscc

[PATCH net-next v6 2/6] Documentation/bindings: net: ocelot: document the PTP ready IRQ

2019-08-12 Thread Antoine Tenart
One additional interrupt needs to be described within the Ocelot device tree node: the PTP ready one. This patch documents the binding needed to do so. Signed-off-by: Antoine Tenart Reviewed-by: Andrew Lunn --- Documentation/devicetree/bindings/net/mscc-ocelot.txt | 11 ++- 1 file

[PATCH net-next v6 5/6] net: mscc: remove the frame_info cpuq member

2019-08-12 Thread Antoine Tenart
In struct frame_info, the cpuq member is never used. This cosmetic patch removes it from the structure, and from the parsing of the frame header as it's only set but never used. Signed-off-by: Antoine Tenart Reviewed-by: Andrew Lunn --- drivers/net/ethernet/mscc/ocelot.h | 1 - dr

[PATCH net-next v6 0/6] net: mscc: PTP Hardware Clock (PHC) support

2019-08-12 Thread Antoine Tenart
stamp(). - Handled the NULL case of ptp_clock_register(). - Added comments on optional dt properties. Antoine Tenart (6): Documentation/bindings: net: ocelot: document the PTP bank Documentation/bindings: net: ocelot: document the PTP ready IRQ net: mscc: describe the PTP register range net:

[PATCH net-next v6 1/6] Documentation/bindings: net: ocelot: document the PTP bank

2019-08-12 Thread Antoine Tenart
One additional register range needs to be described within the Ocelot device tree node: the PTP. This patch documents the binding needed to do so. Signed-off-by: Antoine Tenart Reviewed-by: Andrew Lunn --- Documentation/devicetree/bindings/net/mscc-ocelot.txt | 9 ++--- 1 file changed, 6

[PATCH net-next v6 4/6] net: mscc: improve the frame header parsing readability

2019-08-12 Thread Antoine Tenart
This cosmetic patch improves the frame header parsing readability by introducing a new macro to access and mask its fields. Signed-off-by: Antoine Tenart --- drivers/net/ethernet/mscc/ocelot_board.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a

[PATCH net-next v6 3/6] net: mscc: describe the PTP register range

2019-08-12 Thread Antoine Tenart
This patch adds support for using the PTP register range, and adds a description of its registers. This bank is used when configuring PTP. Signed-off-by: Antoine Tenart Reviewed-by: Andrew Lunn --- drivers/net/ethernet/mscc/ocelot.h | 9 ++ drivers/net/ethernet/mscc/ocelot_board.c

[PATCH net 4/4] net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc

2020-12-17 Thread Antoine Tenart
("net-sysfs: Add interface for Rx queue(s) map per Tx queue") Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 62ca2f2c0ee6..daf502c13d6d 100644

[PATCH net 3/4] net-sysfs: take the rtnl lock when storing xps_rxqs

2020-12-17 Thread Antoine Tenart
o xps_rxqs in a concurrent thread. With the right timing an oops is triggered. Fixes: 8af2c06ff4b1 ("net-sysfs: Add interface for Rx queue(s) map per Tx queue") Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/core/n

[PATCH net 0/4] net-sysfs: fix race conditions in the xps code

2020-12-17 Thread Antoine Tenart
is given in each of the commit logs. Thanks! Antoine Antoine Tenart (4): net-sysfs: take the rtnl lock when storing xps_cpus net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc net-sysfs: take the rtnl lock when storing xps_rxqs net-sysfs: take the rtnl lock when access

[PATCH net 1/4] net-sysfs: take the rtnl lock when storing xps_cpus

2020-12-17 Thread Antoine Tenart
in a concurrent thread. With the right timing an oops is triggered. Fixes: 184c449f91fe ("net: Add support for XPS with QoS via traffic classes") Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/core/net-sysfs.c b/n

[PATCH net 2/4] net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc

2020-12-17 Thread Antoine Tenart
;net: Add support for XPS with QoS via traffic classes") Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 29 ++--- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 7cc15dec1717..65886bfbf822 100644

Re: [PATCH net] net: mvpp2: prs: fix PPPoE with ipv6 packet parse

2020-12-17 Thread Antoine Tenart
Hi Stefan, Quoting stef...@marvell.com (2020-12-17 18:23:11) > From: Stefan Chulski > > Current PPPoE+IPv6 entry is jumping to 'next-hdr' > field and not to 'DIP' field as done for IPv4. > > Fixes: db9d7d36eecc ("net: mvpp2: Split the PPv2 driver to a dedicated > directory") That's not the co

Re: [PATCH net] net: mvpp2: Add TCAM entry to drop flow control pause frames

2020-12-17 Thread Antoine Tenart
Quoting stef...@marvell.com (2020-12-17 18:45:06) > From: Stefan Chulski > > Issue: > Flow control frame used to pause GoP(MAC) was delivered to the CPU > and created a load on the CPU. Since XOFF/XON frames are used only > by MAC, these frames should be dropped inside MAC. > > Fix: > According

Re: [PATCH net 1/4] net-sysfs: take the rtnl lock when storing xps_cpus

2020-12-18 Thread Antoine Tenart
oss > # install riscv cross compiling tool for clang build > # apt-get install binutils-riscv64-linux-gnu > # > https://github.com/0day-ci/linux/commit/f989c3dcbe4d9abd1c6c48b34f08c6c0cd9d44b3 > git remote add linux-review https://github.com/0day-ci/l

Re: [PATCH net 1/4] net-sysfs: take the rtnl lock when storing xps_cpus

2020-12-19 Thread Antoine Tenart
Hi Jakub, Alexander, Quoting Alexander Duyck (2020-12-19 02:41:08) > On Fri, Dec 18, 2020 at 4:30 PM Jakub Kicinski wrote: > > > > Two things: (a) is the datapath not exposed to a similar problem? > > __get_xps_queue_idx() uses dev->tc_num in a very similar fashion. > > I think we are shielded f

[PATCH net v2 0/3] net-sysfs: fix race conditions in the xps code

2020-12-21 Thread Antoine Tenart
. I updated its commit log to describe both races. Thanks! Antoine Antoine Tenart (3): net: fix race conditions in xps by locking the maps and dev->tc_num net: move the xps cpus retrieval out of net-sysfs net: move the xps rxqs retrieval out of net-sysfs include/linux/netdevice.h | 9 +

[PATCH net v2 1/3] net: fix race conditions in xps by locking the maps and dev->tc_num

2020-12-21 Thread Antoine Tenart
This is why the patch is a little bit longer, and moves netdev_unbind_sb_channel up in the file. Fixes: 184c449f91fe ("net: Add support for XPS with QoS via traffic classes") Signed-off-by: Antoine Tenart --- net/core/dev.c | 122 -

[PATCH net v2 3/3] net: move the xps rxqs retrieval out of net-sysfs

2020-12-21 Thread Antoine Tenart
s to keep xps_cpus_show and xps_rxqs_show synced as their logic is the same (as in __netif_set_xps_queue, the function allocating and setting them up). Fixes: 8af2c06ff4b1 ("net-sysfs: Add interface for Rx queue(s) map per Tx queue") Signed-off-by: Antoine Tenart --- include/linux/netdevic

[PATCH net v2 2/3] net: move the xps cpus retrieval out of net-sysfs

2020-12-21 Thread Antoine Tenart
e xps_map mutex is defined and used. Fixes: 184c449f91fe ("net: Add support for XPS with QoS via traffic classes") Signed-off-by: Antoine Tenart --- include/linux/netdevice.h | 8 ++ net/core/dev.c| 59 +++ net/c

Re: [PATCH net v2 2/3] net: move the xps cpus retrieval out of net-sysfs

2020-12-22 Thread Antoine Tenart
Hi Alexander, Quoting Alexander Duyck (2020-12-21 23:33:15) > > One thing I might change is to actually bump this patch up in the > patch set as I think it would probably make things a bit cleaner to > read as you are going to be moving the other functions to this pattern > as well. Right. If it

Re: [PATCH net v2 1/3] net: fix race conditions in xps by locking the maps and dev->tc_num

2020-12-22 Thread Antoine Tenart
Hello Alexander, Jakub, Quoting Alexander Duyck (2020-12-22 00:21:57) > > Looking over this patch it seems kind of obvious that extending the > xps_map_mutex is making things far more complex then they need to be. > > Applying the rtnl_mutex would probably be much simpler. Although as I > think

[PATCH net] net: ip6_gre: set dev->hard_header_len when using header_ops

2020-11-30 Thread Antoine Tenart
en should reflect the length of the header created. Otherwise, when not used, dev->needed_headroom should be used. Fixes: eb95f52fc72d ("net: ipv6_gre: Fix GRO to work on IPv6 over GRE tap") Cc: Maria Pasechnik Signed-off-by: Antoine Tenart --- net/ipv6/ip6_gre.c | 16 +-

Re: [PATCH net-next 3/3] net: phy: mscc: use new PTP_MSGTYPE_* defines

2020-11-23 Thread Antoine Tenart
Hello Christian, Quoting Christian Eggers (2020-11-22 09:26:36) > Use recently introduced PTP_MSGTYPE_SYNC and PTP_MSGTYPE_DELAY_REQ > defines instead of a driver internal enumeration. > > Signed-off-by: Christian Eggers Reviewed-by: Antoine Tenart Thanks! Antoine > Cc: Quent

[PATCH net-next] netfilter: bridge: reset skb->pkt_type after NF_INET_POST_ROUTING traversal

2020-11-23 Thread Antoine Tenart
e cares about the value of skb->pkt_type after br_dev_queue_push_xmit (which isn't true), resetting it to its original value should be safe. Signed-off-by: Antoine Tenart --- net/bridge/br_netfilter_hooks.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/br

Re: [net] net: phy: mscc: adjust the phy support for PTP and MACsec

2020-11-11 Thread Antoine Tenart
Hi Steen! Either this is a fix and it would need a Fixes: tag in addition to the Signed-off-by: one (you can have a look at the git history to see what is the format); or the patch is not a fix and then it should have [net-next] in its subject instead of [net]. Please have a look at the relevant

Re: [net v2] net: phy: mscc: adjust the phy support for PTP and MACsec

2020-11-11 Thread Antoine Tenart
Hi Steen, Quoting Steen Hegelund (2020-11-11 16:17:53) > The MSCC PHYs selected for PTP and MACSec was not correct > > - PTP > - Add VSC8572 and VSC8574 > > - MACsec > - Removed VSC8575 > > The relevant datasheets can be found here: > - VSC8572: https://www.microchip.com/wwwproducts/e

Re: [PATCH net v2] net: phy: mscc: remove non-MACSec compatible phy

2020-11-13 Thread Antoine Tenart
the "Fixes:" tag > > Fixes: 1bbe0ecc2a1a ("net: phy: mscc: macsec initialization") > Signed-off-by: Steen Hegelund Reviewed-by: Antoine Tenart Small comment: you can put the commit history after the --- so it doesn't end-up in the commit log (except when it's re

Re: [PATCH v2] net: phy: mscc: fix excluded_middle.cocci warnings

2020-11-16 Thread Antoine Tenart
_middle.cocci script") > CC: Denis Efremov > Reported-by: kernel test robot > Signed-off-by: kernel test robot > Signed-off-by: Julia Lawall Reviewed-by: Antoine Tenart Thanks! Antoine > --- > > v2: add netdev mailing list > > tree: https://git.kerne

Re: [PATCH net v2 1/3] net: fix race conditions in xps by locking the maps and dev->tc_num

2020-12-23 Thread Antoine Tenart
Hi Jakub, Quoting Jakub Kicinski (2020-12-23 19:27:29) > On Tue, 22 Dec 2020 08:12:28 -0800 Alexander Duyck wrote: > > On Tue, Dec 22, 2020 at 1:21 AM Antoine Tenart wrote: > > > > > If I understood correctly, as things are a bit too complex now, you > > >

Re: [PATCH net v2 1/3] net: fix race conditions in xps by locking the maps and dev->tc_num

2020-12-23 Thread Antoine Tenart
Quoting Jakub Kicinski (2020-12-23 21:11:10) > On Wed, 23 Dec 2020 20:36:33 +0100 Antoine Tenart wrote: > > Quoting Jakub Kicinski (2020-12-23 19:27:29) > > > On Tue, 22 Dec 2020 08:12:28 -0800 Alexander Duyck wrote: > > > > On Tue, Dec 22, 2020 at 1:21 AM

Re: [PATCH net v2 1/3] net: fix race conditions in xps by locking the maps and dev->tc_num

2020-12-23 Thread Antoine Tenart
Quoting Jakub Kicinski (2020-12-23 21:43:15) > On Wed, 23 Dec 2020 21:35:15 +0100 Antoine Tenart wrote: > > > > - For net-next, to resend patches 2 and 3 from v2 (they'll have to be > > > > slightly reworked, to take into account the review from Alexander a

[PATCH net v3 0/4] net-sysfs: fix race conditions in the xps code

2020-12-23 Thread Antoine Tenart
Thanks! Antoine Antoine Tenart (4): net-sysfs: take the rtnl lock when storing xps_cpus net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc net-sysfs: take the rtnl lock when storing xps_rxqs net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc net/

[PATCH net v3 3/4] net-sysfs: take the rtnl lock when storing xps_rxqs

2020-12-23 Thread Antoine Tenart
_queue, netdev_set_num_tc and netdev_reset_tc should be mutually exclusive. We do that by taking the rtnl lock in xps_rxqs_store. Fixes: 8af2c06ff4b1 ("net-sysfs: Add interface for Rx queue(s) map per Tx queue") Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 7 +++ 1 file

[PATCH net v3 4/4] net-sysfs: take the rtnl lock when accessing xps_rxqs_map and num_tc

2020-12-23 Thread Antoine Tenart
("net-sysfs: Add interface for Rx queue(s) map per Tx queue") Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 62ca2f2c0ee6..daf502c13d6d 100644

[PATCH net v3 2/4] net-sysfs: take the rtnl lock when accessing xps_cpus_map and num_tc

2020-12-23 Thread Antoine Tenart
;net: Add support for XPS with QoS via traffic classes") Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 29 ++--- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 7cc15dec1717..65886bfbf822 100644

[PATCH net v3 1/4] net-sysfs: take the rtnl lock when storing xps_cpus

2020-12-23 Thread Antoine Tenart
_queue, netdev_set_num_tc and netdev_reset_tc should be mutually exclusive. We do that by taking the rtnl lock in xps_cpus_store. Fixes: 184c449f91fe ("net: Add support for XPS with QoS via traffic classes") Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 6 ++ 1 file changed,

[PATCH net 0/3] net-sysfs: move the xps cpus/rxqs retrieval in a common function

2021-01-06 Thread Antoine Tenart
looks better and is easier to review. Thanks! Antoine [1] https://lore.kernel.org/netdev/160875219353.1783433.8066935261216141538@kwain.local/ Antoine Tenart (3): net-sysfs: convert xps_cpus_show to bitmap_zalloc net-sysfs: store the return of get_netdev_queue_index in an unsigned int

[PATCH net 2/3] net-sysfs: store the return of get_netdev_queue_index in an unsigned int

2021-01-06 Thread Antoine Tenart
In net-sysfs, get_netdev_queue_index returns an unsigned int. Some of its callers use an unsigned long to store the returned value. Update the code to be consistent, this should only be cosmetic. Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 11 +++ 1 file changed, 7

[PATCH net 3/3] net-sysfs: move the xps cpus/rxqs retrieval in a common function

2021-01-06 Thread Antoine Tenart
, xps_queue_show, to improve maintenance. While the rtnl lock could be held in the new xps_queue_show, it is still held in xps_cpus_show and xps_rxqs_show as this is an important information when looking at those two functions. This does not add complexity. Signed-off-by: Antoine Tenart --- net/core/net

[PATCH net 1/3] net-sysfs: convert xps_cpus_show to bitmap_zalloc

2021-01-06 Thread Antoine Tenart
Use bitmap_zalloc instead if zalloc_cpumask_var in xps_cpus_show to align with xps_rxqs_show. This will improve maintenance and allow us to factorize the two functions. The function should behave the same. Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 12 ++-- 1 file changed

Re: [PATCH net 3/3] net-sysfs: move the xps cpus/rxqs retrieval in a common function

2021-01-07 Thread Antoine Tenart
Quoting Alexander Duyck (2021-01-06 20:54:11) > On Wed, Jan 6, 2021 at 10:04 AM Antoine Tenart wrote: > > +/* Should be called with the rtnl lock held. */ > > +static int xps_queue_show(struct net_device *dev, unsigned long **mask, > > + uns

Re: [PATCH net 3/3] net-sysfs: move the xps cpus/rxqs retrieval in a common function

2021-01-08 Thread Antoine Tenart
Quoting Alexander Duyck (2021-01-07 17:38:35) > On Thu, Jan 7, 2021 at 12:54 AM Antoine Tenart wrote: > > > > Quoting Alexander Duyck (2021-01-06 20:54:11) > > > On Wed, Jan 6, 2021 at 10:04 AM Antoine Tenart wrote: > > > > That would require to hold rcu_rea

Re: [PATCH net 3/3] net-sysfs: move the xps cpus/rxqs retrieval in a common function

2021-01-08 Thread Antoine Tenart
Quoting Alexander Duyck (2021-01-08 17:33:01) > On Fri, Jan 8, 2021 at 1:07 AM Antoine Tenart wrote: > > > > Quoting Alexander Duyck (2021-01-07 17:38:35) > > > On Thu, Jan 7, 2021 at 12:54 AM Antoine Tenart wrote: > > > > > > > > Quoting Alexan

Re: [PATCH net 3/3] net-sysfs: move the xps cpus/rxqs retrieval in a common function

2021-01-08 Thread Antoine Tenart
Quoting Alexander Duyck (2021-01-08 23:04:57) > On Fri, Jan 8, 2021 at 10:58 AM Antoine Tenart wrote: > > > > Quoting Alexander Duyck (2021-01-08 17:33:01) > > > On Fri, Jan 8, 2021 at 1:07 AM Antoine Tenart wrote: > > > > > > > > Quoting Alexan

[PATCH net-next 01/11] net-sysfs: convert xps_cpus_show to bitmap_zalloc

2021-01-28 Thread Antoine Tenart
Use bitmap_zalloc instead if zalloc_cpumask_var in xps_cpus_show to align with xps_rxqs_show. This will improve maintenance and allow us to factorize the two functions. The function should behave the same. Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 12 ++-- 1 file changed

[PATCH net-next 00/11] net: xps: improve the xps maps handling

2021-01-28 Thread Antoine Tenart
Thanks! Antoine [1] https://lore.kernel.org/netdev/20210106180428.722521-1-aten...@kernel.org/ Antoine Tenart (11): net-sysfs: convert xps_cpus_show to bitmap_zalloc net-sysfs: store the return of get_netdev_queue_index in an unsigned int net-sysfs: move the xps cpus/rxqs retrieval in a

[PATCH net-next 04/11] net: embed num_tc in the xps maps

2021-01-28 Thread Antoine Tenart
- Checks can be made before accessing the maps so we know the values retrieved will make sense. We also update __netif_set_xps_queue to conditionally copy old maps from dev_maps in the new one only if the number of traffic classes from both maps match. Signed-off-by: Antoine Tenart --

[PATCH net-next 02/11] net-sysfs: store the return of get_netdev_queue_index in an unsigned int

2021-01-28 Thread Antoine Tenart
In net-sysfs, get_netdev_queue_index returns an unsigned int. Some of its callers use an unsigned long to store the returned value. Update the code to be consistent, this should only be cosmetic. Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 11 +++ 1 file changed, 7

[PATCH net-next 03/11] net-sysfs: move the xps cpus/rxqs retrieval in a common function

2021-01-28 Thread Antoine Tenart
, xps_queue_show, to improve maintenance. While the rtnl lock could be held in the new xps_queue_show, it is still held in xps_cpus_show and xps_rxqs_show as this is an important information when looking at those two functions. This does not add complexity. Signed-off-by: Antoine Tenart --- net/core/net

[PATCH net-next 09/11] net: remove the xps possible_mask

2021-01-28 Thread Antoine Tenart
Remove the xps possible_mask. It was an optimization but we can just loop from 0 to nr_ids now that it is embedded in the xps dev_maps. That simplifies the code a bit. Suggested-by: Alexander Duyck Signed-off-by: Antoine Tenart --- net/core/dev.c | 43

[PATCH net-next 05/11] net: add an helper to copy xps maps to the new dev_maps

2021-01-28 Thread Antoine Tenart
This patch adds an helper, xps_copy_dev_maps, to copy maps from dev_maps to new_dev_maps at a given index. The logic should be the same, with an improved code readability and maintenance. Signed-off-by: Antoine Tenart --- net/core/dev.c | 45 + 1 file

[PATCH net-next 11/11] net: move the xps maps to an array

2021-01-28 Thread Antoine Tenart
. Suggested-by: Alexander Duyck Signed-off-by: Antoine Tenart --- drivers/net/virtio_net.c | 2 +- include/linux/netdevice.h | 17 + net/core/dev.c| 73 +-- net/core/net-sysfs.c | 13 +++ 4 files changed, 48 insertions(+), 57 deletions

[PATCH net-next 10/11] net-sysfs: remove the rtnl lock when accessing the xps maps

2021-01-28 Thread Antoine Tenart
Now that nr_ids and num_tc are stored in the xps dev_maps, which are RCU protected, we do not have the need to protect the xps_queue_show function with the rtnl lock. Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/net

[PATCH net-next 07/11] net: xps: embed nr_ids in dev_maps

2021-01-28 Thread Antoine Tenart
Embed nr_ids (the number of cpu for the xps cpus map, and the number of rxqs for the xps cpus map) in dev_maps. That will help not accessing out of bound memory if those values change after dev_maps was allocated. Suggested-by: Alexander Duyck Signed-off-by: Antoine Tenart --- include/linux

[PATCH net-next 08/11] net: assert the rtnl lock is held when calling __netif_set_xps_queue

2021-01-28 Thread Antoine Tenart
Add ASSERT_RTNL at the top of __netif_set_xps_queue and add a comment about holding the rtnl lock before the function. Suggested-by: Alexander Duyck Signed-off-by: Antoine Tenart --- net/core/dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core

[PATCH net-next 06/11] net: improve queue removal readability in __netif_set_xps_queue

2021-01-28 Thread Antoine Tenart
Improve the readability of the loop removing tx-queue from unused CPUs/rx-queues in __netif_set_xps_queue. The change should only be cosmetic. Signed-off-by: Antoine Tenart --- net/core/dev.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/net/core/dev.c b

[PATCH net-next v3 00/16] net: xps: improve the xps maps handling

2021-03-12 Thread Antoine Tenart
tches to improve readability and avoid introducing issues in between patches. - Use dev_maps->nr_ids to allocate the mask in xps_queue_show but still default to nr_cpu_ids/dev->num_rx_queues in xps_queue_show when dev_maps hasn't been allocated yet for backward compati

[PATCH net-next v3 04/16] net: embed num_tc in the xps maps

2021-03-12 Thread Antoine Tenart
- Checks can be made before accessing the maps so we know the values retrieved will make sense. We also update __netif_set_xps_queue to conditionally copy old maps from dev_maps in the new one only if the number of traffic classes from both maps match. Signed-off-by: Antoine Tenart --

[PATCH net-next v3 02/16] net-sysfs: store the return of get_netdev_queue_index in an unsigned int

2021-03-12 Thread Antoine Tenart
In net-sysfs, get_netdev_queue_index returns an unsigned int. Some of its callers use an unsigned long to store the returned value. Update the code to be consistent, this should only be cosmetic. Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 11 +++ 1 file changed, 7

[PATCH net-next v3 01/16] net-sysfs: convert xps_cpus_show to bitmap_zalloc

2021-03-12 Thread Antoine Tenart
Use bitmap_zalloc instead of zalloc_cpumask_var in xps_cpus_show to align with xps_rxqs_show. This will improve maintenance and allow us to factorize the two functions. The function should behave the same. Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 12 ++-- 1 file changed

[PATCH net-next v3 06/16] net: assert the rtnl lock is held when calling __netif_set_xps_queue

2021-03-12 Thread Antoine Tenart
Add ASSERT_RTNL at the top of __netif_set_xps_queue and add a comment about holding the rtnl lock before the function. Suggested-by: Alexander Duyck Signed-off-by: Antoine Tenart --- net/core/dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core

[PATCH net-next v3 05/16] net: embed nr_ids in the xps maps

2021-03-12 Thread Antoine Tenart
Embed nr_ids (the number of cpu for the xps cpus map, and the number of rxqs for the xps cpus map) in dev_maps. That will help not accessing out of bound memory if those values change after dev_maps was allocated. Suggested-by: Alexander Duyck Signed-off-by: Antoine Tenart --- include/linux

[PATCH net-next v3 03/16] net-sysfs: make xps_cpus_show and xps_rxqs_show consistent

2021-03-12 Thread Antoine Tenart
Make the implementations of xps_cpus_show and xps_rxqs_show to converge, as the two share the same logic but diverted over time. This should not modify their behaviour but will help future changes and improve maintenance. Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 33

[PATCH net-next v3 07/16] net: remove the xps possible_mask

2021-03-12 Thread Antoine Tenart
Remove the xps possible_mask. It was an optimization but we can just loop from 0 to nr_ids now that it is embedded in the xps dev_maps. That simplifies the code a bit. Suggested-by: Alexander Duyck Signed-off-by: Antoine Tenart --- net/core/dev.c | 40

[PATCH net-next v3 09/16] net: add an helper to copy xps maps to the new dev_maps

2021-03-12 Thread Antoine Tenart
This patch adds an helper, xps_copy_dev_maps, to copy maps from dev_maps to new_dev_maps at a given index. The logic should be the same, with an improved code readability and maintenance. Signed-off-by: Antoine Tenart --- net/core/dev.c | 45 + 1 file

[PATCH net-next v3 10/16] net: improve queue removal readability in __netif_set_xps_queue

2021-03-12 Thread Antoine Tenart
Improve the readability of the loop removing tx-queue from unused CPUs/rx-queues in __netif_set_xps_queue. The change should only be cosmetic. Signed-off-by: Antoine Tenart --- net/core/dev.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/net/core/dev.c b

[PATCH net-next v3 11/16] net-sysfs: move the rtnl unlock up in the xps show helpers

2021-03-12 Thread Antoine Tenart
want this device to be freed while we use it (now that the rtnl lock isn't protecting it in the whole function). Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/net/core/net-sysfs.c b/ne

[PATCH net-next v3 08/16] net: move the xps maps to an array

2021-03-12 Thread Antoine Tenart
. Suggested-by: Alexander Duyck Signed-off-by: Antoine Tenart --- drivers/net/virtio_net.c | 2 +- include/linux/netdevice.h | 17 + net/core/dev.c| 73 +-- net/core/net-sysfs.c | 6 ++-- 4 files changed, 46 insertions(+), 52 deletions

[PATCH net-next v3 12/16] net-sysfs: move the xps cpus/rxqs retrieval in a common function

2021-03-12 Thread Antoine Tenart
Most of the xps_cpus_show and xps_rxqs_show functions share the same logic. Having it in two different functions does not help maintenance. This patch moves their common logic into a new function, xps_queue_show, to improve this. Signed-off-by: Antoine Tenart --- net/core/net-sysfs.c | 125

[PATCH net-next v3 14/16] net: NULL the old xps map entries when freeing them

2021-03-12 Thread Antoine Tenart
In __netif_set_xps_queue, old map entries from the old dev_maps are freed but their corresponding entry in the old dev_maps aren't NULLed. Fix this. Signed-off-by: Antoine Tenart --- net/core/dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/dev.c b/net/core/dev.c

  1   2   3   4   5   6   7   8   >