Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106108
b: refs/heads/master
c: ea866e6
h: refs/heads/master
v: v3
  • Loading branch information
Santiago Leon authored and Benjamin Herrenschmidt committed Jul 25, 2008
1 parent d5a74b7 commit 0b91fd2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 22e1a4dd3f2a9009d1d8896a5e833b6094877008
refs/heads/master: ea866e6526b8a2ead92875732d41b26fdb470312
20 changes: 13 additions & 7 deletions trunk/drivers/net/ibmveth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,6 @@ static int ibmveth_change_mtu(struct net_device *dev, int new_mtu)
{
struct ibmveth_adapter *adapter = dev->priv;
int new_mtu_oh = new_mtu + IBMVETH_BUFF_OH;
int reinit = 0;
int i, rc;

if (new_mtu < IBMVETH_MAX_MTU)
Expand All @@ -1067,15 +1066,21 @@ static int ibmveth_change_mtu(struct net_device *dev, int new_mtu)
if (i == IbmVethNumBufferPools)
return -EINVAL;

/* Deactivate all the buffer pools so that the next loop can activate
only the buffer pools necessary to hold the new MTU */
for (i = 0; i < IbmVethNumBufferPools; i++)
if (adapter->rx_buff_pool[i].active) {
ibmveth_free_buffer_pool(adapter,
&adapter->rx_buff_pool[i]);
adapter->rx_buff_pool[i].active = 0;
}

/* Look for an active buffer pool that can hold the new MTU */
for(i = 0; i<IbmVethNumBufferPools; i++) {
if (!adapter->rx_buff_pool[i].active) {
adapter->rx_buff_pool[i].active = 1;
reinit = 1;
}
adapter->rx_buff_pool[i].active = 1;

if (new_mtu_oh < adapter->rx_buff_pool[i].buff_size) {
if (reinit && netif_running(adapter->netdev)) {
if (netif_running(adapter->netdev)) {
adapter->pool_config = 1;
ibmveth_close(adapter->netdev);
adapter->pool_config = 0;
Expand Down Expand Up @@ -1402,14 +1407,15 @@ const char * buf, size_t count)
return -EPERM;
}

pool->active = 0;
if (netif_running(netdev)) {
adapter->pool_config = 1;
ibmveth_close(netdev);
pool->active = 0;
adapter->pool_config = 0;
if ((rc = ibmveth_open(netdev)))
return rc;
}
pool->active = 0;
}
} else if (attr == &veth_num_attr) {
if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT)
Expand Down

0 comments on commit 0b91fd2

Please sign in to comment.