On Wed, Oct 21, 2015 at 6:46 AM, Jijiang Liu <jijiang.liu at intel.com> wrote:
> @@ -221,6 +277,11 @@ virtqueue_enqueue_xmit(struct virtqueue *txvq, struct > rte_mbuf *cookie) > dxp->cookie = (void *)cookie; > dxp->ndescs = needed; > > + if (vtpci_with_feature(txvq->hw, VIRTIO_NET_F_CSUM)) { > + if (virtqueue_enqueue_offload(txvq, cookie, idx, > head_size) < 0) > + return -EPERM; > + } > + > start_dp = txvq->vq_ring.desc; > start_dp[idx].addr = > txvq->virtio_net_hdr_mem + idx * head_size; > If the driver correctly reports negotiated offload capabilities (see my previous comment on patch 3), there is no need for the test on VIRTIO_NET_F_CSUM, because application is not supposed to ask for offloads on driver that do not support them. Same logic would apply to virtqueue_enqueue_offload() function. In the end, we could always call this function (or move the code here). -- David Marchand