DPDK patches and discussions
 help / color / mirror / Atom feed
From: Marcin Zapolski <marcinx.a.zapolski@intel.com>
To: dev@dpdk.org
Cc: Marcin Zapolski <marcinx.a.zapolski@intel.com>
Subject: [dpdk-dev] [PATCH 3/3] examples/ipsec-secgw: remove usage of internal structure
Date: Mon, 15 Jul 2019 11:56:23 +0200	[thread overview]
Message-ID: <20190715095623.579-4-marcinx.a.zapolski@intel.com> (raw)
In-Reply-To: <20190715095623.579-1-marcinx.a.zapolski@intel.com>

Modify ipsec-secgw example app to use rte_eth_dev_info_get instead of
rte_eth_dev.

Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
---
 examples/ipsec-secgw/ipsec.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index 7b8533077..7d3f5f736 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -186,23 +186,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,
-- 
2.17.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.


  parent reply	other threads:[~2019-07-15 13:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15  9:56 [dpdk-dev] [PATCH 0/3] examples: remove usage of internal structures Marcin Zapolski
2019-07-15  9:56 ` [dpdk-dev] [PATCH 1/3] examples/l3fwd*: remove references to rte_eth_devices Marcin Zapolski
2019-07-15 15:03   ` Bruce Richardson
2019-07-15  9:56 ` [dpdk-dev] [PATCH 2/3] examples/ip_fragmentation: remove usage of internal struct Marcin Zapolski
2019-07-15 14:39   ` Bruce Richardson
2019-07-15 14:45     ` Bruce Richardson
2019-07-15  9:56 ` Marcin Zapolski [this message]
2019-07-15 14:51   ` [dpdk-dev] [PATCH 3/3] examples/ipsec-secgw: remove usage of internal structure Bruce Richardson
2019-07-17  7:58 ` [dpdk-dev] [v2 0/3] examples: fix use of internal struct Marcin Zapolski
2019-07-17  7:58   ` [dpdk-dev] [v2 1/3] examples/l3fwd*: " Marcin Zapolski
2019-07-17  7:58   ` [dpdk-dev] [v2 2/3] examples/ip_fragmentation: " Marcin Zapolski
2019-07-17  7:58   ` [dpdk-dev] [v2 3/3] examples/ipsec-secgw: " Marcin Zapolski
2019-07-18 20:42   ` [dpdk-dev] [v2 0/3] examples: " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190715095623.579-4-marcinx.a.zapolski@intel.com \
    --to=marcinx.a.zapolski@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).