[PATCH 06/13] ftgmac100: Split ring alloc, init and rx buffer alloc

2017-04-01 Thread Benjamin Herrenschmidt
handling when the rings will be repopulated but not freed. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 68 ++-- 1 file changed, 47 insertions(+), 21 deletions(-) diff --git a/drivers/net/et

[PATCH 08/13] ftgmac100: Request the interrupt only after HW is reset

2017-04-01 Thread Benjamin Herrenschmidt
The interrupt isn't shared, so this will keep it masked until we have the HW in a known sane state. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff

[PATCH 10/13] ftgmac100: Add a reset task and use it for link changes

2017-04-01 Thread Benjamin Herrenschmidt
as well. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 85 +++- 1 file changed, 72 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/f

[PATCH 04/13] ftgmac100: Remove "enabled" flags

2017-04-01 Thread Benjamin Herrenschmidt
It's not used in any meaningful way Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c

[PATCH 03/13] ftgmac100: Reorder struct fields and comment

2017-04-01 Thread Benjamin Herrenschmidt
Reorder the fields in struct ftgmac in slightly more logical groups. Will make more sense as I add/remove some. No code change. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 19 --- 1 file changed, 12 inse

[PATCH 01/13] ftgmac100: Use netdev->irq instead of private copy

2017-04-01 Thread Benjamin Herrenschmidt
There's a placeholder already for the irq, use it Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/d

[PATCH 11/13] ftgmac100: Rework MAC reset and init

2017-04-01 Thread Benjamin Herrenschmidt
. Move the ring pointers initialization there too in order to reflect the HW change. Also reduce the timeout for the MAC reset as it shouldn't take more than 300 clock cycles according to the doc. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/f

[PATCH 13/13] ftgmac100: Rework NAPI & interrupts handling

2017-04-01 Thread Benjamin Herrenschmidt
ts is less efficient than letting NAPI run a while longer while the queue drains. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 137 +-- drivers/net/ethernet/faraday/ftgmac100.h | 14 2 files change

Re: [PATCH 10/13] ftgmac100: Add a reset task and use it for link changes

2017-04-02 Thread Benjamin Herrenschmidt
On Sun, 2017-04-02 at 13:35 +1000, Benjamin Herrenschmidt wrote: > +   /* Block PHY polling */ > +   if (netdev->phydev) > +   mutex_lock(>phydev->lock); > + > +   rtnl_lock(); Self-given brown paper bag, those two need to be taken the oth

Resend all vs. individual patch updates

2017-04-02 Thread Benjamin Herrenschmidt
Hi Dave ! What is your preference when a couple of patches in a series of about a dozen get updated as a result of reviews ? Just send updates to those few or resend the whole series ? In the latter case I'll wait a bit longer for more comments. Cheers, Ben.

Re: [PATCH 10/13] ftgmac100: Add a reset task and use it for link changes

2017-04-02 Thread Benjamin Herrenschmidt
On Sun, 2017-04-02 at 20:42 +0200, Andrew Lunn wrote: > Have you run lockdep tests on this? I think it is normal to take the > rtnl lock first, then the phydev lock. Try some ethtool operations > and see if you get a splat. You are right. I actually realized that was wrong last night ;-) It will

Re: [PATCH 10/13] ftgmac100: Add a reset task and use it for link changes

2017-04-02 Thread Benjamin Herrenschmidt
On Sun, 2017-04-02 at 20:42 +0200, Andrew Lunn wrote: > Have you run lockdep tests on this? Good idea. For some reason I run it regularly on powerpc but it never occurred to me to try it on that 800Mhz ARM11 :-) Cheers, Ben.

[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 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 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 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 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(

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

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

[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

[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

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: 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

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 v2 00/13] ftgmac100: Rework batch 1 - Link & Interrupts

2017-04-06 Thread Benjamin Herrenschmidt
On Thu, 2017-04-06 at 12:46 -0700, Florian Fainelli wrote: > > I thought a while ago we could add some dev flag to prevent the link > > watch from doing that, but never got to look into it myself and > > apparently neither did Gavin. > > It sounds like a similar situation to e.g: 802.1x, you want

[PATCH 09/10] ftgmac100: Remove rx descriptor accessors

2017-04-05 Thread Benjamin Herrenschmidt
Directly access the fields when needed. The accessors add clutter not clarity and in some cases cause unnecessary read-modify-write type access on the slow (uncached) descriptor memory. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgma

[PATCH 10/10] ftgmac100: Work around HW bug in runt frame detection

2017-04-05 Thread Benjamin Herrenschmidt
stripping is enabled or not. This works around it by ignoring the "runt" error bit of the frame has been vlan tagged and is at least 60 bytes. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 35 +++---

[PATCH 04/10] ftgmac100: Cleanup rx checksum handling

2017-04-05 Thread Benjamin Herrenschmidt
Read the descriptor field only once and check for IP header checksum errors as well Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 63 +--- 1 file changed, 25 insertions(+), 38 deletions(-) diff

[PATCH 06/10] ftgmac100: Simplify rx pointer handling in the rx path

2017-04-05 Thread Benjamin Herrenschmidt
We don't handle fragmented RX packets, so the "looping" helpers to locate the first segment of a packet or to drop a packet aren't actually helping. Take them out and simplify ftgmac100_rx_packet() further as a result. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org&

[PATCH 08/10] ftgmac100: Add missing barrier in ftgmac100_rx_packet()

2017-04-05 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 86bda0a..594af30 100644 --- a/drive

[PATCH 05/10] ftgmac100: Simplify rx packets error handling

2017-04-05 Thread Benjamin Herrenschmidt
. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 61 +--- 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgma

[PATCH 07/10] ftgmac100: Directly receive into sk_buffs

2017-04-05 Thread Benjamin Herrenschmidt
. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 142 --- 1 file changed, 56 insertions(+), 86 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgma

[PATCH 03/10] ftgmac100: Use a scratch buffer for failed RX allocations

2017-04-05 Thread Benjamin Herrenschmidt
a proper buffer can be allocated. It will help later on when re-initializing the whole ring at runtime on link changes since there is no clean failure path there unlike open(). Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.

[PATCH 02/10] ftgmac100: Drop support for fragmented receive

2017-04-05 Thread Benjamin Herrenschmidt
and improvements to the RX path Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 37 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/et

[PATCH 00/10] ftgmac: Rework batch 2 - RX path

2017-04-05 Thread Benjamin Herrenschmidt
This is the second batch of updates to the ftgmac100 driver. This one tackles the RX path of the driver, simplifying it greatly to match common practice while significantly increasing the performance. (The bulk of the performance gains of my series will be provided by the TX path improvements,

[PATCH 01/10] ftgmac100: Move ftgmac100_alloc_rx_page() before its users

2017-04-05 Thread Benjamin Herrenschmidt
Avoids a forward declaration Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 59 +++- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/d

[PATCH v2 00/12] ftgmac100: Rework batch 3 - TX path

2017-04-09 Thread Benjamin Herrenschmidt
This is version 2 of the third batch of updates to the ftgmac100 driver. This one tackles the TX path of the driver. This provides the bulk of the performance improvements by adding support for fragmented sends along with a bunch of cleanups. Version 2 fixes a patch splitting mistake and uses

[PATCH v2 05/12] ftgmac100: Pad small frames properly

2017-04-09 Thread Benjamin Herrenschmidt
Rather than just transmitting garbage past the end of the small packet. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> -- v2. Use eth_skb_pad (wrapper around skb_put_padto) --- drivers/net/ethernet/faraday/ftgmac100.c | 10 -- 1 file changed, 8 insertions

[PATCH v2 01/12] ftgmac100: Add a tx timeout handler

2017-04-09 Thread Benjamin Herrenschmidt
We have a reset task to reset our chip, use it. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/et

[PATCH v2 09/12] ftgmac100: Split tx packet freeing from ftgmac100_tx_complete_packet()

2017-04-09 Thread Benjamin Herrenschmidt
This moves the packet freeing to a separate function which is also used by ftgmac100_free_buffers() and will be used more in the error path of fragmented sends. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.

[PATCH v2 12/12] ftgmac100: Remove tx descriptor accessors

2017-04-09 Thread Benjamin Herrenschmidt
Directly access the fields when needed. The accessors add clutter not clarity and in some cases cause unnecessary read-modify-write type access on the slow (uncached) descriptor memory. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v2. - Adjust for changes in pr

[PATCH v2 06/12] ftgmac100: Store tx skbs in a separate array

2017-04-09 Thread Benjamin Herrenschmidt
s. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v2. - Fix patch splitting mistake --- drivers/net/ethernet/faraday/ftgmac100.c | 59 +--- 1 file changed, 16 insertions(+), 43 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac

[PATCH v2 08/12] ftgmac100: Move the barrier out of ftgmac100_txdes_set_dma_own()

2017-04-09 Thread Benjamin Herrenschmidt
We'll use variants of this accessor without barriers when building series of descriptors for fragmented sends Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff

[PATCH v2 11/12] ftgmac100: Add support for fragmented tx

2017-04-09 Thread Benjamin Herrenschmidt
Add NETIF_F_SG and create multiple TX ring entries for skb fragments. On reclaim, the skb is only freed on the segment marked as "last". Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> -- v2. - Remove skb headlen size adjustments now that we use

[PATCH v2 07/12] ftgmac100: Cleanup tx queue handling

2017-04-09 Thread Benjamin Herrenschmidt
nt reclaim. The aspeed chips aren't SMP today but I prefer the code being right and future proof. So rip that out and replace it with more "standard" queue handling, currently with a threshold of 1 queue element, which will be increased when we implement fragmented sends. Signed-off-by: Be

[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

[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 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/

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 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

[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

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

[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 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 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 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

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 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 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 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 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 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 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

[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

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 >

Re: [PATCH 05/13] ftgmac100: Cleanup speed/duplex tracking and fix duplex config

2017-04-02 Thread Benjamin Herrenschmidt
On Sun, 2017-04-02 at 20:28 +0200, Andrew Lunn wrote: > > + if (new_speed) { > > + netdev_info(netdev, "Link up at %d Mbit/s %s > > duplex\n", > > + new_speed, > > + phydev->duplex == DUPLEX_FULL ? "full" > > : "half"); > > + } else if

Re: [PATCH 05/13] ftgmac100: Cleanup speed/duplex tracking and fix duplex config

2017-04-02 Thread Benjamin Herrenschmidt
On Sun, 2017-04-02 at 13:35 +1000, Benjamin Herrenschmidt wrote: > +   } else if (priv->cur_speed) { > +   /* No link, just return. Leave the HW alone so it can > +    * continue draining the tx ring. > +    */ > +   netdev_

Re: [PATCH 05/13] ftgmac100: Cleanup speed/duplex tracking and fix duplex config

2017-04-02 Thread Benjamin Herrenschmidt
On Sun, 2017-04-02 at 20:28 +0200, Andrew Lunn wrote: > Please consider using phy_print_status(). So in a subsequent (not yet posted) patch, I add Pause support. I noticed that phy_print_status() doesn't distinguish between full and partial (asym) pause support. Is that intentional ?

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

2017-04-07 Thread Benjamin Herrenschmidt
On Fri, 2017-04-07 at 13:09 +0300, Sergei Shtylyov wrote: > Hello! > > On 4/7/2017 6:30 AM, Benjamin Herrenschmidt wrote: > > > Move it below ftgmac100_xmit() and the rest of the tx path > > > > No code change. > > > > Signed-off-by: Benjam

Re: [PATCH 11/12] ftgmac100: Add support for fragmented tx

2017-04-07 Thread Benjamin Herrenschmidt
On Fri, 2017-04-07 at 06:26 -0700, Florian Fainelli wrote: > > On 04/06/2017 08:31 PM, Benjamin Herrenschmidt wrote: > > Add NETIF_F_SG and create multiple TX ring entries for skb fragments. > > > > On reclaim, the skb is only freed on the segment marked as "l

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

2017-04-07 Thread Benjamin Herrenschmidt
On Fri, 2017-04-07 at 05:49 -0700, David Miller wrote: > >    /* Tx ring */ > > + struct sk_buff *tx_skbs[TX_QUEUE_ENTRIES]; > >    unsigned int tx_clean_pointer; > >    unsigned int tx_pointer; > >    unsigned int tx_pending; > > Add this only in patch #6 or wherever it is

Re: [PATCH 05/12] ftgmac100: Pad small frames properly

2017-04-07 Thread Benjamin Herrenschmidt
On Fri, 2017-04-07 at 06:05 -0700, Florian Fainelli wrote: > You may want to use skb_put_padto() which also takes care of bumping > skb->len accordingly, in case that makes a difference for the > ftgmac100 hardware. Subsequent patch adds fragments, so it needs to bump headlen. I'll have a look

[PATCH v2 03/13] ftgmac100: Reorder struct fields and comment

2017-04-04 Thread Benjamin Herrenschmidt
Reorder the fields in struct ftgmac in slightly more logical groups. Will make more sense as I add/remove some. No code change. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 19 --- 1 file changed, 12 inse

[PATCH v2 08/13] ftgmac100: Request the interrupt only after HW is reset

2017-04-04 Thread Benjamin Herrenschmidt
The interrupt isn't shared, so this will keep it masked until we have the HW in a known sane state. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff

Documentation error for checksum offload check ?

2017-04-06 Thread Benjamin Herrenschmidt
I noticed in both Documentation/networking/checksum-offload.txt and include/linux/skbuff.h reference to helpers skb_csum_off_chk* Now, I can't find anything like that with grep ... :-) Am I missing something ? Cheers, Ben.

[PATCH 12/12] ftgmac100: Remove tx descriptor accessors

2017-04-06 Thread Benjamin Herrenschmidt
Directly access the fields when needed. The accessors add clutter not clarity and in some cases cause unnecessary read-modify-write type access on the slow (uncached) descriptor memory. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgma

[PATCH 00/12] ftgmac100: Rework batch 3 - TX path

2017-04-06 Thread Benjamin Herrenschmidt
This is the third batch of updates to the ftgmac100 driver. This one tackles the TX path of the driver. This provides the bulk of the performance improvements by adding support for fragmented sends along with a bunch of cleanups. Subsequent batches will add various features (ethtool functions,

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

2017-04-06 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 03/12] ftgmac100: Merge ftgmac100_xmit() into ftgmac100_hard_start_xmit()

2017-04-06 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 04/12] ftgmac100: Factor tx packet dropping path

2017-04-06 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

[PATCH 01/12] ftgmac100: Add a tx timeout handler

2017-04-06 Thread Benjamin Herrenschmidt
We have a reset task to reset our chip, use it. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/et

[PATCH 09/12] ftgmac100: Split tx packet freeing from ftgmac100_tx_complete_packet()

2017-04-06 Thread Benjamin Herrenschmidt
This moves the packet freeing to a separate function which is also used by ftgmac100_free_buffers() and will be used more in the error path of fragmented sends. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.

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

2017-04-06 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> --- drivers/net/ethernet/faraday/ftgmac100.c | 59 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/d

[PATCH 05/12] ftgmac100: Pad small frames properly

2017-04-06 Thread Benjamin Herrenschmidt
Rather than just transmitting garbage past the end of the small packet. 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/drive

[PATCH 06/12] ftgmac100: Store tx skbs in a separate array

2017-04-06 Thread Benjamin Herrenschmidt
s. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 58 +--- 1 file changed, 15 insertions(+), 43 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/f

[PATCH 07/12] ftgmac100: Cleanup tx queue handling

2017-04-06 Thread Benjamin Herrenschmidt
nt reclaim. The aspeed chips aren't SMP today but I prefer the code being right and future proof. So rip that out and replace it with more "standard" queue handling, currently with a threshold of 1 queue element, which will be increased when we implement fragmented sends. Signed-off-by: Be

[PATCH 11/12] ftgmac100: Add support for fragmented tx

2017-04-06 Thread Benjamin Herrenschmidt
Add NETIF_F_SG and create multiple TX ring entries for skb fragments. On reclaim, the skb is only freed on the segment marked as "last". Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> # Conflicts: # drivers/net/ethernet/faraday/ftgmac100.c --- driv

[PATCH 08/12] ftgmac100: Move the barrier out of ftgmac100_txdes_set_dma_own()

2017-04-06 Thread Benjamin Herrenschmidt
We'll use variants of this accessor without barriers when building series of descriptors for fragmented sends Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/net/ethernet/faraday/ftgmac100.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff

[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

<    1   2   3   4   5   >