[v3] examples/tep_term: remove redundant info get

Message ID 20200217014115.26572-1-xiaoyun.li@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [v3] examples/tep_term: remove redundant info get |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed
ci/Intel-compilation fail apply issues

Commit Message

Li, Xiaoyun Feb. 17, 2020, 1:41 a.m. UTC
  Removed redundant function call of 'rte_eth_dev_info_get()' since it has
already been called earlier.

Coverity issue: 349922
Fixes: 2bb43bd4350a ("examples/tep_term: add TSO offload configuration")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
 examples/tep_termination/vxlan_setup.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

David Marchand Feb. 20, 2020, 3:53 p.m. UTC | #1
On Mon, Feb 17, 2020 at 2:41 AM Xiaoyun Li <xiaoyun.li@intel.com> wrote:
>
> Removed redundant function call of 'rte_eth_dev_info_get()' since it has
> already been called earlier.
>
> Coverity issue: 349922
> Fixes: 2bb43bd4350a ("examples/tep_term: add TSO offload configuration")
> Cc: stable@dpdk.org
>
> Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>

LGTM.
Xiaolong, you had reviewed it before, can you have a look?
Thanks.
  
Xiaolong Ye Feb. 21, 2020, 1:19 a.m. UTC | #2
On 02/20, David Marchand wrote:
>On Mon, Feb 17, 2020 at 2:41 AM Xiaoyun Li <xiaoyun.li@intel.com> wrote:
>>
>> Removed redundant function call of 'rte_eth_dev_info_get()' since it has
>> already been called earlier.
>>
>> Coverity issue: 349922
>> Fixes: 2bb43bd4350a ("examples/tep_term: add TSO offload configuration")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
>
>LGTM.
>Xiaolong, you had reviewed it before, can you have a look?
>Thanks.
>
>-- 
>David Marchand
>

LGTM.

Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
  
David Marchand Feb. 21, 2020, 10:13 a.m. UTC | #3
On Mon, Feb 17, 2020 at 2:41 AM Xiaoyun Li <xiaoyun.li@intel.com> wrote:
>
> Removed redundant function call of 'rte_eth_dev_info_get()' since it has
> already been called earlier.
>
> Coverity issue: 349922
> Fixes: 2bb43bd4350a ("examples/tep_term: add TSO offload configuration")
> Cc: stable@dpdk.org
>
> Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>

Little comment, this patch solves a coverity issue.

Upon inspection of this example code, I can see no check on device
capability when sending packets.
So I suppose it is broken when user asks for TSO, but the devices do
not support TSO.
Can you investigate and fix this in the next release?


Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.

--
David Marchand
  

Patch

diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index eca119a72..4b44ccc14 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -194,8 +194,6 @@  vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 			ports_eth_addr[port].addr_bytes[5]);
 
 	if (tso_segsz != 0) {
-		struct rte_eth_dev_info dev_info;
-		rte_eth_dev_info_get(port, &dev_info);
 		if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) == 0)
 			RTE_LOG(WARNING, PORT,
 				"hardware TSO offload is not supported\n");