|
@@ -559,15 +559,17 @@ static int vnet_ack(struct vnet_port *port, void *msgbuf)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
end = pkt->end_idx;
|
|
end = pkt->end_idx;
|
|
- if (unlikely(!idx_is_pending(dr, end)))
|
|
|
|
- return 0;
|
|
|
|
-
|
|
|
|
vp = port->vp;
|
|
vp = port->vp;
|
|
dev = vp->dev;
|
|
dev = vp->dev;
|
|
|
|
+ netif_tx_lock(dev);
|
|
|
|
+ if (unlikely(!idx_is_pending(dr, end))) {
|
|
|
|
+ netif_tx_unlock(dev);
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* sync for race conditions with vnet_start_xmit() and tell xmit it
|
|
/* sync for race conditions with vnet_start_xmit() and tell xmit it
|
|
* is time to send a trigger.
|
|
* is time to send a trigger.
|
|
*/
|
|
*/
|
|
- netif_tx_lock(dev);
|
|
|
|
dr->cons = next_idx(end, dr);
|
|
dr->cons = next_idx(end, dr);
|
|
desc = vio_dring_entry(dr, dr->cons);
|
|
desc = vio_dring_entry(dr, dr->cons);
|
|
if (desc->hdr.state == VIO_DESC_READY && port->start_cons) {
|
|
if (desc->hdr.state == VIO_DESC_READY && port->start_cons) {
|