Skip to contentSkip to conversation

net/idpf: avoid truncation of constant value

PATCH Applied Praveen Shetty 4 participants 5 messages Apr 9, 2025 – Apr 28, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/idpf: avoid truncation of constant value

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.

---
 drivers/net/intel/idpf/base/virtchnl2.h | 2 --
 1 file changed, 2 deletions(-)
drivers/net/intel/idpf/base/virtchnl2.h +0 -2
index 3285a2b674..cf010c0504 100644
@@ -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),
 };
 
 /**
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Praveen Shetty

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.

Quoted 11 lines
---
 drivers/net/intel/idpf/base/virtchnl2.h | 2 --
 1 file changed, 2 deletions(-)
drivers/net/intel/idpf/base/virtchnl2.h +0 -0
index 3285a2b674..cf010c0504 100644

drivers/net/intel/idpf/base/virtchnl2.h enum virtchnl2_cap_other { · line 269

Quoted 7 lines
drivers/net/intel/idpf/base/virtchnl2.h +0 -2
@@ -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.

[1] https://patches.dpdk.org/project/dpdk/patch/[email protected]/

#2 lore raw
Quoted 33 lines · Bruce Richardson
Quoted 5 lines · Praveen Shetty

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.

Quoted 11 lines
---
 drivers/net/intel/idpf/base/virtchnl2.h | 2 --
 1 file changed, 2 deletions(-)
drivers/net/intel/idpf/base/virtchnl2.h +0 -0
index 3285a2b674..cf010c0504 100644

drivers/net/intel/idpf/base/virtchnl2.h enum virtchnl2_cap_other { · line 269

Quoted 7 lines
drivers/net/intel/idpf/base/virtchnl2.h +0 -2
@@ -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.

Quoted 4 lines

[1] https://patches.dpdk.org/project/dpdk/patch/[email protected]/

LGTM.
I marked Andre patch as rejected.

Signature · 1 line
David Marchand
#3 lore raw
Quoted 35 lines · David Marchand
Quoted 33 lines · Bruce Richardson
Quoted 5 lines · Praveen Shetty

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.

Quoted 11 lines
---
 drivers/net/intel/idpf/base/virtchnl2.h | 2 --
 1 file changed, 2 deletions(-)
drivers/net/intel/idpf/base/virtchnl2.h +0 -0
index 3285a2b674..cf010c0504 100644

drivers/net/intel/idpf/base/virtchnl2.h enum virtchnl2_cap_other { · line 269

Quoted 7 lines
drivers/net/intel/idpf/base/virtchnl2.h +0 -2
@@ -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.

Quoted 8 lines
Quoted 4 lines

[1] https://patches.dpdk.org/project/dpdk/patch/[email protected]/

LGTM.
I marked Andre patch as rejected.

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

Quoted 3 lines
Signature · 2 lines
-- 
David Marchand
#4 lore raw
Quoted 39 lines · Andre Muezerie
Quoted 38 lines · David Marchand
Quoted 36 lines · Bruce Richardson
Quoted 5 lines · Praveen Shetty

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.

Quoted 11 lines
---
 drivers/net/intel/idpf/base/virtchnl2.h | 2 --
 1 file changed, 2 deletions(-)
drivers/net/intel/idpf/base/virtchnl2.h +0 -0
index 3285a2b674..cf010c0504 100644

drivers/net/intel/idpf/base/virtchnl2.h enum virtchnl2_cap_other { · line 269

Quoted 7 lines
drivers/net/intel/idpf/base/virtchnl2.h +0 -2
@@ -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.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

[1] https://patches.dpdk.org/project/dpdk/patch/[email protected]/

LGTM.
I marked Andre patch as rejected.

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

Applied to dpdk-next-net-intel.

thanks,
/Bruce