* Re: [PATCH] bridge: only provide proxy ARP when CONFIG_INET is enabled
From: Arnd Bergmann @ 2015-01-13 21:33 UTC (permalink / raw)
To: David Ahern; +Cc: David Miller, cwang, netdev, kyeyoonp, bridge, stephen
In-Reply-To: <54B58AAC.7090001@gmail.com>
On Tuesday 13 January 2015 14:14:20 David Ahern wrote:
>
> Rather than connect CONFIG_BRIDGE to CONFIG_INET, why not make
> br_do_proxy_arp (and setting BR_PROXYARP flag) a no-op if CONFIG_INET is
> not set?
>
> #ifdef CONFIG_INET
> #else
> static inline void br_do_proxy_arp(...args...)
> {
> }
> #endif
>
> That covers both arp_tbl and arp_send.
The effect is very similar to my patch (probably same object code), the
only difference should be that it would add an ugly #ifdef instead of
the preferred IS_ENABLED() check, so you don't get any compile-time
coverage of the function. It's not really important because everybody
has CONFIG_INET enabled in practice and it does get more than enough
compile-time coverage.
Arnd
^ permalink raw reply
* Re: [PATCH net-next] ipv6: directly include libc-compat.h in ipv6.h
From: David Miller @ 2015-01-13 21:33 UTC (permalink / raw)
To: willemb; +Cc: netdev, xiyou.wangcong
In-Reply-To: <1421090974-30018-1-git-send-email-willemb@google.com>
From: Willem de Bruijn <willemb@google.com>
Date: Mon, 12 Jan 2015 14:29:34 -0500
> From: Willem de Bruijn <willemb@google.com>
>
> Patch 3b50d9029809 ("ipv6: fix redefinition of in6_pktinfo ...")
> fixed a libc compatibility issue in ipv6 structure definitions
> as described in include/uapi/linux/libc-compat.h.
>
> It relies on including linux/in6.h to include libc-compat.h itself.
> Include that file directly to clearly communicate the dependency
> (libc-compat.h: "This include must be as early as possible").
>
> Signed-off-by: Willem de Bruijn <willemb@google.com>
Applied.
^ permalink raw reply
* Re: [PATCH net] cxgb4vf: Initialize mdio_addr before using it
From: David Miller @ 2015-01-13 21:32 UTC (permalink / raw)
To: hariprasad; +Cc: netdev, leedom, nirranjan, kumaras
In-Reply-To: <1421080576-30885-1-git-send-email-hariprasad@chelsio.com>
From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Mon, 12 Jan 2015 22:06:16 +0530
> In commit 5ad24def21b205a8 ("cxgb4vf: Fix ethtool get_settings for VF driver")
> mdio_addr of port_info structure was used unininitialzed. Fixing it.
>
> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Applied.
^ permalink raw reply
* Re: [PATCH] bridge: only provide proxy ARP when CONFIG_INET is enabled
From: David Ahern @ 2015-01-13 21:14 UTC (permalink / raw)
To: David Miller, cwang, arnd; +Cc: netdev, kyeyoonp, bridge, stephen
In-Reply-To: <20150113.155740.1237959632603319909.davem@davemloft.net>
On 1/13/15 1:57 PM, David Miller wrote:
> From: Cong Wang <cwang@twopensource.com>
> Date: Tue, 13 Jan 2015 11:25:45 -0800
>
>> On Tue, Jan 13, 2015 at 6:10 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>>> When IPV4 support is disabled, we cannot call arp_send from
>>> the bridge code, which would result in a kernel link error:
>>>
>>> net/built-in.o: In function `br_handle_frame_finish':
>>> :(.text+0x59914): undefined reference to `arp_send'
>>> :(.text+0x59a50): undefined reference to `arp_tbl'
>>>
>>> This makes the newly added proxy ARP support in the bridge
>>> code depend on the CONFIG_INET symbol and lets the compiler
>>> optimize the code out to avoid the link error.
>>>
>>
>> Not sure how much sense to make CONFIG_BRIDGE depend
>> on CONFIG_INET, at least CONFIG_BONDING does.
>
> It depends upon whether we want to provide and consider
> as a valid configuration bridging without INET. Probably
> we do.
Rather than connect CONFIG_BRIDGE to CONFIG_INET, why not make
br_do_proxy_arp (and setting BR_PROXYARP flag) a no-op if CONFIG_INET is
not set?
#ifdef CONFIG_INET
#else
static inline void br_do_proxy_arp(...args...)
{
}
#endif
That covers both arp_tbl and arp_send.
David
^ permalink raw reply
* [PATCH] tcp: Fix RFC reference in comment
From: Debabrata Banerjee @ 2015-01-13 21:10 UTC (permalink / raw)
To: davem, netdev; +Cc: linux-kernel, Debabrata Banerjee
Comment in tcp_cwnd_restart() was referencing the wrong RFC for the algorithm
it's implementing.
Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
---
net/ipv4/tcp_output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 65caf8b..0c13f88 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -139,7 +139,7 @@ static __u16 tcp_advertise_mss(struct sock *sk)
return (__u16)mss;
}
-/* RFC2861. Reset CWND after idle period longer RTO to "restart window".
+/* RFC2581 4.1. Reset CWND after idle period longer RTO to "restart window".
* This is the first part of cwnd validation mechanism. */
static void tcp_cwnd_restart(struct sock *sk, const struct dst_entry *dst)
{
--
2.2.1
^ permalink raw reply related
* Re: [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates 2015-01-13
From: David Miller @ 2015-01-13 21:06 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 13 Jan 2015 11:57:58 -0800
> This series contains updates to i40e and i40evf.
...
> v2: remove un-needed {} in patch #3 of the series based on feedback from
> Sergei Shtylyov
>
> The following are changes since commit 52e3ad9f011fe72620b2f7050227cd48fd295ad5:
> Merge branch 'rhashtable-next'
> and are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Pulled, thanks Jeff.
^ permalink raw reply
* Re: [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency
From: David Miller @ 2015-01-13 21:05 UTC (permalink / raw)
To: tony; +Cc: thomas.lendacky, netdev, linux-omap, b.hutchman, balbi
In-Reply-To: <20150113195415.GG2419@atomide.com>
From: Tony Lindgren <tony@atomide.com>
Date: Tue, 13 Jan 2015 11:54:16 -0800
> * Tom Lendacky <thomas.lendacky@amd.com> [150113 11:51]:
>> On 01/13/2015 01:29 PM, Tony Lindgren wrote:
>> >We only use clk_get() to get the frequency, the rest is done by
>> >the runtime PM calls. Let's free the clock too.
>> >
>> >Cc: Brian Hutchinson <b.hutchman@gmail.com>
>> >Cc: Felipe Balbi <balbi@ti.com>
>> >Signed-off-by: Tony Lindgren <tony@atomide.com>
>> >---
>> > drivers/net/ethernet/ti/davinci_emac.c | 1 +
>> > 1 file changed, 1 insertion(+)
>> >
>> >diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
>> >index deb43b3..e9efc74 100644
>> >--- a/drivers/net/ethernet/ti/davinci_emac.c
>> >+++ b/drivers/net/ethernet/ti/davinci_emac.c
>> >@@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
>> > return -EBUSY;
>> > }
>> > emac_bus_frequency = clk_get_rate(emac_clk);
>> >+ clk_put(emac_clk);
>>
>> The devm_clk_get call is used to get the clock so either a devm_clk_put
>> needs to be used here or just let the devm_ call do its thing and
>> automatically do the put when the module is unloaded.
>
> Thanks good catch, updated patch below.
Please, once all the feedback has been addressed, repost the entire
series.
THanks.
^ permalink raw reply
* Re: [PATCH 2/6] net: davinci_emac: Fix runtime pm calls for davinci_emac
From: Felipe Balbi @ 2015-01-13 21:03 UTC (permalink / raw)
To: Tony Lindgren
Cc: Felipe Balbi, David Miller, netdev, linux-omap, Brian Hutchinson,
Mark A. Greer
In-Reply-To: <20150113205439.GK2419@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 4851 bytes --]
On Tue, Jan 13, 2015 at 12:54:40PM -0800, Tony Lindgren wrote:
> * Felipe Balbi <balbi@ti.com> [150113 11:55]:
> > On Tue, Jan 13, 2015 at 11:29:24AM -0800, Tony Lindgren wrote:
> > > --- a/drivers/net/ethernet/ti/davinci_emac.c
> > > +++ b/drivers/net/ethernet/ti/davinci_emac.c
> > > @@ -1538,7 +1538,7 @@ static int emac_dev_open(struct net_device *ndev)
> > > int i = 0;
> > > struct emac_priv *priv = netdev_priv(ndev);
> > >
> > > - pm_runtime_get(&priv->pdev->dev);
> > > + pm_runtime_get_sync(&priv->pdev->dev);
> >
> > gotta check return value on all pm_runtime_get_sync() calls. IIRC,
> > there's a coccinelle script for checking and patching this.
>
> Sure, here's an updated patch with error checking added.
>
> Regards,
>
> Tony
>
> 8< ---------------------
> From: Tony Lindgren <tony@atomide.com>
> Date: Mon, 22 Dec 2014 08:19:06 -0800
> Subject: [PATCH] net: davinci_emac: Fix runtime pm calls for davinci_emac
>
> Commit 3ba97381343b ("net: ethernet: davinci_emac: add pm_runtime support")
> added support for runtime PM, but it causes issues on omap3 related devices
> that actually gate the clocks:
>
> Unhandled fault: external abort on non-linefetch (0x1008)
> ...
> [<c04160f0>] (emac_dev_getnetstats) from [<c04d6a3c>] (dev_get_stats+0x78/0xc8)
> [<c04d6a3c>] (dev_get_stats) from [<c04e9ccc>] (rtnl_fill_ifinfo+0x3b8/0x938)
> [<c04e9ccc>] (rtnl_fill_ifinfo) from [<c04eade4>] (rtmsg_ifinfo+0x68/0xd8)
> [<c04eade4>] (rtmsg_ifinfo) from [<c04dd35c>] (register_netdevice+0x3a0/0x4ec)
> [<c04dd35c>] (register_netdevice) from [<c04dd4bc>] (register_netdev+0x14/0x24)
> [<c04dd4bc>] (register_netdev) from [<c041755c>] (davinci_emac_probe+0x408/0x5c8)
> [<c041755c>] (davinci_emac_probe) from [<c0396d78>] (platform_drv_probe+0x48/0xa4)
>
> Let's fix it by moving the pm_runtime_get() call earlier, and also add it to
> the emac_dev_getnetstats(). Also note that we want to use pm_runtime_get_sync()
> as we don't want to have deferred_resume happen. And let's also check the
> return value for pm_runtime_get_sync() as noted by Felipe Balbi <balbi@ti.com>.
>
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Mark A. Greer <mgreer@animalcreek.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
>
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -1538,7 +1538,13 @@ static int emac_dev_open(struct net_device *ndev)
> int i = 0;
> struct emac_priv *priv = netdev_priv(ndev);
>
> - pm_runtime_get(&priv->pdev->dev);
> + ret = pm_runtime_get_sync(&priv->pdev->dev);
> + if (ret < 0) {
> + pm_runtime_put_noidle(&priv->pdev->dev);
> + dev_err(&priv->pdev->dev, "%s: failed to get_sync(%d)\n",
> + __func__, ret);
> + return ret;
> + }
>
> netif_carrier_off(ndev);
> for (cnt = 0; cnt < ETH_ALEN; cnt++)
> @@ -1725,6 +1731,15 @@ static struct net_device_stats *emac_dev_getnetstats(struct net_device *ndev)
> struct emac_priv *priv = netdev_priv(ndev);
> u32 mac_control;
> u32 stats_clear_mask;
> + int err;
> +
> + err = pm_runtime_get_sync(&priv->pdev->dev);
> + if (err < 0) {
> + pm_runtime_put_noidle(&priv->pdev->dev);
> + dev_err(&priv->pdev->dev, "%s: failed to get_sync(%d)\n",
> + __func__, err);
> + return &ndev->stats;
> + }
>
> /* update emac hardware stats and reset the registers*/
>
> @@ -1767,6 +1782,8 @@ static struct net_device_stats *emac_dev_getnetstats(struct net_device *ndev)
> ndev->stats.tx_fifo_errors += emac_read(EMAC_TXUNDERRUN);
> emac_write(EMAC_TXUNDERRUN, stats_clear_mask);
>
> + pm_runtime_put(&priv->pdev->dev);
> +
> return &ndev->stats;
> }
>
> @@ -1981,12 +1998,22 @@ static int davinci_emac_probe(struct platform_device *pdev)
> ndev->ethtool_ops = ðtool_ops;
> netif_napi_add(ndev, &priv->napi, emac_poll, EMAC_POLL_WEIGHT);
>
> + pm_runtime_enable(&pdev->dev);
> + rc = pm_runtime_get_sync(&pdev->dev);
> + if (rc < 0) {
> + pm_runtime_put_noidle(&pdev->dev);
> + dev_err(&pdev->dev, "%s: failed to get_sync(%d)\n",
> + __func__, rc);
> + goto no_cpdma_chan;
> + }
> +
> /* register the network device */
> SET_NETDEV_DEV(ndev, &pdev->dev);
> rc = register_netdev(ndev);
> if (rc) {
> dev_err(&pdev->dev, "error in register_netdev\n");
> rc = -ENODEV;
> + pm_runtime_put(&pdev->dev);
> goto no_cpdma_chan;
> }
>
> @@ -1996,9 +2023,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
> "(regs: %p, irq: %d)\n",
> (void *)priv->emac_base_phys, ndev->irq);
> }
> -
> - pm_runtime_enable(&pdev->dev);
> - pm_runtime_resume(&pdev->dev);
> + pm_runtime_put(&pdev->dev);
>
> return 0;
>
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 2/6] net: davinci_emac: Fix runtime pm calls for davinci_emac
From: Tony Lindgren @ 2015-01-13 20:54 UTC (permalink / raw)
To: Felipe Balbi
Cc: David Miller, netdev, linux-omap, Brian Hutchinson, Mark A. Greer
In-Reply-To: <20150113195141.GT16533@saruman>
* Felipe Balbi <balbi@ti.com> [150113 11:55]:
> On Tue, Jan 13, 2015 at 11:29:24AM -0800, Tony Lindgren wrote:
> > --- a/drivers/net/ethernet/ti/davinci_emac.c
> > +++ b/drivers/net/ethernet/ti/davinci_emac.c
> > @@ -1538,7 +1538,7 @@ static int emac_dev_open(struct net_device *ndev)
> > int i = 0;
> > struct emac_priv *priv = netdev_priv(ndev);
> >
> > - pm_runtime_get(&priv->pdev->dev);
> > + pm_runtime_get_sync(&priv->pdev->dev);
>
> gotta check return value on all pm_runtime_get_sync() calls. IIRC,
> there's a coccinelle script for checking and patching this.
Sure, here's an updated patch with error checking added.
Regards,
Tony
8< ---------------------
From: Tony Lindgren <tony@atomide.com>
Date: Mon, 22 Dec 2014 08:19:06 -0800
Subject: [PATCH] net: davinci_emac: Fix runtime pm calls for davinci_emac
Commit 3ba97381343b ("net: ethernet: davinci_emac: add pm_runtime support")
added support for runtime PM, but it causes issues on omap3 related devices
that actually gate the clocks:
Unhandled fault: external abort on non-linefetch (0x1008)
...
[<c04160f0>] (emac_dev_getnetstats) from [<c04d6a3c>] (dev_get_stats+0x78/0xc8)
[<c04d6a3c>] (dev_get_stats) from [<c04e9ccc>] (rtnl_fill_ifinfo+0x3b8/0x938)
[<c04e9ccc>] (rtnl_fill_ifinfo) from [<c04eade4>] (rtmsg_ifinfo+0x68/0xd8)
[<c04eade4>] (rtmsg_ifinfo) from [<c04dd35c>] (register_netdevice+0x3a0/0x4ec)
[<c04dd35c>] (register_netdevice) from [<c04dd4bc>] (register_netdev+0x14/0x24)
[<c04dd4bc>] (register_netdev) from [<c041755c>] (davinci_emac_probe+0x408/0x5c8)
[<c041755c>] (davinci_emac_probe) from [<c0396d78>] (platform_drv_probe+0x48/0xa4)
Let's fix it by moving the pm_runtime_get() call earlier, and also add it to
the emac_dev_getnetstats(). Also note that we want to use pm_runtime_get_sync()
as we don't want to have deferred_resume happen. And let's also check the
return value for pm_runtime_get_sync() as noted by Felipe Balbi <balbi@ti.com>.
Cc: Brian Hutchinson <b.hutchman@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1538,7 +1538,13 @@ static int emac_dev_open(struct net_device *ndev)
int i = 0;
struct emac_priv *priv = netdev_priv(ndev);
- pm_runtime_get(&priv->pdev->dev);
+ ret = pm_runtime_get_sync(&priv->pdev->dev);
+ if (ret < 0) {
+ pm_runtime_put_noidle(&priv->pdev->dev);
+ dev_err(&priv->pdev->dev, "%s: failed to get_sync(%d)\n",
+ __func__, ret);
+ return ret;
+ }
netif_carrier_off(ndev);
for (cnt = 0; cnt < ETH_ALEN; cnt++)
@@ -1725,6 +1731,15 @@ static struct net_device_stats *emac_dev_getnetstats(struct net_device *ndev)
struct emac_priv *priv = netdev_priv(ndev);
u32 mac_control;
u32 stats_clear_mask;
+ int err;
+
+ err = pm_runtime_get_sync(&priv->pdev->dev);
+ if (err < 0) {
+ pm_runtime_put_noidle(&priv->pdev->dev);
+ dev_err(&priv->pdev->dev, "%s: failed to get_sync(%d)\n",
+ __func__, err);
+ return &ndev->stats;
+ }
/* update emac hardware stats and reset the registers*/
@@ -1767,6 +1782,8 @@ static struct net_device_stats *emac_dev_getnetstats(struct net_device *ndev)
ndev->stats.tx_fifo_errors += emac_read(EMAC_TXUNDERRUN);
emac_write(EMAC_TXUNDERRUN, stats_clear_mask);
+ pm_runtime_put(&priv->pdev->dev);
+
return &ndev->stats;
}
@@ -1981,12 +1998,22 @@ static int davinci_emac_probe(struct platform_device *pdev)
ndev->ethtool_ops = ðtool_ops;
netif_napi_add(ndev, &priv->napi, emac_poll, EMAC_POLL_WEIGHT);
+ pm_runtime_enable(&pdev->dev);
+ rc = pm_runtime_get_sync(&pdev->dev);
+ if (rc < 0) {
+ pm_runtime_put_noidle(&pdev->dev);
+ dev_err(&pdev->dev, "%s: failed to get_sync(%d)\n",
+ __func__, rc);
+ goto no_cpdma_chan;
+ }
+
/* register the network device */
SET_NETDEV_DEV(ndev, &pdev->dev);
rc = register_netdev(ndev);
if (rc) {
dev_err(&pdev->dev, "error in register_netdev\n");
rc = -ENODEV;
+ pm_runtime_put(&pdev->dev);
goto no_cpdma_chan;
}
@@ -1996,9 +2023,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
"(regs: %p, irq: %d)\n",
(void *)priv->emac_base_phys, ndev->irq);
}
-
- pm_runtime_enable(&pdev->dev);
- pm_runtime_resume(&pdev->dev);
+ pm_runtime_put(&pdev->dev);
return 0;
^ permalink raw reply
* Re: [PATCH] bridge: only provide proxy ARP when CONFIG_INET is enabled
From: David Miller @ 2015-01-13 20:57 UTC (permalink / raw)
To: cwang; +Cc: netdev, kyeyoonp, bridge, arnd
In-Reply-To: <CAHA+R7NfZMRMJ2=pq-VYU_FRdcCheAYu9OW6Hj9fwB0mcT7Xng@mail.gmail.com>
From: Cong Wang <cwang@twopensource.com>
Date: Tue, 13 Jan 2015 11:25:45 -0800
> On Tue, Jan 13, 2015 at 6:10 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> When IPV4 support is disabled, we cannot call arp_send from
>> the bridge code, which would result in a kernel link error:
>>
>> net/built-in.o: In function `br_handle_frame_finish':
>> :(.text+0x59914): undefined reference to `arp_send'
>> :(.text+0x59a50): undefined reference to `arp_tbl'
>>
>> This makes the newly added proxy ARP support in the bridge
>> code depend on the CONFIG_INET symbol and lets the compiler
>> optimize the code out to avoid the link error.
>>
>
> Not sure how much sense to make CONFIG_BRIDGE depend
> on CONFIG_INET, at least CONFIG_BONDING does.
It depends upon whether we want to provide and consider
as a valid configuration bridging without INET. Probably
we do.
^ permalink raw reply
* Re: [PATCH] mlx5: avoid build warnings on 32-bit
From: Arnd Bergmann @ 2015-01-13 20:25 UTC (permalink / raw)
To: Eli Cohen
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20150113162803.GA7414@mtldesk30>
On Tuesday 13 January 2015 18:28:03 Eli Cohen wrote:
> On Tue, Jan 13, 2015 at 05:08:06PM +0100, Arnd Bergmann wrote:
>
> Hi Arnd,
> wouldn't it work by casting to uintptr_t instead of unsigned long?
>
These are the same on all architectures that Linux can run on,
but if you have a strong preference, I can send an updated
patch, the effect is exactly the same.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 5/6] net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC address space
From: Felipe Balbi @ 2015-01-13 20:21 UTC (permalink / raw)
To: Tony Lindgren
Cc: Felipe Balbi, David Miller, netdev, linux-omap, Brian Hutchinson
In-Reply-To: <20150113195957.GH2419@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 2175 bytes --]
On Tue, Jan 13, 2015 at 11:59:58AM -0800, Tony Lindgren wrote:
> * Felipe Balbi <balbi@ti.com> [150113 11:57]:
> > On Tue, Jan 13, 2015 at 11:29:27AM -0800, Tony Lindgren wrote:
> > > Some devices like dm816x have the MDIO registers within the first EMAC
> > > instance address space. Let's fix the issue by allowing to pass an
> > > optional second IO range for the EMAC control register area.
> > >
> > > Cc: Brian Hutchinson <b.hutchman@gmail.com>
> > > Cc: Felipe Balbi <balbi@ti.com>
> > > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > ---
> > > drivers/net/ethernet/ti/davinci_emac.c | 15 ++++++++++++---
> > > 1 file changed, 12 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> > > index 4c8d82c..0342273 100644
> > > --- a/drivers/net/ethernet/ti/davinci_emac.c
> > > +++ b/drivers/net/ethernet/ti/davinci_emac.c
> > > @@ -1877,7 +1877,7 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
> > > static int davinci_emac_probe(struct platform_device *pdev)
> > > {
> > > int rc = 0;
> > > - struct resource *res;
> > > + struct resource *res, *res_ctrl;
> > > struct net_device *ndev;
> > > struct emac_priv *priv;
> > > unsigned long hw_ram_addr;
> > > @@ -1936,11 +1936,20 @@ static int davinci_emac_probe(struct platform_device *pdev)
> > > rc = PTR_ERR(priv->remap_addr);
> > > goto no_pdata;
> > > }
> > > +
> > > + res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> > > + if (res_ctrl) {
> >
> > devm_ioremap_resource() will check for res_ctrl being a valid pointer,
> > perhaps below would be slightly better ?
> >
> >
> > res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> > priv->ctrl_base = devm_ioremap_resource(&pdev->dev, res_ctrl);
> > if (IS_ERR(priv->ctrl_base))
> > priv->ctrl_base = priv->remap_addr + pdata->ctrl_mod_reg_offset;
> >
>
> We have a pile of devices using just one ioremap area so the second
> ioremap area needs to be optional. That's why we only do it based on
> if (res_ctrl).
fair enough
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: BW regression after "tcp: refine TSO autosizing"
From: Or Gerlitz @ 2015-01-13 20:21 UTC (permalink / raw)
To: Eric Dumazet
Cc: Eyal Perry, Linux Netdev List, Amir Vadai, Yevgeny Petrilin,
Saeed Mahameed, Ido Shamay, Amir Ancel, Eyal Perry
In-Reply-To: <1421175434.4099.21.camel@edumazet-glaptop2.roam.corp.google.com>
On Tue, Jan 13, 2015 at 8:57 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Tue, 2015-01-13 at 18:48 +0200, Eyal Perry wrote:
>> Hello Eric,
>> Lately we've observed performance degradation in BW of about 30-40% (depends on
>> the setup we use).
>> I've bisected the issue down to the this commit: 605ad7f1 ("tcp: refine TSO
>> autosizing")
>>
>> For instance, I was running the following test:
>> 1. Bounding net device' irqs to core 0 for both client and server side
>> 2. Running netperf with 64K massage size (used the following command)
>> $ netperf -H remote -T 1,1 -l 100 -t TCP_STREAM -- -k THROUGHPUT -M 65536 -m 65536
>>
>> I ran the test on upstream net-next including your patch and than reverted it
>> and these are the results I got was improvement from 14.6Gbps to 22.1Gbps.
>>
>> an additional difference I've noticed when inspecting the ethtool statics,
>> number of xmit_more packets increased from 4 to 160 with the reverted kernel.
>>
>> We are investigating this issue, do you have a hint?
>
> Which driver are you using for this test ?
AFAIK, mlx4
^ permalink raw reply
* [PATCH iproute2] netns: Rename & move get_netns_fd to lib
From: Vadim Kochan @ 2015-01-13 20:08 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
From: Vadim Kochan <vadim4j@gmail.com>
Renamed get_netns_fd -> netns_get_fd and moved to
lib/namespace.c
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
include/namespace.h | 1 +
ip/ip_common.h | 1 -
ip/iplink.c | 3 ++-
ip/ipnetns.c | 15 ---------------
lib/namespace.c | 15 +++++++++++++++
5 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/include/namespace.h b/include/namespace.h
index 2f13e65..b8c5cad 100644
--- a/include/namespace.h
+++ b/include/namespace.h
@@ -42,5 +42,6 @@ static int setns(int fd, int nstype)
#endif /* HAVE_SETNS */
extern int netns_switch(char *netns);
+extern int netns_get_fd(const char *netns);
#endif /* __NAMESPACE_H__ */
diff --git a/ip/ip_common.h b/ip/ip_common.h
index 75bfb82..89a495e 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -87,7 +87,6 @@ struct link_util
struct link_util *get_link_kind(const char *kind);
struct link_util *get_link_slave_kind(const char *slave_kind);
-int get_netns_fd(const char *name);
#ifndef INFINITY_LIFE_TIME
#define INFINITY_LIFE_TIME 0xFFFFFFFFU
diff --git a/ip/iplink.c b/ip/iplink.c
index 2709173..c93d1dc 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -32,6 +32,7 @@
#include "rt_names.h"
#include "utils.h"
#include "ip_common.h"
+#include "namespace.h"
#define IPLINK_IOCTL_COMPAT 1
#ifndef LIBDIR
@@ -440,7 +441,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
NEXT_ARG();
if (netns != -1)
duparg("netns", *argv);
- if ((netns = get_netns_fd(*argv)) >= 0)
+ if ((netns = netns_get_fd(*argv)) >= 0)
addattr_l(&req->n, sizeof(*req), IFLA_NET_NS_FD, &netns, 4);
else if (get_integer(&netns, *argv, 0) == 0)
addattr_l(&req->n, sizeof(*req), IFLA_NET_NS_PID, &netns, 4);
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 519d518..123318e 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -31,21 +31,6 @@ static int usage(void)
exit(-1);
}
-int get_netns_fd(const char *name)
-{
- char pathbuf[MAXPATHLEN];
- const char *path, *ptr;
-
- path = name;
- ptr = strchr(name, '/');
- if (!ptr) {
- snprintf(pathbuf, sizeof(pathbuf), "%s/%s",
- NETNS_RUN_DIR, name );
- path = pathbuf;
- }
- return open(path, O_RDONLY);
-}
-
static int netns_list(int argc, char **argv)
{
struct dirent *entry;
diff --git a/lib/namespace.c b/lib/namespace.c
index 1554ce0..65c1e3d 100644
--- a/lib/namespace.c
+++ b/lib/namespace.c
@@ -84,3 +84,18 @@ int netns_switch(char *name)
bind_etc(name);
return 0;
}
+
+int netns_get_fd(const char *name)
+{
+ char pathbuf[MAXPATHLEN];
+ const char *path, *ptr;
+
+ path = name;
+ ptr = strchr(name, '/');
+ if (!ptr) {
+ snprintf(pathbuf, sizeof(pathbuf), "%s/%s",
+ NETNS_RUN_DIR, name );
+ path = pathbuf;
+ }
+ return open(path, O_RDONLY);
+}
--
2.1.3
^ permalink raw reply related
* Re: [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency
From: Tony Lindgren @ 2015-01-13 20:15 UTC (permalink / raw)
To: Felipe Balbi
Cc: Tom Lendacky, David Miller, netdev, linux-omap, Brian Hutchinson
In-Reply-To: <20150113195035.GS16533@saruman>
* Felipe Balbi <balbi@ti.com> [150113 11:54]:
> On Tue, Jan 13, 2015 at 01:48:24PM -0600, Tom Lendacky wrote:
> > On 01/13/2015 01:29 PM, Tony Lindgren wrote:
> > >We only use clk_get() to get the frequency, the rest is done by
> > >the runtime PM calls. Let's free the clock too.
> > >
> > >Cc: Brian Hutchinson <b.hutchman@gmail.com>
> > >Cc: Felipe Balbi <balbi@ti.com>
> > >Signed-off-by: Tony Lindgren <tony@atomide.com>
> > >---
> > > drivers/net/ethernet/ti/davinci_emac.c | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > >diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> > >index deb43b3..e9efc74 100644
> > >--- a/drivers/net/ethernet/ti/davinci_emac.c
> > >+++ b/drivers/net/ethernet/ti/davinci_emac.c
> > >@@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
> > > return -EBUSY;
> > > }
> > > emac_bus_frequency = clk_get_rate(emac_clk);
> > >+ clk_put(emac_clk);
> >
> > The devm_clk_get call is used to get the clock so either a devm_clk_put
> > needs to be used here or just let the devm_ call do its thing and
> > automatically do the put when the module is unloaded.
>
> instead, if you really don't need the clock for anything other than
> getting its rate, why don't you just remove devm_ prefix from clk_get()?
That would make the fix two lines instead of one :) I guess up to David
to figure out which he prefers, I don't really have a preference here.
Regards,
Tony
^ permalink raw reply
* Re: [PATCH 5/6] net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC address space
From: Tony Lindgren @ 2015-01-13 19:59 UTC (permalink / raw)
To: Felipe Balbi; +Cc: David Miller, netdev, linux-omap, Brian Hutchinson
In-Reply-To: <20150113195405.GU16533@saruman>
* Felipe Balbi <balbi@ti.com> [150113 11:57]:
> On Tue, Jan 13, 2015 at 11:29:27AM -0800, Tony Lindgren wrote:
> > Some devices like dm816x have the MDIO registers within the first EMAC
> > instance address space. Let's fix the issue by allowing to pass an
> > optional second IO range for the EMAC control register area.
> >
> > Cc: Brian Hutchinson <b.hutchman@gmail.com>
> > Cc: Felipe Balbi <balbi@ti.com>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> > drivers/net/ethernet/ti/davinci_emac.c | 15 ++++++++++++---
> > 1 file changed, 12 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> > index 4c8d82c..0342273 100644
> > --- a/drivers/net/ethernet/ti/davinci_emac.c
> > +++ b/drivers/net/ethernet/ti/davinci_emac.c
> > @@ -1877,7 +1877,7 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
> > static int davinci_emac_probe(struct platform_device *pdev)
> > {
> > int rc = 0;
> > - struct resource *res;
> > + struct resource *res, *res_ctrl;
> > struct net_device *ndev;
> > struct emac_priv *priv;
> > unsigned long hw_ram_addr;
> > @@ -1936,11 +1936,20 @@ static int davinci_emac_probe(struct platform_device *pdev)
> > rc = PTR_ERR(priv->remap_addr);
> > goto no_pdata;
> > }
> > +
> > + res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> > + if (res_ctrl) {
>
> devm_ioremap_resource() will check for res_ctrl being a valid pointer,
> perhaps below would be slightly better ?
>
>
> res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> priv->ctrl_base = devm_ioremap_resource(&pdev->dev, res_ctrl);
> if (IS_ERR(priv->ctrl_base))
> priv->ctrl_base = priv->remap_addr + pdata->ctrl_mod_reg_offset;
>
We have a pile of devices using just one ioremap area so the second
ioremap area needs to be optional. That's why we only do it based on
if (res_ctrl).
Regards,
Tony
^ permalink raw reply
* [net-next v2 15/15] i40e: limit sriov to partition 1 of NPAR configurations
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Shannon Nelson, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Shannon Nelson <shannon.nelson@intel.com>
Make sure we only allow SR/IOV on the master PF of a port in multifunction
mode. This should be the case anyway based on the num_vfs configured in
the NVM, but this will help make sure there's no question. If we're not
in multifunction mode the partition_id will always be 1.
Change-ID: I8b2592366fe6782f15301bde2ebd1d4da240109d
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 80430b0..f3b036d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7319,7 +7319,7 @@ static int i40e_sw_init(struct i40e_pf *pf)
#endif /* I40E_FCOE */
#ifdef CONFIG_PCI_IOV
- if (pf->hw.func_caps.num_vfs) {
+ if (pf->hw.func_caps.num_vfs && pf->hw.partition_id == 1) {
pf->num_vf_qps = I40E_DEFAULT_QUEUES_PER_VF;
pf->flags |= I40E_FLAG_SRIOV_ENABLED;
pf->num_req_vfs = min_t(int,
--
1.9.3
^ permalink raw reply related
* [net-next v2 13/15] i40e: limit WoL and link settings to partition 1
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Shannon Nelson, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Shannon Nelson <shannon.nelson@intel.com>
When in multi-function mode, e.g. Dell's NPAR, only partition 1
of each MAC is allowed to set WoL, speed, and flow control.
Change-ID: I87a9debc7479361c55a71f0120294ea319f23588
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 43 +++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 951e876..b8230dc 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -219,6 +219,16 @@ static const char i40e_gstrings_test[][ETH_GSTRING_LEN] = {
#define I40E_TEST_LEN (sizeof(i40e_gstrings_test) / ETH_GSTRING_LEN)
/**
+ * i40e_partition_setting_complaint - generic complaint for MFP restriction
+ * @pf: the PF struct
+ **/
+static void i40e_partition_setting_complaint(struct i40e_pf *pf)
+{
+ dev_info(&pf->pdev->dev,
+ "The link settings are allowed to be changed only from the first partition of a given port. Please switch to the first partition in order to change the setting.\n");
+}
+
+/**
* i40e_get_settings - Get Link Speed and Duplex settings
* @netdev: network interface device structure
* @ecmd: ethtool command
@@ -485,6 +495,14 @@ static int i40e_set_settings(struct net_device *netdev,
u8 autoneg;
u32 advertise;
+ /* Changing port settings is not supported if this isn't the
+ * port's controlling PF
+ */
+ if (hw->partition_id != 1) {
+ i40e_partition_setting_complaint(pf);
+ return -EOPNOTSUPP;
+ }
+
if (vsi != pf->vsi[pf->lan_vsi])
return -EOPNOTSUPP;
@@ -687,6 +705,14 @@ static int i40e_set_pauseparam(struct net_device *netdev,
u8 aq_failures;
int err = 0;
+ /* Changing the port's flow control is not supported if this isn't the
+ * port's controlling PF
+ */
+ if (hw->partition_id != 1) {
+ i40e_partition_setting_complaint(pf);
+ return -EOPNOTSUPP;
+ }
+
if (vsi != pf->vsi[pf->lan_vsi])
return -EOPNOTSUPP;
@@ -1503,7 +1529,7 @@ static void i40e_get_wol(struct net_device *netdev,
/* NVM bit on means WoL disabled for the port */
i40e_read_nvm_word(hw, I40E_SR_NVM_WAKE_ON_LAN, &wol_nvm_bits);
- if ((1 << hw->port) & wol_nvm_bits) {
+ if ((1 << hw->port) & wol_nvm_bits || hw->partition_id != 1) {
wol->supported = 0;
wol->wolopts = 0;
} else {
@@ -1512,13 +1538,28 @@ static void i40e_get_wol(struct net_device *netdev,
}
}
+/**
+ * i40e_set_wol - set the WakeOnLAN configuration
+ * @netdev: the netdev in question
+ * @wol: the ethtool WoL setting data
+ **/
static int i40e_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_pf *pf = np->vsi->back;
+ struct i40e_vsi *vsi = np->vsi;
struct i40e_hw *hw = &pf->hw;
u16 wol_nvm_bits;
+ /* WoL not supported if this isn't the controlling PF on the port */
+ if (hw->partition_id != 1) {
+ i40e_partition_setting_complaint(pf);
+ return -EOPNOTSUPP;
+ }
+
+ if (vsi != pf->vsi[pf->lan_vsi])
+ return -EOPNOTSUPP;
+
/* NVM bit on means WoL disabled for the port */
i40e_read_nvm_word(hw, I40E_SR_NVM_WAKE_ON_LAN, &wol_nvm_bits);
if (((1 << hw->port) & wol_nvm_bits))
--
1.9.3
^ permalink raw reply related
* [net-next v2 12/15] i40e: Adding function for reading PBA String
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Kamil Krawczyk, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Kamil Krawczyk <kamil.krawczyk@intel.com>
Function will read PBA Block from Shadow RAM and return it in a string format.
Change-ID: I4ee7059f6e21bd0eba38687da15e772e0b4ab36e
Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_common.c | 59 ++++++++++++++++++++++++
drivers/net/ethernet/intel/i40e/i40e_prototype.h | 2 +
drivers/net/ethernet/intel/i40e/i40e_type.h | 2 +
3 files changed, 63 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index b16fc03..4f4d9d1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -742,6 +742,65 @@ i40e_status i40e_get_san_mac_addr(struct i40e_hw *hw, u8 *mac_addr)
#endif
/**
+ * i40e_read_pba_string - Reads part number string from EEPROM
+ * @hw: pointer to hardware structure
+ * @pba_num: stores the part number string from the EEPROM
+ * @pba_num_size: part number string buffer length
+ *
+ * Reads the part number string from the EEPROM.
+ **/
+i40e_status i40e_read_pba_string(struct i40e_hw *hw, u8 *pba_num,
+ u32 pba_num_size)
+{
+ i40e_status status = 0;
+ u16 pba_word = 0;
+ u16 pba_size = 0;
+ u16 pba_ptr = 0;
+ u16 i = 0;
+
+ status = i40e_read_nvm_word(hw, I40E_SR_PBA_FLAGS, &pba_word);
+ if (status || (pba_word != 0xFAFA)) {
+ hw_dbg(hw, "Failed to read PBA flags or flag is invalid.\n");
+ return status;
+ }
+
+ status = i40e_read_nvm_word(hw, I40E_SR_PBA_BLOCK_PTR, &pba_ptr);
+ if (status) {
+ hw_dbg(hw, "Failed to read PBA Block pointer.\n");
+ return status;
+ }
+
+ status = i40e_read_nvm_word(hw, pba_ptr, &pba_size);
+ if (status) {
+ hw_dbg(hw, "Failed to read PBA Block size.\n");
+ return status;
+ }
+
+ /* Subtract one to get PBA word count (PBA Size word is included in
+ * total size)
+ */
+ pba_size--;
+ if (pba_num_size < (((u32)pba_size * 2) + 1)) {
+ hw_dbg(hw, "Buffer to small for PBA data.\n");
+ return I40E_ERR_PARAM;
+ }
+
+ for (i = 0; i < pba_size; i++) {
+ status = i40e_read_nvm_word(hw, (pba_ptr + 1) + i, &pba_word);
+ if (status) {
+ hw_dbg(hw, "Failed to read PBA Block word %d.\n", i);
+ return status;
+ }
+
+ pba_num[(i * 2)] = (pba_word >> 8) & 0xFF;
+ pba_num[(i * 2) + 1] = pba_word & 0xFF;
+ }
+ pba_num[(pba_size * 2)] = '\0';
+
+ return status;
+}
+
+/**
* i40e_get_media_type - Gets media type
* @hw: pointer to the hardware structure
**/
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index d1c7d63..68e852a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -248,6 +248,8 @@ void i40e_clear_pxe_mode(struct i40e_hw *hw);
bool i40e_get_link_status(struct i40e_hw *hw);
i40e_status i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr);
i40e_status i40e_get_port_mac_addr(struct i40e_hw *hw, u8 *mac_addr);
+i40e_status i40e_read_pba_string(struct i40e_hw *hw, u8 *pba_num,
+ u32 pba_num_size);
i40e_status i40e_validate_mac_addr(u8 *mac_addr);
void i40e_pre_tx_queue_cfg(struct i40e_hw *hw, u32 queue, bool enable);
#ifdef I40E_FCOE
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 611de3e..ff121fe 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -1140,6 +1140,8 @@ struct i40e_hw_port_stats {
/* Checksum and Shadow RAM pointers */
#define I40E_SR_NVM_CONTROL_WORD 0x00
#define I40E_SR_EMP_MODULE_PTR 0x0F
+#define I40E_SR_PBA_FLAGS 0x15
+#define I40E_SR_PBA_BLOCK_PTR 0x16
#define I40E_SR_NVM_IMAGE_VERSION 0x18
#define I40E_SR_NVM_WAKE_ON_LAN 0x19
#define I40E_SR_ALTERNATE_SAN_MAC_ADDRESS_PTR 0x27
--
1.9.3
^ permalink raw reply related
* [net-next v2 14/15] i40e: Don't exit link event early if link speed has changed
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Catherine Sullivan, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Catherine Sullivan <catherine.sullivan@intel.com>
Previously we were only checking if the link up state had changed,
and if it hadn't exiting the link event routine early. We should
also check if speed has changed, and if it has, stay and finish
processing the link event.
Change-ID: I9c8e0991b3f0279108a7858898c3c5ce0a9856b8
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 7c14973..80430b0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5503,14 +5503,18 @@ static void i40e_link_event(struct i40e_pf *pf)
{
bool new_link, old_link;
struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
+ u8 new_link_speed, old_link_speed;
/* set this to force the get_link_status call to refresh state */
pf->hw.phy.get_link_info = true;
old_link = (pf->hw.phy.link_info_old.link_info & I40E_AQ_LINK_UP);
new_link = i40e_get_link_status(&pf->hw);
+ old_link_speed = pf->hw.phy.link_info_old.link_speed;
+ new_link_speed = pf->hw.phy.link_info.link_speed;
if (new_link == old_link &&
+ new_link_speed == old_link_speed &&
(test_bit(__I40E_DOWN, &vsi->state) ||
new_link == netif_carrier_ok(vsi->netdev)))
return;
--
1.9.3
^ permalink raw reply related
* [net-next v2 08/15] i40evf: kick a stalled admin queue
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Mitch A Williams, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mitch A Williams <mitch.a.williams@intel.com>
On some versions of the firmware, the VF admin send queue may become
stalled. In this case, the easiest solution is to just place another
descriptor on the queue; the firmware will then process both requests.
The early init code already accounts for this, but the runtime code does
not. In the watchdog task, check for the stall condition, and if it's
found, send our API version to the PF. When the PF replies, just ignore
the reply.
Change-ID: I380d78185a4f284d649c44d263e648afc9b4d50c
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 7 ++++++-
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 3 +++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index e2311af..21ccbe8 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1336,8 +1336,13 @@ static void i40evf_watchdog_task(struct work_struct *work)
/* Process admin queue tasks. After init, everything gets done
* here so we don't race on the admin queue.
*/
- if (adapter->aq_pending)
+ if (adapter->aq_pending) {
+ if (!i40evf_asq_done(hw)) {
+ dev_dbg(&adapter->pdev->dev, "Admin queue timeout\n");
+ i40evf_send_api_ver(adapter);
+ }
goto watchdog_done;
+ }
if (adapter->aq_required & I40EVF_FLAG_AQ_MAP_VECTORS) {
i40evf_map_queues(adapter);
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
index 3aeb633..3f0c85e 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
@@ -720,6 +720,9 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
__func__, v_retval, v_opcode);
}
switch (v_opcode) {
+ case I40E_VIRTCHNL_OP_VERSION:
+ /* no action, but also not an error */
+ break;
case I40E_VIRTCHNL_OP_GET_STATS: {
struct i40e_eth_stats *stats =
(struct i40e_eth_stats *)msg;
--
1.9.3
^ permalink raw reply related
* [net-next v2 06/15] i40evf: don't fire traffic IRQs when the interface is down
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Mitch A Williams, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mitch A Williams <mitch.a.williams@intel.com>
There is always a possibility that MSI-X interrupts can get lost. To
keep this problem from stalling the driver, we fire all of our MSI-X
vectors during the watchdog routine. However, we should not fire the
traffic vectors when the interface is closed. In this case, just fire
vector 0, which is used for admin queue events.
As a result, we do not enable the interrupt cause for vector 0. This
can cause the admin queue handler to be called reentrantly, which
causes a scary "critical section violation" message to be logged,
even though no real damage is done.
Change-ID: Ic43a5184708ab2cb9a23fca7dedd808a46717795
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 994ae4e..c960ef5 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1385,11 +1385,14 @@ static void i40evf_watchdog_task(struct work_struct *work)
if (adapter->state == __I40EVF_RUNNING)
i40evf_request_stats(adapter);
-
- i40evf_irq_enable(adapter, true);
- i40evf_fire_sw_int(adapter, 0xFF);
-
watchdog_done:
+ if (adapter->state == __I40EVF_RUNNING) {
+ i40evf_irq_enable_queues(adapter, ~0);
+ i40evf_fire_sw_int(adapter, 0xFF);
+ } else {
+ i40evf_fire_sw_int(adapter, 0x1);
+ }
+
clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);
restart_watchdog:
if (adapter->state == __I40EVF_REMOVE)
--
1.9.3
^ permalink raw reply related
* [net-next v2 11/15] i40e/i40evf: find partition_id in npar mode
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Shannon Nelson, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Shannon Nelson <shannon.nelson@intel.com>
When in NPAR mode the driver instance might be controlling the base
partition or one of the other "fake" PFs. There are some things that
can only be done by the base partition, aka partition_id 1. This code
does a bit of work to find how many partitions are there per port and
what is the current partition_id.
Change-ID: Iba427f020a1983d02147d86f121b3627e20ee21d
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_common.c | 66 ++++++++++++++++++++++++
drivers/net/ethernet/intel/i40e/i40e_prototype.h | 3 ++
drivers/net/ethernet/intel/i40e/i40e_type.h | 7 ++-
drivers/net/ethernet/intel/i40evf/i40e_type.h | 7 ++-
4 files changed, 81 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 3d741ee..b16fc03 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -2035,6 +2035,43 @@ i40e_status i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid,
}
/**
+ * i40e_aq_debug_read_register
+ * @hw: pointer to the hw struct
+ * @reg_addr: register address
+ * @reg_val: register value
+ * @cmd_details: pointer to command details structure or NULL
+ *
+ * Read the register using the admin queue commands
+ **/
+i40e_status i40e_aq_debug_read_register(struct i40e_hw *hw,
+ u32 reg_addr, u64 *reg_val,
+ struct i40e_asq_cmd_details *cmd_details)
+{
+ struct i40e_aq_desc desc;
+ struct i40e_aqc_debug_reg_read_write *cmd_resp =
+ (struct i40e_aqc_debug_reg_read_write *)&desc.params.raw;
+ i40e_status status;
+
+ if (reg_val == NULL)
+ return I40E_ERR_PARAM;
+
+ i40e_fill_default_direct_cmd_desc(&desc,
+ i40e_aqc_opc_debug_read_reg);
+
+ cmd_resp->address = cpu_to_le32(reg_addr);
+
+ status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+ if (!status) {
+ *reg_val = ((u64)cmd_resp->value_high << 32) |
+ (u64)cmd_resp->value_low;
+ *reg_val = le64_to_cpu(*reg_val);
+ }
+
+ return status;
+}
+
+/**
* i40e_aq_debug_write_register
* @hw: pointer to the hw struct
* @reg_addr: register address
@@ -2292,6 +2329,7 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
enum i40e_admin_queue_opc list_type_opc)
{
struct i40e_aqc_list_capabilities_element_resp *cap;
+ u32 valid_functions, num_functions;
u32 number, logical_id, phys_id;
struct i40e_hw_capabilities *p;
u32 i = 0;
@@ -2427,6 +2465,34 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
if (p->npar_enable || p->mfp_mode_1)
p->fcoe = false;
+ /* count the enabled ports (aka the "not disabled" ports) */
+ hw->num_ports = 0;
+ for (i = 0; i < 4; i++) {
+ u32 port_cfg_reg = I40E_PRTGEN_CNF + (4 * i);
+ u64 port_cfg = 0;
+
+ /* use AQ read to get the physical register offset instead
+ * of the port relative offset
+ */
+ i40e_aq_debug_read_register(hw, port_cfg_reg, &port_cfg, NULL);
+ if (!(port_cfg & I40E_PRTGEN_CNF_PORT_DIS_MASK))
+ hw->num_ports++;
+ }
+
+ valid_functions = p->valid_functions;
+ num_functions = 0;
+ while (valid_functions) {
+ if (valid_functions & 1)
+ num_functions++;
+ valid_functions >>= 1;
+ }
+
+ /* partition id is 1-based, and functions are evenly spread
+ * across the ports as partitions
+ */
+ hw->partition_id = (hw->pf_id / hw->num_ports) + 1;
+ hw->num_partitions = num_functions / hw->num_ports;
+
/* additional HW specific goodies that might
* someday be HW version specific
*/
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index 2fb4306..d1c7d63 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -71,6 +71,9 @@ i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw,
i40e_status i40e_aq_debug_write_register(struct i40e_hw *hw,
u32 reg_addr, u64 reg_val,
struct i40e_asq_cmd_details *cmd_details);
+i40e_status i40e_aq_debug_read_register(struct i40e_hw *hw,
+ u32 reg_addr, u64 *reg_val,
+ struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,
struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw, u16 vsi_id,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index c1f2eb9..611de3e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -431,7 +431,7 @@ struct i40e_hw {
u8 __iomem *hw_addr;
void *back;
- /* function pointer structs */
+ /* subsystem structs */
struct i40e_phy_info phy;
struct i40e_mac_info mac;
struct i40e_bus_info bus;
@@ -458,6 +458,11 @@ struct i40e_hw {
u8 pf_id;
u16 main_vsi_seid;
+ /* for multi-function MACs */
+ u16 partition_id;
+ u16 num_partitions;
+ u16 num_ports;
+
/* Closest numa node to the device */
u16 numa_node;
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h
index 68aec11..d1c2b5a 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h
@@ -425,7 +425,7 @@ struct i40e_hw {
u8 __iomem *hw_addr;
void *back;
- /* function pointer structs */
+ /* subsystem structs */
struct i40e_phy_info phy;
struct i40e_mac_info mac;
struct i40e_bus_info bus;
@@ -452,6 +452,11 @@ struct i40e_hw {
u8 pf_id;
u16 main_vsi_seid;
+ /* for multi-function MACs */
+ u16 partition_id;
+ u16 num_partitions;
+ u16 num_ports;
+
/* Closest numa node to the device */
u16 numa_node;
--
1.9.3
^ permalink raw reply related
* [net-next v2 09/15] i40e: Add warning for NPAR partitions with link speed less than 10Gbps
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Greg Rose, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Greg Rose <gregory.v.rose@intel.com>
NPAR enabled partitions should warn the user when detected link speed is
less than 10Gpbs.
Change-ID: I7728bb8ce279bf0f4f755d78d7071074a4eb5f69
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index a5f2660..7c14973 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4557,6 +4557,15 @@ static void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
return;
}
+ /* Warn user if link speed on NPAR enabled partition is not at
+ * least 10GB
+ */
+ if (vsi->back->hw.func_caps.npar_enable &&
+ (vsi->back->hw.phy.link_info.link_speed == I40E_LINK_SPEED_1GB ||
+ vsi->back->hw.phy.link_info.link_speed == I40E_LINK_SPEED_100MB))
+ netdev_warn(vsi->netdev,
+ "The partition detected link speed that is less than 10Gbps\n");
+
switch (vsi->back->hw.phy.link_info.link_speed) {
case I40E_LINK_SPEED_40GB:
strlcpy(speed, "40 Gbps", SPEED_SIZE);
--
1.9.3
^ permalink raw reply related
* [net-next v2 10/15] i40e: remove VN2VN related mac filters
From: Jeff Kirsher @ 2015-01-13 19:58 UTC (permalink / raw)
To: davem; +Cc: Vasu Dev, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1421179093-10932-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Vasu Dev <vasu.dev@intel.com>
These mac address already added by FCoE stack above netdev,
therefore adding them here is redundant.
Change-ID: Ia5b59f426f57efd20f8945f7c6cc5d741fbe06e5
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
index a8b8bd9..2cd841b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
@@ -1515,8 +1515,6 @@ void i40e_fcoe_config_netdev(struct net_device *netdev, struct i40e_vsi *vsi)
i40e_add_filter(vsi, (u8[6]) FC_FCOE_FLOGI_MAC, 0, false, false);
i40e_add_filter(vsi, FIP_ALL_FCOE_MACS, 0, false, false);
i40e_add_filter(vsi, FIP_ALL_ENODE_MACS, 0, false, false);
- i40e_add_filter(vsi, FIP_ALL_VN2VN_MACS, 0, false, false);
- i40e_add_filter(vsi, FIP_ALL_P2P_MACS, 0, false, false);
/* use san mac */
ether_addr_copy(netdev->dev_addr, hw->mac.san_addr);
--
1.9.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox