DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting
@ 2018-04-25 12:56 Hemant Agrawal
  2018-04-25 12:56 ` [dpdk-dev] [PATCH 2/5] bus/fslmc: " Hemant Agrawal
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Hemant Agrawal @ 2018-04-25 12:56 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, shreyansh.jain

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 doc/guides/cryptodevs/dpaa_sec.rst |  13 +++++
 doc/guides/nics/dpaa.rst           |  10 ++++
 drivers/bus/dpaa/dpaa_bus.c        | 101 ++++++++++++++++++++++++++++++-------
 drivers/bus/dpaa/rte_dpaa_bus.h    |   2 -
 4 files changed, 106 insertions(+), 20 deletions(-)

diff --git a/doc/guides/cryptodevs/dpaa_sec.rst b/doc/guides/cryptodevs/dpaa_sec.rst
index 2964e83..9988ee1 100644
--- a/doc/guides/cryptodevs/dpaa_sec.rst
+++ b/doc/guides/cryptodevs/dpaa_sec.rst
@@ -78,6 +78,19 @@ Supported DPAA SoCs
 * LS1046A/LS1026A
 * LS1043A/LS1023A
 
+Whitelisting & Blacklisting
+---------------------------
+
+For blacklisting a DPAA device, following commands can be used.
+
+ .. code-block:: console
+
+    <dpdk app> <EAL args> -b "dpaa_bus:dpaa-secX" -- ...
+    e.g. "dpaa_bus:dpaa-sec0"
+
+    or to disable all 4 SEC devices
+    -b "dpaa_sec:dpaa-sec0"  -b "dpaa_sec:dpaa-sec1" -b "dpaa_sec:dpaa-sec2" -b "dpaa_sec:dpaa-sec3"
+
 Limitations
 -----------
 
diff --git a/doc/guides/nics/dpaa.rst b/doc/guides/nics/dpaa.rst
index 0a13996..620c045 100644
--- a/doc/guides/nics/dpaa.rst
+++ b/doc/guides/nics/dpaa.rst
@@ -162,6 +162,16 @@ Manager.
   this pool.
 
 
+Whitelisting & Blacklisting
+---------------------------
+
+For blacklisting a DPAA device, following commands can be used.
+
+ .. code-block:: console
+
+    <dpdk app> <EAL args> -b "dpaa_bus:fmX-macY" -- ...
+    e.g. "dpaa_bus:fm1-mac4"
+
 Supported DPAA SoCs
 -------------------
 
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index ffc90a7..2b85c9e 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -54,6 +54,8 @@ pthread_key_t dpaa_portal_key;
 
 unsigned int dpaa_svr_family;
 
+#define FSL_DPAA_BUS_NAME	dpaa_bus
+
 RTE_DEFINE_PER_LCORE(bool, dpaa_io);
 RTE_DEFINE_PER_LCORE(struct dpaa_portal_dqrr, held_bufs);
 
@@ -129,6 +131,22 @@ dpaa_sec_available(void)
 
 static void dpaa_clean_device_list(void);
 
+static struct rte_devargs *
+dpaa_devargs_lookup(struct rte_dpaa_device *dev)
+{
+	struct rte_devargs *devargs;
+	char dev_name[32];
+
+	RTE_EAL_DEVARGS_FOREACH("dpaa_bus", devargs) {
+		devargs->bus->parse(devargs->name, &dev_name);
+		if (strcmp(dev_name, dev->device.name) == 0) {
+			DPAA_BUS_INFO("**Devargs matched %s", dev_name);
+			return devargs;
+		}
+	}
+	return NULL;
+}
+
 static int
 dpaa_create_device_list(void)
 {
@@ -162,6 +180,7 @@ dpaa_create_device_list(void)
 			fman_intf->mac_idx);
 		DPAA_BUS_LOG(DEBUG, "Device added: %s", dev->name);
 		dev->device.name = dev->name;
+		dev->device.devargs = dpaa_devargs_lookup(dev);
 
 		dpaa_add_to_device_list(dev);
 	}
@@ -198,6 +217,8 @@ dpaa_create_device_list(void)
 		memset(dev->name, 0, RTE_ETH_NAME_MAX_LEN);
 		sprintf(dev->name, "dpaa-sec%d", i);
 		DPAA_BUS_LOG(DEBUG, "Device added: %s", dev->name);
+		dev->device.name = dev->name;
+		dev->device.devargs = dpaa_devargs_lookup(dev);
 
 		dpaa_add_to_device_list(dev);
 	}
@@ -357,6 +378,51 @@ dpaa_portal_finish(void *arg)
 	RTE_PER_LCORE(dpaa_io) = false;
 }
 
+static int
+rte_dpaa_bus_parse(const char *name, void *out_name)
+{
+	int i, j;
+	int max_fman = 2, max_macs = 16;
+	char *sep = strchr(name, ':');
+
+	if (strncmp(name, RTE_STR(FSL_DPAA_BUS_NAME),
+		strlen(RTE_STR(FSL_DPAA_BUS_NAME)))) {
+		return -EINVAL;
+	}
+
+	if (!sep) {
+		DPAA_BUS_ERR("Incorrect device name observed");
+		return -EINVAL;
+	}
+
+	sep = (char *) (sep + 1);
+
+	for (i = 0; i < max_fman; i++) {
+		for (j = 0; j < max_macs; j++) {
+			char fm_name[16];
+			snprintf(fm_name, 16, "fm%d-mac%d", i, j);
+			if (strcmp(fm_name, sep) == 0) {
+				if (out_name)
+					strcpy(out_name, sep);
+				return 0;
+			}
+		}
+	}
+
+	for (i = 0; i < RTE_LIBRTE_DPAA_MAX_CRYPTODEV; i++) {
+		char sec_name[16];
+
+		snprintf(sec_name, 16, "dpaa-sec%d", i);
+		if (strcmp(sec_name, sep) == 0) {
+			if (out_name)
+				strcpy(out_name, sep);
+			return 0;
+		}
+	}
+
+	return -EINVAL;
+}
+
 #define DPAA_DEV_PATH1 "/sys/devices/platform/soc/soc:fsl,dpaa"
 #define DPAA_DEV_PATH2 "/sys/devices/platform/fsl,dpaa"
 
@@ -458,22 +524,15 @@ static int
 rte_dpaa_device_match(struct rte_dpaa_driver *drv,
 		      struct rte_dpaa_device *dev)
 {
-	int ret = -1;
-
-	BUS_INIT_FUNC_TRACE();
-
 	if (!drv || !dev) {
 		DPAA_BUS_DEBUG("Invalid drv or dev received.");
-		return ret;
+		return -1;
 	}
 
-	if (drv->drv_type == dev->device_type) {
-		DPAA_BUS_INFO("Device: %s matches for driver: %s",
-			      dev->name, drv->driver.name);
-		ret = 0; /* Found a match */
-	}
+	if (drv->drv_type == dev->device_type)
+		return 0;
 
-	return ret;
+	return -1;
 }
 
 static int
@@ -484,8 +543,7 @@ rte_dpaa_bus_probe(void)
 	struct rte_dpaa_driver *drv;
 	FILE *svr_file = NULL;
 	unsigned int svr_ver;
-
-	BUS_INIT_FUNC_TRACE();
+	int probe_all = rte_dpaa_bus.bus.conf.scan_mode != RTE_BUS_SCAN_WHITELIST;
 
 	/* For each registered driver, and device, call the driver->probe */
 	TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) {
@@ -494,13 +552,19 @@ rte_dpaa_bus_probe(void)
 			if (ret)
 				continue;
 
-			if (!drv->probe)
+			if (!drv->probe ||
+			    (dev->device.devargs &&
+			    dev->device.devargs->policy == RTE_DEV_BLACKLISTED))
 				continue;
 
-			ret = drv->probe(drv, dev);
-			if (ret)
-				DPAA_BUS_ERR("Unable to probe.\n");
-
+			if (probe_all ||
+			    (dev->device.devargs &&
+			    dev->device.devargs->policy ==
+			    RTE_DEV_WHITELISTED)) {
+				ret = drv->probe(drv, dev);
+				if (ret)
+					DPAA_BUS_ERR("Unable to probe.\n");
+			}
 			break;
 		}
 	}
@@ -557,6 +621,7 @@ struct rte_dpaa_bus rte_dpaa_bus = {
 	.bus = {
 		.scan = rte_dpaa_bus_scan,
 		.probe = rte_dpaa_bus_probe,
+		.parse = rte_dpaa_bus_parse,
 		.find_device = rte_dpaa_find_device,
 		.get_iommu_class = rte_dpaa_get_iommu_class,
 	},
diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h
index 89aeac2..8f7e18c 100644
--- a/drivers/bus/dpaa/rte_dpaa_bus.h
+++ b/drivers/bus/dpaa/rte_dpaa_bus.h
@@ -15,8 +15,6 @@
 #include <of.h>
 #include <netcfg.h>
 
-#define FSL_DPAA_BUS_NAME	"FSL_DPAA_BUS"
-
 #define DPAA_MEMPOOL_OPS_NAME	"dpaa"
 
 #define DEV_TO_DPAA_DEVICE(ptr)	\
-- 
2.7.4

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

* [dpdk-dev] [PATCH 2/5] bus/fslmc: support device blacklisting
  2018-04-25 12:56 [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Hemant Agrawal
@ 2018-04-25 12:56 ` Hemant Agrawal
  2018-04-25 12:57 ` [dpdk-dev] [PATCH 3/5] bus/fslmc: minor improvements in debug logging Hemant Agrawal
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Hemant Agrawal @ 2018-04-25 12:56 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, shreyansh.jain

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 doc/guides/cryptodevs/dpaa2_sec.rst |  11 ++++
 doc/guides/nics/dpaa2.rst           |  11 ++++
 drivers/bus/fslmc/fslmc_bus.c       | 107 ++++++++++++++++++++++++++++++++----
 drivers/bus/fslmc/rte_fslmc.h       |   4 ++
 4 files changed, 122 insertions(+), 11 deletions(-)

diff --git a/doc/guides/cryptodevs/dpaa2_sec.rst b/doc/guides/cryptodevs/dpaa2_sec.rst
index 5558ea5..0fdd673 100644
--- a/doc/guides/cryptodevs/dpaa2_sec.rst
+++ b/doc/guides/cryptodevs/dpaa2_sec.rst
@@ -134,6 +134,17 @@ Supported DPAA2 SoCs
 * LS2088A/LS2048A
 * LS1088A/LS1048A
 
+Whitelisting & Blacklisting
+---------------------------
+
+For blacklisting a DPAA2 SEC device, following commands can be used.
+
+ .. code-block:: console
+
+    <dpdk app> <EAL args> -b "fslmc:dpseci.x" -- ...
+
+Where x is the device object id as configured in resource container.
+
 Limitations
 -----------
 
diff --git a/doc/guides/nics/dpaa2.rst b/doc/guides/nics/dpaa2.rst
index 8e38eff..7d069aa 100644
--- a/doc/guides/nics/dpaa2.rst
+++ b/doc/guides/nics/dpaa2.rst
@@ -561,6 +561,17 @@ which are lower than logging ``level``.
 Using ``pmd.dpaa2`` as log matching criteria, all PMD logs can be enabled
 which are lower than logging ``level``.
 
+Whitelisting & Blacklisting
+---------------------------
+
+For blacklisting a DPAA2 device, following commands can be used.
+
+ .. code-block:: console
+
+    <dpdk app> <EAL args> -b "fslmc:dpni.x" -- ...
+
+Where x is the device object id as configured in resource container.
+
 Limitations
 -----------
 
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index d0b3261..e7c8cc6 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -23,6 +23,7 @@
 int dpaa2_logtype_bus;
 
 #define VFIO_IOMMU_GROUP_PATH "/sys/kernel/iommu_groups"
+#define FSLMC_BUS_NAME	fslmc
 
 struct rte_fslmc_bus rte_fslmc_bus;
 uint8_t dpaa2_virt_mode;
@@ -93,6 +94,22 @@ insert_in_device_list(struct rte_dpaa2_device *newdev)
 		TAILQ_INSERT_TAIL(&rte_fslmc_bus.device_list, newdev, next);
 }
 
+static struct rte_devargs *
+fslmc_devargs_lookup(struct rte_dpaa2_device *dev)
+{
+	struct rte_devargs *devargs;
+	char dev_name[32];
+
+	RTE_EAL_DEVARGS_FOREACH("fslmc", devargs) {
+		devargs->bus->parse(devargs->name, &dev_name);
+		if (strcmp(dev_name, dev->device.name) == 0) {
+			DPAA2_BUS_INFO("**Devargs matched %s", dev_name);
+			return devargs;
+		}
+	}
+	return NULL;
+}
+
 static void
 dump_device_list(void)
 {
@@ -182,6 +199,7 @@ scan_one_fslmc_device(char *dev_name)
 		DPAA2_BUS_ERR("Unable to clone device name. Out of memory");
 		goto cleanup;
 	}
+	dev->device.devargs = fslmc_devargs_lookup(dev);
 
 	/* Add device in the fslmc device list */
 	insert_in_device_list(dev);
@@ -200,6 +218,54 @@ scan_one_fslmc_device(char *dev_name)
 }
 
 static int
+rte_fslmc_parse(const char *name, void *addr)
+{
+	uint16_t dev_id;
+	char *t_ptr;
+	char *sep = strchr(name, ':');
+
+	if (strncmp(name, RTE_STR(FSLMC_BUS_NAME),
+		strlen(RTE_STR(FSLMC_BUS_NAME)))) {
+		return -EINVAL;
+	}
+
+	if (!sep) {
+		DPAA2_BUS_ERR("Incorrect device name observed");
+		return -EINVAL;
+	}
+
+	t_ptr = (char *)(sep + 1);
+
+	if (strncmp("dpni", t_ptr, 4) &&
+	    strncmp("dpseci", t_ptr, 6) &&
+	    strncmp("dpcon", t_ptr, 5) &&
+	    strncmp("dpbp", t_ptr, 4) &&
+	    strncmp("dpio", t_ptr, 4) &&
+	    strncmp("dpci", t_ptr, 4) &&
+	    strncmp("dpmcp", t_ptr, 5) &&
+	    strncmp("dpdmai", t_ptr, 6)) {
+		DPAA2_BUS_ERR("Unknown or unsupported device");
+		return -EINVAL;
+	}
+
+	t_ptr = strchr(name, '.');
+	if (!t_ptr) {
+		DPAA2_BUS_ERR("Incorrect device string observed (%s)", t_ptr);
+		return -EINVAL;
+	}
+
+	t_ptr = (char *)(t_ptr + 1);
+	if (sscanf(t_ptr, "%hu", &dev_id) <= 0) {
+		DPAA2_BUS_ERR("Incorrect device string observed (%s)", t_ptr);
+		return -EINVAL;
+	}
+
+	if (addr)
+		strcpy(addr, (char *)(sep + 1));
+	return 0;
+}
+
+static int
 rte_fslmc_scan(void)
 {
 	int ret;
@@ -274,6 +340,8 @@ static int
 rte_fslmc_probe(void)
 {
 	int ret = 0;
+	int probe_all;
+
 	struct rte_dpaa2_device *dev;
 	struct rte_dpaa2_driver *drv;
 
@@ -303,6 +371,8 @@ rte_fslmc_probe(void)
 		return 0;
 	}
 
+	probe_all = rte_fslmc_bus.bus.conf.scan_mode != RTE_BUS_SCAN_WHITELIST;
+
 	TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) {
 		TAILQ_FOREACH(drv, &rte_fslmc_bus.driver_list, next) {
 			ret = rte_fslmc_match(drv, dev);
@@ -312,9 +382,21 @@ rte_fslmc_probe(void)
 			if (!drv->probe)
 				continue;
 
-			ret = drv->probe(drv, dev);
-			if (ret)
-				DPAA2_BUS_ERR("Unable to probe");
+			if (dev->device.devargs &&
+			  dev->device.devargs->policy == RTE_DEV_BLACKLISTED) {
+				DPAA2_BUS_LOG(DEBUG, "%s Blacklisted, skipping",
+					      dev->device.name);
+				continue;
+			}
+
+			if (probe_all ||
+			   (dev->device.devargs &&
+			   dev->device.devargs->policy ==
+			   RTE_DEV_WHITELISTED)) {
+				ret = drv->probe(drv, dev);
+				if (ret)
+					DPAA2_BUS_ERR("Unable to probe");
+			}
 			break;
 		}
 	}
@@ -329,17 +411,19 @@ static struct rte_device *
 rte_fslmc_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,
 		      const void *data)
 {
+	const struct rte_dpaa2_device *dstart;
 	struct rte_dpaa2_device *dev;
 
-	TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) {
-		if (start != NULL) {
-			if (&dev->device == start)
-				start = NULL;  /* starting point found */
-			continue;
-		}
-
+	if (start != NULL) {
+		dstart = RTE_DEV_TO_FSLMC_CONST(start);
+		dev = TAILQ_NEXT(dstart, next);
+	} else {
+		dev = TAILQ_FIRST(&rte_fslmc_bus.device_list);
+	}
+	while (dev != NULL) {
 		if (cmp(&dev->device, data) == 0)
 			return &dev->device;
+		dev = TAILQ_NEXT(dev, next);
 	}
 
 	return NULL;
@@ -422,6 +506,7 @@ struct rte_fslmc_bus rte_fslmc_bus = {
 	.bus = {
 		.scan = rte_fslmc_scan,
 		.probe = rte_fslmc_probe,
+		.parse = rte_fslmc_parse,
 		.find_device = rte_fslmc_find_device,
 		.get_iommu_class = rte_dpaa2_get_iommu_class,
 	},
@@ -430,7 +515,7 @@ struct rte_fslmc_bus rte_fslmc_bus = {
 	.device_count = {0},
 };
 
-RTE_REGISTER_BUS(fslmc, rte_fslmc_bus.bus);
+RTE_REGISTER_BUS(FSLMC_BUS_NAME, rte_fslmc_bus.bus);
 
 RTE_INIT(fslmc_init_log);
 static void
diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h
index 69d0fec..de40e86 100644
--- a/drivers/bus/fslmc/rte_fslmc.h
+++ b/drivers/bus/fslmc/rte_fslmc.h
@@ -31,6 +31,7 @@ extern "C" {
 #include <rte_dev.h>
 #include <rte_bus.h>
 #include <rte_tailq.h>
+#include <rte_devargs.h>
 
 #include <fslmc_vfio.h>
 
@@ -49,6 +50,9 @@ struct rte_dpaa2_driver;
 TAILQ_HEAD(rte_fslmc_device_list, rte_dpaa2_device);
 TAILQ_HEAD(rte_fslmc_driver_list, rte_dpaa2_driver);
 
+#define RTE_DEV_TO_FSLMC_CONST(ptr) \
+	container_of(ptr, const struct rte_dpaa2_device, device)
+
 extern struct rte_fslmc_bus rte_fslmc_bus;
 
 enum rte_dpaa2_dev_type {
-- 
2.7.4

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

* [dpdk-dev] [PATCH 3/5] bus/fslmc: minor improvements in debug logging
  2018-04-25 12:56 [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Hemant Agrawal
  2018-04-25 12:56 ` [dpdk-dev] [PATCH 2/5] bus/fslmc: " Hemant Agrawal
@ 2018-04-25 12:57 ` Hemant Agrawal
  2018-04-25 12:57 ` [dpdk-dev] [PATCH 4/5] net/dpaa: fix the xstats implementation Hemant Agrawal
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Hemant Agrawal @ 2018-04-25 12:57 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, shreyansh.jain

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/fslmc/fslmc_bus.c            | 4 ++--
 drivers/bus/fslmc/fslmc_vfio.c           | 7 ++-----
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 -
 drivers/net/dpaa2/dpaa2_ethdev.c         | 2 +-
 4 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index e7c8cc6..d95d392 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -122,9 +122,9 @@ dump_device_list(void)
 	local_log_level = rte_log_get_level(dpaa2_logtype_bus);
 	if (global_log_level == RTE_LOG_DEBUG ||
 	    local_log_level == RTE_LOG_DEBUG) {
-		DPAA2_BUS_DEBUG("List of devices scanned on bus:");
+		DPAA2_BUS_LOG(DEBUG, "List of devices scanned on bus:");
 		TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) {
-			DPAA2_BUS_DEBUG("%s", dev->device.name);
+			DPAA2_BUS_LOG(DEBUG, "\t\t%s", dev->device.name);
 		}
 	}
 }
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 675d160..c35c095 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -401,9 +401,6 @@ static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj)
 		goto MC_FAILURE;
 	}
 
-	DPAA2_BUS_DEBUG("Region offset = 0x%"PRIx64"  , region size = %"PRIu64"",
-			(uint64_t)reg_info.offset, (uint64_t)reg_info.size);
-
 	v_addr = (size_t)mmap(NULL, reg_info.size,
 		PROT_WRITE | PROT_READ, MAP_SHARED,
 		mc_fd, reg_info.offset);
@@ -563,8 +560,8 @@ fslmc_process_iodevices(struct rte_dpaa2_device *dev)
 		break;
 	}
 
-	DPAA2_BUS_DEBUG("Device (%s) abstracted from VFIO",
-			dev->device.name);
+	DPAA2_BUS_LOG(DEBUG, "Device (%s) abstracted from VFIO",
+		      dev->device.name);
 	return 0;
 }
 
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index a741626..99f70be 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -189,7 +189,6 @@ configure_dpio_qbman_swp(struct dpaa2_dpio_dev *dpio_dev)
 		return -1;
 	}
 
-	DPAA2_BUS_DEBUG("Allocated  DPIO Portal[%p]", dpio_dev->dpio);
 	dpio_dev->dpio->regs = dpio_dev->mc_portal;
 	if (dpio_open(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->hw_id,
 		      &dpio_dev->token)) {
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 54ab9eb..7151d98 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -1894,7 +1894,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 	eth_dev->rx_pkt_burst = dpaa2_dev_prefetch_rx;
 	eth_dev->tx_pkt_burst = dpaa2_dev_tx;
 
-	DPAA2_PMD_INFO("%s: netdev created", eth_dev->data->name);
+	RTE_LOG(INFO, PMD, "%s: netdev created\n", eth_dev->data->name);
 	return 0;
 init_err:
 	dpaa2_dev_uninit(eth_dev);
-- 
2.7.4

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

* [dpdk-dev] [PATCH 4/5] net/dpaa: fix the xstats implementation
  2018-04-25 12:56 [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Hemant Agrawal
  2018-04-25 12:56 ` [dpdk-dev] [PATCH 2/5] bus/fslmc: " Hemant Agrawal
  2018-04-25 12:57 ` [dpdk-dev] [PATCH 3/5] bus/fslmc: minor improvements in debug logging Hemant Agrawal
@ 2018-04-25 12:57 ` Hemant Agrawal
  2018-04-25 12:57 ` [dpdk-dev] [PATCH 5/5] bus/dpaa: improve the dynamic logging Hemant Agrawal
  2018-05-09  5:41 ` [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Shreyansh Jain
  4 siblings, 0 replies; 7+ messages in thread
From: Hemant Agrawal @ 2018-04-25 12:57 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, shreyansh.jain, stable

Some of the applications are expecting that if n is 0, it shall
return the supported number of stats. e.g. VPP

Fixes: b21ed3e2a16d ("net/dpaa: support extended statistics")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index b2740b4..136f716 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -354,12 +354,12 @@ dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 	unsigned int i = 0, num = RTE_DIM(dpaa_xstats_strings);
 	uint64_t values[sizeof(struct dpaa_if_stats) / 8];
 
-	if (xstats == NULL)
-		return 0;
-
 	if (n < num)
 		return num;
 
+	if (xstats == NULL)
+		return 0;
+
 	fman_if_stats_get_all(dpaa_intf->fif, values,
 			      sizeof(struct dpaa_if_stats) / 8);
 
-- 
2.7.4

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

* [dpdk-dev] [PATCH 5/5] bus/dpaa: improve the dynamic logging
  2018-04-25 12:56 [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Hemant Agrawal
                   ` (2 preceding siblings ...)
  2018-04-25 12:57 ` [dpdk-dev] [PATCH 4/5] net/dpaa: fix the xstats implementation Hemant Agrawal
@ 2018-04-25 12:57 ` Hemant Agrawal
  2018-05-09  5:41 ` [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Shreyansh Jain
  4 siblings, 0 replies; 7+ messages in thread
From: Hemant Agrawal @ 2018-04-25 12:57 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, shreyansh.jain

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/base/fman/fman.c |  2 +-
 drivers/bus/dpaa/dpaa_bus.c       | 16 +++++-----------
 drivers/bus/dpaa/rte_dpaa_logs.h  | 11 ++++++-----
 3 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c
index be91da4..bdb7004 100644
--- a/drivers/bus/dpaa/base/fman/fman.c
+++ b/drivers/bus/dpaa/base/fman/fman.c
@@ -504,7 +504,7 @@ fman_if_init(const struct device_node *dpa_node)
 
 	/* Parsing of the network interface is complete, add it to the list */
 	DPAA_BUS_LOG(DEBUG, "Found %s, Tx Channel = %x, FMAN = %x,"
-		    "Port ID = %x\n",
+		    "Port ID = %x",
 		    dname, __if->__if.tx_channel_id, __if->__if.fman_idx,
 		    __if->__if.mac_idx);
 
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 2b85c9e..2046206 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -178,7 +178,7 @@ dpaa_create_device_list(void)
 		memset(dev->name, 0, RTE_ETH_NAME_MAX_LEN);
 		sprintf(dev->name, "fm%d-mac%d", (fman_intf->fman_idx + 1),
 			fman_intf->mac_idx);
-		DPAA_BUS_LOG(DEBUG, "Device added: %s", dev->name);
+		DPAA_BUS_LOG(INFO, "%s netdev added", dev->name);
 		dev->device.name = dev->name;
 		dev->device.devargs = dpaa_devargs_lookup(dev);
 
@@ -216,7 +216,7 @@ dpaa_create_device_list(void)
 		 */
 		memset(dev->name, 0, RTE_ETH_NAME_MAX_LEN);
 		sprintf(dev->name, "dpaa-sec%d", i);
-		DPAA_BUS_LOG(DEBUG, "Device added: %s", dev->name);
+		DPAA_BUS_LOG(INFO, "%s cryptodev added", dev->name);
 		dev->device.name = dev->name;
 		dev->device.devargs = dpaa_devargs_lookup(dev);
 
@@ -461,14 +461,11 @@ rte_dpaa_bus_scan(void)
 		return 0;
 	}
 
-	DPAA_BUS_LOG(DEBUG, "Bus: Address of netcfg=%p, Ethports=%d",
-		     dpaa_netcfg, dpaa_netcfg->num_ethports);
-
 #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER
 	dump_netcfg(dpaa_netcfg);
 #endif
 
-	DPAA_BUS_LOG(DEBUG, "Number of devices = %d\n",
+	DPAA_BUS_LOG(DEBUG, "Number of ethernet devices = %d",
 		     dpaa_netcfg->num_ethports);
 	ret = dpaa_create_device_list();
 	if (ret) {
@@ -486,9 +483,6 @@ rte_dpaa_bus_scan(void)
 		return ret;
 	}
 
-	DPAA_BUS_LOG(DEBUG, "dpaa_portal_key=%u, ret=%d\n",
-		    (unsigned int)dpaa_portal_key, ret);
-
 	return 0;
 }
 
@@ -644,11 +638,11 @@ dpaa_init_log(void)
 	if (dpaa_logtype_mempool >= 0)
 		rte_log_set_level(dpaa_logtype_mempool, RTE_LOG_NOTICE);
 
-	dpaa_logtype_pmd = rte_log_register("pmd.dpaa");
+	dpaa_logtype_pmd = rte_log_register("pmd.net.dpaa");
 	if (dpaa_logtype_pmd >= 0)
 		rte_log_set_level(dpaa_logtype_pmd, RTE_LOG_NOTICE);
 
-	dpaa_logtype_eventdev = rte_log_register("eventdev.dpaa");
+	dpaa_logtype_eventdev = rte_log_register("pmd.event.dpaa");
 	if (dpaa_logtype_eventdev >= 0)
 		rte_log_set_level(dpaa_logtype_eventdev, RTE_LOG_NOTICE);
 }
diff --git a/drivers/bus/dpaa/rte_dpaa_logs.h b/drivers/bus/dpaa/rte_dpaa_logs.h
index 0fd70bb..e414354 100644
--- a/drivers/bus/dpaa/rte_dpaa_logs.h
+++ b/drivers/bus/dpaa/rte_dpaa_logs.h
@@ -15,10 +15,7 @@ extern int dpaa_logtype_pmd;
 extern int dpaa_logtype_eventdev;
 
 #define DPAA_BUS_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "%s(): " fmt "\n", \
-		__func__, ##args)
-
-#define BUS_INIT_FUNC_TRACE() DPAA_BUS_LOG(DEBUG, " >>")
+	rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "dpaa: " fmt "\n", ##args)
 
 #ifdef RTE_LIBRTE_DPAA_DEBUG_BUS
 #define DPAA_BUS_HWWARN(cond, fmt, args...) \
@@ -31,7 +28,11 @@ extern int dpaa_logtype_eventdev;
 #endif
 
 #define DPAA_BUS_DEBUG(fmt, args...) \
-	DPAA_BUS_LOG(DEBUG, fmt, ## args)
+	rte_log(RTE_LOG_DEBUG, dpaa_logtype_bus, "dpaa: %s(): " fmt "\n", \
+		__func__, ##args)
+
+#define BUS_INIT_FUNC_TRACE() DPAA_BUS_DEBUG(" >>")
+
 #define DPAA_BUS_INFO(fmt, args...) \
 	DPAA_BUS_LOG(INFO, fmt, ## args)
 #define DPAA_BUS_ERR(fmt, args...) \
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting
  2018-04-25 12:56 [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Hemant Agrawal
                   ` (3 preceding siblings ...)
  2018-04-25 12:57 ` [dpdk-dev] [PATCH 5/5] bus/dpaa: improve the dynamic logging Hemant Agrawal
@ 2018-05-09  5:41 ` Shreyansh Jain
  2018-05-13 22:38   ` Thomas Monjalon
  4 siblings, 1 reply; 7+ messages in thread
From: Shreyansh Jain @ 2018-05-09  5:41 UTC (permalink / raw)
  To: Hemant Agrawal, ferruh.yigit; +Cc: dev

On Wednesday 25 April 2018 06:26 PM, Hemant Agrawal wrote:
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
>   doc/guides/cryptodevs/dpaa_sec.rst |  13 +++++
>   doc/guides/nics/dpaa.rst           |  10 ++++
>   drivers/bus/dpaa/dpaa_bus.c        | 101 ++++++++++++++++++++++++++++++-------
>   drivers/bus/dpaa/rte_dpaa_bus.h    |   2 -
>   4 files changed, 106 insertions(+), 20 deletions(-)
> 

For the complete series of 5 patches:

Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

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

* Re: [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting
  2018-05-09  5:41 ` [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Shreyansh Jain
@ 2018-05-13 22:38   ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2018-05-13 22:38 UTC (permalink / raw)
  To: Hemant Agrawal; +Cc: dev, Shreyansh Jain, ferruh.yigit

09/05/2018 07:41, Shreyansh Jain:
> On Wednesday 25 April 2018 06:26 PM, Hemant Agrawal wrote:
> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> > ---
> >   doc/guides/cryptodevs/dpaa_sec.rst |  13 +++++
> >   doc/guides/nics/dpaa.rst           |  10 ++++
> >   drivers/bus/dpaa/dpaa_bus.c        | 101 ++++++++++++++++++++++++++++++-------
> >   drivers/bus/dpaa/rte_dpaa_bus.h    |   2 -
> >   4 files changed, 106 insertions(+), 20 deletions(-)
> > 
> 
> For the complete series of 5 patches:
> 
> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

Applied, thanks

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

end of thread, other threads:[~2018-05-13 22:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 12:56 [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Hemant Agrawal
2018-04-25 12:56 ` [dpdk-dev] [PATCH 2/5] bus/fslmc: " Hemant Agrawal
2018-04-25 12:57 ` [dpdk-dev] [PATCH 3/5] bus/fslmc: minor improvements in debug logging Hemant Agrawal
2018-04-25 12:57 ` [dpdk-dev] [PATCH 4/5] net/dpaa: fix the xstats implementation Hemant Agrawal
2018-04-25 12:57 ` [dpdk-dev] [PATCH 5/5] bus/dpaa: improve the dynamic logging Hemant Agrawal
2018-05-09  5:41 ` [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting Shreyansh Jain
2018-05-13 22:38   ` Thomas Monjalon

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