Netdev List
 help / color / mirror / Atom feed
* [RFC PATCH 07/24] net: rbridge: Add sysfs for trill_state
From: Ahmed Amamou @ 2014-09-24 15:52 UTC (permalink / raw)
  To: netdev; +Cc: william, f.cachereul, Ahmed Amamou
In-Reply-To: <1411573940-14079-1-git-send-email-ahmed@gandi.net>

in order to activate trill port without need for brctl
add a sysfs for trill_state for net_bridge_port

Signed-off-by: Ahmed Amamou <ahmed@gandi.net>
Signed-off-by: William Dauchy <william@gandi.net>
---
 net/bridge/br_sysfs_if.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
index e561cd5..6edc00b 100644
--- a/net/bridge/br_sysfs_if.c
+++ b/net/bridge/br_sysfs_if.c
@@ -137,6 +137,26 @@ static ssize_t show_port_state(struct net_bridge_port *p, char *buf)
 }
 static BRPORT_ATTR(state, S_IRUGO, show_port_state, NULL);
 
+#ifdef CONFIG_TRILL
+static ssize_t show_port_trill_state(struct net_bridge_port *p, char *buf)
+{
+	return sprintf(buf, "%d\n", p->trill_flag);
+}
+static int store_port_trill_state(struct net_bridge_port *p,  unsigned long v)
+{
+	uint8_t val;
+	if (!ns_capable(dev_net(p->dev)->user_ns, CAP_NET_ADMIN))
+		return -EPERM;
+	val = (uint8_t) v;
+	if (val > TRILL_FLAG_TRUNK)
+		return -ERANGE;
+	p->trill_flag = val;
+	return 0;
+}
+static BRPORT_ATTR(trill_state, S_IRUGO | S_IWUSR, show_port_trill_state,
+				   store_port_trill_state);
+#endif
+
 static ssize_t show_message_age_timer(struct net_bridge_port *p,
 					    char *buf)
 {
@@ -198,6 +218,9 @@ static const struct brport_attribute *brport_attrs[] = {
 	&brport_attr_designated_port,
 	&brport_attr_designated_cost,
 	&brport_attr_state,
+#ifdef CONFIG_TRILL
+	&brport_attr_trill_state,
+#endif
 	&brport_attr_change_ack,
 	&brport_attr_config_pending,
 	&brport_attr_message_age_timer,
-- 
1.9.1

^ permalink raw reply related

* [RFC PATCH 00/24] TRILL implementation
From: Ahmed Amamou @ 2014-09-24 15:51 UTC (permalink / raw)
  To: netdev; +Cc: william, f.cachereul, Ahmed Amamou

Hi,

We have been working on a TRILL implementation in the Linux kernel for some
months now.  The code has been pushed here https://github.com/Gandi/ktrill.git
along the way.  Attached a series of patch as a first proposition.  The code is
not perfect and probably still lacks of improvements. It's a first request of
comment in order to get some feedbacks. This code has been tested for some
months now.

These patch tries to implement TRILL protocol RFC 6325.  As a First
implementation, some RFC details are still not implemented.

We still need to fix these points: 
- The use of rtnetlink instead of the actual netlink.
- BPDU handling

Also some parts may not be fully linux compliant, so we are waiting for
comments

In order to test theses patches please follow this small wiki download quagga
(userland) from here https://github.com/Gandi/quagga.git compile it using these
options ./bootstrap.sh && ./configure --localstatedir=/var/run/quagga
--enable-isisd --enable-trilld --disable-ipv6 --disable-ospfd
--disable-ospfclient --disable-ripd --disable-babeld --disable-bgpd && make &&
make install

start zebra and trilld  $ zebra -f $ZEBRA_CONF -P 2121 -u quagga -d $ trilld -f
$TRILLD_CONF -P 2021 -u quagga -d

configuration sample can be found here
https://github.com/Gandi/quagga/blob/dev_trill/zebra/zebra.conf.sample and here
https://github.com/Gandi/quagga/blob/dev_trill/isisd/trilld.conf.sample


Finally you need to correctly configure bridge port 

For access port (native frames) echo 4 >
/sys/class/net/<INTERFACE>/brport/trill_state For trunk port (trill frame and
control frames) echo 8 > /sys/class/net/<INTERFACE>/brport/trill_state 

more detail can be found here: https://github.com/Gandi/ktrill/wiki NB: for port
state github version has different flags as we did not take into consideration
all port flag when implementing it

Ahmed Amamou (23):
  net: rbridge: add trill frame description
  net: rbridge: Add RBridge structure
  net: rbridge: Add CONFIG_TRILL
  net: rbridge: Adapt Bridge structure
  net: rbridge: Enable/disable TRILL capability
  net: rbridge: Add sysfs for trill_state
  net: rbridge: Add Rbridge netlink message skeleton
  net: rbridge: Get Rbridge nickname from daemon
  net: rbridge: Add elected dtroot
  net: rbridge: Add rbr_node management function
  net: rbridge: Clean up rbr_node on rbridge stop
  net: rbridge: Add set_node function
  net: rbridge: Add get_node function
  net: rbridge: Add basic trill frame handling function
  net: rbridge: Update forwarding database
  net: rbridge: Add test on trill flag before flood
  net: rbridge: Add encapsulation process
  net: rbridge: Add receive function
  net: rbridge: Add multicast recv handling
  net: rbridge: Add decapsulation function
  net: rbridge: Add rbr_fwd
  net: rbridge: Add rbr_multidest_fwd
  net: rbridge: replace net_port rx_handler

François Cachereul (1):
  net: rbridge: Add layer 2 IS-IS Ethertype

 include/linux/etherdevice.h      |  34 ++
 include/linux/if_trill.h         |  89 +++++
 include/uapi/linux/if_ether.h    |   2 +
 net/bridge/Kconfig               |   8 +
 net/bridge/Makefile              |   2 +
 net/bridge/br.c                  |   6 +
 net/bridge/br_fdb.c              |  40 +++
 net/bridge/br_forward.c          |  38 ++
 net/bridge/br_if.c               |   4 +
 net/bridge/br_private.h          |  51 +++
 net/bridge/br_sysfs_br.c         |  38 ++
 net/bridge/br_sysfs_if.c         |  23 ++
 net/bridge/rbridge/rbr.c         | 723 +++++++++++++++++++++++++++++++++++++++
 net/bridge/rbridge/rbr_netlink.c | 404 ++++++++++++++++++++++
 net/bridge/rbridge/rbr_netlink.h |  62 ++++
 net/bridge/rbridge/rbr_private.h |  86 +++++
 16 files changed, 1610 insertions(+)
 create mode 100644 include/linux/if_trill.h
 create mode 100644 net/bridge/rbridge/rbr.c
 create mode 100644 net/bridge/rbridge/rbr_netlink.c
 create mode 100644 net/bridge/rbridge/rbr_netlink.h
 create mode 100644 net/bridge/rbridge/rbr_private.h

-- 
Ahmed Amamou 

^ permalink raw reply

* [RFC PATCH 06/24] net: rbridge: Enable/disable TRILL capability
From: Ahmed Amamou @ 2014-09-24 15:52 UTC (permalink / raw)
  To: netdev; +Cc: william, f.cachereul, Ahmed Amamou, Kamel Haddadou
In-Reply-To: <1411573940-14079-1-git-send-email-ahmed@gandi.net>

enable switching TRILL capability state via sysfs command

Signed-off-by: Ahmed Amamou <ahmed@gandi.net>
Signed-off-by: Kamel Haddadou <kamel@gandi.net>
---
 net/bridge/Makefile      |  2 ++
 net/bridge/br_private.h  |  5 ++++
 net/bridge/br_sysfs_br.c | 38 +++++++++++++++++++++++
 net/bridge/rbridge/rbr.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 123 insertions(+)
 create mode 100644 net/bridge/rbridge/rbr.c

diff --git a/net/bridge/Makefile b/net/bridge/Makefile
index 8590b94..314783c 100644
--- a/net/bridge/Makefile
+++ b/net/bridge/Makefile
@@ -17,3 +17,5 @@ bridge-$(CONFIG_BRIDGE_IGMP_SNOOPING) += br_multicast.o br_mdb.o
 bridge-$(CONFIG_BRIDGE_VLAN_FILTERING) += br_vlan.o
 
 obj-$(CONFIG_NETFILTER) += netfilter/
+
+bridge-$(CONFIG_TRILL) += rbridge/rbr.o
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 430c556..844c87b 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -811,6 +811,11 @@ int br_stp_set_port_priority(struct net_bridge_port *p, unsigned long newprio);
 int br_stp_set_path_cost(struct net_bridge_port *p, unsigned long path_cost);
 ssize_t br_show_bridge_id(char *buf, const struct bridge_id *id);
 
+/* rbridge/rbr.c */
+#ifdef CONFIG_TRILL
+void br_trill_set_enabled(struct net_bridge *br, unsigned long val);
+#endif
+
 /* br_stp_bpdu.c */
 struct stp_proto;
 void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index c9e2572..787ab84 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -146,6 +146,41 @@ static ssize_t stp_state_store(struct device *d,
 }
 static DEVICE_ATTR_RW(stp_state);
 
+#ifdef CONFIG_TRILL
+static ssize_t trill_state_show(struct device *d,
+				struct device_attribute *attr, char *buf)
+{
+	struct net_bridge *br = to_bridge(d);
+	return sprintf(buf, "%d\n", br->trill_enabled);
+}
+
+static ssize_t trill_state_store(struct device *d,
+				 struct device_attribute *attr, const char *buf,
+				 size_t len)
+{
+	struct net_bridge *br = to_bridge(d);
+	char *endp;
+	unsigned long val;
+
+	if (!ns_capable(dev_net(br->dev)->user_ns, CAP_NET_ADMIN))
+		return -EPERM;
+
+	val = simple_strtoul(buf, &endp, 0);
+	if (endp == buf)
+		return -EINVAL;
+
+	if (!rtnl_trylock())
+		return restart_syscall();
+	br_trill_set_enabled(br, val);
+	rtnl_unlock();
+
+	return len;
+}
+
+static DEVICE_ATTR_RW(trill_state);
+#endif
+
+
 static ssize_t group_fwd_mask_show(struct device *d,
 				   struct device_attribute *attr,
 				   char *buf)
@@ -733,6 +768,9 @@ static struct attribute *bridge_attrs[] = {
 	&dev_attr_max_age.attr,
 	&dev_attr_ageing_time.attr,
 	&dev_attr_stp_state.attr,
+#ifdef CONFIG_TRILL
+	&dev_attr_trill_state.attr,
+#endif
 	&dev_attr_group_fwd_mask.attr,
 	&dev_attr_priority.attr,
 	&dev_attr_bridge_id.attr,
diff --git a/net/bridge/rbridge/rbr.c b/net/bridge/rbridge/rbr.c
new file mode 100644
index 0000000..41d47db
--- /dev/null
+++ b/net/bridge/rbridge/rbr.c
@@ -0,0 +1,78 @@
+/*
+ *	Generic parts
+ *	Linux ethernet Rbridge
+ *
+ *	Authors:
+ *	Ahmed AMAMOU	<ahmed@gandi.net>
+ *	Kamel Haddadou	<kamel@gandi.net>
+ *
+ *	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 "br_private.h"
+#include "rbr_private.h"
+
+static struct rbr *add_rbr(struct net_bridge *br)
+{
+	struct rbr *rbr;
+
+	if (!br->rbr) {
+		rbr = kzalloc(sizeof(*rbr), GFP_KERNEL);
+		if (!rbr)
+			return NULL;
+
+		rbr->br = br;
+		rbr->nick = RBRIDGE_NICKNAME_NONE;
+		rbr->treeroot = RBRIDGE_NICKNAME_NONE;
+		return rbr;
+	}
+
+	return br->rbr;
+}
+
+static void br_trill_start(struct net_bridge *br)
+{
+	/* Disable STP if it is already enabled */
+
+	if (br->stp_enabled != BR_NO_STP)
+		br_stp_set_enabled(br, false);
+	br->rbr = add_rbr(br);
+	if (br->rbr) {
+		spin_lock_bh(&br->lock);
+		br->trill_enabled = BR_TRILL;
+		spin_unlock_bh(&br->lock);
+	} else {
+		printk(KERN_WARNING
+		       "RBridge allocation for bridge '%s' failed\n",
+		       br->dev->name);
+	}
+}
+
+static void br_trill_stop(struct net_bridge *br)
+{
+	struct rbr *old;
+
+	spin_lock_bh(&br->lock);
+	br->trill_enabled = BR_NO_TRILL;
+	spin_unlock_bh(&br->lock);
+	old = br->rbr;
+	br->rbr = NULL;
+	if (likely(old)) {
+		spin_lock_bh(&br->lock);
+		kfree(old);
+		spin_unlock_bh(&br->lock);
+	}
+}
+
+void br_trill_set_enabled(struct net_bridge *br, unsigned long val)
+{
+	if (val) {
+		if (br->trill_enabled == BR_NO_TRILL)
+			br_trill_start(br);
+	} else {
+		if (br->trill_enabled != BR_NO_TRILL)
+			br_trill_stop(br);
+	}
+}
-- 
1.9.1

^ permalink raw reply related

* [RFC PATCH 12/24] net: rbridge: Clean up rbr_node on rbridge stop
From: Ahmed Amamou @ 2014-09-24 15:52 UTC (permalink / raw)
  To: netdev; +Cc: william, f.cachereul, Ahmed Amamou, Kamel Haddadou
In-Reply-To: <1411573940-14079-1-git-send-email-ahmed@gandi.net>

in order to avoid memleak need to clean all rbr_node once rbridge is stopped

Signed-off-by: Ahmed Amamou <ahmed@gandi.net>
Signed-off-by: Kamel Haddadou <kamel@gandi.net>
Signed-off-by: William Dauchy <william@gandi.net>
---
 net/bridge/rbridge/rbr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bridge/rbridge/rbr.c b/net/bridge/rbridge/rbr.c
index 1df8f8d..edd1e7c 100644
--- a/net/bridge/rbridge/rbr.c
+++ b/net/bridge/rbridge/rbr.c
@@ -13,6 +13,7 @@
  */
 #include "br_private.h"
 #include "rbr_private.h"
+static void rbr_del_all(struct rbr *rbr);
 
 static struct rbr *add_rbr(struct net_bridge *br)
 {
@@ -61,6 +62,7 @@ static void br_trill_stop(struct net_bridge *br)
 	br->rbr = NULL;
 	if (likely(old)) {
 		spin_lock_bh(&br->lock);
+		rbr_del_all(old);
 		kfree(old);
 		spin_unlock_bh(&br->lock);
 	}
-- 
1.9.1

^ permalink raw reply related

* [RFC PATCH 05/24] net: rbridge: Adapt Bridge structure
From: Ahmed Amamou @ 2014-09-24 15:52 UTC (permalink / raw)
  To: netdev; +Cc: william, f.cachereul, Ahmed Amamou, Kamel Haddadou
In-Reply-To: <1411573940-14079-1-git-send-email-ahmed@gandi.net>

change bridge structure to add corresponding RBridge reference
change bridge port structure to identify disable /P2P/ ACCESS / TRUNK port/

Signed-off-by: Ahmed Amamou <ahmed@gandi.net>
Signed-off-by: Kamel Haddadou <kamel@gandi.net>
Signed-off-by: François Cachereul <f.cachereul@alphalink.fr>
---
 include/linux/etherdevice.h | 34 ++++++++++++++++++++++++++++++++++
 net/bridge/br_private.h     | 25 +++++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 9c5529d..09dc18c 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -54,6 +54,16 @@ struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
 /* Reserved Ethernet Addresses per IEEE 802.1Q */
 static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) =
 { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
+#ifdef CONFIG_TRILL
+static const u8 eth_reserved_addr_all_rbridge[ETH_ALEN] __aligned(2) = {
+0x01, 0x80, 0xc2, 0x00, 0x00, 0x40};
+
+static const u8 eth_reserved_addr_isis_rbridge[ETH_ALEN] __aligned(2) = {
+0x01, 0x80, 0xc2, 0x00, 0x00, 0x41};
+
+static const u8 eth_reserved_addr_esadi_rbridge[ETH_ALEN] __aligned(2) = {
+0x01, 0x80, 0xc2, 0x00, 0x00, 0x42};
+#endif
 
 /**
  * is_link_local_ether_addr - Determine if given Ethernet address is link-local
@@ -391,4 +401,28 @@ static inline unsigned long compare_ether_header(const void *a, const void *b)
 #endif
 }
 
+#ifdef CONFIG_TRILL
+/**
+ * is_all_rbr_address - check if it is a specific Rbridge brodcast mac address
+ * @addr1: Pointer to a six-byte array containing the Ethernet address
+ *
+ * returns true if it is a RBridge brodcast address 01:80:C2:00:00:40
+ */
+static inline bool is_all_rbr_address(const u8 * addr1)
+{
+	return ether_addr_equal(addr1, eth_reserved_addr_all_rbridge);
+}
+
+static inline bool is_isis_rbr_address(const u8 * addr1)
+{
+	return ether_addr_equal(addr1, eth_reserved_addr_isis_rbridge);
+}
+
+static inline bool is_esadi_rbr_address(const u8 * addr1)
+{
+	return ether_addr_equal(addr1, eth_reserved_addr_esadi_rbridge);
+}
+#endif
+
+
 #endif	/* _LINUX_ETHERDEVICE_H */
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 62a7fa2..430c556 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -19,6 +19,9 @@
 #include <linux/u64_stats_sync.h>
 #include <net/route.h>
 #include <linux/if_vlan.h>
+#ifdef CONFIG_TRILL
+#include "rbridge/rbr_private.h"
+#endif
 
 #define BR_HASH_BITS 8
 #define BR_HASH_SIZE (1 << BR_HASH_BITS)
@@ -31,6 +34,18 @@
 
 #define BR_VERSION	"2.3"
 
+#ifdef CONFIG_TRILL
+  /* TRILL flagged ports are ports where we expect receiving native layer 2 frames
+   */
+#define TRILL_FLAG_DISABLE	0x1
+#define TRILL_FLAG_P2P		0x2
+#define TRILL_FLAG_ACCESS	0x4
+#define TRILL_FLAG_TRUNK	0x8	/* DROP ALL native L2 frame */
+/* Bridge TRILL state */
+#define BR_NO_TRILL			0	/* no trill  */
+#define BR_TRILL			1	/* trill enabled */
+#endif
+
 /* Control of forwarding link local multicast */
 #define BR_GROUPFWD_DEFAULT	0
 /* Don't allow forwarding control protocols like STP and LLDP */
@@ -163,6 +178,11 @@ struct net_bridge_port
 	struct rcu_head			rcu;
 
 	unsigned long 			flags;
+	/* Trill */
+#ifdef CONFIG_TRILL
+	uint8_t					trill_flag;
+#endif /* CONFIG_TRILL */
+
 #define BR_HAIRPIN_MODE		0x00000001
 #define BR_BPDU_GUARD           0x00000002
 #define BR_ROOT_BLOCK		0x00000004
@@ -252,6 +272,11 @@ struct net_bridge
 		BR_USER_STP,		/* new RSTP in userspace */
 	} stp_enabled;
 
+#ifdef CONFIG_TRILL
+	bool	 				trill_enabled;
+	struct rbr              *rbr;
+#endif
+
 	unsigned char			topology_change;
 	unsigned char			topology_change_detected;
 
-- 
1.9.1

^ permalink raw reply related

* Re: [PATCH] Revert "net/macb: add pinctrl consumer support"
From: Nicolas Ferre @ 2014-09-24 15:28 UTC (permalink / raw)
  To: Soren Brinkmann, David Miller; +Cc: linux-kernel, netdev
In-Reply-To: <1411429748-31444-1-git-send-email-soren.brinkmann@xilinx.com>

On 23/09/2014 01:49, Soren Brinkmann :
> This reverts commit 8ef29f8aae524bd51298fb10ac6a5ce6c4c5a3d8.
> The driver core already calls pinctrl_get() and claims the default
> state. There is no need to replicate this in the driver.
> ---
> Hi,
> 
> I might be mistaken, but I think the driver core does already take care of
> calling into the pinctrl framework and the driver does not need to do it on its
> own (drivers/base/dd.c:really_probe() calls 'pinctrl_bind_pins() which takes
> care of the pinctrl setup).

True, thanks for your patch:

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>


>  drivers/net/ethernet/cadence/macb.c | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
> index ca5d7798b265..e1e02fba4fcc 100644
> --- a/drivers/net/ethernet/cadence/macb.c
> +++ b/drivers/net/ethernet/cadence/macb.c
> @@ -30,7 +30,6 @@
>  #include <linux/of_device.h>
>  #include <linux/of_mdio.h>
>  #include <linux/of_net.h>
> -#include <linux/pinctrl/consumer.h>
>  
>  #include "macb.h"
>  
> @@ -2071,7 +2070,6 @@ static int __init macb_probe(struct platform_device *pdev)
>  	struct phy_device *phydev;
>  	u32 config;
>  	int err = -ENXIO;
> -	struct pinctrl *pinctrl;
>  	const char *mac;
>  
>  	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -2080,15 +2078,6 @@ static int __init macb_probe(struct platform_device *pdev)
>  		goto err_out;
>  	}
>  
> -	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> -	if (IS_ERR(pinctrl)) {
> -		err = PTR_ERR(pinctrl);
> -		if (err == -EPROBE_DEFER)
> -			goto err_out;
> -
> -		dev_warn(&pdev->dev, "No pinctrl provided\n");
> -	}
> -
>  	err = -ENOMEM;
>  	dev = alloc_etherdev(sizeof(*bp));
>  	if (!dev)
> 


-- 
Nicolas Ferre

^ permalink raw reply

* Re: [PATCH] vlan: Fix receive statistics under-reporting
From: Eric Dumazet @ 2014-09-24 15:08 UTC (permalink / raw)
  To: Vladislav Yasevich; +Cc: netdev, stephen, Vladislav Yasevich
In-Reply-To: <1411569906-31679-1-git-send-email-vyasevic@redhat.com>

On Wed, 2014-09-24 at 10:45 -0400, Vladislav Yasevich wrote:
> Vlan devices uder-report 14 bytes per packet in the recieve statistics.
> This is because the ETH_HLEN bytes of data has been pulled off the skb
> by the time it gets to the vlan receive code.  When accounting for
> receive butes, add ETH_HLEN back.
> 
> See also https://bugzilla.kernel.org/show_bug.cgi?id=84951
> 
> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
> ---
>  net/8021q/vlan_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
> index 90cc2bd..8bc5d46 100644
> --- a/net/8021q/vlan_core.c
> +++ b/net/8021q/vlan_core.c
> @@ -54,7 +54,7 @@ bool vlan_do_receive(struct sk_buff **skbp)
>  
>  	u64_stats_update_begin(&rx_stats->syncp);
>  	rx_stats->rx_packets++;
> -	rx_stats->rx_bytes += skb->len;
> +	rx_stats->rx_bytes += skb->len + ETH_HLEN;
>  	if (skb->pkt_type == PACKET_MULTICAST)
>  		rx_stats->rx_multicast++;
>  	u64_stats_update_end(&rx_stats->syncp);


I do not think this patch is general enough, it doesn't handle GRO for
example.

And should not the vlan tag also be accounted ? 

^ permalink raw reply

* Re: BCM4313 & brcmsmac & 3.12: only semi-working?
From: Michael Tokarev @ 2014-09-24 14:51 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: Seth Forshee, brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <5422C6E0.3080002-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>


>I looked at the log. I see download commence because the packets 
>received of 1562 bytes length. So within one second I see little over 
>200 packets so approx. 3Mbps which is not impressive but I don't know 
>what can be expected.

When it works it goes 50+ Mbps. I always tested at the same place and the signal there is good. D/load speed is 11Mb/sec steady. When it works. Today after powercycle it worked fine at 11 megabytes per second, I transferred several gigs of data.

> Indeed after that it stalls and we only seem to 
>receive small packets of 179 bytes that seem to end up in 
>cfg80211_mgmt_rx. It could be that the hardware is somehow bogged and 
>can not receive at higher modulations as management frames are 
>transmitted at lower rates. The hardware will drop packets that are 
>having FCS (aka. checksum) errors. The brcmsmac is missing some code to
>
>read fcs error count from hardware, but I will get back to you with a 
>patch that we can use to confirm this.

I see. Today I ordered an intel wifi  card (which also works at 5MHz) and will swap bcm4313 with it. Since the notebook has to be disassembled for this (it doesn't have separate window for wifi card), and the procedure is rather complex I don't want to do it more times than necessary... ;)

Thanks! 

/mjt from android phone
--
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

* [PATCH] vlan: Fix receive statistics under-reporting
From: Vladislav Yasevich @ 2014-09-24 14:45 UTC (permalink / raw)
  To: netdev; +Cc: stephen, Vladislav Yasevich
In-Reply-To: <20140922090134.3a114531@urahara>

Vlan devices uder-report 14 bytes per packet in the recieve statistics.
This is because the ETH_HLEN bytes of data has been pulled off the skb
by the time it gets to the vlan receive code.  When accounting for
receive butes, add ETH_HLEN back.

See also https://bugzilla.kernel.org/show_bug.cgi?id=84951

Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
 net/8021q/vlan_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 90cc2bd..8bc5d46 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -54,7 +54,7 @@ bool vlan_do_receive(struct sk_buff **skbp)
 
 	u64_stats_update_begin(&rx_stats->syncp);
 	rx_stats->rx_packets++;
-	rx_stats->rx_bytes += skb->len;
+	rx_stats->rx_bytes += skb->len + ETH_HLEN;
 	if (skb->pkt_type == PACKET_MULTICAST)
 		rx_stats->rx_multicast++;
 	u64_stats_update_end(&rx_stats->syncp);
-- 
1.9.3

^ permalink raw reply related

* Re: [PATCHv6 net-next 1/3] sunvnet: upgrade to VIO protocol version 1.6
From: David L Stevens @ 2014-09-24 14:43 UTC (permalink / raw)
  To: David Miller; +Cc: Raghuram.Kothakota, netdev
In-Reply-To: <20140923.144432.343377380510348797.davem@davemloft.net>



On 09/23/2014 02:44 PM, David Miller wrote:
> From: David L Stevens <david.stevens@oracle.com>
> Date: Tue, 23 Sep 2014 12:49:27 -0400
> 
>> Actually, that's exactly what I've been working on for the last few
>> days. I hope to post this soon. Currently, I allow for misaligned
>> packets by reallocating the skbs with the proper alignment, skip and
>> length restrictions, so the code can handle either, but still copies
>> most of the time. Once I have all the kinks worked out there, I was
>> planning to possibly make *all* skb allocations on LDOMs and/or SPARC64 fit
>> those requirements, since they are compatible with the existing alignments
>> and would allow using the HV copy in any case.
> 
> You should be able to avoid the copy on TX almost all of the time.
> 
> If you do a skb_push(skb, VNET_PACKET_SKIP) (and initialize with some
> garbage bytes) it ought to be aligned.

I can't touch the data buffer (head or tail) without getting a COW copy,
which is often also misaligned, but the code I have now is mapping the
existing head and tail as long as they are part of the skb (ie, headroom
and tailroom to fit it) and with that, I can avoid copies almost all the
time in TCP.

ICMP and ARP still copy usually, but aren't generally high-volume. I didn't
try out UDP yet.

Initial testing shows a ~25% reduction in throughput for the default MTU
(from ~1Gbps to ~750Mbps), but with 64K MTU, I get a ~25% increase in throughput--
from ~7.5Gbps with the original patches to 9.6Gbps with the no-copy, but
remapping, allocating, freeing and unmapping on demand.

Of course the reduction in throughput on the low end eliminates static tx
buffers so allows scaling up the number of LDOMs per vswitch without any
penalty in memory, instead of the n^2 growth before.

If the current static buffer allocation is "good enough," despite its poor
scaling, then we might consider a hybrid where we essentially use the old
code for smaller packets, and direct mapping for larger ones. I have some
other ideas to experiment with, too.

							+-DLS

^ permalink raw reply

* Re: Fw: [Bug 84951] New: 8021q: kernel doesn't take into account ethernet header bytes for received packets
From: Vlad Yasevich @ 2014-09-24 14:36 UTC (permalink / raw)
  To: Stephen Hemminger, netdev
In-Reply-To: <20140922090134.3a114531@urahara>

On 09/22/2014 12:01 PM, Stephen Hemminger wrote:
> I am inclined to think this is something that is just an incorrect
> user expectation.

Looks like a valid bug.  vlan just uses skb->len which already had
the eth header stripped off, so it will always under-report 12 bytes
per packet.

-vlad

> 
> Begin forwarded message:
> 
> Date: Sun, 21 Sep 2014 11:47:22 -0700
> From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
> To: "stephen@networkplumber.org" <stephen@networkplumber.org>
> Subject: [Bug 84951] New: 8021q: kernel doesn't take into account ethernet header bytes for received packets
> 
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=84951
> 
>             Bug ID: 84951
>            Summary: 8021q: kernel doesn't take into account ethernet
>                     header bytes for received packets
>            Product: Networking
>            Version: 2.5
>     Kernel Version: 3.16.1
>           Hardware: All
>                 OS: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Other
>           Assignee: shemminger@linux-foundation.org
>           Reporter: g.djavadyan@gmail.com
>         Regression: No
> 
> Statistics exported by the kernel for received packets on 802.1q subinterfaces
> don't consider Ethernet header bytes (dst MAC, src MAC, type). Statistics for
> transmitted packets is not affected. The problem is more prominent on
> high-speed links (>100Mb/s), as networking tools (nload, iftop, ...) display
> lower bandwidth utilization (>5Mb/s difference) than a report from neighboring
> routing device (FreeBSD, Cisco). Also, someone monitoring Linux router
> interfaces will find that the router generates more information than it
> receives.
> 
> Tested on CentOS kernel 2.6.32-431.29.2.el6.x86_64 and vanilla 3.16.1 with
> drivers: bnx2, atl1c and igb.
> 
> How to reproduce:
> 
> 1. Create dot1q subinterfaces on two boxes (vconfig add eth0 4040).
> 2. Assign IP addresses to subinterfaces.
> 3. Check the connection using ping.
> 4. Check the output from ifconfig eth0.4040 or 'cat
> /sys/class/net/eth0.4040/statistics/rx_{packets,bytes}'.
> 5. Issue standard 56 byte payload ping using 'ping -c 1 neighboring_ip'.
> 6. Recheck statistics using step 4.
> 
> Expected results:
> 
> Received packets value should increase by 1 and received bytes value should
> increase by 98.
> 
> dst MAC - 6
> src MAC - 6
> ethertype - 2
> IP header - 20
> ICMP header - 8
> ICMP Payload - 56
> Total: 98 bytes.
> 
> 
> Actual results:
> 
> Received packets value increases by 1 and received bytes value increases by 84
> bytes.
> 

^ permalink raw reply

* Re: [PATCH] usb: gadget: f_rndis: fix usb_interface_descriptor for rndis
From: Lars Melin @ 2014-09-24 14:22 UTC (permalink / raw)
  To: hs-ynQEQJNshbs
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi,
	Greg Kroah-Hartman, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-api-u79uwXL29TY76Z2rM5mHXA,
	Andrzej Pietrasiewicz, Michal Nazarewicz, Kyungmin Park,
	Dan Carpenter, Macpaul Lin
In-Reply-To: <5422C33F.400-ynQEQJNshbs@public.gmane.org>

On 2014-09-24 20:12, Heiko Schocher wrote:
> Hello Lars,
>
> Am 24.09.2014 14:25, schrieb Lars Melin:
>> On 2014-09-24 13:48, Heiko Schocher wrote:
>>> use the values for RNDIS over Ethernet as defined in
>>> http://www.usb.org/developers/defined_class
>>> (search for RDNIS):
>>>
>>> - baseclass: 0xef (miscellaneous)
>>> - subclass: 0x04
>>> - protocol: 0x01
>>>
>> That is usb class, it is not the same thing as communication device 
>> class.
>>> --- a/include/uapi/linux/usb/cdc.h
>>> +++ b/include/uapi/linux/usb/cdc.h
>>> @@ -12,6 +12,7 @@
>>> #include <linux/types.h>
>>> #define USB_CDC_SUBCLASS_ACM 0x02
>>> +#define USB_CDC_SUBCLASS_RNDIS 0x04
>> No, no, no.
>> There is no CDC_SUBCLASS_RNDIS and you can not define one over an 
>> already used cdc subclass number, 0x04 is Multi-Channel Control Model
>
> Ah, ok, so I have to define this values in a new header file, as there
> is no current file for the USB_CLASS_MISC defines? Or is there a proper
> place for them?
>
> BTW: where do I find the "cdc subclass number, 0x04 is Multi-Channel
> Control Model" define?
>
> bye,
> Heiko

You can still find the original specification usbcdc11.pdf on the net if 
you google for it, it has been pulled from usb.org where you could 
download it until a few years ago.
It is old but covers a lot of what you need to know.

Linux has afaik only the cdc.h definition file, everything else is coded 
by class/subclass in respectively drivers when needed.
02/02/ff  or  e0/01/03  are the most common interface attribute for 
rndis,  both of them together with a data interface with attributes 
0a/00/00.
Please check the whitelisting in drivers/net/usb/rndis_host.c  and also 
blacklistings in other net drivers under the same path, it should give 
you an idea how to bind an interface to a specific driver by interface 
attributes and/or usb vid:pid.
You should be able to do the same for your particular device.

^ permalink raw reply

* [PATCH net-next v3] tcp: use tcp_flags in tcp_data_queue()
From: Weiping Pan @ 2014-09-24 14:17 UTC (permalink / raw)
  To: netdev; +Cc: edumazet
In-Reply-To: <1411564948.15395.31.camel@edumazet-glaptop2.roam.corp.google.com>

This patch is a cleanup which follows the idea in commit e11ecddf5128 (tcp: use
TCP_SKB_CB(skb)->tcp_flags in input path),
and it may reduce register pressure since skb->cb[] access is fast,
bacause skb is probably in a register.

v2: remove variable th
v3: reword the changelog

Signed-off-by: Weiping Pan <panweiping3@gmail.com>
---
 net/ipv4/tcp_input.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 13f3da4..a51663f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4339,7 +4339,6 @@ err:
 
 static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 {
-	const struct tcphdr *th = tcp_hdr(skb);
 	struct tcp_sock *tp = tcp_sk(sk);
 	int eaten = -1;
 	bool fragstolen = false;
@@ -4348,7 +4347,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 		goto drop;
 
 	skb_dst_drop(skb);
-	__skb_pull(skb, th->doff * 4);
+	__skb_pull(skb, tcp_hdr(skb)->doff * 4);
 
 	TCP_ECN_accept_cwr(tp, skb);
 
@@ -4392,7 +4391,7 @@ queue_and_out:
 		tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
 		if (skb->len)
 			tcp_event_data_recv(sk, skb);
-		if (th->fin)
+		if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
 			tcp_fin(sk);
 
 		if (!skb_queue_empty(&tp->out_of_order_queue)) {
-- 
1.7.4

^ permalink raw reply related

* [PATCH 3/5] ARCNET: add com20020 PCI IDs with metadata
From: Michael Grzeschik @ 2014-09-24 13:41 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel
In-Reply-To: <1411566113-15583-1-git-send-email-m.grzeschik@pengutronix.de>

This patch adds metadata for the com20020 to prepare for devices with
multiple io address areas with multi card interfaces.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/net/arcnet/com20020-pci.c | 216 ++++++++++++++++++++++++++++++++------
 include/linux/com20020.h          |  16 +++
 2 files changed, 197 insertions(+), 35 deletions(-)

diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index 7bb292e..f9e5552 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -63,6 +63,8 @@ MODULE_LICENSE("GPL");
 
 static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
+	struct com20020_pci_channel_map *cm;
+	struct com20020_pci_card_info *ci;
 	struct net_device *dev;
 	struct arcnet_local *lp;
 	int ioaddr, err;
@@ -75,19 +77,15 @@ static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
 
 	dev->netdev_ops = &com20020_netdev_ops;
 
+	ci = (struct com20020_pci_card_info *)id->driver_data;
+
 	lp = netdev_priv(dev);
 
 	pci_set_drvdata(pdev, dev);
 
-	// SOHARD needs PCI base addr 4
-	if (pdev->vendor==0x10B5) {
-		BUGMSG(D_NORMAL, "SOHARD\n");
-		ioaddr = pci_resource_start(pdev, 4);
-	}
-	else {
-		BUGMSG(D_NORMAL, "Contemporary Controls\n");
-		ioaddr = pci_resource_start(pdev, 2);
-	}
+	cm = &ci->chan_map_tbl[0];
+	BUGMSG(D_NORMAL, "%s Controls\n", ci->name);
+	ioaddr = pci_resource_start(pdev, cm->bar);
 
 	if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "com20020-pci")) {
 		BUGMSG(D_INIT, "IO region %xh-%xh already allocated.\n",
@@ -105,7 +103,7 @@ static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
 	dev->irq = pdev->irq;
 	dev->dev_addr[0] = node;
 	lp->card_name = "PCI COM20020";
-	lp->card_flags = id->driver_data;
+	lp->card_flags = ci->flags;
 	lp->backplane = backplane;
 	lp->clockp = clockp & 7;
 	lp->clockm = clockm & 3;
@@ -144,32 +142,180 @@ static void com20020pci_remove(struct pci_dev *pdev)
 	free_netdev(dev);
 }
 
+static struct com20020_pci_card_info card_info_10mbit = {
+	.name = "ARC-PCI",
+	.devcount = 1,
+	.chan_map_tbl = {
+		{ 2, 0x00, 0x08 },
+	},
+	.flags = ARC_CAN_10MBIT,
+};
+
+static struct com20020_pci_card_info card_info_5mbit = {
+	.name = "ARC-PCI",
+	.devcount = 1,
+	.chan_map_tbl = {
+		{ 2, 0x00, 0x08 },
+	},
+	.flags = ARC_IS_5MBIT,
+};
+
+static struct com20020_pci_card_info card_info_sohard = {
+	.name = "PLX-PCI",
+	.devcount = 1,
+	/* SOHARD needs PCI base addr 4 */
+	.chan_map_tbl = {
+		{4, 0x00, 0x08},
+	},
+	.flags = ARC_CAN_10MBIT,
+};
+
 static const struct pci_device_id com20020pci_id_table[] = {
-	{ 0x1571, 0xa001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa00a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa00b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa00c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa00d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa00e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x1571, 0xa202, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x1571, 0xa203, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x1571, 0xa204, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x1571, 0xa205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x1571, 0xa206, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x10B5, 0x9030, 0x10B5,     0x2978,     0, 0, ARC_CAN_10MBIT },
-	{ 0x10B5, 0x9050, 0x10B5,     0x2273,     0, 0, ARC_CAN_10MBIT },
-	{ 0x14BA, 0x6000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x10B5, 0x2200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{0,}
+	{
+		0x1571, 0xa001,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0,
+	},
+	{
+		0x1571, 0xa002,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0,
+	},
+	{
+		0x1571, 0xa003,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0
+	},
+	{
+		0x1571, 0xa004,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0,
+	},
+	{
+		0x1571, 0xa005,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0
+	},
+	{
+		0x1571, 0xa006,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0
+	},
+	{
+		0x1571, 0xa007,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0
+	},
+	{
+		0x1571, 0xa008,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0
+	},
+	{
+		0x1571, 0xa009,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa00a,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa00b,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa00c,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa00d,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa00e,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa201,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x1571, 0xa202,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x1571, 0xa203,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x1571, 0xa204,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x1571, 0xa205,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x1571, 0xa206,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x10B5, 0x9030,
+		0x10B5, 0x2978,
+		0, 0,
+		(kernel_ulong_t)&card_info_sohard
+	},
+	{
+		0x10B5, 0x9050,
+		0x10B5, 0x2273,
+		0, 0,
+		(kernel_ulong_t)&card_info_sohard
+	},
+	{
+		0x14BA, 0x6000,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x10B5, 0x2200,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{ 0, }
 };
 
 MODULE_DEVICE_TABLE(pci, com20020pci_id_table);
diff --git a/include/linux/com20020.h b/include/linux/com20020.h
index 5dcfb94..6a1ceca 100644
--- a/include/linux/com20020.h
+++ b/include/linux/com20020.h
@@ -41,6 +41,22 @@ extern const struct net_device_ops com20020_netdev_ops;
 #define BUS_ALIGN  1
 #endif
 
+#define PLX_PCI_MAX_CARDS 1
+
+struct com20020_pci_channel_map {
+	u32 bar;
+	u32 offset;
+	u32 size;               /* 0x00 - auto, e.g. length of entire bar */
+};
+
+struct com20020_pci_card_info {
+	const char *name;
+	int devcount;
+
+	struct com20020_pci_channel_map chan_map_tbl[PLX_PCI_MAX_CARDS];
+
+	unsigned int flags;
+};
 
 #define _INTMASK  (ioaddr+BUS_ALIGN*0)	/* writable */
 #define _STATUS   (ioaddr+BUS_ALIGN*0)	/* readable */
-- 
2.1.0

^ permalink raw reply related

* [PATCH 5/5] ARCNET: enable eae arcnet card support
From: Michael Grzeschik @ 2014-09-24 13:41 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel
In-Reply-To: <1411566113-15583-1-git-send-email-m.grzeschik@pengutronix.de>

This patch adds support for the EAE arcnet cards
which has two Interfaces.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/net/arcnet/com20020-pci.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index fe87576..6c99ff0 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -211,6 +211,16 @@ static struct com20020_pci_card_info card_info_sohard = {
 	.flags = ARC_CAN_10MBIT,
 };
 
+static struct com20020_pci_card_info card_info_eae = {
+	.name = "EAE PLX-PCI",
+	.devcount = 2,
+	.chan_map_tbl = {
+		{ 2, 0x00, 0x08 },
+		{ 2, 0x08, 0x08 }
+	},
+	.flags = ARC_CAN_10MBIT,
+};
+
 static const struct pci_device_id com20020pci_id_table[] = {
 	{
 		0x1571, 0xa001,
@@ -345,6 +355,12 @@ static const struct pci_device_id com20020pci_id_table[] = {
 		(kernel_ulong_t)&card_info_sohard
 	},
 	{
+		0x10B5, 0x9050,
+		0x10B5, 0x3292,
+		0, 0,
+		(kernel_ulong_t)&card_info_eae
+	},
+	{
 		0x14BA, 0x6000,
 		PCI_ANY_ID, PCI_ANY_ID,
 		0, 0,
-- 
2.1.0

^ permalink raw reply related

* [PATCH 4/5] ARCNET: add support for multi interfaces on com20020
From: Michael Grzeschik @ 2014-09-24 13:41 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel
In-Reply-To: <1411566113-15583-1-git-send-email-m.grzeschik@pengutronix.de>

The com20020-pci driver is currently designed to instance
one netdev with one pci device. This patch adds support to
instance many cards with one pci device, depending on the device
data in the private data.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/net/arcnet/com20020-pci.c | 149 ++++++++++++++++++++++++--------------
 include/linux/com20020.h          |  15 +++-
 2 files changed, 109 insertions(+), 55 deletions(-)

diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index f9e5552..fe87576 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -38,6 +38,7 @@
 #include <linux/pci.h>
 #include <linux/arcdevice.h>
 #include <linux/com20020.h>
+#include <linux/list.h>
 
 #include <asm/io.h>
 
@@ -61,85 +62,125 @@ module_param(clockp, int, 0);
 module_param(clockm, int, 0);
 MODULE_LICENSE("GPL");
 
+static void com20020pci_remove(struct pci_dev *pdev);
+
 static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
-	struct com20020_pci_channel_map *cm;
 	struct com20020_pci_card_info *ci;
 	struct net_device *dev;
 	struct arcnet_local *lp;
-	int ioaddr, err;
+	struct com20020_priv *priv;
+	int i, ioaddr, ret;
+	struct resource *r;
 
 	if (pci_enable_device(pdev))
 		return -EIO;
-	dev = alloc_arcdev(device);
-	if (!dev)
-		return -ENOMEM;
-
-	dev->netdev_ops = &com20020_netdev_ops;
 
+	priv = devm_kzalloc(&pdev->dev, sizeof(struct com20020_priv),
+			    GFP_KERNEL);
 	ci = (struct com20020_pci_card_info *)id->driver_data;
+	priv->ci = ci;
 
-	lp = netdev_priv(dev);
+	INIT_LIST_HEAD(&priv->list_dev);
 
-	pci_set_drvdata(pdev, dev);
 
-	cm = &ci->chan_map_tbl[0];
-	BUGMSG(D_NORMAL, "%s Controls\n", ci->name);
-	ioaddr = pci_resource_start(pdev, cm->bar);
+	for (i = 0; i < ci->devcount; i++) {
+		struct com20020_pci_channel_map *cm = &ci->chan_map_tbl[i];
+		struct com20020_dev *card;
 
-	if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "com20020-pci")) {
-		BUGMSG(D_INIT, "IO region %xh-%xh already allocated.\n",
-		       ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1);
-		err = -EBUSY;
-		goto out_dev;
-	}
+		dev = alloc_arcdev(device);
+		if (!dev) {
+			ret = -ENOMEM;
+			goto out_port;
+		}
 
-	// Dummy access after Reset
-	// ARCNET controller needs this access to detect bustype
-	outb(0x00,ioaddr+1);
-	inb(ioaddr+1);
-
-	dev->base_addr = ioaddr;
-	dev->irq = pdev->irq;
-	dev->dev_addr[0] = node;
-	lp->card_name = "PCI COM20020";
-	lp->card_flags = ci->flags;
-	lp->backplane = backplane;
-	lp->clockp = clockp & 7;
-	lp->clockm = clockm & 3;
-	lp->timeout = timeout;
-	lp->hw.owner = THIS_MODULE;
-
-	if (ASTATUS() == 0xFF) {
-		BUGMSG(D_NORMAL, "IO address %Xh was reported by PCI BIOS, "
-		       "but seems empty!\n", ioaddr);
-		err = -EIO;
-		goto out_port;
-	}
-	if (com20020_check(dev)) {
-		err = -EIO;
-		goto out_port;
+		dev->netdev_ops = &com20020_netdev_ops;
+
+		lp = netdev_priv(dev);
+
+		BUGMSG(D_NORMAL, "%s Controls\n", ci->name);
+		ioaddr = pci_resource_start(pdev, cm->bar) + cm->offset;
+
+		r = devm_request_region(&pdev->dev, ioaddr, cm->size,
+					"com20020-pci");
+		if (!r) {
+			pr_err("IO region %xh-%xh already allocated.\n",
+			       ioaddr, ioaddr + cm->size - 1);
+			ret = -EBUSY;
+			goto out_port;
+		}
+
+		/* Dummy access after Reset
+		 * ARCNET controller needs
+		 * this access to detect bustype
+		 */
+		outb(0x00, ioaddr + 1);
+		inb(ioaddr + 1);
+
+		dev->base_addr = ioaddr;
+		dev->dev_addr[0] = node;
+		dev->irq = pdev->irq;
+		lp->card_name = "PCI COM20020";
+		lp->card_flags = ci->flags;
+		lp->backplane = backplane;
+		lp->clockp = clockp & 7;
+		lp->clockm = clockm & 3;
+		lp->timeout = timeout;
+		lp->hw.owner = THIS_MODULE;
+
+		if (ASTATUS() == 0xFF) {
+			pr_err("IO address %Xh is empty!\n", ioaddr);
+			ret = -EIO;
+			goto out_port;
+		}
+		if (com20020_check(dev)) {
+			ret = -EIO;
+			goto out_port;
+		}
+
+		card = devm_kzalloc(&pdev->dev, sizeof(struct com20020_dev),
+				    GFP_KERNEL);
+		if (!card) {
+			pr_err("%s out of memory!\n", __func__);
+			return -ENOMEM;
+		}
+
+		card->index = i;
+		card->pci_priv = priv;
+		card->dev = dev;
+
+		dev_set_drvdata(&dev->dev, card);
+
+		ret = com20020_found(dev, IRQF_SHARED);
+		if (ret)
+			goto out_port;
+
+		list_add(&card->list, &priv->list_dev);
 	}
 
-	if ((err = com20020_found(dev, IRQF_SHARED)) != 0)
-	        goto out_port;
+	pci_set_drvdata(pdev, priv);
 
 	return 0;
 
 out_port:
-	release_region(ioaddr, ARCNET_TOTAL_SIZE);
-out_dev:
-	free_netdev(dev);
-	return err;
+	com20020pci_remove(pdev);
+	return ret;
 }
 
 static void com20020pci_remove(struct pci_dev *pdev)
 {
-	struct net_device *dev = pci_get_drvdata(pdev);
-	unregister_netdev(dev);
-	free_irq(dev->irq, dev);
-	release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
-	free_netdev(dev);
+	struct com20020_dev *card, *tmpcard;
+	struct com20020_priv *priv;
+
+	priv = pci_get_drvdata(pdev);
+
+	list_for_each_entry_safe(card, tmpcard, &priv->list_dev, list) {
+		struct net_device *dev = card->dev;
+
+		unregister_netdev(dev);
+		free_irq(dev->irq, dev);
+		free_netdev(dev);
+	}
 }
 
 static struct com20020_pci_card_info card_info_10mbit = {
diff --git a/include/linux/com20020.h b/include/linux/com20020.h
index 6a1ceca..8589899 100644
--- a/include/linux/com20020.h
+++ b/include/linux/com20020.h
@@ -41,7 +41,7 @@ extern const struct net_device_ops com20020_netdev_ops;
 #define BUS_ALIGN  1
 #endif
 
-#define PLX_PCI_MAX_CARDS 1
+#define PLX_PCI_MAX_CARDS 2
 
 struct com20020_pci_channel_map {
 	u32 bar;
@@ -58,6 +58,19 @@ struct com20020_pci_card_info {
 	unsigned int flags;
 };
 
+struct com20020_priv {
+	struct com20020_pci_card_info *ci;
+	struct list_head list_dev;
+};
+
+struct com20020_dev {
+	struct list_head list;
+	struct net_device *dev;
+
+	struct com20020_priv *pci_priv;
+	int index;
+};
+
 #define _INTMASK  (ioaddr+BUS_ALIGN*0)	/* writable */
 #define _STATUS   (ioaddr+BUS_ALIGN*0)	/* readable */
 #define _COMMAND  (ioaddr+BUS_ALIGN*1)	/* standard arcnet commands */
-- 
2.1.0

^ permalink raw reply related

* [PATCH 2/5] ARCNET: add com20020_set_hwddr to change address
From: Michael Grzeschik @ 2014-09-24 13:41 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel
In-Reply-To: <1411566113-15583-1-git-send-email-m.grzeschik@pengutronix.de>

This patch adds com20020_set_hwaddr to make
it possible to change the hwaddr on runtime.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/net/arcnet/com20020.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c
index 7b96c5f..1a84378 100644
--- a/drivers/net/arcnet/com20020.c
+++ b/drivers/net/arcnet/com20020.c
@@ -149,11 +149,25 @@ int com20020_check(struct net_device *dev)
 	return 0;
 }
 
+static int com20020_set_hwaddr(struct net_device *dev, void *addr)
+{
+	int ioaddr = dev->base_addr;
+	struct arcnet_local *lp = netdev_priv(dev);
+	struct sockaddr *hwaddr = addr;
+
+	memcpy(dev->dev_addr, hwaddr->sa_data, 1);
+	SET_SUBADR(SUB_NODE);
+	outb(dev->dev_addr[0], _XREG);
+
+	return 0;
+}
+
 const struct net_device_ops com20020_netdev_ops = {
 	.ndo_open	= arcnet_open,
 	.ndo_stop	= arcnet_close,
 	.ndo_start_xmit = arcnet_send_packet,
 	.ndo_tx_timeout = arcnet_timeout,
+	.ndo_set_mac_address = com20020_set_hwaddr,
 	.ndo_set_rx_mode = com20020_set_mc_list,
 };
 
-- 
2.1.0

^ permalink raw reply related

* [PATCH 1/5] ARCNET: return IRQ_NONE if the interface isn't running
From: Michael Grzeschik @ 2014-09-24 13:41 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel
In-Reply-To: <1411566113-15583-1-git-send-email-m.grzeschik@pengutronix.de>

The interrupt handler needs to return IRQ_NONE in case
two devices are used with the shared interrupt handler.
Otherwise it could steal interrupts from the other
interface.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/net/arcnet/arcnet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index 3b790de..09de683 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -777,7 +777,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
 			ACOMMAND(CFLAGScmd | RESETclear);
 		AINTMASK(0);
 		spin_unlock(&lp->lock);
-		return IRQ_HANDLED;
+		return retval;
 	}
 
 	BUGMSG(D_DURING, "in arcnet_inthandler (status=%Xh, intmask=%Xh)\n",
-- 
2.1.0

^ permalink raw reply related

* [PATCH 0/5] ARCNET: add support for EAE multi interfac card
From: Michael Grzeschik @ 2014-09-24 13:41 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel

Hello,

this series adds support for the PLX Bridge based multi interface
pci cards and adds support to change device address on com200xx chips
during runtime.

This series is based on v3.17-rc6.

Thanks,
Michael


Michael Grzeschik (5):
  ARCNET: return IRQ_NONE if the interface isn't running
  ARCNET: add com20020_set_hwddr to change address
  ARCNET: add com20020 PCI IDs with metadata
  ARCNET: add support for multi interfaces on com20020
  ARCNET: enable eae arcnet card support

 drivers/net/arcnet/arcnet.c       |   2 +-
 drivers/net/arcnet/com20020-pci.c | 369 +++++++++++++++++++++++++++++---------
 drivers/net/arcnet/com20020.c     |  14 ++
 include/linux/com20020.h          |  29 +++
 4 files changed, 330 insertions(+), 84 deletions(-)

-- 
2.1.0

^ permalink raw reply

* Re: [patch net-next v2 8/9] switchdev: introduce Netlink API
From: Thomas Graf @ 2014-09-24 13:32 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: Andy Gospodarek, Tom Herbert, Alexei Starovoitov, Jiri Pirko,
	John Fastabend, Jamal Hadi Salim, netdev@vger.kernel.org,
	David S. Miller, Neil Horman, Andy Gospodarek, Daniel Borkmann,
	Jesse Gross, Pravin Shelar, Andy Zhou, Ben Hutchings,
	Stephen Hemminger, Jeff Kirsher, Vladislav Yasevich, Cong Wang,
	Eric Dumazet, Scott Feldman, Florian Fainelli
In-Reply-To: <542192A3.2020309@mellanox.com>

On 09/23/14 at 06:32pm, Or Gerlitz wrote:
> Indeed.
> 
> The idea is to leverage OVS to manage eSwitch (embedded NIC switch) as well
> (NOT to offload OVS).
> 
> We envision a seamless integration of user environment which is based on OVS
> with SRIOV eSwitch and the grounds for that were very well supported in
> Jiri’s V1.

Please consider comparing your model with what is described here [0].
I'm trying to write down an architecture document that we can finalize
in Düsseldorf.

[0] http://goo.gl/qkzW5y

> The eSwitch hardware does not need to have multiple tables and ‘enjoys’ the
> flat rule of OVS. The kernel datapath does not need to be aware of the
> existence of HW nor its capabilities, it just pushes the flow also to the
> switchdev which represents the eSwitch.

I think you are saying that the kernel should not be required to make
the offload decision which is fair. We definitely don't want to force
the decision to be outside though, there are several legit reasons to
support transparent offloads within the kernel as well outside of OVS.

> Yep. LPC is the time and place to go over the multiple use-cases (phyiscal
> switch, eSwitch, eBPF, etc) that could (should) be supported by the basic
> framework.

For reference:
http://www.linuxplumbersconf.org/2014/ocw/proposals/2463

^ permalink raw reply

* Re: [PATCH 0/5] ARCNET: add support for EAE multi interfac card
From: Michael Grzeschik @ 2014-09-24 13:29 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel
In-Reply-To: <1411556523-28100-1-git-send-email-m.grzeschik@pengutronix.de>

Hi,

On Wed, Sep 24, 2014 at 01:01:58PM +0200, Michael Grzeschik wrote:
> This series adds support for the PLX bridge based multi interface
> pci cards and adds support to change device address on com200xx chips
> during runtime.
> 
> Thanks,
> Michael
> 
> Michael Grzeschik (5):
>   ARCNET: return IRQ_NONE if the interface isn't running
>   ARCNET: add com20020_set_hwddr to change address
>   ARCNET: add com20020 PCI IDs with metadata
>   ARCNET: add support for multi interfaces on com20020
>   ARCNET: enable eae arcnet card support
> 
>  drivers/net/arcnet/arcnet.c       |   2 +-
>  drivers/net/arcnet/com20020-pci.c | 369 +++++++++++++++++++++++++++++---------
>  drivers/net/arcnet/com20020.c     |  14 ++
>  include/linux/com20020.h          |  29 +++
>  4 files changed, 330 insertions(+), 84 deletions(-)
> 
> -- 
> 2.1.0

This series was based on v3.16 and does not apply on master. Who could
expect somebody else be patching the arcnet dir in this century. :)

Will send a newer series in some minutes.

Michael Grzeschik


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply

* Re: BCM4313 & brcmsmac & 3.12: only semi-working?
From: Arend van Spriel @ 2014-09-24 13:28 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: Seth Forshee, brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <5421B78E.4050908-Gdu+ltImwkhes2APU0mLOQ@public.gmane.org>

On 09/23/14 20:10, Michael Tokarev wrote:
> 23.09.2014 21:35, Arend van Spriel wrote:
>> On 09/23/14 18:02, Michael Tokarev wrote:
>
>>> Oh. Indeed.  While I enabled it, I recompiled only drivers/net/wireless,
>>> but not net/.  Rebuilt, another trace is here --
>>>
>>>    http://www.corpit.ru/mjt/tmp/brcmsmac-4313-trace-201409233.dat.gz
>>>
>>> Thanks,
>>
>> Just to confirm. With this trace you also get a stall during wget?
>
> Yes.  Initially it started d/loading but some time later the d/load speed
> reduced to 0.  It is possible to wait further, and after some more time
> it will receive some more bytes/kilobytes/packets and stall again.  Overall
> progress is nearing zero.

I looked at the log. I see download commence because the packets 
received of 1562 bytes length. So within one second I see little over 
200 packets so approx. 3Mbps which is not impressive but I don't know 
what can be expected. Indeed after that it stalls and we only seem to 
receive small packets of 179 bytes that seem to end up in 
cfg80211_mgmt_rx. It could be that the hardware is somehow bogged and 
can not receive at higher modulations as management frames are 
transmitted at lower rates. The hardware will drop packets that are 
having FCS (aka. checksum) errors. The brcmsmac is missing some code to 
read fcs error count from hardware, but I will get back to you with a 
patch that we can use to confirm this.

Regards,
Arend

> Thanks,
>
> /mjt

--
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 v1 3/5] dtb: Add 10GbE node to APM X-Gene SoC device tree
From: Sergei Shtylyov @ 2014-09-24 13:24 UTC (permalink / raw)
  To: Iyappan Subramanian, davem, netdev, devicetree; +Cc: kchudgar, patches
In-Reply-To: <1411530688-2939-4-git-send-email-isubramanian@apm.com>

Hello.

On 9/24/2014 7:51 AM, Iyappan Subramanian wrote:

> Added 10GbE interface and clock nodes.

> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>

[...]

> diff --git a/arch/arm64/boot/dts/apm-storm.dtsi b/arch/arm64/boot/dts/apm-storm.dtsi
> index c0aceef..ae814ef 100644
> --- a/arch/arm64/boot/dts/apm-storm.dtsi
> +++ b/arch/arm64/boot/dts/apm-storm.dtsi
[...]
> @@ -421,5 +431,19 @@
>
>   			};
>   		};
> +
> +                xgenet: ethernet@1f610000 {
> +			compatible = "apm,xgene-enet";
> +                        status = "disabled";
> +                        reg = <0x0 0x1f610000 0x0 0xd100>,
> +                              <0x0 0x1f600000 0x0 0X400>,
> +                              <0x0 0x18000000 0x0 0X200>;
> +			reg-names = "enet_csr", "ring_csr", "ring_cmd";
> +                        interrupts = <0x0 0x60 0x4>;
> +			dma-coherent;
> +                        clocks = <&xge0clk 0>;
> +                        local-mac-address = [00 01 73 00 00 04];
> +			phy-connection-type = "xgmii";

   Please consistently indent with tabs.

WBR, Sergei

^ permalink raw reply

* Re: [PATCH v1 2/5] Documentation: dts: Update section header for APM X-Gene
From: Sergei Shtylyov @ 2014-09-24 13:22 UTC (permalink / raw)
  To: Iyappan Subramanian, davem, netdev, devicetree; +Cc: kchudgar, patches
In-Reply-To: <1411530688-2939-3-git-send-email-isubramanian@apm.com>

Hello.

On 9/24/2014 7:51 AM, Iyappan Subramanian wrote:

> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
> ---
>   Documentation/devicetree/bindings/net/apm-xgene-enet.txt | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)

> diff --git a/Documentation/devicetree/bindings/net/apm-xgene-enet.txt b/Documentation/devicetree/bindings/net/apm-xgene-enet.txt
> index ebcad25..60a7857 100644
> --- a/Documentation/devicetree/bindings/net/apm-xgene-enet.txt
> +++ b/Documentation/devicetree/bindings/net/apm-xgene-enet.txt
[...]
> @@ -15,6 +15,8 @@ Required properties:
>   - clocks: Reference to the clock entry.
>   - local-mac-address: MAC address assigned to this device
>   - phy-connection-type: Interface type between ethernet device and PHY device
> +
> +Required properties for ethernet interfaces that has external PHY:

    s/has/have/.

WBR, Sergei

^ permalink raw reply

* Re: [PATCH net-next v2] tcp: use tcp_flags in tcp_data_queue()
From: Eric Dumazet @ 2014-09-24 13:22 UTC (permalink / raw)
  To: Weiping Pan; +Cc: netdev, edumazet
In-Reply-To: <c02ed73dc0aa5bf5bdd479ec49403728db8e73c6.1411562110.git.panweiping3@gmail.com>

On Wed, 2014-09-24 at 20:42 +0800, Weiping Pan wrote:
> Follow the idea in commit e11ecddf5128 (tcp: use TCP_SKB_CB(skb)->tcp_flags in
> input path), we can use tcp_flags to avoid cache miss.
> 

Well, there is no cache miss here. Lets try to have precise changelogs.

We access tcp_hdr(skb)->doff right before, so the tcp header is in cpu
cache.

So this patch is a cleanup and a way to help compiler to reduce register
pressure since skb->cb[] access is fast (skb is probably in a register)

Thanks.

^ permalink raw reply


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