diff options
Diffstat (limited to 'drivers/net/iseries_veth.c')
-rw-r--r-- | drivers/net/iseries_veth.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index 855f8b2cf13b..13ed8dc1e91d 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c | |||
@@ -924,7 +924,7 @@ static int veth_transmit_to_one(struct sk_buff *skb, HvLpIndex rlp, | |||
924 | 924 | ||
925 | spin_lock_irqsave(&cnx->lock, flags); | 925 | spin_lock_irqsave(&cnx->lock, flags); |
926 | 926 | ||
927 | if (! cnx->state & VETH_STATE_READY) | 927 | if (! (cnx->state & VETH_STATE_READY)) |
928 | goto drop; | 928 | goto drop; |
929 | 929 | ||
930 | if ((skb->len - 14) > VETH_MAX_MTU) | 930 | if ((skb->len - 14) > VETH_MAX_MTU) |
@@ -1023,6 +1023,8 @@ static int veth_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1023 | 1023 | ||
1024 | lpmask = veth_transmit_to_many(skb, lpmask, dev); | 1024 | lpmask = veth_transmit_to_many(skb, lpmask, dev); |
1025 | 1025 | ||
1026 | dev->trans_start = jiffies; | ||
1027 | |||
1026 | if (! lpmask) { | 1028 | if (! lpmask) { |
1027 | dev_kfree_skb(skb); | 1029 | dev_kfree_skb(skb); |
1028 | } else { | 1030 | } else { |
@@ -1262,13 +1264,18 @@ static void veth_receive(struct veth_lpar_connection *cnx, | |||
1262 | 1264 | ||
1263 | vlan = skb->data[9]; | 1265 | vlan = skb->data[9]; |
1264 | dev = veth_dev[vlan]; | 1266 | dev = veth_dev[vlan]; |
1265 | if (! dev) | 1267 | if (! dev) { |
1266 | /* Some earlier versions of the driver sent | 1268 | /* |
1267 | broadcasts down all connections, even to | 1269 | * Some earlier versions of the driver sent |
1268 | lpars that weren't on the relevant vlan. | 1270 | * broadcasts down all connections, even to lpars |
1269 | So ignore packets belonging to a vlan we're | 1271 | * that weren't on the relevant vlan. So ignore |
1270 | not on. */ | 1272 | * packets belonging to a vlan we're not on. |
1273 | * We can also be here if we receive packets while | ||
1274 | * the driver is going down, because then dev is NULL. | ||
1275 | */ | ||
1276 | dev_kfree_skb_irq(skb); | ||
1271 | continue; | 1277 | continue; |
1278 | } | ||
1272 | 1279 | ||
1273 | port = (struct veth_port *)dev->priv; | 1280 | port = (struct veth_port *)dev->priv; |
1274 | dest = *((u64 *) skb->data) & 0xFFFFFFFFFFFF0000; | 1281 | dest = *((u64 *) skb->data) & 0xFFFFFFFFFFFF0000; |
@@ -1381,18 +1388,25 @@ void __exit veth_module_cleanup(void) | |||
1381 | { | 1388 | { |
1382 | int i; | 1389 | int i; |
1383 | 1390 | ||
1384 | vio_unregister_driver(&veth_driver); | 1391 | /* Stop the queues first to stop any new packets being sent. */ |
1392 | for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) | ||
1393 | if (veth_dev[i]) | ||
1394 | netif_stop_queue(veth_dev[i]); | ||
1385 | 1395 | ||
1396 | /* Stop the connections before we unregister the driver. This | ||
1397 | * ensures there's no skbs lying around holding the device open. */ | ||
1386 | for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) | 1398 | for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) |
1387 | veth_stop_connection(i); | 1399 | veth_stop_connection(i); |
1388 | 1400 | ||
1389 | HvLpEvent_unregisterHandler(HvLpEvent_Type_VirtualLan); | 1401 | HvLpEvent_unregisterHandler(HvLpEvent_Type_VirtualLan); |
1390 | 1402 | ||
1391 | /* Hypervisor callbacks may have scheduled more work while we | 1403 | /* Hypervisor callbacks may have scheduled more work while we |
1392 | * were destroying connections. Now that we've disconnected from | 1404 | * were stoping connections. Now that we've disconnected from |
1393 | * the hypervisor make sure everything's finished. */ | 1405 | * the hypervisor make sure everything's finished. */ |
1394 | flush_scheduled_work(); | 1406 | flush_scheduled_work(); |
1395 | 1407 | ||
1408 | vio_unregister_driver(&veth_driver); | ||
1409 | |||
1396 | for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) | 1410 | for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) |
1397 | veth_destroy_connection(i); | 1411 | veth_destroy_connection(i); |
1398 | 1412 | ||