Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next] enic: fix work done in tx napi_poll
From: David Miller @ 2014-11-13  3:18 UTC (permalink / raw)
  To: f.fainelli; +Cc: _govind, netdev, ssujith, edumazet
In-Reply-To: <5463F0C6.80501@gmail.com>

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Wed, 12 Nov 2014 15:44:06 -0800

> On 11/12/2014 02:42 PM, Govindarajulu Varadarajan wrote:
>> With the commit d75b1ade567 ("net: less interrupt masking in NAPI") napi repoll
>> is done only when work_done == budget. In tx napi poll we always return 0.
>> So tx napi is not called again and we do not clean up the tx ring.
> 
> Good catch, I had exactly the same bug in bcmsysport.c, sounds like
> drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c could also need a fix.
> 
> Thanks!
> 
>> 
>> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>

Applied, thanks everyone.

^ permalink raw reply

* Re: [PATCH net-next] net: systemport: fix tx work done in TX napi poll
From: David Miller @ 2014-11-13  3:21 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, edumazet
In-Reply-To: <1415835643-13767-1-git-send-email-f.fainelli@gmail.com>

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Wed, 12 Nov 2014 15:40:43 -0800

> With commit d75b1ade567 ("net: less interrupt masking in NAPI") napi
> repoll is done only when work_done == budget. bcm_sysport_tx_poll()
> always returns 0 whether or not we completed the poll quantum.
> 
> Fix this by returning either 0 when we did complete the TX ring reclaim,
> or budget to trigger a repoll.
> 
> Fixes: d75b1ade567 ("net: less interrupt masking in NAPI")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next 2/2] r8152: adjust rtl_start_rx
From: David Miller @ 2014-11-13  3:31 UTC (permalink / raw)
  To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel, linux-usb
In-Reply-To: <0835B3720019904CB8F7AA43166CEEB2ECE8EF@RTITMBSV03.realtek.com.tw>

From: Hayes Wang <hayeswang@realtek.com>
Date: Thu, 13 Nov 2014 02:31:14 +0000

> My last method which I mentioned yesterday is similar to
> this one. The difference is that I would re-use the rx
> buffers, so I have to add them to the list for re-submitting,
> not alwayes allocate new one.
> 
> Although one rx buffer could contain many packets, I don't
> think the whole size of the rx buffer is alwayes used.
> Therefore, I re-use the rx buffers to avoid allocating
> the 16K bytes rx buffer alwayes. This also makes sure that
> I always have the buffers to submit without allocating new
> one.
> 
> If you could accept this, I would modify this patch by
> this way.

I'll reread your original patch and think some more about this.

Thanks.

^ permalink raw reply

* (unknown)
From: julien.parvole @ 2014-11-13  2:10 UTC (permalink / raw)




Greetings,

I hope this proposal meets you in a good state of health.

Please can you help me re-profile fund? I am Mr Nobuyuki Hirano,  
President and CEO of The Bank of Tokyo-Mitsubishi UFJ. A sum of Twenty  
three million, two Hundred Thousand dollars  was deposited by my Late  
customer (Fadel Ahmed) who died without declaring any next of kin  
before his death in 2009.

My suggestion to you is to stand as the next of kin to Fadel Ahmed. We  
shall share in the ratio of 50% for me, 50% for you. Please contact me  
via this e- mail: mr.nobuyukihirano@foxmail.com thanks.

Sincerely,
Mr. Nobuyuki Hirano

^ permalink raw reply

* Re: [PATCH] e100: Don't enable WoL by default on Toshiba devices
From: Jeff Kirsher @ 2014-11-13  3:38 UTC (permalink / raw)
  To: David Miller; +Cc: e1000-devel, netdev, linux, linux-kernel
In-Reply-To: <20141112.181813.1072534293888457853.davem@davemloft.net>


[-- Attachment #1.1: Type: text/plain, Size: 730 bytes --]

On Wed, 2014-11-12 at 18:18 -0500, David Miller wrote:
> From: Ondrej Zary <linux@rainbow-software.org>
> Date: Wed, 12 Nov 2014 23:47:25 +0100
> 
> > Enabling WoL on some Toshiba laptops (such as Portege R100) causes battery
> > drain after shutdown (WoL is active even on battery). These laptops have the
> > WoL bit set in EEPROM ID, causing e100 driver to enable WoL by default.
> > 
> > Check subsystem vendor ID and if it's Toshiba, don't enable WoL by default
> > from EEPROM settings.
> > 
> > Fixes https://bugs.launchpad.net/ubuntu/+source/linux/+bug/110784
> > 
> > Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
> 
> Jeff, are you gonna pick this up?

Yes, sorry I did not catch it earlier.

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk

[-- Attachment #3: Type: text/plain, Size: 257 bytes --]

_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply

* lib: rhashtable - Remove weird non-ASCII characters from comments
From: Herbert Xu @ 2014-11-13  5:10 UTC (permalink / raw)
  To: David S. Miller, netdev; +Cc: Thomas Graf

My editor spewed garbage that looked like memory corruption on
my screen.  It turns out that a number of occurences of "fi" got
turned into a ligature.
    
This patch replaces these ligatures with the ASCII letters "fi".
    
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 081be3b..624a0b7 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -230,7 +230,7 @@ int rhashtable_expand(struct rhashtable *ht, gfp_t flags)
 	ht->shift++;
 
 	/* For each new bucket, search the corresponding old bucket
-	 * for the first entry that hashes to the new bucket, and
+	 * for the first entry that hashes to the new bucket, and
 	 * link the new bucket to that entry. Since all the entries
 	 * which will end up in the new bucket appear in the same
 	 * old bucket, this constructs an entirely valid new hash
@@ -248,8 +248,8 @@ int rhashtable_expand(struct rhashtable *ht, gfp_t flags)
 	}
 
 	/* Publish the new table pointer. Lookups may now traverse
-	 * the new table, but they will not benefit from any
-	 * additional efficiency until later steps unzip the buckets.
+	 * the new table, but they will not benefit from any
+	 * additional efficiency until later steps unzip the buckets.
 	 */
 	rcu_assign_pointer(ht->tbl, new_tbl);
 
@@ -306,14 +306,14 @@ int rhashtable_shrink(struct rhashtable *ht, gfp_t flags)
 
 	ht->shift--;
 
-	/* Link each bucket in the new table to the first bucket
+	/* Link each bucket in the new table to the first bucket
 	 * in the old table that contains entries which will hash
 	 * to the new bucket.
 	 */
 	for (i = 0; i < ntbl->size; i++) {
 		ntbl->buckets[i] = tbl->buckets[i];
 
-		/* Link each bucket in the new table to the first bucket
+		/* Link each bucket in the new table to the first bucket
 		 * in the old table that contains entries which will hash
 		 * to the new bucket.
 		 */

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 related

* [PATCH 1/2] virito: introduce methods of fixing device features
From: Jason Wang @ 2014-11-13  5:24 UTC (permalink / raw)
  To: rusty, mst, virtualization, linux-kernel; +Cc: netdev

Buggy host may advertised buggy host features (a usual case is that host
advertise a feature whose dependencies were missed). In this case, driver
should detect and disable the buggy features by itself.

This patch introduces driver specific fix_features() method which is called
just before features finalizing to detect and disable buggy features
advertised by host.

Virtio-net will be the first user.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/virtio/virtio.c       |  4 ++++
 include/linux/virtio.h        |  1 +
 include/linux/virtio_config.h | 12 ++++++++++++
 3 files changed, 17 insertions(+)

diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index df598dd..7001d6e 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -181,6 +181,10 @@ static int virtio_dev_probe(struct device *_d)
 		if (device_features & (1 << i))
 			set_bit(i, dev->features);
 
+	/* Fix buggy features advertised by host */
+	if (drv->fix_features)
+		drv->fix_features(dev);
+
 	dev->config->finalize_features(dev);
 
 	err = drv->probe(dev);
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 65261a7..9d01b54 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -142,6 +142,7 @@ struct virtio_driver {
 	void (*scan)(struct virtio_device *dev);
 	void (*remove)(struct virtio_device *dev);
 	void (*config_changed)(struct virtio_device *dev);
+	void (*fix_features)(struct virtio_device *dev);
 #ifdef CONFIG_PM
 	int (*freeze)(struct virtio_device *dev);
 	int (*restore)(struct virtio_device *dev);
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 7f4ef66..7bd89ea 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -96,6 +96,18 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
 	return test_bit(fbit, vdev->features);
 }
 
+static inline void virtio_disable_feature(struct virtio_device *vdev,
+                                          unsigned int fbit)
+{
+	BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START);
+	BUG_ON(vdev->config->get_status(vdev) &
+	       ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER));
+
+	virtio_check_driver_offered_feature(vdev, fbit);
+
+	clear_bit(fbit, vdev->features);
+}
+
 static inline
 struct virtqueue *virtio_find_single_vq(struct virtio_device *vdev,
 					vq_callback_t *c, const char *n)
-- 
1.9.1

^ permalink raw reply related

* [PATCH 2/2] virtio-net: fix buggy features advertised by host
From: Jason Wang @ 2014-11-13  5:24 UTC (permalink / raw)
  To: rusty, mst, virtualization, linux-kernel; +Cc: netdev
In-Reply-To: <1415856287-12849-1-git-send-email-jasowang@redhat.com>

This patch tries to detect the possible buggy features advertised by host
and fix them. One example is current booting virtio-net with only
ctrl_vq disabled, qemu may still advertise many features which depends
it. This will trigger several BUG()s in virtnet_send_command().

This patch utilizes the fix_features() method, and disable all features that
depends on ctrl_vq if it was not advertised.

This fixes the crash when booting with ctrl_vq=off.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/net/virtio_net.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ec2a8b4..d6bb5fa 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1948,6 +1948,40 @@ static int virtnet_restore(struct virtio_device *vdev)
 }
 #endif
 
+static void virtnet_fix_features(struct virtio_device *dev)
+{
+	if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) {
+		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) {
+			pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host "
+				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
+			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX);
+		}
+		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) {
+			pr_warning("Disable VIRTIO_NET_F_CTRL_VLAN since host "
+				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
+			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN);
+		}
+		if (virtio_has_feature(dev, VIRTIO_NET_F_GUEST_ANNOUNCE)) {
+			pr_warning("Disable VIRTIO_NET_F_GUEST_ANNOUCE since "
+				   "host does not advertise "
+				   "VIRTIO_NET_F_CTRL_VQ");
+			virtio_disable_feature(dev,
+					       VIRTIO_NET_F_GUEST_ANNOUNCE);
+		}
+		if (virtio_has_feature(dev, VIRTIO_NET_F_MQ)) {
+			pr_warning("Disable VIRTIO_NET_F_MQ since host "
+				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
+			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN);
+		}
+		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_MAC_ADDR)) {
+			pr_warning("Disable VIRTIO_NET_F_CTRL_MAC_ADDR since "
+				   "host does not advertise "
+				   "VIRTIO_NET_F_CTRL_VQ");
+			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN);
+		}
+	}
+}
+
 static struct virtio_device_id id_table[] = {
 	{ VIRTIO_ID_NET, VIRTIO_DEV_ANY_ID },
 	{ 0 },
@@ -1975,6 +2009,7 @@ static struct virtio_driver virtio_net_driver = {
 	.probe =	virtnet_probe,
 	.remove =	virtnet_remove,
 	.config_changed = virtnet_config_changed,
+	.fix_features = virtnet_fix_features,
 #ifdef CONFIG_PM_SLEEP
 	.freeze =	virtnet_freeze,
 	.restore =	virtnet_restore,
-- 
1.9.1

^ permalink raw reply related

* Re: [PATCH 2/2] virtio-net: fix buggy features advertised by host
From: Jason Wang @ 2014-11-13  5:42 UTC (permalink / raw)
  To: rusty, mst, virtualization, linux-kernel; +Cc: netdev
In-Reply-To: <1415856287-12849-2-git-send-email-jasowang@redhat.com>

On 11/13/2014 01:24 PM, Jason Wang wrote:
> This patch tries to detect the possible buggy features advertised by host
> and fix them. One example is current booting virtio-net with only
> ctrl_vq disabled, qemu may still advertise many features which depends
> it. This will trigger several BUG()s in virtnet_send_command().
>
> This patch utilizes the fix_features() method, and disable all features that
> depends on ctrl_vq if it was not advertised.
>
> This fixes the crash when booting with ctrl_vq=off.
>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  drivers/net/virtio_net.c | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index ec2a8b4..d6bb5fa 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1948,6 +1948,40 @@ static int virtnet_restore(struct virtio_device *vdev)
>  }
>  #endif
>  
> +static void virtnet_fix_features(struct virtio_device *dev)
> +{
> +	if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) {
> +		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) {
> +			pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host "
> +				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
> +			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX);
> +		}
> +		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) {
> +			pr_warning("Disable VIRTIO_NET_F_CTRL_VLAN since host "
> +				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
> +			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN);
> +		}
> +		if (virtio_has_feature(dev, VIRTIO_NET_F_GUEST_ANNOUNCE)) {
> +			pr_warning("Disable VIRTIO_NET_F_GUEST_ANNOUCE since "
> +				   "host does not advertise "
> +				   "VIRTIO_NET_F_CTRL_VQ");
> +			virtio_disable_feature(dev,
> +					       VIRTIO_NET_F_GUEST_ANNOUNCE);
> +		}
> +		if (virtio_has_feature(dev, VIRTIO_NET_F_MQ)) {
> +			pr_warning("Disable VIRTIO_NET_F_MQ since host "
> +				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
> +			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN);
> +		}
> +		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_MAC_ADDR)) {
> +			pr_warning("Disable VIRTIO_NET_F_CTRL_MAC_ADDR since "
> +				   "host does not advertise "
> +				   "VIRTIO_NET_F_CTRL_VQ");
> +			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN);

Oops, this looks like a cut-and-paste error. Will post V2.
> +		}
> +	}
> +}
> +
>  static struct virtio_device_id id_table[] = {
>  	{ VIRTIO_ID_NET, VIRTIO_DEV_ANY_ID },
>  	{ 0 },
> @@ -1975,6 +2009,7 @@ static struct virtio_driver virtio_net_driver = {
>  	.probe =	virtnet_probe,
>  	.remove =	virtnet_remove,
>  	.config_changed = virtnet_config_changed,
> +	.fix_features = virtnet_fix_features,
>  #ifdef CONFIG_PM_SLEEP
>  	.freeze =	virtnet_freeze,
>  	.restore =	virtnet_restore,

^ permalink raw reply

* Re: [patch net-next v2 00/10] introduce rocker switch driver with hardware accelerated datapath api - phase 1: bridge fdb offload
From: Simon Horman @ 2014-11-13  5:44 UTC (permalink / raw)
  To: John Fastabend
  Cc: Jamal Hadi Salim, Jiri Pirko, netdev, davem, nhorman, andy, tgraf,
	dborkman, ogerlitz, jesse, pshelar, azhou, ben, stephen,
	jeffrey.t.kirsher, vyasevic, xiyou.wangcong, john.r.fastabend,
	edumazet, sfeldma, f.fainelli, roopa, linville, jasowang,
	ebiederm, nicolas.dichtel, ryazanov.s.a, buytenh, aviadr, nbd,
	alexei.starovoitov, Neil.Jerram, ronye, alexander.h.duyck,
	john.ronciak, mleitner, shrijeet, gospo
In-Reply-To: <54613AD3.7030600@gmail.com>

[snip]

> Simon, if your feeling adventurous any feedback on the repo link
> would be great. I still need to smash the commit log into something
> coherent though at the moment you can see all the errors and rewrites,
> etc as I made them.

Hi John,

here is some preliminary feedback:

* I notice that the parse graph code isn't present yet.
  I suppose this is a difficult piece that naturally follows many
  other piece. None the less it is possibly the piece of most
  interest to me :-)

* Will del and update flows require flows to already exist?
  And similarly, will add flow require flows with the same match to not
  already exist?  If so, the error handling seems tricky of more than one
  flow is to be deleted/updated. IIRC there was some discussion of that
  kind of issue at the (double) round table discussion on the last day of
  LPC14 in Düsseldorf.

* Should the .node_count value of ixgbe_table_node_l2 be 3?
  ixgbe_table_graph_nodes has three elements but perhaps you
  are intentionally excluding the last element ixgbe_table_node_nil?

^ permalink raw reply

* [PATCH 1/2] virito: introduce methods of fixing device features
From: Jason Wang @ 2014-11-13  5:52 UTC (permalink / raw)
  To: rusty, mst, virtualization, linux-kernel; +Cc: netdev

Buggy host may advertised buggy host features (a usual case is that host
advertise a feature whose dependencies were missed). In this case, driver
should detect and disable the buggy features by itself.

This patch introduces driver specific fix_features() method which is called
just before features finalizing to detect and disable buggy features
advertised by host.

Virtio-net will be the first user.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/virtio/virtio.c       |  4 ++++
 include/linux/virtio.h        |  1 +
 include/linux/virtio_config.h | 12 ++++++++++++
 3 files changed, 17 insertions(+)

diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index df598dd..7001d6e 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -181,6 +181,10 @@ static int virtio_dev_probe(struct device *_d)
 		if (device_features & (1 << i))
 			set_bit(i, dev->features);
 
+	/* Fix buggy features advertised by host */
+	if (drv->fix_features)
+		drv->fix_features(dev);
+
 	dev->config->finalize_features(dev);
 
 	err = drv->probe(dev);
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 65261a7..9d01b54 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -142,6 +142,7 @@ struct virtio_driver {
 	void (*scan)(struct virtio_device *dev);
 	void (*remove)(struct virtio_device *dev);
 	void (*config_changed)(struct virtio_device *dev);
+	void (*fix_features)(struct virtio_device *dev);
 #ifdef CONFIG_PM
 	int (*freeze)(struct virtio_device *dev);
 	int (*restore)(struct virtio_device *dev);
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 7f4ef66..7bd89ea 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -96,6 +96,18 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
 	return test_bit(fbit, vdev->features);
 }
 
+static inline void virtio_disable_feature(struct virtio_device *vdev,
+                                          unsigned int fbit)
+{
+	BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START);
+	BUG_ON(vdev->config->get_status(vdev) &
+	       ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER));
+
+	virtio_check_driver_offered_feature(vdev, fbit);
+
+	clear_bit(fbit, vdev->features);
+}
+
 static inline
 struct virtqueue *virtio_find_single_vq(struct virtio_device *vdev,
 					vq_callback_t *c, const char *n)
-- 
1.9.1

^ permalink raw reply related

* [PATCH 2/2] virtio-net: fix buggy features advertised by host
From: Jason Wang @ 2014-11-13  5:52 UTC (permalink / raw)
  To: rusty, mst, virtualization, linux-kernel; +Cc: netdev
In-Reply-To: <1415857974-23326-1-git-send-email-jasowang@redhat.com>

This patch tries to detect the possible buggy features advertised by host
and fix them. One example is booting virtio-net with only ctrl_vq disabled,
qemu may still advertise many features which depends on it. This will
trigger several BUG()s in virtnet_send_command().

This patch utilizes the fix_features() method, and disables all features that
depends on ctrl_vq if it was not advertised.

This fixes the crash when booting with ctrl_vq=off.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
Changes from V1:
- fix the cut-and-paste error
---
 drivers/net/virtio_net.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ec2a8b4..6ce125e 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1948,6 +1948,40 @@ static int virtnet_restore(struct virtio_device *vdev)
 }
 #endif
 
+static void virtnet_fix_features(struct virtio_device *dev)
+{
+	if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) {
+		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) {
+			pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host "
+				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
+			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX);
+		}
+		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) {
+			pr_warning("Disable VIRTIO_NET_F_CTRL_VLAN since host "
+				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
+			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN);
+		}
+		if (virtio_has_feature(dev, VIRTIO_NET_F_GUEST_ANNOUNCE)) {
+			pr_warning("Disable VIRTIO_NET_F_GUEST_ANNOUNCE since "
+				   "host does not advertise "
+				   "VIRTIO_NET_F_CTRL_VQ");
+			virtio_disable_feature(dev,
+					       VIRTIO_NET_F_GUEST_ANNOUNCE);
+		}
+		if (virtio_has_feature(dev, VIRTIO_NET_F_MQ)) {
+			pr_warning("Disable VIRTIO_NET_F_MQ since host "
+				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
+			virtio_disable_feature(dev, VIRTIO_NET_F_MQ);
+		}
+		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_MAC_ADDR)) {
+			pr_warning("Disable VIRTIO_NET_F_CTRL_MAC_ADDR since "
+				   "host does not advertise "
+				   "VIRTIO_NET_F_CTRL_VQ");
+			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_MAC_ADDR);
+		}
+	}
+}
+
 static struct virtio_device_id id_table[] = {
 	{ VIRTIO_ID_NET, VIRTIO_DEV_ANY_ID },
 	{ 0 },
@@ -1975,6 +2009,7 @@ static struct virtio_driver virtio_net_driver = {
 	.probe =	virtnet_probe,
 	.remove =	virtnet_remove,
 	.config_changed = virtnet_config_changed,
+	.fix_features = virtnet_fix_features,
 #ifdef CONFIG_PM_SLEEP
 	.freeze =	virtnet_freeze,
 	.restore =	virtnet_restore,
-- 
1.9.1

^ permalink raw reply related

* Re: [PATCH 2/2] virtio-net: fix buggy features advertised by host
From: Wanlong Gao @ 2014-11-13  6:06 UTC (permalink / raw)
  To: Jason Wang, linux-kernel; +Cc: netdev, virtualization, mst
In-Reply-To: <1415857974-23326-2-git-send-email-jasowang@redhat.com>

On 11/13/2014 01:52 PM, Jason Wang wrote:
> This patch tries to detect the possible buggy features advertised by host
> and fix them. One example is booting virtio-net with only ctrl_vq disabled,
> qemu may still advertise many features which depends on it. This will
> trigger several BUG()s in virtnet_send_command().
> 
> This patch utilizes the fix_features() method, and disables all features that
> depends on ctrl_vq if it was not advertised.
> 
> This fixes the crash when booting with ctrl_vq=off.
> 
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> Changes from V1:
> - fix the cut-and-paste error
> ---
>  drivers/net/virtio_net.c | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index ec2a8b4..6ce125e 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1948,6 +1948,40 @@ static int virtnet_restore(struct virtio_device *vdev)
>  }
>  #endif
>  
> +static void virtnet_fix_features(struct virtio_device *dev)
> +{
> +	if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) {
> +		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) {
> +			pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host "
> +				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
> +			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX);
> +		}
> +		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) {
> +			pr_warning("Disable VIRTIO_NET_F_CTRL_VLAN since host "
> +				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
> +			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN);
> +		}
> +		if (virtio_has_feature(dev, VIRTIO_NET_F_GUEST_ANNOUNCE)) {
> +			pr_warning("Disable VIRTIO_NET_F_GUEST_ANNOUNCE since "
> +				   "host does not advertise "
> +				   "VIRTIO_NET_F_CTRL_VQ");
> +			virtio_disable_feature(dev,
> +					       VIRTIO_NET_F_GUEST_ANNOUNCE);
> +		}
> +		if (virtio_has_feature(dev, VIRTIO_NET_F_MQ)) {
> +			pr_warning("Disable VIRTIO_NET_F_MQ since host "
> +				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
> +			virtio_disable_feature(dev, VIRTIO_NET_F_MQ);
> +		}
> +		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_MAC_ADDR)) {
> +			pr_warning("Disable VIRTIO_NET_F_CTRL_MAC_ADDR since "
> +				   "host does not advertise "
> +				   "VIRTIO_NET_F_CTRL_VQ");
> +			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_MAC_ADDR);
> +		}


Can we use a feature array and check with one loop?  The current check looks so dup?


Thanks,
Wanlong Gao

> +	}
> +}
> +
>  static struct virtio_device_id id_table[] = {
>  	{ VIRTIO_ID_NET, VIRTIO_DEV_ANY_ID },
>  	{ 0 },
> @@ -1975,6 +2009,7 @@ static struct virtio_driver virtio_net_driver = {
>  	.probe =	virtnet_probe,
>  	.remove =	virtnet_remove,
>  	.config_changed = virtnet_config_changed,
> +	.fix_features = virtnet_fix_features,
>  #ifdef CONFIG_PM_SLEEP
>  	.freeze =	virtnet_freeze,
>  	.restore =	virtnet_restore,
> 

^ permalink raw reply

* ip6_gre wccp header changed top ipv4, while should be changed to ipv6
From: Yuri Chislov @ 2014-11-13  6:13 UTC (permalink / raw)
  To: netdev

Hi,

wccp v 2.01 forward gre packet with protocol type WCCP (0x883e) in gre header,
that replaced with ETH_P_IP, while encapsulated ipv6 packet (ETH_P_IPV6).

 Tested on 3.14.23, the same code is in 3.17.2

======================================
--- a/ip6_gre.c 2014-11-11 11:33:30.820695876 +0000
+++ b/ip6_gre.c 2014-11-11 11:34:19.480694111 +0000
@@ -512,7 +512,7 @@
                 * - When dealing with WCCPv2, Skip extra 4 bytes in GRE header
                 */
                if (flags == 0 && gre_proto == htons(ETH_P_WCCP)) {
-                       skb->protocol = htons(ETH_P_IP);
+                       skb->protocol = htons(ETH_P_IPV6);
                        if ((*(h + offset) & 0xF0) != 0x40)
                                offset += 4;
                }
======================================

 One more issue noted in ip6_gre.
ipv4 gre interface configured to local any remote any
receive(accept) all gre traffic.
ipv6 gre interface should be configured explicit to exact remote and
local addresses
to receive traffic in gre interface, that a bit problematic due to
multiply addresses
assigned to interface. I will try to understand this issue, but possible someone
have some ideas

Thanks.
Yuri.

^ permalink raw reply

* [patch v2 -next] amd-xgbe: fix ->rss_hash_type
From: Dan Carpenter @ 2014-11-13  6:19 UTC (permalink / raw)
  To: Tom Lendacky, David Miller; +Cc: netdev, kernel-janitors
In-Reply-To: <20141112.150459.233340605780805877.davem@davemloft.net>

There was a missing break statement so we set everything to
PKT_HASH_TYPE_L3 even when we intended to use PKT_HASH_TYPE_L4.

Fixes: 5b9dfe299e55 ('amd-xgbe: Provide support for receive side scaling')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: remove blank line

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
index 7daa2cd..f6014d3 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
@@ -1600,7 +1600,7 @@ static int xgbe_dev_read(struct xgbe_channel *channel)
 		case RX_DESC3_L34T_IPV6_TCP:
 		case RX_DESC3_L34T_IPV6_UDP:
 			packet->rss_hash_type = PKT_HASH_TYPE_L4;
-
+			break;
 		default:
 			packet->rss_hash_type = PKT_HASH_TYPE_L3;
 		}

^ permalink raw reply related

* ip6_gre wccp header changed top ipv4, while should be changed to ipv6
From: Yuri Chislov @ 2014-11-13  6:08 UTC (permalink / raw)
  To: netdev@vger.kernel.org

Hi,

 wccp v 2.01 forward gre packet with protocol type WCCP (0x883e) in gre header,
that replaced with ETH_P_IP, while encapsulated ipv6 packet (ETH_P_IPV6).

 Tested on 3.14.23, the same code is in 3.17.2

======================================
--- a/ip6_gre.c 2014-11-11 11:33:30.820695876 +0000
+++ b/ip6_gre.c 2014-11-11 11:34:19.480694111 +0000
@@ -512,7 +512,7 @@
                 * - When dealing with WCCPv2, Skip extra 4 bytes in GRE header
                 */
                if (flags == 0 && gre_proto == htons(ETH_P_WCCP)) {
-                       skb->protocol = htons(ETH_P_IP);
+                       skb->protocol = htons(ETH_P_IPV6);
                        if ((*(h + offset) & 0xF0) != 0x40)
                                offset += 4;
                }
======================================

 One more issue noted in ip6_gre.
ipv4 gre interface configured to local any remote any
receive(accept) all gre traffic.
ipv6 gre interface should be configured explicit to exact remote and
local addresses
to receive traffic in gre interface, that a bit problematic due to
multiply addresses
assigned to interface. I will try to understand this issue, but possible someone
have some ideas

Thanks.
Yuri.

________________________________

This transmission may contain information that is privileged, confidential, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is strictly prohibited. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.

^ permalink raw reply

* Re: [patch net-next v2 00/10] introduce rocker switch driver with hardware accelerated datapath api - phase 1: bridge fdb offload
From: John Fastabend @ 2014-11-13  6:31 UTC (permalink / raw)
  To: Simon Horman, John Fastabend
  Cc: Jamal Hadi Salim, Jiri Pirko, netdev, davem, nhorman, andy, tgraf,
	dborkman, ogerlitz, jesse, pshelar, azhou, ben, stephen,
	jeffrey.t.kirsher, vyasevic, xiyou.wangcong, edumazet, sfeldma,
	f.fainelli, roopa, linville, jasowang, ebiederm, nicolas.dichtel,
	ryazanov.s.a, buytenh, aviadr, nbd, alexei.starovoitov,
	Neil.Jerram, ronye, alexander.h.duyck, john.ronciak, mleitner,
	shrijeet, gospo, bcrl
In-Reply-To: <20141113054412.GA31283@vergenet.net>

On 11/12/2014 09:44 PM, Simon Horman wrote:
> [snip]
> 
>> Simon, if your feeling adventurous any feedback on the repo link
>> would be great. I still need to smash the commit log into something
>> coherent though at the moment you can see all the errors and rewrites,
>> etc as I made them.
> 
> Hi John,
> 
> here is some preliminary feedback:
> 
> * I notice that the parse graph code isn't present yet.
>   I suppose this is a difficult piece that naturally follows many
>   other piece. None the less it is possibly the piece of most
>   interest to me :-)

I can add this over the next few days. Also I wanted to publish some
more complex examples on top of rocker switch. The nic drivers are
interesting but not as complex as some of the switch devices.

There is also the table graph layout which I wanted tweak a bit. At
the moment I have hardware that can run tables in parallel and some
that executes tables in sequence. It might not be clear from the code
(why I need the cleanup) but the source id is being used to indicate
if the tables are executed in parallel or not.

> 
> * Will del and update flows require flows to already exist?
>   And similarly, will add flow require flows with the same match to not
>   already exist?  If so, the error handling seems tricky of more than one
>   flow is to be deleted/updated. IIRC there was some discussion of that
>   kind of issue at the (double) round table discussion on the last day of
>   LPC14 in Düsseldorf.

I would expect del/updates for flows that don't exist should fail.

I didn't intend to add any checks in the kernel to verify the matches
are unique. My opinion on this is that user space shouldn't add new
duplicate flows. And if it does hardware resources will be wasted.

> 
> * Should the .node_count value of ixgbe_table_node_l2 be 3?
>   ixgbe_table_graph_nodes has three elements but perhaps you
>   are intentionally excluding the last element ixgbe_table_node_nil?
> 

Actually I could just drop the node_count at the moment because I've
been null terminating the arrays with null items.

I should either add a count field to all the structures or null terminate
the arrays. For now I mostly null terminate the arrays when I use
them. For example matches is null terminates same for actions.

.John

^ permalink raw reply

* Re: [PATCH 2/2] virtio-net: fix buggy features advertised by host
From: Jason Wang @ 2014-11-13  6:45 UTC (permalink / raw)
  To: gaowanlong, linux-kernel; +Cc: netdev, virtualization, mst
In-Reply-To: <54644A4E.7000902@cn.fujitsu.com>

On 11/13/2014 02:06 PM, Wanlong Gao wrote:
> On 11/13/2014 01:52 PM, Jason Wang wrote:
>> This patch tries to detect the possible buggy features advertised by host
>> and fix them. One example is booting virtio-net with only ctrl_vq disabled,
>> qemu may still advertise many features which depends on it. This will
>> trigger several BUG()s in virtnet_send_command().
>>
>> This patch utilizes the fix_features() method, and disables all features that
>> depends on ctrl_vq if it was not advertised.
>>
>> This fixes the crash when booting with ctrl_vq=off.
>>
>> Cc: Rusty Russell <rusty@rustcorp.com.au>
>> Cc: Michael S. Tsirkin <mst@redhat.com>
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>> ---
>> Changes from V1:
>> - fix the cut-and-paste error
>> ---
>>  drivers/net/virtio_net.c | 35 +++++++++++++++++++++++++++++++++++
>>  1 file changed, 35 insertions(+)
>>
>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>> index ec2a8b4..6ce125e 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -1948,6 +1948,40 @@ static int virtnet_restore(struct virtio_device *vdev)
>>  }
>>  #endif
>>  
>> +static void virtnet_fix_features(struct virtio_device *dev)
>> +{
>> +	if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) {
>> +		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) {
>> +			pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host "
>> +				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
>> +			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX);
>> +		}
>> +		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) {
>> +			pr_warning("Disable VIRTIO_NET_F_CTRL_VLAN since host "
>> +				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
>> +			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN);
>> +		}
>> +		if (virtio_has_feature(dev, VIRTIO_NET_F_GUEST_ANNOUNCE)) {
>> +			pr_warning("Disable VIRTIO_NET_F_GUEST_ANNOUNCE since "
>> +				   "host does not advertise "
>> +				   "VIRTIO_NET_F_CTRL_VQ");
>> +			virtio_disable_feature(dev,
>> +					       VIRTIO_NET_F_GUEST_ANNOUNCE);
>> +		}
>> +		if (virtio_has_feature(dev, VIRTIO_NET_F_MQ)) {
>> +			pr_warning("Disable VIRTIO_NET_F_MQ since host "
>> +				   "does not advertise VIRTIO_NET_F_CTRL_VQ");
>> +			virtio_disable_feature(dev, VIRTIO_NET_F_MQ);
>> +		}
>> +		if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_MAC_ADDR)) {
>> +			pr_warning("Disable VIRTIO_NET_F_CTRL_MAC_ADDR since "
>> +				   "host does not advertise "
>> +				   "VIRTIO_NET_F_CTRL_VQ");
>> +			virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_MAC_ADDR);
>> +		}
>
> Can we use a feature array and check with one loop?  The current check looks so dup?
>
>
> Thanks,
> Wanlong Gao
>

Yes for sure. I will wait a little bit for the maintainers comment and
do it in next version.

Thanks

^ permalink raw reply

* [PATCH] net: sh_eth: Add RMII mode setting in probe
From: Yoshihiro Kaneko @ 2014-11-13  6:54 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh

From: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>

When using RMMI mode, it is necessary to change in probe.

Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

This patch is based on net-next tree.

 drivers/net/ethernet/renesas/sh_eth.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index dbe8606..1f79ed6 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1,5 +1,6 @@
 /*  SuperH Ethernet device driver
  *
+ *  Copyright (C) 2014  Renesas Electronics Corporation
  *  Copyright (C) 2006-2012 Nobuhiro Iwamatsu
  *  Copyright (C) 2008-2014 Renesas Solutions Corp.
  *  Copyright (C) 2013-2014 Cogent Embedded, Inc.
@@ -2883,6 +2884,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
 		}
 	}
 
+	if (mdp->cd->rmiimode)
+		sh_eth_write(ndev, 0x1, RMIIMODE);
+
 	/* MDIO bus init */
 	ret = sh_mdio_init(mdp, pd);
 	if (ret) {
-- 
1.9.1


^ permalink raw reply related

* [PATCH net-next v2] net: generic dev_disable_lro() stacked device handling
From: Michal Kubecek @ 2014-11-13  6:54 UTC (permalink / raw)
  To: David S. Miller
  Cc: netdev, linux-kernel, Jay Vosburgh, Veaceslav Falico,
	Andy Gospodarek, Jiri Pirko
In-Reply-To: <20141111.214752.266800170368088905.davem@davemloft.net>

Large receive offloading is known to cause problems if received packets
are passed to other host. Therefore the kernel disables it by calling
dev_disable_lro() whenever a network device is enslaved in a bridge or
forwarding is enabled for it (or globally). For virtual devices we need
to disable LRO on the underlying physical device (which is actually
receiving the packets).

Current dev_disable_lro() code handles this  propagation for a vlan
(including 802.1ad nested vlan), macvlan or a vlan on top of a macvlan.
It doesn't handle other stacked devices and their combinations, in
particular propagation from a bond to its slaves which often causes
problems in virtualization setups.

As we now have generic data structures describing the upper-lower device
relationship, dev_disable_lro() can be generalized to disable LRO also
for all lower devices (if any) once it is disabled for the device
itself.

For bonding and teaming devices, it is necessary to disable LRO not only
on current slaves at the moment when dev_disable_lro() is called but
also on any slave (port) added later.

v2: use lower device links for all devices (including vlan and macvlan)

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
 drivers/net/bonding/bond_main.c |  3 +++
 drivers/net/team/team.c         |  3 +++
 net/core/dev.c                  | 15 +++++----------
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b9b3456..8575fee 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1526,6 +1526,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 	}
 #endif
 
+	if (!(bond_dev->features & NETIF_F_LRO))
+		dev_disable_lro(slave_dev);
+
 	res = netdev_rx_handler_register(slave_dev, bond_handle_frame,
 					 new_slave);
 	if (res) {
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 2368395..93e2242 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1179,6 +1179,9 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
 		goto err_enable_netpoll;
 	}
 
+	if (!(dev->features & NETIF_F_LRO))
+		dev_disable_lro(port_dev);
+
 	err = netdev_rx_handler_register(port_dev, team_handle_frame,
 					 port);
 	if (err) {
diff --git a/net/core/dev.c b/net/core/dev.c
index bb09b03..1ab168e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1437,22 +1437,17 @@ EXPORT_SYMBOL(dev_close);
  */
 void dev_disable_lro(struct net_device *dev)
 {
-	/*
-	 * If we're trying to disable lro on a vlan device
-	 * use the underlying physical device instead
-	 */
-	if (is_vlan_dev(dev))
-		dev = vlan_dev_real_dev(dev);
-
-	/* the same for macvlan devices */
-	if (netif_is_macvlan(dev))
-		dev = macvlan_dev_real_dev(dev);
+	struct net_device *lower_dev;
+	struct list_head *iter;
 
 	dev->wanted_features &= ~NETIF_F_LRO;
 	netdev_update_features(dev);
 
 	if (unlikely(dev->features & NETIF_F_LRO))
 		netdev_WARN(dev, "failed to disable LRO!\n");
+
+	netdev_for_each_lower_dev(dev, lower_dev, iter)
+		dev_disable_lro(lower_dev);
 }
 EXPORT_SYMBOL(dev_disable_lro);
 
-- 
1.8.4.5

^ permalink raw reply related

* [PATCH] sh_eth: r8a779x: Enable automatically fetch receive descriptor
From: Yoshihiro Kaneko @ 2014-11-13  6:56 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh,
	Grant Likely

From: Kouei Abe <kouei.abe.cp@renesas.com>

HDMAC automatically fetches the receive descriptor and receives frames.
Continuous reception of multiple frames is possible.

Signed-off-by: Kouei Abe <kouei.abe.cp@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

This patch is based on net-next tree.

 drivers/net/ethernet/renesas/sh_eth.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index dbe8606..badb734 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -494,6 +494,7 @@ static struct sh_eth_cpu_data r8a779x_data = {
 	.eesr_err_check	= EESR_TWB | EESR_TABT | EESR_RABT | EESR_RFE |
 			  EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE |
 			  EESR_ECI,
+	.rmcr_value	= RMCR_RNC,
 
 	.apr		= 1,
 	.mpr		= 1,
-- 
1.9.1


^ permalink raw reply related

* [PATCH] can: Fix bug in suspend/resume
From: Kedareswara rao Appana @ 2014-11-13  6:58 UTC (permalink / raw)
  To: wg, mkl, michal.simek, soren.brinkmann, grant.likely, robh+dt
  Cc: devicetree, netdev, linux-kernel, linux-can,
	Kedareswara rao Appana, linux-arm-kernel

When accessing the priv structure use container_of instead of dev_get_drvdata.
Enable the clocks in the suspend before accessing the registers of the CAN.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
 drivers/net/can/xilinx_can.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 5e8b560..63ef645 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -972,15 +972,30 @@ static const struct net_device_ops xcan_netdev_ops = {
  */
 static int __maybe_unused xcan_suspend(struct device *dev)
 {
-	struct platform_device *pdev = dev_get_drvdata(dev);
+	struct platform_device *pdev = container_of(dev,
+			struct platform_device, dev);
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct xcan_priv *priv = netdev_priv(ndev);
+	int ret;
 
 	if (netif_running(ndev)) {
 		netif_stop_queue(ndev);
 		netif_device_detach(ndev);
 	}
 
+	ret = clk_prepare_enable(priv->can_clk);
+	if (ret) {
+		dev_err(dev, "unable to enable device clock\n");
+		return ret;
+	}
+
+	ret = clk_prepare_enable(priv->bus_clk);
+	if (ret) {
+		dev_err(dev, "unable to enable bus clock\n");
+		clk_disable_unprepare(priv->can_clk);
+		return ret;
+	}
+
 	priv->write_reg(priv, XCAN_MSR_OFFSET, XCAN_MSR_SLEEP_MASK);
 	priv->can.state = CAN_STATE_SLEEPING;
 
@@ -999,7 +1014,8 @@ static int __maybe_unused xcan_suspend(struct device *dev)
  */
 static int __maybe_unused xcan_resume(struct device *dev)
 {
-	struct platform_device *pdev = dev_get_drvdata(dev);
+	struct platform_device *pdev = container_of(dev,
+			struct platform_device, dev);
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct xcan_priv *priv = netdev_priv(ndev);
 	int ret;
-- 
1.7.4

^ permalink raw reply related

* [PATCH] net: sh_eth: Add r8a7793 support
From: Yoshihiro Kaneko @ 2014-11-13  6:59 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh,
	Grant Likely

From: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>

The device tree probing for R-Car M2N (r8a7793) is added.

Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

This patch is based on net-next tree.

 Documentation/devicetree/bindings/net/sh_eth.txt | 1 +
 drivers/net/ethernet/renesas/sh_eth.c            | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/sh_eth.txt b/Documentation/devicetree/bindings/net/sh_eth.txt
index 34d4db1..2f6ec85 100644
--- a/Documentation/devicetree/bindings/net/sh_eth.txt
+++ b/Documentation/devicetree/bindings/net/sh_eth.txt
@@ -9,6 +9,7 @@ Required properties:
 	      "renesas,ether-r8a7779"  if the device is a part of R8A7779 SoC.
 	      "renesas,ether-r8a7790"  if the device is a part of R8A7790 SoC.
 	      "renesas,ether-r8a7791"  if the device is a part of R8A7791 SoC.
+	      "renesas,ether-r8a7793"  if the device is a part of R8A7793 SoC.
 	      "renesas,ether-r8a7794"  if the device is a part of R8A7794 SoC.
 	      "renesas,ether-r7s72100" if the device is a part of R7S72100 SoC.
 - reg: offset and length of (1) the E-DMAC/feLic register block (required),
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index dbe8606..1ba057b 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2746,6 +2746,7 @@ static const struct of_device_id sh_eth_match_table[] = {
 	{ .compatible = "renesas,ether-r8a7779", .data = &r8a777x_data },
 	{ .compatible = "renesas,ether-r8a7790", .data = &r8a779x_data },
 	{ .compatible = "renesas,ether-r8a7791", .data = &r8a779x_data },
+	{ .compatible = "renesas,ether-r8a7793", .data = &r8a779x_data },
 	{ .compatible = "renesas,ether-r8a7794", .data = &r8a779x_data },
 	{ .compatible = "renesas,ether-r7s72100", .data = &r7s72100_data },
 	{ }
@@ -2969,6 +2970,7 @@ static struct platform_device_id sh_eth_id_table[] = {
 	{ "r8a777x-ether", (kernel_ulong_t)&r8a777x_data },
 	{ "r8a7790-ether", (kernel_ulong_t)&r8a779x_data },
 	{ "r8a7791-ether", (kernel_ulong_t)&r8a779x_data },
+	{ "r8a7793-ether", (kernel_ulong_t)&r8a779x_data },
 	{ "r8a7794-ether", (kernel_ulong_t)&r8a779x_data },
 	{ }
 };
-- 
1.9.1


^ permalink raw reply related

* [PATCH] sh_eth: Optimization for RX excess judgement
From: Yoshihiro Kaneko @ 2014-11-13  7:00 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh

From: Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>

Both of 'boguscnt' and 'quota' have nearly meaning as the condition of
the reception loop.
In order to cut down redundant processing, this patch changes excess judgement.

Signed-off-by: Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

This patch is based on net tree.

 drivers/net/ethernet/renesas/sh_eth.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 60e9c2c..7d46326 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1394,10 +1394,15 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
 
 	int entry = mdp->cur_rx % mdp->num_rx_ring;
 	int boguscnt = (mdp->dirty_rx + mdp->num_rx_ring) - mdp->cur_rx;
+	int limit = boguscnt;
 	struct sk_buff *skb;
 	u16 pkt_len = 0;
 	u32 desc_status;
 
+	if (quota) {
+		boguscnt = min(boguscnt, *quota);
+		limit = boguscnt;
+	}
 	rxdesc = &mdp->rx_ring[entry];
 	while (!(rxdesc->status & cpu_to_edmac(mdp, RD_RACT))) {
 		desc_status = edmac_to_cpu(mdp, rxdesc->status);
@@ -1406,11 +1411,6 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
 		if (--boguscnt < 0)
 			break;
 
-		if (*quota <= 0)
-			break;
-
-		(*quota)--;
-
 		if (!(desc_status & RDFEND))
 			ndev->stats.rx_length_errors++;
 
@@ -1501,7 +1501,10 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
 		sh_eth_write(ndev, EDRRR_R, EDRRR);
 	}
 
-	return *quota <= 0;
+	if (quota)
+		*quota -= limit - (++boguscnt);
+
+	return (boguscnt <= 0);
 }
 
 static void sh_eth_rcv_snd_disable(struct net_device *ndev)
-- 
1.9.1


^ permalink raw reply related

* [PATCH 0/2] Fix sleeping function called from invalid context
From: Yoshihiro Kaneko @ 2014-11-13  7:02 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh

This series is based on net tree.

Mitsuhiro Kimura (2):
  sh_eth: Fix sleeping function called from invalid context
  sh_eth: Fix asynchronous external abort

 drivers/net/ethernet/renesas/sh_eth.c | 70 ++++++++++++++++++++---------------
 drivers/net/ethernet/renesas/sh_eth.h |  1 +
 2 files changed, 42 insertions(+), 29 deletions(-)

-- 
1.9.1


^ 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