Skip to contentSkip to conversation

sched: Correct subport calcuation

RFC PATCH NAK Simon Kagstrom 2 participants 4 messages Jun 10, 2016 – Jun 23, 2016

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 sched: Correct subport calcuation

---
I'm a total newbie to the rte_sched design and implementation, so I've added the RFC.

We get crashes (at other places in the scheduler) without this code.

 lib/librte_sched/rte_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_sched/rte_sched.c +1 -1
index 1609ea8..b46ecfb 100644
@@ -1869,7 +1869,7 @@ grinder_next_pipe(struct rte_sched_port *port, uint32_t pos)
 
 	/* Install new pipe in the grinder */
 	grinder->pindex = pipe_qindex >> 4;
-	grinder->subport = port->subport + (grinder->pindex / port->n_pipes_per_subport);
+	grinder->subport = port->subport + (grinder->pindex / port->n_subports_per_port);
 	grinder->pipe = port->pipe + grinder->pindex;
 	grinder->pipe_params = NULL; /* to be set after the pipe structure is prefetched */
 	grinder->productive = 0;
Signature · 1 line
1.9.1
#1 lore raw

Hi again!

Any news about this patch? I'm off for parental leave starting next week (until january), so any comments (or simply dropping it!) would be good to have before that :-)

// Simon

Quoted 24 lines · Simon Kagstrom

---
I'm a total newbie to the rte_sched design and implementation, so I've added the RFC.

We get crashes (at other places in the scheduler) without this code.

 lib/librte_sched/rte_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_sched/rte_sched.c +1 -1
index 1609ea8..b46ecfb 100644
@@ -1869,7 +1869,7 @@ grinder_next_pipe(struct rte_sched_port *port, uint32_t pos)
 
 	/* Install new pipe in the grinder */
 	grinder->pindex = pipe_qindex >> 4;
-	grinder->subport = port->subport + (grinder->pindex / port->n_pipes_per_subport);
+	grinder->subport = port->subport + (grinder->pindex / port->n_subports_per_port);
 	grinder->pipe = port->pipe + grinder->pindex;
 	grinder->pipe_params = NULL; /* to be set after the pipe structure is prefetched */
 	grinder->productive = 0;
#2 lore raw

Hi Simon,

I am going to take a look at it this week and come back to you.

Thanks,
Cristian

Quoted 45 lines

-----Original Message-----
From: Simon Kågström [mailto:[email protected]]
Sent: Tuesday, June 21, 2016 7:41 AM
To: Dumitrescu, Cristian <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH / RFC] sched: Correct subport calcuation

Hi again!

Any news about this patch? I'm off for parental leave starting next week (until january), so any comments (or simply dropping it!) would be good to have before that :-)

// Simon

lib/librte_sched/rte_sched.c grinder_next_pipe(struct rte_sched_port *port,

Quoted 15 lines · Simon Kagstrom

---
I'm a total newbie to the rte_sched design and implementation, so I've added the RFC.

We get crashes (at other places in the scheduler) without this code.

 lib/librte_sched/rte_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_sched/rte_sched.c +0 -0
index 1609ea8..b46ecfb 100644
@@ -1869,7 +1869,7 @@ grinder_next_pipe(struct rte_sched_port *port,

uint32_t pos)

lib/librte_sched/rte_sched.c grinder_next_pipe(struct rte_sched_port *port, · line 1875

Quoted 9 lines
lib/librte_sched/rte_sched.c +1 -1
 	/* Install new pipe in the grinder */
 	grinder->pindex = pipe_qindex >> 4;
-	grinder->subport = port->subport + (grinder->pindex / port-
 n_pipes_per_subport);
+	grinder->subport = port->subport + (grinder->pindex / port-
 n_subports_per_port);
 	grinder->pipe = port->pipe + grinder->pindex;
 	grinder->pipe_params = NULL; /* to be set after the pipe structure is

prefetched */

Quoted 2 lines

grinder->productive = 0;

#3 lore raw
In reply to Simon Kagstrom
Quoted 35 lines

-----Original Message-----
From: Simon Kagstrom [mailto:[email protected]]
Sent: Friday, June 10, 2016 7:29 AM
To: Dumitrescu, Cristian <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [PATCH / RFC] sched: Correct subport calcuation

---
I'm a total newbie to the rte_sched design and implementation, so I've added the RFC.

We get crashes (at other places in the scheduler) without this code.

 lib/librte_sched/rte_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_sched/rte_sched.c +1 -1
index 1609ea8..b46ecfb 100644
@@ -1869,7 +1869,7 @@ grinder_next_pipe(struct rte_sched_port *port,
 uint32_t pos)
 
 	/* Install new pipe in the grinder */
 	grinder->pindex = pipe_qindex >> 4;
-	grinder->subport = port->subport + (grinder->pindex / port-
 >n_pipes_per_subport);
+	grinder->subport = port->subport + (grinder->pindex / port-
 >n_subports_per_port);
lib/librte_sched/rte_sched.c +0 -0
 	grinder->pipe = port->pipe + grinder->pindex;
 	grinder->pipe_params = NULL; /* to be set after the pipe structure is
Quoted 4 lines

prefetched */
grinder->productive = 0;
--
1.9.1

Hi Simon,

NACK.

Each port has an array of queues (size is port->n_queues_per_port), which are organized into equal size groups associated with pipes and subports:
- Each pipe is assigned the next group of RTE_SCHED_QUEUES_PER_PIPE (i.e. 16) queues in ascending order;
- Each subport is assigned the next group of port->n_pipes_per_subport pipes (congurable parameter).
The following is true:
n_queues_per_port = RTE_SCHED_QUEUES_PER_PIPE * n_pipes_per_subport * n_subports_per_port

Given a queue index (pipe_qindex), the following are true:
- Pipe index: pindex = pipe_qindex >> 4;
- Subport index (let's call it sindex): sindex = pindex / n_pipes_per_subport, right?

I don't know why you get crashes in your application, but what I do know is that your proposed method to compute sindex is not correct :)

Regards,
Cristian