diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2016-02-05 12:30:47 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-02-08 20:45:25 +0300 |
commit | 661ae7529c3b2ac6778e0a3755d408e793fa6f78 (patch) | |
tree | b5ed77d060af16d14a9a1239e44275b9752b7360 /platform | |
parent | 04152dd4839c1a7d6020828f5d9839cf9d5c38e1 (diff) |
api: pktio: rename single_user param
Renamed single_user pktio queue parameters to op_mode with
enumeration type. This is in line with event queue enq_ and
deq_mode parameters which are defined for the same purpose.
Also term "single" gives wrong impression since application
may use multiple threads but must itself synchronize those.
This enables op_mode extensions in the future (e.g. dedicated
single thread mode).
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linux-generic/odp_packet_io.c | 2 | ||||
-rw-r--r-- | platform/linux-generic/pktio/netmap.c | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 7bb2ca92b..a3ceec820 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -874,11 +874,13 @@ void odp_pktio_param_init(odp_pktio_param_t *params) void odp_pktin_queue_param_init(odp_pktin_queue_param_t *param) { memset(param, 0, sizeof(odp_pktin_queue_param_t)); + param->op_mode = ODP_PKTIO_OP_MT; } void odp_pktout_queue_param_init(odp_pktout_queue_param_t *param) { memset(param, 0, sizeof(odp_pktout_queue_param_t)); + param->op_mode = ODP_PKTIO_OP_MT; } void odp_pktio_print(odp_pktio_t id) diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index a875783e0..97fb6c3bc 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -130,14 +130,14 @@ static int netmap_input_queues_config(pktio_entry_t *pktio_entry, pkt_netmap_t *pkt_nm = &pktio_entry->s.pkt_nm; odp_pktin_mode_t mode = pktio_entry->s.param.in_mode; unsigned num_queues = p->num_queues; - odp_bool_t single_user; + odp_bool_t lockless; /* Scheduler synchronizes input queue polls. Only single thread * at a time polls a queue */ if (mode == ODP_PKTIN_MODE_SCHED) - single_user = 1; + lockless = 1; else - single_user = p->single_user; + lockless = (p->op_mode == ODP_PKTIO_OP_MT_UNSAFE); if (p->hash_enable && num_queues > 1) { if (rss_conf_set_fd(pktio_entry->s.pkt_nm.sockfd, @@ -147,7 +147,7 @@ static int netmap_input_queues_config(pktio_entry_t *pktio_entry, } } - pkt_nm->lockless_rx = single_user; + pkt_nm->lockless_rx = lockless; return 0; } @@ -157,7 +157,7 @@ static int netmap_output_queues_config(pktio_entry_t *pktio_entry, { pkt_netmap_t *pkt_nm = &pktio_entry->s.pkt_nm; - pkt_nm->lockless_tx = p->single_user; + pkt_nm->lockless_tx = (p->op_mode == ODP_PKTIO_OP_MT_UNSAFE); return 0; } |