DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [PATCH] net/cpfl: fix a compiler issue about virtchnl opcode
  2023-03-09 10:31 [PATCH] net/cpfl: fix a compiler issue about virtchnl opcode Mingxia Liu
@ 2023-03-09  2:41 ` Stephen Hemminger
  2023-03-09  3:03   ` Liu, Mingxia
  2023-03-09 10:38 ` [PATCH v2] " Mingxia Liu
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2023-03-09  2:41 UTC (permalink / raw)
  To: Mingxia Liu; +Cc: dev, beilei.xing, yuying.zhang

On Thu,  9 Mar 2023 10:31:42 +0000
Mingxia Liu <mingxia.liu@intel.com> wrote:

> iff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
> index db58157ba3..59883af8a8 100644
> --- a/drivers/net/idpf/idpf_ethdev.c
> +++ b/drivers/net/idpf/idpf_ethdev.c
> @@ -1058,8 +1058,8 @@ idpf_handle_virtchnl_msg(struct idpf_adapter_ext *adapter_ex)
>  	struct idpf_ctlq_msg ctlq_msg;
>  	enum idpf_mbx_opc mbx_op;
>  	struct idpf_vport *vport;
> -	enum virtchnl_ops vc_op;
>  	uint16_t pending = 1;
> +	enum virtchnl_ops vc_op;
>  	int ret;
>  
>  	while (pending) {


Why does order of declarations matter here?
Compilers are free to reorder this.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] net/cpfl: fix a compiler issue about virtchnl opcode
  2023-03-09  2:41 ` Stephen Hemminger
@ 2023-03-09  3:03   ` Liu, Mingxia
  0 siblings, 0 replies; 5+ messages in thread
From: Liu, Mingxia @ 2023-03-09  3:03 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, Xing, Beilei, Zhang, Yuying



> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Thursday, March 9, 2023 10:42 AM
> To: Liu, Mingxia <mingxia.liu@intel.com>
> Cc: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Yuying
> <yuying.zhang@intel.com>
> Subject: Re: [PATCH] net/cpfl: fix a compiler issue about virtchnl opcode
> 
> On Thu,  9 Mar 2023 10:31:42 +0000
> Mingxia Liu <mingxia.liu@intel.com> wrote:
> 
> > iff --git a/drivers/net/idpf/idpf_ethdev.c
> > b/drivers/net/idpf/idpf_ethdev.c index db58157ba3..59883af8a8 100644
> > --- a/drivers/net/idpf/idpf_ethdev.c
> > +++ b/drivers/net/idpf/idpf_ethdev.c
> > @@ -1058,8 +1058,8 @@ idpf_handle_virtchnl_msg(struct idpf_adapter_ext
> *adapter_ex)
> >  	struct idpf_ctlq_msg ctlq_msg;
> >  	enum idpf_mbx_opc mbx_op;
> >  	struct idpf_vport *vport;
> > -	enum virtchnl_ops vc_op;
> >  	uint16_t pending = 1;
> > +	enum virtchnl_ops vc_op;
> >  	int ret;
> >
> >  	while (pending) {
> 
> 
> Why does order of declarations matter here?
> Compilers are free to reorder this.
[Liu, Mingxia] Unused changes, v2 was sent.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] net/cpfl: fix a compiler issue about virtchnl opcode
@ 2023-03-09 10:31 Mingxia Liu
  2023-03-09  2:41 ` Stephen Hemminger
  2023-03-09 10:38 ` [PATCH v2] " Mingxia Liu
  0 siblings, 2 replies; 5+ messages in thread
From: Mingxia Liu @ 2023-03-09 10:31 UTC (permalink / raw)
  To: dev, beilei.xing, yuying.zhang; +Cc: Mingxia Liu

Comparing an enum virtchnl_ops variable with VIRTCHNL2_OP_EVENT
will cause a compiler issue, as VIRTCHNL2_OP_EVENT is not included
in enum virtchnl_ops. And the PMD uses virtual msg opcodes prefixed
with virtchnl2 or VIRTCHNL2.

Fixes: 20618563b81b ("net/cpfl: support device initialization")

Signed-off-by: Mingxia Liu <mingxia.liu@intel.com>
---
 drivers/net/cpfl/cpfl_ethdev.c | 2 +-
 drivers/net/idpf/idpf_ethdev.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
index 0940bf1276..54261d5743 100644
--- a/drivers/net/cpfl/cpfl_ethdev.c
+++ b/drivers/net/cpfl/cpfl_ethdev.c
@@ -1095,8 +1095,8 @@ cpfl_handle_virtchnl_msg(struct cpfl_adapter_ext *adapter)
 	struct idpf_ctlq_msg ctlq_msg;
 	enum idpf_mbx_opc mbx_op;
 	struct idpf_vport *vport;
-	enum virtchnl_ops vc_op;
 	uint16_t pending = 1;
+	uint32_t vc_op;
 	int ret;
 
 	while (pending) {
diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index db58157ba3..59883af8a8 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -1058,8 +1058,8 @@ idpf_handle_virtchnl_msg(struct idpf_adapter_ext *adapter_ex)
 	struct idpf_ctlq_msg ctlq_msg;
 	enum idpf_mbx_opc mbx_op;
 	struct idpf_vport *vport;
-	enum virtchnl_ops vc_op;
 	uint16_t pending = 1;
+	enum virtchnl_ops vc_op;
 	int ret;
 
 	while (pending) {
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] net/cpfl: fix a compiler issue about virtchnl opcode
  2023-03-09 10:31 [PATCH] net/cpfl: fix a compiler issue about virtchnl opcode Mingxia Liu
  2023-03-09  2:41 ` Stephen Hemminger
@ 2023-03-09 10:38 ` Mingxia Liu
  2023-03-09 12:10   ` Ferruh Yigit
  1 sibling, 1 reply; 5+ messages in thread
From: Mingxia Liu @ 2023-03-09 10:38 UTC (permalink / raw)
  To: dev, beilei.xing, yuying.zhang; +Cc: Mingxia Liu

Comparing an enum virtchnl_ops variable with VIRTCHNL2_OP_EVENT
will cause a compiler issue, as VIRTCHNL2_OP_EVENT is not included
in enum virtchnl_ops. And the PMD uses virtual msg opcodes prefixed
with virtchnl2 or VIRTCHNL2.

Fixes: 20618563b81b ("net/cpfl: support device initialization")

Signed-off-by: Mingxia Liu <mingxia.liu@intel.com>
---
 drivers/net/cpfl/cpfl_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
index 0940bf1276..54261d5743 100644
--- a/drivers/net/cpfl/cpfl_ethdev.c
+++ b/drivers/net/cpfl/cpfl_ethdev.c
@@ -1095,8 +1095,8 @@ cpfl_handle_virtchnl_msg(struct cpfl_adapter_ext *adapter)
 	struct idpf_ctlq_msg ctlq_msg;
 	enum idpf_mbx_opc mbx_op;
 	struct idpf_vport *vport;
-	enum virtchnl_ops vc_op;
 	uint16_t pending = 1;
+	uint32_t vc_op;
 	int ret;
 
 	while (pending) {
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] net/cpfl: fix a compiler issue about virtchnl opcode
  2023-03-09 10:38 ` [PATCH v2] " Mingxia Liu
@ 2023-03-09 12:10   ` Ferruh Yigit
  0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2023-03-09 12:10 UTC (permalink / raw)
  To: Mingxia Liu, beilei.xing, yuying.zhang; +Cc: dev

On 3/9/2023 10:38 AM, Mingxia Liu wrote:
> Comparing an enum virtchnl_ops variable with VIRTCHNL2_OP_EVENT
> will cause a compiler issue, as VIRTCHNL2_OP_EVENT is not included
> in enum virtchnl_ops. And the PMD uses virtual msg opcodes prefixed
> with virtchnl2 or VIRTCHNL2.
> 
> Fixes: 20618563b81b ("net/cpfl: support device initialization")
> 

Fixes: 2d823ecd671c ("net/cpfl: support device initialization")

> Signed-off-by: Mingxia Liu <mingxia.liu@intel.com>

Reported-by: Raslan Darawsheh <rasland@nvidia.com>

Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-09 12:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 10:31 [PATCH] net/cpfl: fix a compiler issue about virtchnl opcode Mingxia Liu
2023-03-09  2:41 ` Stephen Hemminger
2023-03-09  3:03   ` Liu, Mingxia
2023-03-09 10:38 ` [PATCH v2] " Mingxia Liu
2023-03-09 12:10   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).