examples/ipsec-secgw: remove duplicated if check
PATCH 1/2 examples/ipsec-secgw: remove duplicated if check
The two if check does the same task, so removing one.
Coverity Issue: 355669
Fixes 9ad50c29d01d ("examples/ipsec-secgw: add app mode worker")
Signed-off-by Ankur Dwivedi <[email protected]>
--- examples/ipsec-secgw/ipsec_worker.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
examples/ipsec-secgw/ipsec_worker.c +1 -6
@@ -112,12 +112,7 @@rte_acl_classify ((struct rte_acl_ctx *)sp, &nlp, &res,1 ,DEFAULT_MAX_CATEGORIES ); -if (unlikely (res ==0 )) { -/* No match */ -return 0 ; - } - -if (res ==DISCARD ) +if (unlikely (res ==DISCARD ))return 0 ;else if (res ==BYPASS ) { *sa_idx =-1 ;
Signature · 1 line
1.9.3
PATCH 2/2 examples/ipsec-secgw: check return value of function
The return values of functions are checked before proceeding further.
Coverity Issues: 355670, 355671, 355672, 355673
Fixes ec3cc53f5a66 ("examples/ipsec-secgw: support internal ports for events"
Signed-off-by Ankur Dwivedi <[email protected]>
--- examples/ipsec-secgw/event_helper.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-)
examples/ipsec-secgw/event_helper.c +24 -6
@@ -100,12 +100,15 @@ eh_dev_has_rx_internal_port(uint8_t eventdev_id) {bool flag = true; -int j; +int j, ret;RTE_ETH_FOREACH_DEV (j) {uint32_t caps =0 ; -rte_event_eth_rx_adapter_caps_get (eventdev_id, j, &caps); + ret =rte_event_eth_rx_adapter_caps_get (eventdev_id, j, &caps); +if (ret <0 ) +return false; +if (!(caps &RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT )) flag = false; }
@@ -116,12 +119,15 @@ eh_dev_has_tx_internal_port(uint8_t eventdev_id) {bool flag = true; -int j; +int j, ret;RTE_ETH_FOREACH_DEV (j) {uint32_t caps =0 ; -rte_event_eth_tx_adapter_caps_get (eventdev_id, j, &caps); + ret =rte_event_eth_tx_adapter_caps_get (eventdev_id, j, &caps); +if (ret <0 ) +return false; +if (!(caps &RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT )) flag = false; }
@@ -323,6 +329,7 @@int nb_eth_dev;int adapter_id;int conn_id; +int ret;int i;/* Create one adapter with eth queues mapped to event queue(s) */
@@ -385,7 +392,12 @@ conn->ethdev_rx_qid =-1 ;/* Get Rx adapter capabilities */ -rte_event_eth_rx_adapter_caps_get (eventdev_id, i, &caps); + ret =rte_event_eth_rx_adapter_caps_get (eventdev_id, i, &caps); +if (ret <0 ) { +EH_LOG_ERR ("Failed to get event device %d eth rx adapter" +" capabilities for port %d" , eventdev_id, i); +return ret; + }if (!(caps &RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT )) rx_internal_port = false;
@@ -420,6 +432,7 @@int adapter_id;int nb_eth_dev;int conn_id; +int ret;int i;/*
@@ -479,7 +492,12 @@ conn->ethdev_tx_qid =-1 ;/* Get Tx adapter capabilities */ -rte_event_eth_tx_adapter_caps_get (eventdev_id, i, &caps); + ret =rte_event_eth_tx_adapter_caps_get (eventdev_id, i, &caps); +if (ret <0 ) { +EH_LOG_ERR ("Failed to get event device %d eth tx adapter" +" capabilities for port %d" , eventdev_id, i); +return ret; + }if (!(caps &RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT )) tx_internal_port = false;
Signature · 1 line
1.9.3
Re: [dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: check return value of function
Quoted 7 lines
The return values of functions are checked before proceeding further.
Coverity Issues: 355670, 355671, 355672, 355673
Fixes ec3cc53f5a66 ("examples/ipsec-secgw: support internal ports for events"Signed-off-by Ankur Dwivedi <[email protected]>
Acked-by Anoob Joseph <[email protected]>
Quoted 11 lines
The two if check does the same task, so removing one.
Coverity Issue: 355669
Fixes 9ad50c29d01d ("examples/ipsec-secgw: add app mode worker")Signed-off-by Ankur Dwivedi <[email protected]>--- examples/ipsec-secgw/ipsec_worker.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
Acked-by Anoob Joseph <[email protected]>
Quoted 6 lines
Quoted 6 lines
The two if check does the same task, so removing one.
Coverity Issue: 355669
Fixes 9ad50c29d01d ("examples/ipsec-secgw: add app mode worker")
Quoted 8 lines
Quoted 5 lines
Signed-off-by Ankur Dwivedi <[email protected]>--- examples/ipsec-secgw/ipsec_worker.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)Acked-by Anoob Joseph <[email protected]>
Series
Acked-by Akhil Goyal <[email protected]>
Applied to dpdk-next-crypto
Thanks.