* [PATCH net-next 4/5] stmmac: dwmac-socfpga: call phy_resume() only in resume callback
From: Joachim Eastwood @ 2016-04-26 21:24 UTC (permalink / raw)
To: davem
Cc: Joachim Eastwood, marex, dinguyen, peppe.cavallaro,
alexandre.torgue, netdev
In-Reply-To: <1461705899-17015-1-git-send-email-manabian@gmail.com>
Calling phy_resume() should only be need during driver resume to
workaround a hardware errata.
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Tested-by: Marek Vasut <marex@denx.de>
---
.../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 50 ++++++++--------------
1 file changed, 19 insertions(+), 31 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
index ba0b793..ba49d8c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
@@ -198,41 +198,11 @@ static int socfpga_dwmac_setup(struct socfpga_dwmac *dwmac)
static int socfpga_dwmac_init(struct platform_device *pdev, void *priv)
{
struct socfpga_dwmac *dwmac = priv;
- struct net_device *ndev = platform_get_drvdata(pdev);
- struct stmmac_priv *stpriv = NULL;
- int ret = 0;
-
- if (!ndev)
- return -EINVAL;
-
- stpriv = netdev_priv(ndev);
- if (!stpriv)
- return -EINVAL;
/* Setup the phy mode in the system manager registers according to
* devicetree configuration
*/
- ret = socfpga_dwmac_setup(dwmac);
-
- /* Before the enet controller is suspended, the phy is suspended.
- * This causes the phy clock to be gated. The enet controller is
- * resumed before the phy, so the clock is still gated "off" when
- * the enet controller is resumed. This code makes sure the phy
- * is "resumed" before reinitializing the enet controller since
- * the enet controller depends on an active phy clock to complete
- * a DMA reset. A DMA reset will "time out" if executed
- * with no phy clock input on the Synopsys enet controller.
- * Verified through Synopsys Case #8000711656.
- *
- * Note that the phy clock is also gated when the phy is isolated.
- * Phy "suspend" and "isolate" controls are located in phy basic
- * control register 0, and can be modified by the phy driver
- * framework.
- */
- if (stpriv->phydev)
- phy_resume(stpriv->phydev);
-
- return ret;
+ return socfpga_dwmac_setup(dwmac);
}
static int socfpga_dwmac_probe(struct platform_device *pdev)
@@ -290,6 +260,24 @@ static int socfpga_dwmac_resume(struct device *dev)
socfpga_dwmac_init(pdev, priv->plat->bsp_priv);
+ /* Before the enet controller is suspended, the phy is suspended.
+ * This causes the phy clock to be gated. The enet controller is
+ * resumed before the phy, so the clock is still gated "off" when
+ * the enet controller is resumed. This code makes sure the phy
+ * is "resumed" before reinitializing the enet controller since
+ * the enet controller depends on an active phy clock to complete
+ * a DMA reset. A DMA reset will "time out" if executed
+ * with no phy clock input on the Synopsys enet controller.
+ * Verified through Synopsys Case #8000711656.
+ *
+ * Note that the phy clock is also gated when the phy is isolated.
+ * Phy "suspend" and "isolate" controls are located in phy basic
+ * control register 0, and can be modified by the phy driver
+ * framework.
+ */
+ if (priv->phydev)
+ phy_resume(priv->phydev);
+
return stmmac_resume(dev);
}
#endif /* CONFIG_PM_SLEEP */
--
2.8.0
^ permalink raw reply related
* [PATCH net-next 5/5] stmmac: dwmac-socfpga: kill init() and rename setup() to set_phy_mode()
From: Joachim Eastwood @ 2016-04-26 21:24 UTC (permalink / raw)
To: davem
Cc: Joachim Eastwood, marex, dinguyen, peppe.cavallaro,
alexandre.torgue, netdev
In-Reply-To: <1461705899-17015-1-git-send-email-manabian@gmail.com>
Remove old init callback which now contains only a call to
socfpga_dwmac_setup(). Also rename socfpga_dwmac_setup() to indicate
what the function really does.
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Tested-by: Marek Vasut <marex@denx.de>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
index ba49d8c..cd9764a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
@@ -136,7 +136,7 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
return 0;
}
-static int socfpga_dwmac_setup(struct socfpga_dwmac *dwmac)
+static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac)
{
struct regmap *sys_mgr_base_addr = dwmac->sys_mgr_base_addr;
int phymode = dwmac->interface;
@@ -195,16 +195,6 @@ static int socfpga_dwmac_setup(struct socfpga_dwmac *dwmac)
return 0;
}
-static int socfpga_dwmac_init(struct platform_device *pdev, void *priv)
-{
- struct socfpga_dwmac *dwmac = priv;
-
- /* Setup the phy mode in the system manager registers according to
- * devicetree configuration
- */
- return socfpga_dwmac_setup(dwmac);
-}
-
static int socfpga_dwmac_probe(struct platform_device *pdev)
{
struct plat_stmmacenet_data *plat_dat;
@@ -245,7 +235,7 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
*/
dwmac->stmmac_rst = stpriv->stmmac_rst;
- ret = socfpga_dwmac_init(pdev, dwmac);
+ ret = socfpga_dwmac_set_phy_mode(dwmac);
}
return ret;
@@ -254,11 +244,10 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP
static int socfpga_dwmac_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
struct net_device *ndev = dev_get_drvdata(dev);
struct stmmac_priv *priv = netdev_priv(ndev);
- socfpga_dwmac_init(pdev, priv->plat->bsp_priv);
+ socfpga_dwmac_set_phy_mode(priv->plat->bsp_priv);
/* Before the enet controller is suspended, the phy is suspended.
* This causes the phy clock to be gated. The enet controller is
--
2.8.0
^ permalink raw reply related
* Re: [PATCH net-next] macvlan: fix failure during registration v3
From: Mahesh Bandewar @ 2016-04-26 21:36 UTC (permalink / raw)
To: Francesco Ruggeri; +Cc: linux-netdev, Eric W. Biederman, David S. Miller
In-Reply-To: <CA+HUmGgYf8BkaPqYxvuDtuUY5JC90QC-6_mxEQ6DWRcaoeid2Q@mail.gmail.com>
[...]
>> > -destroy_port:
>> > - port->count -= 1;
>> > - if (!port->count)
>> > - macvlan_port_destroy(lowerdev);
>> I think you still need this when it fails netdev_upper_dev_link(). The
>> only thing you should remove is the label.
>
> I don't think so. I think the double decrement also occurred in this case.
> unregister_netdevice invokes rollback_registered/macvlan_uninit
> which does the decrement.
>
I thought macvlan_port_destroy() does not get called but it is called
from macvlan_uninit(). So it's all good. Thanks.
> Thanks,
> Francesco
>
>> >
>> > return err;
>> > }
>> > --
>> > 1.8.1.4
>> >
^ permalink raw reply
* Re: [PATCH] bpf: fix double-fdput in replace_map_fd_with_map_ptr()
From: David Miller @ 2016-04-26 21:38 UTC (permalink / raw)
To: jannh; +Cc: netdev
In-Reply-To: <1461702386-17490-1-git-send-email-jannh@google.com>
From: Jann Horn <jannh@google.com>
Date: Tue, 26 Apr 2016 22:26:26 +0200
> When bpf(BPF_PROG_LOAD, ...) was invoked with a BPF program whose bytecode
> references a non-map file descriptor as a map file descriptor, the error
> handling code called fdput() twice instead of once (in __bpf_map_get() and
> in replace_map_fd_with_map_ptr()). If the file descriptor table of the
> current task is shared, this causes f_count to be decremented too much,
> allowing the struct file to be freed while it is still in use
> (use-after-free). This can be exploited to gain root privileges by an
> unprivileged user.
>
> This bug was introduced in
> commit 0246e64d9a5f ("bpf: handle pseudo BPF_LD_IMM64 insn"), but is only
> exploitable since
> commit 1be7f75d1668 ("bpf: enable non-root eBPF programs") because
> previously, CAP_SYS_ADMIN was required to reach the vulnerable code.
>
> (posted publicly according to request by maintainer)
>
> Signed-off-by: Jann Horn <jannh@google.com>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Applied and queued up for -stable, thanks Jann.
^ permalink raw reply
* Re: [PATCH net-next V1 00/11] Mellanox 100G extending mlx5 ethtool support
From: David Miller @ 2016-04-26 21:41 UTC (permalink / raw)
To: saeedm; +Cc: saeedm, netdev, ogerlitz, talal, eranbe
In-Reply-To: <CALzJLG-BJvB7h2wAOqy8ibDdkw7Croaiy7+QU9izrcivuS1yOg@mail.gmail.com>
From: Saeed Mahameed <saeedm@dev.mellanox.co.il>
Date: Tue, 26 Apr 2016 23:55:03 +0300
> It will be a nightmare to rollback in such case. What if the rollback failed ?
It is absolutely essential to handle this properly.
Which means you must have a prepare/commit model, wherein the prepare
phase makes sure to pre-allocate all necessary resources, and only if
all the prepare phase preparations succeed will the commit phase run.
The commit phase cannot error, because all of the resources have been
allocated successfully already.
This way there are no issues of "rolling back" because you never
actually move the state forward until you can guarantee that you can
do everything.
^ permalink raw reply
* Re: [PATCH -next] pch_gbe: fix bogus trylock conversion
From: David Miller @ 2016-04-26 21:42 UTC (permalink / raw)
To: fw; +Cc: netdev
In-Reply-To: <1461705270-29849-1-git-send-email-fw@strlen.de>
From: Florian Westphal <fw@strlen.de>
Date: Tue, 26 Apr 2016 23:14:30 +0200
> Should have converted 'if (trylock)' to 'lock'.
>
> Fixes: a6086a893718db ("drivers: net: remove NETDEV_TX_LOCKED")
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
> I re-checked the series and this was the only place where I messed up.
Applied.
^ permalink raw reply
* Quote Request
From: Al Waleed Co. @ 2016-04-26 21:45 UTC (permalink / raw)
To: netdev
Hi,
My name is Al Waleed From Al Waleed trading company Dubai we got you recommendation from one of your customer, so we decided to order a product from you.
Kindly get back to us if you can ship to us in Dubai so that we can get back to you with our products needed from you and other requirement Looking forward hearing back from you
Thank you,
Al Waleed trading company
Customer Service
^ permalink raw reply
* Quote Request
From: Al Waleed Co. @ 2016-04-26 21:45 UTC (permalink / raw)
To: netdev
Hi,
My name is Al Waleed From Al Waleed trading company Dubai we got you recommendation from one of your customer, so we decided to order a product from you.
Kindly get back to us if you can ship to us in Dubai so that we can get back to you with our products needed from you and other requirement Looking forward hearing back from you
Thank you,
Al Waleed trading company
Customer Service
^ permalink raw reply
* Quote Request
From: Al Waleed Co. @ 2016-04-26 21:45 UTC (permalink / raw)
To: netdev
Hi,
My name is Al Waleed From Al Waleed trading company Dubai we got you recommendation from one of your customer, so we decided to order a product from you.
Kindly get back to us if you can ship to us in Dubai so that we can get back to you with our products needed from you and other requirement Looking forward hearing back from you
Thank you,
Al Waleed trading company
Customer Service
^ permalink raw reply
* Darlehen anbieten. Kontaktieren Sie uns für weitere Informationen
From: Kredit-Firma @ 2016-04-26 21:35 UTC (permalink / raw)
Guten Tag,
Wir möchten Sie darüber informieren, dass wir anbieten, Geschäftdarlehen, Projektfinanzierung und Immobilienfinanzierung bei 1% Jahreszins. Für weitere Informationen kontaktieren Sie uns bitte über unsere offizielle E-Mail: eurofinance19@gmail.com. Sie sind verpflichtet, Ihre Kreditanfrage mit Ihren vollständigen Namen, den Kreditbetrag erforderlich, Darlehenslaufzeit und Adresse / Telefonnummer zu senden. Wir werden Ihnen die Darlehensbedingungen und die Rückzahlung nach Erhalt Ihrer E-Mail senden. Bitte haben Sie Ihren Kreditantrag über unsere offizielle E-Mail einreichen: eurofinance19@gmail.com.
Grüße, Josef Pani
Este mensaje (y sus adjuntos), en adelante mensaje, ha sido enviado exclusivamente a su(s) destinatario(s) y es confidencial. Si usted recibe este mensaje por error, por favor b��rrelo y comunique inmediatamente al remitente. Toda utilizaci��n o publicaci��n, total o parcial, queda prohibida salvo autorizaci��n expresa. El MEDUCA no podr�� ser considerado responsable si el mensaje ha sido modificado y/o utilizado sin autorizaci��n. This message (and any attachments), are confidential intended solely for the people whose addresses appear. If you have received this message by error, please delete it and immediately notify the sender. Any use, dissemination or disclosure, either whole or partial, without formal approval is prohibited. The MEDUCA will not therefore be liable for the message if modified and/or used without approval.
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2016-04-26 21:58 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) Handle v4/v6 mixed sockets properly in soreuseport, from Craig Gallak.
2) Bug fixes for the new macsec facility (missing kmalloc NULL checks,
missing locking around netdev list traversal, etc.) from Sabrina
Dubroca.
3) Fix handling of host routes on ifdown in ipv6, from David Ahern.
4) Fix double-fdput in bpf verifier. From Jann Horn.
Please pull, thanks a lot!
The following changes since commit 5f44abd041c5f3be76d57579ab254d78e601315b:
Merge tag 'rtc-4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux (2016-04-21 15:41:13 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
for you to fetch changes up to 8358b02bf67d3a5d8a825070e1aa73f25fb2e4c7:
bpf: fix double-fdput in replace_map_fd_with_map_ptr() (2016-04-26 17:37:21 -0400)
----------------------------------------------------------------
David Ahern (1):
net: ipv6: Delete host routes on an ifdown
David S. Miller (5):
Merge branch 'bridge-mdb-fixes'
Merge branch 'macsec-fixes'
Merge branch 'mlx5-fixes'
ipv6: Revert optional address flusing on ifdown.
Revert "ipv6: Revert optional address flusing on ifdown."
Elad Raz (3):
switchdev: Adding complete operation to deferred switchdev ops
bridge: mdb: Common function for mdb entry translation
bridge: mdb: Marking port-group as offloaded
Eli Cohen (1):
net/mlx5_core: Remove static from local variable
Eric Dumazet (1):
net/mlx4_en: fix spurious timestamping callbacks
Grygorii Strashko (1):
MAINTAINERS: net: add entry for TI Ethernet Switch drivers
Ivan Babrou (1):
net: dummy: remove note about being Y by default
Jann Horn (1):
bpf: fix double-fdput in replace_map_fd_with_map_ptr()
Jiri Benc (1):
cxgbi: fix uninitialized flowi6
Majd Dibbiny (2):
net/mlx5_core: Add ConnectX-5 to list of supported devices
net/mlx5: Add pci shutdown callback
Manish Chopra (1):
qlcnic: Update version to 5.3.64
Maor Gottlieb (1):
net/mlx5_core: Fix soft lockup in steering error flow
Marek Vasut (1):
net: stmmac: socfpga: Remove re-registration of reset controller
Paolo Abeni (1):
ipv4/fib: don't warn when primary address is missing if in_dev is dead
Rana Shahout (1):
net/mlx5e: Fix MLX5E_100BASE_T define
Sabrina Dubroca (9):
macsec: add missing NULL check after kmalloc
macsec: take rtnl lock before for_each_netdev
macsec: don't put a NULL rxsa
macsec: fix rx_sa refcounting with decrypt callback
macsec: add consistency check to netlink dumps
macsec: fix memory leaks around rx_handler (un)registration
macsec: fix SA leak if initialization fails
macsec: add missing macsec prefix in uapi
macsec: fix netlink attribute validation
Saeed Mahameed (3):
net/mlx5e: Device's mtu field is u16 and not int
net/mlx5e: Fix minimum MTU
net/mlx5e: Use vport MTU rather than physical port MTU
MAINTAINERS | 9 +++++
drivers/infiniband/hw/mlx5/main.c | 4 +--
drivers/net/Kconfig | 5 ++-
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 6 ++--
drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 8 ++---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 72 +++++++++++++++++++++++++++++--------
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 48 ++++++++++---------------
drivers/net/ethernet/mellanox/mlx5/core/main.c | 25 ++++++++++---
drivers/net/ethernet/mellanox/mlx5/core/port.c | 10 +++---
drivers/net/ethernet/mellanox/mlx5/core/vport.c | 40 +++++++++++++++++++++
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 4 +--
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 50 +++++++++-----------------
drivers/net/macsec.c | 65 ++++++++++++++++++++++------------
drivers/scsi/cxgbi/libcxgbi.c | 1 +
include/linux/mlx5/driver.h | 7 ++--
include/linux/mlx5/port.h | 6 ++--
include/linux/mlx5/vport.h | 2 ++
include/net/switchdev.h | 4 +++
include/uapi/linux/if_macsec.h | 4 +--
kernel/bpf/verifier.c | 1 -
net/bridge/br_mdb.c | 124 +++++++++++++++++++++++++++++++++++++++++-----------------------
net/bridge/br_multicast.c | 8 +++--
net/bridge/br_private.h | 4 +--
net/ipv4/fib_frontend.c | 6 +++-
net/ipv6/addrconf.c | 48 ++++++++-----------------
net/switchdev/switchdev.c | 6 ++++
27 files changed, 351 insertions(+), 218 deletions(-)
^ permalink raw reply
* [PATCH net-next] net-rfs: fix false sharing accessing sd->input_queue_head
From: Eric Dumazet @ 2016-04-26 22:30 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
sd->input_queue_head is incremented for each processed packet
in process_backlog(), and read from other cpus performing
Out Of Order avoidance in get_rps_cpu()
Moving this field in a separate cache line keeps it mostly
hot for the cpu in process_backlog(), as other cpus will
only read it.
In a stress test, process_backlog() was consuming 6.80 % of cpu cycles,
and the patch reduced the cost to 0.65 %
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/linux/netdevice.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 18d8394f2e5d..934ca866562d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2747,11 +2747,15 @@ struct softnet_data {
struct sk_buff *completion_queue;
#ifdef CONFIG_RPS
- /* Elements below can be accessed between CPUs for RPS */
+ /* input_queue_head should be written by cpu owning this struct,
+ * and only read by other cpus. Worth using a cache line.
+ */
+ unsigned int input_queue_head ____cacheline_aligned_in_smp;
+
+ /* Elements below can be accessed between CPUs for RPS/RFS */
struct call_single_data csd ____cacheline_aligned_in_smp;
struct softnet_data *rps_ipi_next;
unsigned int cpu;
- unsigned int input_queue_head;
unsigned int input_queue_tail;
#endif
unsigned int dropped;
^ permalink raw reply related
* Re: [PATCH V3] net: stmmac: socfpga: Remove re-registration of reset controller
From: Marek Vasut @ 2016-04-26 22:33 UTC (permalink / raw)
To: Joachim Eastwood
Cc: netdev, peppe.cavallaro, alexandre.torgue, Matthew Gerlach,
Dinh Nguyen, David S . Miller
In-Reply-To: <CAGhQ9Vz2FSENtif66SfXsgZqaJaaKeiBsw4qCSevM_4XDnUPCg@mail.gmail.com>
On 04/26/2016 11:22 PM, Joachim Eastwood wrote:
> On 26 April 2016 at 14:47, Marek Vasut <marex@denx.de> wrote:
>> On 04/26/2016 02:26 PM, Joachim Eastwood wrote:
>>> On 26 April 2016 at 00:55, Marek Vasut <marex@denx.de> wrote:
>>>> On 04/25/2016 08:11 PM, Joachim Eastwood wrote:
>>>>> On 21 April 2016 at 14:11, Marek Vasut <marex@denx.de> wrote:
>>>>>>
>>>>>> Finally, plat_dat->exit and socfpga_dwmac_exit() is no longer necessary,
>>>>>> since the functionality is already performed by the stmmac core.
>>>>>
>>>>> I am trying to rebase my changes on top of your two patches and
>>>>> noticed a couple of things.
>>>>>
>>>>>> static int socfpga_dwmac_init(struct platform_device *pdev, void *priv)
>>>>>> {
>>>>>> - struct socfpga_dwmac *dwmac = priv;
>>>>>> + struct socfpga_dwmac *dwmac = priv;
>>>>>> struct net_device *ndev = platform_get_drvdata(pdev);
>>>>>> struct stmmac_priv *stpriv = NULL;
>>>>>> int ret = 0;
>>>>>>
>>>>>> - if (ndev)
>>>>>> - stpriv = netdev_priv(ndev);
>>>>>> + if (!ndev)
>>>>>> + return -EINVAL;
>>>>>
>>>>> ndev can never be NULL here. socfpga_dwmac_init() is only called if
>>>>> stmmac_dvr_probe() succeeds or we are running the resume callback. So
>>>>> I don't see how this could ever be NULL.
>>>>
>>>> That's a good point, this check can indeed be removed. While you're at
>>>> the patching, can you remove this one ?
>>>
>>> Yes, my patch will refactor the init() function so this will go away.
>>
>> Thanks!
>>
>>>>>> +
>>>>>> + stpriv = netdev_priv(ndev);
>>>>>
>>>>> It's not really nice to access 'stmmac_priv' as it should be private
>>>>> to the core driver, but I don't see any other good solution right now.
>>>>
>>>> I guess some stmmac_reset_assert() wrapper would be nicer, yes. What do
>>>> you think ?
>>>>
>>>>>> + if (!stpriv)
>>>>>> + return -EINVAL;
>>>>>>
>>>>>> /* Assert reset to the enet controller before changing the phy mode */
>>>>>> - if (dwmac->stmmac_rst)
>>>>>> - reset_control_assert(dwmac->stmmac_rst);
>>>>>> + if (stpriv->stmmac_rst)
>>>>>> + reset_control_assert(stpriv->stmmac_rst);
>>>>>>
>>>>>> /* Setup the phy mode in the system manager registers according to
>>>>>> * devicetree configuration
>>>>>> @@ -227,8 +210,8 @@ static int socfpga_dwmac_init(struct platform_device *pdev, void *priv)
>>>>>> /* Deassert reset for the phy configuration to be sampled by
>>>>>> * the enet controller, and operation to start in requested mode
>>>>>> */
>>>>>> - if (dwmac->stmmac_rst)
>>>>>> - reset_control_deassert(dwmac->stmmac_rst);
>>>>>> + if (stpriv->stmmac_rst)
>>>>>> + reset_control_deassert(stpriv->stmmac_rst);
>>>>>>
>>>>>> /* Before the enet controller is suspended, the phy is suspended.
>>>>>> * This causes the phy clock to be gated. The enet controller is
>>>>>> @@ -245,7 +228,7 @@ static int socfpga_dwmac_init(struct platform_device *pdev, void *priv)
>>>>>> * control register 0, and can be modified by the phy driver
>>>>>> * framework.
>>>>>> */
>>>>>> - if (stpriv && stpriv->phydev)
>>>>>> + if (stpriv->phydev)
>>>>>> phy_resume(stpriv->phydev);
>>>>>
>>>>> Before this change phy_resume() was only called during driver resume
>>>>> when , but your patches cause phy_resume() to called at probe time as
>>>>> well. Is this okey?
>>>>
>>>> I _hope_ it's OK. The cryptic comment above is not very helpful in this
>>>> aspect. Dinh ? :)
>>>
>>> My patches will move phy_resume() to the resume callback so it
>>> preserves the previous behavior. But if someone knows more about this
>>> that would be useful.
>>>
>>>
>>>> btw I wish you reviewed my patch a bit earlier to catch these bits.
>>>
>>> Sorry, about that. I have been really busy with other things lately.
>>
>> Oh I'm real happy someone is doing the refactoring :) I appreciate your
>> work, sorry if that was unclear.
>>
>>> My patches based on next from Friday can be found here now:
>>> https://github.com/manabian/linux-lpc/tree/net-socfpga-dwmac-on-next
>>>
>>> I had to add your latest patch as well since the next version I used
>>> didn't have it. I'll post the patches on netdev later today or
>>> tomorrow.
>>
>> Looks like next wasn't synced for a few days, yeah.
>>
>> You can add my:
>>
>> On SoCFPGA Cyclone V SoC (DENX MCVEVK):
>> Tested-by: Marek Vasut <marex@denx.de>
>>
>> to those patches
>
> Excellent. Thanks Marek.
>
> btw, did you also test suspend/resume?
No, I believe that is unsupported on SoCFPGA Cyclone V in general.
--
Best regards,
Marek Vasut
^ permalink raw reply
* [PATCH net-next 1/1] pch_gbe: replace private tx ring lock with common netif_tx_lock
From: Francois Romieu @ 2016-04-26 22:49 UTC (permalink / raw)
To: netdev; +Cc: davem
pch_gbe_tx_ring.tx_lock is only used in the hard_xmit handler and
in the transmit completion reaper called from NAPI context.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
CONFIG_COMPILE_TESTed
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h | 2 --
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 10 ++--------
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
index 2a55d6d..8d710a3 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
@@ -481,7 +481,6 @@ struct pch_gbe_buffer {
/**
* struct pch_gbe_tx_ring - tx ring information
- * @tx_lock: spinlock structs
* @desc: pointer to the descriptor ring memory
* @dma: physical address of the descriptor ring
* @size: length of descriptor ring in bytes
@@ -491,7 +490,6 @@ struct pch_gbe_buffer {
* @buffer_info: array of buffer information structs
*/
struct pch_gbe_tx_ring {
- spinlock_t tx_lock;
struct pch_gbe_tx_desc *desc;
dma_addr_t dma;
unsigned int size;
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index ca4add7..5c8e2f1 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -1640,7 +1640,7 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
cleaned_count);
if (cleaned_count > 0) { /*skip this if nothing cleaned*/
/* Recover from running out of Tx resources in xmit_frame */
- spin_lock(&tx_ring->tx_lock);
+ netif_tx_lock(adapter->netdev);
if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev))))
{
netif_wake_queue(adapter->netdev);
@@ -1652,7 +1652,7 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
netdev_dbg(adapter->netdev, "next_to_clean : %d\n",
tx_ring->next_to_clean);
- spin_unlock(&tx_ring->tx_lock);
+ netif_tx_lock(adapter->netdev);
}
return cleaned;
}
@@ -1805,7 +1805,6 @@ int pch_gbe_setup_tx_resources(struct pch_gbe_adapter *adapter,
tx_ring->next_to_use = 0;
tx_ring->next_to_clean = 0;
- spin_lock_init(&tx_ring->tx_lock);
for (desNo = 0; desNo < tx_ring->count; desNo++) {
tx_desc = PCH_GBE_TX_DESC(*tx_ring, desNo);
@@ -2135,13 +2134,9 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
{
struct pch_gbe_adapter *adapter = netdev_priv(netdev);
struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring;
- unsigned long flags;
-
- spin_lock_irqsave(&tx_ring->tx_lock, flags);
if (unlikely(!PCH_GBE_DESC_UNUSED(tx_ring))) {
netif_stop_queue(netdev);
- spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
netdev_dbg(netdev,
"Return : BUSY next_to use : 0x%08x next_to clean : 0x%08x\n",
tx_ring->next_to_use, tx_ring->next_to_clean);
@@ -2150,7 +2145,6 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
/* CRC,ITAG no support */
pch_gbe_tx_queue(adapter, tx_ring, skb);
- spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
return NETDEV_TX_OK;
}
--
2.5.5
^ permalink raw reply related
* Re: [PATCH net-next] net-rfs: fix false sharing accessing sd->input_queue_head
From: Tom Herbert @ 2016-04-26 22:55 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev
In-Reply-To: <1461709807.5535.55.camel@edumazet-glaptop3.roam.corp.google.com>
On Tue, Apr 26, 2016 at 3:30 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> sd->input_queue_head is incremented for each processed packet
> in process_backlog(), and read from other cpus performing
> Out Of Order avoidance in get_rps_cpu()
>
> Moving this field in a separate cache line keeps it mostly
> hot for the cpu in process_backlog(), as other cpus will
> only read it.
>
> In a stress test, process_backlog() was consuming 6.80 % of cpu cycles,
> and the patch reduced the cost to 0.65 %
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Very nice!
Acked-by: Tom Herbert <tom@herbertland.com>
> ---
> include/linux/netdevice.h | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 18d8394f2e5d..934ca866562d 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -2747,11 +2747,15 @@ struct softnet_data {
> struct sk_buff *completion_queue;
>
> #ifdef CONFIG_RPS
> - /* Elements below can be accessed between CPUs for RPS */
> + /* input_queue_head should be written by cpu owning this struct,
> + * and only read by other cpus. Worth using a cache line.
> + */
> + unsigned int input_queue_head ____cacheline_aligned_in_smp;
> +
> + /* Elements below can be accessed between CPUs for RPS/RFS */
> struct call_single_data csd ____cacheline_aligned_in_smp;
> struct softnet_data *rps_ipi_next;
> unsigned int cpu;
> - unsigned int input_queue_head;
> unsigned int input_queue_tail;
> #endif
> unsigned int dropped;
>
>
^ permalink raw reply
* [PATCH 3.2 085/115] veth: don’t modify ip_summed; doing so treats packets with bad checksums as good.
From: Ben Hutchings @ 2016-04-26 23:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: akpm, David S. Miller, Vijay Pandurangan, Cong Wang, netdev,
Evan Jones, Nicolas Dichtel, Phil Sutter, Toshiaki Makita
In-Reply-To: <lsq.1461711744.351546278@decadent.org.uk>
3.2.80-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Vijay Pandurangan <vijayp@vijayp.ca>
[ Upstream commit ce8c839b74e3017996fad4e1b7ba2e2625ede82f ]
Packets that arrive from real hardware devices have ip_summed ==
CHECKSUM_UNNECESSARY if the hardware verified the checksums, or
CHECKSUM_NONE if the packet is bad or it was unable to verify it. The
current version of veth will replace CHECKSUM_NONE with
CHECKSUM_UNNECESSARY, which causes corrupt packets routed from hardware to
a veth device to be delivered to the application. This caused applications
at Twitter to receive corrupt data when network hardware was corrupting
packets.
We believe this was added as an optimization to skip computing and
verifying checksums for communication between containers. However, locally
generated packets have ip_summed == CHECKSUM_PARTIAL, so the code as
written does nothing for them. As far as we can tell, after removing this
code, these packets are transmitted from one stack to another unmodified
(tcpdump shows invalid checksums on both sides, as expected), and they are
delivered correctly to applications. We didn’t test every possible network
configuration, but we tried a few common ones such as bridging containers,
using NAT between the host and a container, and routing from hardware
devices to containers. We have effectively deployed this in production at
Twitter (by disabling RX checksum offloading on veth devices).
This code dates back to the first version of the driver, commit
<e314dbdc1c0dc6a548ecf> ("[NET]: Virtual ethernet device driver"), so I
suspect this bug occurred mostly because the driver API has evolved
significantly since then. Commit <0b7967503dc97864f283a> ("net/veth: Fix
packet checksumming") (in December 2010) fixed this for packets that get
created locally and sent to hardware devices, by not changing
CHECKSUM_PARTIAL. However, the same issue still occurs for packets coming
in from hardware devices.
Co-authored-by: Evan Jones <ej@evanjones.ca>
Signed-off-by: Evan Jones <ej@evanjones.ca>
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: Phil Sutter <phil@nwl.cc>
Cc: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Vijay Pandurangan <vijayp@vijayp.ca>
Acked-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
drivers/net/veth.c | 6 ------
1 file changed, 6 deletions(-)
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -126,11 +126,6 @@ static netdev_tx_t veth_xmit(struct sk_b
stats = this_cpu_ptr(priv->stats);
rcv_stats = this_cpu_ptr(rcv_priv->stats);
- /* don't change ip_summed == CHECKSUM_PARTIAL, as that
- will cause bad checksum on forwarded packets */
- if (skb->ip_summed == CHECKSUM_NONE &&
- rcv->features & NETIF_F_RXCSUM)
- skb->ip_summed = CHECKSUM_UNNECESSARY;
length = skb->len;
if (dev_forward_skb(rcv, skb) != NET_RX_SUCCESS)
^ permalink raw reply
* Re: [PATCH net-next 9/9] taskstats: use the libnl API to align nlattr on 64-bit
From: Balbir Singh @ 2016-04-27 1:14 UTC (permalink / raw)
To: Nicolas Dichtel, netdev-u79uwXL29TY76Z2rM5mHXA
Cc: dev-yBygre7rU0TnMu66kgdUjQ,
steffen.klassert-opNxpl+3fjRBDgjK7y7TUQ,
herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q,
aar-bIcnvbaLZ9MEGnE8C9+IrQ, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q, yoshfuji-VfPWfsRibaP+Ru+s062T9g,
netfilter-devel-u79uwXL29TY76Z2rM5mHXA,
kadlec-K40Dz/62t/MgiyqX0sVFJYdd74u8MsAO,
kuznet-v/Mj1YrvjDBInbfyfbPRSQ, jmorris-gx6/JNMH7DfYtjvyW6yDsg,
linux-wpan-u79uwXL29TY76Z2rM5mHXA, kaber-dcUjhNyLwpNeoWH0uzbU5w,
pablo-Cap9r6Oaw4JrovVCs/uTlw
In-Reply-To: <1461339084-3849-10-git-send-email-nicolas.dichtel-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
On 23/04/16 01:31, Nicolas Dichtel wrote:
> Goal of this patch is to use the new libnl API to align netlink attribute
> when needed.
> The layout of the netlink message will be a bit different after the patch,
> because the padattr (TASKSTATS_TYPE_STATS) will be inside the nested
> attribute instead of before it.
>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
The layout will change/break user space -- I've not tested the patch though..
Balbir Singh.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev
^ permalink raw reply
* linux-next: manual merge of the net-next tree with the net tree
From: Stephen Rothwell @ 2016-04-27 2:01 UTC (permalink / raw)
To: David Miller, netdev
Cc: linux-next, linux-kernel, Saeed Mahameed, Gal Pressman
Hi all,
Today's linux-next merge of the net-next tree got a conflict in:
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
between commit:
d8edd2469ace ("et/mlx5e: Fix minimum MTU")
from the net tree and commit:
0e405443e803 ("net/mlx5e: Improve set features ndo resiliency")
from the net-next tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 67d548b70e14,5bad17d37d7b..000000000000
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@@ -2025,9 -2214,49 +2240,52 @@@ static int set_feature_rx_vlan(struct n
return err;
}
+ static int mlx5e_handle_feature(struct net_device *netdev,
+ netdev_features_t wanted_features,
+ netdev_features_t feature,
+ mlx5e_feature_handler feature_handler)
+ {
+ netdev_features_t changes = wanted_features ^ netdev->features;
+ bool enable = !!(wanted_features & feature);
+ int err;
+
+ if (!(changes & feature))
+ return 0;
+
+ err = feature_handler(netdev, enable);
+ if (err) {
+ netdev_err(netdev, "%s feature 0x%llx failed err %d\n",
+ enable ? "Enable" : "Disable", feature, err);
+ return err;
+ }
+
+ MLX5E_SET_FEATURE(netdev, feature, enable);
+ return 0;
+ }
+
+ static int mlx5e_set_features(struct net_device *netdev,
+ netdev_features_t features)
+ {
+ int err;
+
+ err = mlx5e_handle_feature(netdev, features, NETIF_F_LRO,
+ set_feature_lro);
+ err |= mlx5e_handle_feature(netdev, features,
+ NETIF_F_HW_VLAN_CTAG_FILTER,
+ set_feature_vlan_filter);
+ err |= mlx5e_handle_feature(netdev, features, NETIF_F_HW_TC,
+ set_feature_tc_num_filters);
+ err |= mlx5e_handle_feature(netdev, features, NETIF_F_RXALL,
+ set_feature_rx_all);
+ err |= mlx5e_handle_feature(netdev, features, NETIF_F_HW_VLAN_CTAG_RX,
+ set_feature_rx_vlan);
+
+ return err ? -EINVAL : 0;
+ }
+
+#define MXL5_HW_MIN_MTU 64
+#define MXL5E_MIN_MTU (MXL5_HW_MIN_MTU + ETH_FCS_LEN)
+
static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
@@@ -2633,18 -2966,10 +2997,19 @@@ static void mlx5e_destroy_netdev(struc
schedule_work(&priv->set_rx_mode_work);
mlx5e_disable_async_events(priv);
flush_scheduled_work();
- unregister_netdev(netdev);
+ if (test_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &mdev->intf_state)) {
+ netif_device_detach(netdev);
+ mutex_lock(&priv->state_lock);
+ if (test_bit(MLX5E_STATE_OPENED, &priv->state))
+ mlx5e_close_locked(netdev);
+ mutex_unlock(&priv->state_lock);
+ } else {
+ unregister_netdev(netdev);
+ }
+
mlx5e_tc_cleanup(priv);
mlx5e_vxlan_cleanup(priv);
+ mlx5e_destroy_q_counter(priv);
mlx5e_destroy_flow_tables(priv);
mlx5e_destroy_tirs(priv);
mlx5e_destroy_rqt(priv, MLX5E_SINGLE_RQ_RQT);
^ permalink raw reply
* linux-next: manual merge of the net-next tree with the net tree
From: Stephen Rothwell @ 2016-04-27 2:01 UTC (permalink / raw)
To: David Miller, netdev
Cc: linux-next, linux-kernel, Nicolas Dichtel, Sabrina Dubroca
Hi all,
Today's linux-next merge of the net-next tree got a conflict in:
drivers/net/macsec.c
between commit:
748164802c1b ("macsec: add missing macsec prefix in uapi")
from the net tree and commit:
f60d94c00968 ("macsec: use nla_put_u64_64bit()")
from the net-next tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc drivers/net/macsec.c
index c6385617bfb2,a172a1ffa151..000000000000
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@@ -2231,9 -2271,11 +2276,11 @@@ static int nla_put_secy(struct macsec_s
if (!secy_nest)
return 1;
- if (nla_put_sci(skb, MACSEC_SECY_ATTR_SCI, secy->sci) ||
- nla_put_u64(skb, MACSEC_SECY_ATTR_CIPHER_SUITE,
- MACSEC_DEFAULT_CIPHER_ID) ||
+ if (nla_put_sci(skb, MACSEC_SECY_ATTR_SCI, secy->sci,
+ MACSEC_SECY_ATTR_PAD) ||
+ nla_put_u64_64bit(skb, MACSEC_SECY_ATTR_CIPHER_SUITE,
- DEFAULT_CIPHER_ID,
++ MACSEC_DEFAULT_CIPHER_ID,
+ MACSEC_SECY_ATTR_PAD) ||
nla_put_u8(skb, MACSEC_SECY_ATTR_ICV_LEN, secy->icv_len) ||
nla_put_u8(skb, MACSEC_SECY_ATTR_OPER, secy->operational) ||
nla_put_u8(skb, MACSEC_SECY_ATTR_PROTECT, secy->protect_frames) ||
@@@ -3184,10 -3219,11 +3236,11 @@@ static int macsec_fill_info(struct sk_b
struct macsec_secy *secy = &macsec_priv(dev)->secy;
struct macsec_tx_sc *tx_sc = &secy->tx_sc;
- if (nla_put_sci(skb, IFLA_MACSEC_SCI, secy->sci) ||
+ if (nla_put_sci(skb, IFLA_MACSEC_SCI, secy->sci,
+ IFLA_MACSEC_PAD) ||
nla_put_u8(skb, IFLA_MACSEC_ICV_LEN, secy->icv_len) ||
- nla_put_u64(skb, IFLA_MACSEC_CIPHER_SUITE,
- MACSEC_DEFAULT_CIPHER_ID) ||
+ nla_put_u64_64bit(skb, IFLA_MACSEC_CIPHER_SUITE,
- DEFAULT_CIPHER_ID, IFLA_MACSEC_PAD) ||
++ MACSEC_DEFAULT_CIPHER_ID, IFLA_MACSEC_PAD) ||
nla_put_u8(skb, IFLA_MACSEC_ENCODING_SA, tx_sc->encoding_sa) ||
nla_put_u8(skb, IFLA_MACSEC_ENCRYPT, tx_sc->encrypt) ||
nla_put_u8(skb, IFLA_MACSEC_PROTECT, secy->protect_frames) ||
^ permalink raw reply
* Re: [PATCH] net: phy: at803x: only the AT8030 needs a hardware reset on link change
From: Florian Fainelli @ 2016-04-27 2:46 UTC (permalink / raw)
To: Timur Tabi, netdev, davem, marek.belisko, ujhelyi.m, zonque
In-Reply-To: <1461692658-1742-1-git-send-email-timur@codeaurora.org>
Le 26/04/2016 10:44, Timur Tabi a écrit :
> Commit 13a56b44 ("at803x: Add support for hardware reset") added a
> work-around for a hardware bug on the AT8030. However, the work-around
> was being called for all 803x PHYs, even those that don't need it.
> Function at803x_link_change_notify() checks to make sure that it only
> resets the PHY on the 8030, but it makes more sense to not call that
> function at all if it isn't needed.
>
> Signed-off-by: Timur Tabi <timur@codeaurora.org>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
This looks nicer indeed!
--
Florian
^ permalink raw reply
* RE: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets
From: Dexuan Cui @ 2016-04-27 3:02 UTC (permalink / raw)
To: Cathy Avery, gregkh@linuxfoundation.org, davem@davemloft.net,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, olaf@aepfle.de, Jason Wang,
KY Srinivasan, Haiyang Zhang, vkuznets@redhat.com,
joe@perches.com
In-Reply-To: <571F94F9.6020204@redhat.com>
> From: Cathy Avery [mailto:cavery@redhat.com]
> Sent: Wednesday, April 27, 2016 0:19
> To: Dexuan Cui <decui@microsoft.com>; gregkh@linuxfoundation.org;
> davem@davemloft.net; netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; olaf@aepfle.de; Jason Wang
> <jasowang@redhat.com>; KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; vkuznets@redhat.com; joe@perches.com
> Subject: Re: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets
>
> Hi,
>
> I will be working with Dexuan to possibly port this functionality into RHEL.
>
> Here are my initial comments. Mostly stylistic. They are prefaced by CAA.
>
> Cathy Avery
Thank you very much, Cathy!
I'll take your pretty good suggestions and post a new version.
Thanks,
-- Dexuan
^ permalink raw reply
* Re: [PATCH v2 net-next 11/13] Documentation: Bindings: Update DT binding for separating dsaf dev support
From: Yisen Zhuang @ 2016-04-27 3:33 UTC (permalink / raw)
To: Rob Herring, davem
Cc: mark.rutland, devicetree, salil.mehta, catalin.marinas,
xieqianqian, pawel.moll, ijc+devicetree, netdev, lipeng321,
will.deacon, linuxarm, xuwei5, huangdaode, galak, yankejian,
linux-arm-kernel, liguozhu
In-Reply-To: <20160426124847.GA26682@rob-hp-laptop>
Hi Rob and David,
Please see my comments inline.
David have merged this series to net-next, but we need to modify some codes according
to Rob's comments. I am not sure if i need to send V3 for this series, or separate
patches of documentation to independent series and generate a new patch for hns base
on current net-next?
Thanks,
Yisen
在 2016/4/26 20:48, Rob Herring 写道:
> On Sat, Apr 23, 2016 at 05:05:15PM +0800, Yisen Zhuang wrote:
>> Because debug dsaf port was separated from service dsaf port, this patch
>> updates the related information of DT binding.
>
> Separated when? New version of the h/w? If so, where's the new
> compatible string? This is quite a big binding change.
There isn't any change of h/w. I separated debug dsaf port from sevice dsaf
port to make the code more simple and readability.
>
>> Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
>>
>> ---
>> .../devicetree/bindings/net/hisilicon-hns-dsaf.txt | 59 ++++++++++++++++++----
>> 1 file changed, 49 insertions(+), 10 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
>> index ecacfa4..5ccd4f0 100644
>> --- a/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
>> +++ b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
>> @@ -7,19 +7,47 @@ Required properties:
>> - mode: dsa fabric mode string. only support one of dsaf modes like these:
>> "2port-64vf",
>> "6port-16rss",
>> - "6port-16vf".
>> + "6port-16vf",
>> + "single-port".
>> - interrupt-parent: the interrupt parent of this device.
>> - interrupts: should contain the DSA Fabric and rcb interrupt.
>> - reg: specifies base physical address(es) and size of the device registers.
>> - The first region is external interface control register base and size.
>> - The second region is SerDes base register and size.
>> + The first region is external interface control register base and size(optional,
>> + only be used when subctrl-syscon is not exists). It is recommended using
>
> only used when subctrl-syscon does not exist
Agree, thanks.
>
>> + subctrl-syscon rather than this address.
>> + The second region is SerDes base register and size(optional, only be used when
>> + serdes-syscon in port node is not exists. It is recommended using
>
> similar rewording needed here.
Agree, thanks.
>
>> + serdes-syscon rather than this address.
>> The third region is the PPE register base and size.
>> - The fourth region is dsa fabric base register and size.
>> - The fifth region is cpld base register and size, it is not required if do not use cpld.
>> -- phy-handle: phy handle of physicl port, 0 if not any phy device. see ethernet.txt [1].
>> + The fourth region is dsa fabric base register and size. It is not required for
>> + single-port mode.
>> +- reg-names: may be ppe-base and(or) dsaf-base. It is used to find the
>> + corresponding reg's index.
>
> But you have up to 5 regions.
>
> The variable nature of what regions you have tells me you need more
> specific compatible strings for each chip.
we didn't add support of new h/w. We added these regions to make code simple and readability.
If we need to add support of next h/w version next time, we don't need to add many branches
for these attributes. So we didn't add a new compatible here.
>
>> +
>> +- phy-handle: phy handle of physicl port, 0 if not any phy device. It is optional
>
> s/physicl/physical/
Agree, thanks.
>
>> + attribute. If port node is exists, phy-handle in each port node will be used.
>> + see ethernet.txt [1].
>> +- subctrl-syscon: is syscon handle for external interface control register.
>> +- reset-field-offset: is offset of reset field. Its value depends on the hardware
>> + user manual.
>> - buf-size: rx buffer size, should be 16-1024.
>> - desc-num: number of description in TX and RX queue, should be 512, 1024, 2048 or 4096.
>>
>> +- port: subnodes of dsaf. A dsaf node may contain several port nodes(Depending
>> + on mode of dsaf). Port node contain some attributes listed below:
>> +- port-id: is physical port index in one dsaf.
>
> Indexes should generally be avoided. What does the number correspond
> to in h/w (if anything)?
port-id is index for a port in dsaf, it is correspond to index of PHY showed below.
CPU
|
-----------------------------------
| | |
---------------------------------------------- --------- ---------
| | | | | | | |
| PPE | | PPE | | PPE |
| | | | | | | | |
| | | | | | | | |
| crossbar | | | | | | |
| | | | | | | | |
| ---------------------------------- | | | | | | |
| | | | | | | | | | | | | |
| | | | | | | | | | | | | |
| MAC MAC MAC MAC MAC MAC | | MAC | | MAC |
| | | | | | | | | | | | | |
---------------------------------------------- --------- ---------
| | | | | | \ / | / |
PHY PHY PHY PHY PHY PHY \ / PHY / PHY
\ / /
\ / /
DSAF(three platform device)
>
>> +- phy-handle: phy handle of physicl port. It is not required if there isn't
>> + phy device. see ethernet.txt [1].
>> +- serdes-syscon: is syscon handle for SerDes register.
>> +- cpld-syscon: is syscon handle for cpld register. It is not required if there
>> + isn't cpld device.
>> +- cpld-ctrl-reg: is cpld register offset. It is not required if there isn't
>> + cpld-syscon.
>
> This would usually be a cell in the cpld-syscon property.
Agree, thanks.
>
>> +- port-rst-offset: is offset of reset field for each port in dsaf. Its value
>> + depends on the hardware user manual.
>> +- port-mode-offset: is offset of port mode field for each port in dsaf. Its
>> + value depends on the hardware user manual.
>
> Again, sounds like you need more specific compatible strings that imply
> this information.
>
>> +
>> [1] Documentation/devicetree/bindings/net/phy.txt
>>
>> Example:
>> @@ -28,11 +56,11 @@ dsaf0: dsa@c7000000 {
>> compatible = "hisilicon,hns-dsaf-v1";
>> mode = "6port-16rss";
>> interrupt-parent = <&mbigen_dsa>;
>> - reg = <0x0 0xC0000000 0x0 0x420000
>> - 0x0 0xC2000000 0x0 0x300000
>> - 0x0 0xc5000000 0x0 0x890000
>> + reg = <0x0 0xc5000000 0x0 0x890000
>> 0x0 0xc7000000 0x0 0x60000>;
>> - phy-handle = <0 0 0 0 &soc0_phy4 &soc0_phy5 0 0>;
>> + reg-names = "ppe-base", "dsaf-base";
>> + subctrl-syscon = <&subctrl>;
>> + reset-field-offset = 0;
>> interrupts = <131 4>,<132 4>, <133 4>,<134 4>,
>> <135 4>,<136 4>, <137 4>,<138 4>,
>> <139 4>,<140 4>, <141 4>,<142 4>,
>> @@ -43,4 +71,15 @@ dsaf0: dsa@c7000000 {
>> buf-size = <4096>;
>> desc-num = <1024>;
>> dma-coherent;
>> +
>> + prot@0 {
>
> port?
Agree, i am sorry for my carelessness and will pay more attention to it next time.
thank you very much.
>
>> + port-id = 0;
>> + phy-handle = <&phy0>;
>> + serdes-syscon = <&serdes>;
>> + };
>> +
>> + prot@1 {
>> + port-id = 1;
>> + serdes-syscon = <&serdes>;
>> + };
>> };
>> --
>> 1.9.1
>>
>
> .
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH v5 09/21] IB/hns: Add hca support
From: oulijun @ 2016-04-27 3:34 UTC (permalink / raw)
To: Jiri Pirko, Leon Romanovsky
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
davem-fT/PcQaiUtIeIZ0/mPfg9Q,
jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
jiri-VPRAkNaXOzVWk0Htik3J/w, ogerlitz-VPRAkNaXOzVWk0Htik3J/w,
linuxarm-hv44wF8Li93QT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
gongyangming-hv44wF8Li93QT0dZR+AlfA,
xiaokun-hv44wF8Li93QT0dZR+AlfA,
tangchaofei-hv44wF8Li93QT0dZR+AlfA,
haifeng.wei-hv44wF8Li93QT0dZR+AlfA,
yisen.zhuang-hv44wF8Li93QT0dZR+AlfA,
yankejian-hv44wF8Li93QT0dZR+AlfA,
lisheng011-hv44wF8Li93QT0dZR+AlfA,
charles.chenxin-hv44wF8Li93QT0dZR+AlfA
In-Reply-To: <20160426142517.GA1937-6KJVSR23iU488b5SBfVpbw@public.gmane.org>
On 2016/4/26 22:25, Jiri Pirko wrote:
> Tue, Apr 26, 2016 at 04:18:21PM CEST, leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org wrote:
>> On Tue, Apr 26, 2016 at 02:34:44PM +0800, oulijun wrote:
>>> On 2016/4/24 15:54, Leon Romanovsky wrote:
>
> <snip>
>
>>>>> +int hns_roce_bitmap_alloc(struct hns_roce_bitmap *bitmap, u32 *obj)
>>>>> +{
>>>>> + int ret = 0;
>>>>> +
>>>>> + spin_lock(&bitmap->lock);
>>>>> + *obj = find_next_zero_bit(bitmap->table, bitmap->max, bitmap->last);
>>>>> + if (*obj >= bitmap->max) {
>>>>> + bitmap->top = (bitmap->top + bitmap->max + bitmap->reserved_top)
>>>>> + & bitmap->mask;
>>>>> + *obj = find_first_zero_bit(bitmap->table, bitmap->max);
>>>>
>>>> find_first_zero_bit function returns "unsigned long" which may or may
>>>> not be equal to u32 on some architectures.
>>>>
>>> Hi Leon,
>>> I appreciate your keen eye. this code is meant for ARM64bit therefore should run corretly for 64-bit AARCH64.
>
> The driver should run correctly on any arch.
>
Hi Jiri Pirko,
Our driver run in ARM64 platform by depending on Kconfig. It will be configure in Kconfig file.
Thanks
Lijun Ou
>
>>> I will consider changing it as part of good partice and better portability "
>>> I will give a primary plan to modified it.
>>> for example:
>>> *obj = (u32)find_next_zero_bit(bitmap->table, bitmap->max, bitmap->last);
>>> Beause the max size of bitmap->table is u32 in current version.
>>>
>>> int hns_roce_bitmap_init(struct hns_roce_bitmap *bitmap, u32 num, u32 mask,
>>> u32 reserved_bot, u32 reserved_top)
>>> {
>>> u32 i;
>>>
>>> if (num != roundup_pow_of_two(num))
>>> return -EINVAL;
>>>
>>> bitmap->last = 0;
>>> bitmap->top = 0;
>>> bitmap->max = num - reserved_top;
>>> bitmap->mask = mask;
>>> bitmap->reserved_top = reserved_top;
>>> spin_lock_init(&bitmap->lock);
>>> bitmap->table = kcalloc(BITS_TO_LONGS(bitmap->max), sizeof(long),
>>> GFP_KERNEL);
>>>
>>> Is this plan ok?
>>
>> No,
>> You are submitting new driver, please do it properly (without casting)
>>from the beginning.
>>
>>>
>>> Thanks
>>> Lijun Ou
>>>
>>> --
>>> 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
>
>
>
> .
>
--
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 v5 09/21] IB/hns: Add hca support
From: oulijun @ 2016-04-27 3:37 UTC (permalink / raw)
To: leon-DgEjT+Ai2ygdnm+yROfE0A
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
davem-fT/PcQaiUtIeIZ0/mPfg9Q,
jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w,
jiri-VPRAkNaXOzVWk0Htik3J/w, ogerlitz-VPRAkNaXOzVWk0Htik3J/w,
linuxarm-hv44wF8Li93QT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
gongyangming-hv44wF8Li93QT0dZR+AlfA,
xiaokun-hv44wF8Li93QT0dZR+AlfA,
tangchaofei-hv44wF8Li93QT0dZR+AlfA,
haifeng.wei-hv44wF8Li93QT0dZR+AlfA,
yisen.zhuang-hv44wF8Li93QT0dZR+AlfA,
yankejian-hv44wF8Li93QT0dZR+AlfA,
lisheng011-hv44wF8Li93QT0dZR+AlfA,
charles.chenxin-hv44wF8Li93QT0dZR+AlfA
In-Reply-To: <20160426141821.GJ7974-2ukJVAZIZ/Y@public.gmane.org>
On 2016/4/26 22:18, Leon Romanovsky wrote:
> On Tue, Apr 26, 2016 at 02:34:44PM +0800, oulijun wrote:
>> On 2016/4/24 15:54, Leon Romanovsky wrote:
>>> On Sat, Apr 23, 2016 at 06:26:47PM +0800, Lijun Ou wrote:
>>>> This patch mainly setup hca for RoCE. it will do a series of
>>>> initial works as follows:
>>>> 1. init uar table, allocate uar resource
>>>> 2. init pd table
>>>> 3. init cq table
>>>> 4. init mr table
>>>> 5. init qp table
>>>>
>>>> Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>>>> Signed-off-by: Wei Hu(Xavier) <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>>>> ---
>>>> drivers/infiniband/hw/hns/hns_roce_alloc.c | 104 ++++++++++++++++
>>>> drivers/infiniband/hw/hns/hns_roce_cq.c | 25 ++++
>>>> drivers/infiniband/hw/hns/hns_roce_device.h | 69 ++++++++++
>>>> drivers/infiniband/hw/hns/hns_roce_eq.c | 1 -
>>>> drivers/infiniband/hw/hns/hns_roce_icm.c | 88 +++++++++++++
>>>> drivers/infiniband/hw/hns/hns_roce_icm.h | 9 ++
>>>> drivers/infiniband/hw/hns/hns_roce_main.c | 79 ++++++++++++
>>>> drivers/infiniband/hw/hns/hns_roce_mr.c | 187 ++++++++++++++++++++++++++++
>>>> drivers/infiniband/hw/hns/hns_roce_pd.c | 65 ++++++++++
>>>> drivers/infiniband/hw/hns/hns_roce_qp.c | 30 +++++
>>>> 10 files changed, 656 insertions(+), 1 deletion(-)
>>>> create mode 100644 drivers/infiniband/hw/hns/hns_roce_alloc.c
>>>> create mode 100644 drivers/infiniband/hw/hns/hns_roce_mr.c
>>>> create mode 100644 drivers/infiniband/hw/hns/hns_roce_pd.c
>>>>
>>>> diff --git a/drivers/infiniband/hw/hns/hns_roce_alloc.c b/drivers/infiniband/hw/hns/hns_roce_alloc.c
>>>> new file mode 100644
>>>> index 0000000..0c76f1b
>>>> --- /dev/null
>>>> +++ b/drivers/infiniband/hw/hns/hns_roce_alloc.c
>>>> @@ -0,0 +1,104 @@
>>>> +/*
>>>> + * Copyright (c) 2016 Hisilicon Limited.
>>>> + *
>>>> + * This program is free software; you can redistribute it and/or modify
>>>> + * it under the terms of the GNU General Public License as published by
>>>> + * the Free Software Foundation; either version 2 of the License, or
>>>> + * (at your option) any later version.
>>>> + */
>>>> +
>>>> +#include <linux/bitmap.h>
>>>> +#include <linux/dma-mapping.h>
>>>> +#include <linux/errno.h>
>>>> +#include <linux/mm.h>
>>>> +#include <linux/slab.h>
>>>> +#include <linux/vmalloc.h>
>>>> +#include "hns_roce_device.h"
>>>> +
>>>> +int hns_roce_bitmap_alloc(struct hns_roce_bitmap *bitmap, u32 *obj)
>>>> +{
>>>> + int ret = 0;
>>>> +
>>>> + spin_lock(&bitmap->lock);
>>>> + *obj = find_next_zero_bit(bitmap->table, bitmap->max, bitmap->last);
>>>> + if (*obj >= bitmap->max) {
>>>> + bitmap->top = (bitmap->top + bitmap->max + bitmap->reserved_top)
>>>> + & bitmap->mask;
>>>> + *obj = find_first_zero_bit(bitmap->table, bitmap->max);
>>>
>>> find_first_zero_bit function returns "unsigned long" which may or may
>>> not be equal to u32 on some architectures.
>>>
>> Hi Leon,
>> I appreciate your keen eye. this code is meant for ARM64bit therefore should run corretly for 64-bit AARCH64.
>> I will consider changing it as part of good partice and better portability "
>> I will give a primary plan to modified it.
>> for example:
>> *obj = (u32)find_next_zero_bit(bitmap->table, bitmap->max, bitmap->last);
>> Beause the max size of bitmap->table is u32 in current version.
>>
>> int hns_roce_bitmap_init(struct hns_roce_bitmap *bitmap, u32 num, u32 mask,
>> u32 reserved_bot, u32 reserved_top)
>> {
>> u32 i;
>>
>> if (num != roundup_pow_of_two(num))
>> return -EINVAL;
>>
>> bitmap->last = 0;
>> bitmap->top = 0;
>> bitmap->max = num - reserved_top;
>> bitmap->mask = mask;
>> bitmap->reserved_top = reserved_top;
>> spin_lock_init(&bitmap->lock);
>> bitmap->table = kcalloc(BITS_TO_LONGS(bitmap->max), sizeof(long),
>> GFP_KERNEL);
>>
>> Is this plan ok?
>
> No,
> You are submitting new driver, please do it properly (without casting)
> from the beginning.
>
oh, i see. I will give a better plan to modify it.
Thanks
Lijun Ou
>>
>> Thanks
>> Lijun Ou
>>
>> --
>> 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
--
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: [net-next 08/15] i40e: Allow user to change input set mask for flow director
From: David Miller @ 2016-04-27 3:48 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: kiran.patil, netdev, nhorman, sassmann, jogreene
In-Reply-To: <1461704148-114349-9-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 26 Apr 2016 13:55:41 -0700
> From: Kiran Patil <kiran.patil@intel.com>
>
> This patch implements feature, which allows user to change
> input set mask for flow director using side-band channel.
> This patch adds definition of FLOW_TYPE_MASK into the header file.
> With this patch, user can now specify less than 4 tuple(src ip, dsp ip,
> src port, dst port) for flow type TCP4/UDP4.
>
> Change-Id: I90052508f8c172c0da5a4b78b949704b4a59ea78
> Signed-off-by: Kiran Patil <kiran.patil@intel.com>
> Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
If you want to do this, you have to define the semantics generically
in include/uapi/linux/ethtool.h so that other drivers can implement
this too.
Please don't ever implement private, driver specific, interpretations
of the generic ethtool facilitites.
The semantics and interpretations of the values must absolutely be
consistent across all drivers in the tree.
Otherwise the user experience is terrible.
Thanks.
^ permalink raw reply
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