DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/tap: fix add qdisc failed when create tap
@ 2025-05-12  8:22 luyan
  2025-05-20 15:55 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: luyan @ 2025-05-12  8:22 UTC (permalink / raw)
  To: maxime.coquelin, chenbox; +Cc: dev, luyan

From: luyan <luyan@cmss.chinamobile.com>

The errno variable was assigned a positive value in the previous handling,
but here it is compared against -EEXIST,
When the tap already exists, this would falsely report an error.

Signed-off-by: luyan <luyan@cmss.chinamobile.com>
---
 drivers/net/tap/tap_tcmsgs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tap/tap_tcmsgs.c b/drivers/net/tap/tap_tcmsgs.c
index 1755b57519..caca9445c8 100644
--- a/drivers/net/tap/tap_tcmsgs.c
+++ b/drivers/net/tap/tap_tcmsgs.c
@@ -261,7 +261,7 @@ qdisc_create_multiq(int nlsk_fd, unsigned int ifindex)
 	int err = 0;
 
 	err = qdisc_add_multiq(nlsk_fd, ifindex);
-	if (err < 0 && errno != -EEXIST) {
+	if (err < 0 && errno != EEXIST) {
 		TAP_LOG(ERR, "Could not add multiq qdisc (%d): %s",
 			errno, strerror(errno));
 		return -1;
@@ -287,7 +287,7 @@ qdisc_create_ingress(int nlsk_fd, unsigned int ifindex)
 	int err = 0;
 
 	err = qdisc_add_ingress(nlsk_fd, ifindex);
-	if (err < 0 && errno != -EEXIST) {
+	if (err < 0 && errno != EEXIST) {
 		TAP_LOG(ERR, "Could not add ingress qdisc (%d): %s",
 			errno, strerror(errno));
 		return -1;
-- 
2.45.2.windows.1


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

* Re: [PATCH] net/tap: fix add qdisc failed when create tap
  2025-05-12  8:22 [PATCH] net/tap: fix add qdisc failed when create tap luyan
@ 2025-05-20 15:55 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2025-05-20 15:55 UTC (permalink / raw)
  To: luyan; +Cc: maxime.coquelin, chenbox, dev, luyan

On Mon, 12 May 2025 16:22:04 +0800
luyan <973788536@qq.com> wrote:

> From: luyan <luyan@cmss.chinamobile.com>
> 
> The errno variable was assigned a positive value in the previous handling,
> but here it is compared against -EEXIST,
> When the tap already exists, this would falsely report an error.
> 
> Signed-off-by: luyan <luyan@cmss.chinamobile.com>

Patch looks good, but the commit message needs a couple of changes.

* DPDK uses a .mailmap file to keep track of all the contributors.
  You should add your email to that.
* Please use your full legal name in the Signed-off-by: portion.
  Is that your full name?
* Since this fixes a bug, please add a fixes tag like:

Fixes: 6fc6de7e0eaf ("net/tap: update netlink error code management")

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

end of thread, other threads:[~2025-05-20 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-12  8:22 [PATCH] net/tap: fix add qdisc failed when create tap luyan
2025-05-20 15:55 ` Stephen Hemminger

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).