Netdev List
 help / color / mirror / Atom feed
* [PATCH] checkpatch: add double empty line check
From: Eilon Greenstein @ 2012-11-16 19:41 UTC (permalink / raw)
  To: Andy Whitcroft, linux-kernel; +Cc: Joe Perches, netdev

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 scripts/checkpatch.pl |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 21a9f5d..7a9c153 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3579,6 +3579,13 @@ sub process {
 			WARN("EXPORTED_WORLD_WRITABLE",
 			     "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
 		}
+
+# check for double empty lines
+		if ($line =~ /^\+\s*$/ &&
+		    ($prevline =~ /^\+?\s*$/ || $rawlines[$linenr] =~ /^\s*$/)) {
+			WARN("DOUBLE_EMPTY_LINE",
+			     "One empty line should be sufficient. Consider removing this one.\n" . $herecurr);
+		}
 	}
 
 	# If we have no input at all, then there is nothing to report on
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH] checkpatch: add double empty line check
From: David Rientjes @ 2012-11-16 19:55 UTC (permalink / raw)
  To: Eilon Greenstein; +Cc: Andy Whitcroft, linux-kernel, Joe Perches, netdev
In-Reply-To: <1353094919.14327.4.camel@lb-tlvb-eilong.il.broadcom.com>

On Fri, 16 Nov 2012, Eilon Greenstein wrote:

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 21a9f5d..7a9c153 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3579,6 +3579,13 @@ sub process {
>  			WARN("EXPORTED_WORLD_WRITABLE",
>  			     "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
>  		}
> +
> +# check for double empty lines
> +		if ($line =~ /^\+\s*$/ &&
> +		    ($prevline =~ /^\+?\s*$/ || $rawlines[$linenr] =~ /^\s*$/)) {
> +			WARN("DOUBLE_EMPTY_LINE",
> +			     "One empty line should be sufficient. Consider removing this one.\n" . $herecurr);
> +		}
>  	}
>  
>  	# If we have no input at all, then there is nothing to report on

This is fairly common in all the acpi code where variables declared in a 
function are separated from the code in a function.

^ permalink raw reply

* Re: [PATCH] checkpatch: add double empty line check
From: Eilon Greenstein @ 2012-11-16 20:04 UTC (permalink / raw)
  To: David Rientjes, Joe Perches; +Cc: Andy Whitcroft, linux-kernel, netdev
In-Reply-To: <alpine.DEB.2.00.1211161154280.2788@chino.kir.corp.google.com>

On Fri, 2012-11-16 at 11:55 -0800, David Rientjes wrote:
> On Fri, 16 Nov 2012, Eilon Greenstein wrote:
> 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 21a9f5d..7a9c153 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -3579,6 +3579,13 @@ sub process {
> >  			WARN("EXPORTED_WORLD_WRITABLE",
> >  			     "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
> >  		}
> > +
> > +# check for double empty lines
> > +		if ($line =~ /^\+\s*$/ &&
> > +		    ($prevline =~ /^\+?\s*$/ || $rawlines[$linenr] =~ /^\s*$/)) {
> > +			WARN("DOUBLE_EMPTY_LINE",
> > +			     "One empty line should be sufficient. Consider removing this one.\n" . $herecurr);
> > +		}
> >  	}
> >  
> >  	# If we have no input at all, then there is nothing to report on
> 
> This is fairly common in all the acpi code where variables declared in a 
> function are separated from the code in a function.
> 

Indeed, I see that you do use it in some functions.

Maybe we can limit it only to the networking tree (similar to the
networking comments style) or if the ACPI is the exception, we can apply
to all but ACPI.

^ permalink raw reply

* [PATCH net-next] gro: Handle inline VLAN tags
From: Ben Hutchings @ 2012-11-16 20:17 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, linux-net-drivers, Eric Dumazet, Andrew Gallatin,
	Herbert Xu

The receive paths for skbs with inline and out-of-line VLAN tags (VLAN
RX accleration) were made largely consistent in 2.6.37, with tags
pulled out by software as necessary.  However GRO doesn't do this, so
it is not effective for VLAN-tagged packets received on devices
without VLAN RX acceleration.

napi_gro_frags() must not free the skb and does not advance the
skb->data pointer, so cannot use vlan_untag().  Extract the core of
vlan_untag() into a new function __vlan_untag() that allows the offset
to the VLAN tag to be specified and returns an error code.  Add
kernel-doc comments for both those functions.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
Tested with sfc using both napi_gro_receive() and napi_gro_frags().  On
a Core i7 920 (Nehalem) system it increased TCP/IPv4 receive throughput
over a VLAN from ~8.0 to ~9.3 Gbit/s.

Ben.

 include/linux/if_vlan.h |    6 ++++
 net/8021q/vlan_core.c   |   60 ++++++++++++++++++++++++++++++++---------------
 net/core/dev.c          |   27 ++++++++++++++++----
 3 files changed, 68 insertions(+), 25 deletions(-)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index d06cc5c..a2167c3 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -91,6 +91,7 @@ extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
 extern u16 vlan_dev_vlan_id(const struct net_device *dev);
 
 extern bool vlan_do_receive(struct sk_buff **skb);
+extern int __vlan_untag(struct sk_buff *skb, int offset);
 extern struct sk_buff *vlan_untag(struct sk_buff *skb);
 
 extern int vlan_vid_add(struct net_device *dev, unsigned short vid);
@@ -126,6 +127,11 @@ static inline bool vlan_do_receive(struct sk_buff **skb)
 	return false;
 }
 
+static inline int __vlan_untag(struct sk_buff *skb, int offset)
+{
+	return 0;
+}
+
 static inline struct sk_buff *vlan_untag(struct sk_buff *skb)
 {
 	return skb;
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 65e06ab..8486430 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -93,20 +93,53 @@ u16 vlan_dev_vlan_id(const struct net_device *dev)
 }
 EXPORT_SYMBOL(vlan_dev_vlan_id);
 
-static struct sk_buff *vlan_reorder_header(struct sk_buff *skb)
+/**
+ *	__vlan_untag - pull VLAN tag out of 802.1q packet header
+ *	@skb: sk_buff to edit; may be cloned but not shared.
+ *	@offset: Offset from @skb->data to VLAN tag.  Must be either
+ *		0 or %ETH_HLEN.
+ *
+ *	This updates the @mac_header but no other header offset.  The
+ *	caller is expected to check the @protocol and that there is no
+ *	out-of-line tag before calling this.
+ */
+int __vlan_untag(struct sk_buff *skb, int offset)
 {
+	struct vlan_hdr *vhdr;
+	u16 vlan_tci;
+
+	if (unlikely(!pskb_may_pull(skb, offset + VLAN_HLEN)))
+		return -EINVAL;
+
+	vhdr = (struct vlan_hdr *) (skb->data + offset);
+	vlan_tci = ntohs(vhdr->h_vlan_TCI);
+	__vlan_hwaccel_put_tag(skb, vlan_tci);
+
+	skb->len -= VLAN_HLEN;
+	skb_postpull_rcsum(skb, skb->data + offset, VLAN_HLEN);
+	skb->data += VLAN_HLEN;
+	vlan_set_encap_proto(skb, vhdr);
+
 	if (skb_cow(skb, skb_headroom(skb)) < 0)
-		return NULL;
-	memmove(skb->data - ETH_HLEN, skb->data - VLAN_ETH_HLEN, 2 * ETH_ALEN);
+		return -ENOMEM;
+
+	memmove(skb->data + offset - ETH_HLEN,
+		skb->data + offset - VLAN_ETH_HLEN, 2 * ETH_ALEN);
 	skb->mac_header += VLAN_HLEN;
-	return skb;
+	return 0;
 }
 
+/**
+ *	vlan_untag - pull VLAN tag out of packet header, if appropriate
+ *	@skb: sk_buff to edit; may be cloned or shared.
+ *
+ *	If @skb has an inline VLAN tag and no out-of-line VLAN tag,
+ *	pull the tag out-of-line and reset all header offsets.  Return
+ *	the edited sk_buff.  If allocation fails or the VLAN tag is
+ *	invalid, free @skb and return NULL.
+ */
 struct sk_buff *vlan_untag(struct sk_buff *skb)
 {
-	struct vlan_hdr *vhdr;
-	u16 vlan_tci;
-
 	if (unlikely(vlan_tx_tag_present(skb))) {
 		/* vlan_tci is already set-up so leave this for another time */
 		return skb;
@@ -116,18 +149,7 @@ struct sk_buff *vlan_untag(struct sk_buff *skb)
 	if (unlikely(!skb))
 		goto err_free;
 
-	if (unlikely(!pskb_may_pull(skb, VLAN_HLEN)))
-		goto err_free;
-
-	vhdr = (struct vlan_hdr *) skb->data;
-	vlan_tci = ntohs(vhdr->h_vlan_TCI);
-	__vlan_hwaccel_put_tag(skb, vlan_tci);
-
-	skb_pull_rcsum(skb, VLAN_HLEN);
-	vlan_set_encap_proto(skb, vhdr);
-
-	skb = vlan_reorder_header(skb);
-	if (unlikely(!skb))
+	if (unlikely(__vlan_untag(skb, 0)))
 		goto err_free;
 
 	skb_reset_network_header(skb);
diff --git a/net/core/dev.c b/net/core/dev.c
index b4978e2..9d658eb 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3668,6 +3668,13 @@ static void skb_gro_reset_offset(struct sk_buff *skb)
 
 gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
 {
+	if (unlikely(skb->protocol == htons(ETH_P_8021Q)) &&
+	    !vlan_tx_tag_present(skb)) {
+		skb = vlan_untag(skb);
+		if (unlikely(!skb))
+			return GRO_DROP;
+	}
+
 	skb_gro_reset_offset(skb);
 
 	return napi_skb_finish(__napi_gro_receive(napi, skb), skb);
@@ -3743,11 +3750,8 @@ static struct sk_buff *napi_frags_skb(struct napi_struct *napi)
 	eth = skb_gro_header_fast(skb, off);
 	if (skb_gro_header_hard(skb, hlen)) {
 		eth = skb_gro_header_slow(skb, hlen, off);
-		if (unlikely(!eth)) {
-			napi_reuse_skb(napi, skb);
-			skb = NULL;
-			goto out;
-		}
+		if (unlikely(!eth))
+			goto fail;
 	}
 
 	skb_gro_pull(skb, sizeof(*eth));
@@ -3758,8 +3762,19 @@ static struct sk_buff *napi_frags_skb(struct napi_struct *napi)
 	 */
 	skb->protocol = eth->h_proto;
 
-out:
+	if (unlikely(skb->protocol == htons(ETH_P_8021Q)) &&
+	    !vlan_tx_tag_present(skb)) {
+		if (unlikely(__vlan_untag(skb, sizeof(*eth))))
+			goto fail;
+		skb_gro_reset_offset(skb);
+		skb_gro_pull(skb, sizeof(*eth));
+	}
+
 	return skb;
+
+fail:
+	napi_reuse_skb(napi, skb);
+	return NULL;
 }
 
 gro_result_t napi_gro_frags(struct napi_struct *napi)
-- 
1.7.7.6


-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related

* [PATCH] net: remove unnecessary wireless includes
From: Johannes Berg @ 2012-11-16 20:59 UTC (permalink / raw)
  To: linux-wireless; +Cc: netdev, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

The wireless and wext includes in net-sysfs.c aren't
needed, so remove them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/core/net-sysfs.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index bcf02f6..b407879 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -18,11 +18,9 @@
 #include <net/sock.h>
 #include <net/net_namespace.h>
 #include <linux/rtnetlink.h>
-#include <linux/wireless.h>
 #include <linux/vmalloc.h>
 #include <linux/export.h>
 #include <linux/jiffies.h>
-#include <net/wext.h>
 
 #include "net-sysfs.h"
 
-- 
1.8.0

^ permalink raw reply related

* [PATCH v2 net-next] sockopt: Change getsockopt() of SO_BINDTODEVICE to return an interface name
From: Brian Haley @ 2012-11-16 20:58 UTC (permalink / raw)
  To: David Miller; +Cc: Pavel Emelyanov, Eric Dumazet, netdev@vger.kernel.org

Instead of having the getsockopt() of SO_BINDTODEVICE return an index, which
will then require another call like if_indextoname() to get the actual interface
name, have it return the name directly.

This also matches the existing man page description on socket(7) which mentions
the argument being an interface name.

If the value has not been set, zero is returned and optlen will be set to zero
to indicate there is no interface name present.

Added a seqlock to protect this code path, and dev_ifname(), from someone
changing the device name via dev_change_name().

v2: Added seqlock protection while copying device name.

Signed-off-by: Brian Haley <brian.haley@hp.com>

--

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index e46c830..e9929ab 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1567,6 +1567,8 @@ extern int call_netdevice_notifiers(unsigned long val,
struct net_device *dev);

 extern rwlock_t				dev_base_lock;		/* Device list lock */

+extern seqlock_t	devnet_rename_seq;	/* Device rename lock */
+

 #define for_each_netdev(net, d)		\
 		list_for_each_entry(d, &(net)->dev_base_head, dev_list)
diff --git a/net/core/dev.c b/net/core/dev.c
index 2705a2a..3a576ed 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -203,6 +203,8 @@ static struct list_head offload_base __read_mostly;
 DEFINE_RWLOCK(dev_base_lock);
 EXPORT_SYMBOL(dev_base_lock);

+DEFINE_SEQLOCK(devnet_rename_seq);
+
 static inline void dev_base_seq_inc(struct net *net)
 {
 	while (++net->dev_base_seq == 0);
@@ -1091,22 +1093,31 @@ int dev_change_name(struct net_device *dev, const char
*newname)
 	if (dev->flags & IFF_UP)
 		return -EBUSY;

-	if (strncmp(newname, dev->name, IFNAMSIZ) == 0)
+	write_seqlock(&devnet_rename_seq);
+
+	if (strncmp(newname, dev->name, IFNAMSIZ) == 0) {
+		write_sequnlock(&devnet_rename_seq);
 		return 0;
+	}

 	memcpy(oldname, dev->name, IFNAMSIZ);

 	err = dev_get_valid_name(net, dev, newname);
-	if (err < 0)
+	if (err < 0) {
+		write_sequnlock(&devnet_rename_seq);
 		return err;
+	}

 rollback:
 	ret = device_rename(&dev->dev, dev->name);
 	if (ret) {
 		memcpy(dev->name, oldname, IFNAMSIZ);
+		write_sequnlock(&devnet_rename_seq);
 		return ret;
 	}

+	write_sequnlock(&devnet_rename_seq);
+
 	write_lock_bh(&dev_base_lock);
 	hlist_del_rcu(&dev->name_hlist);
 	write_unlock_bh(&dev_base_lock);
@@ -1124,6 +1135,7 @@ rollback:
 		/* err >= 0 after dev_alloc_name() or stores the first errno */
 		if (err >= 0) {
 			err = ret;
+			write_seqlock(&devnet_rename_seq);
 			memcpy(dev->name, oldname, IFNAMSIZ);
 			goto rollback;
 		} else {
@@ -4148,6 +4160,7 @@ static int dev_ifname(struct net *net, struct ifreq __user
*arg)
 {
 	struct net_device *dev;
 	struct ifreq ifr;
+	unsigned seq;

 	/*
 	 *	Fetch the caller's info block.
@@ -4156,6 +4169,8 @@ static int dev_ifname(struct net *net, struct ifreq __user
*arg)
 	if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
 		return -EFAULT;

+retry:
+	seq = read_seqbegin(&devnet_rename_seq);
 	rcu_read_lock();
 	dev = dev_get_by_index_rcu(net, ifr.ifr_ifindex);
 	if (!dev) {
@@ -4165,6 +4180,8 @@ static int dev_ifname(struct net *net, struct ifreq __user
*arg)

 	strcpy(ifr.ifr_name, dev->name);
 	rcu_read_unlock();
+	if (read_seqretry(&devnet_rename_seq, seq))
+		goto retry;

 	if (copy_to_user(arg, &ifr, sizeof(struct ifreq)))
 		return -EFAULT;
diff --git a/net/core/sock.c b/net/core/sock.c
index 0628600..f2a42e3 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -505,7 +505,8 @@ struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie)
 }
 EXPORT_SYMBOL(sk_dst_check);

-static int sock_bindtodevice(struct sock *sk, char __user *optval, int optlen)
+static int sock_setbindtodevice(struct sock *sk, char __user *optval,
+				int optlen)
 {
 	int ret = -ENOPROTOOPT;
 #ifdef CONFIG_NETDEVICES
@@ -562,6 +563,59 @@ out:
 	return ret;
 }

+static int sock_getbindtodevice(struct sock *sk, char __user *optval,
+				int __user *optlen, int len)
+{
+	int ret = -ENOPROTOOPT;
+#ifdef CONFIG_NETDEVICES
+	struct net *net = sock_net(sk);
+	struct net_device *dev;
+	char devname[IFNAMSIZ];
+	unsigned seq;
+
+	if (sk->sk_bound_dev_if == 0) {
+		len = 0;
+		goto zero;
+	}
+
+	ret = -EINVAL;
+	if (len < IFNAMSIZ)
+		goto out;
+
+retry:
+	seq = read_seqbegin(&devnet_rename_seq);
+	rcu_read_lock();
+	dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if);
+	ret = -ENODEV;
+	if (!dev) {
+		rcu_read_unlock();
+		goto out;
+	}
+
+	strcpy(devname, dev->name);
+	rcu_read_unlock();
+	if (read_seqretry(&devnet_rename_seq, seq))
+		goto retry;
+
+	len = strlen(devname) + 1;
+
+	ret = -EFAULT;
+	if (copy_to_user(optval, devname, len))
+		goto out;
+
+zero:
+	ret = -EFAULT;
+	if (put_user(len, optlen))
+		goto out;
+
+	ret = 0;
+
+out:
+#endif
+
+	return ret;
+}
+
 static inline void sock_valbool_flag(struct sock *sk, int bit, int valbool)
 {
 	if (valbool)
@@ -589,7 +643,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
 	 */

 	if (optname == SO_BINDTODEVICE)
-		return sock_bindtodevice(sk, optval, optlen);
+		return sock_setbindtodevice(sk, optval, optlen);

 	if (optlen < sizeof(int))
 		return -EINVAL;
@@ -1074,15 +1128,17 @@ int sock_getsockopt(struct socket *sock, int level, int
optname,
 	case SO_NOFCS:
 		v.val = sock_flag(sk, SOCK_NOFCS);
 		break;
+
 	case SO_BINDTODEVICE:
-		v.val = sk->sk_bound_dev_if;
-		break;
+		return sock_getbindtodevice(sk, optval, optlen, len);
+
 	case SO_GET_FILTER:
 		len = sk_get_filter(sk, (struct sock_filter __user *)optval, len);
 		if (len < 0)
 			return len;

 		goto lenout;
+
 	default:
 		return -ENOPROTOOPT;
 	}

^ permalink raw reply related

* Re: Linux kernel handling of IPv6 temporary addresses
From: Ben Hutchings @ 2012-11-16 21:27 UTC (permalink / raw)
  To: David Miller; +Cc: kargig, netdev
In-Reply-To: <20121114.180824.1930899985436392426.davem@davemloft.net>

On Wed, 2012-11-14 at 18:08 -0500, David Miller wrote:
> From: George Kargiotakis <kargig@void.gr>
> Date: Thu, 15 Nov 2012 01:03:24 +0200
> 
> > I think it's an issue that a LAN root user can disable a
> > locally enabled kernel "feature" for good. The kernel could provide a
> > somewhat more informative message on such an occasion taking place,
> > since it knows that max_addresses limit has been reached and it's not a
> > DAD failure.
> > 
> > My point is that I'd like the kernel to handle this situation a bit 
> > differently than it currently does.
> 
> Read my example again, it's the same thing for ipv4.
> 
> The root LAN user can disable all IPV4 communications to arbitrary IP
> addresses on the local LAN by emitting bogus ARP requests and
> poisoning everyone's caches.  What's the difference between that
> and this arbitrary ipv6 issue?
> 
> There is none at all.
> 
> If you have a root person on your local LAN you're subject to injection
> of bogus addressing and routing information.  This issue is not specific
> to ipv4 or ipv6 and is fundamental in nature.
> 
> So it is misleading to bring this up as an ipv6 specific problem, it's
> not.

You're quite right about this, but I think George's point may be that
it's harder to recover if and when the malicious traffic is stopped.
Poisoned ARP table entries will expire fairly quickly.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* Re: [PATCH v2 net-next] sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
From: Thomas Graf @ 2012-11-16 21:47 UTC (permalink / raw)
  To: Neil Horman
  Cc: Michele Baldessari, linux-sctp, Vlad Yasevich, netdev,
	David S. Miller
In-Reply-To: <20121116163922.GA9722@hmsreliant.think-freely.org>

On 11/16/12 at 11:39am, Neil Horman wrote:
> Yes, I think this is good, I still don't like the idea of having to do these via
> an ioctl, but I suppose it fits well enough.

I'm with you on this. I have started scribbling notes on paper for
a netlink based stats retriever. We should discuss this at some
point making sure we get everyone on board with interests in this
and solve this nice and clean for everyone to enjoy.

I guess the ioctl is the best we can do as long as we don't have
the above.

^ permalink raw reply

* Re: linux-next: Tree for Nov 15 (pch_gbe)
From: Randy Dunlap @ 2012-11-16 21:48 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linux-next, linux-kernel, netdev@vger.kernel.org, Andrew Morton,
	LAPIS SEMICONDUCTOR
In-Reply-To: <20121115181740.4fb08780f0b92149a5ed2ca4@canb.auug.org.au>

On 11/14/2012 11:17 PM, Stephen Rothwell wrote:

> Hi all,
> 
> News: this one will be the last release until next-20121126 (which should
> be just be after -rc7, I guess - assuming that Linus does not release
> v3.7 before then).
> 
> Changes since 20121114:
> 


on x86_64:

drivers/built-in.o: In function `pch_tx_timestamp':
pch_gbe_main.c:(.text+0x5b9b08): undefined reference to `pch_ch_event_read'
pch_gbe_main.c:(.text+0x5b9b39): undefined reference to `pch_tx_snap_read'
pch_gbe_main.c:(.text+0x5b9b6c): undefined reference to `pch_ch_event_write'
drivers/built-in.o: In function `pch_rx_timestamp':
pch_gbe_main.c:(.text+0x5ba648): undefined reference to `pch_ch_event_read'
pch_gbe_main.c:(.text+0x5ba658): undefined reference to `pch_src_uuid_lo_read'
pch_gbe_main.c:(.text+0x5ba663): undefined reference to `pch_src_uuid_hi_read'
pch_gbe_main.c:(.text+0x5ba709): undefined reference to `pch_ch_event_write'
pch_gbe_main.c:(.text+0x5ba717): undefined reference to `pch_rx_snap_read'
drivers/built-in.o: In function `hwtstamp_ioctl.clone.13':
pch_gbe_main.c:(.text+0x5bb3b0): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x5bb3c9): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x5bb3e2): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x5bb406): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x5bb426): undefined reference to `pch_set_station_address'
pch_gbe_main.c:(.text+0x5bb433): undefined reference to `pch_ch_event_write'

when PTP_1588_CLOCK_PCH is not enabled.

Want to select PTP_1588_CLOCK_PCH for PCH_GBE?

-- 
~Randy

^ permalink raw reply

* Re: [PATCH v4 4/9] net: openvswitch: use this_cpu_ptr per-cpu helper
From: Jesse Gross @ 2012-11-16 21:53 UTC (permalink / raw)
  To: Shan Wei
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, Tejun Heo,
	cl-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, NetDev, Kernel-Maillist,
	David Miller
In-Reply-To: <50A5FAEB.7090202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Fri, Nov 16, 2012 at 12:35 AM, Shan Wei <shanwei88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Shan Wei said, at 2012/11/13 9:52:
>> From: Shan Wei <davidshan-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
>>
>> just use more faster this_cpu_ptr instead of per_cpu_ptr(p, smp_processor_id());
>>
>>
>> Signed-off-by: Shan Wei <davidshan-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
>> Reviewed-by: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
>
> Jesse Gross,  would you like to pick it up to your tree?

Applied, thanks.

^ permalink raw reply

* Re: [RFC PATCH 13/13] ipv6: Pull IPv6 GSO registration out of the module
From: Ben Hutchings @ 2012-11-16 22:04 UTC (permalink / raw)
  To: Vlad Yasevich; +Cc: netdev, eric.dumazet, davem
In-Reply-To: <1352856254-29667-14-git-send-email-vyasevic@redhat.com>

On Tue, 2012-11-13 at 20:24 -0500, Vlad Yasevich wrote:
> Sing GSO support is now separate, pull it out of the module

Sing?  Can we dance, too?

> and make it its own init call.
> Remove the cleanup functions as they are no longer called.
[...]
> --- a/include/net/protocol.h
> +++ b/include/net/protocol.h
> @@ -25,6 +25,7 @@
>  #define _PROTOCOL_H
>  
>  #include <linux/in6.h>
> +#include <linux/skbuff.h>
>  #if IS_ENABLED(CONFIG_IPV6)
>  #include <linux/ipv6.h>
>  #endif
> @@ -59,8 +60,6 @@ struct inet6_protocol {
>  
>  #define INET6_PROTO_NOPOLICY	0x1
>  #define INET6_PROTO_FINAL	0x2
> -/* This should be set for any extension header which is compatible with GSO. */
> -#define INET6_PROTO_GSO_EXTHDR	0x4
>  #endif
>  
>  struct net_offload {
> @@ -72,6 +71,8 @@ struct net_offload {
>  	int			(*gro_complete)(struct sk_buff *skb);
>  	unsigned int		flags;	/* Flags used by IPv6 for now */
>  };
> +/* This should be set for any extension header which is compatible with GSO. */
> +#define INET6_PROTO_GSO_EXTHDR	0x1
[...]

Should be renamed to INET6_OFFLOAD_GSO_EXTHDR, matching the new
structure name.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* [GIT] Networking
From: David Miller @ 2012-11-16 22:07 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


1) tx_filtered/ps_tx_buf queues need to be accessed with the SKB queue
   lock, from Arik Nemtsov.

2) Don't call 802.11 driver's filter configure method until it's
   actually open, from Felix Fietkau.

3) Use ieee80211_free_txskb otherwise we leak control information.
   From Johannes Berg.

4) Fix memory leak in bluetooth UUID removal,f rom Johan Hedberg.

5) The shift mask trick doesn't work properly when 'optname' is
   out of range in do_ip_setsockopt().  Use a straightforward
   switch statement instead, the compiler emits essentially the
   same code but without the missing range check.  From Xi Wang.

6) Fix when we call tcp_replace_ts_recent() otherwise we can
   erroneously accept a too-high tsval.  From Eric Dumazet.

7) VXLAN bug fixes, mostly to do with VLAN header length handling,
   from Alexander Duyck.

8) Missing return value initialization for IPV6_MINHOPCOUNT socket
   option handling.  From Hannes Frederic.

9) Fix regression in tasklet handling in jme/ksz884x/xilinx drivers,
   from Xiaotian Feng.

10) At smsc911x driver init time, we don't know if the chip is in word
    swap mode or not.  However we do need to wait for the control
    register's ready bit to be set before we program any other part of
    the chip.  Adjust the wait loop to account for this.  From
    Kamlakant Patel.

11) Revert erroneous MDIO bus unregister change to mdio-bitbang.c

12) Fix memory leak in /proc/net/sctp/, from Tommi Rantala.

13) tilegx driver registers IRQ with NULL name, oops, from Simon
    Marchi.

14) TCP metrics hash table kzalloc() based allocation can fail, back
    down to using vmalloc() if it does.  From Eric Dumazet.

15) Fix packet steering out-of-order delivery regression, from Tom
    Herbert.

Please pull, thanks a lot!

The following changes since commit 77b67063bb6bce6d475e910d3b886a606d0d91f7:

  Linux 3.7-rc5 (2012-11-11 13:44:33 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/davem/net master

for you to fetch changes up to a8203d3ccd7796675739aaa50f708a047601eed2:

  Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless (2012-11-16 14:37:18 -0500)

----------------------------------------------------------------

Alexander Duyck (2):
      vxlan: Fix error that was resulting in VXLAN MTU size being 10 bytes too large
      vxlan: Update hard_header_len based on lowerdev when instantiating VXLAN

Andrew Vagin (1):
      tcp: fix retransmission in repair mode

Antonio Quartulli (4):
      batman-adv: fix tt_global_entries flags update
      batman-adv: correctly pass the client flag on tt_response
      batman-adv: don't add TEMP clients belonging to other backbone nodes
      batman-adv: process broadcast packets in BLA earlier

Arik Nemtsov (1):
      mac80211: sync acccess to tx_filtered/ps_tx_buf queues

Bjørn Mork (1):
      net: cdc_ncm: add Huawei devices

David S. Miller (3):
      Revert "drivers/net/phy/mdio-bitbang.c: Call mdiobus_unregister before mdiobus_free"
      Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge
      Merge branch 'for-davem' of git://git.kernel.org/.../linville/wireless

David Spinadel (1):
      mac80211: init sched_scan_ies

Eric Dumazet (2):
      tcp: tcp_replace_ts_recent() should not be called from tcp_validate_incoming()
      tcp: handle tcp_net_metrics_init() order-5 memory allocation failures

Felix Fietkau (2):
      mac80211: do not call ieee80211_configure_filter if no interfaces are up
      mac80211: call skb_dequeue/ieee80211_free_txskb instead of __skb_queue_purge

Hannes Frederic Sowa (1):
      ipv6: setsockopt(IPIPPROTO_IPV6, IPV6_MINHOPCOUNT) forgot to set return value

Hauke Mehrtens (1):
      brcmfmac: fix typo in CONFIG_BRCMISCAN

Jiri Pirko (1):
      net: correct check in dev_addr_del()

Johan Hedberg (2):
      Bluetooth: Fix having bogus entries in mgmt_read_index_list reply
      Bluetooth: Fix memory leak when removing a UUID

Johannes Berg (5):
      iwlwifi: handle DMA mapping failures
      iwlwifi: use ieee80211_free_txskb
      mac80211: fix memory leak in device registration error path
      mac80211: don't send null data packet when not associated
      wireless: allow 40 MHz on world roaming channels 12/13

John W. Linville (4):
      Merge branch 'for-john' of git://git.kernel.org/.../jberg/mac80211
      Merge branch 'for-john' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
      Merge branch 'master' of git://git.kernel.org/.../bluetooth/bluetooth
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem

Kamlakant Patel (1):
      net/smsc911x: Fix ready check in cases where WORD_SWAP is needed

Kirill Smelkov (1):
      doc/net: Fix typo in netdev-features.txt

Marcel Holtmann (1):
      Bluetooth: Notify about device registration before power on

Marcos Chaparro (1):
      Bluetooth: ath3k: Add support for VAIO VPCEH [0489:e027]

Paulo Sérgio (1):
      Bluetooth: Fix error status when pairing fails

Rami Rosen (1):
      vxlan: fix a typo.

Saurabh Mohan (1):
      ipv4/ip_vti.c: VTI fix post-decryption forwarding

Simon Marchi (1):
      tilegx: request_irq with a non-null device name

Stefan Raspl (1):
      qeth: Fix IPA_CMD_QIPASSIST return code handling

Steve Glendinning (1):
      smsc95xx: set MII_BUSY bit to read/write PHY regs

Tom Herbert (1):
      net-rps: Fix brokeness causing OOO packets

Tommi Rantala (1):
      sctp: fix /proc/net/sctp/ memory leak

Ursula Braun (1):
      qeth: set new mac even if old mac is gone

Xi Wang (1):
      ipv4: avoid undefined behavior in do_ip_setsockopt()

Xiaotian Feng (1):
      drivers/net: fix tasklet misuse issue

 Documentation/networking/netdev-features.txt          |  2 +-
 drivers/bluetooth/ath3k.c                             |  1 +
 drivers/bluetooth/btusb.c                             |  1 +
 drivers/net/ethernet/jme.c                            | 28 ++++++++--------------------
 drivers/net/ethernet/micrel/ksz884x.c                 | 16 ++++------------
 drivers/net/ethernet/smsc/smsc911x.c                  | 17 +++++++++++++++--
 drivers/net/ethernet/tile/tilegx.c                    |  2 +-
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c     | 12 ++++++------
 drivers/net/phy/mdio-bitbang.c                        |  1 -
 drivers/net/usb/cdc_ncm.c                             | 22 ++++++++++++++++++----
 drivers/net/usb/smsc95xx.c                            |  4 ++--
 drivers/net/vxlan.c                                   | 10 +++++++---
 drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c |  2 +-
 drivers/net/wireless/iwlwifi/dvm/mac80211.c           |  2 +-
 drivers/net/wireless/iwlwifi/dvm/main.c               |  2 +-
 drivers/net/wireless/iwlwifi/pcie/rx.c                | 23 +++++++++++++++++++++--
 drivers/s390/net/qeth_core_main.c                     | 24 ++++++++++++++++++++++--
 drivers/s390/net/qeth_l2_main.c                       | 13 ++++++++-----
 net/batman-adv/soft-interface.c                       | 12 ++++++------
 net/batman-adv/translation-table.c                    | 15 ++++++++++++++-
 net/bluetooth/hci_core.c                              |  4 ++--
 net/bluetooth/mgmt.c                                  | 12 +++++++-----
 net/bluetooth/smp.c                                   |  2 +-
 net/core/dev.c                                        |  4 +++-
 net/core/dev_addr_lists.c                             |  3 ++-
 net/ipv4/ip_sockglue.c                                | 35 ++++++++++++++++++++++-------------
 net/ipv4/ip_vti.c                                     |  5 +++++
 net/ipv4/tcp.c                                        |  4 ++--
 net/ipv4/tcp_input.c                                  | 15 ++++++++++-----
 net/ipv4/tcp_metrics.c                                | 12 +++++++++---
 net/ipv4/tcp_output.c                                 |  4 ++++
 net/ipv6/ipv6_sockglue.c                              |  1 +
 net/mac80211/cfg.c                                    |  3 +++
 net/mac80211/ieee80211_i.h                            |  2 ++
 net/mac80211/main.c                                   |  6 ++++--
 net/mac80211/scan.c                                   |  2 +-
 net/mac80211/sta_info.c                               | 11 ++++++++---
 net/mac80211/status.c                                 |  9 +++++++++
 net/mac80211/tx.c                                     |  9 ++++++---
 net/mac80211/util.c                                   |  2 ++
 net/sctp/proc.c                                       |  8 ++++----
 net/wireless/reg.c                                    |  5 ++---
 42 files changed, 247 insertions(+), 120 deletions(-)

^ permalink raw reply

* [PATCH net-next 0/3] Remove inet_lro remnants
From: Ben Hutchings @ 2012-11-16 22:40 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Eric Dumazet

Eric's comments on LRO/GRO conversion prompted me to check what was
still using inet_lro.  Not very many drivers, but there are a few
unnecessary references outside the code.

Ben.

Ben Hutchings (3):
  mlx4_en: Remove remnants of LRO support
  ehea: Remove remnants of LRO support
  net: Remove bogus dependencies on INET

 drivers/net/ethernet/chelsio/Kconfig         |    4 ++--
 drivers/net/ethernet/cisco/Kconfig           |    2 +-
 drivers/net/ethernet/cisco/enic/Kconfig      |    2 +-
 drivers/net/ethernet/emulex/Kconfig          |    2 +-
 drivers/net/ethernet/emulex/benet/Kconfig    |    2 +-
 drivers/net/ethernet/ibm/Kconfig             |    5 ++---
 drivers/net/ethernet/ibm/ehea/ehea_main.c    |    2 +-
 drivers/net/ethernet/intel/Kconfig           |    2 +-
 drivers/net/ethernet/mellanox/Kconfig        |    2 +-
 drivers/net/ethernet/mellanox/mlx4/Kconfig   |    3 +--
 drivers/net/ethernet/mellanox/mlx4/en_rx.c   |    9 +++------
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h |   17 -----------------
 drivers/net/ethernet/neterion/Kconfig        |    2 +-
 drivers/net/ethernet/sfc/Kconfig             |    2 +-
 14 files changed, 17 insertions(+), 39 deletions(-)

-- 
1.7.7.6


-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* [PATCH net-next 1/3] mlx4_en: Remove remnants of LRO support
From: Ben Hutchings @ 2012-11-16 22:44 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Eric Dumazet, Or Gerlitz, Roland Dreier
In-Reply-To: <1353105635.2743.49.camel@bwh-desktop.uk.solarflarecom.com>

Commit fa37a9586f92051de03a13e55e5ec3880bb6783e ('mlx4_en: Moving to
work with GRO') left behind the Kconfig depends/select, some dead
code and comments referring to LRO.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
The check for GRO eligibility in mlx4_en_process_rx_cq() should also be
redundant, but I didn't touch it.

Ben.

 drivers/net/ethernet/mellanox/mlx4/Kconfig   |    3 +--
 drivers/net/ethernet/mellanox/mlx4/en_rx.c   |    9 +++------
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h |   17 -----------------
 3 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/Kconfig b/drivers/net/ethernet/mellanox/mlx4/Kconfig
index 5f027f9..eb520ab 100644
--- a/drivers/net/ethernet/mellanox/mlx4/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx4/Kconfig
@@ -4,9 +4,8 @@
 
 config MLX4_EN
 	tristate "Mellanox Technologies 10Gbit Ethernet support"
-	depends on PCI && INET
+	depends on PCI
 	select MLX4_CORE
-	select INET_LRO
 	---help---
 	  This driver supports Mellanox Technologies ConnectX Ethernet
 	  devices.
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 5aba5ec..f76c967 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -630,7 +630,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
 			if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) &&
 			    (cqe->checksum == cpu_to_be16(0xffff))) {
 				ring->csum_ok++;
-				/* This packet is eligible for LRO if it is:
+				/* This packet is eligible for GRO if it is:
 				 * - DIX Ethernet (type interpretation)
 				 * - TCP/IP (v4)
 				 * - without IP options
@@ -667,7 +667,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
 					goto next;
 				}
 
-				/* LRO not possible, complete processing here */
+				/* GRO not possible, complete processing here */
 				ip_summed = CHECKSUM_UNNECESSARY;
 			} else {
 				ip_summed = CHECKSUM_NONE;
@@ -710,11 +710,8 @@ next:
 		++cq->mcq.cons_index;
 		index = (cq->mcq.cons_index) & ring->size_mask;
 		cqe = &cq->buf[index];
-		if (++polled == budget) {
-			/* We are here because we reached the NAPI budget -
-			 * flush only pending LRO sessions */
+		if (++polled == budget)
 			goto out;
-		}
 	}
 
 out:
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 9d27e42..1809a8b 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -95,8 +95,6 @@
 #define MLX4_EN_ALLOC_SIZE	PAGE_ALIGN(16384)
 #define MLX4_EN_ALLOC_ORDER	get_order(MLX4_EN_ALLOC_SIZE)
 
-#define MLX4_EN_MAX_LRO_DESCRIPTORS	32
-
 /* Receive fragment sizes; we use at most 4 fragments (for 9600 byte MTU
  * and 4K allocations) */
 enum {
@@ -290,21 +288,6 @@ struct mlx4_en_rx_ring {
 	unsigned long csum_none;
 };
 
-
-static inline int mlx4_en_can_lro(__be16 status)
-{
-	return (status & cpu_to_be16(MLX4_CQE_STATUS_IPV4	|
-				     MLX4_CQE_STATUS_IPV4F	|
-				     MLX4_CQE_STATUS_IPV6	|
-				     MLX4_CQE_STATUS_IPV4OPT	|
-				     MLX4_CQE_STATUS_TCP	|
-				     MLX4_CQE_STATUS_UDP	|
-				     MLX4_CQE_STATUS_IPOK)) ==
-		cpu_to_be16(MLX4_CQE_STATUS_IPV4 |
-			    MLX4_CQE_STATUS_IPOK |
-			    MLX4_CQE_STATUS_TCP);
-}
-
 struct mlx4_en_cq {
 	struct mlx4_cq          mcq;
 	struct mlx4_hwq_resources wqres;
-- 
1.7.7.6



-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related

* [PATCH net-next 2/3] ehea: Remove remnants of LRO support
From: Ben Hutchings @ 2012-11-16 22:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Eric Dumazet, Thadeu Lima de Souza Cascardo
In-Reply-To: <1353105635.2743.49.camel@bwh-desktop.uk.solarflarecom.com>

Commit 2cb1deb56f5bf413da83491e0cb5a0474393c8ef ('ehea: Remove LRO
support') left behind the Kconfig depends/select and feature flag.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
This is not even compile-tested, as I don't have a suitable
cross-compiler to hand.

Ben.

 drivers/net/ethernet/ibm/Kconfig          |    5 ++---
 drivers/net/ethernet/ibm/ehea/ehea_main.c |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ibm/Kconfig b/drivers/net/ethernet/ibm/Kconfig
index b9773d2..6529d31 100644
--- a/drivers/net/ethernet/ibm/Kconfig
+++ b/drivers/net/ethernet/ibm/Kconfig
@@ -6,7 +6,7 @@ config NET_VENDOR_IBM
 	bool "IBM devices"
 	default y
 	depends on MCA || PPC_PSERIES || PPC_PSERIES || PPC_DCR || \
-		   (IBMEBUS && INET && SPARSEMEM)
+		   (IBMEBUS && SPARSEMEM)
 	---help---
 	  If you have a network (Ethernet) card belonging to this class, say Y
 	  and read the Ethernet-HOWTO, available from
@@ -33,8 +33,7 @@ source "drivers/net/ethernet/ibm/emac/Kconfig"
 
 config EHEA
 	tristate "eHEA Ethernet support"
-	depends on IBMEBUS && INET && SPARSEMEM
-	select INET_LRO
+	depends on IBMEBUS && SPARSEMEM
 	---help---
 	  This driver supports the IBM pSeries eHEA ethernet adapter.
 
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index f4d2da0..09faf33 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -3028,7 +3028,7 @@ static struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
 	ehea_set_ethtool_ops(dev);
 
 	dev->hw_features = NETIF_F_SG | NETIF_F_TSO
-		      | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX | NETIF_F_LRO;
+		      | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX;
 	dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
 		      | NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
 		      | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER
-- 
1.7.7.6



-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related

* [PATCH net-next 3/3] net: Remove bogus dependencies on INET
From: Ben Hutchings @ 2012-11-16 22:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Eric Dumazet
In-Reply-To: <1353105635.2743.49.camel@bwh-desktop.uk.solarflarecom.com>

Various drivers depend on INET because they used to select INET_LRO,
but they have all been converted to use GRO which has no such
dependency.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
Compile-tested with INET disabled.

Ben.

 drivers/net/ethernet/chelsio/Kconfig      |    4 ++--
 drivers/net/ethernet/cisco/Kconfig        |    2 +-
 drivers/net/ethernet/cisco/enic/Kconfig   |    2 +-
 drivers/net/ethernet/emulex/Kconfig       |    2 +-
 drivers/net/ethernet/emulex/benet/Kconfig |    2 +-
 drivers/net/ethernet/intel/Kconfig        |    2 +-
 drivers/net/ethernet/mellanox/Kconfig     |    2 +-
 drivers/net/ethernet/neterion/Kconfig     |    2 +-
 drivers/net/ethernet/sfc/Kconfig          |    2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/Kconfig b/drivers/net/ethernet/chelsio/Kconfig
index 2de50f9..a71c0f3 100644
--- a/drivers/net/ethernet/chelsio/Kconfig
+++ b/drivers/net/ethernet/chelsio/Kconfig
@@ -5,7 +5,7 @@
 config NET_VENDOR_CHELSIO
 	bool "Chelsio devices"
 	default y
-	depends on PCI || INET
+	depends on PCI
 	---help---
 	  If you have a network (Ethernet) card belonging to this class, say Y
 	  and read the Ethernet-HOWTO, available from
@@ -48,7 +48,7 @@ config CHELSIO_T1_1G
 
 config CHELSIO_T3
 	tristate "Chelsio Communications T3 10Gb Ethernet support"
-	depends on PCI && INET
+	depends on PCI
 	select FW_LOADER
 	select MDIO
 	---help---
diff --git a/drivers/net/ethernet/cisco/Kconfig b/drivers/net/ethernet/cisco/Kconfig
index 94606f7..1c7b884 100644
--- a/drivers/net/ethernet/cisco/Kconfig
+++ b/drivers/net/ethernet/cisco/Kconfig
@@ -5,7 +5,7 @@
 config NET_VENDOR_CISCO
 	bool "Cisco devices"
 	default y
-	depends on PCI && INET
+	depends on PCI
 	---help---
 	  If you have a network (Ethernet) card belonging to this class, say Y
 	  and read the Ethernet-HOWTO, available from
diff --git a/drivers/net/ethernet/cisco/enic/Kconfig b/drivers/net/ethernet/cisco/enic/Kconfig
index 9cc706a..b63f8d8 100644
--- a/drivers/net/ethernet/cisco/enic/Kconfig
+++ b/drivers/net/ethernet/cisco/enic/Kconfig
@@ -4,6 +4,6 @@
 
 config ENIC
 	tristate "Cisco VIC Ethernet NIC Support"
-	depends on PCI && INET
+	depends on PCI
 	---help---
 	  This enables the support for the Cisco VIC Ethernet card.
diff --git a/drivers/net/ethernet/emulex/Kconfig b/drivers/net/ethernet/emulex/Kconfig
index 7a28a64..1b8d638 100644
--- a/drivers/net/ethernet/emulex/Kconfig
+++ b/drivers/net/ethernet/emulex/Kconfig
@@ -5,7 +5,7 @@
 config NET_VENDOR_EMULEX
 	bool "Emulex devices"
 	default y
-	depends on PCI && INET
+	depends on PCI
 	---help---
 	  If you have a network (Ethernet) card belonging to this class, say Y
 	  and read the Ethernet-HOWTO, available from
diff --git a/drivers/net/ethernet/emulex/benet/Kconfig b/drivers/net/ethernet/emulex/benet/Kconfig
index 804db04..231129d 100644
--- a/drivers/net/ethernet/emulex/benet/Kconfig
+++ b/drivers/net/ethernet/emulex/benet/Kconfig
@@ -1,6 +1,6 @@
 config BE2NET
 	tristate "ServerEngines' 10Gbps NIC - BladeEngine"
-	depends on PCI && INET
+	depends on PCI
 	---help---
 	  This driver implements the NIC functionality for ServerEngines'
 	  10Gbps network adapter - BladeEngine.
diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index 73d28d5..ddee406 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -166,7 +166,7 @@ config IXGB
 
 config IXGBE
 	tristate "Intel(R) 10GbE PCI Express adapters support"
-	depends on PCI && INET
+	depends on PCI
 	select MDIO
 	select PTP_1588_CLOCK
 	---help---
diff --git a/drivers/net/ethernet/mellanox/Kconfig b/drivers/net/ethernet/mellanox/Kconfig
index d8099a7..bcdbc14 100644
--- a/drivers/net/ethernet/mellanox/Kconfig
+++ b/drivers/net/ethernet/mellanox/Kconfig
@@ -5,7 +5,7 @@
 config NET_VENDOR_MELLANOX
 	bool "Mellanox devices"
 	default y
-	depends on PCI && INET
+	depends on PCI
 	---help---
 	  If you have a network (Ethernet) card belonging to this class, say Y
 	  and read the Ethernet-HOWTO, available from
diff --git a/drivers/net/ethernet/neterion/Kconfig b/drivers/net/ethernet/neterion/Kconfig
index ff26b54..87abb4f 100644
--- a/drivers/net/ethernet/neterion/Kconfig
+++ b/drivers/net/ethernet/neterion/Kconfig
@@ -32,7 +32,7 @@ config S2IO
 
 config VXGE
 	tristate "Exar X3100 Series 10GbE PCIe Server Adapter"
-	depends on PCI && INET
+	depends on PCI
 	---help---
 	  This driver supports Exar Corp's X3100 Series 10 GbE PCIe
 	  I/O Virtualized Server Adapter.
diff --git a/drivers/net/ethernet/sfc/Kconfig b/drivers/net/ethernet/sfc/Kconfig
index fb3cbc2..059e5e9 100644
--- a/drivers/net/ethernet/sfc/Kconfig
+++ b/drivers/net/ethernet/sfc/Kconfig
@@ -1,6 +1,6 @@
 config SFC
 	tristate "Solarflare SFC4000/SFC9000-family support"
-	depends on PCI && INET
+	depends on PCI
 	select MDIO
 	select CRC32
 	select I2C
-- 
1.7.7.6


-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related

* Re: [PATCH net-next] gro: Handle inline VLAN tags
From: Eric Dumazet @ 2012-11-16 23:01 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: David Miller, netdev, linux-net-drivers, Andrew Gallatin,
	Herbert Xu
In-Reply-To: <1353097030.2743.28.camel@bwh-desktop.uk.solarflarecom.com>

On Fri, 2012-11-16 at 20:17 +0000, Ben Hutchings wrote:
> The receive paths for skbs with inline and out-of-line VLAN tags (VLAN
> RX accleration) were made largely consistent in 2.6.37, with tags
> pulled out by software as necessary.  However GRO doesn't do this, so
> it is not effective for VLAN-tagged packets received on devices
> without VLAN RX acceleration.
> 
> napi_gro_frags() must not free the skb and does not advance the
> skb->data pointer, so cannot use vlan_untag().  Extract the core of
> vlan_untag() into a new function __vlan_untag() that allows the offset
> to the VLAN tag to be specified and returns an error code.  Add
> kernel-doc comments for both those functions.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
> Tested with sfc using both napi_gro_receive() and napi_gro_frags().  On
> a Core i7 920 (Nehalem) system it increased TCP/IPv4 receive throughput
> over a VLAN from ~8.0 to ~9.3 Gbit/s.
> 
> Ben.
> 

> index b4978e2..9d658eb 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3668,6 +3668,13 @@ static void skb_gro_reset_offset(struct sk_buff *skb)
>  
>  gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
>  {
> +	if (unlikely(skb->protocol == htons(ETH_P_8021Q)) &&
> +	    !vlan_tx_tag_present(skb)) {
> +		skb = vlan_untag(skb);
> +		if (unlikely(!skb))
> +			return GRO_DROP;
> +	}
> +
>  	skb_gro_reset_offset(skb);

I am not very convinced.

So for some drivers _not_ doing vlan acceleration, we are slowing down
GRO.

I mean, driver authors should know if they need to call a helper before
calling napi_gro_receive()

To date, only two drivers would need this, and it was discovered very
recently.

Also at GRO point, we totally own the skb and the vlan decap cannot
possibly fail (and free the skb)

A packet sniffer should see all skbs delivered to napi_gro_receive()

^ permalink raw reply

* Re: [PATCH v7 2/6] net: mvneta: driver for Marvell Armada 370/XP network unit
From: Ben Hutchings @ 2012-11-16 23:04 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: David S. Miller, Francois Romieu, Lennert Buytenhek, netdev,
	linux-arm-kernel, Jason Cooper, Andrew Lunn, Gregory Clement,
	Lior Amsalem, Dmitri Epshtein
In-Reply-To: <1352905010-24172-3-git-send-email-thomas.petazzoni@free-electrons.com>

On Wed, 2012-11-14 at 15:56 +0100, Thomas Petazzoni wrote:
[...]
> --- /dev/null
> +++ b/drivers/net/ethernet/marvell/mvneta.c
[...]
> +/* Set interrupt coalescing for ethtools */
> +static int mvneta_ethtool_set_coalesce(struct net_device *dev,
> +				       struct ethtool_coalesce *c)
> +{
> +	struct mvneta_port *pp = netdev_priv(dev);
> +	int queue;
> +
> +	for (queue = 0; queue < rxq_number; queue++) {
> +		struct mvneta_rx_queue *rxq = &pp->rxqs[queue];
> +		rxq->time_coal = c->rx_coalesce_usecs;
> +		rxq->pkts_coal = c->rx_max_coalesced_frames;
> +		mvneta_rx_pkts_coal_set(pp, rxq, rxq->pkts_coal);
> +		mvneta_rx_time_coal_set(pp, rxq, rxq->time_coal);
> +	}

Please check that c->rx_coalesce_usecs || c->rx_max_coalesced_frames
(see the comments in <linux/ethtool.h>).  Also please check that the
other fields, up to and including use_adaptive_tx_coalesce, are all set
to 0.

> +	for (queue = 0; queue < txq_number; queue++) {
> +		struct mvneta_tx_queue *txq = &pp->txqs[queue];
> +		txq->done_pkts_coal = c->tx_max_coalesced_frames;
> +		mvneta_tx_done_pkts_coal_set(pp, txq, txq->done_pkts_coal);
> +	}
> +
> +	return 0;
> +}
[...]
> +static int mvneta_ethtool_set_ringparam(struct net_device *dev,
> +					struct ethtool_ringparam *ring)
> +{
> +	struct mvneta_port *pp = netdev_priv(dev);
> +
> +	if ((ring->rx_pending == 0) || (ring->tx_pending == 0))
> +		return -EINVAL;

Please check that the other fields are all set to 0.

> +	pp->rx_ring_size = ring->rx_pending < MVNETA_MAX_RXD ?
> +		ring->rx_pending : MVNETA_MAX_RXD;
> +	pp->tx_ring_size = ring->tx_pending < MVNETA_MAX_TXD ?
> +		ring->tx_pending : MVNETA_MAX_TXD;
> +
> +	if (netif_running(dev)) {
> +		mvneta_stop(dev);
> +		if (mvneta_open(dev)) {
> +			netdev_err(dev,
> +				   "error on opening device after ring param change\n");
> +			return -ENOMEM;
> +		}

This is nasty because the stack will still considers the interface to be
up.  Ideally you would hold onto the old rings and revert to using them
in case of failure.  If that's not possible then use dev_close() and
dev_open() so that the stack knows the interface didn't come up again.

Ben.

> +	}
> +
> +	return 0;
> +}
[...]

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* Re: [PATCH net-next] gro: Handle inline VLAN tags
From: Ben Hutchings @ 2012-11-17  0:00 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David Miller, netdev, linux-net-drivers, Andrew Gallatin,
	Herbert Xu
In-Reply-To: <1353106865.10798.61.camel@edumazet-glaptop>

On Fri, 2012-11-16 at 15:01 -0800, Eric Dumazet wrote:
> On Fri, 2012-11-16 at 20:17 +0000, Ben Hutchings wrote:
> > The receive paths for skbs with inline and out-of-line VLAN tags (VLAN
> > RX accleration) were made largely consistent in 2.6.37, with tags
> > pulled out by software as necessary.  However GRO doesn't do this, so
> > it is not effective for VLAN-tagged packets received on devices
> > without VLAN RX acceleration.
> > 
> > napi_gro_frags() must not free the skb and does not advance the
> > skb->data pointer, so cannot use vlan_untag().  Extract the core of
> > vlan_untag() into a new function __vlan_untag() that allows the offset
> > to the VLAN tag to be specified and returns an error code.  Add
> > kernel-doc comments for both those functions.
> > 
> > Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> > ---
> > Tested with sfc using both napi_gro_receive() and napi_gro_frags().  On
> > a Core i7 920 (Nehalem) system it increased TCP/IPv4 receive throughput
> > over a VLAN from ~8.0 to ~9.3 Gbit/s.
> > 
> > Ben.
> > 
> 
> > index b4978e2..9d658eb 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -3668,6 +3668,13 @@ static void skb_gro_reset_offset(struct sk_buff *skb)
> >  
> >  gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
> >  {
> > +	if (unlikely(skb->protocol == htons(ETH_P_8021Q)) &&
> > +	    !vlan_tx_tag_present(skb)) {
> > +		skb = vlan_untag(skb);
> > +		if (unlikely(!skb))
> > +			return GRO_DROP;
> > +	}
> > +
> >  	skb_gro_reset_offset(skb);
> 
> I am not very convinced.
> 
> So for some drivers _not_ doing vlan acceleration, we are slowing down
> GRO.

It's a single comparison, hinted as 'unlikely'.

> I mean, driver authors should know if they need to call a helper before
> calling napi_gro_receive()
> 
> To date, only two drivers would need this, and it was discovered very
> recently.

It's not only two drivers.  qlcnic fakes RX VLAN acceleration precisely
to work around this limitation.  netxen, niu and Calxeda's xgmac might
also benefit (it's not clear whether the hardware does checksum
validation for VLAN-tagged packets).

> Also at GRO point, we totally own the skb and the vlan decap cannot
> possibly fail (and free the skb)
> 
> A packet sniffer should see all skbs delivered to napi_gro_receive()

I'm not sure what you mean by this.  Is your point that the
copy-on-write is never needed?  It is still possible for pskb_may_pull()
to fail.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* Re: [PATCH net-next 1/2] PPC: net: bpf_jit_comp: add XOR instruction for BPF JIT
From: Matt Evans @ 2012-11-17  0:00 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: davem, benh, netdev
In-Reply-To: <20121108213939.GA29696@thinkbox>

Hi Daniel,


On 08/11/2012, at 9:39 PM, Daniel Borkmann wrote:

> This patch is a follow-up for patch "filter: add XOR instruction for use
> with X/K" that implements BPF PowerPC JIT parts for the BPF XOR operation.
> 
> Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
> Cc: Matt Evans <matt@ozlabs.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> Disclaimer: uncompiled and untested, since I don't have a PPC machine,
> but it should (hopefully) integrate cleanly; impl. after PPC instruction
> reference.

Unfortunately I can only compile and test this mentally, but it looks fine, instruction formats correct etc.  Thanks!


Acked-by: Matt Evans <matt@ozlabs.org>



Matt

> 
> arch/powerpc/include/asm/ppc-opcode.h |    3 +++
> arch/powerpc/net/bpf_jit.h            |    6 ++++++
> arch/powerpc/net/bpf_jit_comp.c       |   11 +++++++++++
> 3 files changed, 20 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
> index 5f73ce6..42b1f43 100644
> --- a/arch/powerpc/include/asm/ppc-opcode.h
> +++ b/arch/powerpc/include/asm/ppc-opcode.h
> @@ -168,9 +168,12 @@
> #define PPC_INST_AND			0x7c000038
> #define PPC_INST_ANDDOT			0x7c000039
> #define PPC_INST_OR			0x7c000378
> +#define PPC_INST_XOR			0x7c000278
> #define PPC_INST_ANDI			0x70000000
> #define PPC_INST_ORI			0x60000000
> #define PPC_INST_ORIS			0x64000000
> +#define PPC_INST_XORI			0x68000000
> +#define PPC_INST_XORIS			0x6c000000
> #define PPC_INST_NEG			0x7c0000d0
> #define PPC_INST_BRANCH			0x48000000
> #define PPC_INST_BRANCH_COND		0x40800000
> diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h
> index 1fc8109..8a5dfaf 100644
> --- a/arch/powerpc/net/bpf_jit.h
> +++ b/arch/powerpc/net/bpf_jit.h
> @@ -134,6 +134,12 @@ DECLARE_LOAD_FUNC(sk_load_byte_msh);
> 				     ___PPC_RS(a) | IMM_L(i))
> #define PPC_ORIS(d, a, i)	EMIT(PPC_INST_ORIS | ___PPC_RA(d) |	      \
> 				     ___PPC_RS(a) | IMM_L(i))
> +#define PPC_XOR(d, a, b)	EMIT(PPC_INST_XOR | ___PPC_RA(d) |	      \
> +				     ___PPC_RS(a) | ___PPC_RB(b))
> +#define PPC_XORI(d, a, i)	EMIT(PPC_INST_XORI | ___PPC_RA(d) |	      \
> +				     ___PPC_RS(a) | IMM_L(i))
> +#define PPC_XORIS(d, a, i)	EMIT(PPC_INST_XORIS | ___PPC_RA(d) |	      \
> +				     ___PPC_RS(a) | IMM_L(i))
> #define PPC_SLW(d, a, s)	EMIT(PPC_INST_SLW | ___PPC_RA(d) |	      \
> 				     ___PPC_RS(a) | ___PPC_RB(s))
> #define PPC_SRW(d, a, s)	EMIT(PPC_INST_SRW | ___PPC_RA(d) |	      \
> diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
> index dd11306..b9434de 100644
> --- a/arch/powerpc/net/bpf_jit_comp.c
> +++ b/arch/powerpc/net/bpf_jit_comp.c
> @@ -232,6 +232,17 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
> 			if (K >= 65536)
> 				PPC_ORIS(r_A, r_A, IMM_H(K));
> 			break;
> +		case BPF_S_ANC_ALU_XOR_X:
> +		case BPF_S_ALU_XOR_X: /* A ^= X */
> +			ctx->seen |= SEEN_XREG;
> +			PPC_XOR(r_A, r_A, r_X);
> +			break;
> +		case BPF_S_ALU_XOR_K: /* A ^= K */
> +			if (IMM_L(K))
> +				PPC_XORI(r_A, r_A, IMM_L(K));
> +			if (K >= 65536)
> +				PPC_XORIS(r_A, r_A, IMM_H(K));
> +			break;
> 		case BPF_S_ALU_LSH_X: /* A <<= X; */
> 			ctx->seen |= SEEN_XREG;
> 			PPC_SLW(r_A, r_A, r_X);

^ permalink raw reply

* Re: [PATCH net-next 2/2] PPC: net: bpf_jit_comp: add VLAN instructions for BPF JIT
From: Matt Evans @ 2012-11-17  0:06 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: davem, benh, netdev
In-Reply-To: <20121108214137.GB29696@thinkbox>

Hi,

On 08/11/2012, at 9:41 PM, Daniel Borkmann wrote:

> This patch is a follow-up for patch "net: filter: add vlan tag access"
> to support the new VLAN_TAG/VLAN_TAG_PRESENT accessors in BPF JIT.
> 
> Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
> Cc: Matt Evans <matt@ozlabs.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> Disclaimer: uncompiled and untested, since I don't have a PPC machine,
> but it should (hopefully) integrate cleanly; impl. after PPC instruction
> reference.

And for this too,

Acked-by: Matt Evans <matt@ozlabs.org>

Sorry for the delay in reviewing this!

Thanks,


Matt


> 
> arch/powerpc/net/bpf_jit_comp.c |   14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
> index b9434de..e834f1e 100644
> --- a/arch/powerpc/net/bpf_jit_comp.c
> +++ b/arch/powerpc/net/bpf_jit_comp.c
> @@ -13,6 +13,8 @@
> #include <asm/cacheflush.h>
> #include <linux/netdevice.h>
> #include <linux/filter.h>
> +#include <linux/if_vlan.h>
> +
> #include "bpf_jit.h"
> 
> #ifndef __BIG_ENDIAN
> @@ -89,6 +91,8 @@ static void bpf_jit_build_prologue(struct sk_filter *fp, u32 *image,
> 	case BPF_S_ANC_IFINDEX:
> 	case BPF_S_ANC_MARK:
> 	case BPF_S_ANC_RXHASH:
> +	case BPF_S_ANC_VLAN_TAG:
> +	case BPF_S_ANC_VLAN_TAG_PRESENT:
> 	case BPF_S_ANC_CPU:
> 	case BPF_S_ANC_QUEUE:
> 	case BPF_S_LD_W_ABS:
> @@ -382,6 +386,16 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
> 			PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,
> 							  rxhash));
> 			break;
> +		case BPF_S_ANC_VLAN_TAG:
> +		case BPF_S_ANC_VLAN_TAG_PRESENT:
> +			BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_tci) != 2);
> +			PPC_LHZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,
> +							  vlan_tci));
> +			if (filter[i].code == BPF_S_ANC_VLAN_TAG)
> +				PPC_ANDI(r_A, r_A, VLAN_VID_MASK);
> +			else
> +				PPC_ANDI(r_A, r_A, VLAN_TAG_PRESENT);
> +			break;
> 		case BPF_S_ANC_QUEUE:
> 			BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff,
> 						  queue_mapping) != 2);

^ permalink raw reply

* Re: [PATCH net-next] gro: Handle inline VLAN tags
From: Eric Dumazet @ 2012-11-17  0:16 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: David Miller, netdev, linux-net-drivers, Andrew Gallatin,
	Herbert Xu
In-Reply-To: <1353110430.2743.73.camel@bwh-desktop.uk.solarflarecom.com>

On Sat, 2012-11-17 at 00:00 +0000, Ben Hutchings wrote:

> I'm not sure what you mean by this.  Is your point that the
> copy-on-write is never needed?  It is still possible for pskb_may_pull()
> to fail.
> 

A packet sniffer should have a copy of bad frames, even if dropped later
in our stacks.

GRO layer is not allowed to drop a frame, even if not 'correct'.

^ permalink raw reply

* Re: [PATCH net-next 09/17] net: Allow userns root control of the core of the network stack.
From: Ben Hutchings @ 2012-11-17  0:28 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Linux Containers, David Miller
In-Reply-To: <871uft8vpm.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>

On Fri, 2012-11-16 at 06:32 -0800, Eric W. Biederman wrote:
> Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org> writes:
> 
> > On 11/16/2012 05:03 PM, Eric W. Biederman wrote:
> >> +	if (!capable(CAP_NET_ADMIN))
> >> +		return -EPERM;
> >> +
> >>  	return netdev_store(dev, attr, buf, len, change_tx_queue_len);
> >
> > You mean ns_capable here?
> 
> No.  There I meant capable.
> 
> I deliberately call capable here because I don't understand what
> the tx_queue_len well enough to be certain it is safe to relax
> that check to be just ns_capable.
> 
> My get feel is that allowing an unprivileged user to be able to
> arbitrarily change the tx_queue_len on a networking device would be a
> nice way to allow queuing as many network packets as you would like with
> kernel memory and DOSing the machine.
> 
> So since with a quick read of the code I could not convince myself it
> was safe to allow unprivilged users to change tx_queue_len I left it
> protected by capable.  While at the same time I relaxed the check in
> netdev_store to be ns_capable.

Tor the same reason you had better be very selective about which ethtool
commands are allowed based on per-user_ns CAP_NET_ADMIN.  Consider for a
start:

ETHTOOL_SMSGLVL => fill up the system log
ETHTOOL_SEEPROM => brick the NIC
ETHTOOL_FLASHDEV => brick the NIC; own the system if it's not using an IOMMU

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* Re: [PATCH net-next] gro: Handle inline VLAN tags
From: Ben Hutchings @ 2012-11-17  0:32 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David Miller, netdev, linux-net-drivers, Andrew Gallatin,
	Herbert Xu
In-Reply-To: <1353111414.10798.64.camel@edumazet-glaptop>

On Fri, 2012-11-16 at 16:16 -0800, Eric Dumazet wrote:
> On Sat, 2012-11-17 at 00:00 +0000, Ben Hutchings wrote:
> 
> > I'm not sure what you mean by this.  Is your point that the
> > copy-on-write is never needed?  It is still possible for pskb_may_pull()
> > to fail.
> > 
> 
> A packet sniffer should have a copy of bad frames, even if dropped later
> in our stacks.
> 
> GRO layer is not allowed to drop a frame, even if not 'correct'.

What do you think the accelerated hardware does with frames that have a
truncated VLAN tag?

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* Re: [rfc net-next v6 2/3] virtio_net: multiqueue support
From: Ben Hutchings @ 2012-11-17  0:35 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: krkumar2, kvm, netdev, linux-kernel, virtualization, edumazet,
	davem
In-Reply-To: <20121113064026.GA27416@redhat.com>

On Tue, 2012-11-13 at 08:40 +0200, Michael S. Tsirkin wrote:
> On Mon, Nov 05, 2012 at 11:38:39AM +1030, Rusty Russell wrote:
> > > @@ -924,11 +1032,10 @@ static void virtnet_get_ringparam(struct net_device *dev,
> > >  {
> > >  	struct virtnet_info *vi = netdev_priv(dev);
> > >  
> > > -	ring->rx_max_pending = virtqueue_get_vring_size(vi->rvq);
> > > -	ring->tx_max_pending = virtqueue_get_vring_size(vi->svq);
> > > +	ring->rx_max_pending = virtqueue_get_vring_size(vi->rq[0].vq);
> > > +	ring->tx_max_pending = virtqueue_get_vring_size(vi->sq[0].vq);
> > >  	ring->rx_pending = ring->rx_max_pending;
> > >  	ring->tx_pending = ring->tx_max_pending;
> > > -
> > >  }
> > 
> > This assumes all vqs are the same size.  I think this should probably
> > check: for mq mode, use the first vq, otherewise use the 0th.
> 
> For rx_pending/tx_pending I think what is required here is the
> actual number of outstanding buffers.
> Dave, Eric - right?
> 
> So this should be the total over all rings and to be useful,
> rx_max_pending/tx_max_pending should be the total too.

So far as I know, all current implementations use the number of
descriptors per ring here. virtio_net should be consistent with this.

Ben.

> > For bonus points, check this assertion at probe time.
> 
> Looks like we can easily support different queues too.
> 

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ 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