Thread (11 messages) 11 messages, 2 authors, 2015-10-30
STALE3864d

[PATCH v2 4/9] driver/virtio:fill virtio device info for TX offload

From: Jijiang Liu <hidden>
Date: 2015-10-30 13:01:00
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Fill virtio device info for TX offload.

Signed-off-by: Jijiang Liu <redacted>
---
 drivers/net/virtio/virtio_ethdev.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index cb5dfee..b831c02 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1559,6 +1559,16 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->default_txconf = (struct rte_eth_txconf) {
 		.txq_flags = ETH_TXQ_FLAGS_NOOFFLOADS
 	};
+
+	if (hw->guest_features & (1u << VIRTIO_NET_F_CSUM))
+		dev_info->tx_offload_capa = DEV_TX_OFFLOAD_IPV4_CKSUM |
+				DEV_TX_OFFLOAD_UDP_CKSUM |
+				DEV_TX_OFFLOAD_TCP_CKSUM |
+				DEV_TX_OFFLOAD_SCTP_CKSUM;
+
+	if ((hw->guest_features & (1u << VIRTIO_NET_F_HOST_TSO4)) ||
+		(hw->guest_features & (1u << VIRTIO_NET_F_HOST_TSO6)))
+		dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO;
 }
 
 /*
-- 
1.7.7.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help