DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org, Tetsuya Mukawa <mtetsuyah@gmail.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>,
	stable@dpdk.org, mukawa@igel.co.jp
Subject: [dpdk-dev] [PATCH 3/6] net/null: remove redundant check
Date: Mon,  2 Mar 2020 17:36:42 +0000	[thread overview]
Message-ID: <20200302173646.54984-3-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20200302173646.54984-1-ferruh.yigit@intel.com>

There is no need to check if the argument exist or not,
`rte_kvargs_process` returns success if the argument is not provided at
all.

Fixes: c743e50c475f ("null: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: mukawa@igel.co.jp
---
 drivers/net/null/rte_eth_null.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 87a29b853..beedd5f4b 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -610,23 +610,18 @@ rte_pmd_null_probe(struct rte_vdev_device *dev)
 		if (kvlist == NULL)
 			return -1;
 
-		if (rte_kvargs_count(kvlist, ETH_NULL_PACKET_SIZE_ARG) == 1) {
-
-			ret = rte_kvargs_process(kvlist,
-					ETH_NULL_PACKET_SIZE_ARG,
-					&get_packet_size_arg, &packet_size);
-			if (ret < 0)
-				goto free_kvlist;
-		}
-
-		if (rte_kvargs_count(kvlist, ETH_NULL_PACKET_COPY_ARG) == 1) {
-
-			ret = rte_kvargs_process(kvlist,
-					ETH_NULL_PACKET_COPY_ARG,
-					&get_packet_copy_arg, &packet_copy);
-			if (ret < 0)
-				goto free_kvlist;
-		}
+		ret = rte_kvargs_process(kvlist,
+				ETH_NULL_PACKET_SIZE_ARG,
+				&get_packet_size_arg, &packet_size);
+		if (ret < 0)
+			goto free_kvlist;
+
+
+		ret = rte_kvargs_process(kvlist,
+				ETH_NULL_PACKET_COPY_ARG,
+				&get_packet_copy_arg, &packet_copy);
+		if (ret < 0)
+			goto free_kvlist;
 	}
 
 	PMD_LOG(INFO, "Configure pmd_null: packet size is %d, "
-- 
2.24.1


  parent reply	other threads:[~2020-03-02 17:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02 17:36 [dpdk-dev] [PATCH 1/6] net/null: fix secondary burst function selection Ferruh Yigit
2020-03-02 17:36 ` [dpdk-dev] [PATCH 2/6] doc: add net null PMD guide Ferruh Yigit
2020-03-02 17:36 ` Ferruh Yigit [this message]
2020-03-02 17:36 ` [dpdk-dev] [PATCH 4/6] net/null: prefer unsigned int Ferruh Yigit
2020-03-02 17:36 ` [dpdk-dev] [PATCH 5/6] net/null: group device arguments Ferruh Yigit
2020-03-02 17:36 ` [dpdk-dev] [PATCH 6/6] net/null: add argument for no Rx Ferruh Yigit
2020-04-07  8:38 ` [dpdk-dev] [PATCH 1/6] net/null: fix secondary burst function selection Ferruh Yigit
2020-04-10  8:33   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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=20200302173646.54984-3-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=mtetsuyah@gmail.com \
    --cc=mukawa@igel.co.jp \
    --cc=stable@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).