diff options
Diffstat (limited to 'drivers/net/ibmveth.c')
-rw-r--r-- | drivers/net/ibmveth.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index d96eb7229548..cf4a92436aa8 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -1280,24 +1280,28 @@ const char * buf, size_t count) | |||
1280 | int i; | 1280 | int i; |
1281 | /* Make sure there is a buffer pool with buffers that | 1281 | /* Make sure there is a buffer pool with buffers that |
1282 | can hold a packet of the size of the MTU */ | 1282 | can hold a packet of the size of the MTU */ |
1283 | for(i = 0; i<IbmVethNumBufferPools; i++) { | 1283 | for (i = 0; i < IbmVethNumBufferPools; i++) { |
1284 | if (pool == &adapter->rx_buff_pool[i]) | 1284 | if (pool == &adapter->rx_buff_pool[i]) |
1285 | continue; | 1285 | continue; |
1286 | if (!adapter->rx_buff_pool[i].active) | 1286 | if (!adapter->rx_buff_pool[i].active) |
1287 | continue; | 1287 | continue; |
1288 | if (mtu < adapter->rx_buff_pool[i].buff_size) { | 1288 | if (mtu <= adapter->rx_buff_pool[i].buff_size) |
1289 | pool->active = 0; | 1289 | break; |
1290 | h_free_logical_lan_buffer(adapter-> | ||
1291 | vdev-> | ||
1292 | unit_address, | ||
1293 | pool-> | ||
1294 | buff_size); | ||
1295 | } | ||
1296 | } | 1290 | } |
1297 | if (pool->active) { | 1291 | |
1292 | if (i == IbmVethNumBufferPools) { | ||
1298 | ibmveth_error_printk("no active pool >= MTU\n"); | 1293 | ibmveth_error_printk("no active pool >= MTU\n"); |
1299 | return -EPERM; | 1294 | return -EPERM; |
1300 | } | 1295 | } |
1296 | |||
1297 | pool->active = 0; | ||
1298 | if (netif_running(netdev)) { | ||
1299 | adapter->pool_config = 1; | ||
1300 | ibmveth_close(netdev); | ||
1301 | adapter->pool_config = 0; | ||
1302 | if ((rc = ibmveth_open(netdev))) | ||
1303 | return rc; | ||
1304 | } | ||
1301 | } | 1305 | } |
1302 | } else if (attr == &veth_num_attr) { | 1306 | } else if (attr == &veth_num_attr) { |
1303 | if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT) | 1307 | if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT) |