examples/tep_termination: resolve unchecked return value
PATCH 1/1 examples/tep_termination: resolve unchecked return value
resolve the unchecked return value from the function rte_eth_dev_info_get.
Coverity issue: 349922
--- examples/tep_termination/vxlan_setup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
examples/tep_termination/vxlan_setup.c +6 -1
@@ -195,7 +195,12 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)if (tso_segsz !=0 ) {struct rte_eth_dev_info dev_info; -rte_eth_dev_info_get (port, &dev_info); + retval =rte_eth_dev_info_get (port, &dev_info); +if (retval !=0 ) +rte_exit (EXIT_FAILURE , +"Error during getting device (port %u) info: %s\n" , + port,strerror (-retval)); +if ((dev_info.tx_offload_capa &DEV_TX_OFFLOAD_TCP_TSO ) ==0 )RTE_LOG (WARNING ,PORT ,"hardware TSO offload is not supported\n" );
Signature · 1 line
2.17.1
Hi
The patch is fine. But please polish the commit log first.
You can use expression like "This patch checked the return value of rte_eth_dev_info_get function."
Best Regards,
Xiaoyun Li
Quoted 39 lines
-----Original Message-----
From: T D, Shashank
Sent: Wednesday, November 27, 2019 10:34
To: [email protected]
Cc: Li, Xiaoyun <[email protected]>
Subject: [PATCH] examples/tep_termination: resolve unchecked return valueresolve the unchecked return value from the function
rte_eth_dev_info_get. Coverity issue: 349922Signed-off-by Shashank T D <[email protected]>--- examples/tep_termination/vxlan_setup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)examples/tep_termination/vxlan_setup.c +6
-1@@ -195,7 +195,12 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)if (tso_segsz !=0 ) {struct rte_eth_dev_info dev_info; -rte_eth_dev_info_get (port, &dev_info); + retval =rte_eth_dev_info_get (port, &dev_info); +if (retval !=0 ) +rte_exit (EXIT_FAILURE , +"Error during getting device (port %u) info: %s\n" , + port,strerror (-retval)); + if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO)== 0)
examples/tep_termination/vxlan_setup.c +0
-1RTE_LOG (WARNING ,PORT ,"hardware TSO offload is not supported\n" ); --2.17.1
PATCH v2 1/1 examples/tep_termination: resolve unchecked return value
In reply to Shashank T DThis patch checked the return value of rte_eth_dev_info_get function. Coverity issue: 349922
--- examples/tep_termination/vxlan_setup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
examples/tep_termination/vxlan_setup.c +6 -1
@@ -195,7 +195,12 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)if (tso_segsz !=0 ) {struct rte_eth_dev_info dev_info; -rte_eth_dev_info_get (port, &dev_info); + retval =rte_eth_dev_info_get (port, &dev_info); +if (retval !=0 ) +rte_exit (EXIT_FAILURE , +"Error during getting device (port %u) info: %s\n" , + port,strerror (-retval)); +if ((dev_info.tx_offload_capa &DEV_TX_OFFLOAD_TCP_TSO ) ==0 )RTE_LOG (WARNING ,PORT ,"hardware TSO offload is not supported\n" );
Signature · 1 line
2.17.1
Quoted 38 lines
-----Original Message-----
From: T D, Shashank
Sent: Wednesday, November 27, 2019 12:04
To: [email protected]
Cc: Li, Xiaoyun <[email protected]>
Subject: [PATCH v2] examples/tep_termination: resolve unchecked return valueThis patch checked the return value of
rte_eth_dev_info_getfunction. Coverity issue: 349922Signed-off-by Shashank T D <[email protected]>--- examples/tep_termination/vxlan_setup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)examples/tep_termination/vxlan_setup.c +6
-1@@ -195,7 +195,12 @@ vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)if (tso_segsz !=0 ) {struct rte_eth_dev_info dev_info; -rte_eth_dev_info_get (port, &dev_info); + retval =rte_eth_dev_info_get (port, &dev_info); +if (retval !=0 ) +rte_exit (EXIT_FAILURE , +"Error during getting device (port %u) info: %s\n" , + port,strerror (-retval)); + if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO)== 0)
examples/tep_termination/vxlan_setup.c +0
-1RTE_LOG (WARNING ,PORT ,"hardware TSO offload is not supported\n" ); --
Quoted 1 line
2.17.1