aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2017-11-06 14:50:33 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-11-16 18:45:00 +0300
commit163f57de92d66336433cf5638538828e10053655 (patch)
tree408369809402ae587a90688706fec730332e294b
parentfe1f56c168423800534b85d61f319d1dc327b49b (diff)
downloadodp-163f57de92d66336433cf5638538828e10053655.tar.gz
linux-gen: dpdk: reorganize pkt_dpdk_t struct
Reorder pkt_dpdk_t members so that all struct members used in fast path are located on the same cache line. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r--platform/linux-generic/include/odp_packet_dpdk.h17
-rw-r--r--platform/linux-generic/pktio/dpdk.c4
2 files changed, 11 insertions, 10 deletions
diff --git a/platform/linux-generic/include/odp_packet_dpdk.h b/platform/linux-generic/include/odp_packet_dpdk.h
index d4c4f02..7f0e285 100644
--- a/platform/linux-generic/include/odp_packet_dpdk.h
+++ b/platform/linux-generic/include/odp_packet_dpdk.h
@@ -50,20 +50,21 @@ typedef union {
typedef struct {
odp_pool_t pool; /**< pool to alloc packets from */
struct rte_mempool *pkt_pool; /**< DPDK packet pool */
- odp_pktio_capability_t capa; /**< interface capabilities */
uint32_t data_room; /**< maximum packet length */
- uint16_t mtu; /**< maximum transmission unit */
- /** Use system call to get/set vdev promisc mode */
- odp_bool_t vdev_sysc_promisc;
- uint8_t port_id; /**< DPDK port identifier */
unsigned min_rx_burst; /**< minimum RX burst size */
odp_pktin_hash_proto_t hash; /**< Packet input hash protocol */
- odp_bool_t lockless_rx; /**< no locking for rx */
- odp_bool_t lockless_tx; /**< no locking for tx */
+ uint16_t mtu; /**< maximum transmission unit */
+ /** Use system call to get/set vdev promisc mode */
+ uint8_t vdev_sysc_promisc;
+ uint8_t lockless_rx; /**< no locking for rx */
+ uint8_t lockless_tx; /**< no locking for tx */
+ uint8_t port_id; /**< DPDK port identifier */
+ /* --- 34 bytes --- */
+ odp_pktio_capability_t capa; /**< interface capabilities */
odp_ticketlock_t rx_lock[PKTIO_MAX_QUEUES]; /**< RX queue locks */
odp_ticketlock_t tx_lock[PKTIO_MAX_QUEUES]; /**< TX queue locks */
/** cache for storing extra RX packets */
pkt_cache_t rx_cache[PKTIO_MAX_QUEUES];
-} pkt_dpdk_t;
+} pkt_dpdk_t ODP_ALIGNED_CACHE;
#endif
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c
index b5a87b8..e9f7125 100644
--- a/platform/linux-generic/pktio/dpdk.c
+++ b/platform/linux-generic/pktio/dpdk.c
@@ -1083,7 +1083,7 @@ static int dpdk_input_queues_config(pktio_entry_t *pktio_entry,
const odp_pktin_queue_param_t *p)
{
odp_pktin_mode_t mode = pktio_entry->s.param.in_mode;
- odp_bool_t lockless;
+ uint8_t lockless;
/**
* Scheduler synchronizes input queue polls. Only single thread
@@ -1106,7 +1106,7 @@ static int dpdk_output_queues_config(pktio_entry_t *pktio_entry,
const odp_pktout_queue_param_t *p)
{
pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk;
- odp_bool_t lockless;
+ uint8_t lockless;
if (p->op_mode == ODP_PKTIO_OP_MT_UNSAFE)
lockless = 1;