summaryrefslogtreecommitdiff
path: root/lib/librte_vhost
diff options
context:
space:
mode:
authorYuanhan Liu <yuanhan.liu@linux.intel.com>2016-05-02 17:46:18 -0700
committerYuanhan Liu <yuanhan.liu@linux.intel.com>2016-06-22 09:47:12 +0200
commita66bcad3224008f6fb89755c34533eb5fead166a (patch)
tree364adc605551ceb93ec8ecf77c3a65877bae81a6 /lib/librte_vhost
parent1d41d77cf81c448c1b09e1e859bfd300e2054a98 (diff)
downloaddpdk-a66bcad3224008f6fb89755c34533eb5fead166a.zip
dpdk-a66bcad3224008f6fb89755c34533eb5fead166a.tar.gz
dpdk-a66bcad3224008f6fb89755c34533eb5fead166a.tar.xz
vhost: arrange struct fields for better cache sharing
The ifname[] field takes so much space, that it seperates some frequently used fields into different caches, say, features and broadcast_rarp. This patch moves all those fields that will be accessed frequently in Rx/Tx together (before the ifname[] field) to let them share one cache line. Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Acked-by: Huawei Xie <huawei.xie@intel.com> Tested-by: Rich Lane <rich.lane@bigswitch.com>
Diffstat (limited to 'lib/librte_vhost')
-rw-r--r--lib/librte_vhost/vhost-net.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/librte_vhost/vhost-net.h b/lib/librte_vhost/vhost-net.h
index 162ad04..41a3ccf 100644
--- a/lib/librte_vhost/vhost-net.h
+++ b/lib/librte_vhost/vhost-net.h
@@ -128,16 +128,16 @@ struct virtio_net {
int vid;
uint32_t flags;
uint16_t vhost_hlen;
+ /* to tell if we need broadcast rarp packet */
+ rte_atomic16_t broadcast_rarp;
+ uint32_t virt_qp_nb;
+ struct vhost_virtqueue *virtqueue[VHOST_MAX_QUEUE_PAIRS * 2];
#define IF_NAME_SZ (PATH_MAX > IFNAMSIZ ? PATH_MAX : IFNAMSIZ)
char ifname[IF_NAME_SZ];
- uint32_t virt_qp_nb;
uint64_t log_size;
uint64_t log_base;
struct ether_addr mac;
- /* to tell if we need broadcast rarp packet */
- rte_atomic16_t broadcast_rarp;
- struct vhost_virtqueue *virtqueue[VHOST_MAX_QUEUE_PAIRS * 2];
} __rte_cache_aligned;
/**