aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ibmveth.c24
-rw-r--r--drivers/net/ibmveth.h3
2 files changed, 14 insertions, 13 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)
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
index bb69ccae8ace..72cc15a6cab7 100644
--- a/drivers/net/ibmveth.h
+++ b/drivers/net/ibmveth.h
@@ -73,9 +73,6 @@ static inline long h_send_logical_lan(unsigned long unit_address,
73#define h_change_logical_lan_mac(ua, mac) \ 73#define h_change_logical_lan_mac(ua, mac) \
74 plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac) 74 plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac)
75 75
76#define h_free_logical_lan_buffer(ua, bufsize) \
77 plpar_hcall_norets(H_FREE_LOGICAL_LAN_BUFFER, ua, bufsize)
78
79#define IbmVethNumBufferPools 5 76#define IbmVethNumBufferPools 5
80#define IBMVETH_BUFF_OH 22 /* Overhead: 14 ethernet header + 8 opaque handle */ 77#define IBMVETH_BUFF_OH 22 /* Overhead: 14 ethernet header + 8 opaque handle */
81#define IBMVETH_MAX_MTU 68 78#define IBMVETH_MAX_MTU 68