* Re: [v8 net-next 0/4] Refactor vxlan and l2tp to use new common UDP tunnel APIs
From: David Miller @ 2014-09-19 19:58 UTC (permalink / raw)
To: azhou; +Cc: netdev
In-Reply-To: <1410913787-31599-1-git-send-email-azhou@nicira.com>
From: Andy Zhou <azhou@nicira.com>
Date: Tue, 16 Sep 2014 17:29:43 -0700
> This patch series add a few more UDP tunnel APIs and refactoring current
> UDP tunnel based protocols, vxlan and l2tp to make use of the new APIs.
>
> The added APIs are setup_udp_tunnel_sock(), udp_tunnel_xmit_skb() and
> udp_tunnel_sock_release(). Those implementation logics already exist in
> current vxlan and l2tp implementation. Move them to common APIs to reduce
> code duplications.
>
> Also split udp_tunnel.c into net/ipv4/udp_tunnel.c and
> net/ipv6/ip6_udp_tunnel.c to maintain proper IP protocol separation.
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 0/8] net: phy: Broadcom BCM7xxx PHY workaround update
From: Florian Fainelli @ 2014-09-19 19:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20140919.155554.871635845344096230.davem@davemloft.net>
On 09/19/2014 12:55 PM, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Fri, 19 Sep 2014 15:41:04 -0400 (EDT)
>
>> Series applied, thanks Florian.
>
> Actually I had to revert:
>
> net/dsa/slave.c: In function ‘dsa_slave_phy_setup’:
> net/dsa/slave.c:395:42: error: ‘port’ undeclared (first use in this function)
> phy_flags = ds->drv->get_phy_flags(ds, port);
> ^
> net/dsa/slave.c:395:42: note: each undeclared identifier is reported only once for each function it appears in
>
Whoops, I will fix that immediately.
^ permalink raw reply
* Re: [PATCH net] sparc: bpf_jit: fix support for ldx/stx mem and SKF_AD_VLAN_TAG
From: David Miller @ 2014-09-19 20:02 UTC (permalink / raw)
To: ast; +Cc: dborkman, netdev
In-Reply-To: <1410917578-5122-1-git-send-email-ast@plumgrid.com>
From: Alexei Starovoitov <ast@plumgrid.com>
Date: Tue, 16 Sep 2014 18:32:58 -0700
> fix several issues in sparc BPF JIT compiler.
>
> ldx/stx related:
> . classic BPF instructions that access mem[] slots were not setting
> SEEN_MEM flag, so stack wasn't allocated. Fix that by advertising
> correct flags
>
> . LDX/STX instructions were missing SEEN_XREG, so register value
> could have leaked to user space. Fix it.
>
> . since stack for mem[] slots is allocated with 'sub %sp' instead
> of 'save %sp', use %sp as base register instead of %fp.
>
> . ldx mem[0] means first slot in classic BPF which should have
> -4 offset instead of 0.
>
> . sparc64 needs 2047 stack bias as per ABI to access stack
>
> . emit_stmem() was using LD32I macro instead of ST32I
>
> SKF_AD_VLAN_TAG* related:
> . SKF_AD_VLAN_TAG_PRESENT must return 1 or 0 instead of '> 0' or 0
> as per classic BPF de facto standard
>
> . SKF_AD_VLAN_TAG needs to mask the field correctly
>
> Fixes: 2809a2087cc4 ("net: filter: Just In Time compiler for sparc")
> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Applied and queued up for -stable, thanks!
^ permalink raw reply
* Re: [PATCH net] macvlan: allow to enqueue broadcast pkt on virtual device
From: David Miller @ 2014-09-19 20:03 UTC (permalink / raw)
To: nicolas.dichtel; +Cc: netdev, herbert
In-Reply-To: <1410941288-1880-1-git-send-email-nicolas.dichtel@6wind.com>
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 17 Sep 2014 10:08:08 +0200
> Since commit 412ca1550cbe ("macvlan: Move broadcasts into a work queue"), the
> driver uses tx_queue_len of the master device as the limit of packets enqueuing.
> Problem is that virtual drivers have this value set to 0, thus all broadcast
> packets were rejected.
> Because tx_queue_len was arbitrarily chosen, I replace it with a static limit
> of 1000 (also arbitrarily chosen).
>
> CC: Herbert Xu <herbert@gondor.apana.org.au>
> Reported-by: Thibaut Collet <thibaut.collet@6wind.com>
> Suggested-by: Thibaut Collet <thibaut.collet@6wind.com>
> Tested-by: Thibaut Collet <thibaut.collet@6wind.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Herbert please review.
^ permalink raw reply
* Re: [PATCH net-next] tcp: do not fake tcp headers in tcp_send_rcvq()
From: David Miller @ 2014-09-19 20:04 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, xemul, ncardwell
In-Reply-To: <1410948882.7106.212.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 17 Sep 2014 03:14:42 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> Now we no longer rely on having tcp headers for skbs in receive queue,
> tcp repair do not need to build fake ones.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply
* [PATCH net-next v2 0/8] net: phy: Broadcom BCM7xxx PHY workaround update
From: Florian Fainelli @ 2014-09-19 20:07 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
Hi David,
This patch sets the change to of_phy_connect() that you have seen before,
this time with the full context of why it is useful and applicable here.
Due to some design decision, the internal PHY on Broadcom BCM7xxx chips
is not entirely self contained and does not report its internal revision
through MII_PHYSID2, that is left to external PHY designs.
This forces us to get the PHY revision from the GENET and SF2 switch drivers
because those two peripherals integrate such a PHY and do contain the PHY
revision in their registers.
The approach taken here is hopefully easy to extend to similar needs for
other chips/ as well.
Thanks!
Florian Fainelli (8):
of: mdio: honor flags passed to of_phy_connect
net: phy: broadcom: add helper for PHY revision and patch level
net: phy: bcm7xxx: do not use PHY_BRCM_100MBPS_WAR
net: bcmgenet: remove PHY_BRCM_100MBPS_WAR
net: bcmgenet: communicate integrated PHY revision to PHY driver
net: dsa: allow switch drivers to specify phy_device::dev_flags
net: dsa: bcm_sf2: communicate integrated PHY revision to PHY driver
net: phy: bcm7xxx: utilize PHY revision in config_init
drivers/net/dsa/bcm_sf2.c | 16 ++++++++++++++++
drivers/net/dsa/bcm_sf2.h | 1 +
drivers/net/dsa/bcm_sf2_regs.h | 1 +
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 7 +++++++
drivers/net/ethernet/broadcom/genet/bcmgenet.h | 1 +
drivers/net/ethernet/broadcom/genet/bcmmii.c | 18 ++++++------------
drivers/net/phy/bcm7xxx.c | 25 +++++++++++++++++--------
drivers/of/of_mdio.c | 2 ++
include/linux/brcmphy.h | 3 ++-
include/net/dsa.h | 1 +
net/dsa/slave.c | 9 ++++++++-
11 files changed, 62 insertions(+), 22 deletions(-)
--
1.9.1
^ permalink raw reply
* [PATCH net-next v2 1/8] of: mdio: honor flags passed to of_phy_connect
From: Florian Fainelli @ 2014-09-19 20:07 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1411157276-18260-1-git-send-email-f.fainelli@gmail.com>
Commit f9a8f83b04e0 ("net: phy: remove flags argument from phy_{attach,
connect, connect_direct}") removed the flags argument to the PHY library
calls to: phy_{attach,connect,connect_direct}.
Most Device Tree aware drivers call of_phy_connect() with the flag
argument set to 0, but some of them might want to set a different value
there in order for the PHY driver to key a specific behavior based on
the phy_device::phy_flags value.
Allow such drivers to set custom phy_flags as part of the
of_phy_connect() call since of_phy_connect() does start the PHY state
machine, it will call into the PHY driver config_init() callback which
is usually where a specific phy_flags value is important.
Fixes: f9a8f83b04e0 ("net: phy: remove flags argument from phy_{attach, connect, connect_direct}")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/of/of_mdio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index 401b2453da45..a85d80012993 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -224,6 +224,8 @@ struct phy_device *of_phy_connect(struct net_device *dev,
if (!phy)
return NULL;
+ phy->dev_flags = flags;
+
return phy_connect_direct(dev, phy, hndlr, iface) ? NULL : phy;
}
EXPORT_SYMBOL(of_phy_connect);
--
1.9.1
^ permalink raw reply related
* [PATCH net-next v2 2/8] net: phy: broadcom: add helper for PHY revision and patch level
From: Florian Fainelli @ 2014-09-19 20:07 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1411157276-18260-1-git-send-email-f.fainelli@gmail.com>
The Broadcom BCM7xxx internal PHYs do not contain any useful revision
information in the low 4-bits of their MII_PHYSID2 (MII register 3)
which could allow us to properly identify them.
As a result, we need the actual hardware block integrating these PHYs:
GENET or the SF2 switch to tell us what revision they are built with. To
assist with that, add two helper macros for fetching the the PHY
revision and patch level from the struct phy_device::dev_flags.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
include/linux/brcmphy.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 5bd35cc0d471..e4ee9c6679e8 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -41,6 +41,8 @@
#define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000
/* Broadcom BCM7xxx specific workarounds */
#define PHY_BRCM_100MBPS_WAR 0x00010000
+#define PHY_BRCM_7XXX_REV(x) (((x) >> 8) & 0xff)
+#define PHY_BRCM_7XXX_PATCH(x) ((x) & 0xff)
#define PHY_BCM_FLAGS_VALID 0x80000000
/* Broadcom BCM54XX register definitions, common to most Broadcom PHYs */
--
1.9.1
^ permalink raw reply related
* [PATCH net-next v2 3/8] net: phy: bcm7xxx: do not use PHY_BRCM_100MBPS_WAR
From: Florian Fainelli @ 2014-09-19 20:07 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1411157276-18260-1-git-send-email-f.fainelli@gmail.com>
There is no need for the PHY driver to check PHY_BRCM_100MBPS_WAR since
that is redundant with checking the PHY device supported features. Get
rid of that workaround flag.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/bcm7xxx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index 09dd6e1dc6e1..be3a591aabba 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -257,8 +257,8 @@ static int bcm7xxx_config_init(struct phy_device *phydev)
phy_write(phydev, MII_BCM7XXX_AUX_MODE, MII_BCM7XX_64CLK_MDIO);
phy_read(phydev, MII_BCM7XXX_AUX_MODE);
- /* Workaround only required for 100Mbits/sec */
- if (!(phydev->dev_flags & PHY_BRCM_100MBPS_WAR))
+ /* Workaround only required for 100Mbits/sec capable PHYs */
+ if (phydev->supported & PHY_GBIT_FEATURES)
return 0;
/* set shadow mode 2 */
--
1.9.1
^ permalink raw reply related
* [PATCH net-next v2 4/8] net: bcmgenet: remove PHY_BRCM_100MBPS_WAR
From: Florian Fainelli @ 2014-09-19 20:07 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1411157276-18260-1-git-send-email-f.fainelli@gmail.com>
Now that we have removed the need for the PHY_BRCM_100MBPS_WAR flag, we
can remove it from the GENET driver and the broadcom shared header file.
The PHY driver checks the PHY supported bitmask instead.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/genet/bcmmii.c | 10 ----------
include/linux/brcmphy.h | 1 -
2 files changed, 11 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index c88f7ae99636..71f2ef7d33a9 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -296,7 +296,6 @@ static int bcmgenet_mii_probe(struct net_device *dev)
struct bcmgenet_priv *priv = netdev_priv(dev);
struct device_node *dn = priv->pdev->dev.of_node;
struct phy_device *phydev;
- unsigned int phy_flags;
int ret;
if (priv->phydev) {
@@ -338,15 +337,6 @@ static int bcmgenet_mii_probe(struct net_device *dev)
return ret;
}
- phy_flags = PHY_BRCM_100MBPS_WAR;
-
- /* workarounds are only needed for 100Mpbs PHYs, and
- * never on GENET V1 hardware
- */
- if ((phydev->supported & PHY_GBIT_FEATURES) || GENET_IS_V1(priv))
- phy_flags = 0;
-
- phydev->dev_flags |= phy_flags;
phydev->advertising = phydev->supported;
/* The internal PHY has its link interrupts routed to the
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index e4ee9c6679e8..3f626fe48c9a 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -40,7 +40,6 @@
#define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000
#define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000
/* Broadcom BCM7xxx specific workarounds */
-#define PHY_BRCM_100MBPS_WAR 0x00010000
#define PHY_BRCM_7XXX_REV(x) (((x) >> 8) & 0xff)
#define PHY_BRCM_7XXX_PATCH(x) ((x) & 0xff)
#define PHY_BCM_FLAGS_VALID 0x80000000
--
1.9.1
^ permalink raw reply related
* [PATCH net-next v2 5/8] net: bcmgenet: communicate integrated PHY revision to PHY driver
From: Florian Fainelli @ 2014-09-19 20:07 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1411157276-18260-1-git-send-email-f.fainelli@gmail.com>
The integrated BCM7xxx PHY contains no useful revision information in
its MII_PHYSID2 bits 3:0, that information is instead contained in the
GENET hardware block.
We already read the GENET 32-bit revision register, so store the
integrated PHY revision in the driver private structure, and then
communicate this revision value to the PHY driver by overriding the
phy_flags value.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 7 +++++++
drivers/net/ethernet/broadcom/genet/bcmgenet.h | 1 +
drivers/net/ethernet/broadcom/genet/bcmmii.c | 8 ++++++--
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 3f9d4de8173c..a12c65604f9d 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2432,6 +2432,13 @@ static void bcmgenet_set_hw_params(struct bcmgenet_priv *priv)
dev_info(&priv->pdev->dev, "GENET " GENET_VER_FMT,
major, (reg >> 16) & 0x0f, reg & 0xffff);
+ /* Store the integrated PHY revision for the MDIO probing function
+ * to pass this information to the PHY driver. The PHY driver expects
+ * to find the PHY major revision in bits 15:8 while the GENET register
+ * stores that information in bits 7:0, account for that.
+ */
+ priv->gphy_rev = (reg & 0xffff) << 8;
+
#ifdef CONFIG_PHYS_ADDR_T_64BIT
if (!(params->flags & GENET_HAS_40BITS))
pr_warn("GENET does not support 40-bits PA\n");
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
index c862d0666771..ad95fe57ebcd 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
@@ -545,6 +545,7 @@ struct bcmgenet_priv {
struct phy_device *phydev;
struct device_node *phy_dn;
struct mii_bus *mii_bus;
+ u16 gphy_rev;
/* PHY device variables */
int old_duplex;
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 71f2ef7d33a9..75b26cbaa7c1 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -296,6 +296,7 @@ static int bcmgenet_mii_probe(struct net_device *dev)
struct bcmgenet_priv *priv = netdev_priv(dev);
struct device_node *dn = priv->pdev->dev.of_node;
struct phy_device *phydev;
+ u32 phy_flags;
int ret;
if (priv->phydev) {
@@ -314,8 +315,11 @@ static int bcmgenet_mii_probe(struct net_device *dev)
priv->phy_dn = of_node_get(dn);
}
- phydev = of_phy_connect(dev, priv->phy_dn, bcmgenet_mii_setup, 0,
- priv->phy_interface);
+ /* Communicate the integrated PHY revision */
+ phy_flags = priv->gphy_rev;
+
+ phydev = of_phy_connect(dev, priv->phy_dn, bcmgenet_mii_setup,
+ phy_flags, priv->phy_interface);
if (!phydev) {
pr_err("could not attach to PHY\n");
return -ENODEV;
--
1.9.1
^ permalink raw reply related
* [PATCH net-next v2 6/8] net: dsa: allow switch drivers to specify phy_device::dev_flags
From: Florian Fainelli @ 2014-09-19 20:07 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1411157276-18260-1-git-send-email-f.fainelli@gmail.com>
Some switch drivers (e.g: bcm_sf2) may have to communicate specific
workarounds or flags towards the PHY device driver. Allow switches
driver to be delegated that task by introducing a get_phy_flags()
callback which will do just that.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v2:
- fixed the build failure, use 'p->port' instead of 'port'
include/net/dsa.h | 1 +
net/dsa/slave.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/net/dsa.h b/include/net/dsa.h
index c779e9bba1b3..e020b8a12b7d 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -181,6 +181,7 @@ struct dsa_switch_driver {
char *(*probe)(struct device *host_dev, int sw_addr);
int (*setup)(struct dsa_switch *ds);
int (*set_addr)(struct dsa_switch *ds, u8 *addr);
+ u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
/*
* Access to the switch's PHY registers.
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 90c9689ed362..a7997265019a 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -371,6 +371,7 @@ static void dsa_slave_phy_setup(struct dsa_slave_priv *p,
struct dsa_chip_data *cd = ds->pd;
struct device_node *phy_dn, *port_dn;
bool phy_is_fixed = false;
+ u32 phy_flags = 0;
int ret;
port_dn = cd->port_dn[p->port];
@@ -390,9 +391,12 @@ static void dsa_slave_phy_setup(struct dsa_slave_priv *p,
phy_dn = port_dn;
}
+ if (ds->drv->get_phy_flags)
+ phy_flags = ds->drv->get_phy_flags(ds, p->port);
+
if (phy_dn)
p->phy = of_phy_connect(slave_dev, phy_dn,
- dsa_slave_adjust_link, 0,
+ dsa_slave_adjust_link, phy_flags,
p->phy_interface);
if (p->phy && phy_is_fixed)
@@ -480,6 +484,9 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
netif_carrier_off(slave_dev);
if (p->phy != NULL) {
+ if (ds->drv->get_phy_flags(ds, port))
+ p->phy->dev_flags |= ds->drv->get_phy_flags(ds, port);
+
phy_attach(slave_dev, dev_name(&p->phy->dev),
PHY_INTERFACE_MODE_GMII);
--
1.9.1
^ permalink raw reply related
* [PATCH net-next v2 7/8] net: dsa: bcm_sf2: communicate integrated PHY revision to PHY driver
From: Florian Fainelli @ 2014-09-19 20:07 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1411157276-18260-1-git-send-email-f.fainelli@gmail.com>
The integrated BCM7xxx PHY contains no useful revision information
in its MII_PHYSID2 bits 3:0, that information is instead contained in
the SWITCH_REG_PHY_REVISION register.
Read this register, store its value, and return it by implementing the
dsa_switch::get_phy_flags() callback accordingly. The register layout is
already matching what the BCM7xxx PHY driver is expecting to find.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2.c | 16 ++++++++++++++++
drivers/net/dsa/bcm_sf2.h | 1 +
drivers/net/dsa/bcm_sf2_regs.h | 1 +
3 files changed, 18 insertions(+)
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 02d7db320d90..a97ba2548ea5 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -376,6 +376,9 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)
SWITCH_TOP_REV_MASK;
priv->hw_params.core_rev = (rev & SF2_REV_MASK);
+ rev = reg_readl(priv, REG_PHY_REVISION);
+ priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK;
+
pr_info("Starfighter 2 top: %x.%02x, core: %x.%02x base: 0x%p, IRQs: %d, %d\n",
priv->hw_params.top_rev >> 8, priv->hw_params.top_rev & 0xff,
priv->hw_params.core_rev >> 8, priv->hw_params.core_rev & 0xff,
@@ -399,6 +402,18 @@ static int bcm_sf2_sw_set_addr(struct dsa_switch *ds, u8 *addr)
return 0;
}
+static u32 bcm_sf2_sw_get_phy_flags(struct dsa_switch *ds, int port)
+{
+ struct bcm_sf2_priv *priv = ds_to_priv(ds);
+
+ /* The BCM7xxx PHY driver expects to find the integrated PHY revision
+ * in bits 15:8 and the patch level in bits 7:0 which is exactly what
+ * the REG_PHY_REVISION register layout is.
+ */
+
+ return priv->hw_params.gphy_rev;
+}
+
static int bcm_sf2_sw_indir_rw(struct dsa_switch *ds, int op, int addr,
int regnum, u16 val)
{
@@ -597,6 +612,7 @@ static struct dsa_switch_driver bcm_sf2_switch_driver = {
.probe = bcm_sf2_sw_probe,
.setup = bcm_sf2_sw_setup,
.set_addr = bcm_sf2_sw_set_addr,
+ .get_phy_flags = bcm_sf2_sw_get_phy_flags,
.phy_read = bcm_sf2_sw_phy_read,
.phy_write = bcm_sf2_sw_phy_write,
.get_strings = bcm_sf2_sw_get_strings,
diff --git a/drivers/net/dsa/bcm_sf2.h b/drivers/net/dsa/bcm_sf2.h
index 260bab313e58..d3bd52dc40d2 100644
--- a/drivers/net/dsa/bcm_sf2.h
+++ b/drivers/net/dsa/bcm_sf2.h
@@ -26,6 +26,7 @@
struct bcm_sf2_hw_params {
u16 top_rev;
u16 core_rev;
+ u16 gphy_rev;
u32 num_gphy;
u8 num_acb_queue;
u8 num_rgmii;
diff --git a/drivers/net/dsa/bcm_sf2_regs.h b/drivers/net/dsa/bcm_sf2_regs.h
index 885c231b03b5..c65f138c777f 100644
--- a/drivers/net/dsa/bcm_sf2_regs.h
+++ b/drivers/net/dsa/bcm_sf2_regs.h
@@ -25,6 +25,7 @@
#define SWITCH_TOP_REV_MASK 0xffff
#define REG_PHY_REVISION 0x1C
+#define PHY_REVISION_MASK 0xffff
#define REG_SPHY_CNTRL 0x2C
#define IDDQ_BIAS (1 << 0)
--
1.9.1
^ permalink raw reply related
* [PATCH net-next v2 8/8] net: phy: bcm7xxx: utilize PHY revision in config_init
From: Florian Fainelli @ 2014-09-19 20:07 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1411157276-18260-1-git-send-email-f.fainelli@gmail.com>
Now that the GENET and SF2 drivers have been updated to communicate us
what is the revision of the BCM7xxx integrated PHY, utilize that
information in the config_init() callback to call into the appropriate
workaround function based on our revision.
While at it, we also print the revision and patch level to help debug
new chips.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/bcm7xxx.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index be3a591aabba..daae69950925 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -196,13 +196,22 @@ static int bcm7xxx_eee_enable(struct phy_device *phydev)
static int bcm7xxx_28nm_config_init(struct phy_device *phydev)
{
- int ret;
-
- ret = bcm7445_config_init(phydev);
- if (ret)
- return ret;
+ u8 rev = PHY_BRCM_7XXX_REV(phydev->dev_flags);
+ u8 patch = PHY_BRCM_7XXX_PATCH(phydev->dev_flags);
+ int ret = 0;
+
+ dev_info(&phydev->dev, "PHY revision: 0x%02x, patch: %d\n", rev, patch);
+
+ switch (rev) {
+ case 0xa0:
+ case 0xb0:
+ ret = bcm7445_config_init(phydev);
+ break;
+ default:
+ ret = bcm7xxx_28nm_afe_config_init(phydev);
+ break;
+ }
- ret = bcm7xxx_28nm_afe_config_init(phydev);
if (ret)
return ret;
--
1.9.1
^ permalink raw reply related
* cannot ARP macvlan on top of bonding device
From: Francesco Ruggeri @ 2014-09-19 7:03 UTC (permalink / raw)
To: netdev; +Cc: fruggeri, davem, herbert
Ping in the following test fails:
# Create veth pair v1 v2
ip link add v1 type veth peer name v2
# Stack macvlan on top of bonding device on top of v1
ip link set v1 up
ip link add bond1 type bond
ip link set bond1 up
ifenslave bond1 v1
ip link add link bond1 name mac1 type macvlan mode bridge
ip link set mac1 up
ifconfig mac1 1.2.3.1/24
# Move v2 to namespace dummy2 and ping v1
ip netns add dummy2
ip link set v2 netns dummy2
ip netns exec dummy2 bash
ip link set lo up
ip link set v2 up
ifconfig v2 1.2.3.2/24
ping 1.2.3.1 -c 5
# Clean up
exit
ip netns del dummy2
ip link del bond
It passes on older releases.
The problem is that txqueuelen in bond1 is 0, and ARP requests are dropped in macvlan_broadcast_enqueue at:
if (skb_queue_len(&port->bc_queue) < skb->dev->tx_queue_len) {
__skb_queue_tail(&port->bc_queue, nskb);
err = 0;
}
where
port->dev = skb->dev = "bond1"
skb_queue_len(&port->bc_queue) = skb->dev->tx_queue_len = 0
macvlan_broadcast_enqueue was introduced in 412ca1550 (macvlan: Move broadcasts into a work queue).
Why are we using tx_queue_len to limit an rx queue?
Thanks,
Francesco Ruggeri
^ permalink raw reply
* Waiting to hear from you
From: Dr. Nonaka Takashi @ 2014-09-19 20:43 UTC (permalink / raw)
Waiting to hear from you
I am Dr. Nonaka Takashi. (Head of Internal Audit Group, Deputy President,
Executive Officer and Director of Mizuho Trust & Banking Co., Ltd), Japan.
I have a lucrative business proposal of mutual interest to share with you,
If you are interested in working with me, contact me through my private
Email; ( nonakatak@aol.jp ) for further details
Kind Regards
Dr. Nonaka Takashi
E-mail: nonakatak@aol.jp
^ permalink raw reply
* Re: [PATCH net-next] net: add alloc_skb_with_frags() helper
From: David Miller @ 2014-09-19 20:25 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1410954589.7106.227.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 17 Sep 2014 04:49:49 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> Extract from sock_alloc_send_pskb() code building skb with frags,
> so that we can reuse this in other contexts.
>
> Intent is to use it from tcp_send_rcvq(), tcp_collapse(), ...
>
> We also want to replace some skb_linearize() calls to a more reliable
> strategy in pathological cases where we need to reduce number of frags.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Looks good, applied.
^ permalink raw reply
* Re: [PATCH net-next v2 0/8] net: phy: Broadcom BCM7xxx PHY workaround update
From: David Miller @ 2014-09-19 20:27 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev
In-Reply-To: <1411157276-18260-1-git-send-email-f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 19 Sep 2014 13:07:48 -0700
> This patch sets the change to of_phy_connect() that you have seen before,
> this time with the full context of why it is useful and applicable here.
>
> Due to some design decision, the internal PHY on Broadcom BCM7xxx chips
> is not entirely self contained and does not report its internal revision
> through MII_PHYSID2, that is left to external PHY designs.
>
> This forces us to get the PHY revision from the GENET and SF2 switch drivers
> because those two peripherals integrate such a PHY and do contain the PHY
> revision in their registers.
>
> The approach taken here is hopefully easy to extend to similar needs for
> other chips/ as well.
Applied, thanks for fixing things up so fast.
^ permalink raw reply
* Re: [PATCH 1/2] 3c59x: Add dma error checking and recovery
From: David Miller @ 2014-09-19 20:29 UTC (permalink / raw)
To: nhorman; +Cc: netdev, linux-kernel, mroos
In-Reply-To: <1410959085-7351-1-git-send-email-nhorman@tuxdriver.com>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Wed, 17 Sep 2014 09:04:44 -0400
> Noted that 3c59x has no checks on transmit for failed DMA mappings, and no
> ability to unmap fragments when a single map fails in the middle of a transmit.
> This patch provides error checking to ensure that dma mappings work properly,
> and unrolls an skb mapping if a fragmented skb transmission has a mapping
> failure to prevent leaks.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Linux Kernel list <linux-kernel@vger.kernel.org>
> CC: "David S. Miller" <davem@davemloft.net>
> CC: Meelis Roos <mroos@linux.ee>
> Tested-by: Meelis Roos <mroos@linux.ee>
Applied.
^ permalink raw reply
* Re: [PATCH 2/2] 3c59x: Fix bad offset spec in skb_frag_dma_map
From: David Miller @ 2014-09-19 20:29 UTC (permalink / raw)
To: nhorman; +Cc: netdev, linux-kernel, mroos
In-Reply-To: <1410959085-7351-2-git-send-email-nhorman@tuxdriver.com>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Wed, 17 Sep 2014 09:04:45 -0400
> Recently aded the use of skb_frag_dma_map to 3c59x, but didn't realize it
> automatically included the frag_offset internally, as well as provided an option
> to specify an extra offset in the parameter list. We need to specify an offset
> of 0 in the parameter list to avoid skb corruption that results in lost
> connections.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Linux Kernel list <linux-kernel@vger.kernel.org>
> CC: "David S. Miller" <davem@davemloft.net>
> CC: Meelis Roos <mroos@linux.ee>
> Tested-by: Meelis Roos <mroos@linux.ee>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 0/3] bnx2x: Support new Multi-function modes
From: David Miller @ 2014-09-19 20:31 UTC (permalink / raw)
To: Yuval.Mintz; +Cc: netdev, Ariel.Elior
In-Reply-To: <1410960278-32064-1-git-send-email-Yuval.Mintz@qlogic.com>
From: Yuval Mintz <Yuval.Mintz@qlogic.com>
Date: Wed, 17 Sep 2014 16:24:35 +0300
> This patch series adds support for 2 new Multi-function modes -
> Unified Fabric Port [UFP] as well as nic partitioning 1.5 [NPAR1.5].
>
> With the addition of the new multi-function modes, the series also
> revises some of the storage-related multi-function macros.
>
> [Do notice this series has several small issues with checkpatch]
Series applied, thanks Yuval.
^ permalink raw reply
* Re: [PATCH net-next] net: sched: use __skb_queue_head_init() where applicable
From: David Miller @ 2014-09-19 20:32 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1410966305.7106.238.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 17 Sep 2014 08:05:05 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> pfifo_fast and htb use skb lists, without needing their spinlocks.
> (They instead use the standard qdisc lock)
>
> We can use __skb_queue_head_init() instead of skb_queue_head_init()
> to be consistent.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply
* Re: pull request: wireless 2014-09-17
From: David Miller @ 2014-09-19 20:33 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20140917152300.GB13392@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Wed, 17 Sep 2014 11:23:01 -0400
> Please pull this batch of fixes intended for the 3.17 stream...
>
> Arend van Spriel sends a trio of minor brcmfmac fixes, including a
> fix for a Kconfig/build issue, a fix for a crash (null reference),
> and a regression fix related to event handling on a P2P interface.
>
> Hante Meuleman follows-up with a brcmfmac fix for a memory leak.
>
> Johannes Stezenbach brings an ath9k_htc fix for a regression related
> to hardware decryption offload.
>
> Marcel Holtmann delivers a one-liner to properly mark a device ID
> table in rfkill-gpio.
>
> Please let me know if there are problems!
Pulled, thanks John.
^ permalink raw reply
* [RFC net-next PATCH V3 0/2] qdisc bulk dequeuing and utilizing delayed tailptr updates
From: Jesper Dangaard Brouer @ 2014-09-19 20:49 UTC (permalink / raw)
To: Jesper Dangaard Brouer, netdev, David S. Miller, Tom Herbert,
Eric Dumazet, Hannes Frederic Sowa, Florian Westphal,
Daniel Borkmann
Cc: Jamal Hadi Salim, Alexander Duyck, John Fastabend, Dave Taht,
toke
This patchset uses DaveM's recent API changes to dev_hard_start_xmit(),
from the qdisc layer, to implement dequeue bulking.
RFC V3: Keeping the ball rolling.
This patchset should now use BQL correctly. I've done lots of testing
for Head-of-Line blocking issues that can occur due to requeue of a
SKB bulk list. I've not been able to provoke any HoL blocking
situation, simply because BQL is doing such a good job, thus I'm
unable to "overshoot" HW/BQL limits with more than a single packet.
This patch chooses a very conservative approach, as by default only
allowing dequeue of one extra packet, besides the normal dequeue.
Open questions:
- How do we expose tuning to userspace?
Patch adds /proc/sys/net/core/qdisc_bulk_dequeue_limit but I don't like it...
Per device tunable?
- Can/should we limit dequeue bulking to devices supporting BQL?
Based on top of net-next:
commit cb93471acc (tcp: do not fake tcp headers in tcp_send_rcvq())
---
Jesper Dangaard Brouer (1):
qdisc: bulk dequeue support for qdiscs with TCQ_F_ONETXQUEUE
Tom Herbert (1):
net: Functions to report space available in device TX queues
include/linux/netdevice.h | 28 ++++++++++++++++--
include/net/sch_generic.h | 2 +
net/core/sysctl_net_core.c | 9 ++++++
net/sched/sch_generic.c | 70 ++++++++++++++++++++++++++++++++++++++++++--
4 files changed, 104 insertions(+), 5 deletions(-)
--
^ permalink raw reply
* [RFC net-next PATCH V3 1/2] net: Functions to report space available in device TX queues
From: Jesper Dangaard Brouer @ 2014-09-19 20:49 UTC (permalink / raw)
To: Jesper Dangaard Brouer, netdev, David S. Miller, Tom Herbert,
Eric Dumazet, Hannes Frederic Sowa, Florian Westphal,
Daniel Borkmann
Cc: Jamal Hadi Salim, Alexander Duyck, John Fastabend, Dave Taht,
toke
In-Reply-To: <20140919204706.3231.59125.stgit@dragon>
From: Tom Herbert <therbert@google.com>
This patch adds netdev_tx_avail_queue and netdev_avail_queue which are
used to report number of bytes available in transmit queues per BQL. The
functions call dql_avail which returns BQL limit minus number of
inflight bytes. These functions can be called without txlock, for
instance to ascertain how much data should be dequeued from a qdisc in
a batch. When called without the tx_lock, the result is technically a
hint, subsequently when the tx_lock is done for a transmit it is
possible the availability has changed (for example a transmit
completion may have freed up more space in the queue or changed the
limit).
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
- Fixed spelling in comments
include/linux/netdevice.h | 28 ++++++++++++++++++++++++++--
1 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 28d4378..b12b919 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2551,6 +2551,30 @@ static inline void netdev_completed_queue(struct net_device *dev,
netdev_tx_completed_queue(netdev_get_tx_queue(dev, 0), pkts, bytes);
}
+static inline int netdev_tx_avail_queue(struct netdev_queue *dev_queue)
+{
+#ifdef CONFIG_BQL
+ return dql_avail(&dev_queue->dql);
+#else
+ return DQL_MAX_LIMIT;
+#endif
+}
+
+/**
+ * netdev_avail_queue - report how much space is available for xmit
+ * @dev: network device
+ *
+ * Report the amount of space available in the TX queue in terms of
+ * number of bytes. This returns the number of bytes available per
+ * DQL. This function may be called without taking the txlock on
+ * the device, however in that case the result should be taken as
+ * a (strong) hint.
+ */
+static inline int netdev_avail_queue(struct net_device *dev)
+{
+ return netdev_tx_avail_queue(netdev_get_tx_queue(dev, 0));
+}
+
static inline void netdev_tx_reset_queue(struct netdev_queue *q)
{
#ifdef CONFIG_BQL
@@ -2566,9 +2590,9 @@ static inline void netdev_tx_reset_queue(struct netdev_queue *q)
* Reset the bytes and packet count of a network device and clear the
* software flow control OFF bit for this network device
*/
-static inline void netdev_reset_queue(struct net_device *dev_queue)
+static inline void netdev_reset_queue(struct net_device *dev)
{
- netdev_tx_reset_queue(netdev_get_tx_queue(dev_queue, 0));
+ netdev_tx_reset_queue(netdev_get_tx_queue(dev, 0));
}
/**
^ 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