diff mbox

[RFC,4/8] api: packet_io: added odp_pktio_param_t

Message ID A400FC85CF2669428A5A081F01B94F531DA1D414@DEMUMBX012.nsn-intra.net
State New
Headers show

Commit Message

Savolainen, Petri (Nokia - FI/Espoo) March 31, 2015, 6:48 a.m. UTC
From: ext Bill Fischofer [mailto:bill.fischofer@linaro.org]

Sent: Monday, March 30, 2015 11:49 PM
To: Savolainen, Petri (Nokia - FI/Espoo)
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [RFC 4/8] api: packet_io: added odp_pktio_param_t



On Mon, Mar 30, 2015 at 12:23 PM, Petri Savolainen <petri.savolainen@nokia.com<mailto:petri.savolainen@nokia.com>> wrote:
Packet IO interface level parameters are needed e.g. to
select input mode. User must select and use one input mode
(sched, poll or recv) per pktio interface.

Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com<mailto:petri.savolainen@nokia.com>>

---
 example/generator/odp_generator.c                  |  6 +++-
 example/ipsec/odp_ipsec.c                          | 11 +++++-
 example/l2fwd/odp_l2fwd.c                          | 10 +++++-
 example/packet/odp_pktio.c                         | 19 +++++++++-
 include/odp/api/packet_io.h                        | 28 ++++++++++++++-
 .../linux-generic/include/odp_packet_io_internal.h |  1 +
 platform/linux-generic/odp_packet_io.c             | 10 ++++--
 .../classification/odp_classification_tests.c      |  6 +++-
 test/validation/odp_pktio.c                        | 41 +++++++++++++++-------
 9 files changed, 111 insertions(+), 21 deletions(-)




index 61af855..6f638c6 100644
diff mbox

Patch

--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -122,9 +122,26 @@  static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool, int mode)
        odp_queue_param_t qparam;
        char inq_name[ODP_QUEUE_NAME_LEN];
        int ret;
+       odp_pktio_param_t pktio_param;
+
+       memset(&pktio_param, 0, sizeof(pktio_param));
+
+       switch (mode) {
+       case  APPL_MODE_PKT_BURST:
+               pktio_param.in_mode = ODP_PKTIN_MODE_RECV;
+               break;
+       case APPL_MODE_PKT_QUEUE:
+               pktio_param.in_mode = ODP_PKTIN_MODE_POLL;
+               break;
+       case APPL_MODE_PKT_SCHED:
+               pktio_param.in_mode = ODP_PKTIN_MODE_SCHED;
+               break;
+       default:
+               EXAMPLE_ABORT("invalid mode %d\n", mode);
+       }

Since you're standardizing terms in this patch series, why not APPL_MODE_PKT_RECV to pair with ODP_PKTIN_MODE_RECV, etc.?  Having BURST ==> RECV and QUEUE ==> POLL seems non-intuitive.

APPL_MODE_XXX is what the application have used for mode selection. It would topic of another patch to change the application structure. This patch just updates the API.

-Petri