From: Matias Elo <matias....@nokia.com> 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....@nokia.com> Reviewed-by: Bill Fischofer <bill.fischo...@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org> --- /** Email created from pull request 301 (muvarov:api-next) ** https://github.com/Linaro/odp/pull/301 ** Patch: https://github.com/Linaro/odp/pull/301.patch ** Base sha: d4b364849c4abb4c71e0c5260e1a793ebb8dc97d ** Merge commit sha: 390c09cfddb8e938a4bef428fb46ce575f22c984 **/ platform/linux-generic/include/odp_packet_dpdk.h | 17 +++++++++-------- platform/linux-generic/pktio/dpdk.c | 4 ++-- 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 d4c4f02cb..7f0e28535 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 b5a87b829..e9f71257b 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;