This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 5329e5211c447b9b823149baf76112eedfeb07fb (commit) via ce058b8fdde37cc302bcf589f458dab7b8d3e365 (commit) via 5d6a9f036cdeeb79215328a63b2dc63962e292a0 (commit) via 4459e1bd35534dd1b6a313890c74086c0e86c617 (commit) via 163f57de92d66336433cf5638538828e10053655 (commit) via fe1f56c168423800534b85d61f319d1dc327b49b (commit) from 9163719bd4c04321592dad9da7f26539f49c8b7a (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 5329e5211c447b9b823149baf76112eedfeb07fb Author: Matias Elo matias.elo@nokia.com Date: Wed Nov 15 12:52:42 2017 +0200
linux-gen: pktio: add pktio capability to pktio_entry_t
Since odp_pktio_capability_t is common for all pktio implementations move it inside pktio_entry_t.
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
diff --git a/platform/linux-generic/include/odp_packet_dpdk.h b/platform/linux-generic/include/odp_packet_dpdk.h index 7f0e2853..05f00ad3 100644 --- a/platform/linux-generic/include/odp_packet_dpdk.h +++ b/platform/linux-generic/include/odp_packet_dpdk.h @@ -60,7 +60,6 @@ typedef struct { 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 */ diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 1a4e345f..83c449e8 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -159,6 +159,7 @@ struct pktio_entry {
odp_pool_t pool; odp_pktio_param_t param; + odp_pktio_capability_t capa; /**< Packet IO capabilities */
/* Storage for queue handles * Multi-queue support is pktio driver specific */ diff --git a/platform/linux-generic/include/odp_packet_netmap.h b/platform/linux-generic/include/odp_packet_netmap.h index a6f68d56..876c7e46 100644 --- a/platform/linux-generic/include/odp_packet_netmap.h +++ b/platform/linux-generic/include/odp_packet_netmap.h @@ -52,7 +52,6 @@ typedef struct { char nm_name[IF_NAMESIZE + 7]; /**< netmap:<ifname> */ char if_name[IF_NAMESIZE]; /**< interface name used in ioctl */ odp_bool_t is_virtual; /**< nm virtual port (VALE/pipe) */ - odp_pktio_capability_t capa; /**< interface capabilities */ uint32_t num_rx_rings; /**< number of nm rx rings */ uint32_t num_tx_rings; /**< number of nm tx rings */ unsigned num_rx_desc_rings; /**< number of rx descriptor rings */ diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index e9f71257..07671e62 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -1122,7 +1122,7 @@ static void dpdk_init_capability(pktio_entry_t *pktio_entry, struct rte_eth_dev_info *dev_info) { pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk; - odp_pktio_capability_t *capa = &pkt_dpdk->capa; + odp_pktio_capability_t *capa = &pktio_entry->s.capa; int ptype_cnt; int ptype_l3_ipv4 = 0; int ptype_l4_tcp = 0; @@ -1545,7 +1545,7 @@ static int dpdk_promisc_mode_get(pktio_entry_t *pktio_entry) static int dpdk_capability(pktio_entry_t *pktio_entry, odp_pktio_capability_t *capa) { - *capa = pktio_entry->s.pkt_dpdk.capa; + *capa = pktio_entry->s.capa; return 0; }
diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index 297d54dc..cbcf7789 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -267,9 +267,9 @@ static inline int netmap_wait_for_link(pktio_entry_t *pktio_entry) static void netmap_init_capability(pktio_entry_t *pktio_entry) { pkt_netmap_t *pkt_nm = &pktio_entry->s.pkt_nm; - odp_pktio_capability_t *capa = &pkt_nm->capa; + odp_pktio_capability_t *capa = &pktio_entry->s.capa;
- memset(&pkt_nm->capa, 0, sizeof(odp_pktio_capability_t)); + memset(capa, 0, sizeof(odp_pktio_capability_t));
capa->max_input_queues = PKTIO_MAX_QUEUES; if (pkt_nm->num_rx_rings < PKTIO_MAX_QUEUES) @@ -395,8 +395,8 @@ static int netmap_open(odp_pktio_t id ODP_UNUSED, pktio_entry_t *pktio_entry, ODP_DBG("Unable to fetch thread ID. VALE port MAC " "addresses may not be unique.\n");
- pkt_nm->capa.max_input_queues = 1; - pkt_nm->capa.set_op.op.promisc_mode = 0; + pktio_entry->s.capa.max_input_queues = 1; + pktio_entry->s.capa.set_op.op.promisc_mode = 0; pkt_nm->mtu = buf_size; pktio_entry->s.stats_type = STATS_UNSUPPORTED; /* Set MAC address for virtual interface */ @@ -430,7 +430,7 @@ static int netmap_open(odp_pktio_t id ODP_UNUSED, pktio_entry_t *pktio_entry, /* Check if RSS is supported. If not, set 'max_input_queues' to 1. */ if (rss_conf_get_supported_fd(sockfd, netdev, &hash_proto) == 0) { ODP_DBG("RSS not supported\n"); - pkt_nm->capa.max_input_queues = 1; + pktio_entry->s.capa.max_input_queues = 1; }
err = netmap_do_ioctl(pktio_entry, SIOCGIFFLAGS, 0); @@ -897,7 +897,7 @@ static int netmap_promisc_mode_get(pktio_entry_t *pktio_entry) static int netmap_capability(pktio_entry_t *pktio_entry, odp_pktio_capability_t *capa) { - *capa = pktio_entry->s.pkt_nm.capa; + *capa = pktio_entry->s.capa; return 0; }
commit ce058b8fdde37cc302bcf589f458dab7b8d3e365 Author: Matias Elo matias.elo@nokia.com Date: Tue Nov 7 11:03:14 2017 +0200
linux-gen: pool: add inlined accessors for selected pool parameters
Add inlined accessors for pool_t members pool_hdl and uarea_size. This enables removing the matching members from odp_buffer_hdr_t, and thus reduces per buffer overhead.
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
diff --git a/platform/linux-generic/include/odp/api/plat/packet_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_inlines.h index 1804fa6f..c808f2d6 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inlines.h @@ -21,6 +21,9 @@ /** @internal Inline function offsets */ extern const _odp_packet_inline_offset_t _odp_packet_inline;
+/** @internal Pool inline function offsets */ +extern const _odp_pool_inline_offset_t _odp_pool_inline; + #if ODP_ABI_COMPAT == 1 /** @internal Inline function @param seg @return */ static inline uint32_t _odp_packet_seg_to_ndx(odp_packet_seg_t seg) @@ -68,7 +71,9 @@ static inline uint32_t _odp_packet_tailroom(odp_packet_t pkt) /** @internal Inline function @param pkt @return */ static inline odp_pool_t _odp_packet_pool(odp_packet_t pkt) { - return _odp_pkt_get(pkt, odp_pool_t, pool); + void *pool = _odp_pkt_get(pkt, void *, pool); + + return _odp_pool_get(pool, odp_pool_t, pool_hdl); }
/** @internal Inline function @param pkt @return */ @@ -98,7 +103,9 @@ static inline void *_odp_packet_user_area(odp_packet_t pkt) /** @internal Inline function @param pkt @return */ static inline uint32_t _odp_packet_user_area_size(odp_packet_t pkt) { - return _odp_pkt_get(pkt, uint32_t, user_area_size); + void *pool = _odp_pkt_get(pkt, void *, pool); + + return _odp_pool_get(pool, uint32_t, uarea_size); }
/** @internal Inline function @param pkt @return */ diff --git a/platform/linux-generic/include/odp/api/plat/packet_types.h b/platform/linux-generic/include/odp/api/plat/packet_types.h index 68c66312..009a3aa7 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_types.h +++ b/platform/linux-generic/include/odp/api/plat/packet_types.h @@ -94,8 +94,6 @@ typedef struct _odp_packet_inline_offset_t { /** @internal field offset */ uint16_t user_area; /** @internal field offset */ - uint16_t user_area_size; - /** @internal field offset */ uint16_t flow_hash; /** @internal field offset */ uint16_t timestamp; diff --git a/platform/linux-generic/include/odp/api/plat/pool_types.h b/platform/linux-generic/include/odp/api/plat/pool_types.h index 8bc816d4..9a26dde5 100644 --- a/platform/linux-generic/include/odp/api/plat/pool_types.h +++ b/platform/linux-generic/include/odp/api/plat/pool_types.h @@ -48,6 +48,19 @@ typedef enum odp_pool_type_t {
#endif
+/** @internal Pool field accessor */ +#define _odp_pool_get(pool, cast, field) \ + (*(cast *)(uintptr_t)((uint8_t *)pool + _odp_pool_inline.field)) + +/** @internal Pool header field offsets for inline functions */ +typedef struct _odp_pool_inline_offset_t { + /** @internal field offset */ + uint16_t pool_hdl; + /** @internal field offset */ + uint16_t uarea_size; + +} _odp_pool_inline_offset_t; + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index ac189301..c56c5b01 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -104,17 +104,10 @@ struct odp_buffer_hdr_t { /* User area pointer */ void *uarea_addr;
- /* User area size */ - uint32_t uarea_size; - /* ipc mapped process can not walk over pointers, * offset has to be used */ uint64_t ipc_data_offset;
- /* Pool handle: will be removed, used only for odp_packet_pool() - * inlining */ - odp_pool_t pool_hdl; - /* Data or next header */ uint8_t data[0]; } ODP_ALIGNED_CACHE; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index ca706b2e..04f1f33b 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -32,12 +32,11 @@ const _odp_packet_inline_offset_t _odp_packet_inline ODP_ALIGNED_CACHE = { .frame_len = offsetof(odp_packet_hdr_t, frame_len), .headroom = offsetof(odp_packet_hdr_t, headroom), .tailroom = offsetof(odp_packet_hdr_t, tailroom), - .pool = offsetof(odp_packet_hdr_t, buf_hdr.pool_hdl), + .pool = offsetof(odp_packet_hdr_t, buf_hdr.pool_ptr), .input = offsetof(odp_packet_hdr_t, input), .segcount = offsetof(odp_packet_hdr_t, buf_hdr.segcount), .user_ptr = offsetof(odp_packet_hdr_t, buf_hdr.buf_ctx), .user_area = offsetof(odp_packet_hdr_t, buf_hdr.uarea_addr), - .user_area_size = offsetof(odp_packet_hdr_t, buf_hdr.uarea_size), .flow_hash = offsetof(odp_packet_hdr_t, flow_hash), .timestamp = offsetof(odp_packet_hdr_t, timestamp), .input_flags = offsetof(odp_packet_hdr_t, p.input_flags) @@ -266,7 +265,6 @@ static inline void packet_seg_copy_md(odp_packet_hdr_t *dst, /* buffer header side packet metadata */ dst->buf_hdr.buf_u64 = src->buf_hdr.buf_u64; dst->buf_hdr.uarea_addr = src->buf_hdr.uarea_addr; - dst->buf_hdr.uarea_size = src->buf_hdr.uarea_size;
/* segmentation data is not copied: * buf_hdr.seg[] @@ -1837,18 +1835,20 @@ int _odp_packet_copy_md_to_packet(odp_packet_t srcpkt, odp_packet_t dstpkt) { odp_packet_hdr_t *srchdr = packet_hdr(srcpkt); odp_packet_hdr_t *dsthdr = packet_hdr(dstpkt); + pool_t *src_pool = srchdr->buf_hdr.pool_ptr; + pool_t *dst_pool = dsthdr->buf_hdr.pool_ptr; + uint32_t src_uarea_size = src_pool->params.pkt.uarea_size; + uint32_t dst_uarea_size = dst_pool->params.pkt.uarea_size;
dsthdr->input = srchdr->input; dsthdr->dst_queue = srchdr->dst_queue; dsthdr->buf_hdr.buf_u64 = srchdr->buf_hdr.buf_u64; if (dsthdr->buf_hdr.uarea_addr != NULL && - srchdr->buf_hdr.uarea_addr != NULL) - memcpy(dsthdr->buf_hdr.uarea_addr, - srchdr->buf_hdr.uarea_addr, - dsthdr->buf_hdr.uarea_size <= - srchdr->buf_hdr.uarea_size ? - dsthdr->buf_hdr.uarea_size : - srchdr->buf_hdr.uarea_size); + srchdr->buf_hdr.uarea_addr != NULL) { + memcpy(dsthdr->buf_hdr.uarea_addr, srchdr->buf_hdr.uarea_addr, + dst_uarea_size <= src_uarea_size ? dst_uarea_size : + src_uarea_size); + }
copy_packet_parser_metadata(srchdr, dsthdr);
@@ -1856,7 +1856,7 @@ int _odp_packet_copy_md_to_packet(odp_packet_t srcpkt, odp_packet_t dstpkt) * user area was truncated in the process. Note this can only * happen when copying between different pools. */ - return dsthdr->buf_hdr.uarea_size < srchdr->buf_hdr.uarea_size; + return dst_uarea_size < src_uarea_size; }
/** diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 7d7a423b..c0dd41eb 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -57,6 +57,16 @@ typedef struct pool_local_t { pool_table_t *pool_tbl; static __thread pool_local_t local;
+#include <odp/visibility_begin.h> + +/* Fill in pool header field offsets for inline functions */ +const _odp_pool_inline_offset_t _odp_pool_inline ODP_ALIGNED_CACHE = { + .pool_hdl = offsetof(pool_t, pool_hdl), + .uarea_size = offsetof(pool_t, params.pkt.uarea_size) +}; + +#include <odp/visibility_end.h> + static inline odp_pool_t pool_index_to_handle(uint32_t pool_idx) { return _odp_cast_scalar(odp_pool_t, pool_idx); @@ -288,11 +298,8 @@ static void init_buffers(pool_t *pool) buf_hdr->index = i; buf_hdr->type = type; buf_hdr->event_type = type; - buf_hdr->pool_hdl = pool->pool_hdl; buf_hdr->pool_ptr = pool; buf_hdr->uarea_addr = uarea; - /* Show user requested size through API */ - buf_hdr->uarea_size = pool->params.pkt.uarea_size; buf_hdr->segcount = 1; buf_hdr->num_seg = 1; buf_hdr->next_seg = NULL;
commit 5d6a9f036cdeeb79215328a63b2dc63962e292a0 Author: Matias Elo matias.elo@nokia.com Date: Mon Nov 6 16:15:54 2017 +0200
linux-gen: pool: remove unnecessary pool_entry_from_hdl() calls
Pool entry pointer is already stored in the odp_buffer_hdr_t struct.
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
diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 89fb34b6..fb3d4449 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -193,7 +193,7 @@ static inline seg_entry_t *seg_entry_last(odp_packet_hdr_t *hdr) */ static inline void packet_init(odp_packet_hdr_t *pkt_hdr, uint32_t len) { - pool_t *pool = pool_entry_from_hdl(pkt_hdr->buf_hdr.pool_hdl); + pool_t *pool = pkt_hdr->buf_hdr.pool_ptr; uint32_t seg_len; int num = pkt_hdr->buf_hdr.segcount;
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 6d1f1bd0..ca706b2e 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -338,7 +338,7 @@ static inline void link_segments(odp_packet_hdr_t *pkt_hdr[], int num) int cur, i; odp_packet_hdr_t *hdr; odp_packet_hdr_t *head = pkt_hdr[0]; - uint32_t seg_len = pool_entry_from_hdl(head->buf_hdr.pool_hdl)->seg_len; + uint32_t seg_len = ((pool_t *)(head->buf_hdr.pool_ptr))->seg_len;
cur = 0;
@@ -385,7 +385,7 @@ static inline void init_segments(odp_packet_hdr_t *pkt_hdr[], int num)
/* First segment is the packet descriptor */ hdr = pkt_hdr[0]; - seg_len = pool_entry_from_hdl(hdr->buf_hdr.pool_hdl)->seg_len; + seg_len = ((pool_t *)(hdr->buf_hdr.pool_ptr))->seg_len;
/* Defaults for single segment packet */ hdr->buf_hdr.seg[0].data = hdr->buf_hdr.base_data; @@ -416,7 +416,7 @@ static inline void reset_seg(odp_packet_hdr_t *pkt_hdr, int first, int num) void *base; int i; seg_entry_t *seg; - uint32_t seg_len = pool_entry_from_hdl(hdr->buf_hdr.pool_hdl)->seg_len; + uint32_t seg_len = ((pool_t *)(hdr->buf_hdr.pool_ptr))->seg_len; uint8_t idx;
seg_entry_find_idx(&hdr, &idx, first);
commit 4459e1bd35534dd1b6a313890c74086c0e86c617 Author: Matias Elo matias.elo@nokia.com Date: Mon Nov 6 12:52:04 2017 +0200
linux-gen: buffer: remove data size member from odp_buffer_hdr_t
Data size is constant for all buffers from the same pool, so there is no need to store the value in the buffer header.
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
diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index aefb1352..ac189301 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -107,9 +107,6 @@ struct odp_buffer_hdr_t { /* User area size */ uint32_t uarea_size;
- /* Max data size */ - uint32_t size; - /* ipc mapped process can not walk over pointers, * offset has to be used */ uint64_t ipc_data_offset; diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 48945ee1..61ec5ccc 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -61,6 +61,7 @@ typedef struct pool_t { uint32_t headroom; uint32_t tailroom; uint32_t seg_len; + uint32_t max_seg_len; uint32_t max_len; uint32_t uarea_size; uint32_t block_size; diff --git a/platform/linux-generic/odp_buffer.c b/platform/linux-generic/odp_buffer.c index 1b148489..a0e0cd10 100644 --- a/platform/linux-generic/odp_buffer.c +++ b/platform/linux-generic/odp_buffer.c @@ -36,8 +36,9 @@ void *odp_buffer_addr(odp_buffer_t buf) uint32_t odp_buffer_size(odp_buffer_t buf) { odp_buffer_hdr_t *hdr = buf_hdl_to_hdr(buf); + pool_t *pool = hdr->pool_ptr;
- return hdr->size; + return pool->seg_len; }
int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf) @@ -62,7 +63,7 @@ int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf) len += snprintf(&str[len], n-len, " addr %p\n", hdr->seg[0].data); len += snprintf(&str[len], n-len, - " size %" PRIu32 "\n", hdr->size); + " size %" PRIu32 "\n", odp_buffer_size(buf)); len += snprintf(&str[len], n-len, " type %i\n", hdr->type);
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 68a6eef5..6d1f1bd0 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -957,8 +957,9 @@ odp_event_t odp_packet_to_event(odp_packet_t pkt) uint32_t odp_packet_buf_len(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); + pool_t *pool = pkt_hdr->buf_hdr.pool_ptr;
- return pkt_hdr->buf_hdr.size * pkt_hdr->buf_hdr.segcount; + return pool->max_seg_len * pkt_hdr->buf_hdr.segcount; }
void *odp_packet_tail(odp_packet_t pkt) @@ -1404,6 +1405,7 @@ int odp_packet_align(odp_packet_t *pkt, uint32_t offset, uint32_t len, uint32_t shift; uint32_t seglen = 0; /* GCC */ odp_packet_hdr_t *pkt_hdr = packet_hdr(*pkt); + pool_t *pool = pkt_hdr->buf_hdr.pool_ptr; void *addr = packet_map(pkt_hdr, offset, &seglen, NULL); uint64_t uaddr = (uint64_t)(uintptr_t)addr; uint64_t misalign; @@ -1420,7 +1422,7 @@ int odp_packet_align(odp_packet_t *pkt, uint32_t offset, uint32_t len, return 0; shift = align - misalign; } else { - if (len > pkt_hdr->buf_hdr.size) + if (len > pool->max_seg_len) return -1; shift = len - seglen; uaddr -= shift; diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 3e47993c..7d7a423b 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -236,7 +236,6 @@ static void init_buffers(pool_t *pool) ring_t *ring; uint32_t mask; int type; - uint32_t seg_size; uint64_t page_size; int skipped_blocks = 0;
@@ -285,11 +284,8 @@ static void init_buffers(pool_t *pool)
memset(buf_hdr, 0, (uintptr_t)data - (uintptr_t)buf_hdr);
- seg_size = pool->headroom + pool->seg_len + pool->tailroom; - /* Initialize buffer metadata */ buf_hdr->index = i; - buf_hdr->size = seg_size; buf_hdr->type = type; buf_hdr->event_type = type; buf_hdr->pool_hdl = pool->pool_hdl; @@ -469,6 +465,7 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, pool->align = align; pool->headroom = headroom; pool->seg_len = seg_len; + pool->max_seg_len = headroom + seg_len + tailroom; pool->max_len = max_len; pool->tailroom = tailroom; pool->block_size = block_size;
commit 163f57de92d66336433cf5638538828e10053655 Author: Matias Elo matias.elo@nokia.com Date: Mon Nov 6 14:50:33 2017 +0200
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
diff --git a/platform/linux-generic/include/odp_packet_dpdk.h b/platform/linux-generic/include/odp_packet_dpdk.h index d4c4f02c..7f0e2853 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 b5a87b82..e9f71257 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;
commit fe1f56c168423800534b85d61f319d1dc327b49b Author: Matias Elo matias.elo@nokia.com Date: Wed Nov 1 14:47:05 2017 +0200
configure: disable debug by default and print configured value
Disable debug checks by default for optimal performance.
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
diff --git a/configure.ac b/configure.ac index 459ea231..95e31602 100644 --- a/configure.ac +++ b/configure.ac @@ -227,7 +227,8 @@ DX_INIT_DOXYGEN($PACKAGE_NAME, AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [include additional debugging code ] - [(set to 'full' to enable all --enable-*-debug-* options)])]) + [(set to 'full' to enable all --enable-*-debug-* options)])], + [], [enable_debug=no])
AS_IF([test "x$enable_debug" != "xno"], [ODP_DEBUG=1], [ODP_DEBUG=0]) @@ -380,6 +381,7 @@ AC_MSG_RESULT([ shared libraries: ${enable_shared} ABI compatible: ${abi_compat} Deprecated APIs: ${deprecated} + debug: ${enable_debug} cunit: ${cunit_support} test_vald: ${test_vald} test_perf: ${test_perf}
-----------------------------------------------------------------------
Summary of changes: configure.ac | 4 ++- .../include/odp/api/plat/packet_inlines.h | 11 +++++-- .../include/odp/api/plat/packet_types.h | 2 -- .../include/odp/api/plat/pool_types.h | 13 +++++++++ .../linux-generic/include/odp_buffer_internal.h | 10 ------- platform/linux-generic/include/odp_packet_dpdk.h | 16 +++++----- .../linux-generic/include/odp_packet_internal.h | 2 +- .../linux-generic/include/odp_packet_io_internal.h | 1 + platform/linux-generic/include/odp_packet_netmap.h | 1 - platform/linux-generic/include/odp_pool_internal.h | 1 + platform/linux-generic/odp_buffer.c | 5 ++-- platform/linux-generic/odp_packet.c | 34 ++++++++++++---------- platform/linux-generic/odp_pool.c | 18 +++++++----- platform/linux-generic/pktio/dpdk.c | 8 ++--- platform/linux-generic/pktio/netmap.c | 12 ++++---- 15 files changed, 78 insertions(+), 60 deletions(-)
hooks/post-receive