LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [2.6.22.y] {11/17} - via-velocity-dont-oops-on-mtu-change-2 - series for stable kernel #2
@ 2008-02-02  1:34 Oliver Pinter (Pintér Olivér)
  2008-02-06 23:05 ` Oliver Pinter
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Pinter (Pintér Olivér) @ 2008-02-02  1:34 UTC (permalink / raw)
  To: Linux Kernel, stable, stable-commits
  Cc: chrisw, Greg KH, Willy Tarreau, Adrian Bunk, Stephen Hemminger,
	David S. Miller, Jeff Mahoney

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

mainline: 48f6b053613b62fed7a2fe3255e5568260a8d615


-- 
Thanks,
Oliver

[-- Attachment #2: via-velocity-dont-oops-on-mtu-change-2 --]
[-- Type: message/rfc822, Size: 1802 bytes --]



CkRhdGU6IFdlZCwgMjggTm92IDIwMDcgMjI6MjA6MTYgKzAwMDAgKC0wODAwKQpTdWJqZWN0OiB2
aWEtdmVsb2NpdHk6IGRvbid0IG9vcHMgb24gTVRVIGNoYW5nZSAocmVzZW5kKQpQYXRjaC1tYWlu
bGluZTogdjIuNi4yNC1yYzQKUmVmZXJlbmNlczogMzQxNTM3Cgp2aWEtdmVsb2NpdHk6IGRvbid0
IG9vcHMgb24gTVRVIGNoYW5nZSAocmVzZW5kKQoKVGhlIFZJQSB2ZWxvaWN0eSBkcml2ZXIgbmVl
ZHMgdGhlIGZvbGxvd2luZyB0byBhbGxvdyBjaGFuZ2luZyBNVFUgd2hlbiBkb3duLgpUaGUgYnVm
ZmVyIHNpemUgbmVlZHMgdG8gYmUgY29tcHV0ZWQgd2hlbiBkZXZpY2UgaXMgYnJvdWdodCB1cCwg
bm90IHdoZW4KZGV2aWNlIGlzIGluaXRpYWxpemVkLiAgVGhpcyBhbHNvIGZpeGVzIGEgYnVnIHdo
ZXJlIHRoZSBidWZmZXIgc2l6ZSB3YXMKY29tcHV0ZWQgZGlmZmVyZW50bHkgb24gY2hhbmdlX210
dSB2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2Np
dHlfb3BlbihzdHJ1Y3QgbmV0X2RldmkKIAlzdHJ1Y3QgdmVsb2NpdHlfaW5mbyAqdnB0ciA9IG5l
dGRldl9wcml2KGRldik7CiAJaW50IHJldDsKIAotCXZwdHItPnJ4X2J1Zl9zeiA9IChkZXYtPm10
dSA8PSAxNTA0ID8gUEtUX0JVRl9TWiA6IGRldi0+bXR1ICsgMzIpOwotCiAJcmV0ID0gdmVsb2Np
dHlfaW5pdF9yaW5ncyh2cHRyKTsKIAlpZiAocmV0IDwgMCkKIAkJZ290byBvdXQ7CkBAIC0xODEz
LDEyICsxODE0LDYgQEAgc3RhdGljIGludCB2ZWxvY2l0eV9jaGFuZ2VfbXR1KHN0cnVjdCBuZQog
CQl2ZWxvY2l0eV9mcmVlX3JkX3JpbmcodnB0cik7CiAKIAkJZGV2LT5tdHUgPSBuZXdfbXR1Owot
CQlpZiAobmV3X210dSA+IDgxOTIpCi0JCQl2cHRyLT5yeF9idWZfc3ogPSA5ICogMTAyNDsKLQkJ
ZWxzZSBpZiAobmV3X210dSA+IDQwOTYpCi0JCQl2cHRyLT5yeF9idWZfc3ogPSA4MTkyOwotCQll
bHNlCi0JCQl2cHRyLT5yeF9idWZfc3ogPSA0ICogMTAyNDsKIAogCQlyZXQgPSB2ZWxvY2l0eV9p
bml0X3JkX3JpbmcodnB0cik7CiAJCWlmIChyZXQgPCAwKQo=

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [2.6.22.y] {11/17} - via-velocity-dont-oops-on-mtu-change-2 - series for stable kernel #2
  2008-02-02  1:34 [2.6.22.y] {11/17} - via-velocity-dont-oops-on-mtu-change-2 - series for stable kernel #2 Oliver Pinter (Pintér Olivér)
@ 2008-02-06 23:05 ` Oliver Pinter
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Pinter @ 2008-02-06 23:05 UTC (permalink / raw)
  To: Linux Kernel, stable, stable-commits

From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Wed, 28 Nov 2007 22:20:16 +0000 (-0800)
Subject: via-velocity: don't oops on MTU change (resend)
Patch-mainline: v2.6.24-rc4
References: 341537

via-velocity: don't oops on MTU change (resend)

The VIA veloicty driver needs the following to allow changing MTU when down.
The buffer size needs to be computed when device is brought up, not when
device is initialized.  This also fixes a bug where the buffer size was
computed differently on change_mtu versus initial setting.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Acked-by: Jeff Mahoney <jeffm@suse.com>
---
 drivers/net/via-velocity.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

--- a/drivers/net/via-velocity.c	2008-01-03 15:18:50.000000000 -0500
+++ b/drivers/net/via-velocity.c	2008-01-03 15:22:18.000000000 -0500
@@ -1075,6 +1075,9 @@ static int velocity_init_rd_ring(struct
 	int ret = -ENOMEM;
 	unsigned int rsize = sizeof(struct velocity_rd_info) *
 					vptr->options.numrx;
+	int mtu = vptr->dev->mtu;
+
+	vptr->rx_buf_sz = (mtu <= ETH_DATA_LEN) ? PKT_BUF_SZ : mtu + 32;

 	vptr->rd_info = kmalloc(rsize, GFP_KERNEL);
 	if(vptr->rd_info == NULL)
@@ -1733,8 +1736,6 @@ static int velocity_open(struct net_devi
 	struct velocity_info *vptr = netdev_priv(dev);
 	int ret;

-	vptr->rx_buf_sz = (dev->mtu <= 1504 ? PKT_BUF_SZ : dev->mtu + 32);
-
 	ret = velocity_init_rings(vptr);
 	if (ret < 0)
 		goto out;
@@ -1813,12 +1814,6 @@ static int velocity_change_mtu(struct ne
 		velocity_free_rd_ring(vptr);

 		dev->mtu = new_mtu;
-		if (new_mtu > 8192)
-			vptr->rx_buf_sz = 9 * 1024;
-		else if (new_mtu > 4096)
-			vptr->rx_buf_sz = 8192;
-		else
-			vptr->rx_buf_sz = 4 * 1024;

 		ret = velocity_init_rd_ring(vptr);
 		if (ret < 0)


On 2/2/08, Oliver Pinter (Pintér Olivér) <oliver.pntr@gmail.com> wrote:
> mainline: 48f6b053613b62fed7a2fe3255e5568260a8d615
>
>
> --
> Thanks,
> Oliver
>


-- 
Thanks,
Oliver

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-06 23:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-02  1:34 [2.6.22.y] {11/17} - via-velocity-dont-oops-on-mtu-change-2 - series for stable kernel #2 Oliver Pinter (Pintér Olivér)
2008-02-06 23:05 ` Oliver Pinter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).