Skip to contentSkip to conversation

app/testpmd: fixed using strtoull with 64-bit variables

PATCH New Adham Masarwah 4 participants 8 messages Mar 10, 2022 – Mar 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: fixed using strtoull with 64-bit variables

Replaced using strtoul with strtoull when converting to 64-bit mask field.
In Windows strtoul returns 32-bit values which cause an issue with show RSS reta.

Fixes 66c594904ac ("ethdev: support multiple sizes of redirection table")
---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
index b4ba8da2b0..efa02bd301 100644
@@ -3127,7 +3127,7 @@ showport_parse_reta_config(struct rte_eth_rss_reta_entry64 *conf,
 		return -1;
 	}
 	for (i = 0; i < ret; i++)
-		conf[i].mask = (uint64_t)strtoul(str_fld[i], &end, 0);
+		conf[i].mask = (uint64_t)strtoull(str_fld[i], &end, 0);
 
 	return 0;
 }
Signature · 1 line
2.16.1.windows.4
#1 lore raw

PATCH 1/1 app/testpmd: fixed using strtoull with 64-bit variables

Replaced using strtoul with strtoull when converting to 64-bit mask field.
In Windows strtoul returns 32-bit values which cause an issue with show RSS reta.

Fixes 66c594904ac ("ethdev: support multiple sizes of redirection table")
---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
index b4ba8da2b0..efa02bd301 100644
@@ -3127,7 +3127,7 @@ showport_parse_reta_config(struct rte_eth_rss_reta_entry64 *conf,
 		return -1;
 	}
 	for (i = 0; i < ret; i++)
-		conf[i].mask = (uint64_t)strtoul(str_fld[i], &end, 0);
+		conf[i].mask = (uint64_t)strtoull(str_fld[i], &end, 0);
 
 	return 0;
 }
Signature · 1 line
2.16.1.windows.4
Acked-by on v1 1/1
#2 lore raw
Quoted 10 lines · Adham Masarwah

Replaced using strtoul with strtoull when converting to 64-bit mask field.
In Windows strtoul returns 32-bit values which cause an issue with show RSS reta.

Fixes 66c594904ac ("ethdev: support multiple sizes of redirection table")

---

As Windowuses the|LLP64 data model.|

Quoted 16 lines
  app/test-pmd/cmdline.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
index b4ba8da2b0..efa02bd301 100644
@@ -3127,7 +3127,7 @@ showport_parse_reta_config(struct rte_eth_rss_reta_entry64 *conf,
  		return -1;
  	}
  	for (i = 0; i < ret; i++)
-		conf[i].mask = (uint64_t)strtoul(str_fld[i], &end, 0);
+		conf[i].mask = (uint64_t)strtoull(str_fld[i], &end, 0);
 
  	return 0;
  }
#4 lore raw

PATCH v2 1/1 app/testpmd: fix show RSS RETA on Windows

In reply to Adham Masarwah

Replaced using strtoul with strtoull when converting to 64-bit mask field.
In Windows strtoul returns 32-bit values which cause an issue with show RSS RETA.

Fixes 66c594904ac ("ethdev: support multiple sizes of redirection table")
---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
index b4ba8da2b0..efa02bd301 100644
@@ -3127,7 +3127,7 @@ showport_parse_reta_config(struct rte_eth_rss_reta_entry64 *conf,
 		return -1;
 	}
 	for (i = 0; i < ret; i++)
-		conf[i].mask = (uint64_t)strtoul(str_fld[i], &end, 0);
+		conf[i].mask = (uint64_t)strtoull(str_fld[i], &end, 0);
 
 	return 0;
 }
Signature · 1 line
2.16.1.windows.4
#5 lore raw

PATCH v3 1/1 app/testpmd: fix show RSS RETA on Windows

In reply to Adham Masarwah

Replaced using strtoul with strtoull when converting to 64-bit mask field.
In Windows strtoul returns 32-bit values which cause an issue with show RSS RETA.

Fixes 66c594904ac ("ethdev: support multiple sizes of redirection table")

--
v2: Change commit message
v3: Added Acked-by

---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
index b4ba8da2b0..efa02bd301 100644
@@ -3127,7 +3127,7 @@ showport_parse_reta_config(struct rte_eth_rss_reta_entry64 *conf,
 		return -1;
 	}
 	for (i = 0; i < ret; i++)
-		conf[i].mask = (uint64_t)strtoul(str_fld[i], &end, 0);
+		conf[i].mask = (uint64_t)strtoull(str_fld[i], &end, 0);
 
 	return 0;
 }
Signature · 1 line
2.16.1.windows.4
Acked-by on v3 1/1
#6 lore raw

RE: [PATCH v3] app/testpmd: fix show RSS RETA on Windows

Quoted 31 lines

Subject: [PATCH v3] app/testpmd: fix show RSS RETA on Windows

Replaced using strtoul with strtoull when converting to 64-bit mask field. In Windows strtoul returns 32-bit values which cause an issue with show RSS RETA.

Fixes 66c594904ac ("ethdev: support multiple sizes of redirection table")

--
v2: Change commit message
v3: Added Acked-by

---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0 -0

b4ba8da2b0..efa02bd301 100644

app/test-pmd/cmdline.c +1 -1
@@ -3127,7 +3127,7 @@ showport_parse_reta_config(struct
 rte_eth_rss_reta_entry64 *conf,
 		return -1;
 	}
 	for (i = 0; i < ret; i++)
-		conf[i].mask = (uint64_t)strtoul(str_fld[i], &end, 0);
+		conf[i].mask = (uint64_t)strtoull(str_fld[i], &end, 0);
 
 	return 0;
Quoted 3 lines

}
--
2.16.1.windows.4

#7 lore raw

Re: [PATCH v3] app/testpmd: fix show RSS RETA on Windows

13/03/2022 14:21, Tal Shnaiderman:

Quoted 6 lines
Quoted 6 lines

Subject: [PATCH v3] app/testpmd: fix show RSS RETA on Windows

Replaced using strtoul with strtoull when converting to 64-bit mask field. In Windows strtoul returns 32-bit values which cause an issue with show RSS RETA.

Quoted 6 lines
Quoted 5 lines
Fixes 66c594904ac ("ethdev: support multiple sizes of redirection table")

Applied, thanks.