Automatic merge of /spare/repo/netdev-2.6 branch veth

authored by and committed by Jeff Garzik 8cf0d9d0 8a75e7d6

+23 -9
+23 -9
drivers/net/iseries_veth.c
··· 924 924 925 925 spin_lock_irqsave(&cnx->lock, flags); 926 926 927 - if (! cnx->state & VETH_STATE_READY) 927 + if (! (cnx->state & VETH_STATE_READY)) 928 928 goto drop; 929 929 930 930 if ((skb->len - 14) > VETH_MAX_MTU) ··· 1022 1022 spin_lock_irqsave(&port->pending_gate, flags); 1023 1023 1024 1024 lpmask = veth_transmit_to_many(skb, lpmask, dev); 1025 + 1026 + dev->trans_start = jiffies; 1025 1027 1026 1028 if (! lpmask) { 1027 1029 dev_kfree_skb(skb); ··· 1264 1262 1265 1263 vlan = skb->data[9]; 1266 1264 dev = veth_dev[vlan]; 1267 - if (! dev) 1268 - /* Some earlier versions of the driver sent 1269 - broadcasts down all connections, even to 1270 - lpars that weren't on the relevant vlan. 1271 - So ignore packets belonging to a vlan we're 1272 - not on. */ 1265 + if (! dev) { 1266 + /* 1267 + * Some earlier versions of the driver sent 1268 + * broadcasts down all connections, even to lpars 1269 + * that weren't on the relevant vlan. So ignore 1270 + * packets belonging to a vlan we're not on. 1271 + * We can also be here if we receive packets while 1272 + * the driver is going down, because then dev is NULL. 1273 + */ 1274 + dev_kfree_skb_irq(skb); 1273 1275 continue; 1276 + } 1274 1277 1275 1278 port = (struct veth_port *)dev->priv; 1276 1279 dest = *((u64 *) skb->data) & 0xFFFFFFFFFFFF0000; ··· 1388 1381 { 1389 1382 int i; 1390 1383 1391 - vio_unregister_driver(&veth_driver); 1384 + /* Stop the queues first to stop any new packets being sent. */ 1385 + for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) 1386 + if (veth_dev[i]) 1387 + netif_stop_queue(veth_dev[i]); 1392 1388 1389 + /* Stop the connections before we unregister the driver. This 1390 + * ensures there's no skbs lying around holding the device open. */ 1393 1391 for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) 1394 1392 veth_stop_connection(i); 1395 1393 1396 1394 HvLpEvent_unregisterHandler(HvLpEvent_Type_VirtualLan); 1397 1395 1398 1396 /* Hypervisor callbacks may have scheduled more work while we 1399 - * were destroying connections. Now that we've disconnected from 1397 + * were stoping connections. Now that we've disconnected from 1400 1398 * the hypervisor make sure everything's finished. */ 1401 1399 flush_scheduled_work(); 1400 + 1401 + vio_unregister_driver(&veth_driver); 1402 1402 1403 1403 for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) 1404 1404 veth_destroy_connection(i);