Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57603
b: refs/heads/master
c: ce6eea5
h: refs/heads/master
i:
  57601: b32c421
  57599: 366f590
v: v3
  • Loading branch information
Brian King authored and Jeff Garzik committed Jun 9, 2007
1 parent 38a9034 commit 52627fb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 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: 4aa9c93e1c7911866c546651a5efbbf62914092e
refs/heads/master: ce6eea58eb8f50f563663c6e723b4bbbe55b012e
27 changes: 23 additions & 4 deletions trunk/drivers/net/ibmveth.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,17 +915,36 @@ 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 i;
int reinit = 0;
int i, rc;

if (new_mtu < IBMVETH_MAX_MTU)
return -EINVAL;

for (i = 0; i < IbmVethNumBufferPools; i++)
if (new_mtu_oh < adapter->rx_buff_pool[i].buff_size)
break;

if (i == IbmVethNumBufferPools)
return -EINVAL;

/* 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)
continue;
if (!adapter->rx_buff_pool[i].active) {
adapter->rx_buff_pool[i].active = 1;
reinit = 1;
}

if (new_mtu_oh < adapter->rx_buff_pool[i].buff_size) {
dev->mtu = new_mtu;
if (reinit && netif_running(adapter->netdev)) {
adapter->pool_config = 1;
ibmveth_close(adapter->netdev);
adapter->pool_config = 0;
dev->mtu = new_mtu;
if ((rc = ibmveth_open(adapter->netdev)))
return rc;
} else
dev->mtu = new_mtu;
return 0;
}
}
Expand Down

0 comments on commit 52627fb

Please sign in to comment.