Skip to contentSkip to conversation

sched: fix for tc_ov_enable flag position in subport structure.

PATCH In review Megha Ajmera 4 participants 9 messages Jan 9, 2023 – Feb 19, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: fix for tc_ov_enable flag position in subport structure.

Current position of "tv_ov_enable" variable in rte_sched_subport structure makes the "memory" variable unused.

Fixes f5e60154ade ("sched: enable traffic class oversubscription conditionally")
---
 lib/sched/rte_sched.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/sched/rte_sched.c +3 -2
index c91697131d..eaecd7ceb4 100644
@@ -202,6 +202,9 @@ struct rte_sched_subport {
 	uint32_t qsize_add[RTE_SCHED_QUEUES_PER_PIPE];
 	uint32_t qsize_sum;
 
+	/* TC oversubscription activation */
+	int tc_ov_enabled;
+
 	struct rte_sched_pipe *pipe;
 	struct rte_sched_queue *queue;
 	struct rte_sched_queue_extra *queue_extra;
@@ -210,8 +213,6 @@ struct rte_sched_subport {
 	struct rte_mbuf **queue_array;
 	uint8_t memory[0] __rte_cache_aligned;
 
-	/* TC oversubscription activation */
-	int tc_ov_enabled;
 } __rte_cache_aligned;
 
 struct rte_sched_port {
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw

lib/sched/rte_sched.c struct rte_sched_subport {

Quoted 25 lines

-----Original Message-----
From: Ajmera, Megha <[email protected]>
Sent: Monday, January 9, 2023 2:55 PM
To: [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: [email protected]; [email protected]
Subject: [PATCH] sched: fix for tc_ov_enable flag position in subport structure.

Current position of "tv_ov_enable" variable in rte_sched_subport structure makes the "memory" variable unused.

Fixes f5e60154ade ("sched: enable traffic class oversubscription conditionally")
---
 lib/sched/rte_sched.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/sched/rte_sched.c +0 -0
index c91697131d..eaecd7ceb4 100644
@@ -202,6 +202,9 @@ struct rte_sched_subport {
#2 lore raw
In reply to Megha Ajmera
Quoted 2 lines · Megha Ajmera

Current position of "tv_ov_enable" variable in

tc_ov_enabled*

Quoted 1 line

rte_sched_subport structure makes the "memory" variable unused.

I did not enter the beast... but my understanding is that some object internal to rte_sched_subport currently shares location with this tc_ov_enabled field.
So please find a better title and describe the impact.

Quoted 3 lines
Fixes f5e60154ade ("sched: enable traffic class oversubscription conditionally")

This is [email protected] material, isn't it?

Quoted 28 lines
---
 lib/sched/rte_sched.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/sched/rte_sched.c +3 -2
index c91697131d..eaecd7ceb4 100644
@@ -202,6 +202,9 @@ struct rte_sched_subport {
        uint32_t qsize_add[RTE_SCHED_QUEUES_PER_PIPE];
        uint32_t qsize_sum;
 
+       /* TC oversubscription activation */
+       int tc_ov_enabled;
+
        struct rte_sched_pipe *pipe;
        struct rte_sched_queue *queue;
        struct rte_sched_queue_extra *queue_extra;
@@ -210,8 +213,6 @@ struct rte_sched_subport {
        struct rte_mbuf **queue_array;
        uint8_t memory[0] __rte_cache_aligned;
 
-       /* TC oversubscription activation */
-       int tc_ov_enabled;
 } __rte_cache_aligned;
 
 struct rte_sched_port {
Signature · 1 line
David Marchand
#3 lore raw

10/01/2023 12:27, David Marchand:

Quoted 16 lines · Megha Ajmera
Quoted 2 lines

Current position of "tv_ov_enable" variable in

tc_ov_enabled*

Quoted 1 line

rte_sched_subport structure makes the "memory" variable unused.

I did not enter the beast... but my understanding is that some object internal to rte_sched_subport currently shares location with this tc_ov_enabled field.
So please find a better title and describe the impact.

Quoted 1 line
Quoted 7 lines
Quoted 2 lines
Fixes f5e60154ade ("sched: enable traffic class oversubscription conditionally")

This is [email protected] material, isn't it?

Quoted 1 line

Ping
Please update or the patch will be abandoned.
Jasvinder, Cristian, can you help?

#4 lore raw
Quoted 35 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, February 6, 2023 7:43 AM
To: Ajmera, Megha <[email protected]>
Cc: [email protected]; [email protected]; Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; [email protected]; David Marchand <[email protected]>
Subject: Re: [PATCH] sched: fix for tc_ov_enable flag position in subport structure.

10/01/2023 12:27, David Marchand:

Quoted 1 line

On Mon, Jan 9, 2023 at 3:59 PM Megha Ajmera <[email protected]>

Quoted 6 lines · wrote:
Quoted 2 lines

Current position of "tv_ov_enable" variable in

tc_ov_enabled*

Quoted 10 lines
Quoted 1 line

rte_sched_subport structure makes the "memory" variable unused.

I did not enter the beast... but my understanding is that some object internal to rte_sched_subport currently shares location with this tc_ov_enabled field.
So please find a better title and describe the impact.

Quoted 2 lines
Fixes f5e60154ade ("sched: enable traffic class oversubscription

conditionally")

Quoted 2 lines
Quoted 1 line
Quoted 11 lines
Quoted 4 lines

This is [email protected] material, isn't it?

Quoted 1 line

Ping
Please update or the patch will be abandoned. Jasvinder, Cristian, can you help?

Megha,

David asked for a better description of the fix and CC stable about a month ago, did you miss his email? These should be quick to handle, are you able to send V2?

Regards,
Cristian

#5 lore raw
Quoted 19 lines
Quoted 19 lines

10/01/2023 12:27, David Marchand:

Quoted 1 line

On Mon, Jan 9, 2023 at 3:59 PM Megha Ajmera <[email protected]>

Quoted 15 lines · wrote:
Quoted 2 lines

Current position of "tv_ov_enable" variable in

tc_ov_enabled*

Quoted 1 line

rte_sched_subport structure makes the "memory" variable unused.

I did not enter the beast... but my understanding is that some object internal to rte_sched_subport currently shares location with this tc_ov_enabled field.
So please find a better title and describe the impact.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

This is [email protected] material, isn't it?

Yes. Applicable to stable branch as well.

Quoted 6 lines

Megha,

David asked for a better description of the fix and CC stable about a month ago, did you miss his email? These should be quick to handle, are you able to send V2?

Hi Cristian,

I missed earlier email on this thread. Sent v2 version of patch with updated title and description. Please have a look and review.

#6 lore raw

PATCH v2 1/1 sched: fix for incorrect alignment of bitmap, pipe and queue structs in subport

In reply to David Marchand

Big structures like bitmap, pipes and queues in subport are addressed using offset of 'memory' field in subport structures. This means no other variable should be added after 'memory' variable or else addressing of such structs like bitmap etc. become incorrect.

Realigned tc_ov_enabled variable in subport structure.

Fixes f5e60154ade ("sched: enable traffic class oversubscription conditionally")
---
 lib/sched/rte_sched.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/sched/rte_sched.c +3 -2
index c91697131d..eaecd7ceb4 100644
@@ -202,6 +202,9 @@ struct rte_sched_subport {
 	uint32_t qsize_add[RTE_SCHED_QUEUES_PER_PIPE];
 	uint32_t qsize_sum;
 
+	/* TC oversubscription activation */
+	int tc_ov_enabled;
+
 	struct rte_sched_pipe *pipe;
 	struct rte_sched_queue *queue;
 	struct rte_sched_queue_extra *queue_extra;
@@ -210,8 +213,6 @@ struct rte_sched_subport {
 	struct rte_mbuf **queue_array;
 	uint8_t memory[0] __rte_cache_aligned;
 
-	/* TC oversubscription activation */
-	int tc_ov_enabled;
 } __rte_cache_aligned;
 
 struct rte_sched_port {
Signature · 1 line
2.25.1
#7 lore raw

Re: [PATCH v2] sched: fix for incorrect alignment of bitmap, pipe and queue structs in subport

07/02/2023 07:10, Megha Ajmera:

Quoted 11 lines

Big structures like bitmap, pipes and queues in subport are addressed using offset of 'memory' field in subport structures. This means no other variable should be added after 'memory' variable or else addressing of such structs like bitmap etc. become incorrect.

Realigned tc_ov_enabled variable in subport structure.

Fixes f5e60154ade ("sched: enable traffic class oversubscription conditionally")

I bet the impact is wrongly explained, but I don't want to look deeper. Applied.

#8 lore raw

Re: [PATCH v2] sched: fix for incorrect alignment of bitmap, pipe and queue structs in subport

19/02/2023 23:40, Thomas Monjalon:

Quoted 8 lines

07/02/2023 07:10, Megha Ajmera:

Quoted 7 lines

Big structures like bitmap, pipes and queues in subport are addressed using offset of 'memory' field in subport structures. This means no other variable should be added after 'memory' variable or else addressing of such structs like bitmap etc. become incorrect.

Realigned tc_ov_enabled variable in subport structure.

Quoted 7 lines
Quoted 4 lines
Fixes f5e60154ade ("sched: enable traffic class oversubscription conditionally")

I bet the impact is wrongly explained, but I don't want to look deeper. Applied.

And I've added Cc: [email protected] that David and Cristian asked for.