patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/octeontx: fix failures when available ports > queues
@ 2018-11-14  9:22 Anoob Joseph
  2018-11-14 10:40 ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Anoob Joseph @ 2018-11-14  9:22 UTC (permalink / raw)
  To: Ferruh Yigit, Jacob,  Jerin
  Cc: Joseph, Anoob, Athreya, Narayana Prasad, Bhagavatula, Pavan, dev, stable

When eth_octeontx is initialized before event_octeontx, eth_octeontx
would initiate setting up of the event device with the max ports and
queues available. If number of ports is more than the number of queues,
some ports would be left unused when the ports and queues are mapped
1:1. But even in that case the ports need to be setup, or otherwise it
would lead to a segmentation fault when event device is started.

Fixes: f7be70e5130e ("net/octeontx: add net device probe and remove")

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 drivers/net/octeontx/octeontx_ethdev.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index 0681486..9c421d5 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -1237,15 +1237,8 @@ octeontx_probe(struct rte_vdev_device *dev)
 		res = -EINVAL;
 		goto parse_error;
 	}
-	if (pnum > qnum) {
-		/*
-		 * We don't poll on event ports
-		 * that do not have any queues assigned.
-		 */
-		pnum = qnum;
-		PMD_INIT_LOG(INFO,
-			"reducing number of active event ports to %d", pnum);
-	}
+
+	/* Enable all queues available */
 	for (i = 0; i < qnum; i++) {
 		res = rte_event_queue_setup(evdev, i, NULL);
 		if (res < 0) {
@@ -1255,6 +1248,7 @@ octeontx_probe(struct rte_vdev_device *dev)
 		}
 	}
 
+	/* Enable all ports available */
 	for (i = 0; i < pnum; i++) {
 		res = rte_event_port_setup(evdev, i, NULL);
 		if (res < 0) {
@@ -1263,6 +1257,14 @@ octeontx_probe(struct rte_vdev_device *dev)
 						i, res);
 			goto parse_error;
 		}
+	}
+
+	/*
+	 * Do 1:1 links for ports & queues. All queues would be mapped to
+	 * one port. If there are more ports than queues, then some ports
+	 * won't be linked to any queue.
+	 */
+	for (i = 0; i < qnum; i++) {
 		/* Link one queue to one event port */
 		qlist = i;
 		res = rte_event_port_link(evdev, i, &qlist, NULL, 1);
-- 
2.7.4

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

* Re: [dpdk-stable] [PATCH] net/octeontx: fix failures when available ports > queues
  2018-11-14  9:22 [dpdk-stable] [PATCH] net/octeontx: fix failures when available ports > queues Anoob Joseph
@ 2018-11-14 10:40 ` Jerin Jacob
  2018-11-16 11:05   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Jerin Jacob @ 2018-11-14 10:40 UTC (permalink / raw)
  To: Joseph, Anoob
  Cc: Ferruh Yigit, Jacob,  Jerin, Athreya, Narayana Prasad,
	Bhagavatula, Pavan, dev, stable

-----Original Message-----
> Date: Wed, 14 Nov 2018 14:52:03 +0530
> From: "Joseph, Anoob" <Anoob.Joseph@cavium.com>
> To: Ferruh Yigit <ferruh.yigit@intel.com>, "Jacob,  Jerin"
>  <Jerin.JacobKollanukkaran@cavium.com>
> CC: "Joseph, Anoob" <Anoob.Joseph@cavium.com>, "Athreya, Narayana Prasad"
>  <NarayanaPrasad.Athreya@cavium.com>, "Bhagavatula, Pavan"
>  <Pavan.Bhagavatula@cavium.com>, "dev@dpdk.org" <dev@dpdk.org>,
>  "stable@dpdk.org" <stable@dpdk.org>
> Subject: [PATCH] net/octeontx: fix failures when available ports > queues
> 
> When eth_octeontx is initialized before event_octeontx, eth_octeontx
> would initiate setting up of the event device with the max ports and
> queues available. If number of ports is more than the number of queues,
> some ports would be left unused when the ports and queues are mapped
> 1:1. But even in that case the ports need to be setup, or otherwise it
> would lead to a segmentation fault when event device is started.
> 
> Fixes: f7be70e5130e ("net/octeontx: add net device probe and remove")
Cc: stable@dpdk.org
> 
> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

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

* Re: [dpdk-stable] [PATCH] net/octeontx: fix failures when available ports > queues
  2018-11-14 10:40 ` Jerin Jacob
@ 2018-11-16 11:05   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-11-16 11:05 UTC (permalink / raw)
  To: Jerin Jacob, Joseph, Anoob
  Cc: Jacob, Jerin, Athreya, Narayana Prasad, Bhagavatula, Pavan, dev, stable

On 11/14/2018 10:40 AM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Wed, 14 Nov 2018 14:52:03 +0530
>> From: "Joseph, Anoob" <Anoob.Joseph@cavium.com>
>> To: Ferruh Yigit <ferruh.yigit@intel.com>, "Jacob,  Jerin"
>>  <Jerin.JacobKollanukkaran@cavium.com>
>> CC: "Joseph, Anoob" <Anoob.Joseph@cavium.com>, "Athreya, Narayana Prasad"
>>  <NarayanaPrasad.Athreya@cavium.com>, "Bhagavatula, Pavan"
>>  <Pavan.Bhagavatula@cavium.com>, "dev@dpdk.org" <dev@dpdk.org>,
>>  "stable@dpdk.org" <stable@dpdk.org>
>> Subject: [PATCH] net/octeontx: fix failures when available ports > queues
>>
>> When eth_octeontx is initialized before event_octeontx, eth_octeontx
>> would initiate setting up of the event device with the max ports and
>> queues available. If number of ports is more than the number of queues,
>> some ports would be left unused when the ports and queues are mapped
>> 1:1. But even in that case the ports need to be setup, or otherwise it
>> would lead to a segmentation fault when event device is started.
>>
>> Fixes: f7be70e5130e ("net/octeontx: add net device probe and remove")
> Cc: stable@dpdk.org
>>
>> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
>> ---
> 
> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>
Applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2018-11-16 11:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14  9:22 [dpdk-stable] [PATCH] net/octeontx: fix failures when available ports > queues Anoob Joseph
2018-11-14 10:40 ` Jerin Jacob
2018-11-16 11:05   ` Ferruh Yigit

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