aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/vhost_user.h
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-05-06 08:51:56 -0700
committerDave Barach <openvpp@barachs.net>2019-07-31 16:33:15 +0000
commit4208a4ce8d72d3fb6428527cde1fba7b397bd6f7 (patch)
tree3a04e358925ab7215c7d358fbf62b6c1eb33b25f /src/vnet/devices/virtio/vhost_user.h
parent83832e7ced8be8b7de394415feaba70c32e3c38d (diff)
devices interface tests: vhosst GSO support
Add gso option in create vhost interface to support gso and checksum offload. Tested with the following startup options in qemu: csum=on,gso=on,guest_csum=on,guest_tso4=on,guest_tso6=on,guest_ufo=on, host_tso4=on,host_tso6=on,host_ufo=on Type: feature Change-Id: I9ba1ee33677a694c4a0dfe66e745b098995902b8 Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user.h')
-rw-r--r--src/vnet/devices/virtio/vhost_user.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/vnet/devices/virtio/vhost_user.h b/src/vnet/devices/virtio/vhost_user.h
index 7dadfed2334..c7a4206fa1d 100644
--- a/src/vnet/devices/virtio/vhost_user.h
+++ b/src/vnet/devices/virtio/vhost_user.h
@@ -85,6 +85,14 @@ typedef enum
} virtio_trace_flag_t;
#define foreach_virtio_net_feature \
+ _ (VIRTIO_NET_F_CSUM, 0) \
+ _ (VIRTIO_NET_F_GUEST_CSUM, 1) \
+ _ (VIRTIO_NET_F_GUEST_TSO4, 7) \
+ _ (VIRTIO_NET_F_GUEST_TSO6, 8) \
+ _ (VIRTIO_NET_F_GUEST_UFO, 10) \
+ _ (VIRTIO_NET_F_HOST_TSO4, 11) \
+ _ (VIRTIO_NET_F_HOST_TSO6, 12) \
+ _ (VIRTIO_NET_F_HOST_UFO, 14) \
_ (VIRTIO_NET_F_MRG_RXBUF, 15) \
_ (VIRTIO_NET_F_CTRL_VQ, 17) \
_ (VIRTIO_NET_F_GUEST_ANNOUNCE, 21) \
@@ -102,14 +110,32 @@ typedef enum
#undef _
} virtio_net_feature_t;
+#define FEATURE_VIRTIO_NET_F_HOST_TSO_FEATURE_BITS \
+ ((1ULL << FEAT_VIRTIO_NET_F_CSUM) | \
+ (1ULL << FEAT_VIRTIO_NET_F_HOST_UFO) | \
+ (1ULL << FEAT_VIRTIO_NET_F_HOST_TSO4) | \
+ (1ULL << FEAT_VIRTIO_NET_F_HOST_TSO6))
+
+#define FEATURE_VIRTIO_NET_F_GUEST_TSO_FEATURE_BITS \
+ ((1ULL << FEAT_VIRTIO_NET_F_GUEST_CSUM) | \
+ (1ULL << FEAT_VIRTIO_NET_F_GUEST_UFO) | \
+ (1ULL << FEAT_VIRTIO_NET_F_GUEST_TSO4) | \
+ (1ULL << FEAT_VIRTIO_NET_F_GUEST_TSO6))
+
+#define FEATURE_VIRTIO_NET_F_HOST_GUEST_TSO_FEATURE_BITS \
+ (FEATURE_VIRTIO_NET_F_HOST_TSO_FEATURE_BITS | \
+ FEATURE_VIRTIO_NET_F_GUEST_TSO_FEATURE_BITS)
+
int vhost_user_create_if (vnet_main_t * vnm, vlib_main_t * vm,
const char *sock_filename, u8 is_server,
u32 * sw_if_index, u64 feature_mask,
- u8 renumber, u32 custom_dev_instance, u8 * hwaddr);
+ u8 renumber, u32 custom_dev_instance, u8 * hwaddr,
+ u8 enable_gso);
int vhost_user_modify_if (vnet_main_t * vnm, vlib_main_t * vm,
const char *sock_filename, u8 is_server,
u32 sw_if_index, u64 feature_mask,
- u8 renumber, u32 custom_dev_instance);
+ u8 renumber, u32 custom_dev_instance,
+ u8 enable_gso);
int vhost_user_delete_if (vnet_main_t * vnm, vlib_main_t * vm,
u32 sw_if_index);
@@ -301,6 +327,8 @@ typedef struct
/* Whether to use spinlock or per_cpu_tx_qid assignment */
u8 use_tx_spinlock;
u16 *per_cpu_tx_qid;
+
+ u8 enable_gso;
} vhost_user_intf_t;
typedef struct
@@ -357,6 +385,9 @@ typedef struct
/* logging */
vlib_log_class_t log_default;
+
+ /* gso interface count */
+ u32 gso_count;
} vhost_user_main_t;
typedef struct