From 33f65d9c77aeaa4e4bb98f746152112330466c9b Mon Sep 17 00:00:00 2001 From: Francois Romieu Date: Fri, 11 Jul 2008 00:05:57 +0200 Subject: [PATCH] --- yaml --- r: 103463 b: refs/heads/master c: 9088d9a4267ff098d5edc3dad8359c92741b7a6a h: refs/heads/master i: 103461: 81fb6efe3e3159ff03dc8ec6006ce7e6dcf6a8dc 103459: 23130330bfcdd705e983b13e2186fc8a6077134d 103455: 1e1b1a0f9469f1a05285d396d24b7ff7d1b61885 v: v3 --- [refs] | 2 +- trunk/drivers/net/via-velocity.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 094d5abcc6df..05d62c0c8079 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 28133176082d9bcafb5958b8fac80943e51d5eda +refs/heads/master: 9088d9a4267ff098d5edc3dad8359c92741b7a6a diff --git a/trunk/drivers/net/via-velocity.c b/trunk/drivers/net/via-velocity.c index 086d69c19920..370ce30f2f45 100644 --- a/trunk/drivers/net/via-velocity.c +++ b/trunk/drivers/net/via-velocity.c @@ -1207,6 +1207,11 @@ static int velocity_rx_refill(struct velocity_info *vptr) return done; } +static void velocity_set_rxbufsize(struct velocity_info *vptr, int mtu) +{ + vptr->rx_buf_sz = (mtu <= ETH_DATA_LEN) ? PKT_BUF_SZ : mtu + 32; +} + /** * velocity_init_rd_ring - set up receive ring * @vptr: velocity to configure @@ -1217,11 +1222,8 @@ static int velocity_rx_refill(struct velocity_info *vptr) static int velocity_init_rd_ring(struct velocity_info *vptr) { - int mtu = vptr->dev->mtu; int ret = -ENOMEM; - vptr->rx_buf_sz = (mtu <= ETH_DATA_LEN) ? PKT_BUF_SZ : mtu + 32; - vptr->rd_info = kcalloc(vptr->options.numrx, sizeof(struct velocity_rd_info), GFP_KERNEL); if (!vptr->rd_info) @@ -1860,6 +1862,8 @@ static int velocity_open(struct net_device *dev) struct velocity_info *vptr = netdev_priv(dev); int ret; + velocity_set_rxbufsize(vptr, dev->mtu); + ret = velocity_init_rings(vptr); if (ret < 0) goto out; @@ -1941,6 +1945,8 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu) dev->mtu = new_mtu; + velocity_set_rxbufsize(vptr, new_mtu); + ret = velocity_init_rd_ring(vptr); if (ret < 0) goto out_unlock;