net/qede: remove dead code

Message ID dc8bd60d5cca2b5ecf6c175745282224f3cc244f.1594984397.git.wangyunjian@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series net/qede: remove dead code |

Checks

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

Commit Message

Yunjian Wang July 17, 2020, 11:16 a.m. UTC
  From: Yunjian Wang <wangyunjian@huawei.com>

This patch fixes (Logically dead code) coverity issue.

Coverity issue: 261777, 261778
Fixes: dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/qede/qede_rxtx.c | 4 ----
 1 file changed, 4 deletions(-)
  

Comments

Jerin Jacob July 21, 2020, 12:12 p.m. UTC | #1
On Fri, Jul 17, 2020 at 4:47 PM wangyunjian <wangyunjian@huawei.com> wrote:
>
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> This patch fixes (Logically dead code) coverity issue.
>
> Coverity issue: 261777, 261778
> Fixes: dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")
> Cc: stable@dpdk.org

@Rasesh Mody
Could you Ack this change to merge it?


> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>  drivers/net/qede/qede_rxtx.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
> index 9878ba50e..ea264f59d 100644
> --- a/drivers/net/qede/qede_rxtx.c
> +++ b/drivers/net/qede/qede_rxtx.c
> @@ -647,8 +647,6 @@ int qede_alloc_fp_resc(struct qede_dev *qdev)
>
>         for (sb_idx = 0; sb_idx < QEDE_RXTX_MAX(qdev); sb_idx++) {
>                 fp = &qdev->fp_array[sb_idx];
> -               if (!fp)
> -                       continue;
>                 fp->sb_info = rte_calloc("sb", 1, sizeof(struct ecore_sb_info),
>                                 RTE_CACHE_LINE_SIZE);
>                 if (!fp->sb_info) {
> @@ -678,8 +676,6 @@ void qede_dealloc_fp_resc(struct rte_eth_dev *eth_dev)
>
>         for (sb_idx = 0; sb_idx < QEDE_RXTX_MAX(qdev); sb_idx++) {
>                 fp = &qdev->fp_array[sb_idx];
> -               if (!fp)
> -                       continue;
>                 DP_INFO(edev, "Free sb_info index 0x%x\n",
>                                 fp->sb_info->igu_sb_id);
>                 if (fp->sb_info) {
> --
> 2.23.0
>
>
  
Rasesh Mody July 21, 2020, 9:43 p.m. UTC | #2
>From: wangyunjian <wangyunjian@huawei.com>
>Sent: Friday, July 17, 2020 4:16 AM
>
>From: Yunjian Wang <wangyunjian@huawei.com>
>
>This patch fixes (Logically dead code) coverity issue.
>
>Coverity issue: 261777, 261778
>Fixes: dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")
>Cc: stable@dpdk.org
>
>Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
>---

Acked-by: Rasesh Mody <rmody@marvell.com>

Thanks!
  
Jerin Jacob July 22, 2020, 7:45 a.m. UTC | #3
On Wed, Jul 22, 2020 at 3:14 AM Rasesh Mody <rmody@marvell.com> wrote:
>
> >From: wangyunjian <wangyunjian@huawei.com>
> >Sent: Friday, July 17, 2020 4:16 AM
> >
> >From: Yunjian Wang <wangyunjian@huawei.com>
> >
> >This patch fixes (Logically dead code) coverity issue.
> >
> >Coverity issue: 261777, 261778
> >Fixes: dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")
> >Cc: stable@dpdk.org
> >
> >Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> >---
>
> Acked-by: Rasesh Mody <rmody@marvell.com>

There is build issue reported with this patch by CI for qede. Please
check it is valid or not
http://mails.dpdk.org/archives/test-report/2020-July/145267.html

>
> Thanks!
>
  
Yunjian Wang July 22, 2020, 12:15 p.m. UTC | #4
> -----Original Message-----
> From: Jerin Jacob [mailto:jerinjacobk@gmail.com]
> Sent: Wednesday, July 22, 2020 3:45 PM
> To: Rasesh Mody <rmody@marvell.com>
> Cc: wangyunjian <wangyunjian@huawei.com>; dev@dpdk.org; Shahed Shaikh
> <shshaikh@marvell.com>; Lilijun (Jerry) <jerry.lilijun@huawei.com>; xudingke
> <xudingke@huawei.com>; stable@dpdk.org
> Subject: Re: [EXT] [dpdk-dev] [PATCH] net/qede: remove dead code
> 
> On Wed, Jul 22, 2020 at 3:14 AM Rasesh Mody <rmody@marvell.com> wrote:
> >
> > >From: wangyunjian <wangyunjian@huawei.com>
> > >Sent: Friday, July 17, 2020 4:16 AM
> > >
> > >From: Yunjian Wang <wangyunjian@huawei.com>
> > >
> > >This patch fixes (Logically dead code) coverity issue.
> > >
> > >Coverity issue: 261777, 261778
> > >Fixes: dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")
> > >Cc: stable@dpdk.org
> > >
> > >Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > >---
> >
> > Acked-by: Rasesh Mody <rmody@marvell.com>
> 
> There is build issue reported with this patch by CI for qede. Please check it is
> valid or not http://mails.dpdk.org/archives/test-report/2020-July/145267.html

I've already checked. I don't know the reason why the codes on both sides are different.

The origin code:
fprintf(stderr,"Can not write all of dump data bytes=%zd len=%zd\n",

The CI code:
fprintf(stderr, "Can not write all of dump data bytes=%ld len=%ld\n",

> 
> >
> > Thanks!
> >
  
Ferruh Yigit July 22, 2020, 12:29 p.m. UTC | #5
On 7/22/2020 1:15 PM, wangyunjian wrote:
>> -----Original Message-----
>> From: Jerin Jacob [mailto:jerinjacobk@gmail.com]
>> Sent: Wednesday, July 22, 2020 3:45 PM
>> To: Rasesh Mody <rmody@marvell.com>
>> Cc: wangyunjian <wangyunjian@huawei.com>; dev@dpdk.org; Shahed Shaikh
>> <shshaikh@marvell.com>; Lilijun (Jerry) <jerry.lilijun@huawei.com>; xudingke
>> <xudingke@huawei.com>; stable@dpdk.org
>> Subject: Re: [EXT] [dpdk-dev] [PATCH] net/qede: remove dead code
>>
>> On Wed, Jul 22, 2020 at 3:14 AM Rasesh Mody <rmody@marvell.com> wrote:
>>>
>>>> From: wangyunjian <wangyunjian@huawei.com>
>>>> Sent: Friday, July 17, 2020 4:16 AM
>>>>
>>>> From: Yunjian Wang <wangyunjian@huawei.com>
>>>>
>>>> This patch fixes (Logically dead code) coverity issue.
>>>>
>>>> Coverity issue: 261777, 261778
>>>> Fixes: dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")
>>>> Cc: stable@dpdk.org
>>>>
>>>> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
>>>> ---
>>>
>>> Acked-by: Rasesh Mody <rmody@marvell.com>
>>
>> There is build issue reported with this patch by CI for qede. Please check it is
>> valid or not http://mails.dpdk.org/archives/test-report/2020-July/145267.html
> 
> I've already checked. I don't know the reason why the codes on both sides are different.
> 
> The origin code:
> fprintf(stderr,"Can not write all of dump data bytes=%zd len=%zd\n",
> 
> The CI code:
> fprintf(stderr, "Can not write all of dump data bytes=%ld len=%ld\n",
> 

CI run is on top of the 'mrvl' tree (DPDK git baseline:
Repo:dpdk-next-net-mrvl), and above part may be fixed while pulling to the
'next-net'.

Anyway the latest code looks good (for above change), also the error is
unrelated to your patch. So a false positive for this patch.
  
Jerin Jacob July 24, 2020, 4:23 a.m. UTC | #6
On Wed, Jul 22, 2020 at 3:14 AM Rasesh Mody <rmody@marvell.com> wrote:
>
> >From: wangyunjian <wangyunjian@huawei.com>
> >Sent: Friday, July 17, 2020 4:16 AM
> >
> >From: Yunjian Wang <wangyunjian@huawei.com>
> >
> >This patch fixes (Logically dead code) coverity issue.
> >
> >Coverity issue: 261777, 261778
> >Fixes: dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")
> >Cc: stable@dpdk.org
> >
> >Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> >---
>
> Acked-by: Rasesh Mody <rmody@marvell.com>

Applied to dpdk-next-net-mrvl/master. Thanks



>
> Thanks!
>
  

Patch

diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 9878ba50e..ea264f59d 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -647,8 +647,6 @@  int qede_alloc_fp_resc(struct qede_dev *qdev)
 
 	for (sb_idx = 0; sb_idx < QEDE_RXTX_MAX(qdev); sb_idx++) {
 		fp = &qdev->fp_array[sb_idx];
-		if (!fp)
-			continue;
 		fp->sb_info = rte_calloc("sb", 1, sizeof(struct ecore_sb_info),
 				RTE_CACHE_LINE_SIZE);
 		if (!fp->sb_info) {
@@ -678,8 +676,6 @@  void qede_dealloc_fp_resc(struct rte_eth_dev *eth_dev)
 
 	for (sb_idx = 0; sb_idx < QEDE_RXTX_MAX(qdev); sb_idx++) {
 		fp = &qdev->fp_array[sb_idx];
-		if (!fp)
-			continue;
 		DP_INFO(edev, "Free sb_info index 0x%x\n",
 				fp->sb_info->igu_sb_id);
 		if (fp->sb_info) {