Skip to contentSkip to conversation

net/gve: fix bug in verify driver compatibility

PATCH New Rushil Gupta 3 participants 10 messages Jun 1, 2023 – Jun 2, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/gve: fix bug in verify driver compatibility

gVNIC requires physical address to be passed in the adminq command. This was initially rightly pointed by ferruh.yigit@. Fixed by passing 'driver_info_mem->iova'.

---
 drivers/net/gve/gve_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.c +2 -1
index 2c1e73d07a..1c5ce930a4 100644
@@ -276,7 +276,8 @@ gve_verify_driver_compatibility(struct gve_priv *priv)
 			(char *)driver_info->os_version_str2);
 
 	err = gve_adminq_verify_driver_compatibility(priv,
-		sizeof(struct gve_driver_info), (dma_addr_t)driver_info);
+		sizeof(struct gve_driver_info),
+                (dma_addr_t)driver_info_mem->iova);
 	/* It's ok if the device doesn't support this */
 	if (err == -EOPNOTSUPP)
 		err = 0;
Signature · 1 line
2.41.0.rc2.161.g9c6817b8e7-goog
#1 lore raw

PATCH 1/1 net/gve: fix bug in verify driver compatibility

gVNIC requires physical address to be passed in the adminq command. This was initially rightly pointed by ferruh.yigit@. Fixed by passing 'driver_info_mem->iova'.

---
 drivers/net/gve/gve_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.c +2 -1
index 2c1e73d07a..aa75abe102 100644
@@ -276,7 +276,8 @@ gve_verify_driver_compatibility(struct gve_priv *priv)
 			(char *)driver_info->os_version_str2);
 
 	err = gve_adminq_verify_driver_compatibility(priv,
-		sizeof(struct gve_driver_info), (dma_addr_t)driver_info);
+		sizeof(struct gve_driver_info),
+		(dma_addr_t)driver_info_mem->iova);
 	/* It's ok if the device doesn't support this */
 	if (err == -EOPNOTSUPP)
 		err = 0;
Signature · 1 line
2.41.0.rc2.161.g9c6817b8e7-goog
#2 lore raw
Quoted 10 lines

-----Original Message-----
From: Rushil Gupta <[email protected]>
Sent: Thursday, June 1, 2023 12:50
To: Zhang, Qi Z <[email protected]>; [email protected]
Cc: Guo, Junfeng <[email protected]>; [email protected]; Rushil Gupta <[email protected]>
Subject: [PATCH] net/gve: fix bug in verify driver compatibility

Quoted 3 lines

gVNIC requires physical address to be passed in the adminq command. This was initially rightly pointed by ferruh.yigit@. Fixed by passing 'driver_info_mem->iova'.

For bug fixing, it is required to reference the id of the commit which introduced the bug. You can generate the required lines using the following git alias:
''' git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h (\"%s\")%nCc: %ae'" ''' and then put the output of ''' git fixline <SHA> ''' into the commit message.

And also be CCed to the [email protected] mailing list. Thanks!

Regards,
Junfeng

Quoted 23 lines
---
 drivers/net/gve/gve_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.c +2 -1
index 2c1e73d07a..aa75abe102 100644
@@ -276,7 +276,8 @@ gve_verify_driver_compatibility(struct gve_priv
 *priv)
 			(char *)driver_info->os_version_str2);
 
 	err = gve_adminq_verify_driver_compatibility(priv,
-		sizeof(struct gve_driver_info), (dma_addr_t)driver_info);
+		sizeof(struct gve_driver_info),
+		(dma_addr_t)driver_info_mem->iova);
 	/* It's ok if the device doesn't support this */
 	if (err == -EOPNOTSUPP)

err = 0;
--
2.41.0.rc2.161.g9c6817b8e7-goog

#3 lore raw
Quoted 19 lines · Junfeng
Quoted 10 lines

-----Original Message-----
From: Rushil Gupta <[email protected]>
Sent: Thursday, June 1, 2023 12:50
To: Zhang, Qi Z <[email protected]>; [email protected]
Cc: Guo, Junfeng <[email protected]>; [email protected]; Rushil Gupta <[email protected]>
Subject: [PATCH] net/gve: fix bug in verify driver compatibility

Quoted 3 lines

gVNIC requires physical address to be passed in the adminq command. This was initially rightly pointed by ferruh.yigit@. Fixed by passing 'driver_info_mem->iova'.

For bug fixing, it is required to reference the id of the commit which introduced the bug. You can generate the required lines using the following git alias:
''' git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h (\"%s\")%nCc: %ae'" ''' and then put the output of ''' git fixline <SHA> ''' into the commit message.

Quoted 5 lines

And also be CCed to the [email protected] mailing list. Thanks!

Regards,
Junfeng

Hi Junfeng,

You are right, but for this case patch is not pulled to main repo yet, and change is trivial, so I will fix it in next-net.

#4 lore raw
Quoted 36 lines

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Thursday, June 1, 2023 16:35
To: Guo, Junfeng <[email protected]>; Rushil Gupta <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] net/gve: fix bug in verify driver compatibility

Quoted 7 lines · Junfeng
Quoted 7 lines

-----Original Message-----
From: Rushil Gupta <[email protected]>
Sent: Thursday, June 1, 2023 12:50
To: Zhang, Qi Z <[email protected]>; [email protected]
Cc: Guo, Junfeng <[email protected]>; [email protected]; Rushil

Gupta

Quoted 8 lines
Quoted 6 lines

<[email protected]>
Subject: [PATCH] net/gve: fix bug in verify driver compatibility

gVNIC requires physical address to be passed in the adminq command. This was initially rightly pointed by ferruh.yigit@. Fixed by passing 'driver_info_mem->iova'.

For bug fixing, it is required to reference the id of the commit which

introduced the bug.

Quoted 2 lines

You can generate the required lines using the following git alias:
''' git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h

(\"%s\")%nCc: %ae'" '''

Quoted 1 line

and then put the output of ''' git fixline <SHA> ''' into the commit

message.

Quoted 3 lines

And also be CCed to the [email protected] mailing list. Thanks!

Quoted 8 lines
Quoted 3 lines

Regards,
Junfeng

Hi Junfeng,

You are right, but for this case patch is not pulled to main repo yet, and change is trivial, so I will fix it in next-net.

Sure, thanks for the efforts!

#5 lore raw
In reply to Rushil Gupta
Quoted 14 lines · Rushil Gupta

gVNIC requires physical address to be passed in the adminq command. This was initially rightly pointed by ferruh.yigit@. Fixed by passing 'driver_info_mem->iova'.

---
 drivers/net/gve/gve_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.c +0 -0
index 2c1e73d07a..aa75abe102 100644

drivers/net/gve/gve_ethdev.c gve_verify_driver_compatibility(struct gve_priv *priv) · line 281

Quoted 7 lines
drivers/net/gve/gve_ethdev.c +2 -1
@@ -276,7 +276,8 @@ gve_verify_driver_compatibility(struct gve_priv *priv)
 			(char *)driver_info->os_version_str2);
 
 	err = gve_adminq_verify_driver_compatibility(priv,
-		sizeof(struct gve_driver_info), (dma_addr_t)driver_info);
+		sizeof(struct gve_driver_info),
+		(dma_addr_t)driver_info_mem->iova);
 

Yep, this was my point, let me squashed onto original patch in next-net.

#6 lore raw
Quoted 17 lines · Ferruh Yigit
Quoted 16 lines · Rushil Gupta

gVNIC requires physical address to be passed in the adminq command. This was initially rightly pointed by ferruh.yigit@. Fixed by passing 'driver_info_mem->iova'.

---
 drivers/net/gve/gve_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.c +0 -0
index 2c1e73d07a..aa75abe102 100644
@@ -276,7 +276,8 @@ gve_verify_driver_compatibility(struct gve_priv *priv)
 			(char *)driver_info->os_version_str2);
 
Quoted 9 lines

drivers/net/gve/gve_ethdev.c gve_verify_driver_compatibility(struct gve_priv *priv)

Quoted 5 lines
drivers/net/gve/gve_ethdev.c +2 -1
 	err = gve_adminq_verify_driver_compatibility(priv,
-		sizeof(struct gve_driver_info), (dma_addr_t)driver_info);
+		sizeof(struct gve_driver_info),
+		(dma_addr_t)driver_info_mem->iova);
 

Yep, this was my point, let me squashed onto original patch in next-net.

Squashed into relevant commit in next-net, thanks. Can you please verify latest code in next-net?

#7 lore raw

Thanks for the quick response!
Just for my own knowledge, what Junfeng described is the process to fix the bug if a bug is present in the main dpdk repo?

Quoted 31 lines · Ferruh Yigit
Quoted 17 lines · Ferruh Yigit
Quoted 16 lines · Rushil Gupta

gVNIC requires physical address to be passed in the adminq command. This was initially rightly pointed by ferruh.yigit@. Fixed by passing 'driver_info_mem->iova'.

---
 drivers/net/gve/gve_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.c +0 -0
index 2c1e73d07a..aa75abe102 100644
@@ -276,7 +276,8 @@ gve_verify_driver_compatibility(struct gve_priv *priv)
                     (char *)driver_info->os_version_str2);
 
Quoted 9 lines

drivers/net/gve/gve_ethdev.c gve_verify_driver_compatibility(struct gve_priv *priv)

Quoted 5 lines
drivers/net/gve/gve_ethdev.c +2 -1
     err = gve_adminq_verify_driver_compatibility(priv,
-            sizeof(struct gve_driver_info), (dma_addr_t)driver_info);
+            sizeof(struct gve_driver_info),
+            (dma_addr_t)driver_info_mem->iova);
 

Yep, this was my point, let me squashed onto original patch in next-net.

Squashed into relevant commit in next-net, thanks. Can you please verify latest code in next-net?

#8 lore raw
Quoted 4 lines · Rushil Gupta

Thanks for the quick response!
Just for my own knowledge, what Junfeng described is the process to fix the bug if a bug is present in the main dpdk repo?

Correct.

As main dpdk repo doesn't rewrite git history, any bug there needs to be fixed with an incremental commit, and fix commit should have some metadata to describe what it is fixing (this is to help LTS maintainers and developers tracing down a change).

But sub-trees (like next-net) allowed to rewrite git history, so allowed
to squash/rebase commits when it is more practical to do so as this case.
But changing directly in the git repo has its problems, like tracing, justifying source of the change and missing consensus etc. So, even it is squashed, the patch should be publicly available in the mail list first.

For developers it is best to send incremental patch as if it will be merged as incremental commit, but can request a squash if the commit still not pulled by main repo, or maintainer can prefer to squash the fix to original commit, to reduce the churn & process overhead.

Quoted 32 lines · Ferruh Yigit
Quoted 31 lines · Ferruh Yigit
Quoted 17 lines · Rushil Gupta
Quoted 16 lines

gVNIC requires physical address to be passed in the adminq command. This was initially rightly pointed by ferruh.yigit@. Fixed by passing 'driver_info_mem->iova'.

---
 drivers/net/gve/gve_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.c +0 -0
index 2c1e73d07a..aa75abe102 100644
@@ -276,7 +276,8 @@ gve_verify_driver_compatibility(struct gve_priv *priv)
                     (char *)driver_info->os_version_str2);
 
Quoted 9 lines

drivers/net/gve/gve_ethdev.c gve_verify_driver_compatibility(struct gve_priv *priv)

Quoted 5 lines
drivers/net/gve/gve_ethdev.c +2 -1
     err = gve_adminq_verify_driver_compatibility(priv,
-            sizeof(struct gve_driver_info), (dma_addr_t)driver_info);
+            sizeof(struct gve_driver_info),
+            (dma_addr_t)driver_info_mem->iova);
 

Yep, this was my point, let me squashed onto original patch in next-net.

Squashed into relevant commit in next-net, thanks. Can you please verify latest code in next-net?

#9 lore raw

Thanks for the clarification and for squashing the bug into the main commit. I just tested the net-next branch and it seems to log the right message on the device.

Quoted 58 lines · Ferruh Yigit
Quoted 4 lines · Rushil Gupta

Thanks for the quick response!
Just for my own knowledge, what Junfeng described is the process to fix the bug if a bug is present in the main dpdk repo?

Correct.

As main dpdk repo doesn't rewrite git history, any bug there needs to be fixed with an incremental commit, and fix commit should have some metadata to describe what it is fixing (this is to help LTS maintainers and developers tracing down a change).

But sub-trees (like next-net) allowed to rewrite git history, so allowed
to squash/rebase commits when it is more practical to do so as this case.
But changing directly in the git repo has its problems, like tracing, justifying source of the change and missing consensus etc. So, even it is squashed, the patch should be publicly available in the mail list first.

For developers it is best to send incremental patch as if it will be merged as incremental commit, but can request a squash if the commit still not pulled by main repo, or maintainer can prefer to squash the fix to original commit, to reduce the churn & process overhead.

Quoted 32 lines · Ferruh Yigit
Quoted 31 lines · Ferruh Yigit
Quoted 17 lines · Rushil Gupta
Quoted 16 lines

gVNIC requires physical address to be passed in the adminq command. This was initially rightly pointed by ferruh.yigit@. Fixed by passing 'driver_info_mem->iova'.

---
 drivers/net/gve/gve_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.c +0 -0
index 2c1e73d07a..aa75abe102 100644
@@ -276,7 +276,8 @@ gve_verify_driver_compatibility(struct gve_priv *priv)
                     (char *)driver_info->os_version_str2);
 
Quoted 9 lines

drivers/net/gve/gve_ethdev.c gve_verify_driver_compatibility(struct gve_priv *priv)

Quoted 5 lines
drivers/net/gve/gve_ethdev.c +2 -1
     err = gve_adminq_verify_driver_compatibility(priv,
-            sizeof(struct gve_driver_info), (dma_addr_t)driver_info);
+            sizeof(struct gve_driver_info),
+            (dma_addr_t)driver_info_mem->iova);
 

Yep, this was my point, let me squashed onto original patch in next-net.

Squashed into relevant commit in next-net, thanks. Can you please verify latest code in next-net?