Netdev List
 help / color / mirror / Atom feed
* Re: [v3,4/5] net: phy: at803x: Disable phy delay for RGMII mode
From: Marc Gonzalez @ 2019-02-12 13:34 UTC (permalink / raw)
  To: Peter Ujfalusi, Vinod Koul, Roger Quadros, Florian Fainelli
  Cc: David S Miller, netdev, MSM, Niklas Cassel, Bjorn Andersson,
	Andrew Lunn, Nori Sekhar
In-Reply-To: <147151c4-d162-4ebe-189a-564492d84d18@ti.com>

On 12/02/2019 11:55, Peter Ujfalusi wrote:

> On 21/01/2019 11.13, Vinod Koul wrote:
> 
>> For RGMII mode, phy delay should be disabled. Add this case along 
>> with disable delay routines.
> 
> In next-20190211 I need to revert this patch to get cpsw networking
> to work on am335x-evmsk. The board uses AR8031_AL1A PHY, which is
> handled by the phy/at803x.c

I'm having flashbacks:

[PATCH 1/2] net: phy: at803x: Fix RGMII RX and TX clock delays setup
https://www.spinics.net/lists/netdev/msg445053.html

Quirks of the Atheros 8035 PHY
https://www.spinics.net/lists/netdev/msg444527.html

See also
http://patchwork.ozlabs.org/project/netdev/list/?submitter=67482&state=*

Regards.

^ permalink raw reply

* Re: [PATCH net-next v4 0/9] net: Remove switchdev_ops
From: Ido Schimmel @ 2019-02-12 13:14 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev@vger.kernel.org, David S. Miller, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE,
	Jiri Pirko, andrew@lunn.ch, vivien.didelot@gmail.com
In-Reply-To: <20190211191001.8623-1-f.fainelli@gmail.com>

On Mon, Feb 11, 2019 at 11:09:52AM -0800, Florian Fainelli wrote:
> Hi all,
> 
> This patch series finishes by the removal of switchdev_ops. To get there
> we convert the existing switchdev_port_attr_{set,get} switchdev_ops to
> use a blocking notifier, thus making it consistent with how the objects
> are pushed to the switchdev enabled devices.
> 
> Please review and let me know what you think!
> 
> David, I would like to get Ido's feedback on this to make sure I did not
> miss something, thank you!

Hi Florian,

Why do you still keep switchdev_port_attr_get()? I believe we can remove
it and simplify things.

After your recent patchset to remove 'PORT_BRIDGE_FLAGS', the only
remaining user of get() is 'PORT_BRIDGE_FLAGS_SUPPORT'. It can be
converted to a blocking set() with 'PORT_PRE_BRIDGE_FLAGS' (or a similar
name).

I would like to make sure we're in sync with regards to future changes.
After this patchset to get rid of switchdev_ops we can continue to
completely removing switchdev (I believe Jiri approves). The
prepare-commit model is not really needed and the two switchdev
notification chains can be split into bridge and vxlan specific chains.

Notifications sent in an atomic context can be handled by drivers
directly in this context. Similar to how FDB/route/neighbour are
handled. It will really simplify things. No need for the defer flag
anymore and tricks like 'PORT_BRIDGE_FLAGS_SUPPORT' and
'PORT_PRE_BRIDGE_FLAGS'. In the atomic context the driver can veto the
requested bridge flags, but program the device from a blocking context
(using a workqueue).

^ permalink raw reply

* Re: [PATCH V1 net 2/2] net: ena: update driver version from 2.0.2 to 2.0.3
From: Andrew Lunn @ 2019-02-12 13:11 UTC (permalink / raw)
  To: Kiyanovski, Arthur
  Cc: Moritz Fischer, David S. Miller, netdev@vger.kernel.org,
	Woodhouse, David, Machulsky, Zorik, Matushevsky, Alexander,
	Bshara, Saeed, Wilson, Matt, Liguori, Anthony, Bshara, Nafea,
	Tzalik, Guy, Belgazal, Netanel, Saidi, Ali
In-Reply-To: <55dcaee1242649e2a4d8984f120844ae@EX13D22EUA004.ant.amazon.com>

On Tue, Feb 12, 2019 at 11:42:31AM +0000, Kiyanovski, Arthur wrote:
> Hi Moritz,
> 
> > -----Original Message-----
> > From: Moritz Fischer <moritz.fischer@ettus.com>
> > Subject: Re: [PATCH V1 net 2/2] net: ena: update driver version from 2.0.2 to
> > 2.0.3
> > 
> > Hi Arthur,
> > 
> > On Mon, Feb 11, 2019 at 9:19 AM <akiyano@amazon.com> wrote:
> > >
> > > From: Arthur Kiyanovski <akiyano@amazon.com>
> > >
> > > Update driver version due to bug fix.
> > 
> > Wouldn't you want to do this atomically with the actual fix in one commit?
> > 
> > Thanks,
> > Moritz
> 
> Thanks for the feedback.
> I don't want to add the version to the fix.
> Version 2.0.3 includes all of its content that came before this fix, including features.
> Fixes are cherry-picked to older driver versions automatically using the "Fixes:" directive.
> If I add the version change to the fix, older driver versions that get this fix will become version 2.0.3, which is incorrect feature-wise.

Hi Arthur

I think this points out how useless the version string it, and why
many drivers don't use it.

     Andrew

^ permalink raw reply

* [PATCH net] sfc: initialise found bitmap in efx_ef10_mtd_probe
From: Bert Kenward @ 2019-02-12 13:10 UTC (permalink / raw)
  To: Dave Miller; +Cc: linux-net-drivers, netdev

The bitmap of found partitions in efx_ef10_mtd_probe was not
initialised, causing partitions to be suppressed based off whatever
value was in the bitmap at the start.

Fixes: 3366463513f5 ("sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe")
Signed-off-by: Bert Kenward <bkenward@solarflare.com>
---
 drivers/net/ethernet/sfc/ef10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 2f2bda68d861..c08034154a9a 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -6115,7 +6115,7 @@ static int efx_ef10_mtd_probe_partition(struct efx_nic *efx,
 static int efx_ef10_mtd_probe(struct efx_nic *efx)
 {
 	MCDI_DECLARE_BUF(outbuf, MC_CMD_NVRAM_PARTITIONS_OUT_LENMAX);
-	DECLARE_BITMAP(found, EF10_NVRAM_PARTITION_COUNT);
+	DECLARE_BITMAP(found, EF10_NVRAM_PARTITION_COUNT) = { 0 };
 	struct efx_mcdi_mtd_partition *parts;
 	size_t outlen, n_parts_total, i, n_parts;
 	unsigned int type;
-- 
2.20.1


^ permalink raw reply related

* Re: [PATCH net] dsa: mv88e6xxx: Ensure all pending interrupts are handled prior to exit
From: Andrew Lunn @ 2019-02-12 12:56 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: John David Anglin, Russell King, Vivien Didelot, Florian Fainelli,
	netdev
In-Reply-To: <13c1e6d5-c287-0091-3b24-1978f9a18e7e@gmail.com>

On Tue, Feb 12, 2019 at 07:51:05AM +0100, Heiner Kallweit wrote:
> On 12.02.2019 04:58, Andrew Lunn wrote:
> >>> Hi David
> >>>
> >>> I just tested this on one of my boards. It loops endlessly:
> >>>
> >>> [   47.173396] mv88e6xxx_g1_irq_thread_work: c881 a8 80                         
> >>> [   47.182108] mv88e6xxx_g1_irq_thread_work: c881 a8 80                         
> >>> [   47.190820] mv88e6xxx_g1_irq_thread_work: c881 a8 80                         
> >>> [   47.199535] mv88e6xxx_g1_irq_thread_work: c881 a8 80                         
> >>> [   47.208254] mv88e6xxx_g1_irq_thread_work: c881 a8 80   
> >>>
> >>> These are reg, ctl1, reg & ctl1.
> >>>
> >>> So there is an unhandled device interrupt.
> > 
> > Hi Heiner
> > 
> > Your patch Fixes: 2b3e88ea6528 ("net: phy: improve phy state
> > checking") is causing me problems with interrupts for the Marvell
> > switches.
> > 
> Hi Andrew,
> 
> what kernel version is it?

It is a little bit old, 5.0-rc1 net-next. I should rebase and
retest. I'm testing on a ZII board which is not fully in mainline So i
need some patches.

> And the PHY driver in use is "Marvell 88E6390" ?

Yes, the marvell 1G driver.

     Andrew

^ permalink raw reply

* Re: [RFC, PATCH] net: page_pool: Don't use page->private to store dma_addr_t
From: Tariq Toukan @ 2019-02-12 12:39 UTC (permalink / raw)
  To: Eric Dumazet, Ilias Apalodimas, Matthew Wilcox, brouer@redhat.com
  Cc: David Miller, toke@redhat.com, netdev@vger.kernel.org,
	mgorman@techsingularity.net, linux-mm@kvack.org
In-Reply-To: <64f7af75-e6df-7abc-c4ce-82e6ca51fafe@gmail.com>



On 2/11/2019 7:14 PM, Eric Dumazet wrote:
> 
> 
> On 02/11/2019 12:53 AM, Tariq Toukan wrote:
>>
> 
>> Hi,
>>
>> It's great to use the struct page to store its dma mapping, but I am
>> worried about extensibility.
>> page_pool is evolving, and it would need several more per-page fields.
>> One of them would be pageref_bias, a planned optimization to reduce the
>> number of the costly atomic pageref operations (and replace existing
>> code in several drivers).
>>
> 
> But the point about pageref_bias is to place it in a different cache line than "struct page"
> 
> The major cost is having a cache line bouncing between producer and consumer.
> 

pageref_bias is meant to be dirtied only by the page requester, i.e. the 
NIC driver / page_pool.
All other components (basically, SKB release flow / put_page) should 
continue working with the atomic page_refcnt, and not dirty the 
pageref_bias.

However, what bothers me more is another issue.
The optimization doesn't cleanly combine with the new page_pool 
direction for maintaining a queue for "available" pages, as the put_page 
flow would need to read pageref_bias, asynchronously, and act accordingly.

The suggested hook in put_page (to catch the 2 -> 1 "biased refcnt" 
transition) causes a problem to the traditional pageref_bias idea, as it 
implies a new point in which the pageref_bias field is read 
*asynchronously*. This would risk missing the this critical 2 -> 1 
transition! Unless pageref_bias is atomic...


> pageref_bias means the producer only have to read the "struct page" and not dirty it
> in the case the page can be recycled.
> 
> 
> 
>> I would replace this dma field with a pointer to an extensible struct,
>> that would contain the dma mapping (and other stuff in the near future).
>> This pointer fits perfectly with the existing unsigned long private;
>> they can share the memory, for both 32- and 64-bits systems.
>>
>> The only downside is one more pointer de-reference. This should be perf
>> tested.
>> However, when introducing the page refcnt bias optimization into
>> page_pool, I believe the perf gain would be guaranteed.
> 
> Only in some cases perhaps (when the cache line can be dirtied without performance hit)
> 

^ permalink raw reply

* Re: [PATCH 1/1] bnx2x: Add FW 7.13.11.0.
From: Josh Boyer @ 2019-02-12 12:37 UTC (permalink / raw)
  To: Rahul Verma
  Cc: Kyle McMartin, netdev, linux-rdma, linux-scsi, Linux Firmware,
	Ben Hutchings, ariel.elior
In-Reply-To: <20190208085704.26959-1-rahul.verma@cavium.com>

On Sat, Feb 9, 2019 at 11:06 PM Rahul Verma <rahul.verma@cavium.com> wrote:
>
> From: Rahul Verma <Rahul.Verma@cavium.com>
>
> This patch adds new FW for bnx2x, which adds the following:
>  - TX VLAN filtering support.
>  - Enable TPA only for packets without VLAN.
>
> It also addresses few critical issues,
>  - Fairness algorithm misbehaviour when minimum bandwidth configured
>    for all PFs.
>  - Error recovery issue on TAPE devices.
>  - FW not discarding FIP frames that are not designated to PF.
>  - Kernel driver initialization failure after preboot driver.
>  - VxLAN stops working after sending inner IP fragmented traffic.
>  - Issues in the following FW flows:
>     SD VLAN update, TX packet drop, packet padding flow, vlan add/remove.
>
> Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
> Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
> Signed-off-by: Rahul Verma <Rahul.Verma@cavium.com>

Applied and pushed out.

josh

^ permalink raw reply

* Re: [PATCH net-next v4 1/9] Documentation: networking: switchdev: Update port parent ID section
From: Ido Schimmel @ 2019-02-12 12:19 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev@vger.kernel.org, David S. Miller, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE,
	Jiri Pirko, andrew@lunn.ch, vivien.didelot@gmail.com
In-Reply-To: <20190211191001.8623-2-f.fainelli@gmail.com>

On Mon, Feb 11, 2019 at 11:09:53AM -0800, Florian Fainelli wrote:
> Update the section about switchdev drivers having to implement a
> switchdev_port_attr_get() function to return
> SWITCHDEV_ATTR_ID_PORT_PARENT_ID since that is no longer valid after
> commit bccb30254a4a ("net: Get rid of
> SWITCHDEV_ATTR_ID_PORT_PARENT_ID").
> 
> Fixes: bccb30254a4a ("net: Get rid of SWITCHDEV_ATTR_ID_PORT_PARENT_ID")
> Acked-by: Jiri Pirko <jiri@mellanox.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>

^ permalink raw reply

* Re: [PATCH net-next 1/3] mlxsw: spectrum_switchdev: Remove getting PORT_BRIDGE_FLAGS
From: Ido Schimmel @ 2019-02-12 12:18 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev@vger.kernel.org, David S. Miller, open list,
	open list:STAGING SUBSYSTEM, moderated list:ETHERNET BRIDGE,
	Jiri Pirko, andrew@lunn.ch, vivien.didelot@gmail.com
In-Reply-To: <20190211211749.19847-2-f.fainelli@gmail.com>

On Mon, Feb 11, 2019 at 01:17:47PM -0800, Florian Fainelli wrote:
> There is no code that will query the SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS
> attribute remove support for that.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>

^ permalink raw reply

* Re: [v3,4/5] net: phy: at803x: Disable phy delay for RGMII mode
From: Vinod Koul @ 2019-02-12 12:17 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: David S Miller, Roger Quadros, netdev, linux-arm-msm,
	Niklas Cassel, Bjorn Andersson, Andrew Lunn, Florian Fainelli,
	Nori, Sekhar
In-Reply-To: <20190212113114.GZ4296@vkoul-mobl>

Hi again,

On 12-02-19, 17:01, Vinod Koul wrote:
> Hi Peter,
> 
> On 12-02-19, 12:55, Peter Ujfalusi wrote:
> > Vinod,
> > 
> > On 21/01/2019 11.13, Vinod Koul wrote:
> > > For RGMII mode, phy delay should be disabled. Add this case along
> > > with disable delay routines.
> > 
> > In next-20190211 I need to revert this patch to get cpsw networking to
> > work on am335x-evmsk. The board uses AR8031_AL1A PHY, which is handled
> > by the phy/at803x.c
> 
> I see that DTS specifies that you are using phy-mode = "rgmii-txid".
> RGMII mode implies that we should not have any delay in the
> phy, so this patch does the right thing.
> 
> In the previous version of the patch I did propose to add a DT entry so
> that current users who are wrongly using this would not be impacted but
> the suggestion was to get them fixed.
> 
> So in you case do you need rgmii-txd mode if so why should the delay be
> enabled for this? We can add a patch that enabled delay for your
> controller but that cant be rgmii mode.

Relooking at this again and seeing the mode definitions in
Documentation/devicetree/bindings/net/ethernet.txt,
I think I have got it wrong.. (thanks to Niklas for discussion)

So in case of rgmii mode delay should be disabled and in case of
rgmii-id/rxid/txid it should be enabled. I will send a patch to address
this shortly, please do test.

Thanks
-- 
~Vinod

^ permalink raw reply

* Re: [PATCH net] af_key: unconditionally clone on broadcast
From: Steffen Klassert @ 2019-02-12 12:16 UTC (permalink / raw)
  To: David Miller; +Cc: stranche, eric.dumazet, netdev
In-Reply-To: <20190211.124554.1686370406673029680.davem@davemloft.net>

On Mon, Feb 11, 2019 at 12:45:54PM -0800, David Miller wrote:
> From: Sean Tranchetti <stranche@codeaurora.org>
> Date: Thu,  7 Feb 2019 13:33:21 -0700
> 
> > Attempting to avoid cloning the skb when broadcasting by inflating
> > the refcount with sock_hold/sock_put while under RCU lock is dangerous
> > and violates RCU principles. It leads to subtle race conditions when
> > attempting to free the SKB, as we may reference sockets that have
> > already been freed by the stack.
>  ...
> > Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
> > Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
> > ---
> > Realized I never actually sent this patch out after testing the changes
> > Eric recommended. Whoops. Better late then never, I suppose...
> 
> Steffen, I assume you will review and pick this up.

I was not on Cc and overlooked it at the list.
Thanks for the pointer!

Now applied to the ipsec tree, thanks Sean!

^ permalink raw reply

* Re: [v3,4/5] net: phy: at803x: Disable phy delay for RGMII mode
From: Peter Ujfalusi @ 2019-02-12 12:09 UTC (permalink / raw)
  To: Vinod Koul
  Cc: David S Miller, Roger Quadros, netdev, linux-arm-msm,
	Niklas Cassel, Bjorn Andersson, Andrew Lunn, Florian Fainelli,
	Nori, Sekhar
In-Reply-To: <20190212113114.GZ4296@vkoul-mobl>

Hi Vinod,

On 12/02/2019 13.31, Vinod Koul wrote:
> Hi Peter,
> 
> On 12-02-19, 12:55, Peter Ujfalusi wrote:
>> Vinod,
>>
>> On 21/01/2019 11.13, Vinod Koul wrote:
>>> For RGMII mode, phy delay should be disabled. Add this case along
>>> with disable delay routines.
>>
>> In next-20190211 I need to revert this patch to get cpsw networking to
>> work on am335x-evmsk. The board uses AR8031_AL1A PHY, which is handled
>> by the phy/at803x.c
> 
> I see that DTS specifies that you are using phy-mode = "rgmii-txid".
> RGMII mode implies that we should not have any delay in the
> phy, so this patch does the right thing.

Right, on am335x-evmsk:
[    3.393406] at803x_config_init: phydev->interface: 11
So PHY_INTERFACE_MODE_RGMII_TXID.

> In the previous version of the patch I did propose to add a DT entry so
> that current users who are wrongly using this would not be impacted but
> the suggestion was to get them fixed.
> 
> So in you case do you need rgmii-txd mode if so why should the delay be
> enabled for this? We can add a patch that enabled delay for your
> controller but that cant be rgmii mode.

I'm not too familiar with the networking, but the AR8031 datasheet does
tell that the debug_5:bit8 is 0 by default (rgmii tx clock delay disable).

In the errata document of am335x (http://www.ti.com/lit/pdf/sprz360),
1.0.10 I believe tells that the delay needs to be enabled on the rgmii
ethernet PHY because the internal delay is not working (?) and advises
that the delay might need to be enabled on the rgmii PHY.

The PHY_INTERFACE_MODE_RGMII_TXID delay was enabled in the PHY driver
since 2013 (1ca6d1b1aef4628ff0fe458135ddb008d134ad8f)

To me it looks like that when AR8031 is used with am335x the 'rgmii tx
clock delay' needs to be enabled.

Sekhar, Roger: any insights, thoughts?

> 
> Thanks
> 
> 
>>
>> On next-20190211:
>> [    3.374601] net eth0: initializing cpsw version 1.12 (0)
>> [    3.384484] Atheros 8031 ethernet 4a101000.mdio:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
>> [    3.400041] cpsw 4a100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
>> [    3.410813] mmc1: new SDIO card at address 0001
>> [    3.439362] IP-Config: Complete:
>> [    3.442649]      device=eth0, hwaddr=bc:6a:29:7d:2c:a9, ipaddr=10.0.0.90, mask=255.255.255.0, gw=10.0.0.1
>> [    3.452840]      host=10.0.0.90, domain=, nis-domain=(none)
>> [    3.458462]      bootserver=10.0.0.30, rootserver=10.0.0.30, rootpath=
>> [    3.466296] vwl1271: disabling
>> [    3.470195] ALSA device list:
>> [    3.473189]   #0: AM335x-EVMSK
>>
>> After reverting this patch:
>> [    3.374636] net eth0: initializing cpsw version 1.12 (0)
>> [    3.384534] Atheros 8031 ethernet 4a101000.mdio:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
>> [    3.400125] cpsw 4a100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
>> [    3.410866] mmc1: new SDIO card at address 0001
>> [    3.439379] IP-Config: Complete:
>> [    3.442666]      device=eth0, hwaddr=bc:6a:29:7d:2c:a9, ipaddr=10.0.0.90, mask=255.255.255.0, gw=10.0.0.1
>> [    3.452865]      host=10.0.0.90, domain=, nis-domain=(none)
>> [    3.458482]      bootserver=10.0.0.30, rootserver=10.0.0.30, rootpath=
>> [    3.466334] vwl1271: disabling
>> [    3.470245] ALSA device list:
>> [    3.473241]   #0: AM335x-EVMSK
>> [    3.501052] VFS: Mounted root (nfs filesystem) readonly on device 0:15.
>> [    3.508694] devtmpfs: mounted
>> [    3.514546] Freeing unused kernel memory: 1024K
>> [    3.520567] Run /sbin/init as init process
>>
>> and the board boots to nfsroot fine.
>>
>>  
>>> Signed-off-by: Vinod Koul <vkoul@kernel.org>
>>> ---
>>>  drivers/net/phy/at803x.c | 22 ++++++++++++----------
>>>  1 file changed, 12 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
>>> index f9432d053a22..8ff12938ab47 100644
>>> --- a/drivers/net/phy/at803x.c
>>> +++ b/drivers/net/phy/at803x.c
>>> @@ -110,16 +110,16 @@ static int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg,
>>>  	return phy_write(phydev, AT803X_DEBUG_DATA, val);
>>>  }
>>>  
>>> -static inline int at803x_enable_rx_delay(struct phy_device *phydev)
>>> +static inline int at803x_disable_rx_delay(struct phy_device *phydev)
>>>  {
>>> -	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0,
>>> -					AT803X_DEBUG_RX_CLK_DLY_EN);
>>> +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0,
>>> +				     AT803X_DEBUG_RX_CLK_DLY_EN, 0);
>>>  }
>>>  
>>> -static inline int at803x_enable_tx_delay(struct phy_device *phydev)
>>> +static inline int at803x_disable_tx_delay(struct phy_device *phydev)
>>>  {
>>> -	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0,
>>> -					AT803X_DEBUG_TX_CLK_DLY_EN);
>>> +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5,
>>> +				     AT803X_DEBUG_TX_CLK_DLY_EN, 0);
>>>  }
>>>  
>>>  /* save relevant PHY registers to private copy */
>>> @@ -256,15 +256,17 @@ static int at803x_config_init(struct phy_device *phydev)
>>>  		return ret;
>>>  
>>>  	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID ||
>>> -			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
>>> -		ret = at803x_enable_rx_delay(phydev);
>>> +			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
>>> +			phydev->interface == PHY_INTERFACE_MODE_RGMII) {
>>> +		ret = at803x_disable_rx_delay(phydev);
>>>  		if (ret < 0)
>>>  			return ret;
>>>  	}
>>>  
>>>  	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
>>> -			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
>>> -		ret = at803x_enable_tx_delay(phydev);
>>> +			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
>>> +			phydev->interface == PHY_INTERFACE_MODE_RGMII) {
>>> +		ret = at803x_disable_tx_delay(phydev);
>>>  		if (ret < 0)
>>>  			return ret;
>>>  	}
>>>
>>
>> - Péter
>>
>> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply

* pull-request: mac80211 2019-02-12
From: Johannes Berg @ 2019-02-12 11:51 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-wireless

Hi Dave,

We have few more fixes, mostly one-liners; two are bigger:
 * the speculation one, only because the function had multiple
   return points and that had to change, and
 * the peer measurement locking one, because I had to refactor
   a function to be able to call it with or without locking
   (depending on context).

Please pull and let me know if there's any problem.

Thanks,
johannes



The following changes since commit f09bef61f1ed72869b231e5cff16e73a06505cfb:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf (2019-02-05 11:23:23 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git tags/mac80211-for-davem-2019-02-12

for you to fetch changes up to 6157ca0d6bfe437691b1e98a62e2efe12b6714da:

  mac80211: Fix Tx aggregation session tear down with ITXQs (2019-02-11 15:50:56 +0100)

----------------------------------------------------------------
Just a few fixes:
 * aggregation session teardown with internal TXQs was
   continuing to send some frames marked as aggregation,
   fix from Ilan
 * IBSS join was missed during firmware restart, should
   such a thing happen
 * speculative execution based on the return value of
   cfg80211_classify8021d() - which is controlled by the
   sender of the packet - could be problematic in some
   code using it, prevent it
 * a few peer measurement fixes

----------------------------------------------------------------
Aviya Erenfeld (1):
      nl80211: Fix FTM per burst maximum value

Ilan Peer (1):
      mac80211: Fix Tx aggregation session tear down with ITXQs

Johannes Berg (5):
      cfg80211: pmsr: fix MAC address setting
      cfg80211: pmsr: fix abort locking
      mac80211: call drv_ibss_join() on restart
      cfg80211: pmsr: record netlink port ID
      cfg80211: prevent speculation on cfg80211_classify8021d() return

 net/mac80211/agg-tx.c  |  4 +++-
 net/mac80211/util.c    |  6 +++++-
 net/wireless/core.c    |  2 ++
 net/wireless/nl80211.c |  2 +-
 net/wireless/pmsr.c    | 26 +++++++++++++++++---------
 net/wireless/util.c    | 35 ++++++++++++++++++++++++-----------
 6 files changed, 52 insertions(+), 23 deletions(-)


^ permalink raw reply

* RE: [PATCH V1 net 2/2] net: ena: update driver version from 2.0.2 to 2.0.3
From: Kiyanovski, Arthur @ 2019-02-12 11:42 UTC (permalink / raw)
  To: Moritz Fischer
  Cc: David S. Miller, netdev@vger.kernel.org, Woodhouse, David,
	Machulsky, Zorik, Matushevsky, Alexander, Bshara, Saeed,
	Wilson, Matt, Liguori, Anthony, Bshara, Nafea, Tzalik, Guy,
	Belgazal, Netanel, Saidi, Ali
In-Reply-To: <CAAtXAHefiwhcDYnSXPjj5_NJ5dJ44L3OAkqLp6viYYHXbfn_1A@mail.gmail.com>

Hi Moritz,

> -----Original Message-----
> From: Moritz Fischer <moritz.fischer@ettus.com>
> Subject: Re: [PATCH V1 net 2/2] net: ena: update driver version from 2.0.2 to
> 2.0.3
> 
> Hi Arthur,
> 
> On Mon, Feb 11, 2019 at 9:19 AM <akiyano@amazon.com> wrote:
> >
> > From: Arthur Kiyanovski <akiyano@amazon.com>
> >
> > Update driver version due to bug fix.
> 
> Wouldn't you want to do this atomically with the actual fix in one commit?
> 
> Thanks,
> Moritz

Thanks for the feedback.
I don't want to add the version to the fix.
Version 2.0.3 includes all of its content that came before this fix, including features.
Fixes are cherry-picked to older driver versions automatically using the "Fixes:" directive.
If I add the version change to the fix, older driver versions that get this fix will become version 2.0.3, which is incorrect feature-wise.

Thanks,
Arthur

^ permalink raw reply

* [bpf-next 0/2] cleanup SOCK_DEBUG() and introduce BPF_SOCK_OPS_STATS_CB
From: Yafang Shao @ 2019-02-12 11:31 UTC (permalink / raw)
  To: daniel, ast
  Cc: yhs, brakmo, edumazet, davem, netdev, linux-kernel, shaoyafang,
	Yafang Shao

SOCK_DEBUG is a very ancient debugging interface, and it's not very useful
for debugging.
This pacthset cleanups SOCK_DEBUG() and replace it with a new methord
based on BPF.

I cleanup SOCK_DEBUG() only for TCP, and other protocols are kept as is.

After this patchset, the SO_DEBUG interface will not take any effect for
TCP, but I still keep it in sock_{s,g}etsockopt() for TCP to avoid breaking
applications.

In the future we may extend tcp_stats() as bellow or something else to
cover all the LINUX_MIB_* and TCP_MIB_* proposaled[0] in the netconf2018.

now:
	tcp_stats(struct sock *sk, int mib_idx)
future:
	tcp_stats(struct sock *sk, int mib_idx, int packets)
	The argument packets can be 1 to indicates this is a event only;
	and skb_shinfo(skb)->gso_segs to indicates the number of packets
	are also concerned.

[0] page 14,
http://vger.kernel.org/netconf2018_files/BrendanGregg_netconf2018.pdf

Yafang Shao (2):
  tcp: replace SOCK_DEBUG() with tcp_stats()
  bpf: add BPF_SOCK_OPS_STATS_CB for tcp_stats()

 include/uapi/linux/bpf.h  |  5 +++++
 include/uapi/linux/snmp.h |  3 +++
 net/ipv4/proc.c           |  3 +++
 net/ipv4/tcp_input.c      | 27 ++++++++++++---------------
 net/ipv6/tcp_ipv6.c       |  2 --
 5 files changed, 23 insertions(+), 17 deletions(-)

-- 
1.8.3.1


^ permalink raw reply

* [bpf-next 2/2] bpf: add BPF_SOCK_OPS_STATS_CB for tcp_stats()
From: Yafang Shao @ 2019-02-12 11:31 UTC (permalink / raw)
  To: daniel, ast
  Cc: yhs, brakmo, edumazet, davem, netdev, linux-kernel, shaoyafang,
	Yafang Shao
In-Reply-To: <1549971097-12627-1-git-send-email-laoar.shao@gmail.com>

Introuce this new op BPF_SOCK_OPS_STATS_CB for tcp_stats() such that it
can be traced via BPF on a per socket basis.
There's one argument in BPF_SOCK_OPS_STATS_CB, which is Linux MIB index
LINUX_MIB_* to indicate the TCP event.
All these Linux MIBs are defined in include/uapi/linux/snmp.h.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
 include/uapi/linux/bpf.h | 5 +++++
 net/ipv4/tcp_input.c     | 1 +
 2 files changed, 6 insertions(+)

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 1777fa0..0314ddd 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -2894,6 +2894,11 @@ enum {
 	BPF_SOCK_OPS_TCP_LISTEN_CB,	/* Called on listen(2), right after
 					 * socket transition to LISTEN state.
 					 */
+	BPF_SOCK_OPS_STATS_CB,		/*
+					 * Called on tcp_stats().
+					 * Arg1: Linux MIB index
+					 * 	 LINUX_MIB_*
+					 */
 };
 
 /* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 88deb1f..4acf458 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3557,6 +3557,7 @@ static u32 tcp_newly_delivered(struct sock *sk, u32 prior_delivered, int flag)
 static void tcp_stats(struct sock *sk, int mib_idx)
 {
 	NET_INC_STATS(sock_net(sk), mib_idx);
+	tcp_call_bpf(sk, BPF_SOCK_OPS_STATS_CB, 1, &mib_idx);
 }
 
 /* This routine deals with incoming acks, but not outgoing ones. */
-- 
1.8.3.1


^ permalink raw reply related

* [bpf-next 1/2] tcp: replace SOCK_DEBUG() with tcp_stats()
From: Yafang Shao @ 2019-02-12 11:31 UTC (permalink / raw)
  To: daniel, ast
  Cc: yhs, brakmo, edumazet, davem, netdev, linux-kernel, shaoyafang,
	Yafang Shao
In-Reply-To: <1549971097-12627-1-git-send-email-laoar.shao@gmail.com>

SOCK_DEBUG is a very ancient debugging interface, and it's not very useful
for debugging.
So this patch removes the SOCK_DEBUG() and introduce a new function
tcp_stats() to trace this kind of events.
Some MIBs are added for these events.

Regarding the SO_DEBUG in sock_{s,g}etsockopt, I think it is better to
keep as-is, because if we return an errno to tell the application that
this optname isn't supported for TCP, it may break the application.
The application still can use this option but don't take any effect for
TCP.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
 include/uapi/linux/snmp.h |  3 +++
 net/ipv4/proc.c           |  3 +++
 net/ipv4/tcp_input.c      | 26 +++++++++++---------------
 net/ipv6/tcp_ipv6.c       |  2 --
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h
index 86dc24a..fd5c09c 100644
--- a/include/uapi/linux/snmp.h
+++ b/include/uapi/linux/snmp.h
@@ -283,6 +283,9 @@ enum
 	LINUX_MIB_TCPACKCOMPRESSED,		/* TCPAckCompressed */
 	LINUX_MIB_TCPZEROWINDOWDROP,		/* TCPZeroWindowDrop */
 	LINUX_MIB_TCPRCVQDROP,			/* TCPRcvQDrop */
+	LINUX_MIB_TCPINVALIDACK,		/* TCPInvalidAck */
+	LINUX_MIB_TCPOLDACK,			/* TCPOldAck */
+	LINUX_MIB_TCPPARTIALPACKET,		/* TCPPartialPacket */
 	__LINUX_MIB_MAX
 };
 
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index c3610b3..1b0320a 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -291,6 +291,9 @@ static int sockstat_seq_show(struct seq_file *seq, void *v)
 	SNMP_MIB_ITEM("TCPAckCompressed", LINUX_MIB_TCPACKCOMPRESSED),
 	SNMP_MIB_ITEM("TCPZeroWindowDrop", LINUX_MIB_TCPZEROWINDOWDROP),
 	SNMP_MIB_ITEM("TCPRcvQDrop", LINUX_MIB_TCPRCVQDROP),
+	SNMP_MIB_ITEM("TCPInvalidAck", LINUX_MIB_TCPINVALIDACK),
+	SNMP_MIB_ITEM("TCPOldAck", LINUX_MIB_TCPOLDACK),
+	SNMP_MIB_ITEM("TCPPartialPacket", LINUX_MIB_TCPPARTIALPACKET),
 	SNMP_MIB_SENTINEL
 };
 
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 7a027dec..88deb1f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3554,6 +3554,11 @@ static u32 tcp_newly_delivered(struct sock *sk, u32 prior_delivered, int flag)
 	return delivered;
 }
 
+static void tcp_stats(struct sock *sk, int mib_idx)
+{
+	NET_INC_STATS(sock_net(sk), mib_idx);
+}
+
 /* This routine deals with incoming acks, but not outgoing ones. */
 static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 {
@@ -3715,7 +3720,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 	return 1;
 
 invalid_ack:
-	SOCK_DEBUG(sk, "Ack %u after %u:%u\n", ack, tp->snd_una, tp->snd_nxt);
+	tcp_stats(sk, LINUX_MIB_TCPINVALIDACK);
 	return -1;
 
 old_ack:
@@ -3731,7 +3736,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 		tcp_xmit_recovery(sk, rexmit);
 	}
 
-	SOCK_DEBUG(sk, "Ack %u before %u:%u\n", ack, tp->snd_una, tp->snd_nxt);
+	tcp_stats(sk, LINUX_MIB_TCPOLDACK);
 	return 0;
 }
 
@@ -4432,13 +4437,10 @@ static void tcp_ofo_queue(struct sock *sk)
 		rb_erase(&skb->rbnode, &tp->out_of_order_queue);
 
 		if (unlikely(!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt))) {
-			SOCK_DEBUG(sk, "ofo packet was already received\n");
+			tcp_stats(sk, LINUX_MIB_TCPOFODROP);
 			tcp_drop(sk, skb);
 			continue;
 		}
-		SOCK_DEBUG(sk, "ofo requeuing : rcv_next %X seq %X - %X\n",
-			   tp->rcv_nxt, TCP_SKB_CB(skb)->seq,
-			   TCP_SKB_CB(skb)->end_seq);
 
 		tail = skb_peek_tail(&sk->sk_receive_queue);
 		eaten = tail && tcp_try_coalesce(sk, tail, skb, &fragstolen);
@@ -4499,11 +4501,9 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
 	tp->pred_flags = 0;
 	inet_csk_schedule_ack(sk);
 
-	NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFOQUEUE);
 	seq = TCP_SKB_CB(skb)->seq;
 	end_seq = TCP_SKB_CB(skb)->end_seq;
-	SOCK_DEBUG(sk, "out of order segment: rcv_next %X seq %X - %X\n",
-		   tp->rcv_nxt, seq, end_seq);
+	tcp_stats(sk, LINUX_MIB_TCPOFOQUEUE);
 
 	p = &tp->out_of_order_queue.rb_node;
 	if (RB_EMPTY_ROOT(&tp->out_of_order_queue)) {
@@ -4779,9 +4779,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 
 	if (before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
 		/* Partial packet, seq < rcv_next < end_seq */
-		SOCK_DEBUG(sk, "partial packet: rcv_next %X seq %X - %X\n",
-			   tp->rcv_nxt, TCP_SKB_CB(skb)->seq,
-			   TCP_SKB_CB(skb)->end_seq);
+		tcp_stats(sk, LINUX_MIB_TCPPARTIALPACKET);
 
 		tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, tp->rcv_nxt);
 
@@ -5061,9 +5059,7 @@ static int tcp_prune_queue(struct sock *sk)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 
-	SOCK_DEBUG(sk, "prune_queue: c=%x\n", tp->copied_seq);
-
-	NET_INC_STATS(sock_net(sk), LINUX_MIB_PRUNECALLED);
+	tcp_stats(sk, LINUX_MIB_PRUNECALLED);
 
 	if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
 		tcp_clamp_window(sk);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index e51cda7..57ef69a1 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -220,8 +220,6 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
 		u32 exthdrlen = icsk->icsk_ext_hdr_len;
 		struct sockaddr_in sin;
 
-		SOCK_DEBUG(sk, "connect: ipv4 mapped\n");
-
 		if (__ipv6_only_sock(sk))
 			return -ENETUNREACH;
 
-- 
1.8.3.1


^ permalink raw reply related

* Re: [v3,4/5] net: phy: at803x: Disable phy delay for RGMII mode
From: Vinod Koul @ 2019-02-12 11:31 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: David S Miller, Roger Quadros, netdev, linux-arm-msm,
	Niklas Cassel, Bjorn Andersson, Andrew Lunn, Florian Fainelli,
	Nori, Sekhar
In-Reply-To: <147151c4-d162-4ebe-189a-564492d84d18@ti.com>

Hi Peter,

On 12-02-19, 12:55, Peter Ujfalusi wrote:
> Vinod,
> 
> On 21/01/2019 11.13, Vinod Koul wrote:
> > For RGMII mode, phy delay should be disabled. Add this case along
> > with disable delay routines.
> 
> In next-20190211 I need to revert this patch to get cpsw networking to
> work on am335x-evmsk. The board uses AR8031_AL1A PHY, which is handled
> by the phy/at803x.c

I see that DTS specifies that you are using phy-mode = "rgmii-txid".
RGMII mode implies that we should not have any delay in the
phy, so this patch does the right thing.

In the previous version of the patch I did propose to add a DT entry so
that current users who are wrongly using this would not be impacted but
the suggestion was to get them fixed.

So in you case do you need rgmii-txd mode if so why should the delay be
enabled for this? We can add a patch that enabled delay for your
controller but that cant be rgmii mode.

Thanks


> 
> On next-20190211:
> [    3.374601] net eth0: initializing cpsw version 1.12 (0)
> [    3.384484] Atheros 8031 ethernet 4a101000.mdio:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
> [    3.400041] cpsw 4a100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
> [    3.410813] mmc1: new SDIO card at address 0001
> [    3.439362] IP-Config: Complete:
> [    3.442649]      device=eth0, hwaddr=bc:6a:29:7d:2c:a9, ipaddr=10.0.0.90, mask=255.255.255.0, gw=10.0.0.1
> [    3.452840]      host=10.0.0.90, domain=, nis-domain=(none)
> [    3.458462]      bootserver=10.0.0.30, rootserver=10.0.0.30, rootpath=
> [    3.466296] vwl1271: disabling
> [    3.470195] ALSA device list:
> [    3.473189]   #0: AM335x-EVMSK
> 
> After reverting this patch:
> [    3.374636] net eth0: initializing cpsw version 1.12 (0)
> [    3.384534] Atheros 8031 ethernet 4a101000.mdio:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
> [    3.400125] cpsw 4a100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
> [    3.410866] mmc1: new SDIO card at address 0001
> [    3.439379] IP-Config: Complete:
> [    3.442666]      device=eth0, hwaddr=bc:6a:29:7d:2c:a9, ipaddr=10.0.0.90, mask=255.255.255.0, gw=10.0.0.1
> [    3.452865]      host=10.0.0.90, domain=, nis-domain=(none)
> [    3.458482]      bootserver=10.0.0.30, rootserver=10.0.0.30, rootpath=
> [    3.466334] vwl1271: disabling
> [    3.470245] ALSA device list:
> [    3.473241]   #0: AM335x-EVMSK
> [    3.501052] VFS: Mounted root (nfs filesystem) readonly on device 0:15.
> [    3.508694] devtmpfs: mounted
> [    3.514546] Freeing unused kernel memory: 1024K
> [    3.520567] Run /sbin/init as init process
> 
> and the board boots to nfsroot fine.
> 
>  
> > Signed-off-by: Vinod Koul <vkoul@kernel.org>
> > ---
> >  drivers/net/phy/at803x.c | 22 ++++++++++++----------
> >  1 file changed, 12 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
> > index f9432d053a22..8ff12938ab47 100644
> > --- a/drivers/net/phy/at803x.c
> > +++ b/drivers/net/phy/at803x.c
> > @@ -110,16 +110,16 @@ static int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg,
> >  	return phy_write(phydev, AT803X_DEBUG_DATA, val);
> >  }
> >  
> > -static inline int at803x_enable_rx_delay(struct phy_device *phydev)
> > +static inline int at803x_disable_rx_delay(struct phy_device *phydev)
> >  {
> > -	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0,
> > -					AT803X_DEBUG_RX_CLK_DLY_EN);
> > +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0,
> > +				     AT803X_DEBUG_RX_CLK_DLY_EN, 0);
> >  }
> >  
> > -static inline int at803x_enable_tx_delay(struct phy_device *phydev)
> > +static inline int at803x_disable_tx_delay(struct phy_device *phydev)
> >  {
> > -	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0,
> > -					AT803X_DEBUG_TX_CLK_DLY_EN);
> > +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5,
> > +				     AT803X_DEBUG_TX_CLK_DLY_EN, 0);
> >  }
> >  
> >  /* save relevant PHY registers to private copy */
> > @@ -256,15 +256,17 @@ static int at803x_config_init(struct phy_device *phydev)
> >  		return ret;
> >  
> >  	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID ||
> > -			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
> > -		ret = at803x_enable_rx_delay(phydev);
> > +			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
> > +			phydev->interface == PHY_INTERFACE_MODE_RGMII) {
> > +		ret = at803x_disable_rx_delay(phydev);
> >  		if (ret < 0)
> >  			return ret;
> >  	}
> >  
> >  	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
> > -			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
> > -		ret = at803x_enable_tx_delay(phydev);
> > +			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
> > +			phydev->interface == PHY_INTERFACE_MODE_RGMII) {
> > +		ret = at803x_disable_tx_delay(phydev);
> >  		if (ret < 0)
> >  			return ret;
> >  	}
> > 
> 
> - Péter
> 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

-- 
~Vinod

^ permalink raw reply

* Re: [PATCH V1 net 2/2] net: ena: update driver version from 2.0.2 to 2.0.3
From: Moritz Fischer @ 2019-02-12 11:12 UTC (permalink / raw)
  To: akiyano
  Cc: David S. Miller, netdev, dwmw, zorik, matua, saeedb, msw,
	aliguori, nafea, gtzalik, netanel, alisaidi
In-Reply-To: <1549905464-13758-3-git-send-email-akiyano@amazon.com>

Hi Arthur,

On Mon, Feb 11, 2019 at 9:19 AM <akiyano@amazon.com> wrote:
>
> From: Arthur Kiyanovski <akiyano@amazon.com>
>
> Update driver version due to bug fix.

Wouldn't you want to do this atomically with the actual fix in one commit?

Thanks,
Moritz

^ permalink raw reply

* Re: [v3,4/5] net: phy: at803x: Disable phy delay for RGMII mode
From: Peter Ujfalusi @ 2019-02-12 10:55 UTC (permalink / raw)
  To: Vinod Koul, David S Miller, Roger Quadros
  Cc: netdev, linux-arm-msm, Niklas Cassel, Bjorn Andersson,
	Andrew Lunn, Florian Fainelli, Nori, Sekhar
In-Reply-To: <20190121091318.20079-5-vkoul@kernel.org>

Vinod,

On 21/01/2019 11.13, Vinod Koul wrote:
> For RGMII mode, phy delay should be disabled. Add this case along
> with disable delay routines.

In next-20190211 I need to revert this patch to get cpsw networking to work on am335x-evmsk. The board uses AR8031_AL1A PHY, which is handled by the phy/at803x.c

On next-20190211:
[    3.374601] net eth0: initializing cpsw version 1.12 (0)
[    3.384484] Atheros 8031 ethernet 4a101000.mdio:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
[    3.400041] cpsw 4a100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[    3.410813] mmc1: new SDIO card at address 0001
[    3.439362] IP-Config: Complete:
[    3.442649]      device=eth0, hwaddr=bc:6a:29:7d:2c:a9, ipaddr=10.0.0.90, mask=255.255.255.0, gw=10.0.0.1
[    3.452840]      host=10.0.0.90, domain=, nis-domain=(none)
[    3.458462]      bootserver=10.0.0.30, rootserver=10.0.0.30, rootpath=
[    3.466296] vwl1271: disabling
[    3.470195] ALSA device list:
[    3.473189]   #0: AM335x-EVMSK

After reverting this patch:
[    3.374636] net eth0: initializing cpsw version 1.12 (0)
[    3.384534] Atheros 8031 ethernet 4a101000.mdio:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
[    3.400125] cpsw 4a100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[    3.410866] mmc1: new SDIO card at address 0001
[    3.439379] IP-Config: Complete:
[    3.442666]      device=eth0, hwaddr=bc:6a:29:7d:2c:a9, ipaddr=10.0.0.90, mask=255.255.255.0, gw=10.0.0.1
[    3.452865]      host=10.0.0.90, domain=, nis-domain=(none)
[    3.458482]      bootserver=10.0.0.30, rootserver=10.0.0.30, rootpath=
[    3.466334] vwl1271: disabling
[    3.470245] ALSA device list:
[    3.473241]   #0: AM335x-EVMSK
[    3.501052] VFS: Mounted root (nfs filesystem) readonly on device 0:15.
[    3.508694] devtmpfs: mounted
[    3.514546] Freeing unused kernel memory: 1024K
[    3.520567] Run /sbin/init as init process

and the board boots to nfsroot fine.

 
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---
>  drivers/net/phy/at803x.c | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
> index f9432d053a22..8ff12938ab47 100644
> --- a/drivers/net/phy/at803x.c
> +++ b/drivers/net/phy/at803x.c
> @@ -110,16 +110,16 @@ static int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg,
>  	return phy_write(phydev, AT803X_DEBUG_DATA, val);
>  }
>  
> -static inline int at803x_enable_rx_delay(struct phy_device *phydev)
> +static inline int at803x_disable_rx_delay(struct phy_device *phydev)
>  {
> -	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0,
> -					AT803X_DEBUG_RX_CLK_DLY_EN);
> +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0,
> +				     AT803X_DEBUG_RX_CLK_DLY_EN, 0);
>  }
>  
> -static inline int at803x_enable_tx_delay(struct phy_device *phydev)
> +static inline int at803x_disable_tx_delay(struct phy_device *phydev)
>  {
> -	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0,
> -					AT803X_DEBUG_TX_CLK_DLY_EN);
> +	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5,
> +				     AT803X_DEBUG_TX_CLK_DLY_EN, 0);
>  }
>  
>  /* save relevant PHY registers to private copy */
> @@ -256,15 +256,17 @@ static int at803x_config_init(struct phy_device *phydev)
>  		return ret;
>  
>  	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID ||
> -			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
> -		ret = at803x_enable_rx_delay(phydev);
> +			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
> +			phydev->interface == PHY_INTERFACE_MODE_RGMII) {
> +		ret = at803x_disable_rx_delay(phydev);
>  		if (ret < 0)
>  			return ret;
>  	}
>  
>  	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
> -			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
> -		ret = at803x_enable_tx_delay(phydev);
> +			phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
> +			phydev->interface == PHY_INTERFACE_MODE_RGMII) {
> +		ret = at803x_disable_tx_delay(phydev);
>  		if (ret < 0)
>  			return ret;
>  	}
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply

* [PATCH net] sctp: set stream ext to NULL after freeing it in sctp_stream_outq_migrate
From: Xin Long @ 2019-02-12 10:51 UTC (permalink / raw)
  To: linux-kernel, network dev, linux-sctp
  Cc: davem, Marcelo Ricardo Leitner, Neil Horman

In sctp_stream_init(), after sctp_stream_outq_migrate() freed the
surplus streams' ext, but sctp_stream_alloc_out() returns -ENOMEM,
stream->outcnt will not be set to 'outcnt'.

With the bigger value on stream->outcnt, when closing the assoc and
freeing its streams, the ext of those surplus streams will be freed
again since those stream exts were not set to NULL after freeing in
sctp_stream_outq_migrate(). Then the invalid-free issue reported by
syzbot would be triggered.

We fix it by simply setting them to NULL after freeing.

Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations")
Reported-by: syzbot+58e480e7b28f2d890bfd@syzkaller.appspotmail.com
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/stream.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/sctp/stream.c b/net/sctp/stream.c
index f246331..2936ed1 100644
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -144,8 +144,10 @@ static void sctp_stream_outq_migrate(struct sctp_stream *stream,
 		}
 	}
 
-	for (i = outcnt; i < stream->outcnt; i++)
+	for (i = outcnt; i < stream->outcnt; i++) {
 		kfree(SCTP_SO(stream, i)->ext);
+		SCTP_SO(stream, i)->ext = NULL;
+	}
 }
 
 static int sctp_stream_alloc_out(struct sctp_stream *stream, __u16 outcnt,
-- 
2.1.0


^ permalink raw reply related

* [PATCH net] sctp: call gso_reset_checksum when computing checksum in sctp_gso_segment
From: Xin Long @ 2019-02-12 10:47 UTC (permalink / raw)
  To: linux-kernel, network dev, linux-sctp
  Cc: davem, Marcelo Ricardo Leitner, Neil Horman

Jianlin reported a panic when running sctp gso over gre over vlan device:

  [   84.772930] RIP: 0010:do_csum+0x6d/0x170
  [   84.790605] Call Trace:
  [   84.791054]  csum_partial+0xd/0x20
  [   84.791657]  gre_gso_segment+0x2c3/0x390
  [   84.792364]  inet_gso_segment+0x161/0x3e0
  [   84.793071]  skb_mac_gso_segment+0xb8/0x120
  [   84.793846]  __skb_gso_segment+0x7e/0x180
  [   84.794581]  validate_xmit_skb+0x141/0x2e0
  [   84.795297]  __dev_queue_xmit+0x258/0x8f0
  [   84.795949]  ? eth_header+0x26/0xc0
  [   84.796581]  ip_finish_output2+0x196/0x430
  [   84.797295]  ? skb_gso_validate_network_len+0x11/0x80
  [   84.798183]  ? ip_finish_output+0x169/0x270
  [   84.798875]  ip_output+0x6c/0xe0
  [   84.799413]  ? ip_append_data.part.50+0xc0/0xc0
  [   84.800145]  iptunnel_xmit+0x144/0x1c0
  [   84.800814]  ip_tunnel_xmit+0x62d/0x930 [ip_tunnel]
  [   84.801699]  gre_tap_xmit+0xac/0xf0 [ip_gre]
  [   84.802395]  dev_hard_start_xmit+0xa5/0x210
  [   84.803086]  sch_direct_xmit+0x14f/0x340
  [   84.803733]  __dev_queue_xmit+0x799/0x8f0
  [   84.804472]  ip_finish_output2+0x2e0/0x430
  [   84.805255]  ? skb_gso_validate_network_len+0x11/0x80
  [   84.806154]  ip_output+0x6c/0xe0
  [   84.806721]  ? ip_append_data.part.50+0xc0/0xc0
  [   84.807516]  sctp_packet_transmit+0x716/0xa10 [sctp]
  [   84.808337]  sctp_outq_flush+0xd7/0x880 [sctp]

It was caused by SKB_GSO_CB(skb)->csum_start not set in sctp_gso_segment.
sctp_gso_segment() calls skb_segment() with 'feature | NETIF_F_HW_CSUM',
which causes SKB_GSO_CB(skb)->csum_start not to be set in skb_segment().

For TCP/UDP, when feature supports HW_CSUM, CHECKSUM_PARTIAL will be set
and gso_reset_checksum will be called to set SKB_GSO_CB(skb)->csum_start.

So SCTP should do the same as TCP/UDP, to call gso_reset_checksum() when
computing checksum in sctp_gso_segment.

Reported-by: Jianlin Shi <jishi@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/offload.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sctp/offload.c b/net/sctp/offload.c
index 123e9f2..edfcf16 100644
--- a/net/sctp/offload.c
+++ b/net/sctp/offload.c
@@ -36,6 +36,7 @@ static __le32 sctp_gso_make_checksum(struct sk_buff *skb)
 {
 	skb->ip_summed = CHECKSUM_NONE;
 	skb->csum_not_inet = 0;
+	gso_reset_checksum(skb, ~0);
 	return sctp_compute_cksum(skb, skb_transport_offset(skb));
 }
 
-- 
2.1.0


^ permalink raw reply related

* Re: [Patch net] team: avoid complex list operations in team_nl_cmd_options_set()
From: Paolo Abeni @ 2019-02-12 10:32 UTC (permalink / raw)
  To: Cong Wang, netdev
  Cc: syzbot+4d4af685432dc0e56c91, syzbot+68ee510075cf64260cc4,
	Jiri Pirko
In-Reply-To: <20190212055951.6712-1-xiyou.wangcong@gmail.com>

On Mon, 2019-02-11 at 21:59 -0800, Cong Wang wrote:
> The current opt_inst_list operations inside team_nl_cmd_options_set()
> is too complex to track:

Indeed !

>     LIST_HEAD(opt_inst_list);
>     nla_for_each_nested(...) {
>         list_for_each_entry(opt_inst, &team->option_inst_list, list) {
>             if (__team_option_inst_tmp_find(&opt_inst_list, opt_inst))
>                 continue;
>             list_add(&opt_inst->tmp_list, &opt_inst_list);
>         }
>     }
>     team_nl_send_event_options_get(team, &opt_inst_list);
> 
> as while we retrieve 'opt_inst' from team->option_inst_list, it could
> be added to the local 'opt_inst_list' for multiple times. The
> __team_option_inst_tmp_find() doesn't work, as the setter
> team_mode_option_set() still calls team->ops.exit() which uses
> ->tmp_list too in __team_options_change_check().
> Simplify the list operations by moving the 'opt_inst_list' and
> team_nl_send_event_options_get() into the nla_for_each_nested() loop so
> that it can be guranteed that we won't insert a same list entry for
> multiple times. Therefore, __team_option_inst_tmp_find() can be removed
> too.
> 
> Fixes: 4fb0534fb7bb ("team: avoid adding twice the same option to the event list")
> Fixes: 2fcdb2c9e659 ("team: allow to send multiple set events in one message")
> Reported-by: syzbot+4d4af685432dc0e56c91@syzkaller.appspotmail.com
> Reported-by: syzbot+68ee510075cf64260cc4@syzkaller.appspotmail.com
> Cc: Jiri Pirko <jiri@resnulli.us>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Reviewed-by: Paolo Abeni <pabeni@redhat.com>

Thank you!

Paolo


^ permalink raw reply

* Re: [PATCH v2 bpf-next] tools: bpftool: doc, add text about feature-subcommand
From: Quentin Monnet @ 2019-02-12 10:12 UTC (permalink / raw)
  To: Prashant Bhole, Alexei Starovoitov, Daniel Borkmann; +Cc: netdev
In-Reply-To: <20190212012512.9060-1-bhole_prashant_q7@lab.ntt.co.jp>

2019-02-12 10:25 UTC+0900 ~ Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
> This patch adds missing information about feature-subcommand in
> bpftool.rst
> 
> Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
> ---
> 
> v2: used tabs instead of spaces

Thanks a lot!

Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>

^ permalink raw reply

* Re: [net-next PATCH 1/2] mm: add dma_addr_t to struct page
From: Jesper Dangaard Brouer @ 2019-02-12 10:06 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: netdev, linux-mm, Toke Høiland-Jørgensen,
	Ilias Apalodimas, Saeed Mahameed, Andrew Morton, mgorman,
	David S. Miller, Tariq Toukan, brouer, Willem de Bruijn
In-Reply-To: <20190211165551.GD12668@bombadil.infradead.org>

On Mon, 11 Feb 2019 08:55:51 -0800
Matthew Wilcox <willy@infradead.org> wrote:

> On Mon, Feb 11, 2019 at 05:06:46PM +0100, Jesper Dangaard Brouer wrote:
> > The page_pool API is using page->private to store DMA addresses.
> > As pointed out by David Miller we can't use that on 32-bit architectures
> > with 64-bit DMA
> > 
> > This patch adds a new dma_addr_t struct to allow storing DMA addresses
> > 
> > Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
> > Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>  
> 
> Reviewed-by: Matthew Wilcox <willy@infradead.org>
> 
> > +		struct {	/* page_pool used by netstack */
> > +			/**
> > +			 * @dma_addr: Page_pool need to store DMA-addr, and  
> 
> s/need/needs/
> 
> > +			 * cannot use @private, as DMA-mappings can be 64-bit  
> 
> s/DMA-mappings/DMA addresses/
> 
> > +			 * even on 32-bit Architectures.  
> 
> s/A/a/

Yes, that comments needs improvement. I think I'll use AKPMs suggestion.


> > +			 */
> > +			dma_addr_t dma_addr; /* Shares area with @lru */  
> 
> It also shares with @slab_list, @next, @compound_head, @pgmap and
> @rcu_head.  I think it's pointless to try to document which other fields
> something shares space with; the places which do it are a legacy from
> before I rearranged struct page last year.  Anyone looking at this should
> now be able to see "Oh, this is a union, only use the fields which are
> in the union for the type of struct page I have here".

I agree, I'll strip that comment.

 
> Are the pages allocated from this API ever supposed to be mapped to
> userspace?

I would like to know what fields on struct-page we cannot touch if we
want to keep this a possibility?

That said, I hope we don't need to do this. But as I integrate this
further into the netstack code, we might have to support this, or
at-least release the page_pool "state" (currently only DMA-addr) before
the skb_zcopy code path.  First iteration will not do zero-copy stuff,
and later I'll coordinate with Willem how to add this, if needed.

My general opinion is that if an end-user want to have pages mapped to
userspace, then page_pool (MEM_TYPE_PAGE_POOL) is not the right choice,
but instead use MEM_TYPE_ZERO_COPY (see enum xdp_mem_type).  We are
generally working towards allowing NIC drivers to have a different
memory type per RX-ring.


> You also say in the documentation:
> 
>  * If no DMA mapping is done, then it can act as shim-layer that
>  * fall-through to alloc_page.  As no state is kept on the page, the
>  * regular put_page() call is sufficient.
> 
> I think this is probably a dangerous precedent to set.  Better to require
> exactly one call to page_pool_put_page() (with the understanding that the
> refcount may be elevated, so this may not be the final free of the page,
> but the page will no longer be usable for its page_pool purpose).

Yes, this actually how it is implemented today, and the comment should
be improved.  Today __page_pool_put_page() in case of refcount is
elevated do call __page_pool_clean_page() to release page page_pool
state, and is in principle no longer "usable" for page_pool purposes.
BUT I have considered removing this, as it might not fit how want to
use the API. In our current RFC we found a need for (and introduced) a
page_pool_unmap_page() call (that call __page_pool_clean_page()), when
driver hits cases where the code path doesn't have a call-back to
page_pool_put_page() but instead end-up calling put_page().

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox