src/netvsc_drv.c
/* Send skb on the slave VF device. */
Send skb on the slave VF device.
Send skb on the slave VF device .
static int netvsc_vf_xmit(struct net_device *net, struct net_device *vf_netdev,
			  struct sk_buff *skb)
{
	struct net_device_context *ndev_ctx = netdev_priv(net);
	unsigned int len = skb->len;
	int rc;
	skb->dev = vf_netdev;
	skb_record_rx_queue(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping);
	rc = dev_queue_xmit(skb);
	if (likely(rc == NET_XMIT_SUCCESS || rc == NET_XMIT_CN)) {
		struct netvsc_vf_pcpu_stats *pcpu_stats
			= this_cpu_ptr(ndev_ctx->vf_stats);
		u64_stats_update_begin(&pcpu_stats->syncp);
		pcpu_stats->tx_packets++;
		pcpu_stats->tx_bytes += len;
		u64_stats_update_end(&pcpu_stats->syncp);
	} else {
		this_cpu_inc(ndev_ctx->vf_stats->tx_dropped);
	}
	return rc;
}
static int netvsc_vf_xmit ( struct net_device * net , struct net_device * vf_netdev , struct sk_buff * skb ) { struct net_device_context * ndev_ctx = netdev_priv ( net ) ; unsigned int len = skb -> len ; int rc ; skb -> dev = vf_netdev ; skb_record_rx_queue ( skb , qdisc_skb_cb ( skb ) -> slave_dev_queue_mapping ) ; rc = dev_queue_xmit ( skb ) ; if ( likely ( rc == NET_XMIT_SUCCESS || rc == NET_XMIT_CN ) ) { struct netvsc_vf_pcpu_stats * pcpu_stats = this_cpu_ptr ( ndev_ctx -> vf_stats ) ; u64_stats_update_begin ( & pcpu_stats -> syncp ) ; pcpu_stats -> tx_packets ++ ; pcpu_stats -> tx_bytes += len ; u64_stats_update_end ( & pcpu_stats -> syncp ) ; } else { this_cpu_inc ( ndev_ctx -> vf_stats -> tx_dropped ) ; } return rc ; }
Send skb on the slave VF device.
Send skb on the slave VF device .