Re: [PATCH] Revert "net/ibm/emac: wrong bit is used for STA control"

2018-12-06 Thread Benjamin Herrenschmidt
On Fri, 2018-12-07 at 14:20 +1100, Benjamin Herrenschmidt wrote: > Apologies for the empty email, not too sure what happened, I did a resend and the second one worked. Cheers Ben.

[PATCH] Revert "net/ibm/emac: wrong bit is used for STA control"

2018-12-06 Thread Benjamin Herrenschmidt
on his board. Signed-off-by: Benjamin Herrenschmidt --- Found while setting up some old ppc440 boxes for test/CI drivers/net/ethernet/ibm/emac/emac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ibm/emac/emac.h b/drivers/net/ethernet/ibm/emac/emac.h

[PATCH] Revert "net/ibm/emac: wrong bit is used for STA control"

2018-12-06 Thread Benjamin Herrenschmidt

Re: RFC on writel and writel_relaxed

2018-03-29 Thread Benjamin Herrenschmidt
On Thu, 2018-03-29 at 09:56 -0400, Sinan Kaya wrote: > On 3/28/2018 11:55 AM, David Miller wrote: > > From: Benjamin Herrenschmidt <b...@kernel.crashing.org> > > Date: Thu, 29 Mar 2018 02:13:16 +1100 > > > > > Let's fix all archs, it's way easier than fixing

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Thu, 2018-03-29 at 02:23 +1000, Nicholas Piggin wrote: > On Wed, 28 Mar 2018 11:55:09 -0400 (EDT) > David Miller <da...@davemloft.net> wrote: > > > From: Benjamin Herrenschmidt <b...@kernel.crashing.org> > > Date: Thu, 29 Mar 2018 02:13:16 +1100 > > >

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 07:41 -0400, ok...@codeaurora.org wrote: > Yes, we want to get there indeed. It is because of some arch not > implementing writel properly. Maintainers want to play safe. > > That is why I asked if IA64 and other well known archs follow the > strongly ordered rule at this

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 11:30 +, David Laight wrote: > From: Benjamin Herrenschmidt > > Sent: 28 March 2018 10:56 > > ... > > For example, let's say I have a device with a reset bit and the spec > > says the reset bit needs to be set for at least 1

Re: Aw: Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 12:13 +0200, Lino Sanfilippo wrote: > Hi, > > > > > > Yeah so that other trick I'm talking about is also used for timing > > accuracy. > > > > For example, let's say I have a device with a reset bit and the spec > > says the reset bit needs to be set for at least 10us. >

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 10:07 +0100, Will Deacon wrote: > > For arm/arm64 we guarantee ordering for (1) but not for (2) -- you'd need to > add an mb() to make it work. > > Do both of these work on power? Yes. There's even another quirk, see further down ;-) > If so, I guess I can make readl

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 09:11 +0200, Arnd Bergmann wrote: > On Wed, Mar 28, 2018 at 8:56 AM, Benjamin Herrenschmidt > <b...@kernel.crashing.org> wrote: > > On Wed, 2018-03-28 at 06:53 +, Linus Torvalds wrote: > > > On Tue, Mar 27, 2018, 20:43 Benja

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Wed, 2018-03-28 at 06:53 +, Linus Torvalds wrote: > > > On Tue, Mar 27, 2018, 20:43 Benjamin Herrenschmidt <benh@kernel.crash > ing.org> wrote: > > > > > > Of course, you'd have to be pretty odd to want to start a DMA > > with a > >

Re: RFC on writel and writel_relaxed

2018-03-28 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 20:26 -1000, Linus Torvalds wrote: > On Tue, Mar 27, 2018 at 6:33 PM, Benjamin Herrenschmidt > <b...@kernel.crashing.org> wrote: > > > > This is why, I want (with your agreement) to define clearly and once > > and for all, that

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 23:24 -0400, Sinan Kaya wrote: > On 3/27/2018 10:51 PM, Linus Torvalds wrote: > > > The discussion at hand is about > > > > > > dma_buffer->foo = 1;/* WB */ > > > writel(KICK, DMA_KICK_REGISTER);/* UC */ > > > > Yes. That

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 16:51 -1000, Linus Torvalds wrote: > On Tue, Mar 27, 2018 at 3:03 PM, Benjamin Herrenschmidt > <b...@kernel.crashing.org> wrote: > > > > The discussion at hand is about > > > > dma_buffer->foo = 1;

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 16:10 +0100, Will Deacon wrote: > To clarify: are you saying that on x86 you need a wmb() prior to a writel > if you want that writel to be ordered after prior writes to memory? Is this > specific to WC memory or some other non-standard attribute? > > The only reason we have

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 14:39 -1000, Linus Torvalds wrote: > On Tue, Mar 27, 2018 at 11:33 AM, Benjamin Herrenschmidt > <b...@kernel.crashing.org> wrote: > > > > Well, we need to clarify that once and for all, because as I wrote > > earlier, it was decreed b

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 14:54 -0700, Alexander Duyck wrote: > On Tue, Mar 27, 2018 at 2:35 PM, Benjamin Herrenschmidt > <b...@kernel.crashing.org> wrote: > > On Tue, 2018-03-27 at 10:46 -0400, Sinan Kaya wrote: > > > combined buffers. > > > > > > Alex:

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 10:46 -0400, Sinan Kaya wrote: > combined buffers. > > Alex: > "Don't bother. I can tell you right now that for x86 you have to have a > wmb() before the writel(). No, this isn't the semantics of writel. You shouldn't need it unless something changed and we need to revisit

Re: RFC on writel and writel_relaxed

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 11:54 -0700, Alexander Duyck wrote: > As far as I know the code has been this way for a while, something > like 2002, when the barrier was already present in e1000. However > there it was calling out weakly ordered models "such as IA-64". Since > then pretty much all the

Re: [PATCH v2] net: ibm: emac: support RGMII-[RX|TX]ID phymode

2017-12-20 Thread Benjamin Herrenschmidt
On Wed, 2017-12-20 at 22:07 +0100, Christian Lamparter wrote: > > > will read this and say "Oh the function tests against these weird > > PHY_MODE_* aliases, but the helper function phy_interface_mode_is_rgmii() > > tests against PHY_INTERFACE_MODE_*, what is going on?" > > > > I hate to do this

Re: [PATCH] ibmveth: Kernel crash LSO offload flag toggle

2017-11-15 Thread Benjamin Herrenschmidt
On Wed, 2017-11-15 at 10:45 -0600, Bryant G. Ly wrote: > This patch just closes the window, bad things can still happen. I wanted to > leave it > up to the people who actively develop in ibmveth to close the window, since > introducing > a lock can be expensive in tx. You don't need to

Re: [PATCH] ibmveth: Kernel crash LSO offload flag toggle

2017-11-14 Thread Benjamin Herrenschmidt
On Wed, 2017-11-15 at 13:47 +1100, Daniel Axtens wrote: > Hi Bryant, > > This looks a bit better, but... > > > The following patch ensures that the bounce_buffer is not null > > prior to using it within skb_copy_from_linear_data. > > How would this occur? > > Looking at ibmveth.c, I see

Re: [PATCH v2] net: ftgmac100: Request clock and set speed

2017-10-12 Thread Benjamin Herrenschmidt
On Thu, 2017-10-12 at 11:32 +0800, Joel Stanley wrote: > According to the ASPEED datasheet, gigabit speeds require a clock of > 100MHz or higher. Other speeds require 25MHz or higher. This patch > configures a 100MHz clock if the system has a direct-attached > PHY, or 25MHz if the system is

Re: [PATCH] net: ftgmac100: Request clock and set speed

2017-10-10 Thread Benjamin Herrenschmidt
On Tue, 2017-10-10 at 15:19 +1030, Joel Stanley wrote: > According to the ASPEED datasheet, gigabit speeds require a clock of > 100MHz or higher. Other speeds require 25MHz or higher. Did you try "live" changing by either using ethtool or plugging into switches/hubs at different speed ? Also

Re: [PATCH] net: ethernet: ibm-emac: Add 5482 PHY init for OpenBlocks 600

2017-09-01 Thread Benjamin Herrenschmidt
On Fri, 2017-09-01 at 17:35 -0700, Florian Fainelli wrote: > On 08/31/2017 09:44 PM, Benjamin Herrenschmidt wrote: > > The vendor patches initialize those registers to get the > > PHY working properly. > > > > Sadly I don't have that PHY spec and whatever Broadcom P

[PATCH] net: ethernet: ibm-emac: Add 5482 PHY init for OpenBlocks 600

2017-08-31 Thread Benjamin Herrenschmidt
board". The vendor has long abandoned that product, but I find it handy to test ppc405 kernels and so would like to keep it alive upstream :-) Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- Note: Ideally, the whole driver should switch over to the generic PH

Re: [PATCH net-next] net/ncsi: Define {add, kill}_vid callbacks for !CONFIG_NET_NCSI

2017-08-31 Thread Benjamin Herrenschmidt
On Thu, 2017-08-31 at 08:24 -0700, Vernon Mauery wrote: > +int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) > > +{ > > + return -ENOTTY; > > +} > > +int ncsi_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid) > > +{ > > + return -ENOTTY; > > +} > >

Re: [PATCH] net: ftgmac100: Fix oops in probe on failure to find associated PHY

2017-08-22 Thread Benjamin Herrenschmidt
.81] [<8058b040>] (kernel_init_freeable) from [<803fd170>] > (kernel_init+0x18/0x104) >[ 2.81] [<803fd170>] (kernel_init) from [<8000a5e8>] > (ret_from_fork+0x14/0x2c) >[ 2.81] Code: e594205c e5941058 e2843058 e3a05000 (e5812004) >

[PATCH 2/2] ftgmac100: Make the MDIO bus a child of the ethernet device

2017-07-24 Thread Benjamin Herrenschmidt
Populate mii_bus->parent with our own platform device before registering, which makes it easier to locate the MDIO bus in sysfs when trying to diagnose problems. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 1 + 1 file c

[PATCH 1/2] ftgmac100: Increase reset timeout

2017-07-24 Thread Benjamin Herrenschmidt
We had reports of 50us not being sufficient to reset the MAC, thus hitting the "Hardware reset failed" error bringing the interface up on some AST2400 based machines. This bumps the timeout to 200us. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- driv

Re: clean up and modularize arch dma_mapping interface V2

2017-06-24 Thread Benjamin Herrenschmidt
On Sat, 2017-06-24 at 09:18 +0200, Christoph Hellwig wrote: > On Wed, Jun 21, 2017 at 12:24:28PM -0700, tndave wrote: > > Thanks for doing this. > > So archs can still have their own definition for dma_set_mask() if > > HAVE_ARCH_DMA_SET_MASK is y? > > (and similarly for dma_set_coherent_mask()

Re: [PATCH 42/44] powerpc/cell: use the dma_supported method for ops switching

2017-06-18 Thread Benjamin Herrenschmidt
On Sun, 2017-06-18 at 00:13 -0700, Christoph Hellwig wrote: > On Sun, Jun 18, 2017 at 06:50:27AM +1000, Benjamin Herrenschmidt wrote: > > What is your rationale here ? (I have missed patch 0 it seems). > > Less code duplication, more modular dma_map_ops insteance. >

Re: [PATCH 42/44] powerpc/cell: use the dma_supported method for ops switching

2017-06-17 Thread Benjamin Herrenschmidt
On Fri, 2017-06-16 at 20:10 +0200, Christoph Hellwig wrote: > Besides removing the last instance of the set_dma_mask method this also > reduced the code duplication. What is your rationale here ? (I have missed patch 0 it seems). dma_supported() was supposed to be pretty much a "const" function

[PATCH v3 6/9] ftgmac100: Allow configuration of phy interface via device-tree

2017-04-17 Thread Benjamin Herrenschmidt
This uses the standard phy-mode property Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 42 +--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac10

[PATCH v3 8/9] ftgmac100: Fix potential ordering issue in NAPI poll

2017-04-17 Thread Benjamin Herrenschmidt
will order subsequent accesses. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index

[PATCH v3 7/9] ftgmac100: Display the discovered PHY device info

2017-04-17 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 7721c2a..45b8267 100644 --- a/drive

[PATCH v3 9/9] ftgmac100: Document device-tree binding

2017-04-17 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> -- v3. - Update supported values for phy-mode --- .../devicetree/bindings/net/ftgmac100.txt | 37 ++ 1 file changed, 37 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/ftg

[PATCH v3 5/9] ftgmac100: Add netpoll support

2017-04-17 Thread Benjamin Herrenschmidt
Just call the interrupt handler with interrupts locally disabled Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/d

[PATCH v3 3/9] ftgmac100: Add ndo_set_rx_mode() and support for multicast & promisc

2017-04-17 Thread Benjamin Herrenschmidt
This adds the ndo_set_rx_mode() callback to configure the multicast filters, promisc and allmulti options. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> -- v3. - Rebase to fix conflict with #include changes --- drivers/net/ethernet/faraday/ftgmac100.

[PATCH v3 4/9] ftgmac100: Add vlan HW offload

2017-04-17 Thread Benjamin Herrenschmidt
The chip supports HW vlan tag insertion and extraction. Add support for it. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 46 +++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/d

[PATCH v3 1/9] ftgmac100: Add ethtool n-way reset call

2017-04-17 Thread Benjamin Herrenschmidt
A non-wired up implementation accidentally made its way in a previous patch (Make ring sizes configurable via ethtool). This removes it and wires up the generic phy_ethtool_nway_reset instead. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> -- v2. - Use phy_ethtool_nway

[PATCH v3 2/9] ftgmac100: Add pause frames configuration and support

2017-04-17 Thread Benjamin Herrenschmidt
Hopefully my understanding of how the hardware works is correct, as the documentation isn't completely clear. So far I have seen no obvious issue. Pause seem to also work with NC-SI. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgma

[PATCH v3 0/9] ftgmac100: Rework batch 5 - Features

2017-04-17 Thread Benjamin Herrenschmidt
This is the third spin of the fifth and last batch of updates to the ftgmac100 driver. This contains a few additional "features" such as: - Support for ethtool n-way reset - Multicast filtering & promisc support - Vlan offload - netpoll And a couple of misc bits. This also adds the

Re: [PATCH v2 0/9] ftgmac100: Rework batch 5 - Features

2017-04-17 Thread Benjamin Herrenschmidt
On Mon, 2017-04-17 at 11:11 -0400, David Miller wrote: > From: Benjamin Herrenschmidt <b...@kernel.crashing.org> > Date: Thu, 13 Apr 2017 14:39:07 +1000 > > > This is the second spin of the fifth and last batch of > > updates to the ftgmac100 driver. > > This se

Re: [PATCH 8/8] ftgmac100: Document device-tree binding

2017-04-13 Thread Benjamin Herrenschmidt
On Thu, 2017-04-13 at 15:42 +0200, Andrew Lunn wrote: > > +- phy-mode: See ethernet.txt file in the same directory. If the > > property is > > +  absent, "rgmii" is assumed. Supported values are "rgmii" and > > "rmii" > > You might want to say rgmii*, or similar, it indicate the delayed >

[PATCH v2 6/9] ftgmac100: Allow configuration of phy interface via device-tree

2017-04-12 Thread Benjamin Herrenschmidt
This uses the standard phy-mode property Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 42 +--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac10

[PATCH v2 9/9] ftgmac100: Document device-tree binding

2017-04-12 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- .../devicetree/bindings/net/ftgmac100.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/ftgmac100.txt diff --git a/Documentation/devi

[PATCH v2 8/9] ftgmac100: Fix potential ordering issue in NAPI poll

2017-04-12 Thread Benjamin Herrenschmidt
will order subsequent accesses. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index

[PATCH v2 3/9] ftgmac100: Add ndo_set_rx_mode() and support for multicast & promisc

2017-04-12 Thread Benjamin Herrenschmidt
This adds the ndo_set_rx_mode() callback to configure the multicast filters, promisc and allmulti options. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 52 1 file changed, 52 insertions(+)

[PATCH v2 5/9] ftgmac100: Add netpoll support

2017-04-12 Thread Benjamin Herrenschmidt
Just call the interrupt handler with interrupts locally disabled Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/d

[PATCH v2 7/9] ftgmac100: Display the discovered PHY device info

2017-04-12 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 7c607eb..71763e4 100644 --- a/drive

[PATCH v2 4/9] ftgmac100: Add vlan HW offload

2017-04-12 Thread Benjamin Herrenschmidt
The chip supports HW vlan tag insertion and extraction. Add support for it. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 46 +++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/d

[PATCH v2 2/9] ftgmac100: Add pause frames configuration and support

2017-04-12 Thread Benjamin Herrenschmidt
Hopefully my understanding of how the hardware works is correct, as the documentation isn't completely clear. So far I have seen no obvious issue. Pause seem to also work with NC-SI. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgma

[PATCH v2 0/9] ftgmac100: Rework batch 5 - Features

2017-04-12 Thread Benjamin Herrenschmidt
This is the second spin of the fifth and last batch of updates to the ftgmac100 driver. This contains a few additional "features" such as: - Support for ethtool n-way reset - Multicast filtering & promisc support - Vlan offload - netpoll And a couple of misc bits. This also adds the

[PATCH v2 1/9] ftgmac100: Add ethtool n-way reset call

2017-04-12 Thread Benjamin Herrenschmidt
A non-wired up implementation accidentally made its way in a previous patch (Make ring sizes configurable via ethtool). This removes it and wires up the generic phy_ethtool_nway_reset instead. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> -- v2. - Use phy_ethtool_nway

Re: [PATCH 1/8] ftgmac100: Add ethtool n-way reset call

2017-04-12 Thread Benjamin Herrenschmidt
On Wed, 2017-04-12 at 17:00 -0700, Florian Fainelli wrote: > > -static int ftgmac100_nway_reset(struct net_device *ndev) > > +static int ftgmac100_nway_reset(struct net_device *netdev) > >   { > > - if (!ndev->phydev) > > + if (!netdev->phydev) > >    return -ENXIO; > > - 

[PATCH 8/8] ftgmac100: Document device-tree binding

2017-04-12 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- .../devicetree/bindings/net/ftgmac100.txt | 36 ++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/ftgmac100.txt diff --git a/Documentation/devi

[PATCH 5/8] ftgmac100: Add netpoll support

2017-04-12 Thread Benjamin Herrenschmidt
Just call the interrupt handler with interrupts locally disabled Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/d

[PATCH 6/8] ftgmac100: Allow configuration of phy interface via device-tree

2017-04-12 Thread Benjamin Herrenschmidt
This uses the standard phy-mode property Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 42 +--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac10

[PATCH 4/8] ftgmac100: Add vlan HW offload

2017-04-12 Thread Benjamin Herrenschmidt
The chip supports HW vlan tag insertion and extraction. Add support for it. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 46 +++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/d

[PATCH 7/8] ftgmac100: Display the discovered PHY device info

2017-04-12 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index c1afda8..d04ad31 100644 --- a/drive

[PATCH 2/8] ftgmac100: Add pause frames configuration and support

2017-04-12 Thread Benjamin Herrenschmidt
Hopefully my understanding of how the hardware works is correct, as the documentation isn't completely clear. So far I have seen no obvious issue. Pause seem to also work with NC-SI. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgma

[PATCH 3/8] ftgmac100: Add ndo_set_rx_mode() and support for multicast & promisc

2017-04-12 Thread Benjamin Herrenschmidt
This adds the ndo_set_rx_mode() callback to configure the multicast filters, promisc and allmulti options. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 52 1 file changed, 52 insertions(+)

[PATCH 1/8] ftgmac100: Add ethtool n-way reset call

2017-04-12 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 796b37e..b

[PATCH 0/8] ftgmac100: Rework batch 5 - Features

2017-04-12 Thread Benjamin Herrenschmidt
This is fifth and last batch of updates to the ftgmac100 driver. This contains a few additional "features" such as: - Support for ethtool n-way reset - Multicast filtering & promisc support - Vlan offload - netpoll And a couple of misc bits. This also adds the device-tree binding

Re: [PATCH v2 00/10] ftgmac100: Rework batch 4 - Misc

2017-04-12 Thread Benjamin Herrenschmidt
On Wed, 2017-04-12 at 10:19 -0400, David Miller wrote: > > > v2 Fixes patch 1/10 (NETIF_F_HW_CSUM conversion) > >  > > The next (and last) batch will add a few more "features" such > > as netpoll, multicast/promist, vlan offload... > >  > > Series applied, thanks Benjamin. > > I really like how

Re: Network driver "test suite"

2017-04-12 Thread Benjamin Herrenschmidt
On Tue, 2017-04-11 at 17:36 -0700, Florian Fainelli wrote: > > You could start with using LNST: > > https://github.com/jpirko/lnst > > and there is also Ostinato which is a great way to get access to > something IXIA-like, but all configurable in software through python > bindings. Andrew's

[PATCH v2 06/10] ftgmac100: Rename ftgmac100_setup_mac to ftgmac100_initial_mac

2017-04-11 Thread Benjamin Herrenschmidt
To remove more confusion. This function is about obtaining the initial MAC address at driver probe time. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d

[PATCH v2 05/10] ftgmac100: Rename ftgmac100_set_mac to ftgmac100_write_mac_addr

2017-04-11 Thread Benjamin Herrenschmidt
To avoid confusion with the ndo callback and generally be clearer about the purpose of that function Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drive

[PATCH v2 09/10] ftgmac100: Make ring sizes configurable via ethtool

2017-04-11 Thread Benjamin Herrenschmidt
We set an arbitrary max at 1024 since we pre-allocate the actual descriptor arrays and skb arrays to the full size to keep the code a bit simpler and avoid allocation failures in the reset task. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/f

[PATCH v2 01/10] ftgmac100: Upgrade to NETIF_F_HW_CSUM

2017-04-11 Thread Benjamin Herrenschmidt
The documentation describes NETIF_F_IP_CSUM as deprecated so let's switch to NETIF_F_HW_CSUM and use the helper to handle unhandled protocols. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> -- v2. - Properly fallback on unknown IP protocols (side effect of

[PATCH v2 10/10] ftgmac100: Set default ring sizes to 128 entries

2017-04-11 Thread Benjamin Herrenschmidt
I haven't seen any improvement above that size on the machines I've tested with. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/f

[PATCH v2 08/10] ftgmac100: Add more register inits in ftgmac100_init_hw()

2017-04-11 Thread Benjamin Herrenschmidt
Clear stale interrupts on entry, configure FIFO sizes, set FIFO thresholds, configure interrupt mitigation. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 36 1 file changed, 36 insertions(+)

[PATCH v2 02/10] ftgmac100: Use device "compatible" property, not machine.

2017-04-11 Thread Benjamin Herrenschmidt
We test for aspeed chips to handle a couple of special cases, but we do that by checking the machine type which isn't right. Instead check the actual device compatible property. This also updates the dtsi files for the aspeed SoC to match. Signed-off-by: Benjamin Herrenschmidt &l

[PATCH v2 03/10] ftgmac100: Disable HW checksum generation on AST2400, enable on others

2017-04-11 Thread Benjamin Herrenschmidt
disable HW checksum generation and checking regardless of whether NC-SI is used or not in case other variants out there need this. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/arm/boot/dts/aspeed-g4.dtsi | 2 -- arch/arm/boot/dts/aspeed-g5.dtsi | 2

[PATCH v2 07/10] ftgmac100: Open code remaining register writes

2017-04-11 Thread Benjamin Herrenschmidt
The helpers just take space but don't provide much value. Simple one line comments are more explanatory. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 53 1 file changed, 20 insertions(

[PATCH v2 04/10] ftgmac100: Set netdev->hw_features

2017-04-11 Thread Benjamin Herrenschmidt
So features can be turned on/off via ethtool Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/et

[PATCH v2 00/10] ftgmac100: Rework batch 4 - Misc

2017-04-11 Thread Benjamin Herrenschmidt
This is v2 of the fourth batch of updates to the ftgmac100 driver. This is a bunch of misc cleanups and fixes, such as properly disabling HW checksum generation on AST2400 where it's known to be broken and some chip init updates. This also adds the ability to turn HW checksum on/off and

Network driver "test suite"

2017-04-11 Thread Benjamin Herrenschmidt
Hi folks ! Does anybody knows of an existing kind of automated "test suite" for a network/ethernet driver ? IE. Something we could run both on the "tested" driver and a cross-over "known good" peer (possibly the latter set to promisc & no offload for proper analysis), that would out the driver

Re: [PATCH 01/10] ftgmac100: Upgrade to NETIF_F_HW_CSUM

2017-04-11 Thread Benjamin Herrenschmidt
On Tue, 2017-04-11 at 20:03 -0400, David Miller wrote: > > From: Benjamin Herrenschmidt <b...@kernel.crashing.org> > Date: Wed, 12 Apr 2017 09:36:05 +1000 > > > I should call the helper when I don't recognize the protocol type in > > the IP header, not just w

Re: [PATCH 01/10] ftgmac100: Upgrade to NETIF_F_HW_CSUM

2017-04-11 Thread Benjamin Herrenschmidt
On Wed, 2017-04-12 at 08:06 +1000, Benjamin Herrenschmidt wrote: > On Tue, 2017-04-11 at 11:27 -0400, David Miller wrote: > > > I'll fix it in a next spin if Dave wants it that way but > > > otherwise > > > I'm keen to leave it as it is. > > > > Please f

Re: [PATCH 01/10] ftgmac100: Upgrade to NETIF_F_HW_CSUM

2017-04-11 Thread Benjamin Herrenschmidt
On Tue, 2017-04-11 at 11:27 -0400, David Miller wrote: > > I'll fix it in a next spin if Dave wants it that way but otherwise > > I'm keen to leave it as it is. > > Please fix this and respin. > > Meanwhile get the coding style rules changed if you disagree with > them.  A patch series review is

Re: [PATCH 01/10] ftgmac100: Upgrade to NETIF_F_HW_CSUM

2017-04-11 Thread Benjamin Herrenschmidt
On Tue, 2017-04-11 at 21:13 +1000, Benjamin Herrenschmidt wrote: > On Tue, 2017-04-11 at 13:57 +0300, Sergei Shtylyov wrote: > >     Need {} here as well since the 1st branch has it -- see  > > Documentation/process/coding-style.rst (the end of the section 3). > > Addin

Re: [PATCH 01/10] ftgmac100: Upgrade to NETIF_F_HW_CSUM

2017-04-11 Thread Benjamin Herrenschmidt
On Tue, 2017-04-11 at 13:57 +0300, Sergei Shtylyov wrote: >     Need {} here as well since the 1st branch has it -- see  > Documentation/process/coding-style.rst (the end of the section 3). Adding {} in that specific statements just makes things more cluttered and less readable. I can find a ton

[PATCH 02/10] ftgmac100: Use device "compatible" property, not machine.

2017-04-10 Thread Benjamin Herrenschmidt
We test for aspeed chips to handle a couple of special cases, but we do that by checking the machine type which isn't right. Instead check the actual device compatible property. This also updates the dtsi files for the aspeed SoC to match. Signed-off-by: Benjamin Herrenschmidt &l

Re: [PATCH 00/10] ftgmac100: Rework batch 4 - Misc

2017-04-10 Thread Benjamin Herrenschmidt
On Tue, 2017-04-11 at 11:04 +1000, Benjamin Herrenschmidt wrote: > This is the fourth batch of updates to the ftgmac100 driver. > > This is a bunch of misc cleanups and fixes, such as properly > disabling HW checksum generation on AST2400 where it's known > to be broken and some ch

[PATCH 10/10] ftgmac100: Set default ring sizes to 128 entries

2017-04-10 Thread Benjamin Herrenschmidt
I haven't seen any improvement above that size on the machines I've tested with. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/f

[PATCH 09/10] ftgmac100: Make ring sizes configurable via ethtool

2017-04-10 Thread Benjamin Herrenschmidt
We set an arbitrary max at 1024 since we pre-allocate the actual descriptor arrays and skb arrays to the full size to keep the code a bit simpler and avoid allocation failures in the reset task. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/f

[PATCH 08/10] ftgmac100: Add more register inits in ftgmac100_init_hw()

2017-04-10 Thread Benjamin Herrenschmidt
Clear stale interrupts on entry, configure FIFO sizes, set FIFO thresholds, configure interrupt mitigation. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 36 1 file changed, 36 insertions(+)

[PATCH 05/10] ftgmac100: Rename ftgmac100_set_mac to ftgmac100_write_mac_addr

2017-04-10 Thread Benjamin Herrenschmidt
To avoid confusion with the ndo callback and generally be clearer about the purpose of that function Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drive

[PATCH 04/10] ftgmac100: Set netdev->hw_features

2017-04-10 Thread Benjamin Herrenschmidt
So features can be turned on/off via ethtool Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/et

[PATCH 07/10] ftgmac100: Open code remaining register writes

2017-04-10 Thread Benjamin Herrenschmidt
The helpers just take space but don't provide much value. Simple one line comments are more explanatory. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 53 1 file changed, 20 insertions(

[PATCH 06/10] ftgmac100: Rename ftgmac100_setup_mac to ftgmac100_initial_mac

2017-04-10 Thread Benjamin Herrenschmidt
To remove more confusion. This function is about obtaining the initial MAC address at driver probe time. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d

[PATCH 03/10] ftgmac100: Disable HW checksum generation on AST2400, enable on others

2017-04-10 Thread Benjamin Herrenschmidt
disable HW checksum generation and checking regardless of whether NC-SI is used or not in case other variants out there need this. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/arm/boot/dts/aspeed-g4.dtsi | 2 -- arch/arm/boot/dts/aspeed-g5.dtsi | 2

[PATCH 01/10] ftgmac100: Upgrade to NETIF_F_HW_CSUM

2017-04-10 Thread Benjamin Herrenschmidt
The documentation describes NETIF_F_IP_CSUM as deprecated so let's switch to NETIF_F_HW_CSUM and use the helper to handle unhandled protocols. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 7 --- 1 file changed, 4 inse

[PATCH 00/10] ftgmac100: Rework batch 4 - Misc

2017-04-10 Thread Benjamin Herrenschmidt
This is the fourth batch of updates to the ftgmac100 driver. This is a bunch of misc cleanups and fixes, such as properly disabling HW checksum generation on AST2400 where it's known to be broken and some chip init updates. This also adds the ability to turn HW checksum on/off and configure the

[PATCH v2 02/12] ftgmac100: Move ftgmac100_hard_start_xmit() around

2017-04-09 Thread Benjamin Herrenschmidt
Move it below ftgmac100_xmit() and the rest of the tx path No code change. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v2. - Fix patch splitting mistake --- drivers/net/ethernet/faraday/ftgmac100.c | 58 1 file changed, 29 inse

[PATCH v2 10/12] ftgmac100: Don't clear tx desc fields unnecessarily

2017-04-09 Thread Benjamin Herrenschmidt
Those are non-cachable stores, let's avoid those we don't need. Remove the helper, it's not particularly helpful and since it uses "priv" I can't move it to the header file. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/

[PATCH v2 03/12] ftgmac100: Merge ftgmac100_xmit() into ftgmac100_hard_start_xmit()

2017-04-09 Thread Benjamin Herrenschmidt
This will make subsequent rework of the tx path simpler Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 58 ++-- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/drivers/net/et

[PATCH v2 04/12] ftgmac100: Factor tx packet dropping path

2017-04-09 Thread Benjamin Herrenschmidt
Use a simple goto to a drop path at the tail of the function, it will be used in a few more cases soon Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff

  1   2   3   4   5   >