diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2015-05-05 16:11:37 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-05-08 13:54:25 +0300 |
commit | 7c7c3b8ccf1c79b1a42c1724e4d95ebc35f031a8 (patch) | |
tree | 8dd571602b1e36fa9a2a1359c1a2dd3de70d1101 /include/odp/api/packet_io.h | |
parent | a6dfe67827467412eb3f3bd2ddf4a59cd406e084 (diff) |
api: packet_io: added odp_pktio_param_t
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>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include/odp/api/packet_io.h')
-rw-r--r-- | include/odp/api/packet_io.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index fa6c2ea1a..4712fc323 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -44,17 +44,42 @@ extern "C" { * Actual MAC address sizes may be different. */ + +/** + * Packet input mode + */ +enum odp_pktio_input_mode { + /** Application polls packet input directly with odp_pktio_recv() */ + ODP_PKTIN_MODE_RECV = 0, + /** Packet input through scheduled queues */ + ODP_PKTIN_MODE_SCHED, + /** Application polls packet input queues */ + ODP_PKTIN_MODE_POLL +}; + +/** + * Packet IO parameters + * + * In minimum, user must select the input mode. Use 0 for defaults. Initialize + * entire struct with zero to maintain API compatibility. + */ +typedef struct odp_pktio_param_t { + /** Packet input mode */ + enum odp_pktio_input_mode in_mode; +} odp_pktio_param_t; + /** * Open a packet IO interface * * An ODP program can open a single packet IO interface per device, attempts * to open an already open device will fail, returning ODP_PKTIO_INVALID with * errno set. Use odp_pktio_lookup() to obtain a handle to an already open - * device. + * device. Packet IO parameters provide interface level configuration options. * * @param dev Packet IO device name * @param pool Default pool from which to allocate buffers for storing packets * received over this packet IO + * @param param Packet IO parameters * * @return Packet IO handle * @retval ODP_PKTIO_INVALID on failure @@ -70,7 +95,8 @@ extern "C" { * here is applicable only for those packets that are not assigned to a * more specific CoS. */ -odp_pktio_t odp_pktio_open(const char *dev, odp_pool_t pool); +odp_pktio_t odp_pktio_open(const char *dev, odp_pool_t pool, + const odp_pktio_param_t *param); /** * Close a packet IO interface |