aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/virtio_net.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-08-23 16:18:10 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-25 02:02:45 -0400
commitc223a078cbe0a87d470b08db7c83c7053931ae63 (patch)
treec38c0439f002092e03a52fc0743d429c7d6dfbc1 /drivers/net/virtio_net.c
parentc1ebf46c1f72fe542853fc00f059a7d15259379d (diff)
virtio_net: Support netdev_ops->ndo_xmit_flush()
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 59caa06f34a6..62421086d3e6 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -934,7 +934,6 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
934 dev_kfree_skb_any(skb); 934 dev_kfree_skb_any(skb);
935 return NETDEV_TX_OK; 935 return NETDEV_TX_OK;
936 } 936 }
937 virtqueue_kick(sq->vq);
938 937
939 /* Don't wait up for transmitted skbs to be freed. */ 938 /* Don't wait up for transmitted skbs to be freed. */
940 skb_orphan(skb); 939 skb_orphan(skb);
@@ -957,6 +956,14 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
957 return NETDEV_TX_OK; 956 return NETDEV_TX_OK;
958} 957}
959 958
959static void xmit_flush(struct net_device *dev, u16 qnum)
960{
961 struct virtnet_info *vi = netdev_priv(dev);
962 struct send_queue *sq = &vi->sq[qnum];
963
964 virtqueue_kick(sq->vq);
965}
966
960/* 967/*
961 * Send command via the control virtqueue and check status. Commands 968 * Send command via the control virtqueue and check status. Commands
962 * supported by the hypervisor, as indicated by feature bits, should 969 * supported by the hypervisor, as indicated by feature bits, should
@@ -1386,6 +1393,7 @@ static const struct net_device_ops virtnet_netdev = {
1386 .ndo_open = virtnet_open, 1393 .ndo_open = virtnet_open,
1387 .ndo_stop = virtnet_close, 1394 .ndo_stop = virtnet_close,
1388 .ndo_start_xmit = start_xmit, 1395 .ndo_start_xmit = start_xmit,
1396 .ndo_xmit_flush = xmit_flush,
1389 .ndo_validate_addr = eth_validate_addr, 1397 .ndo_validate_addr = eth_validate_addr,
1390 .ndo_set_mac_address = virtnet_set_mac_address, 1398 .ndo_set_mac_address = virtnet_set_mac_address,
1391 .ndo_set_rx_mode = virtnet_set_rx_mode, 1399 .ndo_set_rx_mode = virtnet_set_rx_mode,