X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fvirtio%2Fvirtio_ethdev.c;h=2ac2523ba7d0146220cd709fbbb2cfa106b0f76d;hb=d67d86ce5b0a149946f86161e507402ddce2038d;hp=4b6f004c836ce6dcabd0dd799ae98d9d673c48e9;hpb=ec9f3d122a58934a2c52ae984be7114d03234a11;p=dpdk.git diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 4b6f004c83..2ac2523ba7 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1671,12 +1671,13 @@ virtio_dev_configure(struct rte_eth_dev *dev) return ret; } - /* Virtio does L4 checksum but not L3! */ - if (rxmode->hw_ip_checksum) { - PMD_DRV_LOG(NOTICE, - "virtio does not support IP checksum"); - return -ENOTSUP; - } + /* The name hw_ip_checksum is a bit confusing since it can be + * set by the application to request L3 and/or L4 checksums. In + * case of virtio, only L4 checksum is supported. + */ + if (rxmode->hw_ip_checksum) + req_features |= (1ULL << VIRTIO_NET_F_GUEST_CSUM); + if (rxmode->enable_lro) req_features |= (1ULL << VIRTIO_NET_F_GUEST_TSO4) | @@ -1689,6 +1690,13 @@ virtio_dev_configure(struct rte_eth_dev *dev) return ret; } + if (rxmode->hw_ip_checksum && + !vtpci_with_feature(hw, VIRTIO_NET_F_GUEST_CSUM)) { + PMD_DRV_LOG(NOTICE, + "rx checksum not available on this host"); + return -ENOTSUP; + } + if (rxmode->enable_lro && (!vtpci_with_feature(hw, VIRTIO_NET_F_GUEST_TSO4) || !vtpci_with_feature(hw, VIRTIO_NET_F_GUEST_TSO4))) {