summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMarcin Zapolski <marcinx.a.zapolski@intel.com>2019-07-17 09:58:06 +0200
committerThomas Monjalon <thomas@monjalon.net>2019-07-18 23:05:13 +0200
commit0109baf1964ca047646d49708263b2f6cbd63571 (patch)
tree33a350c9b21712cf2859e2fa7f273e72a3fb8023 /examples
parent5c5c1f99a923986b5b2d2d34e874ca14ffabbcb0 (diff)
downloaddpdk-0109baf1964ca047646d49708263b2f6cbd63571.zip
dpdk-0109baf1964ca047646d49708263b2f6cbd63571.tar.gz
dpdk-0109baf1964ca047646d49708263b2f6cbd63571.tar.xz
examples/ipsec-secgw: fix use of ethdev internal struct
Modify ipsec-secgw example app to use rte_eth_dev_info_get instead of rte_eth_dev. Apps should not be using internal DPDK data structures directly. Fixes: a4677f78368b ("examples/ipsec-secgw: add target queues in flow actions") Cc: stable@dpdk.org Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com> Reviewed-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/ipsec-secgw/ipsec.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index d1cbdc3..f8fc49b 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -189,23 +189,22 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa)
.rss_key = rss_key,
.rss_key_len = 40,
};
- struct rte_eth_dev *eth_dev;
+ struct rte_eth_dev_info dev_info;
uint16_t queue[RTE_MAX_QUEUES_PER_PORT];
struct rte_flow_action_rss action_rss;
unsigned int i;
unsigned int j;
+ rte_eth_dev_info_get(sa->portid, &dev_info);
sa->action[2].type = RTE_FLOW_ACTION_TYPE_END;
/* Try RSS. */
sa->action[1].type = RTE_FLOW_ACTION_TYPE_RSS;
sa->action[1].conf = &action_rss;
- eth_dev = ctx->device;
rte_eth_dev_rss_hash_conf_get(sa->portid,
&rss_conf);
for (i = 0, j = 0;
- i < eth_dev->data->nb_rx_queues; ++i)
- if (eth_dev->data->rx_queues[i])
- queue[j++] = i;
+ i < dev_info.nb_rx_queues; ++i)
+ queue[j++] = i;
action_rss = (struct rte_flow_action_rss){
.types = rss_conf.rss_hf,
.key_len = rss_conf.rss_key_len,