[v1] net/idpf: avoid truncation of constant value

Message ID 20250409125440.7103-1-praveen.shetty@intel.com (mailing list archive)
State New
Delegated to: Bruce Richardson
Headers
Series [v1] net/idpf: avoid truncation of constant value |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS

Commit Message

Praveen Shetty April 9, 2025, 12:54 p.m. UTC
Truncation of constant value compiler warning was reported in clang/msvc
compiler for the VIRTCHNL2_CAP_OEM bit setting.This is due to 64 bit number
is initialized in a 32 bit enum.VIRTCHNL2_CAP_OEM capability is not used in
the present dpdk code,so removing this bit setting from the dpdk to avoid
the truncation.

Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
---
 drivers/net/intel/idpf/base/virtchnl2.h | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Bruce Richardson April 9, 2025, 2:27 p.m. UTC | #1
On Wed, Apr 09, 2025 at 12:54:40PM +0000, Praveen Shetty wrote:
> Truncation of constant value compiler warning was reported in clang/msvc
> compiler for the VIRTCHNL2_CAP_OEM bit setting.This is due to 64 bit number
> is initialized in a 32 bit enum.VIRTCHNL2_CAP_OEM capability is not used in
> the present dpdk code,so removing this bit setting from the dpdk to avoid
> the truncation.

Please just watch spacing after punctuation in commit message. Will fix on
apply as necessary, no need for new revision to fix it.

> 
> Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
> ---
>  drivers/net/intel/idpf/base/virtchnl2.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/intel/idpf/base/virtchnl2.h b/drivers/net/intel/idpf/base/virtchnl2.h
> index 3285a2b674..cf010c0504 100644
> --- a/drivers/net/intel/idpf/base/virtchnl2.h
> +++ b/drivers/net/intel/idpf/base/virtchnl2.h
> @@ -265,8 +265,6 @@ enum virtchnl2_cap_other {
>  	 * if a reserved bit is set in a standard completion's tag.
>  	 */
>  	VIRTCHNL2_CAP_MISS_COMPL_TAG		= BIT_ULL(20),
> -	/* This must be the last capability */
> -	VIRTCHNL2_CAP_OEM			= BIT_ULL(63),
>  };
>  

Although technically perhaps not as good as [1], this avoids significant
divergence from the shared base code, while still fixing the core issue.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>


[1] https://patches.dpdk.org/project/dpdk/patch/1734537913-1159-1-git-send-email-andremue@linux.microsoft.com/
  
David Marchand April 11, 2025, 6:52 a.m. UTC | #2
On Wed, Apr 9, 2025 at 4:27 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Wed, Apr 09, 2025 at 12:54:40PM +0000, Praveen Shetty wrote:
> > Truncation of constant value compiler warning was reported in clang/msvc
> > compiler for the VIRTCHNL2_CAP_OEM bit setting.This is due to 64 bit number
> > is initialized in a 32 bit enum.VIRTCHNL2_CAP_OEM capability is not used in
> > the present dpdk code,so removing this bit setting from the dpdk to avoid
> > the truncation.
>
> Please just watch spacing after punctuation in commit message. Will fix on
> apply as necessary, no need for new revision to fix it.
>
> >
> > Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
> > ---
> >  drivers/net/intel/idpf/base/virtchnl2.h | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/net/intel/idpf/base/virtchnl2.h b/drivers/net/intel/idpf/base/virtchnl2.h
> > index 3285a2b674..cf010c0504 100644
> > --- a/drivers/net/intel/idpf/base/virtchnl2.h
> > +++ b/drivers/net/intel/idpf/base/virtchnl2.h
> > @@ -265,8 +265,6 @@ enum virtchnl2_cap_other {
> >        * if a reserved bit is set in a standard completion's tag.
> >        */
> >       VIRTCHNL2_CAP_MISS_COMPL_TAG            = BIT_ULL(20),
> > -     /* This must be the last capability */
> > -     VIRTCHNL2_CAP_OEM                       = BIT_ULL(63),
> >  };
> >
>
> Although technically perhaps not as good as [1], this avoids significant
> divergence from the shared base code, while still fixing the core issue.
>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>
>
> [1] https://patches.dpdk.org/project/dpdk/patch/1734537913-1159-1-git-send-email-andremue@linux.microsoft.com/

LGTM.
I marked Andre patch as rejected.
  
Andre Muezerie April 11, 2025, 1:51 p.m. UTC | #3
On Fri, Apr 11, 2025 at 08:52:12AM +0200, David Marchand wrote:
> On Wed, Apr 9, 2025 at 4:27 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Wed, Apr 09, 2025 at 12:54:40PM +0000, Praveen Shetty wrote:
> > > Truncation of constant value compiler warning was reported in clang/msvc
> > > compiler for the VIRTCHNL2_CAP_OEM bit setting.This is due to 64 bit number
> > > is initialized in a 32 bit enum.VIRTCHNL2_CAP_OEM capability is not used in
> > > the present dpdk code,so removing this bit setting from the dpdk to avoid
> > > the truncation.
> >
> > Please just watch spacing after punctuation in commit message. Will fix on
> > apply as necessary, no need for new revision to fix it.
> >
> > >
> > > Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
> > > ---
> > >  drivers/net/intel/idpf/base/virtchnl2.h | 2 --
> > >  1 file changed, 2 deletions(-)
> > >
> > > diff --git a/drivers/net/intel/idpf/base/virtchnl2.h b/drivers/net/intel/idpf/base/virtchnl2.h
> > > index 3285a2b674..cf010c0504 100644
> > > --- a/drivers/net/intel/idpf/base/virtchnl2.h
> > > +++ b/drivers/net/intel/idpf/base/virtchnl2.h
> > > @@ -265,8 +265,6 @@ enum virtchnl2_cap_other {
> > >        * if a reserved bit is set in a standard completion's tag.
> > >        */
> > >       VIRTCHNL2_CAP_MISS_COMPL_TAG            = BIT_ULL(20),
> > > -     /* This must be the last capability */
> > > -     VIRTCHNL2_CAP_OEM                       = BIT_ULL(63),
> > >  };
> > >
> >
> > Although technically perhaps not as good as [1], this avoids significant
> > divergence from the shared base code, while still fixing the core issue.
> >
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> >
> >
> > [1] https://patches.dpdk.org/project/dpdk/patch/1734537913-1159-1-git-send-email-andremue@linux.microsoft.com/
> 
> LGTM.
> I marked Andre patch as rejected.
> 

I'm good with that. My main goal is to get this code to compile with MSVC.

> 
> -- 
> David Marchand
  

Patch

diff --git a/drivers/net/intel/idpf/base/virtchnl2.h b/drivers/net/intel/idpf/base/virtchnl2.h
index 3285a2b674..cf010c0504 100644
--- a/drivers/net/intel/idpf/base/virtchnl2.h
+++ b/drivers/net/intel/idpf/base/virtchnl2.h
@@ -265,8 +265,6 @@  enum virtchnl2_cap_other {
 	 * if a reserved bit is set in a standard completion's tag.
 	 */
 	VIRTCHNL2_CAP_MISS_COMPL_TAG		= BIT_ULL(20),
-	/* This must be the last capability */
-	VIRTCHNL2_CAP_OEM			= BIT_ULL(63),
 };
 
 /**