[dpdk-dev] [PATCH v2] test_cryptodev_perf: IV and digest should be stored at a DMAeble address

2016-10-07 Thread akhil.go...@nxp.com
From: Akhil Goyal 

For physical crypto devices, IV and digest are processed by the crypto
device which need the contents to be written on some DMA able address.

So in order to do that, IV and digest are accomodated in the packet.

Signed-off-by: Akhil Goyal 
v2: patch rebased
---
 app/test/test_cryptodev_perf.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/test/test_cryptodev_perf.c b/app/test/test_cryptodev_perf.c
index 4aee9af..08eda81 100644
--- a/app/test/test_cryptodev_perf.c
+++ b/app/test/test_cryptodev_perf.c
@@ -2722,9 +2722,12 @@ test_perf_set_crypto_op_aes(struct rte_crypto_op *op, 
struct rte_mbuf *m,
op->sym->auth.aad.length = AES_CIPHER_IV_LENGTH;

/* Cipher Parameters */
-   op->sym->cipher.iv.data = aes_iv;
+   op->sym->cipher.iv.data = (uint8_t *)m->buf_addr + m->data_off;
+   op->sym->cipher.iv.phys_addr = rte_pktmbuf_mtophys(m);
op->sym->cipher.iv.length = AES_CIPHER_IV_LENGTH;

+   rte_memcpy(op->sym->cipher.iv.data, aes_iv, AES_CIPHER_IV_LENGTH);
+
/* Data lengths/offsets Parameters */
op->sym->auth.data.offset = 0;
op->sym->auth.data.length = data_len;
@@ -2893,7 +2896,9 @@ test_perf_aes_sha(uint8_t dev_id, uint16_t queue_id,
rte_pktmbuf_free(mbufs[k]);
return -1;
}
-
+   /* Make room for Digest and IV in mbuf */
+   rte_pktmbuf_append(mbufs[i], digest_length);
+   rte_pktmbuf_prepend(mbufs[i], AES_CBC_CIPHER_IV_LENGTH);
}


-- 
2.9.3



[dpdk-dev] [PATCH] examples/ipsec-secgw: Update checksum while decrementing ttl

2016-10-07 Thread De Lara Guarch, Pablo

> -Original Message-
> From: Akhil Goyal [mailto:akhil.goyal at nxp.com]
> Sent: Tuesday, October 04, 2016 11:33 PM
> To: De Lara Guarch, Pablo; Gonzalez Monroy, Sergio; dev at dpdk.org
> Subject: Re: [PATCH] examples/ipsec-secgw: Update checksum while
> decrementing ttl
> 
> On 10/5/2016 6:04 AM, De Lara Guarch, Pablo wrote:
> >
> >
> >> -Original Message-
> >> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Sergio Gonzalez
> >> Monroy
> >> Sent: Monday, September 26, 2016 6:28 AM
> >> To: akhil.goyal at nxp.com; dev at dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: Update checksum
> >> while decrementing ttl
> >>
> >> Hi Akhil,
> >>
> >> This application relies on checksum offload in both outbound and
> inbound
> >> paths (PKT_TX_IP_CKSUM flag).
> [Akhil]Agreed that the application relies on checksum offload, but here
> we are talking about the inner ip header. Inner IP checksum will be
> updated on the next end point after decryption. This would expect that
> the next end point must have checksum offload capability. What if we are
> capturing the encrypted packets on wireshark or say send it to some
> other machine which does not run DPDK and do not know about checksum
> offload, then wireshark/other machine will not be able to get the
> correct the checksum and will show error.
> >>
> >> Because we assume that we always forward the packet in both paths, we
> >> decrement the ttl in both inbound and outbound.
> >> You seem to only increment (recalculate) the checksum of the inner IP
> >> header in the outbound path but not the inbound path.
> [Akhil]Correct I missed out the inbound path.
> >>
> >> Also, in the inbound path you have to consider a possible ECN value
> update.
> [Akhil]If I take care of the ECN then it would mean I need to calculate
> the checksum completely, incremental checksum wont give correct results.
> This would surely impact performance. Any suggestion on how should we
> take care of ECN update. Should I recalculate the checksum and send the
> patch for ECN update? Or do we have a better solution.
> >
> > Any further comments here, Akhil?
> >
> > Thanks,
> > Pablo
> >
> [Akhil] Sorry I missed out the previous reply from Sergio.

Any more comments, Sergio?

Pablo
> 
> Thanks,
> Akhil
> >>



[dpdk-dev] [PATCH 1/3] eal/drivers: prefix driver REGISTER macros with EAL

2016-10-07 Thread Shreyansh Jain
Hi David, Thomas,

On Friday 07 October 2016 07:03 PM, Shreyansh Jain wrote:
> DRIVER_REGISTER_PCI -> EAL_REGISTER_PCI
> DRIVER_REGISTER_PCI_TABLE -> EAL_REGISTER_PCI_TABLE
>
> Signed-off-by: Shreyansh Jain 
> ---
>  doc/guides/prog_guide/dev_kit_build_system.rst | 2 +-
>  drivers/crypto/qat/rte_qat_cryptodev.c | 4 ++--
>  drivers/net/bnx2x/bnx2x_ethdev.c   | 8 
>  drivers/net/bnxt/bnxt_ethdev.c | 4 ++--
>  drivers/net/cxgbe/cxgbe_ethdev.c   | 4 ++--
>  drivers/net/e1000/em_ethdev.c  | 4 ++--
>  drivers/net/e1000/igb_ethdev.c | 8 
>  drivers/net/ena/ena_ethdev.c   | 4 ++--
>  drivers/net/enic/enic_ethdev.c | 4 ++--
>  drivers/net/fm10k/fm10k_ethdev.c   | 4 ++--
>  drivers/net/i40e/i40e_ethdev.c | 4 ++--
>  drivers/net/i40e/i40e_ethdev_vf.c  | 4 ++--
>  drivers/net/ixgbe/ixgbe_ethdev.c   | 8 
>  drivers/net/mlx4/mlx4.c| 2 +-
>  drivers/net/mlx5/mlx5.c| 2 +-
>  drivers/net/nfp/nfp_net.c  | 4 ++--
>  drivers/net/qede/qede_ethdev.c | 8 
>  drivers/net/szedata2/rte_eth_szedata2.c| 4 ++--
>  drivers/net/thunderx/nicvf_ethdev.c| 4 ++--
>  drivers/net/virtio/virtio_ethdev.c | 2 +-
>  drivers/net/vmxnet3/vmxnet3_ethdev.c   | 4 ++--
>  lib/librte_eal/common/include/rte_dev.h| 2 +-
>  lib/librte_eal/common/include/rte_pci.h| 2 +-
>  23 files changed, 48 insertions(+), 48 deletions(-)
>
[...]

Ideally there should be a another patch like below as part of the series:

--->8---
diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk
index a42ef03..a91c265 100644
--- a/mk/internal/rte.compile-pre.mk
+++ b/mk/internal/rte.compile-pre.mk
@@ -87,7 +87,7 @@ endif
  PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ $@.pmd.c
  PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@.pmd.o $@.pmd.c
  PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o $@.o $@.pmd.o $@
-PMDINFO_TO_O = if grep -q 'DRIVER_REGISTER_.*(.*)' $<; then \
+PMDINFO_TO_O = if grep 'EAL_REGISTER_.*(.*)' $<; then \
 echo "$(if $V,$(PMDINFO_GEN),  PMDINFO $@.pmd.c)" && \
 $(PMDINFO_GEN) && \
 echo "$(if $V,$(PMDINFO_CC),  CC $@.pmd.o)" && \

--->8---

But unfortunately, my build system complained about this. (and I stopped 
short of sending this patch).

The output of compilation after this patch is something like:

--->8---
   CC eal_pci_vfio.o
   PMDINFO eal_pci_vfio.o.pmd.c
/bin/sh: 1: 
/home/shreyansh/build/DPDK/02_dpdk/x86_64-native-linuxapp-gcc/app/dpdk-pmdinfogen:
 
not found
/home/shreyansh/build/DPDK/02_dpdk/mk/internal/rte.compile-pre.mk:138: 
recipe for target 'eal_pci_vfio.o' failed
--->8---

I don't think PMDINFO should be running on eal_pci_vfio file. Isn't it? 
Is it because EAL_REGISTER_* is matching EAL_REGISTER_TAILQ like macro 
as well?

I am not very well versed with how PMDINFO is linking with the build 
system so any hints/insight into this would be really helpful.

One I get more clarity on this, I will push a new version of this patch.

-
Shreyansh


[dpdk-dev] [PATCH 3/3] eal/drivers: prefix driver param REGISTER macro with EAL

2016-10-07 Thread Shreyansh Jain
Signed-off-by: Shreyansh Jain 
---
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c   | 2 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 2 +-
 drivers/crypto/kasumi/rte_kasumi_pmd.c | 2 +-
 drivers/crypto/null/null_crypto_pmd.c  | 2 +-
 drivers/crypto/snow3g/rte_snow3g_pmd.c | 2 +-
 drivers/net/af_packet/rte_eth_af_packet.c  | 2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
 drivers/net/null/rte_eth_null.c| 2 +-
 drivers/net/pcap/rte_eth_pcap.c| 2 +-
 drivers/net/ring/rte_eth_ring.c| 2 +-
 drivers/net/vhost/rte_eth_vhost.c  | 2 +-
 drivers/net/virtio/virtio_user_ethdev.c| 2 +-
 drivers/net/xenvirt/rte_eth_xenvirt.c  | 2 +-
 lib/librte_eal/common/include/rte_dev.h| 2 +-
 14 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c 
b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index 75f1256..b689a40 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -520,7 +520,7 @@ static struct rte_vdev_driver aesni_gcm_pmd_drv = {
 };

 EAL_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_GCM_PMD, aesni_gcm_pmd_drv);
-DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_GCM_PMD,
+EAL_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_GCM_PMD,
"max_nb_queue_pairs= "
"max_nb_sessions= "
"socket_id=");
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c 
b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index 3390116..80044d8 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -720,7 +720,7 @@ static struct rte_vdev_driver cryptodev_aesni_mb_pmd_drv = {
 };

 EAL_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_MB_PMD, cryptodev_aesni_mb_pmd_drv);
-DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_MB_PMD,
+EAL_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_MB_PMD,
"max_nb_queue_pairs= "
"max_nb_sessions= "
"socket_id=");
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c 
b/drivers/crypto/kasumi/rte_kasumi_pmd.c
index 970bb64..ee2e28a 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
@@ -656,7 +656,7 @@ static struct rte_vdev_driver cryptodev_kasumi_pmd_drv = {
 };

 EAL_REGISTER_VDEV(CRYPTODEV_NAME_KASUMI_PMD, cryptodev_kasumi_pmd_drv);
-DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_KASUMI_PMD,
+EAL_REGISTER_PARAM_STRING(CRYPTODEV_NAME_KASUMI_PMD,
"max_nb_queue_pairs= "
"max_nb_sessions= "
"socket_id=");
diff --git a/drivers/crypto/null/null_crypto_pmd.c 
b/drivers/crypto/null/null_crypto_pmd.c
index 171707d..6af3057 100644
--- a/drivers/crypto/null/null_crypto_pmd.c
+++ b/drivers/crypto/null/null_crypto_pmd.c
@@ -274,7 +274,7 @@ static struct rte_vdev_driver cryptodev_null_pmd_drv = {
 };

 EAL_REGISTER_VDEV(CRYPTODEV_NAME_NULL_PMD, cryptodev_null_pmd_drv);
-DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_NULL_PMD,
+EAL_REGISTER_PARAM_STRING(CRYPTODEV_NAME_NULL_PMD,
"max_nb_queue_pairs= "
"max_nb_sessions= "
"socket_id=");
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c 
b/drivers/crypto/snow3g/rte_snow3g_pmd.c
index 82f3f5d..f3a4bd5 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
@@ -644,7 +644,7 @@ static struct rte_vdev_driver cryptodev_snow3g_pmd_drv = {
 };

 EAL_REGISTER_VDEV(CRYPTODEV_NAME_SNOW3G_PMD, cryptodev_snow3g_pmd_drv);
-DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SNOW3G_PMD,
+EAL_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SNOW3G_PMD,
"max_nb_queue_pairs= "
"max_nb_sessions= "
"socket_id=");
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c 
b/drivers/net/af_packet/rte_eth_af_packet.c
index 556e6b2..e236179 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -895,7 +895,7 @@ static struct rte_vdev_driver pmd_af_packet_drv = {
 };

 EAL_REGISTER_VDEV(net_af_packet, pmd_af_packet_drv);
-DRIVER_REGISTER_PARAM_STRING(net_af_packet,
+EAL_REGISTER_PARAM_STRING(net_af_packet,
"iface= "
"qpairs= "
"blocksz= "
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c 
b/drivers/net/bonding/rte_eth_bond_pmd.c
index ef5901d..2d3194b 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2515,7 +2515,7 @@ static struct rte_vdev_driver bond_drv = {

 EAL_REGISTER_VDEV(net_bonding, bond_drv);

-DRIVER_REGISTER_PARAM_STRING(net_bonding,
+EAL_REGISTER_PARAM_STRING(net_bonding,
"slave= "
"primary= "
"mode=[0-6] "
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 0618299..5485327 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -692,6 +692,6 @@ static struct rte_vdev_driver pmd_null_drv = {
 };

 EAL_REGISTER_VDEV(net_null, pmd_null_drv);
-DRIVER_REGISTER_PARAM_STRING(net_null,
+EAL_REGISTER_PARAM_STRING(net_null,
"size= 

[dpdk-dev] [PATCH 2/3] eal/drivers: prefix VDEV driver REGISTER macro with EAL

2016-10-07 Thread Shreyansh Jain
Signed-off-by: Shreyansh Jain 
---
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c   | 2 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 2 +-
 drivers/crypto/kasumi/rte_kasumi_pmd.c | 2 +-
 drivers/crypto/null/null_crypto_pmd.c  | 2 +-
 drivers/crypto/snow3g/rte_snow3g_pmd.c | 2 +-
 drivers/net/af_packet/rte_eth_af_packet.c  | 2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
 drivers/net/mpipe/mpipe_tilegx.c   | 4 ++--
 drivers/net/null/rte_eth_null.c| 2 +-
 drivers/net/pcap/rte_eth_pcap.c| 2 +-
 drivers/net/ring/rte_eth_ring.c| 2 +-
 drivers/net/vhost/rte_eth_vhost.c  | 2 +-
 drivers/net/virtio/virtio_user_ethdev.c| 2 +-
 drivers/net/xenvirt/rte_eth_xenvirt.c  | 2 +-
 lib/librte_eal/common/eal_common_dev.c | 2 +-
 lib/librte_eal/common/include/rte_vdev.h   | 2 +-
 16 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c 
b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index 317c556..75f1256 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -519,7 +519,7 @@ static struct rte_vdev_driver aesni_gcm_pmd_drv = {
.remove = aesni_gcm_remove
 };

-DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_GCM_PMD, aesni_gcm_pmd_drv);
+EAL_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_GCM_PMD, aesni_gcm_pmd_drv);
 DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_GCM_PMD,
"max_nb_queue_pairs= "
"max_nb_sessions= "
diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c 
b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
index ff2fc25..3390116 100644
--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
@@ -719,7 +719,7 @@ static struct rte_vdev_driver cryptodev_aesni_mb_pmd_drv = {
.remove = cryptodev_aesni_mb_remove
 };

-DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_MB_PMD, cryptodev_aesni_mb_pmd_drv);
+EAL_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_MB_PMD, cryptodev_aesni_mb_pmd_drv);
 DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_MB_PMD,
"max_nb_queue_pairs= "
"max_nb_sessions= "
diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c 
b/drivers/crypto/kasumi/rte_kasumi_pmd.c
index 8774fc2..970bb64 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
@@ -655,7 +655,7 @@ static struct rte_vdev_driver cryptodev_kasumi_pmd_drv = {
.remove = cryptodev_kasumi_remove
 };

-DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_KASUMI_PMD, cryptodev_kasumi_pmd_drv);
+EAL_REGISTER_VDEV(CRYPTODEV_NAME_KASUMI_PMD, cryptodev_kasumi_pmd_drv);
 DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_KASUMI_PMD,
"max_nb_queue_pairs= "
"max_nb_sessions= "
diff --git a/drivers/crypto/null/null_crypto_pmd.c 
b/drivers/crypto/null/null_crypto_pmd.c
index e41e819..171707d 100644
--- a/drivers/crypto/null/null_crypto_pmd.c
+++ b/drivers/crypto/null/null_crypto_pmd.c
@@ -273,7 +273,7 @@ static struct rte_vdev_driver cryptodev_null_pmd_drv = {
.remove = cryptodev_null_remove
 };

-DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_NULL_PMD, cryptodev_null_pmd_drv);
+EAL_REGISTER_VDEV(CRYPTODEV_NAME_NULL_PMD, cryptodev_null_pmd_drv);
 DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_NULL_PMD,
"max_nb_queue_pairs= "
"max_nb_sessions= "
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c 
b/drivers/crypto/snow3g/rte_snow3g_pmd.c
index f4b596e..82f3f5d 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
@@ -643,7 +643,7 @@ static struct rte_vdev_driver cryptodev_snow3g_pmd_drv = {
.remove = cryptodev_snow3g_remove
 };

-DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_SNOW3G_PMD, cryptodev_snow3g_pmd_drv);
+EAL_REGISTER_VDEV(CRYPTODEV_NAME_SNOW3G_PMD, cryptodev_snow3g_pmd_drv);
 DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SNOW3G_PMD,
"max_nb_queue_pairs= "
"max_nb_sessions= "
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c 
b/drivers/net/af_packet/rte_eth_af_packet.c
index 6777c41..556e6b2 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -894,7 +894,7 @@ static struct rte_vdev_driver pmd_af_packet_drv = {
.remove = rte_pmd_af_packet_remove,
 };

-DRIVER_REGISTER_VDEV(net_af_packet, pmd_af_packet_drv);
+EAL_REGISTER_VDEV(net_af_packet, pmd_af_packet_drv);
 DRIVER_REGISTER_PARAM_STRING(net_af_packet,
"iface= "
"qpairs= "
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c 
b/drivers/net/bonding/rte_eth_bond_pmd.c
index 970fe0c..ef5901d 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2513,7 +2513,7 @@ static struct rte_vdev_driver bond_drv = {
.remove = bond_remove,
 };

-DRIVER_REGISTER_VDEV(net_bonding, bond_drv);
+EAL_REGISTER_VDEV(net_bonding, bond_drv);

 DRIVER_REGISTER_PARAM_STRING(net_bonding,
"slave= "
diff --git a/drivers/net/mpipe/mpipe_tilegx.c 

[dpdk-dev] [PATCH 1/3] eal/drivers: prefix driver REGISTER macros with EAL

2016-10-07 Thread Shreyansh Jain
DRIVER_REGISTER_PCI -> EAL_REGISTER_PCI
DRIVER_REGISTER_PCI_TABLE -> EAL_REGISTER_PCI_TABLE

Signed-off-by: Shreyansh Jain 
---
 doc/guides/prog_guide/dev_kit_build_system.rst | 2 +-
 drivers/crypto/qat/rte_qat_cryptodev.c | 4 ++--
 drivers/net/bnx2x/bnx2x_ethdev.c   | 8 
 drivers/net/bnxt/bnxt_ethdev.c | 4 ++--
 drivers/net/cxgbe/cxgbe_ethdev.c   | 4 ++--
 drivers/net/e1000/em_ethdev.c  | 4 ++--
 drivers/net/e1000/igb_ethdev.c | 8 
 drivers/net/ena/ena_ethdev.c   | 4 ++--
 drivers/net/enic/enic_ethdev.c | 4 ++--
 drivers/net/fm10k/fm10k_ethdev.c   | 4 ++--
 drivers/net/i40e/i40e_ethdev.c | 4 ++--
 drivers/net/i40e/i40e_ethdev_vf.c  | 4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.c   | 8 
 drivers/net/mlx4/mlx4.c| 2 +-
 drivers/net/mlx5/mlx5.c| 2 +-
 drivers/net/nfp/nfp_net.c  | 4 ++--
 drivers/net/qede/qede_ethdev.c | 8 
 drivers/net/szedata2/rte_eth_szedata2.c| 4 ++--
 drivers/net/thunderx/nicvf_ethdev.c| 4 ++--
 drivers/net/virtio/virtio_ethdev.c | 2 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c   | 4 ++--
 lib/librte_eal/common/include/rte_dev.h| 2 +-
 lib/librte_eal/common/include/rte_pci.h| 2 +-
 23 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/doc/guides/prog_guide/dev_kit_build_system.rst 
b/doc/guides/prog_guide/dev_kit_build_system.rst
index 05358d0..d6120cd 100644
--- a/doc/guides/prog_guide/dev_kit_build_system.rst
+++ b/doc/guides/prog_guide/dev_kit_build_system.rst
@@ -264,7 +264,7 @@ instance the macro:

 .. code-block:: c

-   DRIVER_REGISTER_PCI(name, drv)
+   EAL_REGISTER_PCI(name, drv)

 Creates the following symbol:

diff --git a/drivers/crypto/qat/rte_qat_cryptodev.c 
b/drivers/crypto/qat/rte_qat_cryptodev.c
index 170ae78..2cd2fff 100644
--- a/drivers/crypto/qat/rte_qat_cryptodev.c
+++ b/drivers/crypto/qat/rte_qat_cryptodev.c
@@ -123,6 +123,6 @@ static struct rte_cryptodev_driver rte_qat_pmd = {
.dev_private_size = sizeof(struct qat_pmd_private),
 };

-DRIVER_REGISTER_PCI(CRYPTODEV_NAME_QAT_SYM_PMD, rte_qat_pmd.pci_drv);
-DRIVER_REGISTER_PCI_TABLE(CRYPTODEV_NAME_QAT_SYM_PMD, pci_id_qat_map);
+EAL_REGISTER_PCI(CRYPTODEV_NAME_QAT_SYM_PMD, rte_qat_pmd.pci_drv);
+EAL_REGISTER_PCI_TABLE(CRYPTODEV_NAME_QAT_SYM_PMD, pci_id_qat_map);

diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index e38c238..ad874bd 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -641,7 +641,7 @@ static struct eth_driver rte_bnx2xvf_pmd = {
.dev_private_size = sizeof(struct bnx2x_softc),
 };

-DRIVER_REGISTER_PCI(net_bnx2x, rte_bnx2x_pmd.pci_drv);
-DRIVER_REGISTER_PCI_TABLE(net_bnx2x, pci_id_bnx2x_map);
-DRIVER_REGISTER_PCI(net_bnx2xvf, rte_bnx2xvf_pmd.pci_drv);
-DRIVER_REGISTER_PCI_TABLE(net_bnx2xvf, pci_id_bnx2xvf_map);
+EAL_REGISTER_PCI(net_bnx2x, rte_bnx2x_pmd.pci_drv);
+EAL_REGISTER_PCI_TABLE(net_bnx2x, pci_id_bnx2x_map);
+EAL_REGISTER_PCI(net_bnx2xvf, rte_bnx2xvf_pmd.pci_drv);
+EAL_REGISTER_PCI_TABLE(net_bnx2xvf, pci_id_bnx2xvf_map);
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 427aa69..6713f8e 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1121,5 +1121,5 @@ static struct eth_driver bnxt_rte_pmd = {
.dev_private_size = sizeof(struct bnxt),
 };

-DRIVER_REGISTER_PCI(net_bnxt, bnxt_rte_pmd.pci_drv);
-DRIVER_REGISTER_PCI_TABLE(net_bnxt, bnxt_pci_id_map);
+EAL_REGISTER_PCI(net_bnxt, bnxt_rte_pmd.pci_drv);
+EAL_REGISTER_PCI_TABLE(net_bnxt, bnxt_pci_id_map);
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index d3ff94a..2f7ff66 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -1048,5 +1048,5 @@ static struct eth_driver rte_cxgbe_pmd = {
.dev_private_size = sizeof(struct port_info),
 };

-DRIVER_REGISTER_PCI(net_cxgbe, rte_cxgbe_pmd.pci_drv);
-DRIVER_REGISTER_PCI_TABLE(net_cxgbe, cxgb4_pci_tbl);
+EAL_REGISTER_PCI(net_cxgbe, rte_cxgbe_pmd.pci_drv);
+EAL_REGISTER_PCI_TABLE(net_cxgbe, cxgb4_pci_tbl);
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index f767e1c..d9b19c0 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1793,5 +1793,5 @@ eth_em_set_mc_addr_list(struct rte_eth_dev *dev,
return 0;
 }

-DRIVER_REGISTER_PCI(net_e1000_em, rte_em_pmd.pci_drv);
-DRIVER_REGISTER_PCI_TABLE(net_e1000_em, pci_id_em_map);
+EAL_REGISTER_PCI(net_e1000_em, rte_em_pmd.pci_drv);
+EAL_REGISTER_PCI_TABLE(net_e1000_em, pci_id_em_map);
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 5a1a83e..5cc9d77 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ 

[dpdk-dev] [PATCH] net/virtio: add missing driver name

2016-10-07 Thread Shreyansh Jain
On Friday 07 October 2016 06:33 PM, David Marchand wrote:
> The driver name has been lost with the eal rework.
> Restore it.
>
> Fixes: c830cb295411 ("drivers: use PCI registration macro")
>
> Signed-off-by: David Marchand 
> ---
>  drivers/net/virtio/virtio_ethdev.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/virtio/virtio_ethdev.c 
> b/drivers/net/virtio/virtio_ethdev.c
> index b4dfc0a..809ebf7 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1304,6 +1304,9 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
>
>  static struct eth_driver rte_virtio_pmd = {
>   .pci_drv = {
> + .driver = {
> + .name = "net_virtio",
> + },
>   .id_table = pci_id_virtio_map,
>   .drv_flags = RTE_PCI_DRV_DETACHABLE,
>   .probe = rte_eth_dev_pci_probe,
>

Indeed. For MLX4/5 and Virtio, DRIVER_REGISTER_* is not being used which 
takes this 'name'. In this case, it was missed.

Acked-by: Shreyansh Jain 


[dpdk-dev] [PATCH v5 8/8] app/testpmd: hide segsize when unrelevant in csum engine

2016-10-07 Thread Olivier Matz
When TSO is not asked, hide the segment size.

Signed-off-by: Olivier Matz 
---
 app/test-pmd/csumonly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 2057633..d5eb260 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -808,7 +808,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
(testpmd_ol_flags & 
TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM))
printf("tx: m->outer_l2_len=%d 
m->outer_l3_len=%d\n",
m->outer_l2_len, m->outer_l3_len);
-   if (info.tso_segsz != 0)
+   if (info.tso_segsz != 0 && (m->ol_flags & 
PKT_TX_TCP_SEG))
printf("tx: m->tso_segsz=%d\n", m->tso_segsz);
rte_get_tx_ol_flag_list(m->ol_flags, buf, sizeof(buf));
printf("tx: flags=%s", buf);
-- 
2.8.1



[dpdk-dev] [PATCH v5 7/8] app/testpmd: don't use tso if packet is too small

2016-10-07 Thread Olivier Matz
Asking for TSO (TCP Segmentation Offload) on packets that are already
smaller than (headers + MSS) does not work, for instance on ixgbe.

Fix the csumonly engine to only set the TSO flag when a segmentation
offload is really required, i.e. when packet is large enough.

Signed-off-by: Olivier Matz 
---
 app/test-pmd/csumonly.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 19c8099..2057633 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -101,6 +101,7 @@ struct testpmd_offload_info {
uint16_t outer_l3_len;
uint8_t outer_l4_proto;
uint16_t tso_segsz;
+   uint32_t pkt_len;
 };

 /* simplified GRE header */
@@ -328,13 +329,20 @@ process_inner_cksums(void *l3_hdr, const struct 
testpmd_offload_info *info,
struct tcp_hdr *tcp_hdr;
struct sctp_hdr *sctp_hdr;
uint64_t ol_flags = 0;
+   uint32_t max_pkt_len, tso_segsz = 0;
+
+   /* ensure packet is large enough to require tso */
+   max_pkt_len = info->l2_len + info->l3_len + info->l4_len +
+   info->tso_segsz;
+   if (info->tso_segsz != 0 && info->pkt_len > max_pkt_len)
+   tso_segsz = info->tso_segsz;

if (info->ethertype == _htons(ETHER_TYPE_IPv4)) {
ipv4_hdr = l3_hdr;
ipv4_hdr->hdr_checksum = 0;

ol_flags |= PKT_TX_IPV4;
-   if (info->tso_segsz != 0 && info->l4_proto == IPPROTO_TCP) {
+   if (tso_segsz != 0 && info->l4_proto == IPPROTO_TCP) {
ol_flags |= PKT_TX_IP_CKSUM;
} else {
if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_IP_CKSUM)
@@ -366,7 +374,7 @@ process_inner_cksums(void *l3_hdr, const struct 
testpmd_offload_info *info,
} else if (info->l4_proto == IPPROTO_TCP) {
tcp_hdr = (struct tcp_hdr *)((char *)l3_hdr + info->l3_len);
tcp_hdr->cksum = 0;
-   if (info->tso_segsz != 0) {
+   if (tso_segsz != 0) {
ol_flags |= PKT_TX_TCP_SEG;
tcp_hdr->cksum = get_psd_sum(l3_hdr, info->ethertype,
ol_flags);
@@ -666,6 +674,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)

m = pkts_burst[i];
info.is_tunnel = 0;
+   info.pkt_len = rte_pktmbuf_pkt_len(m);
tx_ol_flags = 0;
rx_ol_flags = m->ol_flags;

-- 
2.8.1



[dpdk-dev] [PATCH v5 6/8] app/testpmd: display Rx port in csum engine

2016-10-07 Thread Olivier Matz
This information is useful when debugging, especially with
bidirectional traffic.

Signed-off-by: Olivier Matz 
---
 app/test-pmd/csumonly.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index eeb67db..19c8099 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -773,8 +773,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
char buf[256];

printf("-\n");
-   printf("mbuf=%p, pkt_len=%u, nb_segs=%hhu:\n",
-   m, m->pkt_len, m->nb_segs);
+   printf("port=%u, mbuf=%p, pkt_len=%u, nb_segs=%hhu:\n",
+   fs->rx_port, m, m->pkt_len, m->nb_segs);
/* dump rx parsed packet info */
rte_get_rx_ol_flag_list(rx_ol_flags, buf, sizeof(buf));
printf("rx: l2_len=%d ethertype=%x l3_len=%d "
-- 
2.8.1



[dpdk-dev] [PATCH v5 5/8] app/testpmd: do not change ip addrs in csum engine

2016-10-07 Thread Olivier Matz
The csum forward engine was updated to change the IP addresses in the
packet data in
commit 51f694dd40f5 ("app/testpmd: rework checksum forward engine")

This was done to ensure that the checksum is correctly reprocessed when
using hardware checksum offload. But the functions
process_inner_cksums() and process_outer_cksums() already reset the
checksum field to 0, so this is not necessary.

Moreover, this makes the engine more complex than needed, and prevents
to easily use it to forward traffic (like iperf) as it modifies the
packets.

This patch drops this behavior.

Signed-off-by: Olivier Matz 
---
 app/test-pmd/csumonly.c | 30 --
 1 file changed, 4 insertions(+), 26 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index e7ee0b3..eeb67db 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -317,21 +317,6 @@ parse_encap_ip(void *encap_ip, struct testpmd_offload_info 
*info)
info->l2_len = 0;
 }

-/* modify the IPv4 or IPv4 source address of a packet */
-static void
-change_ip_addresses(void *l3_hdr, uint16_t ethertype)
-{
-   struct ipv4_hdr *ipv4_hdr = l3_hdr;
-   struct ipv6_hdr *ipv6_hdr = l3_hdr;
-
-   if (ethertype == _htons(ETHER_TYPE_IPv4)) {
-   ipv4_hdr->src_addr =
-   rte_cpu_to_be_32(rte_be_to_cpu_32(ipv4_hdr->src_addr) + 
1);
-   } else if (ethertype == _htons(ETHER_TYPE_IPv6)) {
-   ipv6_hdr->src_addr[15] = ipv6_hdr->src_addr[15] + 1;
-   }
-}
-
 /* if possible, calculate the checksum of a packet in hw or sw,
  * depending on the testpmd command line configuration */
 static uint64_t
@@ -608,7 +593,6 @@ pkt_copy_split(const struct rte_mbuf *pkt)
  * Receive a burst of packets, and for each packet:
  *  - parse packet, and try to recognize a supported packet type (1)
  *  - if it's not a supported packet type, don't touch the packet, else:
- *  - modify the IPs in inner headers and in outer headers if any
  *  - reprocess the checksum of all supported layers. This is done in SW
  *or HW, depending on testpmd command line configuration
  *  - if TSO is enabled in testpmd command line, also flag the mbuf for TCP
@@ -725,20 +709,14 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
l3_hdr = (char *)l3_hdr + info.outer_l3_len + 
info.l2_len;
}

-   /* step 2: change all source IPs (v4 or v6) so we need
-* to recompute the chksums even if they were correct */
-
-   change_ip_addresses(l3_hdr, info.ethertype);
-   if (info.is_tunnel == 1)
-   change_ip_addresses(outer_l3_hdr, info.outer_ethertype);
-
-   /* step 3: depending on user command line configuration,
+   /* step 2: depending on user command line configuration,
 * recompute checksum either in software or flag the
 * mbuf to offload the calculation to the NIC. If TSO
 * is configured, prepare the mbuf for TCP segmentation. */

/* process checksums of inner headers first */
-   tx_ol_flags |= process_inner_cksums(l3_hdr, , 
testpmd_ol_flags);
+   tx_ol_flags |= process_inner_cksums(l3_hdr, ,
+   testpmd_ol_flags);

/* Then process outer headers if any. Note that the software
 * checksum will be wrong if one of the inner checksums is
@@ -748,7 +726,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
testpmd_ol_flags);
}

-   /* step 4: fill the mbuf meta data (flags and header lengths) */
+   /* step 3: fill the mbuf meta data (flags and header lengths) */

if (info.is_tunnel == 1) {
if (testpmd_ol_flags & 
TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) {
-- 
2.8.1



[dpdk-dev] [PATCH v5 4/8] app/testpmd: add option to enable lro

2016-10-07 Thread Olivier Matz
Introduce a new argument '--enable-lro' to ask testpmd to enable the LRO
feature on enabled ports, like it's done for '--enable-rx-cksum' for
instance.

Signed-off-by: Olivier Matz 
---
 app/test-pmd/parameters.c | 4 
 doc/guides/testpmd_app_ug/run_app.rst | 4 
 2 files changed, 8 insertions(+)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 6a6a07e..c45f78a 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -149,6 +149,7 @@ usage(char* progname)
   "If the drop-queue doesn't exist, the packet is dropped. "
   "By default drop-queue=127.\n");
printf("  --crc-strip: enable CRC stripping by hardware.\n");
+   printf("  --enable-lro: enable large receive offload.\n");
printf("  --enable-rx-cksum: enable rx hardware checksum offload.\n");
printf("  --disable-hw-vlan: disable hardware vlan.\n");
printf("  --disable-hw-vlan-filter: disable hardware vlan filter.\n");
@@ -524,6 +525,7 @@ launch_args_parse(int argc, char** argv)
{ "pkt-filter-size",1, 0, 0 },
{ "pkt-filter-drop-queue",  1, 0, 0 },
{ "crc-strip",  0, 0, 0 },
+   { "enable-lro", 0, 0, 0 },
{ "enable-rx-cksum",0, 0, 0 },
{ "enable-scatter", 0, 0, 0 },
{ "disable-hw-vlan",0, 0, 0 },
@@ -764,6 +766,8 @@ launch_args_parse(int argc, char** argv)
}
if (!strcmp(lgopts[opt_idx].name, "crc-strip"))
rx_mode.hw_strip_crc = 1;
+   if (!strcmp(lgopts[opt_idx].name, "enable-lro"))
+   rx_mode.enable_lro = 1;
if (!strcmp(lgopts[opt_idx].name, "enable-scatter"))
rx_mode.enable_scatter = 1;
if (!strcmp(lgopts[opt_idx].name, "enable-rx-cksum"))
diff --git a/doc/guides/testpmd_app_ug/run_app.rst 
b/doc/guides/testpmd_app_ug/run_app.rst
index 7712bd2..55c7ac0 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -285,6 +285,10 @@ The commandline options are:

 Enable hardware CRC stripping.

+*   ``--enable-lro``
+
+Enable large receive offload.
+
 *   ``--enable-rx-cksum``

 Enable hardware RX checksum offload.
-- 
2.8.1



[dpdk-dev] [PATCH v5 3/8] app/testpmd: dump Rx flags in csum engine

2016-10-07 Thread Olivier Matz
Signed-off-by: Olivier Matz 
---
 app/test-pmd/csumonly.c | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 5ca5702..e7ee0b3 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -640,7 +640,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
uint16_t nb_rx;
uint16_t nb_tx;
uint16_t i;
-   uint64_t ol_flags;
+   uint64_t rx_ol_flags, tx_ol_flags;
uint16_t testpmd_ol_flags;
uint32_t retry;
uint32_t rx_bad_ip_csum;
@@ -680,13 +680,14 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1],
   void *));

-   ol_flags = 0;
-   info.is_tunnel = 0;
m = pkts_burst[i];
+   info.is_tunnel = 0;
+   tx_ol_flags = 0;
+   rx_ol_flags = m->ol_flags;

/* Update the L3/L4 checksum error packet statistics */
-   rx_bad_ip_csum += ((m->ol_flags & PKT_RX_IP_CKSUM_BAD) != 0);
-   rx_bad_l4_csum += ((m->ol_flags & PKT_RX_L4_CKSUM_BAD) != 0);
+   rx_bad_ip_csum += ((rx_ol_flags & PKT_RX_IP_CKSUM_BAD) != 0);
+   rx_bad_l4_csum += ((rx_ol_flags & PKT_RX_L4_CKSUM_BAD) != 0);

/* step 1: dissect packet, parsing optional vlan, ip4/ip6, vxlan
 * and inner headers */
@@ -737,13 +738,13 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 * is configured, prepare the mbuf for TCP segmentation. */

/* process checksums of inner headers first */
-   ol_flags |= process_inner_cksums(l3_hdr, , 
testpmd_ol_flags);
+   tx_ol_flags |= process_inner_cksums(l3_hdr, , 
testpmd_ol_flags);

/* Then process outer headers if any. Note that the software
 * checksum will be wrong if one of the inner checksums is
 * processed in hardware. */
if (info.is_tunnel == 1) {
-   ol_flags |= process_outer_cksums(outer_l3_hdr, ,
+   tx_ol_flags |= process_outer_cksums(outer_l3_hdr, ,
testpmd_ol_flags);
}

@@ -777,7 +778,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
m->l4_len = info.l4_len;
}
m->tso_segsz = info.tso_segsz;
-   m->ol_flags = ol_flags;
+   m->ol_flags = tx_ol_flags;

/* Do split & copy for the packet. */
if (tx_pkt_split != TX_PKT_SPLIT_OFF) {
@@ -797,10 +798,11 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
printf("mbuf=%p, pkt_len=%u, nb_segs=%hhu:\n",
m, m->pkt_len, m->nb_segs);
/* dump rx parsed packet info */
+   rte_get_rx_ol_flag_list(rx_ol_flags, buf, sizeof(buf));
printf("rx: l2_len=%d ethertype=%x l3_len=%d "
-   "l4_proto=%d l4_len=%d\n",
+   "l4_proto=%d l4_len=%d flags=%s\n",
info.l2_len, rte_be_to_cpu_16(info.ethertype),
-   info.l3_len, info.l4_proto, info.l4_len);
+   info.l3_len, info.l4_proto, info.l4_len, buf);
if (info.is_tunnel == 1)
printf("rx: outer_l2_len=%d outer_ethertype=%x "
"outer_l3_len=%d\n", info.outer_l2_len,
-- 
2.8.1



[dpdk-dev] [PATCH v5 2/8] app/testpmd: use new function to dump offload flags

2016-10-07 Thread Olivier Matz
Use the functions introduced in the previous commit to dump the offload
flags.

Signed-off-by: Olivier Matz 
---
 app/test-pmd/csumonly.c | 27 +++
 app/test-pmd/rxonly.c   | 15 ++-
 2 files changed, 5 insertions(+), 37 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 21cb78f..5ca5702 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -791,23 +791,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)

/* if verbose mode is enabled, dump debug info */
if (verbose_level > 0) {
-   struct {
-   uint64_t flag;
-   uint64_t mask;
-   } tx_flags[] = {
-   { PKT_TX_IP_CKSUM, PKT_TX_IP_CKSUM },
-   { PKT_TX_UDP_CKSUM, PKT_TX_L4_MASK },
-   { PKT_TX_TCP_CKSUM, PKT_TX_L4_MASK },
-   { PKT_TX_SCTP_CKSUM, PKT_TX_L4_MASK },
-   { PKT_TX_IPV4, PKT_TX_IPV4 },
-   { PKT_TX_IPV6, PKT_TX_IPV6 },
-   { PKT_TX_OUTER_IP_CKSUM, PKT_TX_OUTER_IP_CKSUM 
},
-   { PKT_TX_OUTER_IPV4, PKT_TX_OUTER_IPV4 },
-   { PKT_TX_OUTER_IPV6, PKT_TX_OUTER_IPV6 },
-   { PKT_TX_TCP_SEG, PKT_TX_TCP_SEG },
-   };
-   unsigned j;
-   const char *name;
+   char buf[256];

printf("-\n");
printf("mbuf=%p, pkt_len=%u, nb_segs=%hhu:\n",
@@ -837,13 +821,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
m->outer_l2_len, m->outer_l3_len);
if (info.tso_segsz != 0)
printf("tx: m->tso_segsz=%d\n", m->tso_segsz);
-   printf("tx: flags=");
-   for (j = 0; j < sizeof(tx_flags)/sizeof(*tx_flags); 
j++) {
-   name = 
rte_get_tx_ol_flag_name(tx_flags[j].flag);
-   if ((m->ol_flags & tx_flags[j].mask) ==
-   tx_flags[j].flag)
-   printf("%s ", name);
-   }
+   rte_get_tx_ol_flag_list(m->ol_flags, buf, sizeof(buf));
+   printf("tx: flags=%s", buf);
printf("\n");
}
}
diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c
index 9acc4c6..fff815c 100644
--- a/app/test-pmd/rxonly.c
+++ b/app/test-pmd/rxonly.c
@@ -229,19 +229,8 @@ pkt_burst_receive(struct fwd_stream *fs)
}
printf(" - Receive queue=0x%x", (unsigned) fs->rx_queue);
printf("\n");
-   if (ol_flags != 0) {
-   unsigned rxf;
-   const char *name;
-
-   for (rxf = 0; rxf < sizeof(mb->ol_flags) * 8; rxf++) {
-   if ((ol_flags & (1ULL << rxf)) == 0)
-   continue;
-   name = rte_get_rx_ol_flag_name(1ULL << rxf);
-   if (name == NULL)
-   continue;
-   printf("  %s\n", name);
-   }
-   }
+   rte_get_rx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));
+   printf("  ol_flags: %s\n", buf);
rte_pktmbuf_free(mb);
}

-- 
2.8.1



[dpdk-dev] [PATCH v5 1/8] mbuf: add function to dump ol flag list

2016-10-07 Thread Olivier Matz
The functions rte_get_rx_ol_flag_name() and rte_get_tx_ol_flag_name()
can dump one flag, or set of flag that are part of the same mask (ex:
PKT_TX_UDP_CKSUM, part of PKT_TX_L4_MASK). But they are not designed to
dump the list of flags contained in mbuf->ol_flags.

This commit introduce new functions to do that. Similarly to the packet
type dump functions, the goal is to factorize the code that could be
used in several applications and reduce the risk of desynchronization
between the flags and the dump functions.

Signed-off-by: Olivier Matz 
---
 doc/guides/rel_notes/release_16_11.rst |  5 ++
 lib/librte_mbuf/rte_mbuf.c | 93 ++
 lib/librte_mbuf/rte_mbuf.h | 28 ++
 lib/librte_mbuf/rte_mbuf_version.map   |  2 +
 4 files changed, 128 insertions(+)

diff --git a/doc/guides/rel_notes/release_16_11.rst 
b/doc/guides/rel_notes/release_16_11.rst
index e9dc797..a0dc9d4 100644
--- a/doc/guides/rel_notes/release_16_11.rst
+++ b/doc/guides/rel_notes/release_16_11.rst
@@ -78,6 +78,11 @@ New Features

   Added new functions ``rte_get_ptype_*()`` to dump a packet type as a string.

+* **Added functions to dump the offload flags as a string.**
+
+  Added two new functions ``rte_get_rx_ol_flag_list()`` and
+  ``rte_get_tx_ol_flag_list()`` to dump offload flags as a string.
+
 Resolved Issues
 ---

diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index cd95e6f..d58a701 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -319,6 +319,54 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask)
}
 }

+struct flag_mask {
+   uint64_t flag;
+   uint64_t mask;
+   const char *default_name;
+};
+
+/* write the list of rx ol flags in buffer buf */
+int
+rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
+{
+   const struct flag_mask rx_flags[] = {
+   { PKT_RX_VLAN_PKT, PKT_RX_VLAN_PKT, NULL },
+   { PKT_RX_RSS_HASH, PKT_RX_RSS_HASH, NULL },
+   { PKT_RX_FDIR, PKT_RX_FDIR, NULL },
+   { PKT_RX_L4_CKSUM_BAD, PKT_RX_L4_CKSUM_BAD, NULL },
+   { PKT_RX_IP_CKSUM_BAD, PKT_RX_IP_CKSUM_BAD, NULL },
+   { PKT_RX_EIP_CKSUM_BAD, PKT_RX_EIP_CKSUM_BAD, NULL },
+   { PKT_RX_VLAN_STRIPPED, PKT_RX_VLAN_STRIPPED, NULL },
+   { PKT_RX_IEEE1588_PTP, PKT_RX_IEEE1588_PTP, NULL },
+   { PKT_RX_IEEE1588_TMST, PKT_RX_IEEE1588_TMST, NULL },
+   { PKT_RX_QINQ_STRIPPED, PKT_RX_QINQ_STRIPPED, NULL },
+   };
+   const char *name;
+   unsigned int i;
+   int ret;
+
+   if (buflen == 0)
+   return -1;
+
+   buf[0] = '\0';
+   for (i = 0; i < RTE_DIM(rx_flags); i++) {
+   if ((mask & rx_flags[i].mask) != rx_flags[i].flag)
+   continue;
+   name = rte_get_rx_ol_flag_name(rx_flags[i].flag);
+   if (name == NULL)
+   name = rx_flags[i].default_name;
+   ret = snprintf(buf, buflen, "%s ", name);
+   if (ret < 0)
+   return -1;
+   if ((size_t)ret >= buflen)
+   return -1;
+   buf += ret;
+   buflen -= ret;
+   }
+
+   return 0;
+}
+
 /*
  * Get the name of a TX offload flag. Must be kept synchronized with flag
  * definitions in rte_mbuf.h.
@@ -341,3 +389,48 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
default: return NULL;
}
 }
+
+/* write the list of tx ol flags in buffer buf */
+int
+rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
+{
+   const struct flag_mask tx_flags[] = {
+   { PKT_TX_VLAN_PKT, PKT_TX_VLAN_PKT, NULL },
+   { PKT_TX_IP_CKSUM, PKT_TX_IP_CKSUM, NULL },
+   { PKT_TX_TCP_CKSUM, PKT_TX_L4_MASK, NULL },
+   { PKT_TX_SCTP_CKSUM, PKT_TX_L4_MASK, NULL },
+   { PKT_TX_UDP_CKSUM, PKT_TX_L4_MASK, NULL },
+   { PKT_TX_L4_NO_CKSUM, PKT_TX_L4_MASK, "PKT_TX_L4_NO_CKSUM" },
+   { PKT_TX_IEEE1588_TMST, PKT_TX_IEEE1588_TMST, NULL },
+   { PKT_TX_TCP_SEG, PKT_TX_TCP_SEG, NULL },
+   { PKT_TX_IPV4, PKT_TX_IPV4, NULL },
+   { PKT_TX_IPV6, PKT_TX_IPV6, NULL },
+   { PKT_TX_OUTER_IP_CKSUM, PKT_TX_OUTER_IP_CKSUM, NULL },
+   { PKT_TX_OUTER_IPV4, PKT_TX_OUTER_IPV4, NULL },
+   { PKT_TX_OUTER_IPV6, PKT_TX_OUTER_IPV6, NULL },
+   };
+   const char *name;
+   unsigned int i;
+   int ret;
+
+   if (buflen == 0)
+   return -1;
+
+   buf[0] = '\0';
+   for (i = 0; i < RTE_DIM(tx_flags); i++) {
+   if ((mask & tx_flags[i].mask) != tx_flags[i].flag)
+   continue;
+   name = rte_get_tx_ol_flag_name(tx_flags[i].flag);
+   if (name == NULL)
+   name = tx_flags[i].default_name;
+   

[dpdk-dev] [PATCH v5 0/8] Misc enhancements in testpmd

2016-10-07 Thread Olivier Matz
This patchset introduces several enhancements or minor fixes
in testpmd. It is targetted for v16.11, and applies on top of
software ptype v2 patchset [1].

These patches are useful to validate the virtio offload
patchset [2] (to be rebased).

[1] http://dpdk.org/ml/archives/dev/2016-August/045876.html
[2] http://dpdk.org/ml/archives/dev/2016-July/044404.html

v4 -> v5:
- fix headline lowercase for "Rx"
- fix typo in API comment: "ouput" -> "output"

v3 -> v4:
- fix typo in documentation

v2 -> v3:
- move return type on a separate line in function definitions
- add documentation for the new --enable-lro option

v1 -> v2:
- rebase on top of sw ptype v2 patch

Olivier Matz (8):
  mbuf: add function to dump ol flag list
  app/testpmd: use new function to dump offload flags
  app/testpmd: dump Rx flags in csum engine
  app/testpmd: add option to enable lro
  app/testpmd: do not change ip addrs in csum engine
  app/testpmd: display Rx port in csum engine
  app/testpmd: don't use tso if packet is too small
  app/testpmd: hide segsize when unrelevant in csum engine

 app/test-pmd/csumonly.c| 96 --
 app/test-pmd/parameters.c  |  4 ++
 app/test-pmd/rxonly.c  | 15 +-
 doc/guides/rel_notes/release_16_11.rst |  5 ++
 doc/guides/testpmd_app_ug/run_app.rst  |  4 ++
 lib/librte_mbuf/rte_mbuf.c | 93 
 lib/librte_mbuf/rte_mbuf.h | 28 ++
 lib/librte_mbuf/rte_mbuf_version.map   |  2 +
 8 files changed, 170 insertions(+), 77 deletions(-)

-- 
2.8.1



[dpdk-dev] [PATCH v3] mbuf: add function to dump ol flag list

2016-10-07 Thread Olivier Matz
Hi Pablo,

On 10/07/2016 05:51 AM, De Lara Guarch, Pablo wrote:
> 
> 
>> -Original Message-
>> From: Olivier Matz [mailto:olivier.matz at 6wind.com]
>> Sent: Thursday, October 06, 2016 1:43 AM
>> To: dev at dpdk.org; De Lara Guarch, Pablo
>> Subject: [PATCH v3] mbuf: add function to dump ol flag list
>>
>> The functions rte_get_rx_ol_flag_name() and rte_get_tx_ol_flag_name()
>> can dump one flag, or set of flag that are part of the same mask (ex:
>> PKT_TX_UDP_CKSUM, part of PKT_TX_L4_MASK). But they are not designed
>> to
>> dump the list of flags contained in mbuf->ol_flags.
>>
>> This commit introduce new functions to do that. Similarly to the packet
>> type dump functions, the goal is to factorize the code that could be
>> used in several applications and reduce the risk of desynchronization
>> between the flags and the dump functions.
>>
>> Signed-off-by: Olivier Matz 
> 
> Hi Olivier,
> 
> Sorry, I missed a typo in this patch: "ouput" -> "output".
> 
> Also, check-git-log.sh is complaining about two patches:
> 
> Wrong headline lowercase:
> app/testpmd: dump rx flags in csum engine
> app/testpmd: display rx port in csum engine
> 
> Lastly, could you send another version of the patchset (including patches 
> without any modifications).
> In my opinion, it is a bit difficult to apply the patchset, because Patchwork 
> doesn't tell me
> that this patch is the first patch of the patchset.

Thank you for the review. I'll fix all these issue and send the whole
patchset again (will be called v5 to avoid confusion with separate
patches). I didn't want to spam the list with the full patchset for
these minor fixes, but you're right it's not that clear.

Regards,
Olivier


[dpdk-dev] [RFC v2] latencystats: added new library for latency stats

2016-10-07 Thread Reshma Pattan
Library is designed to calculate latency stats and report them to the
application when queried. Library measures minimum, average, maximum
latencies and jitter in nano seconds.
Current implementation supports global latency stats, i.e. per application
stats.

Added new field to mbuf struct to mark the packet arrival time on Rx and
use the times tamp to measure the latency on Tx.

APIs:

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

Functionality:

*Library will register ethdev Rx/Tx callbacks for each active port,
queue combinations.
*Library will register latency stats names with new stats library, which is 
under
design for now.
*Rx packets will be marked with time stamp on each sampling interval.
*On Tx side, packets with time stamp will be considered for calculating
the minimum, maximum, average latencies and jitter.
*Average latency is calculated by summing all the latencies measured for each
time stamped packet and dividing that by total time stamped packets.
*Minimum and maximum latencies will be low and high latency values observed
so far.
*Jitter calculation is done based on inter packet delay variation.
*Measured stats can be retrieved via get API of the libray (or)
by calling generic get API of the new stats library, in this case
callback is provided to update the stats  into new stats library.

Signed-off-by: Reshma Pattan 
---
 MAINTAINERS|   4 +
 app/proc_info/main.c   |  60 
 app/test-pmd/testpmd.c |   9 +
 config/common_base |  10 +
 lib/Makefile   |   1 +
 lib/librte_latencystats/Makefile   |  56 
 lib/librte_latencystats/rte_latencystats.c | 316 +
 lib/librte_latencystats/rte_latencystats.h | 133 +
 .../rte_latencystats_version.map   |  10 +
 lib/librte_mbuf/rte_mbuf.h |   3 +
 mk/rte.app.mk  |   1 +
 11 files changed, 603 insertions(+)
 create mode 100644 lib/librte_latencystats/Makefile
 create mode 100644 lib/librte_latencystats/rte_latencystats.c
 create mode 100644 lib/librte_latencystats/rte_latencystats.h
 create mode 100644 lib/librte_latencystats/rte_latencystats_version.map

diff --git a/MAINTAINERS b/MAINTAINERS
index 6a2527c..4f5227f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -687,3 +687,7 @@ F: examples/tep_termination/
 F: examples/vmdq/
 F: examples/vmdq_dcb/
 F: doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst
+
+Latency Stats
+M: Reshma Pattan 
+F: lib/librte_latencystats/
diff --git a/app/proc_info/main.c b/app/proc_info/main.c
index 8246fb2..b80fe4e 100644
--- a/app/proc_info/main.c
+++ b/app/proc_info/main.c
@@ -57,6 +57,7 @@
 #include 
 #include 
 #include 
+#include 

 /* Maximum long option length for option parsing. */
 #define MAX_LONG_OPT_SZ 64
@@ -75,6 +76,8 @@ static uint32_t reset_xstats;
 /**< Enable memory info. */
 static uint32_t mem_info;

+static uint32_t enable_latency_stats = 1;
+
 /**< display usage */
 static void
 proc_info_usage(const char *prgname)
@@ -301,6 +304,60 @@ nic_xstats_clear(uint8_t port_id)
printf("\n  NIC extended statistics for port %d cleared\n", port_id);
 }

+static void
+latency_stats_display(void)
+{
+   struct rte_stat_value *lat_stats;
+   struct rte_stat_name *names;
+   int len, ret;
+   static const char *nic_stats_border = "";
+
+   memset(_stats, 0, sizeof(struct rte_stat_value));
+   len = rte_latencystats_get_names(NULL, 0);
+   if (len < 0) {
+   printf("Cannot get latency stats count\n");
+   return;
+   }
+
+   lat_stats = malloc(sizeof(struct rte_stat_value) * len);
+   if (lat_stats == NULL) {
+   printf("Cannot allocate memory for latency stats\n");
+   return;
+   }
+
+   names =  malloc(sizeof(struct rte_stat_name) * len);
+   if (names == NULL) {
+   printf("Cannot allocate memory for latency stats names\n");
+   free(lat_stats);
+   return;
+   }
+
+   if (len != rte_latencystats_get_names(names, len)) {
+   printf("Cannot get latency stats names\n");
+   free(lat_stats);
+   free(names);
+   return;
+   }
+
+   printf("## Latency statistics #\n");
+   printf("%s\n", nic_stats_border);
+   ret = rte_latencystats_get(lat_stats, len);
+   if (ret < 0 || ret > len) {
+   printf("Cannot get latency stats\n");
+   free(lat_stats);
+   free(names);
+   return;
+   }
+
+   int i;
+   for (i = 0; i < len; i++)
+   printf("%s: %"PRIu64"\n", names[i].name, lat_stats[i].value);
+
+   

[dpdk-dev] [PATCH v6 1/2] librte_ether: modify internal callback function

2016-10-07 Thread Iremonger, Bernard
Hi Thomas,



> Subject: Re: [dpdk-dev] [PATCH v6 1/2] librte_ether: modify internal callback
> function
> 
> 2016-10-06 17:48, Bernard Iremonger:
> > @@ -2508,7 +2508,7 @@ rte_eth_dev_callback_unregister(uint8_t
> port_id,
> >
> >  void
> >  _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
> > -   enum rte_eth_event_type event)
> > +   enum rte_eth_event_type event, void *cb_arg)
> >  {
> > struct rte_eth_dev_callback *cb_lst;
> > struct rte_eth_dev_callback dev_cb;
> > @@ -2519,6 +2519,9 @@ _rte_eth_dev_callback_process(struct
> rte_eth_dev *dev,
> > continue;
> > dev_cb = *cb_lst;
> > cb_lst->active = 1;
> > +   if (cb_arg != NULL)
> > +   dev_cb.cb_arg = (void *) cb_arg;
> > +
> > rte_spinlock_unlock(_eth_dev_cb_lock);
> > dev_cb.cb_fn(dev->data->port_id, dev_cb.event,
> > dev_cb.cb_arg);
> [...]
> > @@ -3047,6 +3048,11 @@ typedef void (*rte_eth_dev_cb_fn)(uint8_t
> port_id, \
> >   * @param cb_arg
> >   *  Pointer to the parameters for the registered callback.
> >   *
> > + *  The cb_arg must not be NULL if the application requires
> > + *  data to be returned when the callback is processed.
> > + *  For the RTE_ETH_EVENT_VF_MBOX data is returned to the
> > + *  application.
> 
> This comment is wrong.
> You should say that the user data is overwritten in the case of
> RTE_ETH_EVENT_VF_MBOX. And you should point to where the meaning of
> this parameter is documented (ixgbe.h) or document it here.

This is corrected in the v7 patchset.

Regards.

Bernard.




[dpdk-dev] [PATCH 1/3] eal/drivers: prefix driver REGISTER macros with EAL

2016-10-07 Thread Thomas Monjalon
2016-10-07 19:11, Shreyansh Jain:
> --- a/mk/internal/rte.compile-pre.mk
> +++ b/mk/internal/rte.compile-pre.mk
> @@ -87,7 +87,7 @@ endif
>   PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ $@.pmd.c
>   PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@.pmd.o $@.pmd.c
>   PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o $@.o $@.pmd.o $@
> -PMDINFO_TO_O = if grep -q 'DRIVER_REGISTER_.*(.*)' $<; then \
> +PMDINFO_TO_O = if grep 'EAL_REGISTER_.*(.*)' $<; then \
>  echo "$(if $V,$(PMDINFO_GEN),  PMDINFO $@.pmd.c)" && \
>  $(PMDINFO_GEN) && \
>  echo "$(if $V,$(PMDINFO_CC),  CC $@.pmd.o)" && \
> 
> --->8---
>CC eal_pci_vfio.o
>PMDINFO eal_pci_vfio.o.pmd.c
> /bin/sh: 1: 
> /home/shreyansh/build/DPDK/02_dpdk/x86_64-native-linuxapp-gcc/app/dpdk-pmdinfogen:
>  
> not found
> /home/shreyansh/build/DPDK/02_dpdk/mk/internal/rte.compile-pre.mk:138: 
> recipe for target 'eal_pci_vfio.o' failed
> --->8---
> 
> I don't think PMDINFO should be running on eal_pci_vfio file. Isn't it? 

Every files are scanned for the pattern.

> Is it because EAL_REGISTER_* is matching EAL_REGISTER_TAILQ like macro 
> as well?

Probably.
That's another argument in favor of good prefixes.
I think you should use RTE_DRIVER_REGISTER_ or better, RTE_PMD_REGISTER_
> 
> I am not very well versed with how PMDINFO is linking with the build 
> system so any hints/insight into this would be really helpful.
> 
> One I get more clarity on this, I will push a new version of this patch.

Thanks


[dpdk-dev] [PATCH 1/3] eal/drivers: prefix driver REGISTER macros with EAL

2016-10-07 Thread Thomas Monjalon
2016-10-07 19:03, Shreyansh Jain:
> DRIVER_REGISTER_PCI -> EAL_REGISTER_PCI
> DRIVER_REGISTER_PCI_TABLE -> EAL_REGISTER_PCI_TABLE

Why not RTE_ prefix instead of EAL_?
Why 3 patches? As there is no specific comment in each, I think you can squash.


[dpdk-dev] [PATCH] net/mlx: align drivers to latest naming convention

2016-10-07 Thread Adrien Mazarguil
On Fri, Oct 07, 2016 at 03:04:13PM +0200, David Marchand wrote:
> Fixes: 2f45703c17ac ("drivers: make driver names consistent")
> 
> Signed-off-by: David Marchand 
> ---
>  drivers/net/mlx4/mlx4.h  | 2 +-
>  drivers/net/mlx5/mlx5_defs.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
> index d0c7bc2..4c7505e 100644
> --- a/drivers/net/mlx4/mlx4.h
> +++ b/drivers/net/mlx4/mlx4.h
> @@ -96,7 +96,7 @@ enum {
>   PCI_DEVICE_ID_MELLANOX_CONNECTX3PRO = 0x1007,
>  };
>  
> -#define MLX4_DRIVER_NAME "librte_pmd_mlx4"
> +#define MLX4_DRIVER_NAME "net_mlx4"
>  
>  /* Bit-field manipulation. */
>  #define BITFIELD_DECLARE(bf, type, size) \
> diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
> index cc2a6f3..b32816e 100644
> --- a/drivers/net/mlx5/mlx5_defs.h
> +++ b/drivers/net/mlx5/mlx5_defs.h
> @@ -37,7 +37,7 @@
>  #include "mlx5_autoconf.h"
>  
>  /* Reported driver name. */
> -#define MLX5_DRIVER_NAME "librte_pmd_mlx5"
> +#define MLX5_DRIVER_NAME "net_mlx5"
>  
>  /* Maximum number of simultaneous MAC addresses. */
>  #define MLX5_MAX_MAC_ADDRESSES 128
> -- 
> 2.7.4

Acked-by: Adrien Mazarguil 

-- 
Adrien Mazarguil
6WIND


[dpdk-dev] [PATCH] net/virtio: add missing driver name

2016-10-07 Thread David Marchand
The driver name has been lost with the eal rework.
Restore it.

Fixes: c830cb295411 ("drivers: use PCI registration macro")

Signed-off-by: David Marchand 
---
 drivers/net/virtio/virtio_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c 
b/drivers/net/virtio/virtio_ethdev.c
index b4dfc0a..809ebf7 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1304,6 +1304,9 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)

 static struct eth_driver rte_virtio_pmd = {
.pci_drv = {
+   .driver = {
+   .name = "net_virtio",
+   },
.id_table = pci_id_virtio_map,
.drv_flags = RTE_PCI_DRV_DETACHABLE,
.probe = rte_eth_dev_pci_probe,
-- 
2.7.4



[dpdk-dev] [PATCH 2/2] ethdev: fix vendor id in debug message

2016-10-07 Thread David Marchand
Fixes: af75078fece3 ("first public release")

Signed-off-by: David Marchand 
---
 lib/librte_ether/rte_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 24029f0..88fa382 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -274,7 +274,7 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,
if (diag == 0)
return 0;

-   RTE_PMD_DEBUG_TRACE("driver %s: eth_dev_init(vendor_id=0x%u 
device_id=0x%x) failed\n",
+   RTE_PMD_DEBUG_TRACE("driver %s: eth_dev_init(vendor_id=0x%x 
device_id=0x%x) failed\n",
pci_drv->driver.name,
(unsigned) pci_dev->id.vendor_id,
(unsigned) pci_dev->id.device_id);
-- 
2.7.4



[dpdk-dev] [PATCH 1/2] ethdev: fix hotplug attach

2016-10-07 Thread David Marchand
If a pci probe operation creates a port but, for any reason, fails to
finish this operation and decides to delete the newly created port, then
the last created port id can not be trusted anymore and any subsequent
attach operations will fail.

This problem was noticed while working on a vm that had a virtio-net
management interface bound to the virtio-net kernel driver and no port
whitelisted in the commandline:

root at ubuntu1404:~/dpdk# ./build/app/testpmd -c 0x6 --
 -i --total-num-mbufs=2049
EAL: Detected 3 lcore(s)
EAL: Probing VFIO support...
EAL: Debug logs available - lower performance
EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using
unreliable clock cycles !
EAL: PCI device :00:03.0 on NUMA socket -1
EAL:   probe driver: 1af4:1000 (null)
rte_eth_dev_pci_probe: driver (null): eth_dev_init(vendor_id=0x6900
device_id=0x1000) failed
EAL: No probed ethernet devices
 ^
 |
 Here, rte_eth_dev_pci_probe() fails since vtpci_init() reports an
 error. This results in a rte_eth_dev_release_port() right after a
 rte_eth_dev_allocate().

Then, if we try to attach a port using rte_eth_dev_attach:

testpmd> port attach net_ring0
Attaching a new port...
PMD: Initializing pmd_ring for net_ring0
PMD: Creating rings-backed ethdev on numa socket 0

Two solutions:
- either update the last created port index to something invalid
  (when freeing a ethdev port),
- or rely on the port count, before and after the eal attach.

The latter solution seems (well not really more robust but at least)
less fragile than the former.
We still have some issues with drivers that create multiple ethdev
ports with a single probe operation, but this was already the case.

Fixes: b0fb26685570 ("ethdev: convert to EAL hotplug")

Reported-by: Daniel Mrzyglod 
Signed-off-by: David Marchand 
---
 lib/librte_ether/rte_ethdev.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index c517e88..24029f0 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -421,7 +421,7 @@ int
 rte_eth_dev_attach(const char *devargs, uint8_t *port_id)
 {
int ret = -1;
-   int current = eth_dev_last_created_port;
+   int current = rte_eth_dev_count();
char *name = NULL;
char *args = NULL;

@@ -438,9 +438,9 @@ rte_eth_dev_attach(const char *devargs, uint8_t *port_id)
if (ret < 0)
goto err;

-   /* no point looking at eth_dev_last_created_port if no port exists */
-   if (!nb_ports) {
-   RTE_LOG(ERR, EAL, "No ports found for device (%s)\n", name);
+   /* no point looking at the port count if no port exists */
+   if (!rte_eth_dev_count()) {
+   RTE_LOG(ERR, EAL, "No port found for device (%s)\n", name);
ret = -1;
goto err;
}
@@ -448,7 +448,7 @@ rte_eth_dev_attach(const char *devargs, uint8_t *port_id)
/* if nothing happened, there is a bug here, since some driver told us
 * it did attach a device, but did not create a port.
 */
-   if (current == eth_dev_last_created_port) {
+   if (current == rte_eth_dev_count()) {
ret = -1;
goto err;
}
-- 
2.7.4



[dpdk-dev] [PATCH v6 1/2] librte_ether: modify internal callback function

2016-10-07 Thread Thomas Monjalon
2016-10-06 17:48, Bernard Iremonger:
> @@ -2508,7 +2508,7 @@ rte_eth_dev_callback_unregister(uint8_t port_id,
>  
>  void
>  _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
> - enum rte_eth_event_type event)
> + enum rte_eth_event_type event, void *cb_arg)
>  {
>   struct rte_eth_dev_callback *cb_lst;
>   struct rte_eth_dev_callback dev_cb;
> @@ -2519,6 +2519,9 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
>   continue;
>   dev_cb = *cb_lst;
>   cb_lst->active = 1;
> + if (cb_arg != NULL)
> + dev_cb.cb_arg = (void *) cb_arg;
> +
>   rte_spinlock_unlock(_eth_dev_cb_lock);
>   dev_cb.cb_fn(dev->data->port_id, dev_cb.event,
>   dev_cb.cb_arg);
[...]
> @@ -3047,6 +3048,11 @@ typedef void (*rte_eth_dev_cb_fn)(uint8_t port_id, \
>   * @param cb_arg
>   *  Pointer to the parameters for the registered callback.
>   *
> + *  The cb_arg must not be NULL if the application requires
> + *  data to be returned when the callback is processed.
> + *  For the RTE_ETH_EVENT_VF_MBOX data is returned to the
> + *  application.

This comment is wrong.
You should say that the user data is overwritten in the case of
RTE_ETH_EVENT_VF_MBOX. And you should point to where the meaning
of this parameter is documented (ixgbe.h) or document it here.



[dpdk-dev] [PATCH v6 2/2] net/ixgbe: add callback to user app on VF to PF mbox msg

2016-10-07 Thread Thomas Monjalon
2016-10-06 17:48, Bernard Iremonger:
> call _rte_eth_dev_callback_process from ixgbe_rcv_msg_from_vf function.
> 
> The callback asks the user application if it is allowed to perform
> the function.
> If the cb_param.retval is RTE_PMD_IXGBE_MB_EVENT_PROCEED then continue,
> if 0, do nothing and send ACK to VF
> if > 1, do nothing and send NAK to VF.
[...]
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -3559,7 +3559,7 @@ ixgbe_dev_interrupt_delayed_handler(void *param)
>   ixgbe_dev_link_update(dev, 0);
>   intr->flags &= ~IXGBE_FLAG_NEED_LINK_UPDATE;
>   ixgbe_dev_link_status_print(dev);
> - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC);
> + _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, 
> NULL);
>   }
>  
>   PMD_DRV_LOG(DEBUG, "enable intr in delayed handler S[%08x]", eicr);
> @@ -7525,7 +7525,7 @@ static void ixgbevf_mbx_process(struct rte_eth_dev *dev)
>  
>   /* PF reset VF event */
>   if (in_msg == IXGBE_PF_CONTROL_MSG)
> - _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET);
> + _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, 
> NULL);
>  }

This piece should go into the patch 1.


[dpdk-dev] [PATCH] app/test: fix crypto mbuf pool size

2016-10-07 Thread Piotr Azarewicz
This patch fix that created pool for crypto mbufs may be too big in some
environments.
To avoid the issue, mbuf pool is reverted to its previous size.
Moreover, here is added additional small pool with one large mbuf, what
is needed in large data test scenarios.

Fixes: 2070f885b76d ("app/test: added tests for libcrypto PMD")

Signed-off-by: Piotr Azarewicz 
---
 app/test/test_cryptodev.c |   28 +---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 2917454..914bb0b 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -60,6 +60,7 @@ static enum rte_cryptodev_type gbl_cryptodev_type;

 struct crypto_testsuite_params {
struct rte_mempool *mbuf_pool;
+   struct rte_mempool *large_mbuf_pool;
struct rte_mempool *op_mpool;
struct rte_cryptodev_config conf;
struct rte_cryptodev_qp_conf qp_conf;
@@ -169,7 +170,7 @@ testsuite_setup(void)
/* Not already created so create */
ts_params->mbuf_pool = rte_pktmbuf_pool_create(
"CRYPTO_MBUFPOOL",
-   NUM_MBUFS, MBUF_CACHE_SIZE, 0, UINT16_MAX,
+   NUM_MBUFS, MBUF_CACHE_SIZE, 0, MBUF_SIZE,
rte_socket_id());
if (ts_params->mbuf_pool == NULL) {
RTE_LOG(ERR, USER1, "Can't create CRYPTO_MBUFPOOL\n");
@@ -177,6 +178,21 @@ testsuite_setup(void)
}
}

+   ts_params->large_mbuf_pool = rte_mempool_lookup(
+   "CRYPTO_LARGE_MBUFPOOL");
+   if (ts_params->large_mbuf_pool == NULL) {
+   /* Not already created so create */
+   ts_params->large_mbuf_pool = rte_pktmbuf_pool_create(
+   "CRYPTO_LARGE_MBUFPOOL",
+   1, 0, 0, UINT16_MAX,
+   rte_socket_id());
+   if (ts_params->large_mbuf_pool == NULL) {
+   RTE_LOG(ERR, USER1,
+   "Can't create CRYPTO_LARGE_MBUFPOOL\n");
+   return TEST_FAILED;
+   }
+   }
+
ts_params->op_mpool = rte_crypto_op_pool_create(
"MBUF_CRYPTO_SYM_OP_POOL",
RTE_CRYPTO_OP_TYPE_SYMMETRIC,
@@ -5149,7 +5165,10 @@ test_AES_GMAC_authentication(const struct gmac_test_data 
*tdata)
if (retval < 0)
return retval;

-   ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
+   if (tdata->aad.len == GMAC_LARGE_PLAINTEXT_LENGTH)
+   ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool);
+   else
+   ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);

memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->ibuf));
@@ -5233,7 +5252,10 @@ test_AES_GMAC_authentication_verify(const struct 
gmac_test_data *tdata)
if (retval < 0)
return retval;

-   ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
+   if (tdata->aad.len == GMAC_LARGE_PLAINTEXT_LENGTH)
+   ut_params->ibuf = rte_pktmbuf_alloc(ts_params->large_mbuf_pool);
+   else
+   ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);

memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0,
rte_pktmbuf_tailroom(ut_params->ibuf));
-- 
1.7.9.5



[dpdk-dev] Facing issue in encryption/decryption with QAT library

2016-10-07 Thread Pankaj Joshi
Hello All,

I am using QAT library, and getting the error as below :

?[error] LacSymCb_ProcessDpCallback() - : Response status value not as
expected?

Observation are as below :

1. While running encryption only, everything working fine
2. While running decryption only, everything working fine
3. While running decryption along with encryption, in encryption instance
getting this error for some packet, 10% of the packets are corrupting and
digest result is coming as FALSE

Please let me know, what wrong is getting and how can I debug this.

Regards,
Pankaj Joshi


[dpdk-dev] [PATCH v5 1/2] librte_ether: add protection against overwrite device data

2016-10-07 Thread Kerlin, MarcinX
Hi Thomas,

> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Thursday, October 06, 2016 4:53 PM
> To: Kerlin, MarcinX 
> Cc: dev at dpdk.org; De Lara Guarch, Pablo 
> Subject: Re: [PATCH v5 1/2] librte_ether: add protection against overwrite
> device data
> 
> 2016-09-30 16:00, Marcin Kerlin:
> > Added protection against overwrite device data in array
> > rte_eth_dev_data[] for the next secondary applications. Secondary
> > process appends in the first free place rather than at the beginning.
> > This behavior prevents overwriting devices data of primary process by
> secondary process.
> 
> It would be good to state what is a secondary process.
> You are trying to extend its capabilities to be able to initialize devices.
> So primary and secondary processes are almost equivalent?
> What happens if we do not create any device in the primary?
> Answer from code review: "Cannot allocate memzone for ethernet port data\n"
> 
> The secondary process is a hack to me.
> But it is fine to have such hack for debug or monitoring purpose.
> I would like to understand what are the other use cases?

It's true, it is fine for debug or monitoring but If DPDK allow run secondary 
app with 
devices then it should be safe or completely not allowed. 

This bug has been observed while running secondary testpmd with virtual devices.

I will adapt to the decision of maintainers regards to design of secondary 
process.

> 
> By the way, the code managing the shared data of a device should be at the
> EAL level in order to be used by other interfaces like crypto.
> 
> > @@ -631,6 +692,8 @@ int
> >  rte_eth_dev_detach(uint8_t port_id, char *name)  {
> > struct rte_pci_addr addr;
> > +   struct rte_eth_dev_data *eth_dev_data = NULL;
> > +   char device[RTE_ETH_NAME_MAX_LEN];
> > int ret = -1;
> >
> > if (name == NULL) {
> > @@ -642,6 +705,15 @@ rte_eth_dev_detach(uint8_t port_id, char *name)
> > if (rte_eth_dev_is_detachable(port_id))
> > goto err;
> >
> > +   /* get device name by port id */
> > +   if (rte_eth_dev_get_name_by_port(port_id, device))
> > +   goto err;
> > +
> > +   /* look for an entry in the shared device data */
> > +   eth_dev_data = rte_eth_dev_get_dev_data_by_name(device);
> > +   if (eth_dev_data == NULL)
> > +   goto err;
> 
> Why not getting eth_dev_data from rte_eth_devices[port_id].data ?

because rte_eth_devices[port_id].data for some drivers (mainly virtual devices)
is pointer to local eth_dev_data (e.g rte_eth_pcap.c:816 and also other 
drivers).
This causes that local eth_dev_data is clearing rather than shared in memzone. 

Naming is unique so if device was added then there (shared memzone) has to be. 

> 
> > --- a/lib/librte_ether/rte_ethdev.h
> > +++ b/lib/librte_ether/rte_ethdev.h
> >  /**
> >   * @internal
> > + * Release device data kept in shared memory for all processes.
> > + *
> > + * @param  port_id
> > + *   The port identifier of the device to release device data.
> > + * @return
> > + *   - 0 on success, negative on error
> > + */
> > +int rte_eth_dev_release_dev_data(uint8_t port_id);
> 
> Why this function? It is not used.
> You already have done the job in the detach function.

This function is using in testpmd.c:1640, basic wrapper for clean up.

Detach function is working only for detachable devices, release_dev_data() 
no matter just clean up shared array before next run secondary e.g testpmd.

Regards,
Marcin


[dpdk-dev] [PATCH v6 2/2] net/ixgbe: add callback to user app on VF to PF mbox msg

2016-10-07 Thread Iremonger, Bernard
Hi Thomas,



> Subject: Re: [dpdk-dev] [PATCH v6 2/2] net/ixgbe: add callback to user app
> on VF to PF mbox msg
> 
> 2016-10-06 17:48, Bernard Iremonger:
> > call _rte_eth_dev_callback_process from ixgbe_rcv_msg_from_vf
> function.
> >
> > The callback asks the user application if it is allowed to perform the
> > function.
> > If the cb_param.retval is RTE_PMD_IXGBE_MB_EVENT_PROCEED then
> > continue, if 0, do nothing and send ACK to VF if > 1, do nothing and
> > send NAK to VF.
> [...]
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -3559,7 +3559,7 @@ ixgbe_dev_interrupt_delayed_handler(void
> *param)
> > ixgbe_dev_link_update(dev, 0);
> > intr->flags &= ~IXGBE_FLAG_NEED_LINK_UPDATE;
> > ixgbe_dev_link_status_print(dev);
> > -   _rte_eth_dev_callback_process(dev,
> RTE_ETH_EVENT_INTR_LSC);
> > +   _rte_eth_dev_callback_process(dev,
> RTE_ETH_EVENT_INTR_LSC, NULL);
> > }
> >
> > PMD_DRV_LOG(DEBUG, "enable intr in delayed handler S[%08x]",
> eicr);
> > @@ -7525,7 +7525,7 @@ static void ixgbevf_mbx_process(struct
> > rte_eth_dev *dev)
> >
> > /* PF reset VF event */
> > if (in_msg == IXGBE_PF_CONTROL_MSG)
> > -   _rte_eth_dev_callback_process(dev,
> RTE_ETH_EVENT_INTR_RESET);
> > +   _rte_eth_dev_callback_process(dev,
> RTE_ETH_EVENT_INTR_RESET, NULL);
> >  }
> 
> This piece should go into the patch 1.

Ok, I will send a v7.

Regards,

Bernard.


[dpdk-dev] [PATCH v7 2/2] app/test_pmd: add tests for new API's

2016-10-07 Thread Bernard Iremonger
add test for set vf vlan anti spoof
add test for set vf mac anti spoof
add test for set vf vlan stripq
add test for set vf vlan insert
add test for set tx loopback
add test for set all queues drop enable bit
add test for set vf split drop enable bit
add test for set vf mac address
add new API's to the testpmd guide

Signed-off-by: Bernard Iremonger 
---
 app/test-pmd/cmdline.c  | 675 
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  62 ++-
 2 files changed, 734 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 17d238f..d26db62 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -87,6 +87,7 @@
 #ifdef RTE_LIBRTE_PMD_BOND
 #include 
 #endif
+#include 

 #include "testpmd.h"

@@ -10585,6 +10586,672 @@ cmdline_parse_inst_t cmd_config_e_tag_filter_del = {
},
 };

+/* vf vlan anti spoof configuration */
+
+/* Common result structure for vf vlan anti spoof */
+struct cmd_vf_vlan_anti_spoof_result {
+   cmdline_fixed_string_t set;
+   cmdline_fixed_string_t vf;
+   cmdline_fixed_string_t vlan;
+   cmdline_fixed_string_t antispoof;
+   uint8_t port_id;
+   uint32_t vf_id;
+   cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf vlan anti spoof enable disable */
+cmdline_parse_token_string_t cmd_vf_vlan_anti_spoof_set =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+set, "set");
+cmdline_parse_token_string_t cmd_vf_vlan_anti_spoof_vf =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+vf, "vf");
+cmdline_parse_token_string_t cmd_vf_vlan_anti_spoof_vlan =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+vlan, "vlan");
+cmdline_parse_token_string_t cmd_vf_vlan_anti_spoof_antispoof =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+antispoof, "antispoof");
+cmdline_parse_token_num_t cmd_vf_vlan_anti_spoof_port_id =
+   TOKEN_NUM_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_vlan_anti_spoof_vf_id =
+   TOKEN_NUM_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+vf_id, UINT32);
+cmdline_parse_token_string_t cmd_vf_vlan_anti_spoof_on_off =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_vlan_anti_spoof_result,
+on_off, "on#off");
+
+static void
+cmd_set_vf_vlan_anti_spoof_parsed(
+   void *parsed_result,
+   __attribute__((unused)) struct cmdline *cl,
+   __attribute__((unused)) void *data)
+{
+   struct cmd_vf_vlan_anti_spoof_result *res = parsed_result;
+   int ret = 0;
+   int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+   ret = rte_pmd_ixgbe_set_vf_vlan_anti_spoof(res->port_id, res->vf_id, 
is_on);
+   switch (ret) {
+   case 0:
+   break;
+   case -EINVAL:
+   printf("invalid vf_id %d\n", res->vf_id);
+   break;
+   case -ENODEV:
+   printf("invalid port_id %d\n", res->port_id);
+   break;
+   default:
+   printf("programming error: (%s)\n", strerror(-ret));
+   }
+}
+
+cmdline_parse_inst_t cmd_set_vf_vlan_anti_spoof = {
+   .f = cmd_set_vf_vlan_anti_spoof_parsed,
+   .data = NULL,
+   .help_str = "set vf vlan antispoof port_id vf_id on|off",
+   .tokens = {
+   (void *)_vf_vlan_anti_spoof_set,
+   (void *)_vf_vlan_anti_spoof_vf,
+   (void *)_vf_vlan_anti_spoof_vlan,
+   (void *)_vf_vlan_anti_spoof_antispoof,
+   (void *)_vf_vlan_anti_spoof_port_id,
+   (void *)_vf_vlan_anti_spoof_vf_id,
+   (void *)_vf_vlan_anti_spoof_on_off,
+   NULL,
+   },
+};
+
+/* vf mac anti spoof configuration */
+
+/* Common result structure for vf mac anti spoof */
+struct cmd_vf_mac_anti_spoof_result {
+   cmdline_fixed_string_t set;
+   cmdline_fixed_string_t vf;
+   cmdline_fixed_string_t mac;
+   cmdline_fixed_string_t antispoof;
+   uint8_t port_id;
+   uint32_t vf_id;
+   cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf mac anti spoof enable disable */
+cmdline_parse_token_string_t cmd_vf_mac_anti_spoof_set =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_mac_anti_spoof_result,
+set, "set");
+cmdline_parse_token_string_t cmd_vf_mac_anti_spoof_vf =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_mac_anti_spoof_result,
+vf, "vf");
+cmdline_parse_token_string_t cmd_vf_mac_anti_spoof_mac =
+   TOKEN_STRING_INITIALIZER
+   (struct cmd_vf_mac_anti_spoof_result,
+mac, "mac");
+cmdline_parse_token_string_t 

[dpdk-dev] [PATCH v7 1/2] net/ixgbe: add API's for VF management

2016-10-07 Thread Bernard Iremonger
Add API's to configure and manage VF's on an Intel 82559 NIC.

add rte_pmd_ixgbe_set_vf_vlan_anti_spoof function.
add rte_pmd_ixgbe_set_vf_mac_anti_spoof function.
add rte_pmd_ixgbe_set_vf_stripq function.

Signed-off-by: Alex Zelezniak 

add rte_pmd_ixgbe_set_vf_vlan_insert function.
add rte_pmd_ixgbe_set_tx_loopback function.
add rte_pmd_ixgbe_set_all_queues_drop function.
add rte_pmd_ixgbe_set_vf_split_drop_en function.
add rte_pmd_ixgbe_set_vf_mac_addr function.

Signed-off-by: Bernard Iremonger 
---
 drivers/net/ixgbe/Makefile  |   4 +-
 drivers/net/ixgbe/ixgbe_ethdev.c| 240 
 drivers/net/ixgbe/rte_pmd_ixgbe.h   | 182 +
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  13 ++
 4 files changed, 438 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/ixgbe/rte_pmd_ixgbe.h

diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile
index a6c71f3..94ddc7b 100644
--- a/drivers/net/ixgbe/Makefile
+++ b/drivers/net/ixgbe/Makefile
@@ -1,6 +1,6 @@
 #   BSD LICENSE
 #
-#   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+#   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
 #   All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
@@ -119,6 +119,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_bypass.c
 SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_82599_bypass.c
 endif

+# install this header file
+SYMLINK-$(CONFIG_RTE_LIBRTE_IXGBE_PMD)-include := rte_pmd_ixgbe.h

 # this lib depends upon:
 DEPDIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += lib/librte_eal lib/librte_ether
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 6b3d4fa..35281f9 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -72,6 +72,8 @@
 #include "base/ixgbe_phy.h"
 #include "ixgbe_regs.h"

+#include "rte_pmd_ixgbe.h"
+
 /*
  * High threshold controlling when to start sending XOFF frames. Must be at
  * least 8 bytes less than receive packet buffer size. This value is in units
@@ -4046,6 +4048,35 @@ ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, 
struct ether_addr *addr)
ixgbe_add_rar(dev, addr, 0, 0);
 }

+int
+rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, struct ether_addr 
*mac_addr)
+{
+   struct ixgbe_hw *hw;
+   struct ixgbe_vf_info *vfinfo;
+   int rar_entry;
+   uint8_t *new_mac = (uint8_t *)(mac_addr);
+   struct rte_eth_dev *dev;
+   struct rte_eth_dev_info dev_info;
+
+   RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+   dev = _eth_devices[port];
+   rte_eth_dev_info_get(port, _info);
+
+   if (vf >= dev_info.max_vfs)
+   return -EINVAL;
+
+   hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+   vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
+   rar_entry = hw->mac.num_rar_entries - (vf + 1);
+
+   if (is_valid_assigned_ether_addr((struct ether_addr *)new_mac)) {
+   rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 
ETHER_ADDR_LEN);
+   return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, 
IXGBE_RAH_AV);
+   }
+   return -EINVAL;
+}
+
 static int
 ixgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 {
@@ -4639,6 +4670,215 @@ ixgbe_set_pool_vlan_filter(struct rte_eth_dev *dev, 
uint16_t vlan,
return ret;
 }

+int
+rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
+{
+   struct ixgbe_hw *hw;
+   struct ixgbe_mac_info *mac;
+   struct rte_eth_dev *dev;
+   struct rte_eth_dev_info dev_info;
+
+   RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+   dev = _eth_devices[port];
+   rte_eth_dev_info_get(port, _info);
+
+   if (vf >= dev_info.max_vfs)
+   return -EINVAL;
+
+   if (on > 1)
+   return -EINVAL;
+
+   hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+   mac = >mac;
+
+   mac->ops.set_vlan_anti_spoofing(hw, on, vf);
+
+   return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
+{
+   struct ixgbe_hw *hw;
+   struct ixgbe_mac_info *mac;
+   struct rte_eth_dev *dev;
+   struct rte_eth_dev_info dev_info;
+
+   RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+   dev = _eth_devices[port];
+   rte_eth_dev_info_get(port, _info);
+
+   if (vf >= dev_info.max_vfs)
+   return -EINVAL;
+
+   if (on > 1)
+   return -EINVAL;
+
+   hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+   mac = >mac;
+   mac->ops.set_mac_anti_spoofing(hw, on, vf);
+
+   return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint8_t on)
+{
+   struct ixgbe_hw *hw;
+   uint32_t ctrl;
+   struct rte_eth_dev *dev;
+   struct rte_eth_dev_info dev_info;
+
+   RTE_ETH_VALID_PORTID_OR_ERR_RET(port, 

[dpdk-dev] [PATCH v7 0/2] add API's for VF management

2016-10-07 Thread Bernard Iremonger
This patchset contains new DPDK API's for use
with the Virtual Function Daemon (VFD).

The need to configure and manage VF's on a NIC has grown to the
point where a DPDK based tool, VFD, has been developed to do this.

This patch set adds API extensions to DPDK for VF configuration.

Eight new API's have been added for the Intel 82559 NIC.

Changes have been made to testpmd to facilitate testing of the new API's.
The testpmd documentation has been updated to document the testpmd changes.

Changes in v7:
rebase to latest master branch.
minor changes to ixgbe PMD following internal review.

Changes in v6:
rebase to latest master branch.
fix ixgbe makefile.
move set_vf_vlan_stripq function from ethdev to ixgbe PMD.
revise testpmd command for set_vf_vlan_stripq.

Changes in v5:
rebase to latest master branch.
remove new API's from eth_dev_ops structure.
add public API's to ixgbe PMD.
revise testpmd commands for new API's

Changes in v4:
The rte_eth_dev_vf_ping API has been dropped as it is a work around for a bug.
The rte_eth_dev_set_vf_vlan_strip API has been renamed to
rte_eth_dev_set_vf_vlan_stripq.

Changes in v3:
rebase to latest master branch.
drop patches for callback functions
revise VF id checks in new librte_ether functions
revise testpmd commands for new API's

Changes in V2:
rebase to latest master branch.
fix compile  error with clang.

Bernard Iremonger (2):
  net/ixgbe: add API's for VF management
  app/test_pmd: add tests for new API's

 app/test-pmd/cmdline.c  | 675 
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  62 ++-
 drivers/net/ixgbe/Makefile  |   4 +-
 drivers/net/ixgbe/ixgbe_ethdev.c| 240 ++
 drivers/net/ixgbe/rte_pmd_ixgbe.h   | 182 
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  13 +
 6 files changed, 1172 insertions(+), 4 deletions(-)
 create mode 100644 drivers/net/ixgbe/rte_pmd_ixgbe.h

-- 
2.9.0



[dpdk-dev] [PATCH] test_cryptodev_perf: IV and digest should be stored at a DMAeble address

2016-10-07 Thread Akhil Goyal
Hi Arek,

Ok. I would rebase the patch.
Regarding changes required to qat_snow3g, I do not have setup to test on qat 
and the hardware that I test, currently snow3g support is not added. I can send 
the patches for snow3g at some later stage.

Regards,
Akhil

-Original Message-
From: Kusztal, ArkadiuszX [mailto:arkadiuszx.kusz...@intel.com] 
Sent: Wednesday, October 05, 2016 2:57 PM
To: Akhil Goyal ; dev at dpdk.org; Doherty, Declan 

Cc: Jain, Deepak K ; Trahe, Fiona ; Griffin, John 
Subject: RE: [dpdk-dev] [PATCH] test_cryptodev_perf: IV and digest should be 
stored at a DMAeble address

Hi Akhil,

Could you rebase it against newest next-crypto subtree, there were changes with 
function names in the meantime.
And to make it really consistent across all hw tests could you add this change 
to qat_snow3g too, for snow3g I assume aad need to obtain correct physical 
address too.

Regards,
Arek

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Akhil Goyal
> Sent: Wednesday, October 05, 2016 7:40 AM
> To: dev at dpdk.org; Doherty, Declan 
> Subject: Re: [dpdk-dev] [PATCH] test_cryptodev_perf: IV and digest 
> should be stored at a DMAeble address
> 
> On 9/26/2016 10:03 PM, akhil.goyal at nxp.com wrote:
> > From: Akhil Goyal 
> >
> > For physical crypto devices, IV and digest are processed by the 
> > crypto device which need the contents to be written on some DMA able 
> > address.
> >
> > So in order to do that, IV and digest are accomodated in the packet.
> >
> > Signed-off-by: Akhil Goyal 
> > ---
> >  app/test/test_cryptodev_perf.c | 10 --
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/app/test/test_cryptodev_perf.c 
> > b/app/test/test_cryptodev_perf.c index 0ea7ec1..930d5b8 100644
> > --- a/app/test/test_cryptodev_perf.c
> > +++ b/app/test/test_cryptodev_perf.c
> > @@ -2366,9 +2366,13 @@ test_perf_set_crypto_op(struct rte_crypto_op
> *op, struct rte_mbuf *m,
> > op->sym->auth.aad.length = AES_CBC_CIPHER_IV_LENGTH;
> >
> > /* Cipher Parameters */
> > -   op->sym->cipher.iv.data = aes_cbc_iv;
> > +   op->sym->cipher.iv.data = (uint8_t *)m->buf_addr + m->data_off;
> > +   op->sym->cipher.iv.phys_addr = rte_pktmbuf_mtophys(m);
> > op->sym->cipher.iv.length = AES_CBC_CIPHER_IV_LENGTH;
> >
> > +   rte_memcpy(op->sym->cipher.iv.data, aes_cbc_iv,
> > +   AES_CBC_CIPHER_IV_LENGTH);
> > +
> > /* Data lengths/offsets Parameters */
> > op->sym->auth.data.offset = 0;
> > op->sym->auth.data.length = data_len; @@ -2468,7 +2472,9 @@ 
> > test_perf_aes_sha(uint8_t dev_id, uint16_t queue_id,
> > rte_pktmbuf_free(mbufs[k]);
> > return -1;
> > }
> > -
> > +   /* Make room for Digest and IV in mbuf */
> > +   rte_pktmbuf_append(mbufs[i], digest_length);
> > +   rte_pktmbuf_prepend(mbufs[i],
> AES_CBC_CIPHER_IV_LENGTH);
> > }
> >
> >
> >
> Hi Declan,
> 
> Sorry I missed out copy your name in the TO list. Do we have some 
> comments on this patch.
> 
> Regards,
> Akhil



[dpdk-dev] [RFC] libeventdev: event driven programming model framework for DPDK

2016-10-07 Thread Hemant Agrawal
Hi Jerin/Narender,

Thanks for the proposal and discussions. 

I agree with many of the comment made by Narender.  Here are some 
additional comments.

1. rte_event_schedule - should support option for bulk dequeue. The size of 
bulk should be a property of device, how much depth it can support.

2. The event schedule should also support the option to specify the amount of 
time, it can wait. The implementation may only support global 
setting(dequeue_wait_ns) for wait time. They can take any non-zero wait value 
as to implement wait.  

3. rte_event_schedule_from_group - there should be one model.  Both Push and 
Pull may not work well together. At least the simultaneous mixed config will 
not work on NXP hardware scheduler. 

4. Priority of queues within the scheduling group?  - Please keep in mind that 
some hardware supports intra scheduler priority and some only support intra 
flow_queue priority within a scheduler instance. The events of same flow id 
should have same priority.

5. w.r.t flow_queue numbers in log2, I will prefer to have absolute number. Not 
all system may have large number of queues. So the design should keep in 
account the system will fewer number of queues.

Regards,
Hemant

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Jerin Jacob
> Sent: Wednesday, October 05, 2016 12:55 PM
> On Tue, Oct 04, 2016 at 09:49:52PM +, Vangati, Narender wrote:
> > Hi Jerin,
> 
> Hi Narender,
> 
> Thanks for the comments.I agree with proposed changes; I will address these
> comments in v2.
> 
> /Jerin
> 
> 
> >
> >
> >
> > Here are some comments on the libeventdev RFC.
> >
> > These are collated thoughts after discussions with you & others to 
> > understand
> the concepts and rationale for the current proposal.
> >
> >
> >
> > 1. Concept of flow queues. This is better abstracted as flow ids and not as 
> > flow
> queues which implies there is a queueing structure per flow. A s/w
> implementation can do atomic load balancing on multiple flow ids more
> efficiently than maintaining each event in a specific flow queue.
> >
> >
> >
> > 2. Scheduling group. A scheduling group is more a steam of events, so an 
> > event
> queue might be a better abstraction.
> >
> >
> >
> > 3. An event queue should support the concept of max active atomic flows
> (maximum number of active flows this queue can track at any given time) and
> max active ordered sequences (maximum number of outstanding events waiting
> to be egress reordered by this queue). This allows a scheduler implementation 
> to
> dimension/partition its resources among event queues.
> >
> >
> >
> > 4. An event queue should support concept of a single consumer. In an
> application, a stream of events may need to be brought together to a single
> core for some stages of processing, e.g. for TX at the end of the pipeline to
> avoid NIC reordering of the packets. Having a 'single consumer' event queue 
> for
> that stage allows the intensive scheduling logic to be short circuited and can
> improve throughput for s/w implementations.
> >
> >
> >
> > 5. Instead of tying eventdev access to an lcore, a higher level of 
> > abstraction
> called event port is needed which is the application i/f to the eventdev. 
> Event
> ports are connected to event queues and is the object the application uses to
> dequeue and enqueue events. There can be more than one event port per lcore
> allowing multiple lightweight threads to have their own i/f into eventdev, if 
> the
> implementation supports it. An event port abstraction also encapsulates
> dequeue depth and enqueue depth for a scheduler implementations which can
> schedule multiple events at a time and output events that can be buffered.
> >
> >
> >
> > 6. An event should support priority. Per event priority is useful for 
> > segregating
> high priority (control messages) traffic from low priority within the same 
> flow.
> This needs to be part of the event definition for implementations which 
> support
> it.
> >
> >
> >
> > 7. Event port to event queue servicing priority. This allows two event 
> > ports to
> connect to the same event queue with different priorities. For implementations
> which support it, this allows a worker core to participate in two different
> workflows with different priorities (workflow 1 needing 3.5 cores, workflow 2
> needing 2.5 cores, and so on).
> >
> >
> >
> > 8. Define the workflow as schedule/dequeue/enqueue. An implementation is
> free to define schedule as NOOP. A distributed s/w scheduler can use this to
> schedule events; also a centralized s/w scheduler can make this a NOOP on non-
> scheduler cores.
> >
> >
> >
> > 9. The schedule_from_group API does not fit the workflow.
> >
> >
> >
> > 10. The ctxt_update/ctxt_wait breaks the normal workflow. If the normal
> workflow is a dequeue -> do work based on event type -> enqueue,  a pin_event
> argument to enqueue (where the pinned event is returned through the normal
> 

[dpdk-dev] [PATCH 1/3] eal/drivers: prefix driver REGISTER macros with EAL

2016-10-07 Thread Neil Horman
On Fri, Oct 07, 2016 at 03:51:44PM +0200, Thomas Monjalon wrote:
> 2016-10-07 19:11, Shreyansh Jain:
> > --- a/mk/internal/rte.compile-pre.mk
> > +++ b/mk/internal/rte.compile-pre.mk
> > @@ -87,7 +87,7 @@ endif
> >   PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ $@.pmd.c
> >   PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@.pmd.o $@.pmd.c
> >   PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o $@.o $@.pmd.o $@
> > -PMDINFO_TO_O = if grep -q 'DRIVER_REGISTER_.*(.*)' $<; then \
> > +PMDINFO_TO_O = if grep 'EAL_REGISTER_.*(.*)' $<; then \
> >  echo "$(if $V,$(PMDINFO_GEN),  PMDINFO $@.pmd.c)" && \
> >  $(PMDINFO_GEN) && \
> >  echo "$(if $V,$(PMDINFO_CC),  CC $@.pmd.o)" && \
> > 
> > --->8---
> >CC eal_pci_vfio.o
> >PMDINFO eal_pci_vfio.o.pmd.c
> > /bin/sh: 1: 
> > /home/shreyansh/build/DPDK/02_dpdk/x86_64-native-linuxapp-gcc/app/dpdk-pmdinfogen:
> >  
> > not found
> > /home/shreyansh/build/DPDK/02_dpdk/mk/internal/rte.compile-pre.mk:138: 
> > recipe for target 'eal_pci_vfio.o' failed
> > --->8---
> > 
> > I don't think PMDINFO should be running on eal_pci_vfio file. Isn't it? 
> 
> Every files are scanned for the pattern.
> 
> > Is it because EAL_REGISTER_* is matching EAL_REGISTER_TAILQ like macro 
> > as well?
> 
> Probably.
> That's another argument in favor of good prefixes.
> I think you should use RTE_DRIVER_REGISTER_ or better, RTE_PMD_REGISTER_
Thats what we had, about 4 changes to this macro ago, and yes, that made alot
more sense, to grep on a more complete version of the macro name to ensure a
unique match.  You might just look for the regex
EAL_REGISTER_VDEV|EAL_REGISTER_PCI with grep -E

Neil



> > 
> > I am not very well versed with how PMDINFO is linking with the build 
> > system so any hints/insight into this would be really helpful.
> > 
> > One I get more clarity on this, I will push a new version of this patch.
> 
> Thanks
> 


[dpdk-dev] [PATCH v2 10/12] virtio: add Tx checksum offload support

2016-10-07 Thread Maxime Coquelin
Hi Olivier,

On 10/03/2016 11:00 AM, Olivier Matz wrote:
> Signed-off-by: Olivier Matz 
> ---
>  drivers/net/virtio/virtio_ethdev.c |  7 +
>  drivers/net/virtio/virtio_ethdev.h |  1 +
>  drivers/net/virtio/virtio_rxtx.c   | 57 
> +-
>  3 files changed, 45 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/net/virtio/virtio_ethdev.c 
> b/drivers/net/virtio/virtio_ethdev.c
> index 43cb096..55024cd 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1578,6 +1578,13 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct 
> rte_eth_dev_info *dev_info)
>   dev_info->rx_offload_capa =
>   DEV_RX_OFFLOAD_TCP_CKSUM |
>   DEV_RX_OFFLOAD_UDP_CKSUM;
> + dev_info->tx_offload_capa = 0;
> +
> + if (hw->guest_features & (1ULL << VIRTIO_NET_F_CSUM)) {
> + dev_info->tx_offload_capa |=
> + DEV_TX_OFFLOAD_UDP_CKSUM |
> + DEV_TX_OFFLOAD_TCP_CKSUM;
> + }
>  }
>
>  /*
> diff --git a/drivers/net/virtio/virtio_ethdev.h 
> b/drivers/net/virtio/virtio_ethdev.h
> index 2fc9218..202aa2e 100644
> --- a/drivers/net/virtio/virtio_ethdev.h
> +++ b/drivers/net/virtio/virtio_ethdev.h
> @@ -62,6 +62,7 @@
>1u << VIRTIO_NET_F_CTRL_VQ   | \
>1u << VIRTIO_NET_F_CTRL_RX   | \
>1u << VIRTIO_NET_F_CTRL_VLAN | \
> +  1u << VIRTIO_NET_F_CSUM  | \
>1u << VIRTIO_NET_F_MRG_RXBUF | \
>1ULL << VIRTIO_F_VERSION_1)
>
> diff --git a/drivers/net/virtio/virtio_rxtx.c 
> b/drivers/net/virtio/virtio_rxtx.c
> index eda678a..4ae11e7 100644
> --- a/drivers/net/virtio/virtio_rxtx.c
> +++ b/drivers/net/virtio/virtio_rxtx.c
> @@ -213,13 +213,14 @@ static inline void
>  virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
>  uint16_t needed, int use_indirect, int can_push)
>  {
> + struct virtio_tx_region *txr = txvq->virtio_net_hdr_mz->addr;
>   struct vq_desc_extra *dxp;
>   struct virtqueue *vq = txvq->vq;
>   struct vring_desc *start_dp;
>   uint16_t seg_num = cookie->nb_segs;
>   uint16_t head_idx, idx;
>   uint16_t head_size = vq->hw->vtnet_hdr_size;
> - unsigned long offs;
> + struct virtio_net_hdr *hdr;
>
>   head_idx = vq->vq_desc_head_idx;
>   idx = head_idx;
> @@ -230,10 +231,9 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct 
> rte_mbuf *cookie,
>   start_dp = vq->vq_ring.desc;
>
>   if (can_push) {
> - /* put on zero'd transmit header (no offloads) */
> - void *hdr = rte_pktmbuf_prepend(cookie, head_size);
> -
> - memset(hdr, 0, head_size);
> + /* prepend cannot fail, checked by caller */
> + hdr = (struct virtio_net_hdr *)
> + rte_pktmbuf_prepend(cookie, head_size);
>   } else if (use_indirect) {
>   /* setup tx ring slot to point to indirect
>* descriptor list stored in reserved region.
> @@ -241,14 +241,11 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct 
> rte_mbuf *cookie,
>* the first slot in indirect ring is already preset
>* to point to the header in reserved region
>*/
> - struct virtio_tx_region *txr = txvq->virtio_net_hdr_mz->addr;
> -
> - offs = idx * sizeof(struct virtio_tx_region)
> - + offsetof(struct virtio_tx_region, tx_indir);
> -
> - start_dp[idx].addr  = txvq->virtio_net_hdr_mem + offs;
> + start_dp[idx].addr  = txvq->virtio_net_hdr_mem +
> + RTE_PTR_DIFF([idx].tx_indir, txr);
>   start_dp[idx].len   = (seg_num + 1) * sizeof(struct vring_desc);
>   start_dp[idx].flags = VRING_DESC_F_INDIRECT;
> + hdr = (struct virtio_net_hdr *)[idx].tx_hdr;
>
>   /* loop below will fill in rest of the indirect elements */
>   start_dp = txr[idx].tx_indir;
> @@ -257,15 +254,40 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct 
> rte_mbuf *cookie,
>   /* setup first tx ring slot to point to header
>* stored in reserved region.
>*/
> - offs = idx * sizeof(struct virtio_tx_region)
> - + offsetof(struct virtio_tx_region, tx_hdr);
> -
> - start_dp[idx].addr  = txvq->virtio_net_hdr_mem + offs;
> + start_dp[idx].addr  = txvq->virtio_net_hdr_mem +
> + RTE_PTR_DIFF([idx].tx_hdr, txr);
>   start_dp[idx].len   = vq->hw->vtnet_hdr_size;
>   start_dp[idx].flags = VRING_DESC_F_NEXT;
> + hdr = (struct virtio_net_hdr *)[idx].tx_hdr;
> +
>   idx = start_dp[idx].next;
>   }
>
> + /* Checksum Offload */
> + switch (cookie->ol_flags & PKT_TX_L4_MASK) {
> + case PKT_TX_UDP_CKSUM:
> + 

[dpdk-dev] [PATCH v7] net/virtio: add set_mtu in virtio

2016-10-07 Thread Stephen Hemminger
I think current patch is fine. If someone has later problem with it on some
scenario we can fix the bug then.
Please merge


[dpdk-dev] [PATCH V2 2/2] virtio: support IOMMU platform

2016-10-07 Thread Michael S. Tsirkin
On Wed, Sep 28, 2016 at 04:25:12PM +0800, Jason Wang wrote:
> Negotiate VIRTIO_F_IOMMU_PLATFORM to have IOMMU support.
> 
> Signed-off-by: Jason Wang 
> ---
> Changes from v1:
> - remove unnecessary NEED_MAPPING flag

One thing we probably should do is enable this flag
with VFIO but not with UIO or VFIO-noiommu.

> ---
>  drivers/net/virtio/virtio_ethdev.h | 3 ++-
>  drivers/net/virtio/virtio_pci.h| 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.h 
> b/drivers/net/virtio/virtio_ethdev.h
> index 2ecec6e..04a06e2 100644
> --- a/drivers/net/virtio/virtio_ethdev.h
> +++ b/drivers/net/virtio/virtio_ethdev.h
> @@ -63,7 +63,8 @@
>1u << VIRTIO_NET_F_CTRL_RX   | \
>1u << VIRTIO_NET_F_CTRL_VLAN | \
>1u << VIRTIO_NET_F_MRG_RXBUF | \
> -  1ULL << VIRTIO_F_VERSION_1)
> +  1ULL << VIRTIO_F_VERSION_1   | \
> +  1ULL << VIRTIO_F_IOMMU_PLATFORM )

Space before ) looks kind of ugly.

>  
>  /*
>   * CQ function prototype
> diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
> index 3430a39..0aa0015 100644
> --- a/drivers/net/virtio/virtio_pci.h
> +++ b/drivers/net/virtio/virtio_pci.h
> @@ -138,6 +138,7 @@ struct virtnet_ctl;
>  #define VIRTIO_RING_F_INDIRECT_DESC  28
>  
>  #define VIRTIO_F_VERSION_1   32
> +#define VIRTIO_F_IOMMU_PLATFORM  33
>  
>  /*
>   * Some VirtIO feature bits (currently bits 28 through 31) are
> @@ -145,7 +146,7 @@ struct virtnet_ctl;
>   * rest are per-device feature bits.
>   */
>  #define VIRTIO_TRANSPORT_F_START 28
> -#define VIRTIO_TRANSPORT_F_END   32
> +#define VIRTIO_TRANSPORT_F_END   34
>  

This seems unused. Drop it?

>  /* The Guest publishes the used index for which it expects an interrupt
>   * at the end of the avail ring. Host should ignore the avail->flags field. 
> */
> -- 
> 2.7.4


[dpdk-dev] [PATCH 1/1] testpmd_ug: update userguide with xstats commands

2016-10-07 Thread Mcnamara, John
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Maryam Tahhan
> Sent: Wednesday, September 7, 2016 11:46 AM
> To: dev at dpdk.org
> Cc: Tahhan, Maryam 
> Subject: [dpdk-dev] [PATCH 1/1] testpmd_ug: update userguide with xstats
> commands
> 
> Update the testpmd user guide with instructions for retrieving extended
> NIC statistics.
> 
> Signed-off-by: Maryam Tahhan 

Acked-by: John McNamara 



[dpdk-dev] [PATCH] examples/l3fwd: em path hash offload to machine

2016-10-07 Thread Hemant Agrawal
Hi Jerin,
Thanks for the review, I will send a v2 with the suggestions made
Regards,
Hemant

> -Original Message-
> From: Jerin Jacob [mailto:jerin.jacob at caviumnetworks.com]
> Sent: Wednesday, October 05, 2016 5:23 PM
> To: Hemant Agrawal 
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: em path hash offload to
> machine
> 
> On Tue, Aug 23, 2016 at 08:24:39PM +0530, Hemant Agrawal wrote:
> 
> Maybe you can change the subject line to:
> examples/l3fwd: em: use hw accelerated crc hash function for arm64 instead of:
> examples/l3fwd: em path hash offload to machine
> 
> > if machine level CRC extension are available, offload the hash to
> > machine provided functions e.g. armv8-a CRC extensions support it
> >
> > Signed-off-by: Hemant Agrawal 
> > ---
> >  examples/l3fwd/l3fwd_em.c | 20 ++--
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
> > index def5a02..a889c67 100644
> > --- a/examples/l3fwd/l3fwd_em.c
> > +++ b/examples/l3fwd/l3fwd_em.c
> > @@ -58,13 +58,13 @@
> >
> >  #include "l3fwd.h"
> >
> > -#ifdef RTE_MACHINE_CPUFLAG_SSE4_2
> > +#if defined(RTE_MACHINE_CPUFLAG_SSE4_2) ||
> > +defined(RTE_MACHINE_CPUFLAG_CRC32)
> 
> Rather than adding new compilation flag everywhere, Maybe you can add
> 
> #if defined(RTE_MACHINE_CPUFLAG_SSE4_2) &&
> defined(RTE_MACHINE_CPUFLAG_CRC32)
> #define EM_HASH_CRC 1
> #endif
> 
> something like above to reduce the change for future platforms with crc
> support.
> 
> Other than that, you can add:
> Reviewed-by: Jerin Jacob 
> 
> >  #include 
> >  #define DEFAULT_HASH_FUNC   rte_hash_crc
> >  #else
> >  #include 
> >  #define DEFAULT_HASH_FUNC   rte_jhash
> > -#endif /* RTE_MACHINE_CPUFLAG_SSE4_2 */
> > +#endif
> >
> >  #define IPV6_ADDR_LEN 16
> >
> > @@ -169,17 +169,17 @@ ipv4_hash_crc(const void *data, __rte_unused
> uint32_t data_len,
> > t = k->proto;
> > p = (const uint32_t *)>port_src;
> >
> > -#ifdef RTE_MACHINE_CPUFLAG_SSE4_2
> > +#if defined(RTE_MACHINE_CPUFLAG_SSE4_2) ||
> > +defined(RTE_MACHINE_CPUFLAG_CRC32)
> > init_val = rte_hash_crc_4byte(t, init_val);
> > init_val = rte_hash_crc_4byte(k->ip_src, init_val);
> > init_val = rte_hash_crc_4byte(k->ip_dst, init_val);
> > init_val = rte_hash_crc_4byte(*p, init_val); -#else /*
> > RTE_MACHINE_CPUFLAG_SSE4_2 */
> > +#else
> > init_val = rte_jhash_1word(t, init_val);
> > init_val = rte_jhash_1word(k->ip_src, init_val);
> > init_val = rte_jhash_1word(k->ip_dst, init_val);
> > init_val = rte_jhash_1word(*p, init_val); -#endif /*
> > RTE_MACHINE_CPUFLAG_SSE4_2 */
> > +#endif
> >
> > return init_val;
> >  }
> > @@ -191,16 +191,16 @@ ipv6_hash_crc(const void *data, __rte_unused
> uint32_t data_len,
> > const union ipv6_5tuple_host *k;
> > uint32_t t;
> > const uint32_t *p;
> > -#ifdef RTE_MACHINE_CPUFLAG_SSE4_2
> > +#if defined(RTE_MACHINE_CPUFLAG_SSE4_2) ||
> > +defined(RTE_MACHINE_CPUFLAG_CRC32)
> > const uint32_t  *ip_src0, *ip_src1, *ip_src2, *ip_src3;
> > const uint32_t  *ip_dst0, *ip_dst1, *ip_dst2, *ip_dst3; -#endif /*
> > RTE_MACHINE_CPUFLAG_SSE4_2 */
> > +#endif
> >
> > k = data;
> > t = k->proto;
> > p = (const uint32_t *)>port_src;
> >
> > -#ifdef RTE_MACHINE_CPUFLAG_SSE4_2
> > +#if defined(RTE_MACHINE_CPUFLAG_SSE4_2) ||
> > +defined(RTE_MACHINE_CPUFLAG_CRC32)
> > ip_src0 = (const uint32_t *) k->ip_src;
> > ip_src1 = (const uint32_t *)(k->ip_src+4);
> > ip_src2 = (const uint32_t *)(k->ip_src+8); @@ -219,14 +219,14 @@
> > ipv6_hash_crc(const void *data, __rte_unused uint32_t data_len,
> > init_val = rte_hash_crc_4byte(*ip_dst2, init_val);
> > init_val = rte_hash_crc_4byte(*ip_dst3, init_val);
> > init_val = rte_hash_crc_4byte(*p, init_val); -#else /*
> > RTE_MACHINE_CPUFLAG_SSE4_2 */
> > +#else
> > init_val = rte_jhash_1word(t, init_val);
> > init_val = rte_jhash(k->ip_src,
> > sizeof(uint8_t) * IPV6_ADDR_LEN, init_val);
> > init_val = rte_jhash(k->ip_dst,
> > sizeof(uint8_t) * IPV6_ADDR_LEN, init_val);
> > init_val = rte_jhash_1word(*p, init_val); -#endif /*
> > RTE_MACHINE_CPUFLAG_SSE4_2 */
> > +#endif
> > return init_val;
> >  }
> >
> > --
> > 1.9.1
> >


[dpdk-dev] [PATCH] doc: fix typo in SNOW3G documentation

2016-10-07 Thread Jain, Deepak K


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pablo de Lara
> Sent: Thursday, October 6, 2016 9:55 PM
> To: dev at dpdk.org
> Cc: De Lara Guarch, Pablo 
> Subject: [dpdk-dev] [PATCH] doc: fix typo in SNOW3G documentation
> 
> Fixes: 1d0c90e6cf0b ("doc: update build instructions for libsso_snow3g")
> 
> Signed-off-by: Pablo de Lara 
> ---
>  doc/guides/cryptodevs/snow3g.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/doc/guides/cryptodevs/snow3g.rst
> b/doc/guides/cryptodevs/snow3g.rst
> index f6eb538..75a08aa 100644
> --- a/doc/guides/cryptodevs/snow3g.rst
> +++ b/doc/guides/cryptodevs/snow3g.rst
> @@ -58,7 +58,7 @@ Limitations
>  Installation
>  
> 
> -To build DPDK with the KASUMI_PMD the user is required to download
> +To build DPDK with the SNOW3G_PMD the user is required to download
>  the export controlled ``libsso_snow3g`` library, by requesting it from
> ``_.
>  Once approval has been granted, the user needs to log in
> --
> 2.7.4
Acked-by: Deepak kumar Jain 


[dpdk-dev] [PATCH v3] mbuf: add function to dump ol flag list

2016-10-07 Thread De Lara Guarch, Pablo


> -Original Message-
> From: Olivier Matz [mailto:olivier.matz at 6wind.com]
> Sent: Thursday, October 06, 2016 1:43 AM
> To: dev at dpdk.org; De Lara Guarch, Pablo
> Subject: [PATCH v3] mbuf: add function to dump ol flag list
> 
> The functions rte_get_rx_ol_flag_name() and rte_get_tx_ol_flag_name()
> can dump one flag, or set of flag that are part of the same mask (ex:
> PKT_TX_UDP_CKSUM, part of PKT_TX_L4_MASK). But they are not designed
> to
> dump the list of flags contained in mbuf->ol_flags.
> 
> This commit introduce new functions to do that. Similarly to the packet
> type dump functions, the goal is to factorize the code that could be
> used in several applications and reduce the risk of desynchronization
> between the flags and the dump functions.
> 
> Signed-off-by: Olivier Matz 

Hi Olivier,

Sorry, I missed a typo in this patch: "ouput" -> "output".

Also, check-git-log.sh is complaining about two patches:

Wrong headline lowercase:
app/testpmd: dump rx flags in csum engine
app/testpmd: display rx port in csum engine

Lastly, could you send another version of the patchset (including patches 
without any modifications).
In my opinion, it is a bit difficult to apply the patchset, because Patchwork 
doesn't tell me
that this patch is the first patch of the patchset.

The rest of the patches look ok to me.

Thanks,
Pablo


[dpdk-dev] [PATCH 1/1] testpmd_ug: update userguide with xstats commands

2016-10-07 Thread De Lara Guarch, Pablo


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Maryam Tahhan
> Sent: Wednesday, September 07, 2016 3:46 AM
> To: dev at dpdk.org
> Cc: Tahhan, Maryam
> Subject: [dpdk-dev] [PATCH 1/1] testpmd_ug: update userguide with xstats
> commands
> 
> Update the testpmd user guide with instructions for retrieving extended
> NIC statistics.
> 
> Signed-off-by: Maryam Tahhan 

Title needs to be modified to something like the following, for convention 
reasons:
"doc: update testpmd guide with xtats commands"
Apart from this:

Acked-by: Pablo de Lara 


[dpdk-dev] [PATCH 1/2] app/test: fix vdev names

2016-10-07 Thread De Lara Guarch, Pablo


> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Thursday, October 06, 2016 3:34 AM
> To: De Lara Guarch, Pablo
> Cc: dev at dpdk.org
> Subject: [PATCH 1/2] app/test: fix vdev names
> 
> The vdev eth_ring has been renamed to net_ring.
> Some unit tests are using the old name and fail.
> 
> Fixes also the vdev comments in EAL and ethdev.
> 
> Fixes: 2f45703c17ac ("drivers: make driver names consistent")
> 
> Signed-off-by: Thomas Monjalon 

Acked-by: Pablo de Lara 


[dpdk-dev] [PATCH 2/2] app/testpmd: use consistent vdev names

2016-10-07 Thread De Lara Guarch, Pablo


> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Thursday, October 06, 2016 3:34 AM
> To: De Lara Guarch, Pablo
> Cc: dev at dpdk.org
> Subject: [PATCH 2/2] app/testpmd: use consistent vdev names
> 
> The vdev eth_bond has been renamed to net_bond.
> testpmd is creating a bonding device with the old prefix.
> It is changed for consistency.
> 
> The script test-null.sh was failing because using the old name
> for the null vdev.
> 
> Fixes also the bonding and testpmd doc.
> 
> Fixes: 2f45703c17ac ("drivers: make driver names consistent")
> 
> Signed-off-by: Thomas Monjalon 

Acked-by: Pablo de Lara 


[dpdk-dev] [PATCH v7] net/virtio: add set_mtu in virtio

2016-10-07 Thread Dey, Souvik
Hi Stephen,
  As I am new to this patch submission, I did not get what you 
exactly meant my ?Please merge?, do you mean that you Ack the patch and it can 
be upstreamed or you want me submit a new version or something. Sorry for my 
ignorance.
Thanks

--
Souvik

From: Stephen Hemminger [mailto:step...@networkplumber.org]
Sent: Thursday, October 6, 2016 6:30 PM
To: Kavanagh, Mark B 
Cc: Dey, Souvik ; yuanhan.liu at linux.intel.com; dev at 
dpdk.org
Subject: Re: [PATCH v7] net/virtio: add set_mtu in virtio

I think current patch is fine. If someone has later problem with it on some 
scenario we can fix the bug then.
Please merge


[dpdk-dev] [PATCH v3 0/4] remove hard-coding of crypto num qps and cleanup

2016-10-07 Thread De Lara Guarch, Pablo


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of De Lara Guarch,
> Pablo
> Sent: Thursday, October 06, 2016 5:30 PM
> To: Trahe, Fiona; dev at dpdk.org
> Cc: Trahe, Fiona; akhil.goyal at nxp.com
> Subject: Re: [dpdk-dev] [PATCH v3 0/4] remove hard-coding of crypto num
> qps and cleanup
> 
> 
> 
> > -Original Message-
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Fiona Trahe
> > Sent: Thursday, October 06, 2016 10:34 AM
> > To: dev at dpdk.org
> > Cc: De Lara Guarch, Pablo; Trahe, Fiona; akhil.goyal at nxp.com
> > Subject: [dpdk-dev] [PATCH v3 0/4] remove hard-coding of crypto num qps
> > and cleanup
> >
> >
> > ts_params->conf.nb_queue_pairs should not be hard coded with device
> > specific number. It should be retrieved from the device info.
> > Any test which changes it should restore it to orig value.
> >
> > Also related cleanup of test code setting number and size of
> > queue-pairs on a device, e.g.
> > * Removed irrelevant ?for? loop ? was hardcoded to only loop once.
> > * Removed obsolete comment re inability to free and re-allocate queu
> > memory
> >   and obsolete workaround for it which used to create maximum size
> queues.
> >
> > And added freeing of ring memory on queue-pair release in aesni_mb PMD,
> > else releasing and setting up queue-pair of a different size fails.
> >
> > v3:
> >   separate out into 4 patches
> >
> > v2:
> >   Fix for broken QAT PMD unit tests exposed by v1
> >   i.e. In test_device_configure_invalid_queue_pair_ids() after running tests
> >   for invalid values restore original nb_queue_pairs.
> >   Also cleanup of test code setting number and size of queue-pairs on a
> device
> >   Also fix for aesni_mb PMD not freeing ring memory on qp release
> >
> >
> > Fiona Trahe (4):
> >   crypto/aesni_mb: free ring memory on qp release in PMD
> >   app/test: remove pointless for loop
> >   app/test: cleanup unnecessary ring size setup
> >   app/test: remove hard-coding of crypto num qps
> > Akhil Goyal (1):
> >   app/test: remove hard-coding of crypto num qps
> >
> >  app/test/test_cryptodev.c  | 53 
> > ++
> >  app/test/test_cryptodev_perf.c | 19 +
> >  drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 10 -
> >  3 files changed, 31 insertions(+), 51 deletions(-)
> >
> > --
> > 2.5.0
> 
> Series-acked-by: Pablo de Lara 

Applied to dpdk-next-crypto.
Thanks,

Pablo


[dpdk-dev] [PATCH v3 0/4] remove hard-coding of crypto num qps and cleanup

2016-10-07 Thread De Lara Guarch, Pablo


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Fiona Trahe
> Sent: Thursday, October 06, 2016 10:34 AM
> To: dev at dpdk.org
> Cc: De Lara Guarch, Pablo; Trahe, Fiona; akhil.goyal at nxp.com
> Subject: [dpdk-dev] [PATCH v3 0/4] remove hard-coding of crypto num qps
> and cleanup
> 
> 
> ts_params->conf.nb_queue_pairs should not be hard coded with device
> specific number. It should be retrieved from the device info.
> Any test which changes it should restore it to orig value.
> 
> Also related cleanup of test code setting number and size of
> queue-pairs on a device, e.g.
> * Removed irrelevant ?for? loop ? was hardcoded to only loop once.
> * Removed obsolete comment re inability to free and re-allocate queu
> memory
>   and obsolete workaround for it which used to create maximum size queues.
> 
> And added freeing of ring memory on queue-pair release in aesni_mb PMD,
> else releasing and setting up queue-pair of a different size fails.
> 
> v3:
>   separate out into 4 patches
> 
> v2:
>   Fix for broken QAT PMD unit tests exposed by v1
>   i.e. In test_device_configure_invalid_queue_pair_ids() after running tests
>   for invalid values restore original nb_queue_pairs.
>   Also cleanup of test code setting number and size of queue-pairs on a device
>   Also fix for aesni_mb PMD not freeing ring memory on qp release
> 
> 
> Fiona Trahe (4):
>   crypto/aesni_mb: free ring memory on qp release in PMD
>   app/test: remove pointless for loop
>   app/test: cleanup unnecessary ring size setup
>   app/test: remove hard-coding of crypto num qps
> Akhil Goyal (1):
>   app/test: remove hard-coding of crypto num qps
> 
>  app/test/test_cryptodev.c  | 53 
> ++
>  app/test/test_cryptodev_perf.c | 19 +
>  drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 10 -
>  3 files changed, 31 insertions(+), 51 deletions(-)
> 
> --
> 2.5.0

Series-acked-by: Pablo de Lara 



[dpdk-dev] [PATCH] test: fix hash multiwriter test

2016-10-07 Thread Pablo de Lara
Hash multiwriter test consists of two subtests.
If the any of the subtests fails, the overall test should fail,
but the overall test only passed if the second subtest passed,
because the return of the first subtest was being overwritten.

Fixes: be856325cba3 ("hash: add scalable multi-writer insertion with Intel TSX")

Signed-off-by: Pablo de Lara 
---
 app/test/test_hash_multiwriter.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/test/test_hash_multiwriter.c b/app/test/test_hash_multiwriter.c
index 40af95d..4dcbd9d 100644
--- a/app/test/test_hash_multiwriter.c
+++ b/app/test/test_hash_multiwriter.c
@@ -247,8 +247,6 @@ err1:
 static int
 test_hash_multiwriter_main(void)
 {
-   int r = -1;
-
if (rte_lcore_count() == 1) {
printf("More than one lcore is required to do multiwriter 
test\n");
return 0;
@@ -268,14 +266,16 @@ test_hash_multiwriter_main(void)
printf("Test multi-writer with Hardware transactional 
memory\n");

use_htm = 1;
-   r = test_hash_multiwriter();
+   if (test_hash_multiwriter() < 0)
+   return -1;
}

printf("Test multi-writer without Hardware transactional memory\n");
use_htm = 0;
-   r = test_hash_multiwriter();
+   if (test_hash_multiwriter() < 0)
+   return -1;

-   return r;
+   return 0;
 }

 REGISTER_TEST_COMMAND(hash_multiwriter_autotest, test_hash_multiwriter_main);
-- 
2.7.4