patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/7 v2] bus/dpaa: check flag in qman multi enqueue
       [not found] ` <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com>
@ 2018-01-23 12:27   ` Nipun Gupta
  2018-01-24  5:24     ` Hemant Agrawal
  2018-01-23 12:27   ` [dpdk-stable] [PATCH 2/7 v2] bus/dpaa: allocate qman portals in thread safe manner Nipun Gupta
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Nipun Gupta @ 2018-01-23 12:27 UTC (permalink / raw)
  To: thomas; +Cc: dev, hemant.agrawal, shreyansh.jain, Nipun Gupta, stable

A caller may/may not pass the flags in qman enqueue multi API.
This patch adds a check on that flag and only accesses it if passed
by the caller.

Fixes: 43797e7b4774 ("bus/dpaa: support event dequeue and consumption")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/dpaa/base/qbman/qman.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index 609bc76..e7fdf03 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -2198,7 +2198,7 @@ int qman_enqueue_multi(struct qman_fq *fq,
 		eq->fd.addr = cpu_to_be40(fd->addr);
 		eq->fd.status = cpu_to_be32(fd->status);
 		eq->fd.opaque = cpu_to_be32(fd->opaque);
-		if (flags[i] & QMAN_ENQUEUE_FLAG_DCA) {
+		if (flags && (flags[i] & QMAN_ENQUEUE_FLAG_DCA)) {
 			eq->dca = QM_EQCR_DCA_ENABLE |
 				((flags[i] >> 8) & QM_EQCR_DCA_IDXMASK);
 		}
-- 
1.9.1

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

* [dpdk-stable] [PATCH 2/7 v2] bus/dpaa: allocate qman portals in thread safe manner
       [not found] ` <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com>
  2018-01-23 12:27   ` [dpdk-stable] [PATCH 1/7 v2] bus/dpaa: check flag in qman multi enqueue Nipun Gupta
@ 2018-01-23 12:27   ` Nipun Gupta
  2018-01-23 12:27   ` [dpdk-stable] [PATCH 3/7 v2] mempool/dpaa: fix the phy to virt optimization Nipun Gupta
  2018-01-23 12:27   ` [dpdk-stable] [PATCH 4/7 v2] bus/dpaa: fix port order shuffling Nipun Gupta
  3 siblings, 0 replies; 10+ messages in thread
From: Nipun Gupta @ 2018-01-23 12:27 UTC (permalink / raw)
  To: thomas; +Cc: dev, hemant.agrawal, shreyansh.jain, Nipun Gupta, stable

Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/dpaa/base/qbman/qman.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index e7fdf03..4d8bdae 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -625,7 +625,7 @@ struct qman_portal *qman_create_portal(
 
 #define MAX_GLOBAL_PORTALS 8
 static struct qman_portal global_portals[MAX_GLOBAL_PORTALS];
-static int global_portals_used[MAX_GLOBAL_PORTALS];
+rte_atomic16_t global_portals_used[MAX_GLOBAL_PORTALS];
 
 static struct qman_portal *
 qman_alloc_global_portal(void)
@@ -633,10 +633,8 @@ struct qman_portal *qman_create_portal(
 	unsigned int i;
 
 	for (i = 0; i < MAX_GLOBAL_PORTALS; i++) {
-		if (global_portals_used[i] == 0) {
-			global_portals_used[i] = 1;
+		if (rte_atomic16_test_and_set(&global_portals_used[i]))
 			return &global_portals[i];
-		}
 	}
 	pr_err("No portal available (%x)\n", MAX_GLOBAL_PORTALS);
 
@@ -650,7 +648,7 @@ struct qman_portal *qman_create_portal(
 
 	for (i = 0; i < MAX_GLOBAL_PORTALS; i++) {
 		if (&global_portals[i] == portal) {
-			global_portals_used[i] = 0;
+			rte_atomic16_clear(&global_portals_used[i]);
 			return 0;
 		}
 	}
-- 
1.9.1

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

* [dpdk-stable] [PATCH 3/7 v2] mempool/dpaa: fix the phy to virt optimization
       [not found] ` <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com>
  2018-01-23 12:27   ` [dpdk-stable] [PATCH 1/7 v2] bus/dpaa: check flag in qman multi enqueue Nipun Gupta
  2018-01-23 12:27   ` [dpdk-stable] [PATCH 2/7 v2] bus/dpaa: allocate qman portals in thread safe manner Nipun Gupta
@ 2018-01-23 12:27   ` Nipun Gupta
  2018-01-23 12:27   ` [dpdk-stable] [PATCH 4/7 v2] bus/dpaa: fix port order shuffling Nipun Gupta
  3 siblings, 0 replies; 10+ messages in thread
From: Nipun Gupta @ 2018-01-23 12:27 UTC (permalink / raw)
  To: thomas; +Cc: dev, hemant.agrawal, shreyansh.jain, stable

From: Hemant Agrawal <hemant.agrawal@nxp.com>

Fixes: 83a4f267f2e3 ("mempool/dpaa: optimize phy to virt conversion")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/mempool/dpaa/dpaa_mempool.c | 9 ++++-----
 drivers/mempool/dpaa/dpaa_mempool.h | 4 ++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index ddc4e47..fe22519 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -150,8 +150,8 @@
 		uint64_t phy = rte_mempool_virt2iova(obj_table[i]);
 
 		if (unlikely(!bp_info->ptov_off)) {
-			/* buffers are not from multiple memzones */
-			if (!(bp_info->flags & DPAA_MPOOL_MULTI_MEMZONE)) {
+			/* buffers are from single mem segment */
+			if (bp_info->flags & DPAA_MPOOL_SINGLE_SEGMENT) {
 				bp_info->ptov_off
 						= (uint64_t)obj_table[i] - phy;
 				rte_dpaa_bpid_info[bp_info->bpid].ptov_off
@@ -282,9 +282,8 @@
 			   len, total_elt_sz * mp->size);
 
 	/* Detect pool area has sufficient space for elements in this memzone */
-	if (len < total_elt_sz * mp->size)
-		/* Else, Memory will be allocated from multiple memzones */
-		bp_info->flags |= DPAA_MPOOL_MULTI_MEMZONE;
+	if (len >= total_elt_sz * mp->size)
+		bp_info->flags |= DPAA_MPOOL_SINGLE_SEGMENT;
 
 	return 0;
 }
diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h
index 02aa513..9435dd2 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -28,8 +28,8 @@
 /* Maximum release/acquire from BMAN */
 #define DPAA_MBUF_MAX_ACQ_REL  8
 
-/* Buffers are allocated from multiple memzones i.e. non phys contiguous */
-#define DPAA_MPOOL_MULTI_MEMZONE  0x01
+/* Buffers are allocated from single mem segment i.e. phys contiguous */
+#define DPAA_MPOOL_SINGLE_SEGMENT  0x01
 
 struct dpaa_bp_info {
 	struct rte_mempool *mp;
-- 
1.9.1

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

* [dpdk-stable] [PATCH 4/7 v2] bus/dpaa: fix port order shuffling
       [not found] ` <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com>
                     ` (2 preceding siblings ...)
  2018-01-23 12:27   ` [dpdk-stable] [PATCH 3/7 v2] mempool/dpaa: fix the phy to virt optimization Nipun Gupta
@ 2018-01-23 12:27   ` Nipun Gupta
  3 siblings, 0 replies; 10+ messages in thread
From: Nipun Gupta @ 2018-01-23 12:27 UTC (permalink / raw)
  To: thomas; +Cc: dev, hemant.agrawal, shreyansh.jain, stable

From: Shreyansh Jain <shreyansh.jain@nxp.com>

While scanning for devices, the order in which devices appear is
different as compared to MAC sequence.
This can cause confusion for users and automated scripts.
This patch create a sorted list of devices.

Fixes: 919eeaccb2ba ("bus/dpaa: introduce NXP DPAA bus driver skeleton")
Cc: stable@dpdk.org

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 52 +++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 50 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index ba33566..ef2df48 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -57,10 +57,58 @@
 RTE_DEFINE_PER_LCORE(bool, _dpaa_io);
 RTE_DEFINE_PER_LCORE(struct dpaa_portal_dqrr, held_bufs);
 
+static int
+compare_dpaa_devices(struct rte_dpaa_device *dev1,
+		     struct rte_dpaa_device *dev2)
+{
+	int comp = 0;
+
+	/* Segragating ETH from SEC devices */
+	if (dev1->device_type > dev2->device_type)
+		comp = 1;
+	else if (dev1->device_type < dev2->device_type)
+		comp = -1;
+	else
+		comp = 0;
+
+	if ((comp != 0) || (dev1->device_type != FSL_DPAA_ETH))
+		return comp;
+
+	if (dev1->id.fman_id > dev2->id.fman_id) {
+		comp = 1;
+	} else if (dev1->id.fman_id < dev2->id.fman_id) {
+		comp = -1;
+	} else {
+		/* FMAN ids match, check for mac_id */
+		if (dev1->id.mac_id > dev2->id.mac_id)
+			comp = 1;
+		else if (dev1->id.mac_id < dev2->id.mac_id)
+			comp = -1;
+		else
+			comp = 0;
+	}
+
+	return comp;
+}
+
 static inline void
-dpaa_add_to_device_list(struct rte_dpaa_device *dev)
+dpaa_add_to_device_list(struct rte_dpaa_device *newdev)
 {
-	TAILQ_INSERT_TAIL(&rte_dpaa_bus.device_list, dev, next);
+	int comp, inserted = 0;
+	struct rte_dpaa_device *dev = NULL;
+	struct rte_dpaa_device *tdev = NULL;
+
+	TAILQ_FOREACH_SAFE(dev, &rte_dpaa_bus.device_list, next, tdev) {
+		comp = compare_dpaa_devices(newdev, dev);
+		if (comp < 0) {
+			TAILQ_INSERT_BEFORE(dev, newdev, next);
+			inserted = 1;
+			break;
+		}
+	}
+
+	if (!inserted)
+		TAILQ_INSERT_TAIL(&rte_dpaa_bus.device_list, newdev, next);
 }
 
 static inline void
-- 
1.9.1

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

* [dpdk-stable] [PATCH 1/7] bus/dpaa: check flag in qman multi enqueue
       [not found] <1516710671-13897-1-git-send-email-nipun.gupta@nxp.com>
       [not found] ` <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com>
@ 2018-01-23 12:31 ` Nipun Gupta
  2018-01-23 12:31 ` [dpdk-stable] [PATCH 2/7] bus/dpaa: allocate qman portals in thread safe manner Nipun Gupta
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Nipun Gupta @ 2018-01-23 12:31 UTC (permalink / raw)
  To: thomas; +Cc: dev, hemant.agrawal, shreyansh.jain, Nipun Gupta, stable

A caller may/may not pass the flags in qman enqueue multi API.
This patch adds a check on that flag and only accesses it if passed
by the caller.

Fixes: 43797e7b4774 ("bus/dpaa: support event dequeue and consumption")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/dpaa/base/qbman/qman.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index 609bc76..e7fdf03 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -2198,7 +2198,7 @@ int qman_enqueue_multi(struct qman_fq *fq,
 		eq->fd.addr = cpu_to_be40(fd->addr);
 		eq->fd.status = cpu_to_be32(fd->status);
 		eq->fd.opaque = cpu_to_be32(fd->opaque);
-		if (flags[i] & QMAN_ENQUEUE_FLAG_DCA) {
+		if (flags && (flags[i] & QMAN_ENQUEUE_FLAG_DCA)) {
 			eq->dca = QM_EQCR_DCA_ENABLE |
 				((flags[i] >> 8) & QM_EQCR_DCA_IDXMASK);
 		}
-- 
1.9.1

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

* [dpdk-stable] [PATCH 2/7] bus/dpaa: allocate qman portals in thread safe manner
       [not found] <1516710671-13897-1-git-send-email-nipun.gupta@nxp.com>
       [not found] ` <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com>
  2018-01-23 12:31 ` [dpdk-stable] [PATCH 1/7] bus/dpaa: check flag in qman multi enqueue Nipun Gupta
@ 2018-01-23 12:31 ` Nipun Gupta
  2018-01-23 12:31 ` [dpdk-stable] [PATCH 3/7] mempool/dpaa: fix the phy to virt optimization Nipun Gupta
  2018-01-23 12:31 ` [dpdk-stable] [PATCH 4/7] bus/dpaa: fix port order shuffling Nipun Gupta
  4 siblings, 0 replies; 10+ messages in thread
From: Nipun Gupta @ 2018-01-23 12:31 UTC (permalink / raw)
  To: thomas; +Cc: dev, hemant.agrawal, shreyansh.jain, Nipun Gupta, stable

Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/dpaa/base/qbman/qman.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index e7fdf03..4d8bdae 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -625,7 +625,7 @@ struct qman_portal *qman_create_portal(
 
 #define MAX_GLOBAL_PORTALS 8
 static struct qman_portal global_portals[MAX_GLOBAL_PORTALS];
-static int global_portals_used[MAX_GLOBAL_PORTALS];
+rte_atomic16_t global_portals_used[MAX_GLOBAL_PORTALS];
 
 static struct qman_portal *
 qman_alloc_global_portal(void)
@@ -633,10 +633,8 @@ struct qman_portal *qman_create_portal(
 	unsigned int i;
 
 	for (i = 0; i < MAX_GLOBAL_PORTALS; i++) {
-		if (global_portals_used[i] == 0) {
-			global_portals_used[i] = 1;
+		if (rte_atomic16_test_and_set(&global_portals_used[i]))
 			return &global_portals[i];
-		}
 	}
 	pr_err("No portal available (%x)\n", MAX_GLOBAL_PORTALS);
 
@@ -650,7 +648,7 @@ struct qman_portal *qman_create_portal(
 
 	for (i = 0; i < MAX_GLOBAL_PORTALS; i++) {
 		if (&global_portals[i] == portal) {
-			global_portals_used[i] = 0;
+			rte_atomic16_clear(&global_portals_used[i]);
 			return 0;
 		}
 	}
-- 
1.9.1

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

* [dpdk-stable] [PATCH 3/7] mempool/dpaa: fix the phy to virt optimization
       [not found] <1516710671-13897-1-git-send-email-nipun.gupta@nxp.com>
                   ` (2 preceding siblings ...)
  2018-01-23 12:31 ` [dpdk-stable] [PATCH 2/7] bus/dpaa: allocate qman portals in thread safe manner Nipun Gupta
@ 2018-01-23 12:31 ` Nipun Gupta
  2018-01-23 12:31 ` [dpdk-stable] [PATCH 4/7] bus/dpaa: fix port order shuffling Nipun Gupta
  4 siblings, 0 replies; 10+ messages in thread
From: Nipun Gupta @ 2018-01-23 12:31 UTC (permalink / raw)
  To: thomas; +Cc: dev, hemant.agrawal, shreyansh.jain, stable

From: Hemant Agrawal <hemant.agrawal@nxp.com>

Fixes: 83a4f267f2e3 ("mempool/dpaa: optimize phy to virt conversion")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/mempool/dpaa/dpaa_mempool.c | 9 ++++-----
 drivers/mempool/dpaa/dpaa_mempool.h | 4 ++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index ddc4e47..fe22519 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -150,8 +150,8 @@
 		uint64_t phy = rte_mempool_virt2iova(obj_table[i]);
 
 		if (unlikely(!bp_info->ptov_off)) {
-			/* buffers are not from multiple memzones */
-			if (!(bp_info->flags & DPAA_MPOOL_MULTI_MEMZONE)) {
+			/* buffers are from single mem segment */
+			if (bp_info->flags & DPAA_MPOOL_SINGLE_SEGMENT) {
 				bp_info->ptov_off
 						= (uint64_t)obj_table[i] - phy;
 				rte_dpaa_bpid_info[bp_info->bpid].ptov_off
@@ -282,9 +282,8 @@
 			   len, total_elt_sz * mp->size);
 
 	/* Detect pool area has sufficient space for elements in this memzone */
-	if (len < total_elt_sz * mp->size)
-		/* Else, Memory will be allocated from multiple memzones */
-		bp_info->flags |= DPAA_MPOOL_MULTI_MEMZONE;
+	if (len >= total_elt_sz * mp->size)
+		bp_info->flags |= DPAA_MPOOL_SINGLE_SEGMENT;
 
 	return 0;
 }
diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h
index 02aa513..9435dd2 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -28,8 +28,8 @@
 /* Maximum release/acquire from BMAN */
 #define DPAA_MBUF_MAX_ACQ_REL  8
 
-/* Buffers are allocated from multiple memzones i.e. non phys contiguous */
-#define DPAA_MPOOL_MULTI_MEMZONE  0x01
+/* Buffers are allocated from single mem segment i.e. phys contiguous */
+#define DPAA_MPOOL_SINGLE_SEGMENT  0x01
 
 struct dpaa_bp_info {
 	struct rte_mempool *mp;
-- 
1.9.1

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

* [dpdk-stable] [PATCH 4/7] bus/dpaa: fix port order shuffling
       [not found] <1516710671-13897-1-git-send-email-nipun.gupta@nxp.com>
                   ` (3 preceding siblings ...)
  2018-01-23 12:31 ` [dpdk-stable] [PATCH 3/7] mempool/dpaa: fix the phy to virt optimization Nipun Gupta
@ 2018-01-23 12:31 ` Nipun Gupta
  4 siblings, 0 replies; 10+ messages in thread
From: Nipun Gupta @ 2018-01-23 12:31 UTC (permalink / raw)
  To: thomas; +Cc: dev, hemant.agrawal, shreyansh.jain, stable

From: Shreyansh Jain <shreyansh.jain@nxp.com>

While scanning for devices, the order in which devices appear is
different as compared to MAC sequence.
This can cause confusion for users and automated scripts.
This patch create a sorted list of devices.

Fixes: 919eeaccb2ba ("bus/dpaa: introduce NXP DPAA bus driver skeleton")
Cc: stable@dpdk.org

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 52 +++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 50 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index ba33566..ef2df48 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -57,10 +57,58 @@
 RTE_DEFINE_PER_LCORE(bool, _dpaa_io);
 RTE_DEFINE_PER_LCORE(struct dpaa_portal_dqrr, held_bufs);
 
+static int
+compare_dpaa_devices(struct rte_dpaa_device *dev1,
+		     struct rte_dpaa_device *dev2)
+{
+	int comp = 0;
+
+	/* Segragating ETH from SEC devices */
+	if (dev1->device_type > dev2->device_type)
+		comp = 1;
+	else if (dev1->device_type < dev2->device_type)
+		comp = -1;
+	else
+		comp = 0;
+
+	if ((comp != 0) || (dev1->device_type != FSL_DPAA_ETH))
+		return comp;
+
+	if (dev1->id.fman_id > dev2->id.fman_id) {
+		comp = 1;
+	} else if (dev1->id.fman_id < dev2->id.fman_id) {
+		comp = -1;
+	} else {
+		/* FMAN ids match, check for mac_id */
+		if (dev1->id.mac_id > dev2->id.mac_id)
+			comp = 1;
+		else if (dev1->id.mac_id < dev2->id.mac_id)
+			comp = -1;
+		else
+			comp = 0;
+	}
+
+	return comp;
+}
+
 static inline void
-dpaa_add_to_device_list(struct rte_dpaa_device *dev)
+dpaa_add_to_device_list(struct rte_dpaa_device *newdev)
 {
-	TAILQ_INSERT_TAIL(&rte_dpaa_bus.device_list, dev, next);
+	int comp, inserted = 0;
+	struct rte_dpaa_device *dev = NULL;
+	struct rte_dpaa_device *tdev = NULL;
+
+	TAILQ_FOREACH_SAFE(dev, &rte_dpaa_bus.device_list, next, tdev) {
+		comp = compare_dpaa_devices(newdev, dev);
+		if (comp < 0) {
+			TAILQ_INSERT_BEFORE(dev, newdev, next);
+			inserted = 1;
+			break;
+		}
+	}
+
+	if (!inserted)
+		TAILQ_INSERT_TAIL(&rte_dpaa_bus.device_list, newdev, next);
 }
 
 static inline void
-- 
1.9.1

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

* Re: [dpdk-stable] [PATCH 1/7 v2] bus/dpaa: check flag in qman multi enqueue
  2018-01-23 12:27   ` [dpdk-stable] [PATCH 1/7 v2] bus/dpaa: check flag in qman multi enqueue Nipun Gupta
@ 2018-01-24  5:24     ` Hemant Agrawal
  2018-01-31 12:45       ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  0 siblings, 1 reply; 10+ messages in thread
From: Hemant Agrawal @ 2018-01-24  5:24 UTC (permalink / raw)
  To: Nipun Gupta, thomas; +Cc: dev, Shreyansh Jain, stable



> -----Original Message-----
> From: Nipun Gupta [mailto:nipun.gupta@nxp.com]
> A caller may/may not pass the flags in qman enqueue multi API.
> This patch adds a check on that flag and only accesses it if passed by the
> caller.
> 
> Fixes: 43797e7b4774 ("bus/dpaa: support event dequeue and
> consumption")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> ---
>  drivers/bus/dpaa/base/qbman/qman.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/dpaa/base/qbman/qman.c
> b/drivers/bus/dpaa/base/qbman/qman.c
> index 609bc76..e7fdf03 100644
> --- a/drivers/bus/dpaa/base/qbman/qman.c
> +++ b/drivers/bus/dpaa/base/qbman/qman.c
> @@ -2198,7 +2198,7 @@ int qman_enqueue_multi(struct qman_fq *fq,
>                 eq->fd.addr = cpu_to_be40(fd->addr);
>                 eq->fd.status = cpu_to_be32(fd->status);
>                 eq->fd.opaque = cpu_to_be32(fd->opaque);
> -               if (flags[i] & QMAN_ENQUEUE_FLAG_DCA) {
> +               if (flags && (flags[i] & QMAN_ENQUEUE_FLAG_DCA)) {
>                         eq->dca = QM_EQCR_DCA_ENABLE |
>                                 ((flags[i] >> 8) & QM_EQCR_DCA_IDXMASK);
>                 }

Series-
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH 1/7 v2] bus/dpaa: check flag in qman multi enqueue
  2018-01-24  5:24     ` Hemant Agrawal
@ 2018-01-31 12:45       ` Thomas Monjalon
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2018-01-31 12:45 UTC (permalink / raw)
  To: Hemant Agrawal, Nipun Gupta; +Cc: dev, Shreyansh Jain, stable

> > Fixes: 43797e7b4774 ("bus/dpaa: support event dequeue and
> > consumption")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> 
> Series-
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Applied, thanks

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

end of thread, other threads:[~2018-01-31 12:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1516710671-13897-1-git-send-email-nipun.gupta@nxp.com>
     [not found] ` <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com>
2018-01-23 12:27   ` [dpdk-stable] [PATCH 1/7 v2] bus/dpaa: check flag in qman multi enqueue Nipun Gupta
2018-01-24  5:24     ` Hemant Agrawal
2018-01-31 12:45       ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2018-01-23 12:27   ` [dpdk-stable] [PATCH 2/7 v2] bus/dpaa: allocate qman portals in thread safe manner Nipun Gupta
2018-01-23 12:27   ` [dpdk-stable] [PATCH 3/7 v2] mempool/dpaa: fix the phy to virt optimization Nipun Gupta
2018-01-23 12:27   ` [dpdk-stable] [PATCH 4/7 v2] bus/dpaa: fix port order shuffling Nipun Gupta
2018-01-23 12:31 ` [dpdk-stable] [PATCH 1/7] bus/dpaa: check flag in qman multi enqueue Nipun Gupta
2018-01-23 12:31 ` [dpdk-stable] [PATCH 2/7] bus/dpaa: allocate qman portals in thread safe manner Nipun Gupta
2018-01-23 12:31 ` [dpdk-stable] [PATCH 3/7] mempool/dpaa: fix the phy to virt optimization Nipun Gupta
2018-01-23 12:31 ` [dpdk-stable] [PATCH 4/7] bus/dpaa: fix port order shuffling Nipun Gupta

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