Netdev List
 help / color / mirror / Atom feed
* Re: [net-next v2 3/3] cfg80211: add MPLS and 802.21 classification
From: Arend van Spriel @ 2014-02-17 17:30 UTC (permalink / raw)
  To: Simon Wunderlich
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	mathias.kretschmer-8LS2qeF34IpklNlQbfROjRvVK+yQ3ZXh
In-Reply-To: <1392656174-14791-4-git-send-email-sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org>

On 02/17/14 17:56, Simon Wunderlich wrote:
> MPLS labels may contain traffic control information, which should be
> evaluated and used by the wireless subsystem if present.
>
> Also check for IEEE 802.21 which is always network control traffic.
>
> Signed-off-by: Simon Wunderlich<sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org>
> Signed-off-by: Mathias Kretschmer<mathias.kretschmer-8LS2qeF34IpklNlQbfROjRvVK+yQ3ZXh@public.gmane.org>
> ---
> Changes to first version:
>
>   * include linux/mpls.h, not the UAPI one
>   * change __constant_htons to htons
> ---
>   net/wireless/util.c |   24 ++++++++++++++++++++++++
>   1 file changed, 24 insertions(+)
>
> diff --git a/net/wireless/util.c b/net/wireless/util.c
> index d39c371..54956eb 100644
> --- a/net/wireless/util.c
> +++ b/net/wireless/util.c
> @@ -11,6 +11,7 @@
>   #include<net/ip.h>
>   #include<net/dsfield.h>
>   #include<linux/if_vlan.h>
> +#include<linux/mpls.h>
>   #include "core.h"
>   #include "rdev-ops.h"
>
> @@ -710,6 +711,29 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb,

So does the name still covers what it is doing now or should we just 
callit cfg80211_classify_skb()?

>   			return vlan_priority;
>   	}
>
> +	if (skb_headlen(skb)>= sizeof(struct ethhdr)) {
> +		struct ethhdr *eh = (struct ethhdr *)skb->data;
> +		struct mpls_label_stack mpls_tmp, *mpls;
> +
> +		switch (eh->h_proto) {

It seem eh->h_proto should be the same as skb->protocol, right? So why 
not add these case statements to the switch below?

Regards,
Arend

> +		case htons(ETH_P_MPLS_UC):
> +		case htons(ETH_P_MPLS_MC):
> +			/* MPLS */
> +			mpls = skb_header_pointer(skb, sizeof(*eh),
> +						  sizeof(*mpls),&mpls_tmp);
> +			if (!mpls)
> +				break;
> +
> +			return (ntohl(mpls->entry)&  MPLS_LS_TC_MASK)
> +				>>  MPLS_LS_TC_SHIFT;
> +		case htons(ETH_P_80221):
> +			/* 802.21 is always network control traffic */
> +			return 7;
> +		default:
> +			break;
> +		}
> +	}
> +
>   	switch (skb->protocol) {
>   	case htons(ETH_P_IP):
>   		dscp = ipv4_get_dsfield(ip_hdr(skb))&  0xfc;

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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] of_mdio: fix phy interrupt passing
From: Florian Fainelli @ 2014-02-17 17:26 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Grant Likely, linux-kernel, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev, Linux-sh list,
	Sergei Shtylyov
In-Reply-To: <1392654580-3706-1-git-send-email-ben.dooks@codethink.co.uk>

Hi Ben,

2014-02-17 8:29 GMT-08:00 Ben Dooks <ben.dooks@codethink.co.uk>:
> The of_mdiobus_register_phy() is not setting phy->irq this causing
> some drivers to incorrectly assume that the PHY does not have an
> IRQ associated with it or install an interrupt handler for the
> PHY.
>
> Simplify the code setting irq and set the phy->irq at the same
> time so that the case if mdio->irq is not NULL is easier to read.

The real bug fix, which is not properly explained here, is that
irq_of_parse_and_map() should return values > 0 when the interrupt is
valid, so this makes me wonder why we are not propagating the return
value from irq_of_parse_and_map() in case the call to
of_irq_parse_one() does return something non-zero?

Other than that, I agree with the resolution, but it deserves a better
commit message, and eventually doing this in two steps:

- first fix the bug by changing the if (!mdio->irq[addr]) into a if
(mdio->irq[addr] <= 0)
- second submit a patch which cleanups the assignment

>
> This fixes the issue:
>  net eth0: attached PHY 1 (IRQ -1) to driver Micrel KSZ8041RNLI
>
> to the correct:
>  net eth0: attached PHY 1 (IRQ 416) to driver Micrel KSZ8041RNLI
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>  drivers/of/of_mdio.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
> index 875b7b6..7b3e7b0 100644
> --- a/drivers/of/of_mdio.c
> +++ b/drivers/of/of_mdio.c
> @@ -44,7 +44,7 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi
>  {
>         struct phy_device *phy;
>         bool is_c45;
> -       int rc, prev_irq;
> +       int rc;
>         u32 max_speed = 0;
>
>         is_c45 = of_device_is_compatible(child,
> @@ -55,11 +55,11 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi
>                 return 1;
>
>         if (mdio->irq) {
> -               prev_irq = mdio->irq[addr];
> -               mdio->irq[addr] =
> -                       irq_of_parse_and_map(child, 0);
> -               if (!mdio->irq[addr])
> -                       mdio->irq[addr] = prev_irq;
> +               rc = irq_of_parse_and_map(child, 0);
> +               if (rc > 0) {
> +                       mdio->irq[addr] = rc;
> +                       phy->irq = rc;
> +               }
>         }
>
>         /* Associate the OF node with the device structure so it
> --
> 1.8.5.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Florian

^ permalink raw reply

* Re: [PATCH] ethtool: check the ethtool_ops is NULL in dev_ethtool
From: Daniel Borkmann @ 2014-02-17 17:09 UTC (permalink / raw)
  To: Wang Weidong; +Cc: David Miller, netdev
In-Reply-To: <5301F32C.4040704@huawei.com>

On 02/17/2014 12:31 PM, Wang Weidong wrote:
> some drivers maybe not implement the ethtool_ops with only
> set NULL. So when call the ethtool cmds will lead to a
> 'NULL pointer dereference'.
>
> So add a checking in dev_ethtool.
>
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
> ---
>   net/core/ethtool.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index 30071de..f418dcb 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -1499,6 +1499,9 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
>   		if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
>   			return -EPERM;
>   	}
> +	

You have a trailing whitespace/tab in the line above. Please
use checkpatch for detecting such things.

Can you be more specific with "some drivers"? Any driver that
is in the mainline tree?

> +	if (!dev->ethtool_ops)
> +		return -EOPNOTSUPP;
>
>   	if (dev->ethtool_ops->begin) {
>   		rc = dev->ethtool_ops->begin(dev);
>

^ permalink raw reply

* [net-next v2 3/3] cfg80211: add MPLS and 802.21 classification
From: Simon Wunderlich @ 2014-02-17 16:56 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-wireless, mathias.kretschmer, Simon Wunderlich
In-Reply-To: <1392656174-14791-1-git-send-email-sw@simonwunderlich.de>

MPLS labels may contain traffic control information, which should be
evaluated and used by the wireless subsystem if present.

Also check for IEEE 802.21 which is always network control traffic.

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
Changes to first version:

 * include linux/mpls.h, not the UAPI one
 * change __constant_htons to htons
---
 net/wireless/util.c |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index d39c371..54956eb 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -11,6 +11,7 @@
 #include <net/ip.h>
 #include <net/dsfield.h>
 #include <linux/if_vlan.h>
+#include <linux/mpls.h>
 #include "core.h"
 #include "rdev-ops.h"
 
@@ -710,6 +711,29 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb,
 			return vlan_priority;
 	}
 
+	if (skb_headlen(skb) >= sizeof(struct ethhdr)) {
+		struct ethhdr *eh = (struct ethhdr *)skb->data;
+		struct mpls_label_stack mpls_tmp, *mpls;
+
+		switch (eh->h_proto) {
+		case htons(ETH_P_MPLS_UC):
+		case htons(ETH_P_MPLS_MC):
+			/* MPLS */
+			mpls = skb_header_pointer(skb, sizeof(*eh),
+						  sizeof(*mpls), &mpls_tmp);
+			if (!mpls)
+				break;
+
+			return (ntohl(mpls->entry) & MPLS_LS_TC_MASK)
+				>> MPLS_LS_TC_SHIFT;
+		case htons(ETH_P_80221):
+			/* 802.21 is always network control traffic */
+			return 7;
+		default:
+			break;
+		}
+	}
+
 	switch (skb->protocol) {
 	case htons(ETH_P_IP):
 		dscp = ipv4_get_dsfield(ip_hdr(skb)) & 0xfc;
-- 
1.7.10.4

^ permalink raw reply related

* [net-next v2 2/3] UAPI: add MPLS label stack definition
From: Simon Wunderlich @ 2014-02-17 16:56 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-wireless, mathias.kretschmer, Simon Wunderlich
In-Reply-To: <1392656174-14791-1-git-send-email-sw@simonwunderlich.de>

Labels for the Multiprotocol Label Switching are defined in RFC 3032
which was superseded by RFC 5462. Add the definition to UAPI and a stub
header for include/linux.

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
Changes to first version:

 * add stub mpls header in include/linux/mpls.h for users inside the
   kernel
---
 include/linux/mpls.h      |    6 ++++++
 include/uapi/linux/mpls.h |   34 ++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 include/linux/mpls.h
 create mode 100644 include/uapi/linux/mpls.h

diff --git a/include/linux/mpls.h b/include/linux/mpls.h
new file mode 100644
index 0000000..9999145
--- /dev/null
+++ b/include/linux/mpls.h
@@ -0,0 +1,6 @@
+#ifndef _LINUX_MPLS_H
+#define _LINUX_MPLS_H
+
+#include <uapi/linux/mpls.h>
+
+#endif  /* _LINUX_MPLS_H */
diff --git a/include/uapi/linux/mpls.h b/include/uapi/linux/mpls.h
new file mode 100644
index 0000000..15c8260
--- /dev/null
+++ b/include/uapi/linux/mpls.h
@@ -0,0 +1,34 @@
+#ifndef _UAPI_MPLS_H
+#define _UAPI_MPLS_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+/* Reference: RFC 5462, RFC 3032
+ *
+ *  0                   1                   2                   3
+ *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |                Label                  | TC  |S|       TTL     |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ *	Label:  Label Value, 20 bits
+ *	TC:     Traffic Class field, 3 bits
+ *	S:      Bottom of Stack, 1 bit
+ *	TTL:    Time to Live, 8 bits
+ */
+
+struct mpls_label_stack {
+	__be32 entry;
+};
+
+#define MPLS_LS_LABEL_MASK      0xFFFFF000
+#define MPLS_LS_LABEL_SHIFT     12
+#define MPLS_LS_TC_MASK         0x00000E00
+#define MPLS_LS_TC_SHIFT        9
+#define MPLS_LS_S_MASK          0x00000100
+#define MPLS_LS_S_SHIFT         8
+#define MPLS_LS_TTL_MASK        0x000000FF
+#define MPLS_LS_TTL_SHIFT       0
+
+#endif /* _UAPI_MPLS_H */
-- 
1.7.10.4

^ permalink raw reply related

* [net-next v2 1/3] if_ether.h: add IEEE 802.21 Ethertype
From: Simon Wunderlich @ 2014-02-17 16:56 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	mathias.kretschmer-8LS2qeF34IpklNlQbfROjRvVK+yQ3ZXh,
	Simon Wunderlich
In-Reply-To: <1392656174-14791-1-git-send-email-sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org>

Add the Ethertype for IEEE Std 802.21 - Media Independent Handover
Protocol. This Ethertype is used for network control messages.

Signed-off-by: Simon Wunderlich <sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer-8LS2qeF34IpklNlQbfROjRvVK+yQ3ZXh@public.gmane.org>
---
 include/uapi/linux/if_ether.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index 2ce0f6a..2e27208 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -89,6 +89,7 @@
 #define ETH_P_FCOE	0x8906		/* Fibre Channel over Ethernet  */
 #define ETH_P_TDLS	0x890D          /* TDLS */
 #define ETH_P_FIP	0x8914		/* FCoE Initialization Protocol */
+#define ETH_P_80221	0x8917		/* IEEE 802.21 Media Independent Handover Protocol */
 #define ETH_P_QINQ1	0x9100		/* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
 #define ETH_P_QINQ2	0x9200		/* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
 #define ETH_P_QINQ3	0x9300		/* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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 related

* [net-next v2 0/3] 802.21 and MPLS headers and classification
From: Simon Wunderlich @ 2014-02-17 16:56 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	mathias.kretschmer-8LS2qeF34IpklNlQbfROjRvVK+yQ3ZXh,
	Simon Wunderlich

Hi,

this series contains a header file proposal for MPLS labels. These
labels do not seem to be properly defined in the kernel so far. We are
developing a wired/wireless 802.21/MPLS switch and need to check the
MPLS labels to use the traffic control info for transmissions over
802.11 networks.

Thanks to Joe Perches for comments - changes have been made according
to his suggestions, check the individual patches for details.

Thanks,
     Simon

Simon Wunderlich (3):
  if_ether.h: add IEEE 802.21 Ethertype
  UAPI: add MPLS label stack definition
  cfg80211: add MPLS and 802.21 classification

 include/linux/mpls.h          |    6 ++++++
 include/uapi/linux/if_ether.h |    1 +
 include/uapi/linux/mpls.h     |   34 ++++++++++++++++++++++++++++++++++
 net/wireless/util.c           |   24 ++++++++++++++++++++++++
 4 files changed, 65 insertions(+)
 create mode 100644 include/linux/mpls.h
 create mode 100644 include/uapi/linux/mpls.h

-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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: [Linux-kernel] [PATCH] sh_eth: call of_mdiobus_register() to register phys
From: Ben Dooks @ 2014-02-17 16:44 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-kernel, netdev, magnus, linux-sh, horms+renesas
In-Reply-To: <53022EE4.50607@codethink.co.uk>

On 17/02/14 15:46, Ben Dooks wrote:
> On 17/02/14 16:40, Sergei Shtylyo

[snip]

>
>>> +        return 0;
>>> +    }
>>> +
>>>       /* PHY IRQ */
>>>       mdp->mii_bus->irq = devm_kzalloc(&ndev->dev,
>>>                        sizeof(int) * PHY_MAX_ADDR,
>>>
>>
>>      Hm, I can only hope this works with PHY IRQ in DT mode.
>> Would you mind if I include your patch into my Ether DT patch?
>
> You are welcome to include it in your series, but I would like
> to keep the credit for finding this.
>
> Also, FYI, for some reason the probe is not finding the correct
> IRQ for this. I will have a look later when I get the board back
> as to why this is:
>
> net eth0: attached PHY 1 (IRQ -1) to driver Micrel KSZ8041RNLI

I've sent a fix for of_mdio to set phy->irq correctly and will
re-send this as a v2 patch shortly.

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

^ permalink raw reply

* Re: [PATCH] sh_eth: call of_mdiobus_register() to register phys
From: Sergei Shtylyov @ 2014-02-17 16:40 UTC (permalink / raw)
  To: Ben Dooks, netdev; +Cc: horms+renesas, linux-sh, magnus, linux-kernel
In-Reply-To: <1392650895-1422-1-git-send-email-ben.dooks@codethink.co.uk>

Hello.

On 02/17/2014 06:28 PM, Ben Dooks wrote:

> If the sh_eth device is registered using OF, then the driver

    Which is not supported yet as my DT patch hasn't been merged.
This patch seems somewhat premature.

> should call of_mdiobus_register() to register any PHYs connected
> to the system.

    That's not necessary (but good to have).

> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>   drivers/net/ethernet/renesas/sh_eth.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)

> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 06970ac..165f0c4 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
[...]
> @@ -2629,6 +2630,18 @@ static int sh_mdio_init(struct net_device *ndev, int id,
>   	snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
>   		 mdp->pdev->name, id);
>
> +	if (ndev->dev.parent->of_node) {
> +		dev_set_drvdata(&ndev->dev, mdp->mii_bus);
> +		ret = of_mdiobus_register(mdp->mii_bus,
> +					  ndev->dev.parent->of_node);
> +		if (ret != 0) {
> +			dev_err(&ndev->dev, "of_mdiobus_register() failed\n");
> +			goto out_free_bus;
> +		}
> +
> +		return 0;
> +	}
> +
>   	/* PHY IRQ */
>   	mdp->mii_bus->irq = devm_kzalloc(&ndev->dev,
>   					 sizeof(int) * PHY_MAX_ADDR,
>

     Hm, I can only hope this works with PHY IRQ in DT mode.
Would you mind if I include your patch into my Ether DT patch?

WBR, Sergei


^ permalink raw reply

* [PATCH] of_mdio: fix phy interrupt passing
From: Ben Dooks @ 2014-02-17 16:29 UTC (permalink / raw)
  To: grant.likely-QSEj5FYQhm4dnm+yROfE0A
  Cc: linux-kernel-81qHHgoATdFT9dQujB1mzip2UmYkHbXO,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-sh-u79uwXL29TY76Z2rM5mHXA,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8, Ben Dooks

The of_mdiobus_register_phy() is not setting phy->irq this causing
some drivers to incorrectly assume that the PHY does not have an
IRQ associated with it or install an interrupt handler for the
PHY.

Simplify the code setting irq and set the phy->irq at the same
time so that the case if mdio->irq is not NULL is easier to read.

This fixes the issue:
 net eth0: attached PHY 1 (IRQ -1) to driver Micrel KSZ8041RNLI

to the correct:
 net eth0: attached PHY 1 (IRQ 416) to driver Micrel KSZ8041RNLI

Signed-off-by: Ben Dooks <ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
---
 drivers/of/of_mdio.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index 875b7b6..7b3e7b0 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -44,7 +44,7 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi
 {
 	struct phy_device *phy;
 	bool is_c45;
-	int rc, prev_irq;
+	int rc;
 	u32 max_speed = 0;
 
 	is_c45 = of_device_is_compatible(child,
@@ -55,11 +55,11 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi
 		return 1;
 
 	if (mdio->irq) {
-		prev_irq = mdio->irq[addr];
-		mdio->irq[addr] =
-			irq_of_parse_and_map(child, 0);
-		if (!mdio->irq[addr])
-			mdio->irq[addr] = prev_irq;
+		rc = irq_of_parse_and_map(child, 0);
+		if (rc > 0) {
+			mdio->irq[addr] = rc;
+			phy->irq = rc;
+		}
 	}
 
 	/* Associate the OF node with the device structure so it
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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 related

* BOURSE SUISSE (2014-2015)
From: BOURSE D’ÉTUDE SUISSE @ 2014-02-17 16:15 UTC (permalink / raw)





PAR L'INTERMEDIAIRE DE LA COMMISSION FEDERALE DES BOURSES ETRANGERES (CFBE-SUISSE) , LE SECRETARIAT D'ETAT D'ETUDE ET A LA RECHERCHE DE LA CONFEDERATION LANCE UN APPEL A LA CANDIDATURE POUR 500 BOURSES D'ETUDES SUISSES AU TITRE DE L'ANNEE ACADEMIQUE 2014 - 2015 CES BOURSES SONT DESTINEES AUX RESSORTISSANTS DES PAYS
DE LA CATEGORIE A
(pays industrialisés européens, et extra-européens)
ET CEUX DES PAYS DE LA CATEGORIE B
( pays en developpement, du tiers monde et extra - européens). 
ELLES DOIVENT LEUR PERMETTRE DE POURSUIVRE LEURS ETUDES, DE PARFAIRE LEURS CONNAISSANCES POUR LES TRAVAUX DE RECHERCHES DANS LES DOMAINES AUXQUELS LES UNIVERSITES SUISSES ACCORDENT UNE ATTENTION PARTICULIERE.
DUREE DE LA BOURSE
LES BOURSES COUVRENT LA PERIODE D'UN CYCLE DE FORMATION OU AU MAXIMUM SIX (06) SEMESTRES .
FRAIS DE VOYAGE
LES BILLETS D'AVION ALLER-RETOUR ( PAYS DE PROVENANCE -GENEVE) , SONT PRIS EN CHARGE PAR LA COMMISSION FEDERALE DES BOURSES ETRANGERES.
CONDITIONS PREALABLES A LA CANDIDATURE
EN REGLE GENERALE, LES CANDIDATS AUX BOURSES ETRANGERES SUISSES DOIVENT:
- AVOIR AU MAXIMUM 18 ANS a 45 ANS ;
- COMPRENDRE ET PARLER CORRECTEMENT L'UNE DES LANGUES D'ENSEIGNEMENT EN SUISSE
( ESPAGNOL, ALLEMAND, ANGLAIS, ITALIE, FRANCAIS) ;
- AVOIR UN DIPLOME EQUIVALENT AU BREVET D'ETUDE DE PREMIER CYCLE D'ENSEIGNEMENT, AU BACCALAUREAT OU AU BREVET D'APTITUDE PROFESSIONELLE DES PAYS DE L'UNION EUROPEENNE.
PROCEDURE DE SELECTION
- RETIRER AUPRES DE LA COMMISSION FEDERALE DES BOURSES ETRANGERES SUISSEs(CFBES)LE FORMULAIRE DE DEMANDE DE
BOURSE VIA
A LEUR ADRESSE EMAIL: cfbesavis01@nokiamail.com- REMPLIR ET ENVOYER PAR PIECE JOINTE LE FORMULAIRE.
- LA COMMISSION FEDERALE DES BOURSES ETRANGERES FERA ETUDIER VOTRE DOSSIER PAR LA REPRESENTATION SUISSE DELEGUEE
DE VOTRE ZONE ET CATEGORIE DE PAYS.
- - LES CANDIDATS RETENUS RECEVRONT UNE ATTESTATION DU SECRETARIAT D'ETAT A L'ETUDE ET A LA RECHERCHE POUR NOTIFICATION DE LA BOURSE. LES CANDIDATS DESIREUX DE PARTICIPER AUX BOURSES D'ETUDES 2014 - 2015 DOIVENT RETIRER LEUR FORMULAIRE A REMPLIR AUPRES DE LA CFBES: A LEUR ADRESSE EMAIL: cfbesavis01@nokiamail.com
DATE LIMITE DE DEPÖT DES DOSSIERS
LA DATE LIMITE DE DEPÖT DES DOSSIERS EST PREVUE POUR LE
 15 Mars 2014.
 CEPENDANT, LA COMMISSION FEDERALE DES BOURSES ETRANGERES SUISSEs(CFBES) SE RESERVE LE DROIT DE CLOTURER L'OCTROI DES BOURSES A CONCURRENCE DES BOURSES DISPONIBLES.
LE PRESIDENT DE LA COMMISSION FEDERALE
DES BOURSES ETRANGERES SUISSES

^ permalink raw reply

* Re: linux 3.13: problems with isatap tunnel device and UFO
From: Hannes Frederic Sowa @ 2014-02-17 16:09 UTC (permalink / raw)
  To: Wolfgang Walter; +Cc: netdev, xiyou.wangcong
In-Reply-To: <5911515.kv7YDRiZP1@h2o.as.studentenwerk.mhn.de>

[+Cc Cong Wang]

Hi Cong!

In commit d949d826c09fb ("ipv6: Add generic UDP Tunnel segmentation") you
patched ip6_offload.c:

@@ -126,7 +128,7 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb,
                ipv6h = ipv6_hdr(skb);
                ipv6h->payload_len = htons(skb->len - skb->mac_len -
                                           sizeof(*ipv6h));
-               if (proto == IPPROTO_UDP) {
+               if (!tunnel && proto == IPPROTO_UDP) {
                        unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr);
                        fptr = (struct frag_hdr *)(skb_network_header(skb) +
                                unfrag_ip6hlen);


I wonder about the !tunnel exception. This now seems to be a problem in sit
ufo output path, where we don't update fragmentation offsets any more thus
generating invalid frames.

I am not too firm with segmentation in case of tunnels but don't we need to
always update the fragmentation offset no matter what, if upper gso callback
produced more segments?

I'll try to dig deeper...

Thanks,

  Hannes

^ permalink raw reply

* Re: [PATCH net] net: sctp: fix sctp_connectx abi for ia32 emulation/compat mode
From: Vlad Yasevich @ 2014-02-17 15:52 UTC (permalink / raw)
  To: Daniel Borkmann, davem; +Cc: netdev, linux-sctp
In-Reply-To: <1392635471-31528-1-git-send-email-dborkman@redhat.com>

On 02/17/2014 06:11 AM, Daniel Borkmann wrote:
> SCTP's sctp_connectx() abi breaks for 64bit kernels compiled with 32bit
> emulation (e.g. ia32 emulation or x86_x32). Due to internal usage of
> 'struct sctp_getaddrs_old' which includes a struct sockaddr pointer,
> sizeof(param) check will always fail in kernel as the structure in
> 64bit kernel space is 4bytes larger than for user binaries compiled
> in 32bit mode. Thus, applications making use of sctp_connectx() won't
> be able to run under such circumstances.
> 
> Introduce a compat interface in the kernel to deal with such
> situations by using a 'struct compat_sctp_getaddrs_old' structure
> where user data is copied into it, and then sucessively transformed
> into a 'struct sctp_getaddrs_old' structure with the help of
> compat_ptr(). That fixes sctp_connectx() abi without any changes
> needed in user space, and lets the SCTP test suite pass when compiled
> in 32bit and run on 64bit kernels.
> 
> Fixes: f9c67811ebc0 ("sctp: Fix regression introduced by new sctp_connectx api")
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>

Acked-by: Vlad Yasevich <vyasevich@gmail.com>

-vlad

^ permalink raw reply

* Re: [PATCH] sh_eth: call of_mdiobus_register() to register phys
From: Ben Dooks @ 2014-02-17 15:46 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: netdev, horms+renesas, linux-sh, magnus, linux-kernel
In-Reply-To: <53023B60.4030201@cogentembedded.com>

On 17/02/14 16:40, Sergei Shtylyov wrote:
> Hello.
>
> On 02/17/2014 06:28 PM, Ben Dooks wrote:
>
>> If the sh_eth device is registered using OF, then the driver
>
>     Which is not supported yet as my DT patch hasn't been merged.
> This patch seems somewhat premature.

I've got your OF patches in my local tree to test with, this
is what I found during that testing.

>> should call of_mdiobus_register() to register any PHYs connected
>> to the system.
>
>     That's not necessary (but good to have).

Well, it is necessary if you then want any PHYS bound to
the device to have their OF information to hand,

>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>> ---
>>   drivers/net/ethernet/renesas/sh_eth.c | 13 +++++++++++++
>>   1 file changed, 13 insertions(+)
>
>> diff --git a/drivers/net/ethernet/renesas/sh_eth.c
>> b/drivers/net/ethernet/renesas/sh_eth.c
>> index 06970ac..165f0c4 100644
>> --- a/drivers/net/ethernet/renesas/sh_eth.c
>> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> [...]
>> @@ -2629,6 +2630,18 @@ static int sh_mdio_init(struct net_device
>> *ndev, int id,
>>       snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
>>            mdp->pdev->name, id);
>>
>> +    if (ndev->dev.parent->of_node) {
>> +        dev_set_drvdata(&ndev->dev, mdp->mii_bus);
>> +        ret = of_mdiobus_register(mdp->mii_bus,
>> +                      ndev->dev.parent->of_node);
>> +        if (ret != 0) {
>> +            dev_err(&ndev->dev, "of_mdiobus_register() failed\n");
>> +            goto out_free_bus;
>> +        }

I should probably only set the drvdata if the
of_mdiobus_register() succeeds.

>> +        return 0;
>> +    }
>> +
>>       /* PHY IRQ */
>>       mdp->mii_bus->irq = devm_kzalloc(&ndev->dev,
>>                        sizeof(int) * PHY_MAX_ADDR,
>>
>
>      Hm, I can only hope this works with PHY IRQ in DT mode.
> Would you mind if I include your patch into my Ether DT patch?

You are welcome to include it in your series, but I would like
to keep the credit for finding this.

Also, FYI, for some reason the probe is not finding the correct
IRQ for this. I will have a look later when I get the board back
as to why this is:

net eth0: attached PHY 1 (IRQ -1) to driver Micrel KSZ8041RNLI

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

^ permalink raw reply

* Re: REGRESSION f54b311142a92ea2e42598e347b84e1655caf8e3 tcp auto corking slows down iSCSI file system creation by factor of 70 [WAS: 4 TB VMFS creation takes 15 minutes vs 26 seconds]
From: Thomas Glanzmann @ 2014-02-17 15:46 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: John Ogness, Eric Dumazet, David S. Miller, Nicholas A. Bellinger,
	target-devel, Linux Network Development, LKML
In-Reply-To: <1392651973.24974.13.camel@edumazet-glaptop2.roam.corp.google.com>

Hello Eric,

> I'll do it tomorrow : Today is President's Day in the US, and I am
> spending the day with my family.

thank you. Enjoy your day.

Cheers,
        Thomas

^ permalink raw reply

* Re: REGRESSION f54b311142a92ea2e42598e347b84e1655caf8e3 tcp auto corking slows down iSCSI file system creation by factor of 70 [WAS: 4 TB VMFS creation takes 15 minutes vs 26 seconds]
From: Eric Dumazet @ 2014-02-17 15:46 UTC (permalink / raw)
  To: Thomas Glanzmann
  Cc: John Ogness, Eric Dumazet, David S. Miller, Nicholas A. Bellinger,
	target-devel, Linux Network Development, LKML
In-Reply-To: <20140217153213.GA12054@glanzmann.de>

On Mon, 2014-02-17 at 16:32 +0100, Thomas Glanzmann wrote:
> Hello Eric,
> 
> > Unfortunately you did not had good results with the MSG_MORE applied
> > to the page fragments.
> 
> I agree. We should submit only the submit the patch from this message:
> 
> Message-ID: <1391886759.10160.114.camel@edumazet-glaptop2.roam.corp.google.com>
> http://mid.gmane.org/1391886759.10160.114.camel@edumazet-glaptop2.roam.corp.google.com
> 
> > I think I'll submit the part only dealing with the metadata.
> 
> May I submit the patch or do you want to do it yourself?

I'll do it tomorrow : Today is President's Day in the US, and I am
spending the day with my family.

Thanks !

^ permalink raw reply

* Re: REGRESSION f54b311142a92ea2e42598e347b84e1655caf8e3 tcp auto corking slows down iSCSI file system creation by factor of 70 [WAS: 4 TB VMFS creation takes 15 minutes vs 26 seconds]
From: Thomas Glanzmann @ 2014-02-17 15:32 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: John Ogness, Eric Dumazet, David S. Miller, Nicholas A. Bellinger,
	target-devel, Linux Network Development, LKML
In-Reply-To: <1392650807.24974.12.camel@edumazet-glaptop2.roam.corp.google.com>

Hello Eric,

> Unfortunately you did not had good results with the MSG_MORE applied
> to the page fragments.

I agree. We should submit only the submit the patch from this message:

Message-ID: <1391886759.10160.114.camel@edumazet-glaptop2.roam.corp.google.com>
http://mid.gmane.org/1391886759.10160.114.camel@edumazet-glaptop2.roam.corp.google.com

> I think I'll submit the part only dealing with the metadata.

May I submit the patch or do you want to do it yourself?

Cheers,
        Thomas

^ permalink raw reply

* [PATCH] sh_eth: call of_mdiobus_register() to register phys
From: Ben Dooks @ 2014-02-17 15:28 UTC (permalink / raw)
  To: netdev
  Cc: horms+renesas, sergei.shtylyov, linux-sh, magnus, linux-kernel,
	Ben Dooks

If the sh_eth device is registered using OF, then the driver
should call of_mdiobus_register() to register any PHYs connected
to the system.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 drivers/net/ethernet/renesas/sh_eth.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 06970ac..165f0c4 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -40,6 +40,7 @@
 #include <linux/if_vlan.h>
 #include <linux/clk.h>
 #include <linux/sh_eth.h>
+#include <linux/of_mdio.h>
 
 #include "sh_eth.h"
 
@@ -2629,6 +2630,18 @@ static int sh_mdio_init(struct net_device *ndev, int id,
 	snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
 		 mdp->pdev->name, id);
 
+	if (ndev->dev.parent->of_node) {
+		dev_set_drvdata(&ndev->dev, mdp->mii_bus);
+		ret = of_mdiobus_register(mdp->mii_bus,
+					  ndev->dev.parent->of_node);
+		if (ret != 0) {
+			dev_err(&ndev->dev, "of_mdiobus_register() failed\n");
+			goto out_free_bus;
+		}
+
+		return 0;
+	}
+
 	/* PHY IRQ */
 	mdp->mii_bus->irq = devm_kzalloc(&ndev->dev,
 					 sizeof(int) * PHY_MAX_ADDR,
-- 
1.8.5.3


^ permalink raw reply related

* Re: [PATCH v4 net-next 02/12] bonding: permit using arp_validate with non-ab modes
From: Nikolay Aleksandrov @ 2014-02-17 15:22 UTC (permalink / raw)
  To: Veaceslav Falico, netdev; +Cc: Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1392648088-21336-3-git-send-email-vfalico@redhat.com>

On 02/17/2014 03:41 PM, Veaceslav Falico wrote:
> Currently it's disabled because it's sometimes hard, in typical configs, to
> make it work - because of the nature how the loadbalance modes work - as
> it's hard to deliver valid arp replies to correct slaves by the switch.
> 
> However we still can use arp_validation in loadbalance with several other
> configs, per example with arp_validate == 2 for backup with one broadcast
> domain, without the switch(es) doing any balancing - this way we'd be (a
> bit more) sure that the slave is up.
> 
> So, enable it to let users decide which one works/suits them best. Also
> remove the mode limitation from BOND_OPT_ARP_VALIDATE.
> 
> CC: Jay Vosburgh <fubar@us.ibm.com>
> CC: Andy Gospodarek <andy@greyhouse.net>
> Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
> ---
>  Documentation/networking/bonding.txt | 6 +++---
>  drivers/net/bonding/bond_main.c      | 4 ----
>  drivers/net/bonding/bond_options.c   | 1 -
>  3 files changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
> index 5cdb229..96b4ad8 100644
> --- a/Documentation/networking/bonding.txt
> +++ b/Documentation/networking/bonding.txt
> @@ -270,9 +270,9 @@ arp_ip_target
>  arp_validate
>  
>  	Specifies whether or not ARP probes and replies should be
> -	validated in the active-backup mode.  This causes the ARP
> -	monitor to examine the incoming ARP requests and replies, and
> -	only consider a slave to be up if it is receiving the
> +	validated in any mode that supports arp monitoring.  This causes
> +	the ARP monitor to examine the incoming ARP requests and replies,
> +	and only consider a slave to be up if it is receiving the
>  	appropriate ARP traffic.
>  
>  	Possible values are:
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 3c50bec..91c0248 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -4183,10 +4183,6 @@ static int bond_check_params(struct bond_params *params)
>  	}
>  
>  	if (arp_validate) {
> -		if (bond_mode != BOND_MODE_ACTIVEBACKUP) {
> -			pr_err("arp_validate only supported in active-backup mode\n");
> -			return -EINVAL;
> -		}
>  		if (!arp_interval) {
>  			pr_err("arp_validate requires arp_interval\n");
>  			return -EINVAL;
> diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
> index f3eb44d..d566cab 100644
> --- a/drivers/net/bonding/bond_options.c
> +++ b/drivers/net/bonding/bond_options.c
> @@ -151,7 +151,6 @@ static struct bond_option bond_opts[] = {
>  		.id = BOND_OPT_ARP_VALIDATE,
>  		.name = "arp_validate",
>  		.desc = "validate src/dst of ARP probes",
> -		.unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_ACTIVEBACKUP)),
>  		.values = bond_arp_validate_tbl,
>  		.set = bond_option_arp_validate_set
>  	},
> 
Sorry for not noticing before, but I just remembered the reason why all the
checks are there when changing the recv_probe, especially from the options.
The problem was that lacp mode also uses the recv_probe, so after this patch we
can overwrite the recv_probe while it's running in lacp mode, because
bond_option_arp_validate_set changes the recv_probe. We can actually only set it
to NULL because arp_interval can't be set in those modes, but still we can break
the mode and there'll be need for at least down/up cycle to fix it.
I think rlb also uses the recv_probe so this applies to it as well.

Nik

^ permalink raw reply

* Re: REGRESSION f54b311142a92ea2e42598e347b84e1655caf8e3 tcp auto corking slows down iSCSI file system creation by factor of 70 [WAS: 4 TB VMFS creation takes 15 minutes vs 26 seconds]
From: Eric Dumazet @ 2014-02-17 15:26 UTC (permalink / raw)
  To: Thomas Glanzmann
  Cc: John Ogness, Eric Dumazet, David S. Miller, Nicholas A. Bellinger,
	target-devel, Linux Network Development, LKML
In-Reply-To: <20140217140821.GD6211@glanzmann.de>

On Mon, 2014-02-17 at 15:08 +0100, Thomas Glanzmann wrote:
> Hello Eric,
> may submit your latest patch for upstream? Or do you plan on doing that
> yourself?

Unfortunately you did not had good results with the MSG_MORE applied to
the page fragments.

I think I'll submit the part only dealing with the metadata.

Then later we might take care of the page themselves.

^ permalink raw reply

* Re: [PATCH v4 net-next 11/12] bonding: trivial: rename slave->jiffies to ->last_link_up
From: Veaceslav Falico @ 2014-02-17 15:15 UTC (permalink / raw)
  To: David Laight; +Cc: netdev@vger.kernel.org, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D0F6C18F7@AcuExch.aculab.com>

On Mon, Feb 17, 2014 at 03:02:36PM +0000, David Laight wrote:
>> -	unsigned long jiffies;
>> +	/* all three in jiffies */
>> +	unsigned long last_link_up;
>>  	unsigned long last_arp_rx;
>>  	unsigned long target_last_arp_rx[BOND_MAX_ARP_TARGETS];
>
>Personally I'd add _time to the member names (maybe not the last
>as that is long enough already).
>I sometimes go as far as adding the time units (eg _ms or _sec)
>just to avoid confusion when reading the code much later on.

Good idea, however current renaming follows the one used in bonding:

last_link_up, last_arp_rx (ripped from net_device, where last_rx is also
used), target_last_arp_rx, slave_last_rx() and some other. So it's somehow
consistent over all bonding and some other networking code (grepping by
last_rx yields a lot of results). And all of these are using jiffies as its
value.

I really like the general idea (to make it more readable, bonding really
lacks this part), however it's, IMO, a new patch(-set) material and doesn't
really fit in this patchset.

If you'd like to do that I would be really glad :), otherwise I'll add this
to my todo list.

Thanks a lot!

>
>	David
>
>
>

^ permalink raw reply

* RE: [PATCH v4 net-next 11/12] bonding: trivial: rename slave->jiffies to ->last_link_up
From: David Laight @ 2014-02-17 15:02 UTC (permalink / raw)
  To: 'Veaceslav Falico', netdev@vger.kernel.org
  Cc: Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1392648088-21336-12-git-send-email-vfalico@redhat.com>

> -	unsigned long jiffies;
> +	/* all three in jiffies */
> +	unsigned long last_link_up;
>  	unsigned long last_arp_rx;
>  	unsigned long target_last_arp_rx[BOND_MAX_ARP_TARGETS];

Personally I'd add _time to the member names (maybe not the last
as that is long enough already).
I sometimes go as far as adding the time units (eg _ms or _sec)
just to avoid confusion when reading the code much later on.

	David

^ permalink raw reply

* [PATCH v4 net-next 08/12] bonding: use last_arp_rx in slave_last_rx()
From: Veaceslav Falico @ 2014-02-17 14:41 UTC (permalink / raw)
  To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1392648088-21336-1-git-send-email-vfalico@redhat.com>

Now that last_arp_rx really has the last time we've received any (validated or
not) ARP, we can use it in slave_last_rx() instead of slave->dev->last_rx.

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
 drivers/net/bonding/bonding.h | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index ab2e651..ae20c5a 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -379,14 +379,10 @@ static inline unsigned long slave_oldest_target_arp_rx(struct bonding *bond,
 static inline unsigned long slave_last_rx(struct bonding *bond,
 					struct slave *slave)
 {
-	if (slave_do_arp_validate(bond, slave)) {
-		if (bond->params.arp_all_targets == BOND_ARP_TARGETS_ALL)
-			return slave_oldest_target_arp_rx(bond, slave);
-		else
-			return slave->last_arp_rx;
-	}
+	if (bond->params.arp_all_targets == BOND_ARP_TARGETS_ALL)
+		return slave_oldest_target_arp_rx(bond, slave);
 
-	return slave->dev->last_rx;
+	return slave->last_arp_rx;
 }
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
-- 
1.8.4

^ permalink raw reply related

* [PATCH v4 net-next 07/12] bonding: use the new options to correctly set last_arp_rx
From: Veaceslav Falico @ 2014-02-17 14:41 UTC (permalink / raw)
  To: netdev
  Cc: Veaceslav Falico, Rob Landley, David S. Miller,
	Nikolay Aleksandrov, Ding Tianhong, Neil Horman
In-Reply-To: <1392648088-21336-1-git-send-email-vfalico@redhat.com>

Now that the options are in place - arp_validate can be set to receive all
the traffic or only arp packets to verify if the slave is up, when the
slave isn't validated.

CC: Rob Landley <rob@landley.net>
CC: "David S. Miller" <davem@davemloft.net>
CC: Nikolay Aleksandrov <nikolay@redhat.com>
CC: Ding Tianhong <dingtianhong@huawei.com>
CC: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
 drivers/net/bonding/bond_main.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 257ee7f..3fe81cd 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2255,15 +2255,16 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
 	struct arphdr *arp = (struct arphdr *)skb->data;
 	unsigned char *arp_ptr;
 	__be32 sip, tip;
-	int alen;
+	int alen, is_arp = skb->protocol == __cpu_to_be16(ETH_P_ARP);
 
-	slave->last_arp_rx = jiffies;
-
-	if (skb->protocol != __cpu_to_be16(ETH_P_ARP))
+	if (!slave_do_arp_validate(bond, slave)) {
+		if ((slave_do_arp_validate_only(bond, slave) && is_arp) ||
+		    !slave_do_arp_validate_only(bond, slave))
+			slave->last_arp_rx = jiffies;
 		return RX_HANDLER_ANOTHER;
-
-	if (!slave_do_arp_validate(bond, slave))
-		goto out_unlock;
+	} else if (!is_arp) {
+		return RX_HANDLER_ANOTHER;
+	}
 
 	alen = arp_hdr_len(bond->dev);
 
-- 
1.8.4

^ permalink raw reply related

* [PATCH v4 net-next 12/12] bonding: rename last_arp_rx to last_rx
From: Veaceslav Falico @ 2014-02-17 14:41 UTC (permalink / raw)
  To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1392648088-21336-1-git-send-email-vfalico@redhat.com>

To reflect the new meaning.

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
 drivers/net/bonding/bond_main.c | 12 ++++++------
 drivers/net/bonding/bonding.h   |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index f6d56d9..ac4a1b8 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1397,10 +1397,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 
 	bond_update_speed_duplex(new_slave);
 
-	new_slave->last_arp_rx = jiffies -
+	new_slave->last_rx = jiffies -
 		(msecs_to_jiffies(bond->params.arp_interval) + 1);
 	for (i = 0; i < BOND_MAX_ARP_TARGETS; i++)
-		new_slave->target_last_arp_rx[i] = new_slave->last_arp_rx;
+		new_slave->target_last_arp_rx[i] = new_slave->last_rx;
 
 	if (bond->params.miimon && !bond->params.use_carrier) {
 		link_reporting = bond_check_dev_link(bond, slave_dev, 1);
@@ -2242,7 +2242,7 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
 		pr_debug("bva: sip %pI4 not found in targets\n", &sip);
 		return;
 	}
-	slave->last_arp_rx = jiffies;
+	slave->last_rx = jiffies;
 	slave->target_last_arp_rx[i] = jiffies;
 }
 
@@ -2257,7 +2257,7 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
 	if (!slave_do_arp_validate(bond, slave)) {
 		if ((slave_do_arp_validate_only(bond, slave) && is_arp) ||
 		    !slave_do_arp_validate_only(bond, slave))
-			slave->last_arp_rx = jiffies;
+			slave->last_rx = jiffies;
 		return RX_HANDLER_ANOTHER;
 	} else if (!is_arp) {
 		return RX_HANDLER_ANOTHER;
@@ -2369,7 +2369,7 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
 
 		if (slave->link != BOND_LINK_UP) {
 			if (bond_time_in_interval(bond, trans_start, 1) &&
-			    bond_time_in_interval(bond, slave->last_arp_rx, 1)) {
+			    bond_time_in_interval(bond, slave->last_rx, 1)) {
 
 				slave->link  = BOND_LINK_UP;
 				slave_state_changed = 1;
@@ -2398,7 +2398,7 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
 			 * if we don't know our ip yet
 			 */
 			if (!bond_time_in_interval(bond, trans_start, 2) ||
-			    !bond_time_in_interval(bond, slave->last_arp_rx, 2)) {
+			    !bond_time_in_interval(bond, slave->last_rx, 2)) {
 
 				slave->link  = BOND_LINK_DOWN;
 				slave_state_changed = 1;
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 36db702..4303628 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -190,7 +190,7 @@ struct slave {
 	int    delay;
 	/* all three in jiffies */
 	unsigned long last_link_up;
-	unsigned long last_arp_rx;
+	unsigned long last_rx;
 	unsigned long target_last_arp_rx[BOND_MAX_ARP_TARGETS];
 	s8     link;    /* one of BOND_LINK_XXXX */
 	s8     new_link;
@@ -383,7 +383,7 @@ static inline unsigned long slave_last_rx(struct bonding *bond,
 	if (bond->params.arp_all_targets == BOND_ARP_TARGETS_ALL)
 		return slave_oldest_target_arp_rx(bond, slave);
 
-	return slave->last_arp_rx;
+	return slave->last_rx;
 }
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
-- 
1.8.4

^ permalink raw reply related


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