app/testpmd: fix build without drivers

Message ID 20220225152653.72437-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: fix build without drivers |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Functional fail Functional Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Thomas Monjalon Feb. 25, 2022, 3:26 p.m. UTC
  When ixgbe and bnxt are disabled, compilation was failing:

app/test-pmd/cmdline.c:9396:11: error:
	variable 'vf_rxmode' set but not used

Fixes: 4cfe399f6550 ("net/bnxt: support to set VF rxmode")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test-pmd/cmdline.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Bruce Richardson Feb. 25, 2022, 3:50 p.m. UTC | #1
On Fri, Feb 25, 2022 at 04:26:53PM +0100, Thomas Monjalon wrote:
> When ixgbe and bnxt are disabled, compilation was failing:
> 
> app/test-pmd/cmdline.c:9396:11: error:
> 	variable 'vf_rxmode' set but not used
> 
> Fixes: 4cfe399f6550 ("net/bnxt: support to set VF rxmode")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  app/test-pmd/cmdline.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index b4ba8da2b0..7ab0575e64 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -9409,6 +9409,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
>  	}
>  
>  	RTE_SET_USED(is_on);
> +	RTE_SET_USED(vf_rxmode);
>  
Checking the code, I see the issue and the fix looks correct. However,
doing some basic builds disabling the relevant drivers, and all drivers, in
fact, I fail to reproduce the actual error message. Does this error only
occur at lower optimization levels, or only using clang or similar?

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Thomas Monjalon Feb. 25, 2022, 4:44 p.m. UTC | #2
25/02/2022 16:50, Bruce Richardson:
> On Fri, Feb 25, 2022 at 04:26:53PM +0100, Thomas Monjalon wrote:
> > When ixgbe and bnxt are disabled, compilation was failing:
> > 
> > app/test-pmd/cmdline.c:9396:11: error:
> > 	variable 'vf_rxmode' set but not used
> > 
> > Fixes: 4cfe399f6550 ("net/bnxt: support to set VF rxmode")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> >  app/test-pmd/cmdline.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> > index b4ba8da2b0..7ab0575e64 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -9409,6 +9409,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
> >  	}
> >  
> >  	RTE_SET_USED(is_on);
> > +	RTE_SET_USED(vf_rxmode);
> >  
> Checking the code, I see the issue and the fix looks correct. However,
> doing some basic builds disabling the relevant drivers, and all drivers, in
> fact, I fail to reproduce the actual error message. Does this error only
> occur at lower optimization levels, or only using clang or similar?

I don't remember, probably clang only.
  
Ajit Khaparde Feb. 25, 2022, 4:53 p.m. UTC | #3
On Fri, Feb 25, 2022 at 7:50 AM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Fri, Feb 25, 2022 at 04:26:53PM +0100, Thomas Monjalon wrote:
> > When ixgbe and bnxt are disabled, compilation was failing:
> >
> > app/test-pmd/cmdline.c:9396:11: error:
> >       variable 'vf_rxmode' set but not used
> >
> > Fixes: 4cfe399f6550 ("net/bnxt: support to set VF rxmode")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> >  app/test-pmd/cmdline.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> > index b4ba8da2b0..7ab0575e64 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -9409,6 +9409,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
> >       }
> >
> >       RTE_SET_USED(is_on);
> > +     RTE_SET_USED(vf_rxmode);
> >
> Checking the code, I see the issue and the fix looks correct. However,
> doing some basic builds disabling the relevant drivers, and all drivers, in
> fact, I fail to reproduce the actual error message. Does this error only
> occur at lower optimization levels, or only using clang or similar?
>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Thanks

Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  
Ferruh Yigit Feb. 25, 2022, 5:33 p.m. UTC | #4
On 2/25/2022 4:53 PM, Ajit Khaparde wrote:
> On Fri, Feb 25, 2022 at 7:50 AM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
>>
>> On Fri, Feb 25, 2022 at 04:26:53PM +0100, Thomas Monjalon wrote:
>>> When ixgbe and bnxt are disabled, compilation was failing:
>>>
>>> app/test-pmd/cmdline.c:9396:11: error:
>>>        variable 'vf_rxmode' set but not used
>>>
>>> Fixes: 4cfe399f6550 ("net/bnxt: support to set VF rxmode")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>>> ---
>>>   app/test-pmd/cmdline.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
>>> index b4ba8da2b0..7ab0575e64 100644
>>> --- a/app/test-pmd/cmdline.c
>>> +++ b/app/test-pmd/cmdline.c
>>> @@ -9409,6 +9409,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
>>>        }
>>>
>>>        RTE_SET_USED(is_on);
>>> +     RTE_SET_USED(vf_rxmode);
>>>
>> Checking the code, I see the issue and the fix looks correct. However,
>> doing some basic builds disabling the relevant drivers, and all drivers, in
>> fact, I fail to reproduce the actual error message. Does this error only
>> occur at lower optimization levels, or only using clang or similar?
>>
>> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Thanks
> 
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

Able to reproduce with clang.

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b4ba8da2b0..7ab0575e64 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -9409,6 +9409,7 @@  cmd_set_vf_rxmode_parsed(void *parsed_result,
 	}
 
 	RTE_SET_USED(is_on);
+	RTE_SET_USED(vf_rxmode);
 
 #ifdef RTE_NET_IXGBE
 	if (ret == -ENOTSUP)