DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 5/7] net/ixgbe/base: use clause 22 MDIO functions for Marvell PHYs
From: Wei Dai @ 2017-01-12 14:53 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, helin.zhang, konstantin.ananyev, Wei Dai
In-Reply-To: <1484232811-39257-1-git-send-email-wei.dai@intel.com>

This patch sets the MDIO(Management Data Input/Output Interface)
read/write function ponters for Marvell PHYs on some X550 platforms
to use the clause 22 functions. Marvell PHYs do not support clause 45.

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_x550.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c
index 1fd7ffb..e15054b 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.c
+++ b/drivers/net/ixgbe/base/ixgbe_x550.c
@@ -2373,6 +2373,10 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
 		/* set up for CS4227 usage */
 		hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM;
 		break;
+	case IXGBE_DEV_ID_X550EM_X_1G_T:
+		phy->ops.read_reg_mdi = ixgbe_read_phy_reg_mdi_22;
+		phy->ops.write_reg_mdi = ixgbe_write_phy_reg_mdi_22;
+		break;
 	default:
 		break;
 	}
-- 
2.7.4

^ permalink raw reply related

* [PATCH v2 4/7] net/ixgbe/base: support Marvell 1000BASE-T PHYs
From: Wei Dai @ 2017-01-12 14:53 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, helin.zhang, konstantin.ananyev, Wei Dai
In-Reply-To: <1484232811-39257-1-git-send-email-wei.dai@intel.com>

This patch adds initial support for Marvell 1000BASE-T PHYs
on some X550 platforms.
Firmware owns the link config for Marvell PHYs on these platforms,
software should not touch it.
Also these platforms are not capable of speeds lower than 1Gb.

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_phy.c  | 4 ++++
 drivers/net/ixgbe/base/ixgbe_type.h | 1 +
 drivers/net/ixgbe/base/ixgbe_x550.c | 8 ++++++++
 3 files changed, 13 insertions(+)

diff --git a/drivers/net/ixgbe/base/ixgbe_phy.c b/drivers/net/ixgbe/base/ixgbe_phy.c
index 5ad4dfe..e0d7125 100644
--- a/drivers/net/ixgbe/base/ixgbe_phy.c
+++ b/drivers/net/ixgbe/base/ixgbe_phy.c
@@ -472,6 +472,10 @@ enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
 	case X557_PHY_ID2:
 		phy_type = ixgbe_phy_x550em_ext_t;
 		break;
+	case IXGBE_M88E1500_E_PHY_ID:
+	case IXGBE_M88E1543_E_PHY_ID:
+		phy_type = ixgbe_phy_ext_1g_t;
+		break;
 	default:
 		phy_type = ixgbe_phy_unknown;
 		break;
diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h
index dea210e..bb1f85b 100644
--- a/drivers/net/ixgbe/base/ixgbe_type.h
+++ b/drivers/net/ixgbe/base/ixgbe_type.h
@@ -3647,6 +3647,7 @@ enum ixgbe_phy_type {
 	ixgbe_phy_x550em_kx4,
 	ixgbe_phy_x550em_xfi,
 	ixgbe_phy_x550em_ext_t,
+	ixgbe_phy_ext_1g_t,
 	ixgbe_phy_cu_unknown,
 	ixgbe_phy_qt,
 	ixgbe_phy_xaui,
diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c
index b23d479..1fd7ffb 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.c
+++ b/drivers/net/ixgbe/base/ixgbe_x550.c
@@ -1975,6 +1975,7 @@ s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw,
 			*speed = IXGBE_LINK_SPEED_10GB_FULL;
 	} else {
 		switch (hw->phy.type) {
+		case ixgbe_phy_ext_1g_t:
 		case ixgbe_phy_sgmii:
 			*speed = IXGBE_LINK_SPEED_1GB_FULL;
 			break;
@@ -2399,6 +2400,10 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
 		phy->ops.read_reg = ixgbe_read_phy_reg_x550em;
 		phy->ops.write_reg = ixgbe_write_phy_reg_x550em;
 		break;
+	case ixgbe_phy_ext_1g_t:
+		/* link is managed by FW */
+		phy->ops.setup_link = NULL;
+		break;
 	case ixgbe_phy_x550em_xfi:
 		/* link is managed by HW */
 		phy->ops.setup_link = NULL;
@@ -3706,6 +3711,9 @@ u32 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw)
 	case ixgbe_phy_sgmii:
 		physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX;
 		break;
+	case ixgbe_phy_ext_1g_t:
+		physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
+		break;
 	default:
 		break;
 	}
-- 
2.7.4

^ permalink raw reply related

* [PATCH v2 3/7] net/ixgbe/base: configure speeds for KR/KX backplane
From: Wei Dai @ 2017-01-12 14:53 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, helin.zhang, konstantin.ananyev, Wei Dai
In-Reply-To: <1484232811-39257-1-git-send-email-wei.dai@intel.com>

This patch ensures that the advertised link speeds are configured
for KR/KX backplane on some new platform. Without this patch the
link remains at 1G when resuming from low power after being
downshifted by LPLU(Low Power Link Up).
This patch ensures that the advertise speeds are not changed
for 2.5G configurations.

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_x550.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c
index 2f7f446..b23d479 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.c
+++ b/drivers/net/ixgbe/base/ixgbe_x550.c
@@ -2627,12 +2627,11 @@ s32 ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw)
 /**
  *  ixgbe_setup_kr_x550em - Configure the KR PHY.
  *  @hw: pointer to hardware structure
- *
- *  Configures the integrated KR PHY for X550EM_x.
  **/
 s32 ixgbe_setup_kr_x550em(struct ixgbe_hw *hw)
 {
-	if (hw->mac.type != ixgbe_mac_X550EM_x)
+	/* leave link alone for 2.5G */
+	if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL)
 		return IXGBE_SUCCESS;
 
 	return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised);
-- 
2.7.4

^ permalink raw reply related

* [PATCH v2 2/7] net/ixgbe/base: remove a compiler warning
From: Wei Dai @ 2017-01-12 14:53 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, helin.zhang, konstantin.ananyev, Wei Dai
In-Reply-To: <1484232811-39257-1-git-send-email-wei.dai@intel.com>

This patch fixes a compiler warning.
In ixgbe_init_led_link_act_generic() of
drivers/net/ixgbe/base/ixgbe_common.c, u16 i will
make some C compiler generate a warning for the line
mac->led_link_act = i where led_link_act is u8 .

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_common.c b/drivers/net/ixgbe/base/ixgbe_common.c
index 18bb18c..0dd33b8 100644
--- a/drivers/net/ixgbe/base/ixgbe_common.c
+++ b/drivers/net/ixgbe/base/ixgbe_common.c
@@ -1150,7 +1150,7 @@ s32 ixgbe_init_led_link_act_generic(struct ixgbe_hw *hw)
 {
 	struct ixgbe_mac_info *mac = &hw->mac;
 	u32 led_reg, led_mode;
-	u16 i;
+	u8 i;
 
 	led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH v2 1/7] net/ixgbe/base: support XFI backplane for X550
From: Wei Dai @ 2017-01-12 14:53 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, helin.zhang, konstantin.ananyev, Wei Dai
In-Reply-To: <1484232811-39257-1-git-send-email-wei.dai@intel.com>

This patch adds initial support for a XFI backplane interface on some
future new platforms. The XFI backplane requires a custom tuned link.
Hardware/Firmware owns the link config for XF backplane and software
must not interfere with it.

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_api.c  |  1 +
 drivers/net/ixgbe/base/ixgbe_type.h |  2 ++
 drivers/net/ixgbe/base/ixgbe_x550.c | 11 +++++++++++
 3 files changed, 14 insertions(+)

diff --git a/drivers/net/ixgbe/base/ixgbe_api.c b/drivers/net/ixgbe/base/ixgbe_api.c
index 0ddafcb..270a97d 100644
--- a/drivers/net/ixgbe/base/ixgbe_api.c
+++ b/drivers/net/ixgbe/base/ixgbe_api.c
@@ -205,6 +205,7 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw *hw)
 	case IXGBE_DEV_ID_X550EM_X_10G_T:
 	case IXGBE_DEV_ID_X550EM_X_1G_T:
 	case IXGBE_DEV_ID_X550EM_X_SFP:
+	case IXGBE_DEV_ID_X550EM_X_XFI:
 		hw->mac.type = ixgbe_mac_X550EM_x;
 		hw->mvals = ixgbe_mvals_X550EM_x;
 		break;
diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h
index b609f6e..dea210e 100644
--- a/drivers/net/ixgbe/base/ixgbe_type.h
+++ b/drivers/net/ixgbe/base/ixgbe_type.h
@@ -146,6 +146,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #define IXGBE_DEV_ID_X550EM_X_SFP		0x15AC
 #define IXGBE_DEV_ID_X550EM_X_10G_T		0x15AD
 #define IXGBE_DEV_ID_X550EM_X_1G_T		0x15AE
+#define IXGBE_DEV_ID_X550EM_X_XFI		0x15B0
 #define IXGBE_DEV_ID_X550_VF_HV			0x1564
 #define IXGBE_DEV_ID_X550_VF			0x1565
 #define IXGBE_DEV_ID_X550EM_A_VF		0x15C5
@@ -3644,6 +3645,7 @@ enum ixgbe_phy_type {
 	ixgbe_phy_aq,
 	ixgbe_phy_x550em_kr,
 	ixgbe_phy_x550em_kx4,
+	ixgbe_phy_x550em_xfi,
 	ixgbe_phy_x550em_ext_t,
 	ixgbe_phy_cu_unknown,
 	ixgbe_phy_qt,
diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c
index 782ca91..2f7f446 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.c
+++ b/drivers/net/ixgbe/base/ixgbe_x550.c
@@ -450,6 +450,9 @@ STATIC s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw)
 	case IXGBE_DEV_ID_X550EM_X_KX4:
 		hw->phy.type = ixgbe_phy_x550em_kx4;
 		break;
+	case IXGBE_DEV_ID_X550EM_X_XFI:
+		hw->phy.type = ixgbe_phy_x550em_xfi;
+		break;
 	case IXGBE_DEV_ID_X550EM_X_KR:
 	case IXGBE_DEV_ID_X550EM_A_KR:
 	case IXGBE_DEV_ID_X550EM_A_KR_L:
@@ -1573,6 +1576,7 @@ enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw)
 	switch (hw->device_id) {
 	case IXGBE_DEV_ID_X550EM_X_KR:
 	case IXGBE_DEV_ID_X550EM_X_KX4:
+	case IXGBE_DEV_ID_X550EM_X_XFI:
 	case IXGBE_DEV_ID_X550EM_A_KR:
 	case IXGBE_DEV_ID_X550EM_A_KR_L:
 		media_type = ixgbe_media_type_backplane;
@@ -2395,6 +2399,12 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
 		phy->ops.read_reg = ixgbe_read_phy_reg_x550em;
 		phy->ops.write_reg = ixgbe_write_phy_reg_x550em;
 		break;
+	case ixgbe_phy_x550em_xfi:
+		/* link is managed by HW */
+		phy->ops.setup_link = NULL;
+		phy->ops.read_reg = ixgbe_read_phy_reg_x550em;
+		phy->ops.write_reg = ixgbe_write_phy_reg_x550em;
+		break;
 	case ixgbe_phy_x550em_ext_t:
 		/* If internal link mode is XFI, then setup iXFI internal link,
 		 * else setup KR now.
@@ -3669,6 +3679,7 @@ u32 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw)
 
 	switch (hw->phy.type) {
 	case ixgbe_phy_x550em_kr:
+	case ixgbe_phy_x550em_xfi:
 		physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KR |
 				 IXGBE_PHYSICAL_LAYER_1000BASE_KX;
 		break;
-- 
2.7.4

^ permalink raw reply related

* [PATCH v2 0/7] update ixgbe shared code to version 2017-01-05
From: Wei Dai @ 2017-01-12 14:53 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, helin.zhang, konstantin.ananyev, Wei Dai

This patch set updates ixgbe shared code to cid-ixgbe.2017.01.05.tar.gz .
The shared codes are in drivers/net/ixgbe/base/ and are developed by 
another Intel team.

This patch add more supports to some future new Intel ixgbe X550  platforms.
A new device id and two PHY types are introduced and also 
add some debug traces to help debugging.

Wei Dai (7):
  net/ixgbe/base: support XFI backplane for X550
  net/ixgbe/base: remove a compiler warning
  net/ixgbe/base: configure speeds for KR/KX backplane
  net/ixgbe/base: support Marvell 1000BASE-T PHYs
  net/ixgbe/base: use clause 22 MDIO functions for Marvell PHYs
  net/ixgbe/base: add some debug traces
  net/ixgbe/base: update version of shared code

 drivers/net/ixgbe/base/README         |  2 +-
 drivers/net/ixgbe/base/ixgbe_api.c    |  1 +
 drivers/net/ixgbe/base/ixgbe_common.c |  9 +++-
 drivers/net/ixgbe/base/ixgbe_phy.c    | 20 +++++++--
 drivers/net/ixgbe/base/ixgbe_type.h   |  3 ++
 drivers/net/ixgbe/base/ixgbe_x540.c   | 11 ++++-
 drivers/net/ixgbe/base/ixgbe_x550.c   | 77 ++++++++++++++++++++++++++++++-----
 7 files changed, 104 insertions(+), 19 deletions(-)

-- 
2.7.4

^ permalink raw reply

* [PATCH] examples/ipsec-secgw: add support for SHA256 HMAC
From: zbigniew.bodek @ 2017-01-12 14:52 UTC (permalink / raw)
  To: dev; +Cc: sergio.gonzalez.monroy, jerin.jacob, Zbigniew Bodek

From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>

Add minor adjustments to support SHA256 HMAC:
- extend maximum key length to match SHA256 HMAC
- add SHA256 HMAC parameters and configuration string
- add SHA256 HMAC to inbound and outbound cases

Signed-off-by: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
---
 examples/ipsec-secgw/esp.c   | 2 ++
 examples/ipsec-secgw/ipsec.h | 2 +-
 examples/ipsec-secgw/sa.c    | 6 ++++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c
index 9715ea9..e77afa0 100644
--- a/examples/ipsec-secgw/esp.c
+++ b/examples/ipsec-secgw/esp.c
@@ -122,6 +122,7 @@
 	switch (sa->auth_algo) {
 	case RTE_CRYPTO_AUTH_NULL:
 	case RTE_CRYPTO_AUTH_SHA1_HMAC:
+	case RTE_CRYPTO_AUTH_SHA256_HMAC:
 		sym_cop->auth.data.offset = ip_hdr_len;
 		sym_cop->auth.data.length = sizeof(struct esp_hdr) +
 			sa->iv_len + payload_len;
@@ -354,6 +355,7 @@
 	switch (sa->auth_algo) {
 	case RTE_CRYPTO_AUTH_NULL:
 	case RTE_CRYPTO_AUTH_SHA1_HMAC:
+	case RTE_CRYPTO_AUTH_SHA256_HMAC:
 		sym_cop->auth.data.offset = ip_hdr_len;
 		sym_cop->auth.data.length = sizeof(struct esp_hdr) +
 			sa->iv_len + pad_payload_len;
diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h
index dbc8c2c..fe42661 100644
--- a/examples/ipsec-secgw/ipsec.h
+++ b/examples/ipsec-secgw/ipsec.h
@@ -90,7 +90,7 @@ struct ip_addr {
 	} ip;
 };
 
-#define MAX_KEY_SIZE		20
+#define MAX_KEY_SIZE		32
 
 struct ipsec_sa {
 	uint32_t spi;
diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index 8c4406c..39624c4 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -114,6 +114,12 @@ struct supported_auth_algo {
 		.key_len = 20
 	},
 	{
+		.keyword = "sha256-hmac",
+		.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
+		.digest_len = 12,
+		.key_len = 32
+	},
+	{
 		.keyword = "aes-128-gcm",
 		.algo = RTE_CRYPTO_AUTH_AES_GCM,
 		.digest_len = 16,
-- 
1.9.1

^ permalink raw reply related

* Re: [PATCH v6 4/4] latencystats: added new library for latency stats
From: Remy Horton @ 2017-01-12 14:44 UTC (permalink / raw)
  To: Thomas Monjalon, Reshma Pattan; +Cc: dev, olivier.matz
In-Reply-To: <8494765.8zaa745I9T@xps13>


On 12/01/2017 13:41, Thomas Monjalon wrote:
> 2017-01-12 00:03, Remy Horton:
>> Add a library designed to calculate latency statistics and report them
>> to the application when queried. The library measures minimum, average and
>> maximum latencies, and jitter in nano seconds. The current implementation
>> supports global latency stats, i.e. per application stats.
>
> Is it specific to ethdev ports?

No (or at least not at the moment).


>> Added new field to mbuf struct to mark the packet arrival time on Rx.
>
> There was another patch adding a timestamp in mbuf:
> 	http://dpdk.org/ml/archives/dev/2016-October/048809.html

Will look into it. Since time is tight will have internal discussion 
whether latency will make it into 17.02..


>> APIs:
>>
>> * Added APIs to initialize and un initialize latency stats
>>   calculation.
>> * Added API to retrieve latency stats names and values.
>
> Why bitrate and latencies are separate libs?

They were developed independently by different people in response to 
seperate requirements.

Reshma went on extended leave, so I took over the latency patch at the 
last moment when development was complete. Aside from rebase-related 
fixups and one printf change it is the last version of her seperate 
patch included verbatim.

..Remy

^ permalink raw reply

* [PATCH v2 2/2] crypto: add user defined name initializing parameter parsing to software PMDs
From: Fan Zhang @ 2017-01-12 14:28 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch
In-Reply-To: <1484231320-139083-1-git-send-email-roy.fan.zhang@intel.com>

This patch adds user defined name parsing feature to software PMDs.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c   | 58 ++++++++++------------------
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 61 ++++++++++--------------------
 drivers/crypto/kasumi/rte_kasumi_pmd.c     | 58 +++++++++++-----------------
 drivers/crypto/null/null_crypto_pmd.c      | 55 ++++++++++-----------------
 drivers/crypto/openssl/rte_openssl_pmd.c   | 55 ++++++++++-----------------
 drivers/crypto/snow3g/rte_snow3g_pmd.c     | 59 +++++++++++------------------
 drivers/crypto/zuc/rte_zuc_pmd.c           | 59 +++++++++++------------------
 7 files changed, 148 insertions(+), 257 deletions(-)

diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index dba5e15..ddb2e0e 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -43,27 +43,6 @@
 
 #include "aesni_gcm_pmd_private.h"
 
-/**
- * Global static parameter used to create a unique name for each AES-NI multi
- * buffer crypto device.
- */
-static unsigned unique_name_id;
-
-static inline int
-create_unique_device_name(char *name, size_t size)
-{
-	int ret;
-
-	if (name == NULL)
-		return -EINVAL;
-
-	ret = snprintf(name, size, "%s_%u", RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD),
-			unique_name_id++);
-	if (ret < 0)
-		return ret;
-	return 0;
-}
-
 static int
 aesni_gcm_calculate_hash_sub_key(uint8_t *hsubkey, unsigned hsubkey_length,
 		uint8_t *aeskey, unsigned aeskey_length)
@@ -407,14 +386,23 @@ aesni_gcm_pmd_dequeue_burst(void *queue_pair,
 static int aesni_gcm_remove(const char *name);
 
 static int
-aesni_gcm_create(const char *name,
-		struct rte_crypto_vdev_init_params *init_params)
+aesni_gcm_create(struct rte_crypto_vdev_init_params *init_params)
 {
 	struct rte_cryptodev *dev;
-	char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	struct aesni_gcm_private *internals;
 	enum aesni_gcm_vector_mode vector_mode;
 
+	if (init_params->name[0] == '\0') {
+		int ret = rte_cryptodev_pmd_create_dev_name(
+				init_params->name,
+				RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD));
+
+		if (ret < 0) {
+			GCM_LOG_ERR("failed to create unique name");
+			return ret;
+		}
+	}
+
 	/* Check CPU for support for AES instruction set */
 	if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_AES)) {
 		GCM_LOG_ERR("AES instructions not supported by CPU");
@@ -433,15 +421,7 @@ aesni_gcm_create(const char *name,
 		return -EFAULT;
 	}
 
-	/* create a unique device name */
-	if (create_unique_device_name(crypto_dev_name,
-			RTE_CRYPTODEV_NAME_MAX_LEN) != 0) {
-		GCM_LOG_ERR("failed to create unique cryptodev name");
-		return -EINVAL;
-	}
-
-
-	dev = rte_cryptodev_pmd_virtual_dev_init(crypto_dev_name,
+	dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name,
 			sizeof(struct aesni_gcm_private), init_params->socket_id);
 	if (dev == NULL) {
 		GCM_LOG_ERR("failed to create cryptodev vdev");
@@ -484,9 +464,9 @@ aesni_gcm_create(const char *name,
 	return 0;
 
 init_error:
-	GCM_LOG_ERR("driver %s: create failed", name);
+	GCM_LOG_ERR("driver %s: create failed", init_params->name);
 
-	aesni_gcm_remove(crypto_dev_name);
+	aesni_gcm_remove(init_params->name);
 	return -EFAULT;
 }
 
@@ -496,19 +476,23 @@ aesni_gcm_probe(const char *name, const char *input_args)
 	struct rte_crypto_vdev_init_params init_params = {
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS,
-		rte_socket_id()
+		rte_socket_id(),
+		{0}
 	};
 
 	rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
 
 	RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
 			init_params.socket_id);
+	if (init_params.name[0] != '\0')
+		RTE_LOG(INFO, PMD, "  User defined name = %s\n",
+			init_params.name);
 	RTE_LOG(INFO, PMD, "  Max number of queue pairs = %d\n",
 			init_params.max_nb_queue_pairs);
 	RTE_LOG(INFO, PMD, "  Max number of sessions = %d\n",
 			init_params.max_nb_sessions);
 
-	return aesni_gcm_create(name, &init_params);
+	return aesni_gcm_create(&init_params);
 }
 
 static int
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index f07cd07..26dc05e 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -40,27 +40,6 @@
 
 #include "rte_aesni_mb_pmd_private.h"
 
-/**
- * Global static parameter used to create a unique name for each AES-NI multi
- * buffer crypto device.
- */
-static unsigned unique_name_id;
-
-static inline int
-create_unique_device_name(char *name, size_t size)
-{
-	int ret;
-
-	if (name == NULL)
-		return -EINVAL;
-
-	ret = snprintf(name, size, "%s_%u", RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD),
-			unique_name_id++);
-	if (ret < 0)
-		return ret;
-	return 0;
-}
-
 typedef void (*hash_one_block_t)(void *data, void *digest);
 typedef void (*aes_keyexp_t)(void *key, void *enc_exp_keys, void *dec_exp_keys);
 
@@ -598,18 +577,21 @@ aesni_mb_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
 static int cryptodev_aesni_mb_remove(const char *name);
 
 static int
-cryptodev_aesni_mb_create(const char *name,
-		struct rte_crypto_vdev_init_params *init_params)
+cryptodev_aesni_mb_create(struct rte_crypto_vdev_init_params *init_params)
 {
 	struct rte_cryptodev *dev;
-	char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	struct aesni_mb_private *internals;
 	enum aesni_mb_vector_mode vector_mode;
 
-	/* Check CPU for support for AES instruction set */
-	if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_AES)) {
-		MB_LOG_ERR("AES instructions not supported by CPU");
-		return -EFAULT;
+	if (init_params->name[0] == '\0') {
+		int ret = rte_cryptodev_pmd_create_dev_name(
+				init_params->name,
+				RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
+
+		if (ret < 0) {
+			MB_LOG_ERR("failed to create unique name");
+			return ret;
+		}
 	}
 
 	/* Check CPU for supported vector instruction set */
@@ -624,15 +606,7 @@ cryptodev_aesni_mb_create(const char *name,
 		return -EFAULT;
 	}
 
-	/* create a unique device name */
-	if (create_unique_device_name(crypto_dev_name,
-			RTE_CRYPTODEV_NAME_MAX_LEN) != 0) {
-		MB_LOG_ERR("failed to create unique cryptodev name");
-		return -EINVAL;
-	}
-
-
-	dev = rte_cryptodev_pmd_virtual_dev_init(crypto_dev_name,
+	dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name,
 			sizeof(struct aesni_mb_private), init_params->socket_id);
 	if (dev == NULL) {
 		MB_LOG_ERR("failed to create cryptodev vdev");
@@ -673,9 +647,10 @@ cryptodev_aesni_mb_create(const char *name,
 
 	return 0;
 init_error:
-	MB_LOG_ERR("driver %s: cryptodev_aesni_create failed", name);
+	MB_LOG_ERR("driver %s: cryptodev_aesni_create failed",
+			init_params->name);
 
-	cryptodev_aesni_mb_remove(crypto_dev_name);
+	cryptodev_aesni_mb_remove(init_params->name);
 	return -EFAULT;
 }
 
@@ -687,19 +662,23 @@ cryptodev_aesni_mb_probe(const char *name,
 	struct rte_crypto_vdev_init_params init_params = {
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS,
-		rte_socket_id()
+		rte_socket_id(),
+		""
 	};
 
 	rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
 
 	RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
 			init_params.socket_id);
+	if (init_params.name[0] != '\0')
+		RTE_LOG(INFO, PMD, "  User defined name = %s\n",
+			init_params.name);
 	RTE_LOG(INFO, PMD, "  Max number of queue pairs = %d\n",
 			init_params.max_nb_queue_pairs);
 	RTE_LOG(INFO, PMD, "  Max number of sessions = %d\n",
 			init_params.max_nb_sessions);
 
-	return cryptodev_aesni_mb_create(name, &init_params);
+	return cryptodev_aesni_mb_create(&init_params);
 }
 
 static int
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c
index b119da2..c38c851 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
@@ -47,27 +47,6 @@
 #define KASUMI_MAX_BURST 4
 #define BYTE_LEN 8
 
-/**
- * Global static parameter used to create a unique name for each KASUMI
- * crypto device.
- */
-static unsigned unique_name_id;
-
-static inline int
-create_unique_device_name(char *name, size_t size)
-{
-	int ret;
-
-	if (name == NULL)
-		return -EINVAL;
-
-	ret = snprintf(name, size, "%s_%u", RTE_STR(CRYPTODEV_NAME_KASUMI_PMD),
-			unique_name_id++);
-	if (ret < 0)
-		return ret;
-	return 0;
-}
-
 /** Get xform chain order. */
 static enum kasumi_operation
 kasumi_get_mode(const struct rte_crypto_sym_xform *xform)
@@ -559,14 +538,23 @@ kasumi_pmd_dequeue_burst(void *queue_pair,
 static int cryptodev_kasumi_remove(const char *name);
 
 static int
-cryptodev_kasumi_create(const char *name,
-		struct rte_crypto_vdev_init_params *init_params)
+cryptodev_kasumi_create(struct rte_crypto_vdev_init_params *init_params)
 {
 	struct rte_cryptodev *dev;
-	char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	struct kasumi_private *internals;
 	uint64_t cpu_flags = 0;
 
+	if (init_params->name[0] == '\0') {
+		int ret = rte_cryptodev_pmd_create_dev_name(
+				init_params->name,
+				RTE_STR(CRYPTODEV_NAME_KASUMI_PMD));
+
+		if (ret < 0) {
+			KASUMI_LOG_ERR("failed to create unique name");
+			return ret;
+		}
+	}
+
 	/* Check CPU for supported vector instruction set */
 	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX))
 		cpu_flags |= RTE_CRYPTODEV_FF_CPU_AVX;
@@ -577,14 +565,7 @@ cryptodev_kasumi_create(const char *name,
 		return -EFAULT;
 	}
 
-	/* Create a unique device name. */
-	if (create_unique_device_name(crypto_dev_name,
-			RTE_CRYPTODEV_NAME_MAX_LEN) != 0) {
-		KASUMI_LOG_ERR("failed to create unique cryptodev name");
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_virtual_dev_init(crypto_dev_name,
+	dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name,
 			sizeof(struct kasumi_private), init_params->socket_id);
 	if (dev == NULL) {
 		KASUMI_LOG_ERR("failed to create cryptodev vdev");
@@ -609,9 +590,10 @@ cryptodev_kasumi_create(const char *name,
 
 	return 0;
 init_error:
-	KASUMI_LOG_ERR("driver %s: cryptodev_kasumi_create failed", name);
+	KASUMI_LOG_ERR("driver %s: cryptodev_kasumi_create failed",
+			init_params->name);
 
-	cryptodev_kasumi_remove(crypto_dev_name);
+	cryptodev_kasumi_remove(init_params->name);
 	return -EFAULT;
 }
 
@@ -622,19 +604,23 @@ cryptodev_kasumi_probe(const char *name,
 	struct rte_crypto_vdev_init_params init_params = {
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS,
-		rte_socket_id()
+		rte_socket_id(),
+		{0}
 	};
 
 	rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
 
 	RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
 			init_params.socket_id);
+	if (init_params.name[0] != '\0')
+		RTE_LOG(INFO, PMD, "  User defined name = %s\n",
+			init_params.name);
 	RTE_LOG(INFO, PMD, "  Max number of queue pairs = %d\n",
 			init_params.max_nb_queue_pairs);
 	RTE_LOG(INFO, PMD, "  Max number of sessions = %d\n",
 			init_params.max_nb_sessions);
 
-	return cryptodev_kasumi_create(name, &init_params);
+	return cryptodev_kasumi_create(&init_params);
 }
 
 static int
diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c
index c69606b..ce60470 100644
--- a/drivers/crypto/null/null_crypto_pmd.c
+++ b/drivers/crypto/null/null_crypto_pmd.c
@@ -38,27 +38,6 @@
 
 #include "null_crypto_pmd_private.h"
 
-/**
- * Global static parameter used to create a unique name for each crypto device.
- */
-static unsigned unique_name_id;
-
-static inline int
-create_unique_device_name(char *name, size_t size)
-{
-	int ret;
-
-	if (name == NULL)
-		return -EINVAL;
-
-	ret = snprintf(name, size, "%s_%u", RTE_STR(CRYPTODEV_NAME_NULL_PMD),
-			unique_name_id++);
-	if (ret < 0)
-		return ret;
-	return 0;
-}
-
-
 /** verify and set session parameters */
 int
 null_crypto_set_session_parameters(
@@ -186,21 +165,24 @@ static int cryptodev_null_remove(const char *name);
 
 /** Create crypto device */
 static int
-cryptodev_null_create(const char *name,
-		struct rte_crypto_vdev_init_params *init_params)
+cryptodev_null_create(struct rte_crypto_vdev_init_params *init_params)
 {
 	struct rte_cryptodev *dev;
-	char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	struct null_crypto_private *internals;
 
-	/* create a unique device name */
-	if (create_unique_device_name(crypto_dev_name,
-			RTE_CRYPTODEV_NAME_MAX_LEN) != 0) {
-		NULL_CRYPTO_LOG_ERR("failed to create unique cryptodev name");
-		return -EINVAL;
+	if (init_params->name[0] == '\0') {
+		int ret = rte_cryptodev_pmd_create_dev_name(
+				init_params->name,
+				RTE_STR(CRYPTODEV_NAME_NULL_PMD));
+
+		if (ret < 0) {
+			NULL_CRYPTO_LOG_ERR("failed to create unique "
+					"name");
+			return ret;
+		}
 	}
 
-	dev = rte_cryptodev_pmd_virtual_dev_init(crypto_dev_name,
+	dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name,
 			sizeof(struct null_crypto_private),
 			init_params->socket_id);
 	if (dev == NULL) {
@@ -226,8 +208,9 @@ cryptodev_null_create(const char *name,
 	return 0;
 
 init_error:
-	NULL_CRYPTO_LOG_ERR("driver %s: cryptodev_null_create failed", name);
-	cryptodev_null_remove(crypto_dev_name);
+	NULL_CRYPTO_LOG_ERR("driver %s: cryptodev_null_create failed",
+			init_params->name);
+	cryptodev_null_remove(init_params->name);
 
 	return -EFAULT;
 }
@@ -240,19 +223,23 @@ cryptodev_null_probe(const char *name,
 	struct rte_crypto_vdev_init_params init_params = {
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS,
-		rte_socket_id()
+		rte_socket_id(),
+		{0}
 	};
 
 	rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
 
 	RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
 			init_params.socket_id);
+	if (init_params.name[0] != '\0')
+		RTE_LOG(INFO, PMD, "  User defined name = %s\n",
+			init_params.name);
 	RTE_LOG(INFO, PMD, "  Max number of queue pairs = %d\n",
 			init_params.max_nb_queue_pairs);
 	RTE_LOG(INFO, PMD, "  Max number of sessions = %d\n",
 			init_params.max_nb_sessions);
 
-	return cryptodev_null_create(name, &init_params);
+	return cryptodev_null_create(&init_params);
 }
 
 /** Uninitialise null crypto device */
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 5f8fa33..c556a9e 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -47,28 +47,6 @@ static int cryptodev_openssl_remove(const char *name);
 /*----------------------------------------------------------------------------*/
 
 /**
- * Global static parameter used to create a unique name for each
- * OPENSSL crypto device.
- */
-static unsigned int unique_name_id;
-
-static inline int
-create_unique_device_name(char *name, size_t size)
-{
-	int ret;
-
-	if (name == NULL)
-		return -EINVAL;
-
-	ret = snprintf(name, size, "%s_%u",
-			RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD),
-			unique_name_id++);
-	if (ret < 0)
-		return ret;
-	return 0;
-}
-
-/**
  * Increment counter by 1
  * Counter is 64 bit array, big-endian
  */
@@ -964,21 +942,23 @@ openssl_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
 
 /** Create OPENSSL crypto device */
 static int
-cryptodev_openssl_create(const char *name,
-		struct rte_crypto_vdev_init_params *init_params)
+cryptodev_openssl_create(struct rte_crypto_vdev_init_params *init_params)
 {
 	struct rte_cryptodev *dev;
-	char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	struct openssl_private *internals;
 
-	/* create a unique device name */
-	if (create_unique_device_name(crypto_dev_name,
-			RTE_CRYPTODEV_NAME_MAX_LEN) != 0) {
-		OPENSSL_LOG_ERR("failed to create unique cryptodev name");
-		return -EINVAL;
+	if (init_params->name[0] == '\0') {
+		int ret = rte_cryptodev_pmd_create_dev_name(
+				init_params->name,
+				RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD));
+
+		if (ret < 0) {
+			OPENSSL_LOG_ERR("failed to create unique name");
+			return ret;
+		}
 	}
 
-	dev = rte_cryptodev_pmd_virtual_dev_init(crypto_dev_name,
+	dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name,
 			sizeof(struct openssl_private),
 			init_params->socket_id);
 	if (dev == NULL) {
@@ -1006,9 +986,10 @@ cryptodev_openssl_create(const char *name,
 	return 0;
 
 init_error:
-	OPENSSL_LOG_ERR("driver %s: cryptodev_openssl_create failed", name);
+	OPENSSL_LOG_ERR("driver %s: cryptodev_openssl_create failed",
+			init_params->name);
 
-	cryptodev_openssl_remove(crypto_dev_name);
+	cryptodev_openssl_remove(init_params->name);
 	return -EFAULT;
 }
 
@@ -1020,19 +1001,23 @@ cryptodev_openssl_probe(const char *name,
 	struct rte_crypto_vdev_init_params init_params = {
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS,
-		rte_socket_id()
+		rte_socket_id(),
+		{0}
 	};
 
 	rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
 
 	RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
 			init_params.socket_id);
+	if (init_params.name[0] != '\0')
+		RTE_LOG(INFO, PMD, "  User defined name = %s\n",
+			init_params.name);
 	RTE_LOG(INFO, PMD, "  Max number of queue pairs = %d\n",
 			init_params.max_nb_queue_pairs);
 	RTE_LOG(INFO, PMD, "  Max number of sessions = %d\n",
 			init_params.max_nb_sessions);
 
-	return cryptodev_openssl_create(name, &init_params);
+	return cryptodev_openssl_create(&init_params);
 }
 
 /** Uninitialise OPENSSL crypto device */
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c
index 3b4292a..4a70f06 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
@@ -46,27 +46,6 @@
 #define SNOW3G_MAX_BURST 8
 #define BYTE_LEN 8
 
-/**
- * Global static parameter used to create a unique name for each SNOW 3G
- * crypto device.
- */
-static unsigned unique_name_id;
-
-static inline int
-create_unique_device_name(char *name, size_t size)
-{
-	int ret;
-
-	if (name == NULL)
-		return -EINVAL;
-
-	ret = snprintf(name, size, "%s_%u", RTE_STR(CRYPTODEV_NAME_SNOW3G_PMD),
-			unique_name_id++);
-	if (ret < 0)
-		return ret;
-	return 0;
-}
-
 /** Get xform chain order. */
 static enum snow3g_operation
 snow3g_get_mode(const struct rte_crypto_sym_xform *xform)
@@ -548,14 +527,23 @@ snow3g_pmd_dequeue_burst(void *queue_pair,
 static int cryptodev_snow3g_remove(const char *name);
 
 static int
-cryptodev_snow3g_create(const char *name,
-		struct rte_crypto_vdev_init_params *init_params)
+cryptodev_snow3g_create(struct rte_crypto_vdev_init_params *init_params)
 {
 	struct rte_cryptodev *dev;
-	char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	struct snow3g_private *internals;
 	uint64_t cpu_flags = 0;
 
+	if (init_params->name[0] == '\0') {
+		int ret = rte_cryptodev_pmd_create_dev_name(
+				init_params->name,
+				RTE_STR(CRYPTODEV_NAME_SNOW3G_PMD));
+
+		if (ret < 0) {
+			SNOW3G_LOG_ERR("failed to create unique name");
+			return ret;
+		}
+	}
+
 	/* Check CPU for supported vector instruction set */
 	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1))
 		cpu_flags |= RTE_CRYPTODEV_FF_CPU_SSE;
@@ -564,15 +552,7 @@ cryptodev_snow3g_create(const char *name,
 		return -EFAULT;
 	}
 
-
-	/* Create a unique device name. */
-	if (create_unique_device_name(crypto_dev_name,
-			RTE_CRYPTODEV_NAME_MAX_LEN) != 0) {
-		SNOW3G_LOG_ERR("failed to create unique cryptodev name");
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_virtual_dev_init(crypto_dev_name,
+	dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name,
 			sizeof(struct snow3g_private), init_params->socket_id);
 	if (dev == NULL) {
 		SNOW3G_LOG_ERR("failed to create cryptodev vdev");
@@ -597,9 +577,10 @@ cryptodev_snow3g_create(const char *name,
 
 	return 0;
 init_error:
-	SNOW3G_LOG_ERR("driver %s: cryptodev_snow3g_create failed", name);
+	SNOW3G_LOG_ERR("driver %s: cryptodev_snow3g_create failed",
+			init_params->name);
 
-	cryptodev_snow3g_remove(crypto_dev_name);
+	cryptodev_snow3g_remove(init_params->name);
 	return -EFAULT;
 }
 
@@ -610,19 +591,23 @@ cryptodev_snow3g_probe(const char *name,
 	struct rte_crypto_vdev_init_params init_params = {
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS,
-		rte_socket_id()
+		rte_socket_id(),
+		{0}
 	};
 
 	rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
 
 	RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
 			init_params.socket_id);
+	if (init_params.name[0] != '\0')
+		RTE_LOG(INFO, PMD, "  User defined name = %s\n",
+			init_params.name);
 	RTE_LOG(INFO, PMD, "  Max number of queue pairs = %d\n",
 			init_params.max_nb_queue_pairs);
 	RTE_LOG(INFO, PMD, "  Max number of sessions = %d\n",
 			init_params.max_nb_sessions);
 
-	return cryptodev_snow3g_create(name, &init_params);
+	return cryptodev_snow3g_create(&init_params);
 }
 
 static int
diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
index 3849119..062cfff 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd.c
@@ -45,27 +45,6 @@
 #define ZUC_MAX_BURST 8
 #define BYTE_LEN 8
 
-/**
- * Global static parameter used to create a unique name for each ZUC
- * crypto device.
- */
-static unsigned unique_name_id;
-
-static inline int
-create_unique_device_name(char *name, size_t size)
-{
-	int ret;
-
-	if (name == NULL)
-		return -EINVAL;
-
-	ret = snprintf(name, size, "%s_%u", RTE_STR(CRYPTODEV_NAME_ZUC_PMD),
-			unique_name_id++);
-	if (ret < 0)
-		return ret;
-	return 0;
-}
-
 /** Get xform chain order. */
 static enum zuc_operation
 zuc_get_mode(const struct rte_crypto_sym_xform *xform)
@@ -448,14 +427,23 @@ zuc_pmd_dequeue_burst(void *queue_pair,
 static int cryptodev_zuc_remove(const char *name);
 
 static int
-cryptodev_zuc_create(const char *name,
-		struct rte_crypto_vdev_init_params *init_params)
+cryptodev_zuc_create(struct rte_crypto_vdev_init_params *init_params)
 {
 	struct rte_cryptodev *dev;
-	char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	struct zuc_private *internals;
 	uint64_t cpu_flags = 0;
 
+	if (init_params->name[0] == '\0') {
+		int ret = rte_cryptodev_pmd_create_dev_name(
+				init_params->name,
+				RTE_STR(CRYPTODEV_NAME_ZUC_PMD));
+
+		if (ret < 0) {
+			ZUC_LOG_ERR("failed to create unique name");
+			return ret;
+		}
+	}
+
 	/* Check CPU for supported vector instruction set */
 	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1))
 		cpu_flags |= RTE_CRYPTODEV_FF_CPU_SSE;
@@ -464,15 +452,7 @@ cryptodev_zuc_create(const char *name,
 		return -EFAULT;
 	}
 
-
-	/* Create a unique device name. */
-	if (create_unique_device_name(crypto_dev_name,
-			RTE_CRYPTODEV_NAME_MAX_LEN) != 0) {
-		ZUC_LOG_ERR("failed to create unique cryptodev name");
-		return -EINVAL;
-	}
-
-	dev = rte_cryptodev_pmd_virtual_dev_init(crypto_dev_name,
+	dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name,
 			sizeof(struct zuc_private), init_params->socket_id);
 	if (dev == NULL) {
 		ZUC_LOG_ERR("failed to create cryptodev vdev");
@@ -497,9 +477,10 @@ cryptodev_zuc_create(const char *name,
 
 	return 0;
 init_error:
-	ZUC_LOG_ERR("driver %s: cryptodev_zuc_create failed", name);
+	ZUC_LOG_ERR("driver %s: cryptodev_zuc_create failed",
+			init_params->name);
 
-	cryptodev_zuc_remove(crypto_dev_name);
+	cryptodev_zuc_remove(init_params->name);
 	return -EFAULT;
 }
 
@@ -510,19 +491,23 @@ cryptodev_zuc_probe(const char *name,
 	struct rte_crypto_vdev_init_params init_params = {
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
 		RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS,
-		rte_socket_id()
+		rte_socket_id(),
+		{0}
 	};
 
 	rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
 
 	RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
 			init_params.socket_id);
+	if (init_params.name[0] != '\0')
+		RTE_LOG(INFO, PMD, "  User defined name = %s\n",
+			init_params.name);
 	RTE_LOG(INFO, PMD, "  Max number of queue pairs = %d\n",
 			init_params.max_nb_queue_pairs);
 	RTE_LOG(INFO, PMD, "  Max number of sessions = %d\n",
 			init_params.max_nb_sessions);
 
-	return cryptodev_zuc_create(name, &init_params);
+	return cryptodev_zuc_create(&init_params);
 }
 
 static int
-- 
2.7.4

^ permalink raw reply related

* [PATCH v2 0/2] crypto: add user defined name initializing parameter
From: Fan Zhang @ 2017-01-12 14:28 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch
In-Reply-To: <1484154786-91531-1-git-send-email-roy.fan.zhang@intel.com>

This patchset adds a user defined name initializing parameter to all
software cryptodevs.

v2:
Fixed a line adds whitespace error
Updated rte_cryptodev_version.map

Fan Zhang (2):
  cryptodev: add user defined name initializing parameter to software
    PMD
  crypto: add user defined name initializing parameter parsing to
    software PMDs

 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c       | 58 +++++++++---------------
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c     | 61 +++++++++-----------------
 drivers/crypto/kasumi/rte_kasumi_pmd.c         | 58 ++++++++++--------------
 drivers/crypto/null/null_crypto_pmd.c          | 55 +++++++++--------------
 drivers/crypto/openssl/rte_openssl_pmd.c       | 55 +++++++++--------------
 drivers/crypto/snow3g/rte_snow3g_pmd.c         | 59 ++++++++++---------------
 drivers/crypto/zuc/rte_zuc_pmd.c               | 59 ++++++++++---------------
 lib/librte_cryptodev/rte_cryptodev.c           | 44 +++++++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.h           |  7 ++-
 lib/librte_cryptodev/rte_cryptodev_pmd.h       |  7 +++
 lib/librte_cryptodev/rte_cryptodev_version.map |  7 +++
 11 files changed, 209 insertions(+), 261 deletions(-)

-- 
2.7.4

^ permalink raw reply

* [PATCH v2 1/2] cryptodev: add user defined name initializing parameter to software PMD
From: Fan Zhang @ 2017-01-12 14:28 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch
In-Reply-To: <1484231320-139083-1-git-send-email-roy.fan.zhang@intel.com>

This patch adds a user defined name initializing parameter to cryptodev
library.

Originally, for software cryptodev PMD, the vdev name parameter is
treated as the driver identifier, and will create an unique name for each
device automatically, which is not necessarily as same as the vdev
parameter.

This patch allows the user to either create a unique name for his software
cryptodev, or by default, let the system creates a unique one. This should
help the user managing the created cryptodevs easily.

Examples:
CLI command fragment 1: --vdev "crypto_aesni_gcm_pmd"
The above command will result in creating a AESNI-GCM PMD with name of
"crypto_aesni_gcm_X", where postfix X is the number assigned by the system,
starting from 0. This fragment can be placed in the same CLI command
multiple times, resulting the postfixs incremented by one for each new
device.

CLI command fragment 2: --vdev "crypto_aesni_gcm_pmd,name=gcm1"
The above command will result in creating a AESNI-GCM PMD with name of
"gcm1". This fragment can be placed in the same CLI command multiple
times, as long as each having a unique name value.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 lib/librte_cryptodev/rte_cryptodev.c           | 44 ++++++++++++++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.h           |  7 ++--
 lib/librte_cryptodev/rte_cryptodev_pmd.h       |  7 ++++
 lib/librte_cryptodev/rte_cryptodev_version.map |  7 ++++
 4 files changed, 61 insertions(+), 4 deletions(-)

diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 127e8d0..08c9eb4 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -101,11 +101,13 @@ struct rte_cryptodev_callback {
 	uint32_t active;			/**< Callback is executing */
 };
 
+#define RTE_CRYPTODEV_VDEV_NAME				("name")
 #define RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG		("max_nb_queue_pairs")
 #define RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG		("max_nb_sessions")
 #define RTE_CRYPTODEV_VDEV_SOCKET_ID			("socket_id")
 
 static const char *cryptodev_vdev_valid_params[] = {
+	RTE_CRYPTODEV_VDEV_NAME,
 	RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG,
 	RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG,
 	RTE_CRYPTODEV_VDEV_SOCKET_ID
@@ -143,6 +145,18 @@ parse_integer_arg(const char *key __rte_unused,
 	return 0;
 }
 
+/** Parse name */
+static int
+parse_name_arg(const char *key __rte_unused,
+		const char *value, void *extra_args)
+{
+	struct rte_crypto_vdev_init_params *params = extra_args;
+
+	strncpy(params->name, value, RTE_CRYPTODEV_NAME_MAX_LEN);
+
+	return 0;
+}
+
 int
 rte_cryptodev_parse_vdev_init_params(struct rte_crypto_vdev_init_params *params,
 		const char *input_args)
@@ -179,6 +193,12 @@ rte_cryptodev_parse_vdev_init_params(struct rte_crypto_vdev_init_params *params,
 		if (ret < 0)
 			goto free_kvlist;
 
+		ret = rte_kvargs_process(kvlist, RTE_CRYPTODEV_VDEV_NAME,
+					&parse_name_arg,
+					params);
+		if (ret < 0)
+			goto free_kvlist;
+
 		if (params->socket_id >= number_of_sockets()) {
 			CDEV_LOG_ERR("Invalid socket id specified to create "
 				"the virtual crypto device on");
@@ -1205,3 +1225,27 @@ rte_crypto_op_pool_create(const char *name, enum rte_crypto_op_type type,
 
 	return mp;
 }
+
+int
+rte_cryptodev_pmd_create_dev_name(char *name, const char *dev_name_prefix)
+{
+	struct rte_cryptodev *dev = NULL;
+	uint32_t i = 0;
+
+	if (name == NULL)
+		return -EINVAL;
+
+	for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) {
+		int ret = snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN,
+				"%s_%u", dev_name_prefix, i);
+
+		if (ret < 0)
+			return ret;
+
+		dev = rte_cryptodev_pmd_get_named_dev(name);
+		if (!dev)
+			return 0;
+	}
+
+	return -1;
+}
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index 8f63e8f..b5399af 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -300,6 +300,8 @@ struct rte_cryptodev_stats {
 	/**< Total error count on operations dequeued */
 };
 
+#define RTE_CRYPTODEV_NAME_MAX_LEN	(64)
+/**< Max length of name of crypto PMD */
 #define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS	8
 #define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS	2048
 
@@ -311,6 +313,7 @@ struct rte_crypto_vdev_init_params {
 	unsigned max_nb_queue_pairs;
 	unsigned max_nb_sessions;
 	uint8_t socket_id;
+	char name[RTE_CRYPTODEV_NAME_MAX_LEN];
 };
 
 /**
@@ -635,10 +638,6 @@ struct rte_cryptodev {
 	/**< Flag indicating the device is attached */
 } __rte_cache_aligned;
 
-
-#define RTE_CRYPTODEV_NAME_MAX_LEN	(64)
-/**< Max length of name of crypto PMD */
-
 /**
  *
  * The data part, with no function pointers, associated with each device.
diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h
index abfe2dc..dc57bfa 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.h
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h
@@ -519,6 +519,13 @@ int rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv,
  */
 int rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev);
 
+/**
+ * @internal
+ * Create unique device name
+ */
+int
+rte_cryptodev_pmd_create_dev_name(char *name, const char *dev_name_prefix);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map b/lib/librte_cryptodev/rte_cryptodev_version.map
index 9dde0e7..c581eea 100644
--- a/lib/librte_cryptodev/rte_cryptodev_version.map
+++ b/lib/librte_cryptodev/rte_cryptodev_version.map
@@ -46,3 +46,10 @@ DPDK_16.11 {
 	rte_cryptodev_pci_remove;
 
 } DPDK_16.07;
+
+DPDK_17.02 {
+	global:
+
+	rte_cryptodev_pmd_create_dev_name;
+
+} DPDK_16.11;
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH 2/7] net/ixgbe/base: remove a compiler warning
From: Ferruh Yigit @ 2017-01-12 14:24 UTC (permalink / raw)
  To: Dai, Wei, dev@dpdk.org; +Cc: Zhang, Helin, Ananyev, Konstantin
In-Reply-To: <49759EB36A64CF4892C1AFEC9231E8D63A3275EF@PGSMSX106.gar.corp.intel.com>

On 1/12/2017 2:08 PM, Dai, Wei wrote:
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Wednesday, January 11, 2017 11:38 PM
>> To: Dai, Wei <wei.dai@intel.com>; dev@dpdk.org
>> Cc: Zhang, Helin <helin.zhang@intel.com>; Ananyev, Konstantin
>> <konstantin.ananyev@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH 2/7] net/ixgbe/base: remove a compiler warning
>>
>> On 1/10/2017 3:45 PM, Wei Dai wrote:
>>> This patch fixes a compiler warning.
>>
>> I guess compiler warning is because of "mac->led_link_act = i;", since
>> led_link_act is 8bits..
>>
>> But can you please add the compile warning here, to make it more clear to
>> understand what is the issue.
> 
> I have compared the generated ixgbe_common.o both from "u16 i" and "u8 I" .
> Two .o files are identical. 
> Whether the variable i is defined as u8 or u16,  there is no compile warning. 
> The version of gcc version is 6.3.1 20161221 (Red Hat 6.3.1-1) (GCC).
> If i is u16, mac->led_link_act = i; should generate a warning, but there is no.
> It is a bit weird .
> As you know, this code is provided by another Intel team.
> I think that it will generate a warning when they build it with their C compiler.
> Anyway, to define i as u8 is better than u16 and we had better keep aligned with them.

Agreed, u8 is better.

> 
>>
>>>
>>> Signed-off-by: Wei Dai <wei.dai@intel.com>
>>> ---
>>>  drivers/net/ixgbe/base/ixgbe_common.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/ixgbe/base/ixgbe_common.c
>>> b/drivers/net/ixgbe/base/ixgbe_common.c
>>> index 18bb18c..0dd33b8 100644
>>> --- a/drivers/net/ixgbe/base/ixgbe_common.c
>>> +++ b/drivers/net/ixgbe/base/ixgbe_common.c
>>> @@ -1150,7 +1150,7 @@ s32 ixgbe_init_led_link_act_generic(struct
>>> ixgbe_hw *hw)  {
>>>  	struct ixgbe_mac_info *mac = &hw->mac;
>>>  	u32 led_reg, led_mode;
>>> -	u16 i;
>>> +	u8 i;
>>>
>>>  	led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
>>>
>>>
> 

^ permalink raw reply

* Re: [PATCH 6/7] net/ixgbe/base: add some debug traces
From: Ferruh Yigit @ 2017-01-12 14:21 UTC (permalink / raw)
  To: Dai, Wei, dev@dpdk.org; +Cc: Zhang, Helin, Ananyev, Konstantin
In-Reply-To: <49759EB36A64CF4892C1AFEC9231E8D63A327604@PGSMSX106.gar.corp.intel.com>

On 1/12/2017 2:18 PM, Dai, Wei wrote:
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Wednesday, January 11, 2017 11:39 PM
>> To: Dai, Wei <wei.dai@intel.com>; dev@dpdk.org
>> Cc: Zhang, Helin <helin.zhang@intel.com>; Ananyev, Konstantin
>> <konstantin.ananyev@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH 6/7] net/ixgbe/base: add some debug traces
>>
>> On 1/10/2017 3:45 PM, Wei Dai wrote:
>>> This patch adds some traces in the reset_hw logic and semaphore
>>> acquisition logic to help debugging.
>>
>> Is verbosity of the PMD changes with this update?
>>
>> Is something required in PMD to disable DEBUGOUT1(), DEBUGOUT2(),
>> DEBUGOUT() by default?
> 
> In drivers/net/ixgbe/ixgbe_logs.h, there are
> #ifdef RTE_LIBRTE_IXGBE_DEBUG_DRIVER
> #define PMD_DRV_LOG_RAW(level, fmt, args...) \
> 	RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
> #else
> #define PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0)
> #endif
> 
> And in drivers/net/ixgbe/base/ixgbe_osdep.h, there are
> #include "../ixgbe_logs.h"
> ....
> #define DEBUGOUT(S, args...)    PMD_DRV_LOG_RAW(DEBUG, S, ##args)
> #define DEBUGOUT1(S, args...)   DEBUGOUT(S, ##args)
> #define DEBUGOUT2(S, args...)   DEBUGOUT(S, ##args)
> #define DEBUGOUT3(S, args...)   DEBUGOUT(S, ##args)
> #define DEBUGOUT6(S, args...)   DEBUGOUT(S, ##args)
> #define DEBUGOUT7(S, args...)   DEBUGOUT(S, ##args)
> 
> In config/common_base, there is 
> CONFIG_RTE_LIBRTE_IXGBE_DEBUG_DRIVER=n
> 
> So according above codes, the macro RTE_LIBRTE_IXGBE_DEBUG_DRIVER in drivers/net/ixgbe/ixgbe_logs.h is not defined
> and PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0) will be valid,
> then DEBUGOUT() is just a null definition by default.

OK, thanks for clarification.

> 
>>
>>>
>>> Signed-off-by: Wei Dai <wei.dai@intel.com>
>>> ---
>>
>> <...>

^ permalink raw reply

* Re: [PATCH] tools: add tags and cscope index file generation support
From: Ferruh Yigit @ 2017-01-12 14:19 UTC (permalink / raw)
  To: Jerin Jacob, dev; +Cc: thomas.monjalon
In-Reply-To: <1480205562-32745-1-git-send-email-jerin.jacob@caviumnetworks.com>

On 11/27/2016 12:12 AM, Jerin Jacob wrote:
> This script generates cscope, gtags, and tags
> index files based on EAL environment.
> (architecture and OS(linux/bsd))
> 
> Selection of the architecture and OS environment
> is based on dpdk configuration target(T=)
> 
> example usage:
> make tags T=x86_64-native-linuxapp-gcc
> make cscope T=x86_64-native-linuxapp-gcc
> make gtags T=x86_64-native-linuxapp-gcc
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

<...>

> +
> +if [ -n "$T" ]; then
<...>
> +	usage $1
> +	exit

I would prefer fallback to RTE_TARGET parsing, or processing all files (
cscope -Rqn ), instead of exiting here, but that is your call.


Also "tags.sh" needs to be moved into "devtools" after latest updates.


Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply

* Re: [PATCH 6/7] net/ixgbe/base: add some debug traces
From: Dai, Wei @ 2017-01-12 14:18 UTC (permalink / raw)
  To: Yigit, Ferruh, dev@dpdk.org; +Cc: Zhang, Helin, Ananyev, Konstantin
In-Reply-To: <a9cc3ccf-0466-0e06-26d6-f555ea650ceb@intel.com>

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, January 11, 2017 11:39 PM
> To: Dai, Wei <wei.dai@intel.com>; dev@dpdk.org
> Cc: Zhang, Helin <helin.zhang@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 6/7] net/ixgbe/base: add some debug traces
> 
> On 1/10/2017 3:45 PM, Wei Dai wrote:
> > This patch adds some traces in the reset_hw logic and semaphore
> > acquisition logic to help debugging.
> 
> Is verbosity of the PMD changes with this update?
> 
> Is something required in PMD to disable DEBUGOUT1(), DEBUGOUT2(),
> DEBUGOUT() by default?

In drivers/net/ixgbe/ixgbe_logs.h, there are
#ifdef RTE_LIBRTE_IXGBE_DEBUG_DRIVER
#define PMD_DRV_LOG_RAW(level, fmt, args...) \
	RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
#else
#define PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0)
#endif

And in drivers/net/ixgbe/base/ixgbe_osdep.h, there are
#include "../ixgbe_logs.h"
....
#define DEBUGOUT(S, args...)    PMD_DRV_LOG_RAW(DEBUG, S, ##args)
#define DEBUGOUT1(S, args...)   DEBUGOUT(S, ##args)
#define DEBUGOUT2(S, args...)   DEBUGOUT(S, ##args)
#define DEBUGOUT3(S, args...)   DEBUGOUT(S, ##args)
#define DEBUGOUT6(S, args...)   DEBUGOUT(S, ##args)
#define DEBUGOUT7(S, args...)   DEBUGOUT(S, ##args)

In config/common_base, there is 
CONFIG_RTE_LIBRTE_IXGBE_DEBUG_DRIVER=n

So according above codes, the macro RTE_LIBRTE_IXGBE_DEBUG_DRIVER in drivers/net/ixgbe/ixgbe_logs.h is not defined
and PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0) will be valid,
then DEBUGOUT() is just a null definition by default.

> 
> >
> > Signed-off-by: Wei Dai <wei.dai@intel.com>
> > ---
> 
> <...>

^ permalink raw reply

* Re: [PATCH 2/7] net/ixgbe/base: remove a compiler warning
From: Dai, Wei @ 2017-01-12 14:08 UTC (permalink / raw)
  To: Yigit, Ferruh, dev@dpdk.org; +Cc: Zhang, Helin, Ananyev, Konstantin
In-Reply-To: <baebd11d-586e-30ff-8530-d37261e699b0@intel.com>

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, January 11, 2017 11:38 PM
> To: Dai, Wei <wei.dai@intel.com>; dev@dpdk.org
> Cc: Zhang, Helin <helin.zhang@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 2/7] net/ixgbe/base: remove a compiler warning
> 
> On 1/10/2017 3:45 PM, Wei Dai wrote:
> > This patch fixes a compiler warning.
> 
> I guess compiler warning is because of "mac->led_link_act = i;", since
> led_link_act is 8bits..
> 
> But can you please add the compile warning here, to make it more clear to
> understand what is the issue.

I have compared the generated ixgbe_common.o both from "u16 i" and "u8 I" .
Two .o files are identical. 
Whether the variable i is defined as u8 or u16,  there is no compile warning. 
The version of gcc version is 6.3.1 20161221 (Red Hat 6.3.1-1) (GCC).
If i is u16, mac->led_link_act = i; should generate a warning, but there is no.
It is a bit weird .
As you know, this code is provided by another Intel team.
I think that it will generate a warning when they build it with their C compiler.
Anyway, to define i as u8 is better than u16 and we had better keep aligned with them.

> 
> >
> > Signed-off-by: Wei Dai <wei.dai@intel.com>
> > ---
> >  drivers/net/ixgbe/base/ixgbe_common.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ixgbe/base/ixgbe_common.c
> > b/drivers/net/ixgbe/base/ixgbe_common.c
> > index 18bb18c..0dd33b8 100644
> > --- a/drivers/net/ixgbe/base/ixgbe_common.c
> > +++ b/drivers/net/ixgbe/base/ixgbe_common.c
> > @@ -1150,7 +1150,7 @@ s32 ixgbe_init_led_link_act_generic(struct
> > ixgbe_hw *hw)  {
> >  	struct ixgbe_mac_info *mac = &hw->mac;
> >  	u32 led_reg, led_mode;
> > -	u16 i;
> > +	u8 i;
> >
> >  	led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
> >
> >

^ permalink raw reply

* Re: [PATCH] app/testpmd: fix static build link ordering
From: Jerin Jacob @ 2017-01-12 13:58 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, ferruh.yigit, stable
In-Reply-To: <1733289.GsZYjJJTCP@xps13>

On Thu, Jan 12, 2017 at 10:26:08AM +0100, Thomas Monjalon wrote:
> 2017-01-12 13:16, Jerin Jacob:
> > +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> >  _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> > +endif
> 
> _LDLIBS is an internal variable of rte.app.mk.
> Please could you check that there is no issue when using LDLIBS instead
> of _LDLIBS?

Tested it. Suggested change has issue in shared lib configuration.

[dpdk-master] $ git diff
diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile
index 050663a..27cadd5 100644
--- a/app/test-pmd/Makefile
+++ b/app/test-pmd/Makefile
@@ -59,9 +59,7 @@ SRCS-y += csumonly.c
 SRCS-y += icmpecho.c
 SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c
 
-ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
-endif
+LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
 
 CFLAGS_cmdline.o := -D_GNU_SOURCE

[error]


gcc -Wp,-MD,./.iofwd.o.d.tmp  -m64 -pthread -fPIC  -march=native
-DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2
-DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3
-DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2
-DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ
-DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_RDRAND
-DRTE_MACHINE_CPUFLAG_FSGSBASE -DRTE_MACHINE_CPUFLAG_F16C
-DRTE_MACHINE_CPUFLAG_AVX2  -I/export/dpdk-master/build/include -include
/export/dpdk-master/build/include/rte_config.h -O3 -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs
-Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef
-Wwrite-strings -Werror    -o iofwd.o -c
/export/dpdk-master/app/test-pmd/iofwd.c 
gcc -o testpmd -m64 -pthread -fPIC  -march=native
-DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2
-DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3
-DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2
-DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ
-DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_RDRAND
-DRTE_MACHINE_CPUFLAG_FSGSBASE -DRTE_MACHINE_CPUFLAG_F16C
-DRTE_MACHINE_CPUFLAG_AVX2  -I/export/dpdk-master/build/include -include
/export/dpdk-master/build/include/rte_config.h -O3 -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs
-Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef
-Wwrite-strings -Werror testpmd.o parameters.o cmdline.o cmdline_flow.o
config.o iofwd.o macfwd.o macswap.o flowgen.o rxonly.o txonly.o
csumonly.o icmpecho.o -L/export/dpdk-master/build/lib -Wl,-lrte_kni
-Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_pdump
-Wl,-lrte_distributor -Wl,-lrte_reorder -Wl,-lrte_ip_frag
-Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lrte_lpm -Wl,--whole-archive
-Wl,-lrte_acl -Wl,--no-whole-archive -Wl,-lrte_jobstats -Wl,-lrte_power
-Wl,--whole-archive -Wl,-lrte_timer -Wl,-lrte_hash -Wl,-lrte_vhost
-Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_net -Wl,-lrte_ethdev
-Wl,-lrte_cryptodev -Wl,-lrte_eventdev -Wl,-lrte_mempool -Wl,-lrte_ring
-Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond
-Wl,--no-whole-archive -Wl,-lgcc_s -Wl,-ldl -Wl,-export-dynamic
-Wl,-export-dynamic -Wl,-export-dynamic -L/export/dpdk-master/build/lib
-Wl,--as-needed -Wl,-rpath=/export/dpdk-master/build/lib
-Wl,-Map=testpmd.map -Wl,--cref 
cmdline.o: In function `cmd_set_vf_vlan_anti_spoof_parsed':
cmdline.c:(.text+0x4b3a): undefined reference to
`rte_pmd_ixgbe_set_vf_vlan_anti_spoof'
cmdline.o: In function `cmd_set_vf_mac_anti_spoof_parsed':
cmdline.c:(.text+0x4c02): undefined reference to
`rte_pmd_ixgbe_set_vf_mac_anti_spoof'
cmdline.o: In function `cmd_set_vf_vlan_stripq_parsed':
cmdline.c:(.text+0x4cd2): undefined reference to
`rte_pmd_ixgbe_set_vf_vlan_stripq'
cmdline.o: In function `cmd_set_vf_split_drop_en_parsed':
cmdline.c:(.text+0x4da2): undefined reference to
`rte_pmd_ixgbe_set_vf_split_drop_en'
cmdline.o: In function `cmd_set_vf_vlan_insert_parsed':
cmdline.c:(.text+0x5eda): undefined reference to
`rte_pmd_ixgbe_set_vf_vlan_insert'
cmdline.o: In function `cmd_set_tx_loopback_parsed':
cmdline.c:(.text+0x5f8b): undefined reference to
`rte_pmd_ixgbe_set_tx_loopback'
cmdline.o: In function `cmd_set_all_queues_drop_en_parsed':
cmdline.c:(.text+0x604b): undefined reference to
`rte_pmd_ixgbe_set_all_queues_drop_en'
cmdline.o: In function `cmd_set_vf_mac_addr_parsed':
cmdline.c:(.text+0x60ea): undefined reference to
`rte_pmd_ixgbe_set_vf_mac_addr'
collect2: error: ld returned 1 exit status
/export/dpdk-master/mk/rte.app.mk:236: recipe for target 'testpmd'
failed
make[3]: *** [testpmd] Error 1
/export/dpdk-master/mk/rte.subdir.mk:61: recipe for target 'test-pmd'
failed
make[2]: *** [test-pmd] Error 2
/export/dpdk-master/mk/rte.sdkbuild.mk:78: recipe for target 'app'
failed
make[1]: *** [app] Error 2
/export/dpdk-master/mk/rte.sdkroot.mk:130: recipe for target 'all'
failed
make: *** [all] Error 2

 

^ permalink raw reply related

* [PATCH v3 2/2] app/testpmd: add command to configure VMDq
From: Bernard Iremonger @ 2017-01-12 13:58 UTC (permalink / raw)
  To: dev, wenzhuo.lu, jingjing.wu, helin.zhang; +Cc: Bernard Iremonger
In-Reply-To: <1483979366-16914-1-git-send-email-bernard.iremonger@intel.com>

Add the following command to configure VMDq:
port config <port> vmdq

Add new command to testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      |  60 +++++++++++++
 app/test-pmd/testpmd.c                      | 126 +++++++++++++++++++++++++++-
 app/test-pmd/testpmd.h                      |   1 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |   7 ++
 4 files changed, 193 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 4e8b0d8..b780f3f 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -604,6 +604,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" pfc (on|off)\n"
 			"    Set the DCB mode.\n\n"
 
+			"port config (port_id) vmdq\n"
+			"    Configure VMDq.\n\n"
+
 			"port config all burst (value)\n"
 			"    Set the number of packets per burst.\n\n"
 
@@ -2297,6 +2300,62 @@ cmdline_parse_inst_t cmd_config_dcb = {
         },
 };
 
+/* *** Configure VMDq *** */
+struct cmd_config_vmdq {
+	cmdline_fixed_string_t port;
+	cmdline_fixed_string_t config;
+	uint8_t port_id;
+	cmdline_fixed_string_t vmdq;
+};
+
+static void
+cmd_config_vmdq_parsed(void *parsed_result,
+		       __attribute__((unused)) struct cmdline *cl,
+		       __attribute__((unused)) void *data)
+{
+	struct cmd_config_vmdq *res = parsed_result;
+	portid_t port_id = res->port_id;
+	struct rte_port *port;
+	int ret;
+
+	port = &ports[port_id];
+	/** Check if the port is not started **/
+	if (port->port_status != RTE_PORT_STOPPED) {
+		printf("Please stop port %d first\n", port_id);
+		return;
+	}
+
+	ret = init_port_vmdq_config(port_id);
+	if (ret != 0) {
+		printf("Cannot initialize network ports.\n");
+		return;
+	}
+
+	cmd_reconfig_device_queue(port_id, 0, 1);
+}
+
+cmdline_parse_token_string_t cmd_config_vmdq_port =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_vmdq, port, "port");
+cmdline_parse_token_string_t cmd_config_vmdq_config =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_vmdq, config, "config");
+cmdline_parse_token_num_t cmd_config_vmdq_port_id =
+	TOKEN_NUM_INITIALIZER(struct cmd_config_vmdq, port_id, UINT8);
+cmdline_parse_token_string_t cmd_config_vmdq_vmdq =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_vmdq, vmdq, "vmdq");
+
+cmdline_parse_inst_t cmd_config_vmdq = {
+	.f = cmd_config_vmdq_parsed,
+	.data = NULL,
+	.help_str = "port config <port-id> vmdq",
+	.tokens = {
+		(void *)&cmd_config_vmdq_port,
+		(void *)&cmd_config_vmdq_config,
+		(void *)&cmd_config_vmdq_port_id,
+		(void *)&cmd_config_vmdq_vmdq,
+		NULL,
+	},
+};
+
 /* *** configure number of packets per burst *** */
 struct cmd_config_burst {
 	cmdline_fixed_string_t port;
@@ -11572,6 +11631,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_link_flow_control_set_autoneg,
 	(cmdline_parse_inst_t *)&cmd_priority_flow_control_set,
 	(cmdline_parse_inst_t *)&cmd_config_dcb,
+	(cmdline_parse_inst_t *)&cmd_config_vmdq,
 	(cmdline_parse_inst_t *)&cmd_read_reg,
 	(cmdline_parse_inst_t *)&cmd_read_reg_bit_field,
 	(cmdline_parse_inst_t *)&cmd_read_reg_bit,
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index bfb2f8e..11d263d 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -196,6 +196,34 @@ uint8_t dcb_test = 0;
 queueid_t nb_rxq = 1; /**< Number of RX queues per port. */
 queueid_t nb_txq = 1; /**< Number of TX queues per port. */
 
+static const struct rte_eth_conf vmdq_conf_default = {
+	.rxmode = {
+		.mq_mode        = ETH_MQ_RX_VMDQ_ONLY,
+		.split_hdr_size = 0,
+		.header_split   = 0, /**< Header Split disabled */
+		.hw_ip_checksum = 0, /**< IP checksum offload disabled */
+		.hw_vlan_filter = 0, /**< VLAN filtering disabled */
+		.jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
+	},
+
+	.txmode = {
+		.mq_mode = ETH_MQ_TX_NONE,
+	},
+	.rx_adv_conf = {
+		/*
+		 * should be overridden separately in code with
+		 * appropriate values
+		 */
+		.vmdq_rx_conf = {
+			.nb_queue_pools = ETH_8_POOLS,
+			.enable_default_pool = 0,
+			.default_pool = 0,
+			.nb_pool_maps = 0,
+			.pool_map = {{0, 0},},
+		},
+	},
+};
+
 /*
  * Configurable number of RX/TX ring descriptors.
  */
@@ -1895,6 +1923,102 @@ const uint16_t vlan_tags[] = {
 		24, 25, 26, 27, 28, 29, 30, 31
 };
 
+const uint16_t num_vlans = RTE_DIM(vlan_tags);
+static uint16_t num_pf_queues, num_vmdq_queues;
+static uint16_t vmdq_pool_base, vmdq_queue_base;
+/* number of pools (if user does not specify any, 8 by default */
+static uint32_t num_queues = 8;
+static uint32_t num_pools = 8;
+
+/**
+ * Builds up the correct configuration for vmdq based on the vlan tags array
+ * given above, and determine the queue number and pool map number according to
+ * valid pool number
+ */
+static int
+get_eth_vmdq_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)
+{
+	struct rte_eth_vmdq_rx_conf conf;
+	uint8_t i;
+
+	conf.nb_queue_pools = (enum rte_eth_nb_pools)num_pools;
+	conf.nb_pool_maps = num_pools;
+	conf.enable_default_pool = 0;
+	conf.default_pool = 0; /* set explicit value, even if not used */
+
+	for (i = 0; i < conf.nb_pool_maps; i++) {
+		conf.pool_map[i].vlan_id = vlan_tags[i];
+		conf.pool_map[i].pools = (1UL << (i % num_pools));
+	}
+
+	(void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
+	(void)(rte_memcpy(&eth_conf->rx_adv_conf.vmdq_rx_conf, &conf,
+	       sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+	return 0;
+}
+
+/**
+ * Configures VMDq for  a given port using global settings.
+ */
+int
+init_port_vmdq_config(uint8_t port)
+{
+	struct rte_eth_dev_info dev_info;
+	struct rte_eth_conf port_conf;
+	uint16_t rx_queues, tx_queues;
+	int retval;
+	uint16_t queues_per_pool;
+	uint32_t max_nb_pools;
+
+	if (port >= rte_eth_dev_count())
+		return -1;
+	/**
+	 * The max pool number from dev_info will be used to validate the pool
+	 * number.
+	 */
+	rte_eth_dev_info_get(port, &dev_info);
+	max_nb_pools = (uint32_t)dev_info.max_vmdq_pools;
+	/**
+	 * We allow to process part of VMDQ pools specified by num_pools in
+	 * command line.
+	 */
+	if (num_pools > max_nb_pools) {
+		printf("num_pools %d >max_nb_pools %d\n",
+			num_pools, max_nb_pools);
+		return -1;
+	}
+
+	retval = get_eth_vmdq_conf(&port_conf, num_pools);
+	if (retval < 0)
+		return retval;
+
+	/*
+	 * NIC queues are divided into pf queues and vmdq queues.
+	 */
+	/* There is assumption here all ports have the same configuration! */
+	num_pf_queues = dev_info.max_rx_queues - dev_info.vmdq_queue_num;
+	queues_per_pool = dev_info.vmdq_queue_num / dev_info.max_vmdq_pools;
+	num_vmdq_queues = num_pools * queues_per_pool;
+	num_queues = num_pf_queues + num_vmdq_queues;
+	vmdq_queue_base = dev_info.vmdq_queue_base;
+	vmdq_pool_base  = dev_info.vmdq_pool_base;
+
+	printf("num_pf_queues: %u num_pools: %u\n", num_pf_queues, num_pools);
+	printf("each vmdq pool has %u queues\n", queues_per_pool);
+	printf("vmdq_queue_base: %d vmdq_pool_base: %d\n", vmdq_queue_base, vmdq_pool_base);
+
+	/*
+	 * All queues including pf queues are setup.
+	 * This is because VMDQ queues doesn't always start from zero, and the
+	 * PMD layer doesn't support selectively initialising part of rx/tx
+	 * queues.
+	 */
+	rx_queues = (uint16_t)dev_info.max_rx_queues;
+	tx_queues = (uint16_t)dev_info.max_tx_queues;
+	retval = rte_eth_dev_configure(port, rx_queues, tx_queues, &port_conf);
+	return retval;
+}
+
 static  int
 get_eth_dcb_conf(struct rte_eth_conf *eth_conf,
 		 enum dcb_mode_enable dcb_mode,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 22ce2d6..6e72420 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -580,6 +580,7 @@ uint8_t port_is_bonding_slave(portid_t slave_pid);
 int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode,
 		     enum rte_eth_nb_tcs num_tcs,
 		     uint8_t pfc_en);
+int init_port_vmdq_config(uint8_t port);
 int start_port(portid_t pid);
 void stop_port(portid_t pid);
 void close_port(portid_t pid);
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index c611dc5..d9839cc 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1374,6 +1374,13 @@ Set the DCB mode for an individual port::
 
 The traffic class should be 4 or 8.
 
+port config - VMDq
+~~~~~~~~~~~~~~~~~~
+
+Configure VMDq for an individual port::
+
+   testpmd> port config (port_id) vmdq
+
 port config - Burst
 ~~~~~~~~~~~~~~~~~~~
 
-- 
2.10.1

^ permalink raw reply related

* [PATCH v3 0/2] net/i40e: fix segmentation fault
From: Bernard Iremonger @ 2017-01-12 13:58 UTC (permalink / raw)
  To: dev, wenzhuo.lu, jingjing.wu, helin.zhang; +Cc: Bernard Iremonger
In-Reply-To: <1483979366-16914-1-git-send-email-bernard.iremonger@intel.com>

Changes in v3:
Fix checkpatch  warning in testpmd.c
Tidy debug code in testpmd.c

Changes in v2: 
These two patches were previously part of the following patchset:
[PATCH v7 00/27] Support VFD on i40e

They are being submitted seperately as they are not needed for VFD.
The net/i40e patch has been revised.
The testpmd patch is needed to setup VMDq in order to test the fix.

Bernard Iremonger (2):
  net/i40e: fix segmentation fault in close
  app/testpmd: add command to configure VMDq

 app/test-pmd/cmdline.c                      |  60 +++++++++++++
 app/test-pmd/testpmd.c                      | 126 +++++++++++++++++++++++++++-
 app/test-pmd/testpmd.h                      |   1 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |   7 ++
 drivers/net/i40e/i40e_ethdev.c              |  12 +--
 5 files changed, 200 insertions(+), 6 deletions(-)

-- 
2.10.1

^ permalink raw reply

* [PATCH v3 1/2] net/i40e: fix segmentation fault in close
From: Bernard Iremonger @ 2017-01-12 13:58 UTC (permalink / raw)
  To: dev, wenzhuo.lu, jingjing.wu, helin.zhang; +Cc: Bernard Iremonger, stable
In-Reply-To: <1483979366-16914-1-git-send-email-bernard.iremonger@intel.com>

Change the order of releasing the vsi's.
Release the vmdq vsi's first, then release the main vsi.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

CC: stable@dpdk.org

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index f13e61b..e8cfec8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2068,18 +2068,17 @@ i40e_dev_close(struct rte_eth_dev *dev)
 	/* shutdown and destroy the HMC */
 	i40e_shutdown_lan_hmc(hw);
 
-	/* release all the existing VSIs and VEBs */
-	i40e_fdir_teardown(pf);
-	i40e_vsi_release(pf->main_vsi);
-
 	for (i = 0; i < pf->nb_cfg_vmdq_vsi; i++) {
 		i40e_vsi_release(pf->vmdq[i].vsi);
 		pf->vmdq[i].vsi = NULL;
 	}
-
 	rte_free(pf->vmdq);
 	pf->vmdq = NULL;
 
+	/* release all the existing VSIs and VEBs */
+	i40e_fdir_teardown(pf);
+	i40e_vsi_release(pf->main_vsi);
+
 	/* shutdown the adminq */
 	i40e_aq_queue_shutdown(hw, true);
 	i40e_shutdown_adminq(hw);
@@ -4342,6 +4341,9 @@ i40e_vsi_release(struct i40e_vsi *vsi)
 	if (!vsi)
 		return I40E_SUCCESS;
 
+	if (!vsi->adapter)
+		return I40E_ERR_BAD_PTR;
+
 	user_param = vsi->user_param;
 
 	pf = I40E_VSI_TO_PF(vsi);
-- 
2.10.1

^ permalink raw reply related

* Re: i40e_aq_get_phy_capabilities() fails when using SFP+ with no link
From: Olivier MATZ @ 2017-01-12 13:55 UTC (permalink / raw)
  To: Rowden, Aaron F
  Cc: Christos Ricudis, Zhang, Helin, Olivier MATZ, dev@dpdk.org,
	Wu, Jingjing
In-Reply-To: <FC7A99FCE8F15942AB8D6F91FF66D8F694836A60@ORSMSX112.amr.corp.intel.com>

Hi,

On Wed, 11 Jan 2017 20:51:58 +0000, "Rowden, Aaron F"
<aaron.f.rowden@intel.com> wrote:
> Hi Helin,
> 
> I'm checking on this to see why it could be failing but I don’t think
> this is one part of formal validation. Intel modules are always what
> is recommended.
> 
> Aaron
> 
> > Hi Helin, 
> > 
> > > On 11 Jan 2017, at 09:08, Zhang, Helin <helin.zhang@intel.com>
> > > wrote:
> > > 
> > > Hi Aaron
> > > 
> > > Is the SFP+ (Finisar FTLX8571D3BCL) supported and validated by
> > > Intel? It seems there is some PHY issue in this case.  
> > 
> > As the original reporter of this issue, I will test with validated
> > SFP+s and will report on my testing. 
> > 
> > Shouldn’t unsupported SFP+s be blacklisted in the I40E driver? 
> > 

Just to let you know that in my case the SFP are Intel ones.
Maybe it's a different issue.

I see there are some i40e fixes in the net-next repo, I'll give a try
with this version.

Regards,
Olivier

^ permalink raw reply

* Re: [PATCH] ethdev: check process type before reset dev data
From: Thomas Monjalon @ 2017-01-12 13:45 UTC (permalink / raw)
  To: Haibo Zhang; +Cc: dev, zhoujingbin, zhangyuexi
In-Reply-To: <1484209998-21852-1-git-send-email-zhanghaibo5@huawei.com>

2017-01-12 16:33, Haibo Zhang:
> Overwrite dev date by no primary process would cause
> segment fault issue to primary proccess during receive pkt
> 
> Signed-off-by: Haibo Zhang <zhanghaibo5@huawei.com>

Thank you for the fix.
A similar one was proposed by Yuanhan:
	http://dpdk.org/ml/archives/dev/2017-January/054220.html

^ permalink raw reply

* Re: [PATCH v2] SDK: Add scripts to initialize DPDK runtime
From: Christian Ehrhardt @ 2017-01-12 13:43 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Luca Boccassi, dev, Stefan Bader, Bruce Richardson
In-Reply-To: <3810875.kgVK3RKdmy@xps13>

On Mon, Dec 19, 2016 at 4:15 PM, Thomas Monjalon <thomas.monjalon@6wind.com>
wrote:

> Thanks for sending your Debian/Ubuntu work.
>
> 2016-12-13 16:47, Luca Boccassi:
> > From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> >
> > A tools/init directory is added with dpdk-init, a script that can be
> > used to initialize a DPDK runtime environment. 2 config files with
> > default options, dpdk.conf and interfaces, are provided as well
> > together with a SysV init script and a systemd service unit.
>
> I have 2 concerns:
>
> - What does exactly mean "initialize a DPDK runtime environment"?
> Should it be documented somewhere?
>

Sorry for the late reply, Luca made me aware that this was lost in the
Christmas hole.
It means that you make a system config ready to be used in a persistent way
e.g. cross reboots.

The common steps to prep a system in that regard are assigning a set of
cards to dpdk (=>dpdk-devbind) and furthermore to set up hugepages as
needed.
The latter is only a simple helper for the convenience of the admin. It can
suit 95% of the cases but if someone has something very specific in mind a
manual hugepage setup might be needed.

The conf files themself have comment on their usage.
I'm not sure how much more (on top of the comments in the config files) a
doc might be useful.
But then that might just be because I happen to know about that stuff.
We could hapilly copy the bit we have about it at
https://help.ubuntu.com/16.04/serverguide/DPDK.html#dpdk-config-dev
https://help.ubuntu.com/16.04/serverguide/DPDK.html#dpdk-config-hp

Luca/Thomas - what do you think about that?


> - Is it deprecating dpdk-setup.sh?
>

dpdk-setup is a one-shot effort and provides very different things.
the init script is for the system lifecycle, to be controlled by config
files and invoked automatically.

ATM - we covered what is needed on a regular base in the script, while
dpdk-setup has a longer list of use-cases.
If anybody identifies functions of dpdk-setup which would be reasonable in
a lifecycle management we should be open to take patches moving those from
the one-shot to the system service.
Also one could think of sharing some code between them - like providing
sourcable shell fragment that both scripts use to execute - yet I don't
think it is needed until I see a reasonable call that this is needed or
helpful.
Once (I don't expect that) all functionality would have moved it would be
deprecated, but not for now in my Opinion.

-- 
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd

^ permalink raw reply

* Re: [PATCH v6 4/4] latencystats: added new library for latency stats
From: Thomas Monjalon @ 2017-01-12 13:41 UTC (permalink / raw)
  To: Remy Horton, Reshma Pattan; +Cc: dev, olivier.matz
In-Reply-To: <1484150594-3758-5-git-send-email-remy.horton@intel.com>

2017-01-12 00:03, Remy Horton:
> Add a library designed to calculate latency statistics and report them
> to the application when queried. The library measures minimum, average and
> maximum latencies, and jitter in nano seconds. The current implementation
> supports global latency stats, i.e. per application stats.

Is it specific to ethdev ports?

> Added new field to mbuf struct to mark the packet arrival time on Rx.

There was another patch adding a timestamp in mbuf:
	http://dpdk.org/ml/archives/dev/2016-October/048809.html

> Modify testpmd code to initialize/uninitialize latency statistics
> calulation.
> 
> Modify the dpdk-procinfo process to display the newly added metrics.
> Added new command line option "--metrics" to display metrics.

It should be a separate patch.

> APIs:
> 
> * Added APIs to initialize and un initialize latency stats
>   calculation.
> * Added API to retrieve latency stats names and values.

Why bitrate and latencies are separate libs?

^ permalink raw reply

* Re: [PATCH v3 25/29] net/nfp: use eal I/O device memory read/write API
From: Jerin Jacob @ 2017-01-12 13:40 UTC (permalink / raw)
  To: Alejandro Lucero
  Cc: dev, Ananyev, Konstantin, Thomas Monjalon, Bruce Richardson,
	jianbo.liu, Jan Viktorin, santosh.shukla
In-Reply-To: <CAD+H992WfM6goFehpOuGRkN=ANXLYrDF9FMGS23MZACzFWG8TQ@mail.gmail.com>

On Thu, Jan 12, 2017 at 10:53:17AM +0000, Alejandro Lucero wrote:
> Hi,
> 
> I've tried to find out which dpdk repo should I use for testing this change
> with NFP PMD.
> 
> It seems rte_read/write functions are not with last dpdk main repo, nor
> with dpdk-net-next.
> 
> Can someone tell me which repo should I use?

It is based on the dpdk main repo. This patchset has 29 patches. The initial
patches in the series contains the definition of rte_read/write.

I have created a temporary branch in public repo to make other users to
test the changes without applying all patches.

https://github.com/jerinjacobk/dpdk.git
branch: rte_io_v3
It is based on today's dpdk master and this patchset.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox