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, api-next has been updated via bdb7cbf620ada8682c89b5ae5a97cb84f16c0ed0 (commit) via e4b4bab2247e7724fb4b5983e54fd62676f1d206 (commit) via 22441cdcb569d5c6147db5d67e62fde67a3daad5 (commit) via 2ae5d875aab20e728c231361af95e1c57336daa5 (commit) via c370d7950524a968bbc148644f7c5fc619c78600 (commit) via 28a3b9e30fb4e8784a8781e06e28d3f175e05749 (commit) from ad990bbf88d95b2a4f9583b7fda718bf5d7d4212 (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 bdb7cbf620ada8682c89b5ae5a97cb84f16c0ed0 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Nov 16 15:07:42 2017 +0200
api: pktio: clean up doxygen tags
Remove [in] from @param tags as by default parameters are input only.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Balasubramanian Manoharan bala.manoharan@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index a9a39a64..60d13043 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -954,8 +954,8 @@ uint32_t ODP_DEPRECATE(odp_pktio_mtu)(odp_pktio_t pktio); /** * Enable/Disable promiscuous mode on a packet IO interface. * - * @param[in] pktio Packet IO handle. - * @param[in] enable 1 to enable, 0 to disable. + * @param pktio Packet IO handle. + * @param enable 1 to enable, 0 to disable. * * @retval 0 on success * @retval <0 on failure @@ -965,7 +965,7 @@ int odp_pktio_promisc_mode_set(odp_pktio_t pktio, odp_bool_t enable); /** * Determine if promiscuous mode is enabled for a packet IO interface. * - * @param[in] pktio Packet IO handle. + * @param pktio Packet IO handle. * * @retval 1 if promiscuous mode is enabled. * @retval 0 if promiscuous mode is disabled. @@ -1034,14 +1034,13 @@ int odp_pktio_mac_addr_set(odp_pktio_t pktio, const void *mac_addr, /** * Setup per-port default class-of-service. * - * @param[in] pktio Ingress port pktio handle. - * @param[in] default_cos Class-of-service set to all packets arriving - * at this ingress port, - * unless overridden by subsequent - * header-based filters. + * @param pktio Ingress port pktio handle. + * @param default_cos Class-of-service set to all packets arriving at this + * ingress port, unless overridden by subsequent + * header-based filters. * - * @retval 0 on success - * @retval <0 on failure + * @retval 0 on success + * @retval <0 on failure * * @note The default_cos has to be unique per odp_pktio_t instance. */ @@ -1050,12 +1049,12 @@ int odp_pktio_default_cos_set(odp_pktio_t pktio, odp_cos_t default_cos); /** * Setup per-port error class-of-service * - * @param[in] pktio Ingress port pktio handle. - * @param[in] error_cos class-of-service set to all packets arriving - * at this ingress port that contain an error. + * @param pktio Ingress port pktio handle. + * @param error_cos class-of-service set to all packets arriving at this + * ingress port that contain an error. * - * @retval 0 on success - * @retval <0 on failure + * @retval 0 on success + * @retval <0 on failure * * @note Optional. */ @@ -1064,24 +1063,23 @@ int odp_pktio_error_cos_set(odp_pktio_t pktio, odp_cos_t error_cos); /** * Setup per-port header offset * - * @param[in] pktio Ingress port pktio handle. - * @param[in] offset Number of bytes the classifier must skip. + * @param pktio Ingress port pktio handle. + * @param offset Number of bytes the classifier must skip. * - * @retval 0 on success - * @retval <0 on failure - * @note Optional. + * @retval 0 on success + * @retval <0 on failure * + * @note Optional. */ int odp_pktio_skip_set(odp_pktio_t pktio, uint32_t offset);
/** * Specify per-port buffer headroom * - * @param[in] pktio Ingress port pktio handle. - * @param[in] headroom Number of bytes of space preceding - * packet data to reserve for use as headroom. - * Must not exceed the implementation - * defined ODP_PACKET_MAX_HEADROOM. + * @param pktio Ingress port pktio handle. + * @param headroom Number of bytes of space preceding packet data to reserve + * for use as headroom. Must not exceed the implementation + * defined ODP_PACKET_MAX_HEADROOM. * * @retval 0 on success * @retval <0 on failure
commit e4b4bab2247e7724fb4b5983e54fd62676f1d206 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Nov 16 14:25:10 2017 +0200
linux-gen: dpdk: fix maximum frame length value
Returns maximum ethernet frame size instead of maximum IP packet MTU.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Balasubramanian Manoharan bala.manoharan@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index ccccc0a8..d0a238aa 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -842,6 +842,13 @@ static uint32_t dpdk_mtu_get(pktio_entry_t *pktio_entry) return mtu; }
+static uint32_t dpdk_frame_maxlen(pktio_entry_t *pktio_entry) +{ + pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk; + + return pkt_dpdk->mtu; +} + static int dpdk_vdev_promisc_mode_get(uint8_t port_id) { struct rte_eth_dev_info dev_info; @@ -1654,7 +1661,7 @@ const pktio_if_ops_t dpdk_pktio_ops = { .recv = dpdk_recv, .send = dpdk_send, .link_status = dpdk_link_status, - .mtu_get = dpdk_mtu_get, + .mtu_get = dpdk_frame_maxlen, .promisc_mode_set = dpdk_promisc_mode_set, .promisc_mode_get = dpdk_promisc_mode_get, .mac_get = dpdk_mac_addr_get,
commit 22441cdcb569d5c6147db5d67e62fde67a3daad5 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Nov 16 14:23:08 2017 +0200
test: l2fwd: add verbose option
Added verbose command line option. When enabled, pktio interface details are printed after open. This can be used for debugging interface configuration.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Balasubramanian Manoharan bala.manoharan@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 42d8f49a..2daf0e2d 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -108,6 +108,7 @@ typedef struct { int error_check; /**< Check packet errors */ int sched_mode; /**< Scheduler mode */ int num_groups; /**< Number of scheduling groups */ + int verbose; /**< Verbose output */ } appl_args_t;
static int exit_threads; /**< Break workers loop if set to 1 */ @@ -697,6 +698,9 @@ static int create_pktio(const char *dev, int idx, int num_rx, int num_tx, printf("created pktio %" PRIu64 ", dev: %s, drv: %s\n", odp_pktio_to_u64(pktio), dev, info.drv_name);
+ if (gbl_args->appl.verbose) + odp_pktio_print(pktio); + if (odp_pktio_capability(pktio, &capa)) { LOG_ERR("Error: capability query failed %s\n", dev); return -1; @@ -1163,11 +1167,12 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) {"src_change", required_argument, NULL, 's'}, {"error_check", required_argument, NULL, 'e'}, {"groups", required_argument, NULL, 'g'}, + {"verbose", no_argument, NULL, 'v'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} };
- static const char *shortopts = "+c:+t:+a:i:m:o:r:d:s:e:g:h"; + static const char *shortopts = "+c:+t:+a:i:m:o:r:d:s:e:g:vh";
/* let helper collect its own arguments (e.g. --odph_proc) */ odph_parse_options(argc, argv, shortopts, longopts); @@ -1178,6 +1183,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) appl_args->src_change = 1; /* change eth src address by default */ appl_args->num_groups = 0; /* use default group */ appl_args->error_check = 0; /* don't check packet errors by default */ + appl_args->verbose = 0;
opterr = 0; /* do not issue errors on helper options */
@@ -1305,6 +1311,9 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) case 'g': appl_args->num_groups = atoi(optarg); break; + case 'v': + appl_args->verbose = 1; + break; case 'h': usage(argv[0]); exit(EXIT_SUCCESS);
commit 2ae5d875aab20e728c231361af95e1c57336daa5 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Nov 16 13:53:10 2017 +0200
api: pktio: deprecate odp_pktio_mtu
MTU is not a well defined term for link layer maximum receive and transmit frame sizes. Use odp_pktin_maxlen() and odp_pktout_maxlen() instead.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Balasubramanian Manoharan bala.manoharan@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index b09c9cfc..a9a39a64 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -30,7 +30,7 @@ extern "C" { * * Packet IO is the Ingress and Egress interface to ODP processing. It * allows manipulation of the interface for setting such attributes as - * the mtu, mac etc. + * number of queues, MAC address etc. * Pktio is usually followed by the classifier and a default class COS * can be set so that the scheduler may distribute flows. The interface * may be used directly in polled mode with odp_pktin_recv() and @@ -938,14 +938,18 @@ int odp_pktout_send(odp_pktout_queue_t queue, const odp_packet_t packets[], int num);
/** - * Return the currently configured MTU value of a packet IO interface. + * MTU value of a packet IO interface * - * @param[in] pktio Packet IO handle. + * @deprecated Use odp_pktin_maxlen() and odp_pktout_maxlen() instead. MTU was + * not well defined. There may be difference between MTU and maximum frame + * length values. + * + * @param pktio Packet IO handle. * * @return MTU value on success * @retval 0 on failure */ -uint32_t odp_pktio_mtu(odp_pktio_t pktio); +uint32_t ODP_DEPRECATE(odp_pktio_mtu)(odp_pktio_t pktio);
/** * Enable/Disable promiscuous mode on a packet IO interface. diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index cf65e723..aa6cdb06 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -803,7 +803,7 @@ static inline uint32_t pktio_mtu(odp_pktio_t hdl) return ret; }
-uint32_t odp_pktio_mtu(odp_pktio_t pktio) +uint32_t ODP_DEPRECATE(odp_pktio_mtu)(odp_pktio_t pktio) { return pktio_mtu(pktio); } diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c index 004379cd..39451de3 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio/pktio.c @@ -617,13 +617,13 @@ static void pktio_txrx_multi(pktio_info_t *pktio_a, pktio_info_t *pktio_b,
if (packet_len == USE_MTU) { odp_pool_capability_t pool_capa; - uint32_t mtu; + uint32_t maxlen;
- mtu = odp_pktio_mtu(pktio_a->id); - if (odp_pktio_mtu(pktio_b->id) < mtu) - mtu = odp_pktio_mtu(pktio_b->id); - CU_ASSERT_FATAL(mtu > 0); - packet_len = mtu; + maxlen = odp_pktout_maxlen(pktio_a->id); + if (odp_pktout_maxlen(pktio_b->id) < maxlen) + maxlen = odp_pktout_maxlen(pktio_b->id); + CU_ASSERT_FATAL(maxlen > 0); + packet_len = maxlen; if (packet_len > PKT_LEN_MAX) packet_len = PKT_LEN_MAX;
@@ -1026,16 +1026,21 @@ void pktio_test_recv_mtu(void) void pktio_test_mtu(void) { int ret; - uint32_t mtu; + uint32_t maxlen;
odp_pktio_t pktio = create_pktio(0, ODP_PKTIN_MODE_SCHED, ODP_PKTOUT_MODE_DIRECT); CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID);
- mtu = odp_pktio_mtu(pktio); - CU_ASSERT(mtu > 0); + maxlen = odp_pktout_maxlen(pktio); + CU_ASSERT(maxlen > 0);
- printf(" %" PRIu32 " ", mtu); + printf(" %" PRIu32 " ", maxlen); + + maxlen = odp_pktin_maxlen(pktio); + CU_ASSERT(maxlen > 0); + + printf(" %" PRIu32 " ", maxlen);
ret = odp_pktio_close(pktio); CU_ASSERT(ret == 0); @@ -1706,14 +1711,14 @@ void pktio_test_start_stop(void)
/* * This is a pre-condition check that the pktio_test_send_failure() - * test case can be run. If the TX interface MTU is larger that the + * test case can be run. If the TX interface max frame len is larger that the * biggest packet we can allocate then the test won't be able to - * attempt to send packets larger than the MTU, so skip the test. + * attempt to send packets larger than the max len, so skip the test. */ int pktio_check_send_failure(void) { odp_pktio_t pktio_tx; - uint32_t mtu; + uint32_t maxlen; odp_pktio_param_t pktio_param; int iface_idx = 0; const char *iface = iface_name[iface_idx]; @@ -1734,14 +1739,14 @@ int pktio_check_send_failure(void) return ODP_TEST_INACTIVE; }
- /* read the MTU from the transmit interface */ - mtu = odp_pktio_mtu(pktio_tx); + /* read the maxlen from the transmit interface */ + maxlen = odp_pktout_maxlen(pktio_tx);
odp_pktio_close(pktio_tx);
/* Failure test supports only single segment */ if (pool_capa.pkt.max_seg_len && - pool_capa.pkt.max_seg_len < mtu + 32) + pool_capa.pkt.max_seg_len < maxlen + 32) return ODP_TEST_INACTIVE;
return ODP_TEST_ACTIVE; @@ -1753,7 +1758,7 @@ void pktio_test_send_failure(void) odp_packet_t pkt_tbl[TX_BATCH_LEN]; uint32_t pkt_seq[TX_BATCH_LEN]; int ret, i, alloc_pkts; - uint32_t mtu; + uint32_t maxlen; odp_pool_param_t pool_params; odp_pool_t pkt_pool; int long_pkt_idx = TX_BATCH_LEN / 2; @@ -1770,8 +1775,8 @@ void pktio_test_send_failure(void)
CU_ASSERT_FATAL(odp_pktout_queue(pktio_tx, &pktout, 1) == 1);
- /* read the MTU from the transmit interface */ - mtu = odp_pktio_mtu(pktio_tx); + /* read maxlen from the transmit interface */ + maxlen = odp_pktout_maxlen(pktio_tx);
ret = odp_pktio_start(pktio_tx); CU_ASSERT_FATAL(ret == 0); @@ -1781,15 +1786,15 @@ void pktio_test_send_failure(void) CU_ASSERT_FATAL(odp_pool_capability(&pool_capa) == 0);
if (pool_capa.pkt.max_seg_len && - pool_capa.pkt.max_seg_len < mtu + 32) { + pool_capa.pkt.max_seg_len < maxlen + 32) { CU_FAIL("Max packet seg length is too small."); return; }
/* configure the pool so that we can generate test packets larger - * than the interface MTU */ + * than the interface max transmit length */ odp_pool_param_init(&pool_params); - pool_params.pkt.len = mtu + 32; + pool_params.pkt.len = maxlen + 32; pool_params.pkt.seg_len = pool_params.pkt.len; pool_params.pkt.num = TX_BATCH_LEN + 1; pool_params.type = ODP_POOL_PACKET;
commit c370d7950524a968bbc148644f7c5fc619c78600 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Nov 16 10:56:34 2017 +0200
linux-gen: pktio: implement frame length
Use mtu to implement frame length functions. Various packet IO devices mtu functions need to be still updated to return correct frame length values.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Balasubramanian Manoharan bala.manoharan@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 5f7da263..cf65e723 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -777,7 +777,7 @@ void sched_cb_pktio_stop_finalize(int pktio_index) unlock_entry(entry); }
-uint32_t odp_pktio_mtu(odp_pktio_t hdl) +static inline uint32_t pktio_mtu(odp_pktio_t hdl) { pktio_entry_t *entry; uint32_t ret = 0; @@ -803,6 +803,21 @@ uint32_t odp_pktio_mtu(odp_pktio_t hdl) return ret; }
+uint32_t odp_pktio_mtu(odp_pktio_t pktio) +{ + return pktio_mtu(pktio); +} + +uint32_t odp_pktin_maxlen(odp_pktio_t pktio) +{ + return pktio_mtu(pktio); +} + +uint32_t odp_pktout_maxlen(odp_pktio_t pktio) +{ + return pktio_mtu(pktio); +} + int odp_pktio_promisc_mode_set(odp_pktio_t hdl, odp_bool_t enable) { pktio_entry_t *entry; @@ -1089,8 +1104,11 @@ void odp_pktio_print(odp_pktio_t hdl) " mac %02x:%02x:%02x:%02x:%02x:%02x\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); len += snprintf(&str[len], n - len, - " mtu %" PRIu32 "\n", - odp_pktio_mtu(hdl)); + " pktin maxlen %" PRIu32 "\n", + odp_pktin_maxlen(hdl)); + len += snprintf(&str[len], n - len, + " pktout maxlen %" PRIu32 "\n", + odp_pktout_maxlen(hdl)); len += snprintf(&str[len], n - len, " promisc %s\n", odp_pktio_promisc_mode(hdl) ? "yes" : "no");
commit 28a3b9e30fb4e8784a8781e06e28d3f175e05749 Author: Petri Savolainen petri.savolainen@linaro.org Date: Wed Nov 15 17:19:33 2017 +0200
api: pktio: add max frame length
Added functions to request maximum packet input and output frame lengths.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Balasubramanian Manoharan bala.manoharan@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 6e4f8810..b09c9cfc 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -969,6 +969,36 @@ int odp_pktio_promisc_mode_set(odp_pktio_t pktio, odp_bool_t enable); */ int odp_pktio_promisc_mode(odp_pktio_t pktio);
+/** + * Maximum frame length at packet input + * + * Maximum frame length in bytes that the packet IO interface can receive. + * For Ethernet, the frame length bytes start with MAC addresses and continue + * to the end of the payload. So, Ethernet checksum, interpacket gap + * and preamble bytes are excluded from the length. + * + * @param pktio Packet IO handle. + * + * @return Maximum frame length at packet input + * @retval 0 on failure + */ +uint32_t odp_pktin_maxlen(odp_pktio_t pktio); + +/** + * Maximum frame length at packet output + * + * Maximum frame length in bytes that the packet IO interface can transmit. + * For Ethernet, the frame length bytes start with MAC addresses and continue + * to the end of the payload. So, Ethernet checksum, interpacket gap + * and preamble bytes are excluded from the length. + * + * @param pktio Packet IO handle. + * + * @return Maximum frame length at packet output + * @retval 0 on failure + */ +uint32_t odp_pktout_maxlen(odp_pktio_t pktio); + /** * Get the default MAC address of a packet IO interface. *
-----------------------------------------------------------------------
Summary of changes: include/odp/api/spec/packet_io.h | 90 +++++++++++++++++++++++----------- platform/linux-generic/odp_packet_io.c | 24 +++++++-- platform/linux-generic/pktio/dpdk.c | 9 +++- test/performance/odp_l2fwd.c | 11 ++++- test/validation/api/pktio/pktio.c | 49 +++++++++--------- 5 files changed, 127 insertions(+), 56 deletions(-)
hooks/post-receive