Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] [PATCH v3 1/2] 8139too: Fix the lack of pci_disable_device
From: David Miller @ 2014-12-22 21:32 UTC (permalink / raw)
  To: baijiaju1990; +Cc: sergei.shtylyov, netdev, jgarzik
In-Reply-To: <1419208132-23657-1-git-send-email-baijiaju1990@163.com>

From: Jia-Ju Bai <baijiaju1990@163.com>
Date: Mon, 22 Dec 2014 08:28:52 +0800

> For linux-3.18.0
> When pci_request_regions is failed in rtl8139_init_board, pci_disable_device 
> is not called to disable the device which are enabled by pci_enable_device, 
> because of disable_dev_on_err is not assigned 1.
> This patch fix this problem.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>

Applied.

^ permalink raw reply

* Re: [PATCH v3 2/2] 8139too: Add netif_napi_del in the driver
From: David Miller @ 2014-12-22 21:32 UTC (permalink / raw)
  To: baijiaju1990; +Cc: sergei.shtylyov, netdev, jgarzik
In-Reply-To: <1419208994-23908-1-git-send-email-baijiaju1990@163.com>

From: Jia-Ju Bai <baijiaju1990@163.com>
Date: Mon, 22 Dec 2014 08:43:14 +0800

> For linux-3.18.0
> The driver lacks netif_napi_del in the normal path and error path
> to match the call of netif_napi_add in rtl8139_init_one.
> This patch fixes this problem.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>

Applied.

^ permalink raw reply

* Re: [PATCH net V1] net/mlx4_en: Doorbell is byteswapped in Little Endian archs
From: David Miller @ 2014-12-22 21:34 UTC (permalink / raw)
  To: amirv; +Cc: netdev, ogerlitz, yevgenyp, weiyang, david.laight
In-Reply-To: <1419236517-15666-1-git-send-email-amirv@mellanox.com>

From: Amir Vadai <amirv@mellanox.com>
Date: Mon, 22 Dec 2014 10:21:57 +0200

> iowrite32() will byteswap it's argument on big endian archs.
> iowrite32be() will byteswap on little endian archs.
> Since we don't want to do this unnecessary byteswap on the fast path,
> doorbell is stored in the NIC's native endianness. Using the right
> iowrite() according to the arch endianness.
> 
> CC: Wei Yang <weiyang@linux.vnet.ibm.com>
> CC: David Laight <david.laight@aculab.com>
> Fixes: 6a4e812 ("net/mlx4_en: Avoid calling bswap in tx fast path")
> Signed-off-by: Amir Vadai <amirv@mellanox.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply

* Re: caif: Fix napi poll list corruption
From: David Miller @ 2014-12-22 21:35 UTC (permalink / raw)
  To: herbert
  Cc: jasowang, david.vrabel, netdev, xen-devel, konrad.wilk,
	boris.ostrovsky, edumazet
In-Reply-To: <20141222093525.GA18616@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Mon, 22 Dec 2014 20:35:25 +1100

> The commit d75b1ade567ffab085e8adbbdacf0092d10cd09c (net: less
> interrupt masking in NAPI) breaks caif.
> 
> It is now required that if the entire budget is consumed when poll
> returns, the napi poll_list must remain empty.  However, like some
> other drivers caif tries to do a last-ditch check and if there is
> more work it will call napi_schedule and then immediately process
> some of this new work.  Should the entire budget be consumed while
> processing such new work then we will violate the new caller
> contract.
> 
> This patch fixes this by not touching any work when we reschedule
> in caif.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net] cxgb4vf: Fix ethtool get_settings for VF driver
From: David Miller @ 2014-12-22 21:35 UTC (permalink / raw)
  To: hariprasad; +Cc: netdev, leedom, nirranjan, kumaras
In-Reply-To: <1419241477-15718-1-git-send-email-hariprasad@chelsio.com>

From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Mon, 22 Dec 2014 15:14:37 +0530

> Decode and display Port Type and Module Type for ethtool get_settings() call
> 
> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH net] tcp6: don't move IP6CB before xfrm6_policy_check()
From: David Miller @ 2014-12-22 21:48 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: eric.dumazet, netdev
In-Reply-To: <1419268968-4136-1-git-send-email-nicolas.dichtel@6wind.com>

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Mon, 22 Dec 2014 18:22:48 +0100

> When xfrm6_policy_check() is used, _decode_session6() is called after some
> intermediate functions. This function uses IP6CB(), thus TCP_SKB_CB() must be
> prepared after the call of xfrm6_policy_check().
> 
> Before this patch, scenarii with IPv6 + TCP + IPsec Transport are broken.
> 
> Fixes: 971f10eca186 ("tcp: better TCP_SKB_CB layout to reduce cache line misses")
> Reported-by: Huaibin Wang <huaibin.wang@6wind.com>
> Suggested-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied and queued up for -stable, thanks everyone.

^ permalink raw reply

* Re: [RFC PATCH 02/17] fib_trie: Make leaf and tnode more uniform
From: David Miller @ 2014-12-22 21:50 UTC (permalink / raw)
  To: alexander.h.duyck; +Cc: netdev
In-Reply-To: <54986915.6050906@redhat.com>

From: Alexander Duyck <alexander.h.duyck@redhat.com>
Date: Mon, 22 Dec 2014 10:55:17 -0800

> The thing is I don't think we would actually be saving any space. The
> slub allocator will round us up anyway.  On a 32b system the size is
> 28B if I recall correctly.  Dropping it to 24B would mean only a 2
> child node could be allocated from the 32B slab.  Anything larger than
> that it wouldn't matter.

Indeed, you even mention this in the commit messages of your
series.

> My real concern with all of this is the fact that we have to do 2
> separate memory reads per node, one for the key info and one for the
> child pointer.  I really think we need to get this down to 1 in order
> to get there, but the overhead is the tricky part for that. What I
> would look at doing is splitting the tnode into two parts. One would
> be a key vector (key, pos, bits, seq) paired with a pointer to either
> a tnode_info or leaf_info, the other would be something like a
> tnode_info (rcu, parent pointer, full_children, empty_children, key
> vector array[0]) that provides a means of backtracing and stores the
> nodes.  The problem is it makes insertion/deletion and backtracking
> more complicated and doubles (64b) or quadruples (32b) the memory
> needed as such I am still just throwing the idea around and haven't
> gotten into implementation yet.

I think calling into this code twice for every non-local FIB lookup
has costs as well.

And yes I agree with you that the memory references matter a lot.

^ permalink raw reply

* [PATCH 3/3] net: ieee802154: don't use devm_pinctrl_get_select_default() in probe
From: Wolfram Sang @ 2014-12-22 22:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-gpio, Wolfram Sang, Varka Bhadram, Alexander Aring,
	linux-wpan, netdev
In-Reply-To: <1419286616-9893-1-git-send-email-wsa@the-dreams.de>

Since commit ab78029ecc34 (drivers/pinctrl: grab default handles from device
core), we can rely on device core for setting the default pins.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 drivers/net/ieee802154/cc2520.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
index c2b7da3da183..033473448d9f 100644
--- a/drivers/net/ieee802154/cc2520.c
+++ b/drivers/net/ieee802154/cc2520.c
@@ -19,7 +19,6 @@
 #include <linux/workqueue.h>
 #include <linux/interrupt.h>
 #include <linux/skbuff.h>
-#include <linux/pinctrl/consumer.h>
 #include <linux/of_gpio.h>
 #include <linux/ieee802154.h>
 
@@ -841,7 +840,6 @@ done:
 static int cc2520_probe(struct spi_device *spi)
 {
 	struct cc2520_private *priv;
-	struct pinctrl *pinctrl;
 	struct cc2520_platform_data *pdata;
 	int ret;
 
@@ -854,11 +852,6 @@ static int cc2520_probe(struct spi_device *spi)
 
 	spi_set_drvdata(spi, priv);
 
-	pinctrl = devm_pinctrl_get_select_default(&spi->dev);
-	if (IS_ERR(pinctrl))
-		dev_warn(&spi->dev,
-			 "pinctrl pins are not configured\n");
-
 	pdata = cc2520_get_platform_data(spi);
 	if (!pdata) {
 		dev_err(&spi->dev, "no platform data\n");
-- 
2.1.3

^ permalink raw reply related

* [PATCH iproute2 v2] ip lib: Added shorter timestamp option
From: Vadim Kochan @ 2014-12-22 22:13 UTC (permalink / raw)
  To: netdev; +Cc: Vadim Kochan

From: Vadim Kochan <vadim4j@gmail.com>

Added another timestamp format to look like more logging info:

[2014-12-22T22:36:50.489 ] 2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default
    link/ether 3c:97:0e:a3:86:2e brd ff:ff:ff:ff:ff:ff

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
 include/utils.h       |  1 +
 ip/ip.c               |  5 ++++-
 lib/utils.c           | 15 ++++++++++++---
 man/man8/ip-monitor.8 | 13 +++++++++++++
 4 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/include/utils.h b/include/utils.h
index eef9c42..eecbc39 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -19,6 +19,7 @@ extern int show_raw;
 extern int resolve_hosts;
 extern int oneline;
 extern int timestamp;
+extern int timestamp_short;
 extern char * _SL_;
 extern int max_flush_loops;
 extern int batch_mode;
diff --git a/ip/ip.c b/ip/ip.c
index 5f759d5..9b90707 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -53,7 +53,7 @@ static void usage(void)
 "                    -f[amily] { inet | inet6 | ipx | dnet | bridge | link } |\n"
 "                    -4 | -6 | -I | -D | -B | -0 |\n"
 "                    -l[oops] { maximum-addr-flush-attempts } |\n"
-"                    -o[neline] | -t[imestamp] | -b[atch] [filename] |\n"
+"                    -o[neline] | -t[imestamp] | -t[short] | -b[atch] [filename] |\n"
 "                    -rc[vbuf] [size]}\n");
 	exit(-1);
 }
@@ -232,6 +232,9 @@ int main(int argc, char **argv)
 			++oneline;
 		} else if (matches(opt, "-timestamp") == 0) {
 			++timestamp;
+		} else if (matches(opt, "-tshort") == 0) {
+			++timestamp;
+			++timestamp_short;
 #if 0
 		} else if (matches(opt, "-numeric") == 0) {
 			rtnl_names_numeric++;
diff --git a/lib/utils.c b/lib/utils.c
index 987377b..1cf0679 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -32,6 +32,8 @@
 
 #include "utils.h"
 
+int timestamp_short = 0;
+
 int get_integer(int *val, const char *arg, int base)
 {
 	long res;
@@ -773,13 +775,20 @@ int print_timestamp(FILE *fp)
 {
 	struct timeval tv;
 	char *tstr;
+	char tshort[40] = {};
 
 	memset(&tv, 0, sizeof(tv));
 	gettimeofday(&tv, NULL);
 
-	tstr = asctime(localtime(&tv.tv_sec));
-	tstr[strlen(tstr)-1] = 0;
-	fprintf(fp, "Timestamp: %s %ld usec\n", tstr, (long)tv.tv_usec);
+	if (timestamp_short) {
+		strftime(tshort, sizeof(tshort), "%Y-%m-%dT%H:%M:%S", localtime(&tv.tv_sec));
+		fprintf(fp, "[%s.%-4ld] ", tshort, (long)tv.tv_usec / 1000);
+	} else {
+		tstr = asctime(localtime(&tv.tv_sec));
+		tstr[strlen(tstr)-1] = 0;
+		fprintf(fp, "Timestamp: %s %ld usec\n", tstr, (long)tv.tv_usec);
+	}
+
 	return 0;
 }
 
diff --git a/man/man8/ip-monitor.8 b/man/man8/ip-monitor.8
index 68e83f1..544b625 100644
--- a/man/man8/ip-monitor.8
+++ b/man/man8/ip-monitor.8
@@ -16,6 +16,19 @@ ip-monitor, rtmon \- state monitoring
 ]
 .sp
 
+.SH OPTIONS
+
+.TP
+.BR "\-t" , " \-timestamp"
+Prints timestamp before the event message on the separated line in format:
+    Timestamp: <Day> <Month> <DD> <hh:mm:ss> <YYYY> <usecs> usec
+    <EVENT>
+
+.TP
+.BR "\-ts" , " \-tshort"
+Prints short timestamp before the event message on the same line in format:
+    [<YYYY>-<MM>-<DD>T<hh:mm:ss>.<ms>] <EVENT>
+
 .SH DESCRIPTION
 The
 .B ip
-- 
2.1.3

^ permalink raw reply related

* Re: [PATCH iproute2 v2] tc: Show classes in tree view
From: Vadim Kochan @ 2014-12-22 22:19 UTC (permalink / raw)
  To: netdev; +Cc: Vadim Kochan
In-Reply-To: <1419263518-14434-1-git-send-email-vadim4j@gmail.com>

On Mon, Dec 22, 2014 at 05:51:58PM +0200, Vadim Kochan wrote:
> From: Vadim Kochan <vadim4j@gmail.com>
> 
> Added new '-t[ree]' which shows classes dependency
> in the tree view. Meanwhile only generic stats info
> is supported.
> 

Seems here is one limitation with this code so that it will not pick child
classes from the leaf classfull qdisc.

^ permalink raw reply

* Re: [RFC PATCH net-next] tun: support retrieving multiple packets in a single read with IFF_MULTI_READ
From: Herbert Xu @ 2014-12-22 22:34 UTC (permalink / raw)
  To: Alex Gartrell
  Cc: jasonwang, davem, netdev, linux-kernel, mst, herbert, kernel-team
In-Reply-To: <54987C9F.5070103@fb.com>

On Mon, Dec 22, 2014 at 12:18:39PM -0800, Alex Gartrell wrote:
> 
> While fully aware that this makes me look like an idiot, I have to
> admit that I've tried and failed to figure out how to get a socket
> fd out of the tun device.

Well right now the socket is only used within the kernel by
vhost so it's not exported to user-space.  If we were to use
recvmmsg obviously we'd create a new interface based on sockets
for tun and expose the existing socket through that.

The current file-based tun interface was never designed to be
a high-performance interface.  So let's take this opportunity
and create a new interface (but still using the same underlying
code since whatever you create should be easily applicable to
the existing kernel user vhost).

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: [PATCH for 3.19] rtlwifi: Fix error when accessing unmapped memory in skb
From: Larry Finger @ 2014-12-22 22:41 UTC (permalink / raw)
  To: Eric Biggers
  Cc: kvalo-sgV2jX0FEOL9JmXXK+q4OQ,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, Stable
In-Reply-To: <20141222194843.GA7575@zzz>

[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]

On 12/22/2014 01:48 PM, Eric Biggers wrote:
> Is this really the same behavior as 3.17?  In 3.17, allocating the new skb is
> one of the first things the interrupt handler does, and if that fails it drops
> the packet and keeps using the old skb.  In this proposal, it's only after the
> packet has been received and the old skb has been freed that a new one is
> allocated.  And if that fails --- well, what are you expecting to happen
> exactly?

You are correct. In trying to get a small patch for stable, I missed some 
important points.

Please look at the attached patch. I think it handles the skb allocations 
correctly. The critical point is that _rtl_pci_init_one_rxdesc() cannot be 
allowed to fail to allocate an skb while in the interrupt path. Now, I have 
already allocated the skb before the call and bypassed this routine if the 
allocation fails. After a couple of crashes, this one now works for the case 
when the allocation wouldn't fail anyway. I will likely pull the allocation out 
of _rtl_pci_init_one_rxdesc() in all cases for the final patch.

@Kalle: Please drop the patch I submitted this morning with this subject. It 
would not help the problem. I will resubmit after I am sure of the proper fix.

Thanks,

Larry



[-- Attachment #2: fix_skb_alloc_v2 --]
[-- Type: text/plain, Size: 3218 bytes --]

Index: wireless-drivers/drivers/net/wireless/rtlwifi/pci.c
===================================================================
--- wireless-drivers.orig/drivers/net/wireless/rtlwifi/pci.c
+++ wireless-drivers/drivers/net/wireless/rtlwifi/pci.c
@@ -666,6 +666,7 @@ tx_status_ok:
 }
 
 static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw,
+				    struct sk_buff *new_skb,
 				    u8 *entry, int rxring_idx, int desc_idx)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -674,7 +675,10 @@ static int _rtl_pci_init_one_rxdesc(stru
 	u8 tmp_one = 1;
 	struct sk_buff *skb;
 
-	skb = dev_alloc_skb(rtlpci->rxbuffersize);
+	if (new_skb)
+		skb = new_skb;
+	else
+		skb = dev_alloc_skb(rtlpci->rxbuffersize);
 	if (!skb)
 		return 0;
 	rtlpci->rx_ring[rxring_idx].rx_buf[desc_idx] = skb;
@@ -772,6 +776,7 @@ static void _rtl_pci_rx_interrupt(struct
 	/*RX NORMAL PKT */
 	while (count--) {
 		struct ieee80211_hdr *hdr;
+		struct sk_buff *new_skb = NULL;
 		__le16 fc;
 		u16 len;
 		/*rx buffer descriptor */
@@ -800,6 +805,12 @@ static void _rtl_pci_rx_interrupt(struct
 				return;
 		}
 
+		new_skb = dev_alloc_skb(rtlpci->rxbuffersize);
+		if (unlikely(!new_skb)) {
+			RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), DBG_DMESG,
+				 "can't alloc skb for rx\n");
+			goto end;
+		}
 		/* Reaching this point means: data is filled already
 		 * AAAAAAttention !!!
 		 * We can NOT access 'skb' before 'pci_unmap_single'
@@ -845,6 +856,7 @@ static void _rtl_pci_rx_interrupt(struct
 		if (rtlpriv->cfg->ops->rx_command_packet &&
 		    rtlpriv->cfg->ops->rx_command_packet(hw, stats, skb)) {
 				dev_kfree_skb_any(skb);
+				skb = new_skb;
 				goto end;
 		}
 
@@ -895,6 +907,7 @@ static void _rtl_pci_rx_interrupt(struct
 		} else {
 			dev_kfree_skb_any(skb);
 		}
+		skb = new_skb;
 		if (rtlpriv->use_new_trx_flow) {
 			rtlpci->rx_ring[hw_queue].next_rx_rp += 1;
 			rtlpci->rx_ring[hw_queue].next_rx_rp %=
@@ -912,12 +925,13 @@ static void _rtl_pci_rx_interrupt(struct
 		}
 end:
 		if (rtlpriv->use_new_trx_flow) {
-			if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)buffer_desc,
-					     rxring_idx,
-					     rtlpci->rx_ring[rxring_idx].idx))
+			/* TODO: Can the following fail? */
+			if (!_rtl_pci_init_one_rxdesc(hw, skb,
+					 (u8 *)buffer_desc, rxring_idx,
+					 rtlpci->rx_ring[rxring_idx].idx))
 				return;
 		} else {
-			if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)pdesc,
+			if (!_rtl_pci_init_one_rxdesc(hw, skb, (u8 *)pdesc,
 					     rxring_idx,
 					     rtlpci->rx_ring[rxring_idx].idx))
 				return;
@@ -1309,7 +1323,7 @@ static int _rtl_pci_init_rx_ring(struct
 		rtlpci->rx_ring[rxring_idx].idx = 0;
 		for (i = 0; i < rtlpci->rxringcount; i++) {
 			entry = &rtlpci->rx_ring[rxring_idx].buffer_desc[i];
-			if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry,
+			if (!_rtl_pci_init_one_rxdesc(hw, NULL, (u8 *)entry,
 						      rxring_idx, i))
 				return -ENOMEM;
 		}
@@ -1334,7 +1348,7 @@ static int _rtl_pci_init_rx_ring(struct
 
 		for (i = 0; i < rtlpci->rxringcount; i++) {
 			entry = &rtlpci->rx_ring[rxring_idx].desc[i];
-			if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry,
+			if (!_rtl_pci_init_one_rxdesc(hw, NULL, (u8 *)entry,
 						      rxring_idx, i))
 				return -ENOMEM;
 		}

^ permalink raw reply

* Re: REGRESSION in nfnetlink on 3.18.x (bisected)
From: Andre Tomt @ 2014-12-22 23:23 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel, netdev
In-Reply-To: <20141222115607.GA4961@salvia>

On 22. des. 2014 12:56, Pablo Neira Ayuso wrote:
> On Sun, Dec 21, 2014 at 12:33:51AM +0100, Andre Tomt wrote:
>> On at least Ubuntu 14.04 LTS and Ubuntu 14.10 "conntrack -E" has
>> started failing with Linux 3.18.x. conntrack -L still works.
>>
>> 14.04 and 14.10 ships conntrack-utils version 1.4.1, but 1.4.2 does
>> not work either.
>>
>> It fails with:
>>> # conntrack -E
>>> conntrack v1.4.2 (conntrack-tools): Can't open handler
>>
>> strace shows:
>>> bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
>>> getsockname(3, {sa_family=AF_NETLINK, pid=14092, groups=00000000}, [12]) = 0
>>> bind(3, {sa_family=AF_NETLINK, pid=14092, groups=00000007}, 12) = -1 EINVAL (Invalid argument)
>>
>> Reverting 97840cb67ff5ac8add836684f011fd838518d698 - netfilter:
>> nfnetlink: fix insufficient validation in nfnetlink_bind
>
> Could you give a test to this patch? Thanks.
>

Initial testing looks good with this patch applied on top of 3.18.1
I will give it a spin on some more systems tomorrow.

Thanks

^ permalink raw reply

* Re: [PATCH for 3.19] rtlwifi: Fix error when accessing unmapped memory in skb
From: Eric Biggers @ 2014-12-22 23:33 UTC (permalink / raw)
  To: Larry Finger; +Cc: kvalo, linux-wireless, netdev, Stable
In-Reply-To: <54989E12.6050808@lwfinger.net>

On Mon, Dec 22, 2014 at 04:41:22PM -0600, Larry Finger wrote:
> Please look at the attached patch. I think it handles the skb allocations
> correctly. The critical point is that _rtl_pci_init_one_rxdesc() cannot be
> allowed to fail to allocate an skb while in the interrupt path. Now, I have
> already allocated the skb before the call and bypassed this routine if the
> allocation fails. After a couple of crashes, this one now works for the case
> when the allocation wouldn't fail anyway. I will likely pull the allocation
> out of _rtl_pci_init_one_rxdesc() in all cases for the final patch.

Well, it's looking better.  But what seems strange to me is that
_rtl_pci_init_one_rxdesc() will map the skb for DMA, even though in the error
path it was never unmapped from the previous use.  The 3.17 version will neither
unmap nor map the skb in the error path.

I also suspect that trying to share _rtl_pci_init_one_rxdesc() between the
driver initialization and the interrupt handler is just confusing matters.
Perhaps only the ->set_desc() calls should be shared?

In any case, I assume it would be a good idea to, for testing, inject some
random skb allocation failures and make sure the driver still works smoothly
except for some dropped packets.

^ permalink raw reply

* Re: [RFC PATCH 02/17] fib_trie: Make leaf and tnode more uniform
From: Alexander Duyck @ 2014-12-22 23:38 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20141222.165015.1694288362513627826.davem@davemloft.net>


On 12/22/2014 01:50 PM, David Miller wrote:
> From: Alexander Duyck <alexander.h.duyck@redhat.com>
> Date: Mon, 22 Dec 2014 10:55:17 -0800
>
>> My real concern with all of this is the fact that we have to do 2
>> separate memory reads per node, one for the key info and one for the
>> child pointer.  I really think we need to get this down to 1 in order
>> to get there, but the overhead is the tricky part for that. What I
>> would look at doing is splitting the tnode into two parts. One would
>> be a key vector (key, pos, bits, seq) paired with a pointer to either
>> a tnode_info or leaf_info, the other would be something like a
>> tnode_info (rcu, parent pointer, full_children, empty_children, key
>> vector array[0]) that provides a means of backtracing and stores the
>> nodes.  The problem is it makes insertion/deletion and backtracking
>> more complicated and doubles (64b) or quadruples (32b) the memory
>> needed as such I am still just throwing the idea around and haven't
>> gotten into implementation yet.
> I think calling into this code twice for every non-local FIB lookup
> has costs as well.

Agreed.  I remember when you sent me the patch to test out merging the 
two tries a few years back that did make a significant difference.

By my math the difference with these patches is probably around 26ns 
extra, 113ns vs 87ns, to do the second table lookup.  The changes in 
adding/checking the suffix length and the fact that we validate the key 
is usable as a prefix before reading the leaf_info made the first table 
lookup much cheaper than it was before so merging the tables should 
provide less of a gain.

What it will come down to is if the cost to backtrack however many bits 
it takes to get to the route is greater than the cost to start the 
search over in the main trie.  In the case of subnets with a short 
prefix you may end up finding that the cost to backtrack will be more 
expensive for addresses at the end of the address range with a large 
number of bits set in the host identifier.

> And yes I agree with you that the memory references matter a lot.

Especially now.  Considering the loop for lookup is fairly small the 
only thing that is really holding it back is the memory access latency.  
That is why I am playing around with the idea of doubling the memory 
footprint for the trie just to make it so that the key and the pointer 
could co-exist in the same 16B region.  I'm hoping it would allow us to 
cut total memory access latency in half and double the speed at which we 
could process tnodes.

Thanks for the feedback.

- Alex

^ permalink raw reply

* Re: [RFC PATCH net-next] tun: support retrieving multiple packets in a single read with IFF_MULTI_READ
From: Alex Gartrell @ 2014-12-22 23:39 UTC (permalink / raw)
  To: Herbert Xu
  Cc: jasonwang, davem, netdev, linux-kernel, mst, herbert, kernel-team
In-Reply-To: <20141222223436.GA25970@gondor.apana.org.au>

Hey Herbert,

On 12/22/2014 02:34 PM, Herbert Xu wrote:
> On Mon, Dec 22, 2014 at 12:18:39PM -0800, Alex Gartrell wrote:
>>
>> While fully aware that this makes me look like an idiot, I have to
>> admit that I've tried and failed to figure out how to get a socket
>> fd out of the tun device.
>
> Well right now the socket is only used within the kernel by
> vhost so it's not exported to user-space.  If we were to use
> recvmmsg obviously we'd create a new interface based on sockets
> for tun and expose the existing socket through that.

Ah, that explains it then.  I was afraid I was just going insane :)

> The current file-based tun interface was never designed to be
> a high-performance interface.  So let's take this opportunity
> and create a new interface (but still using the same underlying
> code since whatever you create should be easily applicable to
> the existing kernel user vhost).

Sounds good to me. I'll get a patch turned around soon.

Thanks,
-- 
Alex Gartrell <agartrell@fb.com>

^ permalink raw reply

* [PATCH net] net: Reset secmark when scrubbing packet
From: Thomas Graf @ 2014-12-23  0:13 UTC (permalink / raw)
  To: davem; +Cc: netdev

skb_scrub_packet() is called when a packet switches between a context
such as between underlay and overlay, between namespaces, or between
L3 subnets.

While we already scrub the packet mark, connection tracking entry,
and cached destination, the security mark/context is left intact.

It seems wrong to inherit the security context of a packet when going
from overlay to underlay or across forwarding paths.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
---
 net/core/skbuff.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index ae13ef6..395c15b 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4148,6 +4148,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
 	skb->ignore_df = 0;
 	skb_dst_drop(skb);
 	skb->mark = 0;
+	skb_init_secmark(skb);
 	secpath_reset(skb);
 	nf_reset(skb);
 	nf_reset_trace(skb);
-- 
1.9.3

^ permalink raw reply related

* Re: [PATCH 3/3] net: ieee802154: don't use devm_pinctrl_get_select_default() in probe
From: Varka Bhadram @ 2014-12-23  0:28 UTC (permalink / raw)
  Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-wpan - ML, netdev@vger.kernel.org
In-Reply-To: <CAEUmHyYbPbeWzHEaPYFAV+wTGYqhz7pps6XEzNrK_jQm_HPKpg@mail.gmail.com>

Thanks for the patch.

Acked-by: Varka Bhadram <varkabhadram@gmail.com>

On Tue, Dec 23, 2014 at 5:40 AM, Varka Bhadram <varkabhadram@gmail.com> wrote:
>
> Thanks for the patch.
>
> Acked-by: Varka Bhadram <varkabhadram@gmail.com>
>
> On Tue, Dec 23, 2014 at 3:46 AM, Wolfram Sang <wsa@the-dreams.de> wrote:
>>
>> Since commit ab78029ecc34 (drivers/pinctrl: grab default handles from device
>> core), we can rely on device core for setting the default pins.
>>
>> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
>> ---
>>  drivers/net/ieee802154/cc2520.c | 7 -------
>>  1 file changed, 7 deletions(-)
>>
>> diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
>> index c2b7da3da183..033473448d9f 100644
>> --- a/drivers/net/ieee802154/cc2520.c
>> +++ b/drivers/net/ieee802154/cc2520.c
>> @@ -19,7 +19,6 @@
>>  #include <linux/workqueue.h>
>>  #include <linux/interrupt.h>
>>  #include <linux/skbuff.h>
>> -#include <linux/pinctrl/consumer.h>
>>  #include <linux/of_gpio.h>
>>  #include <linux/ieee802154.h>
>>
>> @@ -841,7 +840,6 @@ done:
>>  static int cc2520_probe(struct spi_device *spi)
>>  {
>>         struct cc2520_private *priv;
>> -       struct pinctrl *pinctrl;
>>         struct cc2520_platform_data *pdata;
>>         int ret;
>>
>> @@ -854,11 +852,6 @@ static int cc2520_probe(struct spi_device *spi)
>>
>>         spi_set_drvdata(spi, priv);
>>
>> -       pinctrl = devm_pinctrl_get_select_default(&spi->dev);
>> -       if (IS_ERR(pinctrl))
>> -               dev_warn(&spi->dev,
>> -                        "pinctrl pins are not configured\n");
>> -
>>         pdata = cc2520_get_platform_data(spi);
>>         if (!pdata) {
>>                 dev_err(&spi->dev, "no platform data\n");
>> --
>> 2.1.3
>>
>
>
>
> --
> Thanks and Regards,
> Varka Bhadram.




-- 
Thanks and Regards,
Varka Bhadram.

^ permalink raw reply

* [PATCH] bonding: change error message to debug message in __bond_release_one()
From: Wengang Wang @ 2014-12-23  1:24 UTC (permalink / raw)
  To: netdev, gospo, dingtianhong; +Cc: wen.gang.wang

In __bond_release_one(), when the interface is not a slave or not a slave of
"this" master, it log error message.

The message actually should be a debug message matching what bond_enslave()
does.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
---
 drivers/net/bonding/bond_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 184c434..0dceba1 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1648,7 +1648,7 @@ static int __bond_release_one(struct net_device *bond_dev,
 	/* slave is not a slave or master is not master of this slave */
 	if (!(slave_dev->flags & IFF_SLAVE) ||
 	    !netdev_has_upper_dev(slave_dev, bond_dev)) {
-		netdev_err(bond_dev, "cannot release %s\n",
+		netdev_dbg(bond_dev, "cannot release %s\n",
 			   slave_dev->name);
 		return -EINVAL;
 	}
-- 
1.8.3.1

^ permalink raw reply related

* Re: [PATCH net] net: Generalize ndo_gso_check to ndo_features_check
From: Tom Herbert @ 2014-12-23  1:28 UTC (permalink / raw)
  To: Jesse Gross; +Cc: David Miller, Linux Netdev List, Joe Stringer, Eric Dumazet
In-Reply-To: <1419264223-30004-1-git-send-email-jesse@nicira.com>

On Mon, Dec 22, 2014 at 8:03 AM, Jesse Gross <jesse@nicira.com> wrote:
> GSO isn't the only offload feature with restrictions that
> potentially can't be expressed with the current features mechanism.
> Checksum is another although it's a general issue that could in
> theory apply to anything. Even if it may be possible to
> implement these restrictions in other ways, it can result in
> duplicate code or inefficient per-packet behavior.
>
> This generalizes ndo_gso_check so that drivers can remove any
> features that don't make sense for a given packet, similar to
> netif_skb_features(). It also converts existing driver
> restrictions to the new format, completing the work that was
> done to support tunnel protocols since the issues apply to
> checksums as well.
>
It's a nice feature, but I really hope that this is not used for
checksums. We already have a sufficiently general interface for that
and checksum is already computed in drivers to work around HW bugs.

Acked-by:  Tom Herbert <therbert@google.com>

> CC: Tom Herbert <therbert@google.com>
> CC: Joe Stringer <joestringer@nicira.com>
> CC: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Jesse Gross <jesse@nicira.com>
> Fixes: 04ffcb255f22 ("net: Add ndo_gso_check")
> ---
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |  8 ++++---
>  drivers/net/ethernet/emulex/benet/be_main.c      |  8 ++++---
>  drivers/net/ethernet/mellanox/mlx4/en_netdev.c   | 10 +++++----
>  drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |  8 ++++---
>  include/linux/netdevice.h                        | 20 +++++++++--------
>  include/net/vxlan.h                              | 28 ++++++++++++++++++++----
>  net/core/dev.c                                   | 28 ++++++++++++++++--------
>  7 files changed, 75 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> index 9f5e387..72eef9f 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> @@ -12553,9 +12553,11 @@ static int bnx2x_get_phys_port_id(struct net_device *netdev,
>         return 0;
>  }
>
> -static bool bnx2x_gso_check(struct sk_buff *skb, struct net_device *dev)
> +static netdev_features_t bnx2x_features_check(struct sk_buff *skb,
> +                                             struct net_device *dev,
> +                                             netdev_features_t features)
>  {
> -       return vxlan_gso_check(skb);
> +       return vxlan_features_check(skb, features);
>  }
>
>  static const struct net_device_ops bnx2x_netdev_ops = {
> @@ -12589,7 +12591,7 @@ static const struct net_device_ops bnx2x_netdev_ops = {
>  #endif
>         .ndo_get_phys_port_id   = bnx2x_get_phys_port_id,
>         .ndo_set_vf_link_state  = bnx2x_set_vf_link_state,
> -       .ndo_gso_check          = bnx2x_gso_check,
> +       .ndo_features_check     = bnx2x_features_check,
>  };
>
>  static int bnx2x_set_coherency_mask(struct bnx2x *bp)
> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
> index 1960731..41a0a54 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
> @@ -4459,9 +4459,11 @@ done:
>         adapter->vxlan_port_count--;
>  }
>
> -static bool be_gso_check(struct sk_buff *skb, struct net_device *dev)
> +static netdev_features_t be_features_check(struct sk_buff *skb,
> +                                          struct net_device *dev,
> +                                          netdev_features_t features)
>  {
> -       return vxlan_gso_check(skb);
> +       return vxlan_features_check(skb, features);
>  }
>  #endif
>
> @@ -4492,7 +4494,7 @@ static const struct net_device_ops be_netdev_ops = {
>  #ifdef CONFIG_BE2NET_VXLAN
>         .ndo_add_vxlan_port     = be_add_vxlan_port,
>         .ndo_del_vxlan_port     = be_del_vxlan_port,
> -       .ndo_gso_check          = be_gso_check,
> +       .ndo_features_check     = be_features_check,
>  #endif
>  };
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> index 190cbd9..d0d6dc1 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -2365,9 +2365,11 @@ static void mlx4_en_del_vxlan_port(struct  net_device *dev,
>         queue_work(priv->mdev->workqueue, &priv->vxlan_del_task);
>  }
>
> -static bool mlx4_en_gso_check(struct sk_buff *skb, struct net_device *dev)
> +static netdev_features_t mlx4_en_features_check(struct sk_buff *skb,
> +                                               struct net_device *dev,
> +                                               netdev_features_t features)
>  {
> -       return vxlan_gso_check(skb);
> +       return vxlan_features_check(skb, features);
>  }
>  #endif
>
> @@ -2400,7 +2402,7 @@ static const struct net_device_ops mlx4_netdev_ops = {
>  #ifdef CONFIG_MLX4_EN_VXLAN
>         .ndo_add_vxlan_port     = mlx4_en_add_vxlan_port,
>         .ndo_del_vxlan_port     = mlx4_en_del_vxlan_port,
> -       .ndo_gso_check          = mlx4_en_gso_check,
> +       .ndo_features_check     = mlx4_en_features_check,
>  #endif
>  };
>
> @@ -2434,7 +2436,7 @@ static const struct net_device_ops mlx4_netdev_ops_master = {
>  #ifdef CONFIG_MLX4_EN_VXLAN
>         .ndo_add_vxlan_port     = mlx4_en_add_vxlan_port,
>         .ndo_del_vxlan_port     = mlx4_en_del_vxlan_port,
> -       .ndo_gso_check          = mlx4_en_gso_check,
> +       .ndo_features_check     = mlx4_en_features_check,
>  #endif
>  };
>
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> index 1aa25b1..9929b97 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> @@ -505,9 +505,11 @@ static void qlcnic_del_vxlan_port(struct net_device *netdev,
>         adapter->flags |= QLCNIC_DEL_VXLAN_PORT;
>  }
>
> -static bool qlcnic_gso_check(struct sk_buff *skb, struct net_device *dev)
> +static netdev_features_t qlcnic_features_check(struct sk_buff *skb,
> +                                              struct net_device *dev,
> +                                              netdev_features_t features)
>  {
> -       return vxlan_gso_check(skb);
> +       return vxlan_features_check(skb, features);
>  }
>  #endif
>
> @@ -532,7 +534,7 @@ static const struct net_device_ops qlcnic_netdev_ops = {
>  #ifdef CONFIG_QLCNIC_VXLAN
>         .ndo_add_vxlan_port     = qlcnic_add_vxlan_port,
>         .ndo_del_vxlan_port     = qlcnic_del_vxlan_port,
> -       .ndo_gso_check          = qlcnic_gso_check,
> +       .ndo_features_check     = qlcnic_features_check,
>  #endif
>  #ifdef CONFIG_NET_POLL_CONTROLLER
>         .ndo_poll_controller = qlcnic_poll_controller,
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index c31f74d..679e6e9 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1012,12 +1012,15 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
>   *     Callback to use for xmit over the accelerated station. This
>   *     is used in place of ndo_start_xmit on accelerated net
>   *     devices.
> - * bool        (*ndo_gso_check) (struct sk_buff *skb,
> - *                       struct net_device *dev);
> + * netdev_features_t (*ndo_features_check) (struct sk_buff *skb,
> + *                                         struct net_device *dev
> + *                                         netdev_features_t features);
>   *     Called by core transmit path to determine if device is capable of
> - *     performing GSO on a packet. The device returns true if it is
> - *     able to GSO the packet, false otherwise. If the return value is
> - *     false the stack will do software GSO.
> + *     performing offload operations on a given packet. This is to give
> + *     the device an opportunity to implement any restrictions that cannot
> + *     be otherwise expressed by feature flags. The check is called with
> + *     the set of features that the stack has calculated and it returns
> + *     those the driver believes to be appropriate.
>   *
>   * int (*ndo_switch_parent_id_get)(struct net_device *dev,
>   *                                struct netdev_phys_item_id *psid);
> @@ -1178,8 +1181,9 @@ struct net_device_ops {
>                                                         struct net_device *dev,
>                                                         void *priv);
>         int                     (*ndo_get_lock_subclass)(struct net_device *dev);
> -       bool                    (*ndo_gso_check) (struct sk_buff *skb,
> -                                                 struct net_device *dev);
> +       netdev_features_t       (*ndo_features_check) (struct sk_buff *skb,
> +                                                      struct net_device *dev,
> +                                                      netdev_features_t features);
>  #ifdef CONFIG_NET_SWITCHDEV
>         int                     (*ndo_switch_parent_id_get)(struct net_device *dev,
>                                                             struct netdev_phys_item_id *psid);
> @@ -3611,8 +3615,6 @@ static inline bool netif_needs_gso(struct net_device *dev, struct sk_buff *skb,
>                                    netdev_features_t features)
>  {
>         return skb_is_gso(skb) && (!skb_gso_ok(skb, features) ||
> -               (dev->netdev_ops->ndo_gso_check &&
> -                !dev->netdev_ops->ndo_gso_check(skb, dev)) ||
>                 unlikely((skb->ip_summed != CHECKSUM_PARTIAL) &&
>                          (skb->ip_summed != CHECKSUM_UNNECESSARY)));
>  }
> diff --git a/include/net/vxlan.h b/include/net/vxlan.h
> index 57cccd0..903461a 100644
> --- a/include/net/vxlan.h
> +++ b/include/net/vxlan.h
> @@ -1,6 +1,9 @@
>  #ifndef __NET_VXLAN_H
>  #define __NET_VXLAN_H 1
>
> +#include <linux/ip.h>
> +#include <linux/ipv6.h>
> +#include <linux/if_vlan.h>
>  #include <linux/skbuff.h>
>  #include <linux/netdevice.h>
>  #include <linux/udp.h>
> @@ -51,16 +54,33 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
>                    __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
>                    __be16 src_port, __be16 dst_port, __be32 vni, bool xnet);
>
> -static inline bool vxlan_gso_check(struct sk_buff *skb)
> +static inline netdev_features_t vxlan_features_check(struct sk_buff *skb,
> +                                                    netdev_features_t features)
>  {
> -       if ((skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL) &&
> +       u8 l4_hdr = 0;
> +
> +       if (!skb->encapsulation)
> +               return features;
> +
> +       switch (vlan_get_protocol(skb)) {
> +       case htons(ETH_P_IP):
> +               l4_hdr = ip_hdr(skb)->protocol;
> +               break;
> +       case htons(ETH_P_IPV6):
> +               l4_hdr = ipv6_hdr(skb)->nexthdr;
> +               break;
> +       default:
> +               return features;;
> +       }
> +
> +       if ((l4_hdr == IPPROTO_UDP) &&
>             (skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
>              skb->inner_protocol != htons(ETH_P_TEB) ||
>              (skb_inner_mac_header(skb) - skb_transport_header(skb) !=
>               sizeof(struct udphdr) + sizeof(struct vxlanhdr))))
> -               return false;
> +               return features & ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK);
>
> -       return true;
> +       return features;
>  }
>
>  /* IP header + UDP + VXLAN + Ethernet header */
> diff --git a/net/core/dev.c b/net/core/dev.c
> index f411c28..fc13f72 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2562,7 +2562,7 @@ static netdev_features_t harmonize_features(struct sk_buff *skb,
>
>  netdev_features_t netif_skb_features(struct sk_buff *skb)
>  {
> -       const struct net_device *dev = skb->dev;
> +       struct net_device *dev = skb->dev;
>         netdev_features_t features = dev->features;
>         u16 gso_segs = skb_shinfo(skb)->gso_segs;
>         __be16 protocol = skb->protocol;
> @@ -2570,11 +2570,19 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
>         if (gso_segs > dev->gso_max_segs || gso_segs < dev->gso_min_segs)
>                 features &= ~NETIF_F_GSO_MASK;
>
> +       /* If encapsulation offload request, verify we are testing
> +        * hardware encapsulation features instead of standard
> +        * features for the netdev
> +        */
> +       if (skb->encapsulation)
> +               features = netdev_intersect_features(features,
> +                                                    dev->hw_enc_features);
> +
>         if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD)) {
>                 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
>                 protocol = veh->h_vlan_encapsulated_proto;
>         } else if (!vlan_tx_tag_present(skb)) {
> -               return harmonize_features(skb, features);
> +               goto finalize;
>         }
>
>         features = netdev_intersect_features(features,
> @@ -2591,6 +2599,15 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
>                                                      NETIF_F_HW_VLAN_CTAG_TX |
>                                                      NETIF_F_HW_VLAN_STAG_TX);
>
> +finalize:
> +       if (dev->netdev_ops->ndo_features_check) {
> +               netdev_features_t dev_features;
> +
> +               dev_features = dev->netdev_ops->ndo_features_check(skb, dev,
> +                                                                  features);
> +               features = netdev_intersect_features(features, dev_features);
> +       }
> +
>         return harmonize_features(skb, features);
>  }
>  EXPORT_SYMBOL(netif_skb_features);
> @@ -2661,13 +2678,6 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device
>         if (unlikely(!skb))
>                 goto out_null;
>
> -       /* If encapsulation offload request, verify we are testing
> -        * hardware encapsulation features instead of standard
> -        * features for the netdev
> -        */
> -       if (skb->encapsulation)
> -               features &= dev->hw_enc_features;
> -
>         if (netif_needs_gso(dev, skb, features)) {
>                 struct sk_buff *segs;
>
> --
> 1.9.1
>

^ permalink raw reply

* Re: [PATCH iproute2 v2] tc: Show classes in tree view
From: Stephen Hemminger @ 2014-12-23  1:35 UTC (permalink / raw)
  To: Vadim Kochan; +Cc: netdev
In-Reply-To: <1419263518-14434-1-git-send-email-vadim4j@gmail.com>

On Mon, 22 Dec 2014 17:51:58 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:

> +	while (cls && cls->cls_parent) {
> +		cls->cls_parent->cls_right = cls;
> +		cls = cls->cls_parent;
> +	}
> +	while (cls && cls->cls_right)
> +	{

Why the sudden shift of bracketing style?

^ permalink raw reply

* Re: [PATCH] bonding: change error message to debug message in __bond_release_one()
From: Ding Tianhong @ 2014-12-23  1:48 UTC (permalink / raw)
  To: Wengang Wang, netdev, gospo
In-Reply-To: <1419297876-1412-1-git-send-email-wen.gang.wang@oracle.com>

On 2014/12/23 9:24, Wengang Wang wrote:
> In __bond_release_one(), when the interface is not a slave or not a slave of
> "this" master, it log error message.
> 
> The message actually should be a debug message matching what bond_enslave()
> does.
> 
> Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
> ---
>  drivers/net/bonding/bond_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 184c434..0dceba1 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1648,7 +1648,7 @@ static int __bond_release_one(struct net_device *bond_dev,
>  	/* slave is not a slave or master is not master of this slave */
>  	if (!(slave_dev->flags & IFF_SLAVE) ||
>  	    !netdev_has_upper_dev(slave_dev, bond_dev)) {
> -		netdev_err(bond_dev, "cannot release %s\n",
> +		netdev_dbg(bond_dev, "cannot release %s\n",
>  			   slave_dev->name);
>  		return -EINVAL;
>  	}
> 
Acked-by: Ding Tianhong <dingtianhong@huawei.com>

^ permalink raw reply

* [PATCH v3] 3c59x: Fix memory leaks in vortex_open
From: Jia-Ju Bai @ 2014-12-23  2:54 UTC (permalink / raw)
  To: davem, nhorman, ebiederm, dingtianhong, paul.gortmaker,
	justinvanwijngaarden
  Cc: netdev, Jia-Ju Bai

For linux-3.18.0
The driver calls __netdev_alloc_skb in vortex_open but lacks dev_kfree_skb
when vortex_up is failed, so memory leaks may occur in this situation.
This patch fixes this problem.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
 drivers/net/ethernet/3com/3c59x.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index 41095eb..d0c5bee 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -1782,6 +1782,16 @@ vortex_open(struct net_device *dev)
 	if (!retval)
 		goto out;
 
+	if (vp->full_bus_master_rx) {
+		for (i = 0; i < RX_RING_SIZE; i++) {
+			if (vp->rx_skbuff[i]) {
+				dev_kfree_skb(vp->rx_skbuff[i]);
+				vp->rx_skbuff[i] = NULL;
+			}
+		}
+		retval = -ENOMEM;
+	}
+
 err_free_irq:
 	free_irq(dev->irq, dev);
 err:
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v3] ne2k-pci: Add pci_disable_device in error handling
From: Jia-Ju Bai @ 2014-12-23  3:29 UTC (permalink / raw)
  To: davem, bhelgaas, benoit.taine; +Cc: netdev, Jia-Ju Bai

For linux-3.18.0
The driver lacks pci_disable_device in error handling code of
ne2k_pci_init_one, so the device enabled by pci_enable_device is not
disabled when errors occur.
This patch fixes this problem.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
 drivers/net/ethernet/8390/ne2k-pci.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/8390/ne2k-pci.c b/drivers/net/ethernet/8390/ne2k-pci.c
index 89c8d9f..160c161 100644
--- a/drivers/net/ethernet/8390/ne2k-pci.c
+++ b/drivers/net/ethernet/8390/ne2k-pci.c
@@ -246,13 +246,13 @@ static int ne2k_pci_init_one(struct pci_dev *pdev,
 
 	if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) {
 		dev_err(&pdev->dev, "no I/O resource at PCI BAR #0\n");
-		return -ENODEV;
+		goto err_out;
 	}
 
 	if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) {
 		dev_err(&pdev->dev, "I/O resource 0x%x @ 0x%lx busy\n",
 			NE_IO_EXTENT, ioaddr);
-		return -EBUSY;
+		goto err_out;
 	}
 
 	reg0 = inb(ioaddr);
@@ -392,6 +392,8 @@ err_out_free_netdev:
 	free_netdev (dev);
 err_out_free_res:
 	release_region (ioaddr, NE_IO_EXTENT);
+err_out:
+	pci_disable_device(pdev);
 	return -ENODEV;
 }
 
-- 
1.7.9.5

^ permalink raw reply related

* RE: [PATCH net] net: Generalize ndo_gso_check to ndo_features_check
From: Sathya Perla @ 2014-12-23  6:24 UTC (permalink / raw)
  To: Tom Herbert, Jesse Gross
  Cc: David Miller, Linux Netdev List, Joe Stringer, Eric Dumazet
In-Reply-To: <CA+mtBx9vYV5i9_u=XMmEgSV3Uj9SEJAZHrKhTgyGgBG9Ojs-dA@mail.gmail.com>

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of Tom Herbert
> 
> On Mon, Dec 22, 2014 at 8:03 AM, Jesse Gross <jesse@nicira.com> wrote:
> > GSO isn't the only offload feature with restrictions that
> > potentially can't be expressed with the current features mechanism.
> > Checksum is another although it's a general issue that could in
> > theory apply to anything. Even if it may be possible to
> > implement these restrictions in other ways, it can result in
> > duplicate code or inefficient per-packet behavior.
> >
> > This generalizes ndo_gso_check so that drivers can remove any
> > features that don't make sense for a given packet, similar to
> > netif_skb_features(). It also converts existing driver
> > restrictions to the new format, completing the work that was
> > done to support tunnel protocols since the issues apply to
> > checksums as well.
> >
> It's a nice feature, but I really hope that this is not used for
> checksums. We already have a sufficiently general interface for that
> and checksum is already computed in drivers to work around HW bugs.
> 
The ndo_featureas_check() interface that includes a means to report
inability to compute inner checksums on some tunnel types, seems like
a useful feature. The Skyhawk-R NIC can support inner csum offload for
either vxlan or nv-gre, but not both simultaneously. So, this ndo_
is useful in reporting this situation.
This would also obviate the need to have extra code in the drivers to
compute csums in the above scenario.

thanks,
-Sathya

^ 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