Skip to content

Commit

Permalink
net/null: remove redundant check
Browse files Browse the repository at this point in the history
[ upstream commit c21a276 ]

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: c743e50 ("null: new poll mode driver")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
  • Loading branch information
Ferruh Yigit authored and kevintraynor committed May 27, 2020
1 parent 1142c2f commit 4fcd772
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions drivers/net/null/rte_eth_null.c
Expand Up @@ -639,23 +639,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, "
Expand Down

0 comments on commit 4fcd772

Please sign in to comment.