Re: [dpdk-dev] [PATCH v2 00/15] add OCTEONTX2 inline IPsec support

2020-01-19 Thread Anoob Joseph
Hi Jerin,

Will  do the suggested change (RX/rx-> Rx & TX/tx->Tx). Do you want me to trim 
the headline as well?

@Akhil, did you get a chance to review the series? Do you have any comments on 
the patches?

Thanks,
Anoob

> -Original Message-
> From: dev  On Behalf Of Jerin Jacob
> Sent: Saturday, January 18, 2020 8:09 PM
> To: Anoob Joseph 
> Cc: Akhil Goyal ; Declan Doherty
> ; Thomas Monjalon ; Jerin
> Jacob Kollanukkaran ; Narayana Prasad Raju Athreya
> ; Kiran Kumar Kokkilagadda
> ; Nithin Kumar Dabilpuram
> ; Pavan Nikhilesh Bhagavatula
> ; Ankur Dwivedi ;
> Archana Muniganti ; Tejasree Kondoj
> ; Vamsi Krishna Attunuru ;
> Lukas Bartosik ; dpdk-dev 
> Subject: Re: [dpdk-dev] [PATCH v2 00/15] add OCTEONTX2 inline IPsec support
> 
> On Sat, Jan 18, 2020 at 4:19 PM Anoob Joseph  wrote:
> >
> > This series adds inline IPsec support in OCTEONTX2 PMD.
> >
> > In the inbound path, rte_flow framework need to be used to configure
> > the NPC block, which does the h/w lookup. The packets would get
> > processed by the crypto block and would submit to the scheduling
> > block, SSO. So inline IPsec mode can be enabled only when traffic is
> > received via event device using Rx adapter.
> >
> > In the outbound path, the core would submit to the crypto block and
> > the crypto block would submit the packet for Tx internally.
> 
> 
> Please fix following check-git-log.sh issues.
> 
> Wrong headline lowercase:
> net/octeontx2: add inline ipsec rx path changes
> drivers/octeontx2: add sec in compiler optimized RX fastpath framework
> drivers/octeontx2: add sec in compiler optimized TX fastpath framework
> crypto/octeontx2: add inline tx path changes Headline too long:
> drivers/octeontx2: add sec in compiler optimized RX fastpath framework
> drivers/octeontx2: add sec in compiler optimized TX fastpath framework
> crypto/octeontx2: sync inline tag type cfg with Rx adapter 
> configuration
> 
> Changing to Rx and Tx will fix most of the issues.
> 
> 
> 
> > v2:
> > * Minimized additions to common/octeontx2
> > * Updated release notes
> > * Renamed otx2_is_ethdev to otx2_ethdev_is_sec_capable
> >
> > Ankur Dwivedi (3):
> >   crypto/octeontx2: add eth security capabilities
> >   crypto/octeontx2: add datapath ops in eth security ctx
> >   crypto/octeontx2: add inline tx path changes
> >
> > Anoob Joseph (4):
> >   common/octeontx2: add CPT LF mbox for inline inbound
> >   crypto/octeontx2: create eth security ctx
> >   crypto/octeontx2: enable CPT to share QP with ethdev
> >   crypto/octeontx2: add eth security session operations
> >
> > Archana Muniganti (3):
> >   crypto/octeontx2: add lookup mem changes to hold sa indices
> >   drivers/octeontx2: add sec in compiler optimized RX fastpath framework
> >   drivers/octeontx2: add sec in compiler optimized TX fastpath
> > framework
> >
> > Tejasree Kondoj (3):
> >   crypto/octeontx2: configure for inline IPsec
> >   crypto/octeontx2: add security in eth dev configure
> >   net/octeontx2: add inline ipsec rx path changes
> >
> > Vamsi Attunuru (2):
> >   common/octeontx2: add routine to check if sec capable otx2
> >   crypto/octeontx2: sync inline tag type cfg with Rx adapter
> > configuration
> >
> >  doc/guides/nics/octeontx2.rst  |  20 +
> >  doc/guides/rel_notes/release_20_02.rst |   9 +
> >  drivers/common/octeontx2/otx2_common.c |  22 +
> >  drivers/common/octeontx2/otx2_common.h |  22 +
> >  drivers/common/octeontx2/otx2_mbox.h   |   7 +
> >  .../octeontx2/rte_common_octeontx2_version.map |   3 +
> >  drivers/crypto/octeontx2/Makefile  |   7 +-
> >  drivers/crypto/octeontx2/meson.build   |   7 +-
> >  drivers/crypto/octeontx2/otx2_cryptodev.c  |   8 +
> >  .../crypto/octeontx2/otx2_cryptodev_hw_access.h|  22 +-
> >  drivers/crypto/octeontx2/otx2_cryptodev_mbox.c |  53 ++
> >  drivers/crypto/octeontx2/otx2_cryptodev_mbox.h |   7 +
> >  drivers/crypto/octeontx2/otx2_cryptodev_ops.c  |  56 ++
> >  drivers/crypto/octeontx2/otx2_cryptodev_qp.h   |  35 +
> >  drivers/crypto/octeontx2/otx2_ipsec_fp.h   | 348 +
> >  drivers/crypto/octeontx2/otx2_security.c   | 870
> +
> >  drivers/crypto/octeontx2/otx2_security.h   | 158 
> >  drivers/crypto/octeontx2/otx2_security_tx.h| 175 +
> >  drivers/event/octeontx2/Makefile   |   1 +
> >  drivers/event/octeontx2/meson.build|   5 +-
> >  drivers/event/octeontx2/otx2_evdev.c   | 170 ++--
> >  drivers/event/octeontx2/otx2_evdev.h   |   4 +-
> >  drivers/event/octeontx2/otx2_worker.c  |   6 +-
> >  drivers/event/octeontx2/otx2_worker.h  |   6 +
> >  drivers/event/octeontx2/otx2_worker_dual.c |   6 +-
> >  drivers/net/octeontx2/Makefile |   1 +
> >  drivers/net/octeontx2/m

Re: [dpdk-dev] [PATCH v2 00/15] add OCTEONTX2 inline IPsec support

2020-01-19 Thread Thomas Monjalon
19/01/2020 11:43, Anoob Joseph:
> Hi Jerin,
> 
> Will  do the suggested change (RX/rx-> Rx & TX/tx->Tx). Do you want me to 
> trim the headline as well?

While you are in casing details,
I don't understand why I am alone taking care of the Marvell naming
(I am fixing it often while applying)
OCTEONTX2 -> OCTEON TX2





Re: [dpdk-dev] [EXT] Re: [PATCH v2 00/15] add OCTEONTX2 inline IPsec support

2020-01-19 Thread Anoob Joseph
Hi Thomas,

I'll have it fixed in v3. Thanks for pointing it out.

Thanks,
Anoob

> -Original Message-
> From: Thomas Monjalon 
> Sent: Sunday, January 19, 2020 4:24 PM
> To: Jerin Jacob ; Anoob Joseph
> ; Jerin Jacob Kollanukkaran ;
> Narayana Prasad Raju Athreya ; Kiran Kumar
> Kokkilagadda ; Nithin Kumar Dabilpuram
> ; Pavan Nikhilesh Bhagavatula
> ; Ankur Dwivedi ;
> Archana Muniganti ; Tejasree Kondoj
> ; Vamsi Krishna Attunuru ;
> Lukas Bartosik 
> Cc: Akhil Goyal ; Declan Doherty
> ; dpdk-dev 
> Subject: [EXT] Re: [dpdk-dev] [PATCH v2 00/15] add OCTEONTX2 inline IPsec
> support
> 
> External Email
> 
> --
> 19/01/2020 11:43, Anoob Joseph:
> > Hi Jerin,
> >
> > Will  do the suggested change (RX/rx-> Rx & TX/tx->Tx). Do you want me to
> trim the headline as well?
> 
> While you are in casing details,
> I don't understand why I am alone taking care of the Marvell naming (I am 
> fixing
> it often while applying)
>   OCTEONTX2 -> OCTEON TX2
> 
> 



Re: [dpdk-dev] [PATCH v2] mempool: fix slow allocation of large mempools

2020-01-19 Thread Ali Alnubani
> -Original Message-
> From: Olivier Matz 
> Sent: Friday, January 17, 2020 11:52 AM
> To: dev@dpdk.org
> Cc: Ali Alnubani ; Anatoly Burakov
> ; Andrew Rybchenko
> ; Raslan Darawsheh
> ; sta...@dpdk.org; Thomas Monjalon
> 
> Subject: [PATCH v2] mempool: fix slow allocation of large mempools
> 
> When allocating a mempool which is larger than the largest available area, it
> can take a lot of time:
> 
> a- the mempool calculate the required memory size, and tries
>to allocate it, it fails
> b- then it tries to allocate the largest available area (this
>does not request new huge pages)
> c- add this zone to the mempool, this triggers the allocation
>of a mem hdr, which request a new huge page
> d- back to a- until mempool is populated or until there is no
>more memory
> 
> This can take a lot of time to finally fail (several minutes): in step
> a- it takes all available hugepages on the system, then release them after it
> fails.
> 
> The problem appeared with commit eba11e364614 ("mempool: reduce
> wasted space on populate"), because smaller chunks are now allowed.
> Previously, it had to be at least one page size, which is not the case in 
> step b-.
> 
> To fix this, implement our own way to allocate the largest available area
> instead of using the feature from memzone: if an allocation fails, try to 
> divide
> the size by 2 and retry. When the requested size falls below min_chunk_size,
> stop and return an error.
> 
> Fixes: eba11e364614 ("mempool: reduce wasted space on populate")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Olivier Matz 
> ---
> 
> v2:
> * fix missing check on mz == NULL condition
> 

Tested-by: Ali Alnubani 


[dpdk-dev] [PATCH v5 00/17] Introduces net/ionic PMD

2020-01-19 Thread Alfredo Cardigliano
The patch series provides an initial version of a
poll mode driver for Pensando network adapters.
The driver name is ionic.

v5 Changes:
--
- Fixed commits headlines
- Fixed doc syntax
- Fixed unused parameters errors
- Fixed included headers
- Replaced ilog2 with rte_log2_u32
- More code style cleanup

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 

Alfredo Cardigliano (17):
  net/ionic: add skeleton
  net/ionic: add hardware structures definitions
  net/ionic: add log
  net/ionic: register and initialize the adapter
  net/ionic: add port management commands
  net/ionic: add basic lif support
  net/ionic: add doorbells
  net/ionic: add adminq support
  net/ionic: add notifyq support
  net/ionic: add basic port operations
  net/ionic: add Rx filters support
  net/ionic: add Flow Control support
  net/ionic: add Rx and Tx handling
  net/ionic: add RSS support
  net/ionic: add stats
  net/ionic: add Tx checksum support
  net/ionic: read Fw version

 MAINTAINERS |6 +
 config/common_armv8a_linux  |2 +
 config/common_base  |5 +
 config/defconfig_arm-armv7a-linuxapp-gcc|1 +
 config/defconfig_ppc_64-power8-linuxapp-gcc |1 +
 doc/guides/nics/features/ionic.ini  |   36 +
 doc/guides/nics/index.rst   |1 +
 doc/guides/nics/ionic.rst   |   41 +
 doc/guides/rel_notes/release_20_02.rst  |4 +
 drivers/net/Makefile|1 +
 drivers/net/ionic/Makefile  |   34 +
 drivers/net/ionic/ionic.h   |   82 +
 drivers/net/ionic/ionic_dev.c   |  577 +
 drivers/net/ionic/ionic_dev.h   |  269 ++
 drivers/net/ionic/ionic_ethdev.c| 1327 ++
 drivers/net/ionic/ionic_ethdev.h|   22 +
 drivers/net/ionic/ionic_if.h| 2491 +++
 drivers/net/ionic/ionic_lif.c   | 1696 +
 drivers/net/ionic/ionic_lif.h   |  190 ++
 drivers/net/ionic/ionic_logs.h  |   26 +
 drivers/net/ionic/ionic_mac_api.c   |   61 +
 drivers/net/ionic/ionic_mac_api.h   |   13 +
 drivers/net/ionic/ionic_main.c  |  441 
 drivers/net/ionic/ionic_osdep.h |   64 +
 drivers/net/ionic/ionic_regs.h  |  142 ++
 drivers/net/ionic/ionic_rx_filter.c |  139 ++
 drivers/net/ionic/ionic_rx_filter.h |   47 +
 drivers/net/ionic/ionic_rxtx.c  | 1082 
 drivers/net/ionic/ionic_rxtx.h  |   44 +
 drivers/net/ionic/meson.build   |   13 +
 drivers/net/ionic/rte_pmd_ionic_version.map |5 +
 mk/rte.app.mk   |1 +
 32 files changed, 8864 insertions(+)
 create mode 100644 doc/guides/nics/features/ionic.ini
 create mode 100644 doc/guides/nics/ionic.rst
 create mode 100644 drivers/net/ionic/Makefile
 create mode 100644 drivers/net/ionic/ionic.h
 create mode 100644 drivers/net/ionic/ionic_dev.c
 create mode 100644 drivers/net/ionic/ionic_dev.h
 create mode 100644 drivers/net/ionic/ionic_ethdev.c
 create mode 100644 drivers/net/ionic/ionic_ethdev.h
 create mode 100644 drivers/net/ionic/ionic_if.h
 create mode 100644 drivers/net/ionic/ionic_lif.c
 create mode 100644 drivers/net/ionic/ionic_lif.h
 create mode 100644 drivers/net/ionic/ionic_logs.h
 create mode 100644 drivers/net/ionic/ionic_mac_api.c
 create mode 100644 drivers/net/ionic/ionic_mac_api.h
 create mode 100644 drivers/net/ionic/ionic_main.c
 create mode 100644 drivers/net/ionic/ionic_osdep.h
 create mode 100644 drivers/net/ionic/ionic_regs.h
 create mode 100644 drivers/net/ionic/ionic_rx_filter.c
 create mode 100644 drivers/net/ionic/ionic_rx_filter.h
 create mode 100644 drivers/net/ionic/ionic_rxtx.c
 create mode 100644 drivers/net/ionic/ionic_rxtx.h
 create mode 100644 drivers/net/ionic/meson.build
 create mode 100644 drivers/net/ionic/rte_pmd_ionic_version.map

-- 
2.17.1



[dpdk-dev] [PATCH v5 02/17] net/ionic: add hardware structures definitions

2020-01-19 Thread Alfredo Cardigliano
Add hardware structures and message commands definitions for
Pensando network adapters.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 drivers/net/ionic/ionic_if.h | 2491 ++
 1 file changed, 2491 insertions(+)
 create mode 100644 drivers/net/ionic/ionic_if.h

diff --git a/drivers/net/ionic/ionic_if.h b/drivers/net/ionic/ionic_if.h
new file mode 100644
index 0..b3d1c85dc
--- /dev/null
+++ b/drivers/net/ionic/ionic_if.h
@@ -0,0 +1,2491 @@
+/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB OR BSD-3-Clause */
+/* Copyright (c) 2017-2019 Pensando Systems, Inc.  All rights reserved. */
+
+#ifndef _IONIC_IF_H_
+#define _IONIC_IF_H_
+
+#pragma pack(push, 1)
+
+#define IONIC_DEV_INFO_SIGNATURE   0x44455649  /* 'DEVI' */
+#define IONIC_DEV_INFO_VERSION 1
+#define IONIC_IFNAMSIZ 16
+
+/**
+ * Commands
+ */
+enum ionic_cmd_opcode {
+   IONIC_CMD_NOP   = 0,
+
+   /* Device commands */
+   IONIC_CMD_IDENTIFY  = 1,
+   IONIC_CMD_INIT  = 2,
+   IONIC_CMD_RESET = 3,
+   IONIC_CMD_GETATTR   = 4,
+   IONIC_CMD_SETATTR   = 5,
+
+   /* Port commands */
+   IONIC_CMD_PORT_IDENTIFY = 10,
+   IONIC_CMD_PORT_INIT = 11,
+   IONIC_CMD_PORT_RESET= 12,
+   IONIC_CMD_PORT_GETATTR  = 13,
+   IONIC_CMD_PORT_SETATTR  = 14,
+
+   /* LIF commands */
+   IONIC_CMD_LIF_IDENTIFY  = 20,
+   IONIC_CMD_LIF_INIT  = 21,
+   IONIC_CMD_LIF_RESET = 22,
+   IONIC_CMD_LIF_GETATTR   = 23,
+   IONIC_CMD_LIF_SETATTR   = 24,
+
+   IONIC_CMD_RX_MODE_SET   = 30,
+   IONIC_CMD_RX_FILTER_ADD = 31,
+   IONIC_CMD_RX_FILTER_DEL = 32,
+
+   /* Queue commands */
+   IONIC_CMD_Q_INIT= 40,
+   IONIC_CMD_Q_CONTROL = 41,
+
+   /* RDMA commands */
+   IONIC_CMD_RDMA_RESET_LIF= 50,
+   IONIC_CMD_RDMA_CREATE_EQ= 51,
+   IONIC_CMD_RDMA_CREATE_CQ= 52,
+   IONIC_CMD_RDMA_CREATE_ADMINQ= 53,
+
+   /* QoS commands */
+   IONIC_CMD_QOS_CLASS_IDENTIFY= 240,
+   IONIC_CMD_QOS_CLASS_INIT= 241,
+   IONIC_CMD_QOS_CLASS_RESET   = 242,
+
+   /* Firmware commands */
+   IONIC_CMD_FW_DOWNLOAD   = 254,
+   IONIC_CMD_FW_CONTROL= 255,
+};
+
+/**
+ * Command Return codes
+ */
+enum ionic_status_code {
+   IONIC_RC_SUCCESS= 0,/* Success */
+   IONIC_RC_EVERSION   = 1,/* Incorrect version for request */
+   IONIC_RC_EOPCODE= 2,/* Invalid cmd opcode */
+   IONIC_RC_EIO= 3,/* I/O error */
+   IONIC_RC_EPERM  = 4,/* Permission denied */
+   IONIC_RC_EQID   = 5,/* Bad qid */
+   IONIC_RC_EQTYPE = 6,/* Bad qtype */
+   IONIC_RC_ENOENT = 7,/* No such element */
+   IONIC_RC_EINTR  = 8,/* operation interrupted */
+   IONIC_RC_EAGAIN = 9,/* Try again */
+   IONIC_RC_ENOMEM = 10,   /* Out of memory */
+   IONIC_RC_EFAULT = 11,   /* Bad address */
+   IONIC_RC_EBUSY  = 12,   /* Device or resource busy */
+   IONIC_RC_EEXIST = 13,   /* object already exists */
+   IONIC_RC_EINVAL = 14,   /* Invalid argument */
+   IONIC_RC_ENOSPC = 15,   /* No space left or alloc failure */
+   IONIC_RC_ERANGE = 16,   /* Parameter out of range */
+   IONIC_RC_BAD_ADDR   = 17,   /* Descriptor contains a bad ptr */
+   IONIC_RC_DEV_CMD= 18,   /* Device cmd attempted on AdminQ */
+   IONIC_RC_ENOSUPP= 19,   /* Operation not supported */
+   IONIC_RC_ERROR  = 29,   /* Generic error */
+
+   IONIC_RC_ERDMA  = 30,   /* Generic RDMA error */
+};
+
+enum ionic_notifyq_opcode {
+   IONIC_EVENT_LINK_CHANGE = 1,
+   IONIC_EVENT_RESET   = 2,
+   IONIC_EVENT_HEARTBEAT   = 3,
+   IONIC_EVENT_LOG = 4,
+};
+
+/**
+ * struct cmd - General admin command format
+ * @opcode: Opcode for the command
+ * @lif_index:  LIF index
+ * @cmd_data:   Opcode-specific command bytes
+ */
+struct ionic_admin_cmd {
+   u8 opcode;
+   u8 rsvd;
+   __le16 lif_index;
+   u8 cmd_data[60];
+};
+
+/**
+ * struct ionic_admin_comp - General admin command completion format
+ * @status: The status of the command (enum status_code)
+ * @comp_index: The index in the descriptor ring for whi

[dpdk-dev] [PATCH v5 01/17] net/ionic: add skeleton

2020-01-19 Thread Alfredo Cardigliano
Add makefile and config file options to compile the Pensando ionic PMD.
Add feature and version map file.
Update maintainers file.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 MAINTAINERS |  6 +++
 config/common_armv8a_linux  |  2 +
 config/common_base  |  5 +++
 config/defconfig_arm-armv7a-linuxapp-gcc|  1 +
 config/defconfig_ppc_64-power8-linuxapp-gcc |  1 +
 doc/guides/nics/features/ionic.ini  |  8 
 doc/guides/nics/index.rst   |  1 +
 doc/guides/nics/ionic.rst   | 41 +
 doc/guides/rel_notes/release_20_02.rst  |  4 ++
 drivers/net/Makefile|  1 +
 drivers/net/ionic/Makefile  | 25 +
 drivers/net/ionic/meson.build   |  6 +++
 drivers/net/ionic/rte_pmd_ionic_version.map |  5 +++
 mk/rte.app.mk   |  1 +
 14 files changed, 107 insertions(+)
 create mode 100644 doc/guides/nics/features/ionic.ini
 create mode 100644 doc/guides/nics/ionic.rst
 create mode 100644 drivers/net/ionic/Makefile
 create mode 100644 drivers/net/ionic/meson.build
 create mode 100644 drivers/net/ionic/rte_pmd_ionic_version.map

diff --git a/MAINTAINERS b/MAINTAINERS
index 8eda5f811..e9570da4b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -806,6 +806,12 @@ F: doc/guides/nics/pfe.rst
 F: drivers/net/pfe/
 F: doc/guides/nics/features/pfe.ini
 
+Pensando ionic
+M: Alfredo Cardigliano 
+F: drivers/net/ionic/
+F: doc/guides/nics/ionic.rst
+F: doc/guides/nics/features/ionic.ini
+
 QLogic bnx2x
 M: Rasesh Mody 
 M: Shahed Shaikh 
diff --git a/config/common_armv8a_linux b/config/common_armv8a_linux
index 782877bb2..2057d9138 100644
--- a/config/common_armv8a_linux
+++ b/config/common_armv8a_linux
@@ -42,3 +42,5 @@ CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=n
 CONFIG_RTE_LIBRTE_PFE_PMD=y
 
 CONFIG_RTE_SCHED_VECTOR=n
+
+CONFIG_RTE_LIBRTE_IONIC_PMD=n
diff --git a/config/common_base b/config/common_base
index 7dec7ed45..626c83d05 100644
--- a/config/common_base
+++ b/config/common_base
@@ -277,6 +277,11 @@ CONFIG_RTE_LIBRTE_E1000_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_E1000_DEBUG_TX_FREE=n
 CONFIG_RTE_LIBRTE_E1000_PF_DISABLE_STRIP_CRC=n
 
+#
+# Compile Pensando IONIC PMD driver
+#
+CONFIG_RTE_LIBRTE_IONIC_PMD=y
+
 #
 # Compile burst-oriented HINIC PMD driver
 #
diff --git a/config/defconfig_arm-armv7a-linuxapp-gcc 
b/config/defconfig_arm-armv7a-linuxapp-gcc
index c91423f0e..6ac7f47e4 100644
--- a/config/defconfig_arm-armv7a-linuxapp-gcc
+++ b/config/defconfig_arm-armv7a-linuxapp-gcc
@@ -57,3 +57,4 @@ CONFIG_RTE_LIBRTE_NFP_PMD=n
 CONFIG_RTE_LIBRTE_HINIC_PMD=n
 CONFIG_RTE_LIBRTE_HNS3_PMD=n
 CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=n
+CONFIG_RTE_LIBRTE_IONIC_PMD=n
diff --git a/config/defconfig_ppc_64-power8-linuxapp-gcc 
b/config/defconfig_ppc_64-power8-linuxapp-gcc
index b7b9d6f48..c917c4774 100644
--- a/config/defconfig_ppc_64-power8-linuxapp-gcc
+++ b/config/defconfig_ppc_64-power8-linuxapp-gcc
@@ -32,3 +32,4 @@ CONFIG_RTE_LIBRTE_AVP_PMD=n
 CONFIG_RTE_LIBRTE_HINIC_PMD=n
 CONFIG_RTE_LIBRTE_HNS3_PMD=n
 CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=n
+CONFIG_RTE_LIBRTE_IONIC_PMD=n
diff --git a/doc/guides/nics/features/ionic.ini 
b/doc/guides/nics/features/ionic.ini
new file mode 100644
index 0..3a92eedc7
--- /dev/null
+++ b/doc/guides/nics/features/ionic.ini
@@ -0,0 +1,8 @@
+;
+; Supported features of the 'ionic' network poll mode driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+x86-64   = Y
+Usage doc= Y
diff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst
index 8c540c0bb..6d88028ef 100644
--- a/doc/guides/nics/index.rst
+++ b/doc/guides/nics/index.rst
@@ -32,6 +32,7 @@ Network Interface Controller Drivers
 i40e
 ice
 igb
+ionic
 ipn3ke
 ixgbe
 intel_vf
diff --git a/doc/guides/nics/ionic.rst b/doc/guides/nics/ionic.rst
new file mode 100644
index 0..787123df5
--- /dev/null
+++ b/doc/guides/nics/ionic.rst
@@ -0,0 +1,41 @@
+..  SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
+Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
+
+IONIC Driver
+
+
+The ionic driver provides support for Pensando server adapters.
+It currently supports the below models:
+
+- `Naples DSC-25 
`_
+- `Naples DSC-100 
`_
+
+Please visit https://pensando.io for more information.
+
+Identifying the Adapter
+---
+
+To find if one or more Pensando PCI Ethernet devices are installed
+on the host, check for the PCI devices:
+
+   .. code-block:: console
+
+  lspci -d 1dd8:
+  b5:00.0 Ethernet controller: Device 1dd8:1002
+  b6:00.0 Ethernet controller: Device 1dd8:1002
+
+Pre-Installation Configuration
+---

[dpdk-dev] [PATCH v5 03/17] net/ionic: add log

2020-01-19 Thread Alfredo Cardigliano
Add debug options to the config file.
Define macros used for logs and make use of config file options
to enable them.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 drivers/net/ionic/Makefile   |  2 +-
 drivers/net/ionic/ionic_ethdev.c | 14 ++
 drivers/net/ionic/ionic_logs.h   | 26 ++
 drivers/net/ionic/meson.build|  1 +
 4 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/ionic/ionic_ethdev.c
 create mode 100644 drivers/net/ionic/ionic_logs.h

diff --git a/drivers/net/ionic/Makefile b/drivers/net/ionic/Makefile
index 9c2f9cf2e..baa34b055 100644
--- a/drivers/net/ionic/Makefile
+++ b/drivers/net/ionic/Makefile
@@ -20,6 +20,6 @@ LDLIBS += -lrte_bus_pci
 #
 # all source are stored in SRCS-y
 #
-SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) +=
+SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_ethdev.c
 
 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
new file mode 100644
index 0..9839903cb
--- /dev/null
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
+ * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
+ */
+
+#include "ionic_logs.h"
+
+int ionic_logtype;
+
+RTE_INIT(ionic_init_log)
+{
+   ionic_logtype = rte_log_register("pmd.net.ionic");
+   if (ionic_logtype >= 0)
+   rte_log_set_level(ionic_logtype, RTE_LOG_NOTICE);
+}
diff --git a/drivers/net/ionic/ionic_logs.h b/drivers/net/ionic/ionic_logs.h
new file mode 100644
index 0..bc10ad174
--- /dev/null
+++ b/drivers/net/ionic/ionic_logs.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
+ * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
+ */
+
+#ifndef _IONIC_LOGS_H_
+#define _IONIC_LOGS_H_
+
+#include 
+
+extern int ionic_logtype;
+
+#define IONIC_PRINT(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
+   ionic_logtype, "%s(): " fmt "\n", __func__, ##args)
+
+#define IONIC_PRINT_CALL() IONIC_PRINT(DEBUG, " >>")
+
+#ifndef IONIC_WARN_ON
+#define IONIC_WARN_ON(x) do { \
+   int ret = !!(x); \
+   if (unlikely(ret)) \
+   IONIC_PRINT(WARNING, "WARN_ON: \"" #x "\" at %s:%d\n", \
+   __func__, __LINE__); \
+} while (0)
+#endif
+
+#endif /* _IONIC_LOGS_H_ */
diff --git a/drivers/net/ionic/meson.build b/drivers/net/ionic/meson.build
index 5386e23ca..f5e3c36c9 100644
--- a/drivers/net/ionic/meson.build
+++ b/drivers/net/ionic/meson.build
@@ -2,5 +2,6 @@
 # Copyright(c) 2019 Pensando
 
 sources = files(
+   'ionic_ethdev.c'
 )
 
-- 
2.17.1



[dpdk-dev] [PATCH v5 06/17] net/ionic: add basic lif support

2020-01-19 Thread Alfredo Cardigliano
Initialize LIFs (Logical Interfaces) which represents
external connections. The NIC can multiplex many LIFs
to a single port, but in most setups, LIF0 is the
primary control for the port.
Create a device for each LIF.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 drivers/net/ionic/Makefile   |   4 +
 drivers/net/ionic/ionic.h|   5 ++
 drivers/net/ionic/ionic_dev.c|  38 
 drivers/net/ionic/ionic_dev.h|   8 ++
 drivers/net/ionic/ionic_ethdev.c | 134 
 drivers/net/ionic/ionic_ethdev.h |  14 +++
 drivers/net/ionic/ionic_lif.c| 144 +++
 drivers/net/ionic/ionic_lif.h|  48 +++
 drivers/net/ionic/meson.build|   1 +
 9 files changed, 396 insertions(+)
 create mode 100644 drivers/net/ionic/ionic_ethdev.h
 create mode 100644 drivers/net/ionic/ionic_lif.c
 create mode 100644 drivers/net/ionic/ionic_lif.h

diff --git a/drivers/net/ionic/Makefile b/drivers/net/ionic/Makefile
index 31abe5b95..2dc88cdd5 100644
--- a/drivers/net/ionic/Makefile
+++ b/drivers/net/ionic/Makefile
@@ -8,6 +8,9 @@ include $(RTE_SDK)/mk/rte.vars.mk
 #
 LIB = librte_pmd_ionic.a
 
+# Required to use rte_eth_dev_create and rte_eth_dev_destroy
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
@@ -23,6 +26,7 @@ LDLIBS += -lrte_bus_pci
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_mac_api.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_dev.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_lif.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_main.c
 
 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/ionic/ionic.h b/drivers/net/ionic/ionic.h
index 1adea8f7d..964589ed5 100644
--- a/drivers/net/ionic/ionic.h
+++ b/drivers/net/ionic/ionic.h
@@ -50,7 +50,12 @@ struct ionic_adapter {
struct ionic_dev idev;
struct ionic_dev_bar bars[IONIC_BARS_MAX];
struct ionic_identity   ident;
+   struct ionic_lif *lifs[IONIC_LIFS_MAX];
uint32_t num_bars;
+   uint32_t nlifs;
+   uint32_t max_ntxqs_per_lif;
+   uint32_t max_nrxqs_per_lif;
+   uint32_t nintrs;
bool is_mgmt_nic;
struct rte_pci_device *pci_dev;
LIST_ENTRY(ionic_adapter) pci_adapters;
diff --git a/drivers/net/ionic/ionic_dev.c b/drivers/net/ionic/ionic_dev.c
index d74834122..c63709ee8 100644
--- a/drivers/net/ionic/ionic_dev.c
+++ b/drivers/net/ionic/ionic_dev.c
@@ -259,3 +259,41 @@ ionic_dev_cmd_port_loopback(struct ionic_dev *idev, 
uint8_t loopback_mode)
 
ionic_dev_cmd_go(idev, &cmd);
 }
+
+/* LIF commands */
+
+void
+ionic_dev_cmd_lif_identify(struct ionic_dev *idev, uint8_t type, uint8_t ver)
+{
+   union ionic_dev_cmd cmd = {
+   .lif_identify.opcode = IONIC_CMD_LIF_IDENTIFY,
+   .lif_identify.type = type,
+   .lif_identify.ver = ver,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+void
+ionic_dev_cmd_lif_init(struct ionic_dev *idev, uint16_t lif_index,
+  rte_iova_t info_pa)
+{
+   union ionic_dev_cmd cmd = {
+   .lif_init.opcode = IONIC_CMD_LIF_INIT,
+   .lif_init.index = lif_index,
+   .lif_init.info_pa = info_pa,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+void
+ionic_dev_cmd_lif_reset(struct ionic_dev *idev, uint16_t lif_index)
+{
+   union ionic_dev_cmd cmd = {
+   .lif_init.opcode = IONIC_CMD_LIF_RESET,
+   .lif_init.index = lif_index,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
diff --git a/drivers/net/ionic/ionic_dev.h b/drivers/net/ionic/ionic_dev.h
index 75c50d4cb..afcfcbf56 100644
--- a/drivers/net/ionic/ionic_dev.h
+++ b/drivers/net/ionic/ionic_dev.h
@@ -9,6 +9,8 @@
 #include "ionic_if.h"
 #include "ionic_regs.h"
 
+#define IONIC_LIFS_MAX 1024
+
 #define IONIC_DEVCMD_TIMEOUT   30 /* devcmd_timeout */
 #defineIONIC_ALIGN 4096
 
@@ -142,4 +144,10 @@ void ionic_dev_cmd_port_pause(struct ionic_dev *idev, 
uint8_t pause_type);
 void ionic_dev_cmd_port_loopback(struct ionic_dev *idev,
uint8_t loopback_mode);
 
+void ionic_dev_cmd_lif_identify(struct ionic_dev *idev, uint8_t type,
+   uint8_t ver);
+void ionic_dev_cmd_lif_init(struct ionic_dev *idev, uint16_t lif_index,
+   rte_iova_t addr);
+void ionic_dev_cmd_lif_reset(struct ionic_dev *idev, uint16_t lif_index);
+
 #endif /* _IONIC_DEV_H_ */
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index b0ae7b076..f58d2d3a6 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -7,11 +7,17 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "ionic_logs.h"
 #include "ionic.h"
 #include "ionic_dev.h"
 #include "ionic_mac_api.h"
+#include "ionic_lif.h"
+#include "ionic_ethdev.h"
+
+static int  eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params);
+static int  eth_i

[dpdk-dev] [PATCH v5 04/17] net/ionic: register and initialize the adapter

2020-01-19 Thread Alfredo Cardigliano
Register the Pensando ionic PMD (net_ionic) and define initial probe
and remove callbacks with adapter initialization.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 doc/guides/nics/features/ionic.ini |   2 +
 drivers/net/ionic/Makefile |   3 +
 drivers/net/ionic/ionic.h  |  64 +
 drivers/net/ionic/ionic_dev.c  | 134 +++
 drivers/net/ionic/ionic_dev.h  | 127 ++
 drivers/net/ionic/ionic_ethdev.c   | 117 
 drivers/net/ionic/ionic_mac_api.c  |  61 +
 drivers/net/ionic/ionic_mac_api.h  |  13 +++
 drivers/net/ionic/ionic_main.c | 130 ++
 drivers/net/ionic/ionic_osdep.h|  64 +
 drivers/net/ionic/ionic_regs.h | 142 +
 drivers/net/ionic/meson.build  |   5 +-
 12 files changed, 861 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/ionic/ionic.h
 create mode 100644 drivers/net/ionic/ionic_dev.c
 create mode 100644 drivers/net/ionic/ionic_dev.h
 create mode 100644 drivers/net/ionic/ionic_mac_api.c
 create mode 100644 drivers/net/ionic/ionic_mac_api.h
 create mode 100644 drivers/net/ionic/ionic_main.c
 create mode 100644 drivers/net/ionic/ionic_osdep.h
 create mode 100644 drivers/net/ionic/ionic_regs.h

diff --git a/doc/guides/nics/features/ionic.ini 
b/doc/guides/nics/features/ionic.ini
index 3a92eedc7..6915d9c42 100644
--- a/doc/guides/nics/features/ionic.ini
+++ b/doc/guides/nics/features/ionic.ini
@@ -4,5 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Linux UIO= Y
+Linux VFIO   = Y
 x86-64   = Y
 Usage doc= Y
diff --git a/drivers/net/ionic/Makefile b/drivers/net/ionic/Makefile
index baa34b055..31abe5b95 100644
--- a/drivers/net/ionic/Makefile
+++ b/drivers/net/ionic/Makefile
@@ -20,6 +20,9 @@ LDLIBS += -lrte_bus_pci
 #
 # all source are stored in SRCS-y
 #
+SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_mac_api.c
+SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_dev.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_main.c
 
 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/ionic/ionic.h b/drivers/net/ionic/ionic.h
new file mode 100644
index 0..a415dd80a
--- /dev/null
+++ b/drivers/net/ionic/ionic.h
@@ -0,0 +1,64 @@
+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
+ * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
+ */
+
+#ifndef _IONIC_H_
+#define _IONIC_H_
+
+#include 
+#include 
+
+#include "ionic_dev.h"
+#include "ionic_if.h"
+#include "ionic_osdep.h"
+
+#define IONIC_DRV_NAME "ionic"
+#define IONIC_DRV_DESCRIPTION  "Pensando Ethernet NIC Driver"
+#define IONIC_DRV_VERSION  "0.11.0-49"
+
+/* Vendor ID */
+#define IONIC_PENSANDO_VENDOR_ID   0x1dd8
+
+/* Device IDs */
+#define IONIC_DEV_ID_ETH_PF0x1002
+#define IONIC_DEV_ID_ETH_VF0x1003
+#define IONIC_DEV_ID_ETH_MGMT  0x1004
+
+enum ionic_mac_type {
+   IONIC_MAC_UNKNOWN = 0,
+   IONIC_MAC_CAPRI,
+   IONIC_NUM_MACS
+};
+
+struct ionic_mac_info {
+   enum ionic_mac_type type;
+};
+
+struct ionic_hw {
+   struct ionic_mac_info mac;
+   uint16_t device_id;
+   uint16_t vendor_id;
+};
+
+/*
+ * Structure to store private data for each driver instance (for each adapter).
+ */
+struct ionic_adapter {
+   struct ionic_hw hw;
+   struct ionic_dev idev;
+   struct ionic_dev_bar bars[IONIC_BARS_MAX];
+   struct ionic_identity   ident;
+   uint32_t num_bars;
+   bool is_mgmt_nic;
+   struct rte_pci_device *pci_dev;
+   LIST_ENTRY(ionic_adapter) pci_adapters;
+};
+
+int ionic_dev_cmd_wait_check(struct ionic_dev *idev, unsigned long max_wait);
+int ionic_setup(struct ionic_adapter *adapter);
+
+int ionic_identify(struct ionic_adapter *adapter);
+int ionic_init(struct ionic_adapter *adapter);
+int ionic_reset(struct ionic_adapter *adapter);
+
+#endif /* _IONIC_H_ */
diff --git a/drivers/net/ionic/ionic_dev.c b/drivers/net/ionic/ionic_dev.c
new file mode 100644
index 0..a8ad5358f
--- /dev/null
+++ b/drivers/net/ionic/ionic_dev.c
@@ -0,0 +1,134 @@
+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
+ * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
+ */
+
+#include 
+
+#include "ionic_dev.h"
+#include "ionic.h"
+
+int
+ionic_dev_setup(struct ionic_adapter *adapter)
+{
+   struct ionic_dev_bar *bar = adapter->bars;
+   unsigned int num_bars = adapter->num_bars;
+   struct ionic_dev *idev = &adapter->idev;
+   uint32_t sig;
+   u_char *bar0_base;
+
+   /* BAR0: dev_cmd and interrupts */
+   if (num_bars < 1) {
+   IONIC_PRINT(ERR, "No bars found, aborting");
+   return -EFAULT;
+   }
+
+   if (bar->len < IONIC_BAR0_SIZE) {
+   IONIC_PRINT(ERR,

[dpdk-dev] [PATCH v5 07/17] net/ionic: add doorbells

2020-01-19 Thread Alfredo Cardigliano
Doorbell registers are used by the driver to signal to the NIC
that requests are waiting on the message queues.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 drivers/net/ionic/ionic_dev.c | 15 +++
 drivers/net/ionic/ionic_dev.h | 18 ++
 drivers/net/ionic/ionic_lif.c | 23 +++
 drivers/net/ionic/ionic_lif.h |  2 ++
 4 files changed, 58 insertions(+)

diff --git a/drivers/net/ionic/ionic_dev.c b/drivers/net/ionic/ionic_dev.c
index c63709ee8..13e99ace6 100644
--- a/drivers/net/ionic/ionic_dev.c
+++ b/drivers/net/ionic/ionic_dev.c
@@ -5,6 +5,7 @@
 #include 
 
 #include "ionic_dev.h"
+#include "ionic_lif.h"
 #include "ionic.h"
 
 int
@@ -297,3 +298,17 @@ ionic_dev_cmd_lif_reset(struct ionic_dev *idev, uint16_t 
lif_index)
 
ionic_dev_cmd_go(idev, &cmd);
 }
+
+int
+ionic_db_page_num(struct ionic_lif *lif, int pid)
+{
+   return (lif->index * 0) + pid;
+}
+
+void
+ionic_intr_init(struct ionic_dev *idev, struct ionic_intr_info *intr,
+   unsigned long index)
+{
+   ionic_intr_clean(idev->intr_ctrl, index);
+   intr->index = index;
+}
diff --git a/drivers/net/ionic/ionic_dev.h b/drivers/net/ionic/ionic_dev.h
index afcfcbf56..d6f0669c3 100644
--- a/drivers/net/ionic/ionic_dev.h
+++ b/drivers/net/ionic/ionic_dev.h
@@ -121,6 +121,22 @@ struct ionic_dev {
uint32_t port_info_sz;
 };
 
+#define IONIC_INTR_INDEX_NOT_ASSIGNED  (-1)
+#define IONIC_INTR_NAME_MAX_SZ (32)
+
+struct ionic_intr_info {
+   char name[IONIC_INTR_NAME_MAX_SZ];
+   int index;
+   uint32_t vector;
+   struct ionic_intr __iomem *ctrl;
+};
+
+struct ionic_lif;
+struct ionic_adapter;
+
+void ionic_intr_init(struct ionic_dev *idev, struct ionic_intr_info *intr,
+   unsigned long index);
+
 int ionic_dev_setup(struct ionic_adapter *adapter);
 
 void ionic_dev_cmd_go(struct ionic_dev *idev, union ionic_dev_cmd *cmd);
@@ -150,4 +166,6 @@ void ionic_dev_cmd_lif_init(struct ionic_dev *idev, 
uint16_t lif_index,
rte_iova_t addr);
 void ionic_dev_cmd_lif_reset(struct ionic_dev *idev, uint16_t lif_index);
 
+int ionic_db_page_num(struct ionic_lif *lif, int pid);
+
 #endif /* _IONIC_DEV_H_ */
diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 2559b4c16..9cdab3250 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -10,15 +10,38 @@
 #include "ionic_lif.h"
 #include "ionic_ethdev.h"
 
+static void *
+ionic_bus_map_dbpage(struct ionic_adapter *adapter, int page_num)
+{
+   char *vaddr = adapter->bars[IONIC_PCI_BAR_DBELL].vaddr;
+
+   if (adapter->num_bars <= IONIC_PCI_BAR_DBELL)
+   return NULL;
+
+   return (void *)&vaddr[page_num << PAGE_SHIFT];
+}
+
 int
 ionic_lif_alloc(struct ionic_lif *lif)
 {
+   struct ionic_adapter *adapter = lif->adapter;
uint32_t socket_id = rte_socket_id();
+   int dbpage_num;
 
snprintf(lif->name, sizeof(lif->name), "lif%u", lif->index);
 
IONIC_PRINT(DEBUG, "Allocating Lif Info");
 
+   lif->kern_pid = 0;
+
+   dbpage_num = ionic_db_page_num(lif, 0);
+
+   lif->kern_dbpage = ionic_bus_map_dbpage(adapter, dbpage_num);
+   if (!lif->kern_dbpage) {
+   IONIC_PRINT(ERR, "Cannot map dbpage, aborting");
+   return -ENOMEM;
+   }
+
lif->info_sz = RTE_ALIGN(sizeof(*lif->info), PAGE_SIZE);
 
lif->info_z = rte_eth_dma_zone_reserve(lif->eth_dev,
diff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h
index a75e420c6..6e3233d1d 100644
--- a/drivers/net/ionic/ionic_lif.h
+++ b/drivers/net/ionic/ionic_lif.h
@@ -24,6 +24,8 @@ struct ionic_lif {
uint32_t index;
uint32_t hw_index;
uint32_t state;
+   uint32_t kern_pid;
+   struct ionic_doorbell __iomem *kern_dbpage;
char name[IONIC_LIF_NAME_MAX_SZ];
uint32_t info_sz;
struct ionic_lif_info *info;
-- 
2.17.1



[dpdk-dev] [PATCH v5 05/17] net/ionic: add port management commands

2020-01-19 Thread Alfredo Cardigliano
Add port management commands that apply to the physical
ports associated with the PCI device, which might be
shared among several logical interfaces.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 drivers/net/ionic/ionic.h|   6 ++
 drivers/net/ionic/ionic_dev.c| 127 +++
 drivers/net/ionic/ionic_dev.h|  18 +
 drivers/net/ionic/ionic_ethdev.c |  14 
 drivers/net/ionic/ionic_main.c   | 127 +++
 5 files changed, 292 insertions(+)

diff --git a/drivers/net/ionic/ionic.h b/drivers/net/ionic/ionic.h
index a415dd80a..1adea8f7d 100644
--- a/drivers/net/ionic/ionic.h
+++ b/drivers/net/ionic/ionic.h
@@ -8,6 +8,8 @@
 #include 
 #include 
 
+#include 
+
 #include "ionic_dev.h"
 #include "ionic_if.h"
 #include "ionic_osdep.h"
@@ -61,4 +63,8 @@ int ionic_identify(struct ionic_adapter *adapter);
 int ionic_init(struct ionic_adapter *adapter);
 int ionic_reset(struct ionic_adapter *adapter);
 
+int ionic_port_identify(struct ionic_adapter *adapter);
+int ionic_port_init(struct ionic_adapter *adapter);
+int ionic_port_reset(struct ionic_adapter *adapter);
+
 #endif /* _IONIC_H_ */
diff --git a/drivers/net/ionic/ionic_dev.c b/drivers/net/ionic/ionic_dev.c
index a8ad5358f..d74834122 100644
--- a/drivers/net/ionic/ionic_dev.c
+++ b/drivers/net/ionic/ionic_dev.c
@@ -132,3 +132,130 @@ ionic_dev_cmd_reset(struct ionic_dev *idev)
 
ionic_dev_cmd_go(idev, &cmd);
 }
+
+/* Port commands */
+
+void
+ionic_dev_cmd_port_identify(struct ionic_dev *idev)
+{
+   union ionic_dev_cmd cmd = {
+   .port_init.opcode = IONIC_CMD_PORT_IDENTIFY,
+   .port_init.index = 0,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+void
+ionic_dev_cmd_port_init(struct ionic_dev *idev)
+{
+   union ionic_dev_cmd cmd = {
+   .port_init.opcode = IONIC_CMD_PORT_INIT,
+   .port_init.index = 0,
+   .port_init.info_pa = idev->port_info_pa,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+void
+ionic_dev_cmd_port_reset(struct ionic_dev *idev)
+{
+   union ionic_dev_cmd cmd = {
+   .port_reset.opcode = IONIC_CMD_PORT_RESET,
+   .port_reset.index = 0,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+void
+ionic_dev_cmd_port_state(struct ionic_dev *idev, uint8_t state)
+{
+   union ionic_dev_cmd cmd = {
+   .port_setattr.opcode = IONIC_CMD_PORT_SETATTR,
+   .port_setattr.index = 0,
+   .port_setattr.attr = IONIC_PORT_ATTR_STATE,
+   .port_setattr.state = state,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+void
+ionic_dev_cmd_port_speed(struct ionic_dev *idev, uint32_t speed)
+{
+   union ionic_dev_cmd cmd = {
+   .port_setattr.opcode = IONIC_CMD_PORT_SETATTR,
+   .port_setattr.index = 0,
+   .port_setattr.attr = IONIC_PORT_ATTR_SPEED,
+   .port_setattr.speed = speed,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+void
+ionic_dev_cmd_port_mtu(struct ionic_dev *idev, uint32_t mtu)
+{
+   union ionic_dev_cmd cmd = {
+   .port_setattr.opcode = IONIC_CMD_PORT_SETATTR,
+   .port_setattr.index = 0,
+   .port_setattr.attr = IONIC_PORT_ATTR_MTU,
+   .port_setattr.mtu = mtu,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+void
+ionic_dev_cmd_port_autoneg(struct ionic_dev *idev, uint8_t an_enable)
+{
+   union ionic_dev_cmd cmd = {
+   .port_setattr.opcode = IONIC_CMD_PORT_SETATTR,
+   .port_setattr.index = 0,
+   .port_setattr.attr = IONIC_PORT_ATTR_AUTONEG,
+   .port_setattr.an_enable = an_enable,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+void
+ionic_dev_cmd_port_fec(struct ionic_dev *idev, uint8_t fec_type)
+{
+   union ionic_dev_cmd cmd = {
+   .port_setattr.opcode = IONIC_CMD_PORT_SETATTR,
+   .port_setattr.index = 0,
+   .port_setattr.attr = IONIC_PORT_ATTR_FEC,
+   .port_setattr.fec_type = fec_type,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+void
+ionic_dev_cmd_port_pause(struct ionic_dev *idev, uint8_t pause_type)
+{
+   union ionic_dev_cmd cmd = {
+   .port_setattr.opcode = IONIC_CMD_PORT_SETATTR,
+   .port_setattr.index = 0,
+   .port_setattr.attr = IONIC_PORT_ATTR_PAUSE,
+   .port_setattr.pause_type = pause_type,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+void
+ionic_dev_cmd_port_loopback(struct ionic_dev *idev, uint8_t loopback_mode)
+{
+   union ionic_dev_cmd cmd = {
+   .port_setattr.opcode = IONIC_CMD_PORT_SETATTR,
+   .port_setattr.index = 0,
+   .port_setattr.attr = IONIC_PORT_ATTR_LOOPBACK,
+   .port_setattr.loopback_mode = loopback_mode,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
diff --git a/dr

[dpdk-dev] [PATCH v5 10/17] net/ionic: add basic port operations

2020-01-19 Thread Alfredo Cardigliano
Add support for port start/stop and handle basic features
including mtu and link up/down.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 doc/guides/nics/features/ionic.ini |   4 +
 drivers/net/ionic/ionic.h  |   1 +
 drivers/net/ionic/ionic_dev.h  |   3 +
 drivers/net/ionic/ionic_ethdev.c   | 319 +
 drivers/net/ionic/ionic_lif.c  | 266 +++-
 drivers/net/ionic/ionic_lif.h  |  10 +
 6 files changed, 602 insertions(+), 1 deletion(-)

diff --git a/doc/guides/nics/features/ionic.ini 
b/doc/guides/nics/features/ionic.ini
index 6915d9c42..c69e5cbed 100644
--- a/doc/guides/nics/features/ionic.ini
+++ b/doc/guides/nics/features/ionic.ini
@@ -4,6 +4,10 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
+Link status  = Y
+Link status event= Y
+MTU update   = Y
 Linux UIO= Y
 Linux VFIO   = Y
 x86-64   = Y
diff --git a/drivers/net/ionic/ionic.h b/drivers/net/ionic/ionic.h
index 0243ee4ca..184fc6da0 100644
--- a/drivers/net/ionic/ionic.h
+++ b/drivers/net/ionic/ionic.h
@@ -55,6 +55,7 @@ struct ionic_adapter {
uint32_t nlifs;
uint32_t max_ntxqs_per_lif;
uint32_t max_nrxqs_per_lif;
+   uint32_t max_mac_addrs;
uint32_t link_speed;
uint32_t nintrs;
bool intrs[IONIC_INTR_CTRL_REGS_MAX];
diff --git a/drivers/net/ionic/ionic_dev.h b/drivers/net/ionic/ionic_dev.h
index a832ff405..61576621b 100644
--- a/drivers/net/ionic/ionic_dev.h
+++ b/drivers/net/ionic/ionic_dev.h
@@ -9,6 +9,9 @@
 #include "ionic_if.h"
 #include "ionic_regs.h"
 
+#define IONIC_MIN_MTU  RTE_ETHER_MIN_MTU
+#define IONIC_MAX_MTU  9194
+
 #define IONIC_MAX_RING_DESC32768
 #define IONIC_MIN_RING_DESC16
 
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index b57dce1e5..e2c9d1d68 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -18,6 +18,17 @@
 
 static int  eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params);
 static int  eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev);
+static int  ionic_dev_info_get(struct rte_eth_dev *eth_dev,
+   struct rte_eth_dev_info *dev_info);
+static int  ionic_dev_configure(struct rte_eth_dev *dev);
+static int  ionic_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
+static int  ionic_dev_start(struct rte_eth_dev *dev);
+static void ionic_dev_stop(struct rte_eth_dev *dev);
+static void ionic_dev_close(struct rte_eth_dev *dev);
+static int  ionic_dev_set_link_up(struct rte_eth_dev *dev);
+static int  ionic_dev_set_link_down(struct rte_eth_dev *dev);
+static int  ionic_dev_link_update(struct rte_eth_dev *eth_dev,
+   int wait_to_complete);
 
 int ionic_logtype;
 
@@ -29,8 +40,113 @@ static const struct rte_pci_id pci_id_ionic_map[] = {
 };
 
 static const struct eth_dev_ops ionic_eth_dev_ops = {
+   .dev_infos_get  = ionic_dev_info_get,
+   .dev_configure  = ionic_dev_configure,
+   .mtu_set= ionic_dev_mtu_set,
+   .dev_start  = ionic_dev_start,
+   .dev_stop   = ionic_dev_stop,
+   .dev_close  = ionic_dev_close,
+   .link_update= ionic_dev_link_update,
+   .dev_set_link_up= ionic_dev_set_link_up,
+   .dev_set_link_down  = ionic_dev_set_link_down,
 };
 
+/*
+ * Set device link up, enable tx.
+ */
+static int
+ionic_dev_set_link_up(struct rte_eth_dev *eth_dev)
+{
+   struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
+   struct ionic_adapter *adapter = lif->adapter;
+   struct ionic_dev *idev = &adapter->idev;
+   int err;
+
+   IONIC_PRINT_CALL();
+
+   ionic_dev_cmd_port_state(idev, IONIC_PORT_ADMIN_STATE_UP);
+
+   err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
+   if (err) {
+   IONIC_PRINT(WARNING, "Failed to bring port UP");
+   return err;
+   }
+
+   return 0;
+}
+
+/*
+ * Set device link down, disable tx.
+ */
+static int
+ionic_dev_set_link_down(struct rte_eth_dev *eth_dev)
+{
+   struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
+   struct ionic_adapter *adapter = lif->adapter;
+   struct ionic_dev *idev = &adapter->idev;
+   int err;
+
+   IONIC_PRINT_CALL();
+
+   ionic_dev_cmd_port_state(idev, IONIC_PORT_ADMIN_STATE_DOWN);
+
+   err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
+   if (err) {
+   IONIC_PRINT(WARNING, "Failed to bring port DOWN");
+   return err;
+   }
+
+   return 0;
+}
+
+static int
+ionic_dev_link_update(struct rte_eth_dev *eth_dev,
+   int wait_to_complete __rte_unused)
+{
+   struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
+   struct ionic_adapter *adapter = lif->adapter;
+   struct rt

[dpdk-dev] [PATCH v5 11/17] net/ionic: add Rx filters support

2020-01-19 Thread Alfredo Cardigliano
Add support for managing RX filters based on MAC and VLAN.
Hardware cannot provide the list of filters, thus we keep
a local list.
Add support for promisc and allmulticast modes.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 doc/guides/nics/features/ionic.ini  |   4 +
 drivers/net/ionic/Makefile  |   1 +
 drivers/net/ionic/ionic_ethdev.c|   8 +
 drivers/net/ionic/ionic_lif.c   | 253 +++-
 drivers/net/ionic/ionic_lif.h   |  16 ++
 drivers/net/ionic/ionic_rx_filter.c | 139 +++
 drivers/net/ionic/ionic_rx_filter.h |  47 ++
 drivers/net/ionic/meson.build   |   1 +
 8 files changed, 462 insertions(+), 7 deletions(-)
 create mode 100644 drivers/net/ionic/ionic_rx_filter.c
 create mode 100644 drivers/net/ionic/ionic_rx_filter.h

diff --git a/doc/guides/nics/features/ionic.ini 
b/doc/guides/nics/features/ionic.ini
index c69e5cbed..3dd5dab45 100644
--- a/doc/guides/nics/features/ionic.ini
+++ b/doc/guides/nics/features/ionic.ini
@@ -8,6 +8,10 @@ Speed capabilities   = Y
 Link status  = Y
 Link status event= Y
 MTU update   = Y
+Promiscuous mode = Y
+Allmulticast mode= Y
+Unicast MAC filter   = Y
+VLAN filter  = Y
 Linux UIO= Y
 Linux VFIO   = Y
 x86-64   = Y
diff --git a/drivers/net/ionic/Makefile b/drivers/net/ionic/Makefile
index 2dc88cdd5..2b7cbaf9e 100644
--- a/drivers/net/ionic/Makefile
+++ b/drivers/net/ionic/Makefile
@@ -24,6 +24,7 @@ LDLIBS += -lrte_bus_pci
 # all source are stored in SRCS-y
 #
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_mac_api.c
+SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_rx_filter.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_dev.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_lif.c
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index e2c9d1d68..0cb551c73 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -49,6 +49,14 @@ static const struct eth_dev_ops ionic_eth_dev_ops = {
.link_update= ionic_dev_link_update,
.dev_set_link_up= ionic_dev_set_link_up,
.dev_set_link_down  = ionic_dev_set_link_down,
+   .mac_addr_add   = ionic_dev_add_mac,
+   .mac_addr_remove= ionic_dev_remove_mac,
+   .mac_addr_set   = ionic_dev_set_mac,
+   .vlan_filter_set= ionic_dev_vlan_filter_set,
+   .promiscuous_enable = ionic_dev_promiscuous_enable,
+   .promiscuous_disable= ionic_dev_promiscuous_disable,
+   .allmulticast_enable= ionic_dev_allmulticast_enable,
+   .allmulticast_disable   = ionic_dev_allmulticast_disable,
 };
 
 /*
diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 66038bbdb..1214ebf93 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -9,6 +9,7 @@
 #include "ionic_logs.h"
 #include "ionic_lif.h"
 #include "ionic_ethdev.h"
+#include "ionic_rx_filter.h"
 
 static int ionic_lif_addr_add(struct ionic_lif *lif, const uint8_t *addr);
 static int ionic_lif_addr_del(struct ionic_lif *lif, const uint8_t *addr);
@@ -83,23 +84,200 @@ ionic_lif_reset(struct ionic_lif *lif)
 }
 
 static int
-ionic_lif_addr_add(struct ionic_lif *lif __rte_unused,
-   const uint8_t *addr __rte_unused)
+ionic_lif_addr_add(struct ionic_lif *lif, const uint8_t *addr)
 {
-   IONIC_PRINT(INFO, "%s: stubbed", __func__);
+   struct ionic_admin_ctx ctx = {
+   .pending_work = true,
+   .cmd.rx_filter_add = {
+   .opcode = IONIC_CMD_RX_FILTER_ADD,
+   .match = IONIC_RX_FILTER_MATCH_MAC,
+   },
+   };
+   int err;
+
+   memcpy(ctx.cmd.rx_filter_add.mac.addr, addr, RTE_ETHER_ADDR_LEN);
+
+   err = ionic_adminq_post_wait(lif, &ctx);
+   if (err)
+   return err;
+
+   IONIC_PRINT(INFO, "rx_filter add (id %d)",
+   ctx.comp.rx_filter_add.filter_id);
+
+   return ionic_rx_filter_save(lif, 0, IONIC_RXQ_INDEX_ANY, &ctx);
+}
+
+static int
+ionic_lif_addr_del(struct ionic_lif *lif, const uint8_t *addr)
+{
+   struct ionic_admin_ctx ctx = {
+   .pending_work = true,
+   .cmd.rx_filter_del = {
+   .opcode = IONIC_CMD_RX_FILTER_DEL,
+   },
+   };
+   struct ionic_rx_filter *f;
+   int err;
+
+   IONIC_PRINT_CALL();
+
+   rte_spinlock_lock(&lif->rx_filters.lock);
+
+   f = ionic_rx_filter_by_addr(lif, addr);
+   if (!f) {
+   rte_spinlock_unlock(&lif->rx_filters.lock);
+   return -ENOENT;
+   }
+
+   ctx.cmd.rx_filter_del.filter_id = f->filter_id;
+   ionic_rx_filter_free(f);
+
+   rte_spinlock_unlock(&lif->rx_filters.lock);
+
+   err = ionic_adminq_post_wait(lif, &ctx);
+   if (err)
+   return 

[dpdk-dev] [PATCH v5 12/17] net/ionic: add Flow Control support

2020-01-19 Thread Alfredo Cardigliano
Add support for managing Flow Control.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 doc/guides/nics/features/ionic.ini |  1 +
 drivers/net/ionic/ionic_ethdev.c   | 56 ++
 2 files changed, 57 insertions(+)

diff --git a/doc/guides/nics/features/ionic.ini 
b/doc/guides/nics/features/ionic.ini
index 3dd5dab45..05bdb2d98 100644
--- a/doc/guides/nics/features/ionic.ini
+++ b/doc/guides/nics/features/ionic.ini
@@ -12,6 +12,7 @@ Promiscuous mode = Y
 Allmulticast mode= Y
 Unicast MAC filter   = Y
 VLAN filter  = Y
+Flow control = Y
 Linux UIO= Y
 Linux VFIO   = Y
 x86-64   = Y
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 0cb551c73..d37a4204e 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -29,6 +29,10 @@ static int  ionic_dev_set_link_up(struct rte_eth_dev *dev);
 static int  ionic_dev_set_link_down(struct rte_eth_dev *dev);
 static int  ionic_dev_link_update(struct rte_eth_dev *eth_dev,
int wait_to_complete);
+static int  ionic_flow_ctrl_get(struct rte_eth_dev *eth_dev,
+   struct rte_eth_fc_conf *fc_conf);
+static int  ionic_flow_ctrl_set(struct rte_eth_dev *eth_dev,
+   struct rte_eth_fc_conf *fc_conf);
 
 int ionic_logtype;
 
@@ -57,6 +61,8 @@ static const struct eth_dev_ops ionic_eth_dev_ops = {
.promiscuous_disable= ionic_dev_promiscuous_disable,
.allmulticast_enable= ionic_dev_allmulticast_enable,
.allmulticast_disable   = ionic_dev_allmulticast_disable,
+   .flow_ctrl_get  = ionic_flow_ctrl_get,
+   .flow_ctrl_set  = ionic_flow_ctrl_set,
 };
 
 /*
@@ -240,6 +246,56 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,
return 0;
 }
 
+static int
+ionic_flow_ctrl_get(struct rte_eth_dev *eth_dev,
+   struct rte_eth_fc_conf *fc_conf)
+{
+   struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
+   struct ionic_adapter *adapter = lif->adapter;
+   struct ionic_dev *idev = &adapter->idev;
+
+   if (idev->port_info) {
+   fc_conf->autoneg = idev->port_info->config.an_enable;
+
+   if (idev->port_info->config.pause_type)
+   fc_conf->mode = RTE_FC_FULL;
+   else
+   fc_conf->mode = RTE_FC_NONE;
+   }
+
+   return 0;
+}
+
+static int
+ionic_flow_ctrl_set(struct rte_eth_dev *eth_dev,
+   struct rte_eth_fc_conf *fc_conf)
+{
+   struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
+   struct ionic_adapter *adapter = lif->adapter;
+   struct ionic_dev *idev = &adapter->idev;
+   uint8_t pause_type = IONIC_PORT_PAUSE_TYPE_NONE;
+   uint8_t an_enable;
+
+   switch (fc_conf->mode) {
+   case RTE_FC_NONE:
+   pause_type = IONIC_PORT_PAUSE_TYPE_NONE;
+   break;
+   case RTE_FC_FULL:
+   pause_type = IONIC_PORT_PAUSE_TYPE_LINK;
+   break;
+   case RTE_FC_RX_PAUSE:
+   case RTE_FC_TX_PAUSE:
+   return -ENOTSUP;
+   }
+
+   an_enable = fc_conf->autoneg;
+
+   ionic_dev_cmd_port_pause(idev, pause_type);
+   ionic_dev_cmd_port_autoneg(idev, an_enable);
+
+   return 0;
+}
+
 static int
 ionic_dev_configure(struct rte_eth_dev *eth_dev)
 {
-- 
2.17.1



[dpdk-dev] [PATCH v5 08/17] net/ionic: add adminq support

2020-01-19 Thread Alfredo Cardigliano
Add support for the admin queue, which is used for most
of the NIC configurations.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 drivers/net/ionic/ionic.h  |   3 +
 drivers/net/ionic/ionic_dev.c  | 255 
 drivers/net/ionic/ionic_dev.h  |  94 +
 drivers/net/ionic/ionic_lif.c  | 351 +
 drivers/net/ionic/ionic_lif.h  |  36 
 drivers/net/ionic/ionic_main.c | 184 +
 6 files changed, 923 insertions(+)

diff --git a/drivers/net/ionic/ionic.h b/drivers/net/ionic/ionic.h
index 964589ed5..e4592ede3 100644
--- a/drivers/net/ionic/ionic.h
+++ b/drivers/net/ionic/ionic.h
@@ -56,11 +56,14 @@ struct ionic_adapter {
uint32_t max_ntxqs_per_lif;
uint32_t max_nrxqs_per_lif;
uint32_t nintrs;
+   bool intrs[IONIC_INTR_CTRL_REGS_MAX];
bool is_mgmt_nic;
struct rte_pci_device *pci_dev;
LIST_ENTRY(ionic_adapter) pci_adapters;
 };
 
+int ionic_adminq_check_err(struct ionic_admin_ctx *ctx, bool timeout);
+int ionic_adminq_post_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx);
 int ionic_dev_cmd_wait_check(struct ionic_dev *idev, unsigned long max_wait);
 int ionic_setup(struct ionic_adapter *adapter);
 
diff --git a/drivers/net/ionic/ionic_dev.c b/drivers/net/ionic/ionic_dev.c
index 13e99ace6..582c4ccd0 100644
--- a/drivers/net/ionic/ionic_dev.c
+++ b/drivers/net/ionic/ionic_dev.c
@@ -299,6 +299,12 @@ ionic_dev_cmd_lif_reset(struct ionic_dev *idev, uint16_t 
lif_index)
ionic_dev_cmd_go(idev, &cmd);
 }
 
+struct ionic_doorbell *
+ionic_db_map(struct ionic_lif *lif, struct ionic_queue *q)
+{
+   return lif->kern_dbpage + q->hw_type;
+}
+
 int
 ionic_db_page_num(struct ionic_lif *lif, int pid)
 {
@@ -312,3 +318,252 @@ ionic_intr_init(struct ionic_dev *idev, struct 
ionic_intr_info *intr,
ionic_intr_clean(idev->intr_ctrl, index);
intr->index = index;
 }
+
+void
+ionic_dev_cmd_adminq_init(struct ionic_dev *idev,
+   struct ionic_qcq *qcq,
+   uint16_t lif_index, uint16_t intr_index)
+{
+   struct ionic_queue *q = &qcq->q;
+   struct ionic_cq *cq = &qcq->cq;
+
+   union ionic_dev_cmd cmd = {
+   .q_init.opcode = IONIC_CMD_Q_INIT,
+   .q_init.lif_index = lif_index,
+   .q_init.type = q->type,
+   .q_init.index = q->index,
+   .q_init.flags = IONIC_QINIT_F_ENA,
+   .q_init.pid = q->pid,
+   .q_init.intr_index = intr_index,
+   .q_init.ring_size = rte_log2_u32(q->num_descs),
+   .q_init.ring_base = q->base_pa,
+   .q_init.cq_ring_base = cq->base_pa,
+   };
+
+   ionic_dev_cmd_go(idev, &cmd);
+}
+
+int
+ionic_cq_init(struct ionic_lif *lif, struct ionic_cq *cq,
+   struct ionic_intr_info *intr,
+   uint32_t num_descs, size_t desc_size)
+{
+   if (desc_size == 0) {
+   IONIC_PRINT(ERR, "Descriptor size is %zu", desc_size);
+   return -EINVAL;
+   }
+
+   if (!rte_is_power_of_2(num_descs) ||
+   num_descs < IONIC_MIN_RING_DESC ||
+   num_descs > IONIC_MAX_RING_DESC) {
+   IONIC_PRINT(ERR, "%u descriptors (min: %u max: %u)",
+   num_descs, IONIC_MIN_RING_DESC, IONIC_MAX_RING_DESC);
+   return -EINVAL;
+   }
+
+   cq->lif = lif;
+   cq->bound_intr = intr;
+   cq->num_descs = num_descs;
+   cq->desc_size = desc_size;
+   cq->tail_idx = 0;
+   cq->done_color = 1;
+
+   return 0;
+}
+
+void
+ionic_cq_map(struct ionic_cq *cq, void *base, rte_iova_t base_pa)
+{
+   cq->base = base;
+   cq->base_pa = base_pa;
+}
+
+void
+ionic_cq_bind(struct ionic_cq *cq, struct ionic_queue *q)
+{
+   cq->bound_q = q;
+   q->bound_cq = cq;
+}
+
+uint32_t
+ionic_cq_service(struct ionic_cq *cq, uint32_t work_to_do,
+ionic_cq_cb cb, void *cb_arg)
+{
+   uint32_t work_done = 0;
+
+   if (work_to_do == 0)
+   return 0;
+
+   while (cb(cq, cq->tail_idx, cb_arg)) {
+   cq->tail_idx = (cq->tail_idx + 1) & (cq->num_descs - 1);
+   if (cq->tail_idx == 0)
+   cq->done_color = !cq->done_color;
+
+   if (++work_done == work_to_do)
+   break;
+   }
+
+   return work_done;
+}
+
+int
+ionic_q_init(struct ionic_lif *lif, struct ionic_dev *idev,
+struct ionic_queue *q, uint32_t index, uint32_t num_descs,
+size_t desc_size, size_t sg_desc_size, uint32_t pid)
+{
+   uint32_t ring_size;
+
+   if (desc_size == 0 || !rte_is_power_of_2(num_descs))
+   return -EINVAL;
+
+   ring_size = rte_log2_u32(num_descs);
+
+   if (ring_size < 2 || ring_size > 16)
+   return -EINVAL;
+
+   q->lif = lif;
+   q->idev = idev;
+   q->index = index;
+   q->num_descs = num_descs;
+   q-

[dpdk-dev] [PATCH v5 13/17] net/ionic: add Rx and Tx handling

2020-01-19 Thread Alfredo Cardigliano
Add Rx and Tx queues setup and handling.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 doc/guides/nics/features/ionic.ini |  10 +
 drivers/net/ionic/Makefile |   1 +
 drivers/net/ionic/ionic_dev.h  |   1 +
 drivers/net/ionic/ionic_ethdev.c   | 115 
 drivers/net/ionic/ionic_lif.c  | 220 ++-
 drivers/net/ionic/ionic_lif.h  |  44 ++
 drivers/net/ionic/ionic_rxtx.c | 994 +
 drivers/net/ionic/ionic_rxtx.h |  44 ++
 drivers/net/ionic/meson.build  |   1 +
 9 files changed, 1429 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/ionic/ionic_rxtx.c
 create mode 100644 drivers/net/ionic/ionic_rxtx.h

diff --git a/doc/guides/nics/features/ionic.ini 
b/doc/guides/nics/features/ionic.ini
index 05bdb2d98..8fde998c1 100644
--- a/doc/guides/nics/features/ionic.ini
+++ b/doc/guides/nics/features/ionic.ini
@@ -7,12 +7,22 @@
 Speed capabilities   = Y
 Link status  = Y
 Link status event= Y
+Queue start/stop = Y
 MTU update   = Y
+Jumbo frame  = Y
+Scattered Rx = Y
+LRO  = Y
+TSO  = Y
 Promiscuous mode = Y
 Allmulticast mode= Y
 Unicast MAC filter   = Y
 VLAN filter  = Y
+VLAN offload = Y
 Flow control = Y
+CRC offload  = Y
+L3 checksum offload  = Y
+L4 checksum offload  = Y
+Packet type parsing  = Y
 Linux UIO= Y
 Linux VFIO   = Y
 x86-64   = Y
diff --git a/drivers/net/ionic/Makefile b/drivers/net/ionic/Makefile
index 2b7cbaf9e..f74ac2d34 100644
--- a/drivers/net/ionic/Makefile
+++ b/drivers/net/ionic/Makefile
@@ -25,6 +25,7 @@ LDLIBS += -lrte_bus_pci
 #
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_mac_api.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_rx_filter.c
+SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_rxtx.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_dev.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_lif.c
diff --git a/drivers/net/ionic/ionic_dev.h b/drivers/net/ionic/ionic_dev.h
index 61576621b..8c1ec13a6 100644
--- a/drivers/net/ionic/ionic_dev.h
+++ b/drivers/net/ionic/ionic_dev.h
@@ -14,6 +14,7 @@
 
 #define IONIC_MAX_RING_DESC32768
 #define IONIC_MIN_RING_DESC16
+#define IONIC_DEF_TXRX_DESC4096
 
 #define IONIC_LIFS_MAX 1024
 
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index d37a4204e..912c8464b 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -15,6 +15,7 @@
 #include "ionic_mac_api.h"
 #include "ionic_lif.h"
 #include "ionic_ethdev.h"
+#include "ionic_rxtx.h"
 
 static int  eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params);
 static int  eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev);
@@ -33,6 +34,7 @@ static int  ionic_flow_ctrl_get(struct rte_eth_dev *eth_dev,
struct rte_eth_fc_conf *fc_conf);
 static int  ionic_flow_ctrl_set(struct rte_eth_dev *eth_dev,
struct rte_eth_fc_conf *fc_conf);
+static int  ionic_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask);
 
 int ionic_logtype;
 
@@ -43,6 +45,20 @@ static const struct rte_pci_id pci_id_ionic_map[] = {
{ .vendor_id = 0, /* sentinel */ },
 };
 
+static const struct rte_eth_desc_lim rx_desc_lim = {
+   .nb_max = IONIC_MAX_RING_DESC,
+   .nb_min = IONIC_MIN_RING_DESC,
+   .nb_align = 1,
+};
+
+static const struct rte_eth_desc_lim tx_desc_lim = {
+   .nb_max = IONIC_MAX_RING_DESC,
+   .nb_min = IONIC_MIN_RING_DESC,
+   .nb_align = 1,
+   .nb_seg_max = IONIC_TX_MAX_SG_ELEMS,
+   .nb_mtu_seg_max = IONIC_TX_MAX_SG_ELEMS,
+};
+
 static const struct eth_dev_ops ionic_eth_dev_ops = {
.dev_infos_get  = ionic_dev_info_get,
.dev_configure  = ionic_dev_configure,
@@ -63,6 +79,17 @@ static const struct eth_dev_ops ionic_eth_dev_ops = {
.allmulticast_disable   = ionic_dev_allmulticast_disable,
.flow_ctrl_get  = ionic_flow_ctrl_get,
.flow_ctrl_set  = ionic_flow_ctrl_set,
+   .rxq_info_get   = ionic_rxq_info_get,
+   .txq_info_get   = ionic_txq_info_get,
+   .rx_queue_setup = ionic_dev_rx_queue_setup,
+   .rx_queue_release   = ionic_dev_rx_queue_release,
+   .rx_queue_start = ionic_dev_rx_queue_start,
+   .rx_queue_stop  = ionic_dev_rx_queue_stop,
+   .tx_queue_setup = ionic_dev_tx_queue_setup,
+   .tx_queue_release   = ionic_dev_tx_queue_release,
+   .tx_queue_start = ionic_dev_tx_queue_start,
+   .tx_queue_stop  = ionic_dev_tx_queue_stop,
+   .vlan_offload_set   = ionic_vlan_offload_set,
 };
 
 /*
@@ -243,6 +270,50 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,
ETH_LINK_SPEED_50G |
ETH_LINK_SPEED_100G;
 
+   /*
+* Per-queue capabili

[dpdk-dev] [PATCH v5 09/17] net/ionic: add notifyq support

2020-01-19 Thread Alfredo Cardigliano
Add support for the notify queue, which is used for events
published by the NIC.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 drivers/net/ionic/ionic.h|   2 +
 drivers/net/ionic/ionic_ethdev.c |  97 
 drivers/net/ionic/ionic_lif.c| 191 +++
 drivers/net/ionic/ionic_lif.h|   7 ++
 4 files changed, 297 insertions(+)

diff --git a/drivers/net/ionic/ionic.h b/drivers/net/ionic/ionic.h
index e4592ede3..0243ee4ca 100644
--- a/drivers/net/ionic/ionic.h
+++ b/drivers/net/ionic/ionic.h
@@ -55,9 +55,11 @@ struct ionic_adapter {
uint32_t nlifs;
uint32_t max_ntxqs_per_lif;
uint32_t max_nrxqs_per_lif;
+   uint32_t link_speed;
uint32_t nintrs;
bool intrs[IONIC_INTR_CTRL_REGS_MAX];
bool is_mgmt_nic;
+   bool link_up;
struct rte_pci_device *pci_dev;
LIST_ENTRY(ionic_adapter) pci_adapters;
 };
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index f58d2d3a6..b57dce1e5 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -31,6 +31,30 @@ static const struct rte_pci_id pci_id_ionic_map[] = {
 static const struct eth_dev_ops ionic_eth_dev_ops = {
 };
 
+/**
+ * Interrupt handler triggered by NIC for handling
+ * specific interrupt.
+ *
+ * @param param
+ *  The address of parameter regsitered before.
+ *
+ * @return
+ *  void
+ */
+static void
+ionic_dev_interrupt_handler(void *param)
+{
+   struct ionic_adapter *adapter = (struct ionic_adapter *)param;
+   uint32_t i;
+
+   IONIC_PRINT(DEBUG, "->");
+
+   for (i = 0; i < adapter->nlifs; i++) {
+   if (adapter->lifs[i])
+   ionic_notifyq_handler(adapter->lifs[i], -1);
+   }
+}
+
 static int
 eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params)
 {
@@ -98,6 +122,70 @@ eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev)
return 0;
 }
 
+static int
+ionic_configure_intr(struct ionic_adapter *adapter)
+{
+   struct rte_pci_device *pci_dev = adapter->pci_dev;
+   struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
+   int err;
+
+   IONIC_PRINT(DEBUG, "Configuring %u intrs", adapter->nintrs);
+
+   if (rte_intr_efd_enable(intr_handle, adapter->nintrs)) {
+   IONIC_PRINT(ERR, "Fail to create eventfd");
+   return -1;
+   }
+
+   if (rte_intr_dp_is_en(intr_handle))
+   IONIC_PRINT(DEBUG,
+   "Packet I/O interrupt on datapath is enabled");
+
+   if (!intr_handle->intr_vec) {
+   intr_handle->intr_vec = rte_zmalloc("intr_vec",
+   adapter->nintrs * sizeof(int), 0);
+
+   if (!intr_handle->intr_vec) {
+   IONIC_PRINT(ERR, "Failed to allocate %u vectors",
+   adapter->nintrs);
+   return -ENOMEM;
+   }
+   }
+
+   err = rte_intr_callback_register(intr_handle,
+   ionic_dev_interrupt_handler,
+   adapter);
+
+   if (err) {
+   IONIC_PRINT(ERR,
+   "Failure registering interrupts handler (%d)",
+   err);
+   return err;
+   }
+
+   /* enable intr mapping */
+   err = rte_intr_enable(intr_handle);
+
+   if (err) {
+   IONIC_PRINT(ERR, "Failure enabling interrupts (%d)", err);
+   return err;
+   }
+
+   return 0;
+}
+
+static void
+ionic_unconfigure_intr(struct ionic_adapter *adapter)
+{
+   struct rte_pci_device *pci_dev = adapter->pci_dev;
+   struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
+
+   rte_intr_disable(intr_handle);
+
+   rte_intr_callback_unregister(intr_handle,
+   ionic_dev_interrupt_handler,
+   adapter);
+}
+
 static int
 eth_ionic_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
struct rte_pci_device *pci_dev)
@@ -221,6 +309,13 @@ eth_ionic_pci_probe(struct rte_pci_driver *pci_drv 
__rte_unused,
adapter->nlifs++;
}
 
+   err = ionic_configure_intr(adapter);
+
+   if (err) {
+   IONIC_PRINT(ERR, "Failed to configure interrupts");
+   goto err_free_adapter;
+   }
+
return 0;
 
 err_free_adapter:
@@ -249,6 +344,8 @@ eth_ionic_pci_remove(struct rte_pci_device *pci_dev 
__rte_unused)
}
 
if (adapter) {
+   ionic_unconfigure_intr(adapter);
+
for (i = 0; i < adapter->nlifs; i++) {
lif = adapter->lifs[i];
rte_eth_dev_destroy(lif->eth_dev, eth_ionic_dev_uninit);
diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 78a8c93a8..c831519b7 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -253,7 +253,27 @@ ionic_admin_qcq_alloc(struct ionic_lif *

[dpdk-dev] [PATCH v5 15/17] net/ionic: add stats

2020-01-19 Thread Alfredo Cardigliano
Add basic, per queue and extended statistics for
RX and TX, both from the adapter and the driver.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 doc/guides/nics/features/ionic.ini |   3 +
 drivers/net/ionic/ionic_ethdev.c   | 253 +
 drivers/net/ionic/ionic_lif.c  | 149 +
 drivers/net/ionic/ionic_lif.h  |  10 ++
 4 files changed, 415 insertions(+)

diff --git a/doc/guides/nics/features/ionic.ini 
b/doc/guides/nics/features/ionic.ini
index 9a155251c..8cd5936d6 100644
--- a/doc/guides/nics/features/ionic.ini
+++ b/doc/guides/nics/features/ionic.ini
@@ -26,6 +26,9 @@ CRC offload  = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
 Packet type parsing  = Y
+Basic stats  = Y
+Extended stats   = Y
+Stats per queue  = Y
 Linux UIO= Y
 Linux VFIO   = Y
 x86-64   = Y
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 804602e22..eb7378f8d 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -43,6 +43,19 @@ static int  ionic_dev_rss_hash_conf_get(struct rte_eth_dev 
*eth_dev,
struct rte_eth_rss_conf *rss_conf);
 static int  ionic_dev_rss_hash_update(struct rte_eth_dev *eth_dev,
struct rte_eth_rss_conf *rss_conf);
+static int  ionic_dev_stats_get(struct rte_eth_dev *eth_dev,
+   struct rte_eth_stats *stats);
+static int  ionic_dev_stats_reset(struct rte_eth_dev *eth_dev);
+static int  ionic_dev_xstats_get(struct rte_eth_dev *dev,
+   struct rte_eth_xstat *xstats, unsigned int n);
+static int  ionic_dev_xstats_get_by_id(struct rte_eth_dev *dev,
+   const uint64_t *ids, uint64_t *values, unsigned int n);
+static int  ionic_dev_xstats_reset(struct rte_eth_dev *dev);
+static int  ionic_dev_xstats_get_names(struct rte_eth_dev *dev,
+   struct rte_eth_xstat_name *xstats_names, unsigned int size);
+static int  ionic_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
+   struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+   unsigned int limit);
 
 int ionic_logtype;
 
@@ -102,8 +115,102 @@ static const struct eth_dev_ops ionic_eth_dev_ops = {
.reta_query = ionic_dev_rss_reta_query,
.rss_hash_conf_get  = ionic_dev_rss_hash_conf_get,
.rss_hash_update= ionic_dev_rss_hash_update,
+   .stats_get  = ionic_dev_stats_get,
+   .stats_reset= ionic_dev_stats_reset,
+   .xstats_get = ionic_dev_xstats_get,
+   .xstats_get_by_id   = ionic_dev_xstats_get_by_id,
+   .xstats_reset   = ionic_dev_xstats_reset,
+   .xstats_get_names   = ionic_dev_xstats_get_names,
+   .xstats_get_names_by_id = ionic_dev_xstats_get_names_by_id,
 };
 
+struct rte_ionic_xstats_name_off {
+   char name[RTE_ETH_XSTATS_NAME_SIZE];
+   unsigned int offset;
+};
+
+static const struct rte_ionic_xstats_name_off rte_ionic_xstats_strings[] = {
+   /* RX */
+   {"rx_ucast_bytes", offsetof(struct ionic_lif_stats,
+   rx_ucast_bytes)},
+   {"rx_ucast_packets", offsetof(struct ionic_lif_stats,
+   rx_ucast_packets)},
+   {"rx_mcast_bytes", offsetof(struct ionic_lif_stats,
+   rx_mcast_bytes)},
+   {"rx_mcast_packets", offsetof(struct ionic_lif_stats,
+   rx_mcast_packets)},
+   {"rx_bcast_bytes", offsetof(struct ionic_lif_stats,
+   rx_bcast_bytes)},
+   {"rx_bcast_packets", offsetof(struct ionic_lif_stats,
+   rx_bcast_packets)},
+   /* RX drops */
+   {"rx_ucast_drop_bytes", offsetof(struct ionic_lif_stats,
+   rx_ucast_drop_bytes)},
+   {"rx_ucast_drop_packets", offsetof(struct ionic_lif_stats,
+   rx_ucast_drop_packets)},
+   {"rx_mcast_drop_bytes", offsetof(struct ionic_lif_stats,
+   rx_mcast_drop_bytes)},
+   {"rx_mcast_drop_packets", offsetof(struct ionic_lif_stats,
+   rx_mcast_drop_packets)},
+   {"rx_bcast_drop_bytes", offsetof(struct ionic_lif_stats,
+   rx_bcast_drop_bytes)},
+   {"rx_bcast_drop_packets", offsetof(struct ionic_lif_stats,
+   rx_bcast_drop_packets)},
+   {"rx_dma_error", offsetof(struct ionic_lif_stats,
+   rx_dma_error)},
+   /* TX */
+   {"tx_ucast_bytes", offsetof(struct ionic_lif_stats,
+   tx_ucast_bytes)},
+   {"tx_ucast_packets", offsetof(struct ionic_lif_stats,
+   tx_ucast_packets)},
+   {"tx_mcast_bytes", offsetof(struct ionic_lif_stats,
+   tx_mcast_bytes)},
+   {"tx_mcast_packets", offsetof(struct ionic_lif_stats,
+   tx_mcast_packets)},
+   {"tx_bcast_bytes", offsetof(struct ionic_lif_stats,
+   tx_bcast_bytes)},

[dpdk-dev] [PATCH v5 16/17] net/ionic: add Tx checksum support

2020-01-19 Thread Alfredo Cardigliano
Add support for Tx checksumming.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 drivers/net/ionic/ionic_ethdev.c |  5 ++
 drivers/net/ionic/ionic_lif.c|  1 +
 drivers/net/ionic/ionic_lif.h|  1 +
 drivers/net/ionic/ionic_rxtx.c   | 88 +++-
 4 files changed, 93 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index eb7378f8d..948bf05ca 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -406,7 +406,12 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,
0;
 
dev_info->tx_queue_offload_capa =
+   DEV_TX_OFFLOAD_IPV4_CKSUM |
+   DEV_TX_OFFLOAD_UDP_CKSUM |
+   DEV_TX_OFFLOAD_TCP_CKSUM |
DEV_TX_OFFLOAD_VLAN_INSERT |
+   DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+   DEV_TX_OFFLOAD_OUTER_UDP_CKSUM |
0;
 
/*
diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 689c56a1a..8522489ea 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -1491,6 +1491,7 @@ ionic_lif_init(struct ionic_lif *lif)
| IONIC_ETH_HW_RX_HASH
| IONIC_ETH_HW_TX_SG
| IONIC_ETH_HW_RX_SG
+   | IONIC_ETH_HW_TX_CSUM
| IONIC_ETH_HW_RX_CSUM
| IONIC_ETH_HW_TSO
| IONIC_ETH_HW_TSO_IPV6
diff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h
index 558d23f74..425762d65 100644
--- a/drivers/net/ionic/ionic_lif.h
+++ b/drivers/net/ionic/ionic_lif.h
@@ -32,6 +32,7 @@ struct ionic_tx_stats {
uint64_t bytes;
uint64_t drop;
uint64_t stop;
+   uint64_t no_csum;
uint64_t tso;
uint64_t frags;
 };
diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index 13919fc5a..a721d8c52 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -230,16 +230,59 @@ ionic_dev_tx_queue_start(struct rte_eth_dev *eth_dev, 
uint16_t tx_queue_id)
return 0;
 }
 
+static void
+ionic_tx_tcp_pseudo_csum(struct rte_mbuf *txm)
+{
+   struct ether_hdr *eth_hdr = rte_pktmbuf_mtod(txm, struct ether_hdr *);
+   char *l3_hdr = ((char *)eth_hdr) + txm->l2_len;
+   struct rte_tcp_hdr *tcp_hdr = (struct rte_tcp_hdr *)
+   (l3_hdr + txm->l3_len);
+
+   if (txm->ol_flags & PKT_TX_IP_CKSUM) {
+   struct rte_ipv4_hdr *ipv4_hdr = (struct rte_ipv4_hdr *)l3_hdr;
+   ipv4_hdr->hdr_checksum = 0;
+   tcp_hdr->cksum = 0;
+   tcp_hdr->cksum = rte_ipv4_udptcp_cksum(ipv4_hdr, tcp_hdr);
+   } else {
+   struct rte_ipv6_hdr *ipv6_hdr = (struct rte_ipv6_hdr *)l3_hdr;
+   tcp_hdr->cksum = 0;
+   tcp_hdr->cksum = rte_ipv6_udptcp_cksum(ipv6_hdr, tcp_hdr);
+   }
+}
+
+static void
+ionic_tx_tcp_inner_pseudo_csum(struct rte_mbuf *txm)
+{
+   struct ether_hdr *eth_hdr = rte_pktmbuf_mtod(txm, struct ether_hdr *);
+   char *l3_hdr = ((char *)eth_hdr) + txm->outer_l2_len +
+   txm->outer_l3_len + txm->l2_len;
+   struct rte_tcp_hdr *tcp_hdr = (struct rte_tcp_hdr *)
+   (l3_hdr + txm->l3_len);
+
+   if (txm->ol_flags & PKT_TX_IPV4) {
+   struct rte_ipv4_hdr *ipv4_hdr = (struct rte_ipv4_hdr *)l3_hdr;
+   ipv4_hdr->hdr_checksum = 0;
+   tcp_hdr->cksum = 0;
+   tcp_hdr->cksum = rte_ipv4_udptcp_cksum(ipv4_hdr, tcp_hdr);
+   } else {
+   struct rte_ipv6_hdr *ipv6_hdr = (struct rte_ipv6_hdr *)l3_hdr;
+   tcp_hdr->cksum = 0;
+   tcp_hdr->cksum = rte_ipv6_udptcp_cksum(ipv6_hdr, tcp_hdr);
+   }
+}
+
 static void
 ionic_tx_tso_post(struct ionic_queue *q, struct ionic_txq_desc *desc,
struct rte_mbuf *txm,
rte_iova_t addr, uint8_t nsge, uint16_t len,
uint32_t hdrlen, uint32_t mss,
+   bool encap,
uint16_t vlan_tci, bool has_vlan,
bool start, bool done)
 {
uint8_t flags = 0;
flags |= has_vlan ? IONIC_TXQ_DESC_FLAG_VLAN : 0;
+   flags |= encap ? IONIC_TXQ_DESC_FLAG_ENCAP : 0;
flags |= start ? IONIC_TXQ_DESC_FLAG_TSO_SOT : 0;
flags |= done ? IONIC_TXQ_DESC_FLAG_TSO_EOT : 0;
 
@@ -284,10 +327,29 @@ ionic_tx_tso(struct ionic_queue *q, struct rte_mbuf *txm,
uint32_t len;
uint32_t offset = 0;
bool start, done;
+   bool encap;
bool has_vlan = !!(txm->ol_flags & PKT_TX_VLAN_PKT);
uint16_t vlan_tci = txm->vlan_tci;
+   uint64_t ol_flags = txm->ol_flags;
 
-   hdrlen = txm->l2_len + txm->l3_len;
+   encap = ((ol_flags & PKT_TX_OUTER_IP_CKSUM) ||
+   (ol_flags & PKT_TX_OUTER_UDP_CKSUM)) &&
+   ((ol_flags & PKT_TX_OUTER_IPV4) ||
+   (ol_flags 

[dpdk-dev] [PATCH v5 14/17] net/ionic: add RSS support

2020-01-19 Thread Alfredo Cardigliano
Add code to manipulate the RSS configuration
used by the adapter.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 doc/guides/nics/features/ionic.ini |   3 +
 drivers/net/ionic/ionic_ethdev.c   | 175 +
 drivers/net/ionic/ionic_ethdev.h   |   8 ++
 drivers/net/ionic/ionic_lif.c  | 120 +++-
 drivers/net/ionic/ionic_lif.h  |  16 +++
 drivers/net/ionic/ionic_rxtx.c |   4 +
 6 files changed, 324 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features/ionic.ini 
b/doc/guides/nics/features/ionic.ini
index 8fde998c1..9a155251c 100644
--- a/doc/guides/nics/features/ionic.ini
+++ b/doc/guides/nics/features/ionic.ini
@@ -16,6 +16,9 @@ TSO  = Y
 Promiscuous mode = Y
 Allmulticast mode= Y
 Unicast MAC filter   = Y
+RSS hash = Y
+RSS key update   = Y
+RSS reta update  = Y
 VLAN filter  = Y
 VLAN offload = Y
 Flow control = Y
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 912c8464b..804602e22 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -35,6 +35,14 @@ static int  ionic_flow_ctrl_get(struct rte_eth_dev *eth_dev,
 static int  ionic_flow_ctrl_set(struct rte_eth_dev *eth_dev,
struct rte_eth_fc_conf *fc_conf);
 static int  ionic_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask);
+static int  ionic_dev_rss_reta_update(struct rte_eth_dev *eth_dev,
+   struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size);
+static int  ionic_dev_rss_reta_query(struct rte_eth_dev *eth_dev,
+   struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size);
+static int  ionic_dev_rss_hash_conf_get(struct rte_eth_dev *eth_dev,
+   struct rte_eth_rss_conf *rss_conf);
+static int  ionic_dev_rss_hash_update(struct rte_eth_dev *eth_dev,
+   struct rte_eth_rss_conf *rss_conf);
 
 int ionic_logtype;
 
@@ -90,6 +98,10 @@ static const struct eth_dev_ops ionic_eth_dev_ops = {
.tx_queue_start = ionic_dev_tx_queue_start,
.tx_queue_stop  = ionic_dev_tx_queue_stop,
.vlan_offload_set   = ionic_vlan_offload_set,
+   .reta_update= ionic_dev_rss_reta_update,
+   .reta_query = ionic_dev_rss_reta_query,
+   .rss_hash_conf_get  = ionic_dev_rss_hash_conf_get,
+   .rss_hash_update= ionic_dev_rss_hash_update,
 };
 
 /*
@@ -263,6 +275,10 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,
dev_info->min_mtu = IONIC_MIN_MTU;
dev_info->max_mtu = IONIC_MAX_MTU;
 
+   dev_info->hash_key_size = IONIC_RSS_HASH_KEY_SIZE;
+   dev_info->reta_size = ident->lif.eth.rss_ind_tbl_sz;
+   dev_info->flow_type_rss_offloads = IONIC_ETH_RSS_OFFLOAD_ALL;
+
dev_info->speed_capa =
ETH_LINK_SPEED_10G |
ETH_LINK_SPEED_25G |
@@ -405,6 +421,165 @@ ionic_vlan_offload_set(struct rte_eth_dev *eth_dev, int 
mask)
return 0;
 }
 
+static int
+ionic_dev_rss_reta_update(struct rte_eth_dev *eth_dev,
+   struct rte_eth_rss_reta_entry64 *reta_conf,
+   uint16_t reta_size)
+{
+   struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
+   struct ionic_adapter *adapter = lif->adapter;
+   struct ionic_identity *ident = &adapter->ident;
+   uint32_t i, j, index, num;
+
+   IONIC_PRINT_CALL();
+
+   if (!lif->rss_ind_tbl) {
+   IONIC_PRINT(ERR, "RSS RETA not initialized, "
+   "can't update the table");
+   return -EINVAL;
+   }
+
+   if (reta_size != ident->lif.eth.rss_ind_tbl_sz) {
+   IONIC_PRINT(ERR, "The size of hash lookup table configured "
+   "(%d) doesn't match the number hardware can supported "
+   "(%d)",
+   reta_size, ident->lif.eth.rss_ind_tbl_sz);
+   return -EINVAL;
+   }
+
+   num = lif->adapter->ident.lif.eth.rss_ind_tbl_sz / RTE_RETA_GROUP_SIZE;
+
+   for (i = 0; i < num; i++) {
+   for (j = 0; j < RTE_RETA_GROUP_SIZE; j++) {
+   if (reta_conf[i].mask & ((uint64_t)1 << j)) {
+   index = (i * RTE_RETA_GROUP_SIZE) + j;
+   lif->rss_ind_tbl[index] = reta_conf[i].reta[j];
+   }
+   }
+   }
+
+   return ionic_lif_rss_config(lif, lif->rss_types, NULL, NULL);
+}
+
+static int
+ionic_dev_rss_reta_query(struct rte_eth_dev *eth_dev,
+   struct rte_eth_rss_reta_entry64 *reta_conf,
+   uint16_t reta_size)
+{
+   struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
+   struct ionic_adapter *adapter = lif->adapter;
+   struct ionic_identity *ident = &adapter->ident;
+   int i, num;
+
+   IONIC_PRINT_CALL();
+
+   if (reta_size != ident->lif.eth.rss_ind_tbl_sz) {
+   IONIC_PRINT(ERR,

[dpdk-dev] [PATCH v5 17/17] net/ionic: read Fw version

2020-01-19 Thread Alfredo Cardigliano
Add support for reading the firmware version.

Signed-off-by: Alfredo Cardigliano 
Reviewed-by: Shannon Nelson 
---
 doc/guides/nics/features/ionic.ini |  1 +
 drivers/net/ionic/ionic.h  |  1 +
 drivers/net/ionic/ionic_dev.c  |  8 
 drivers/net/ionic/ionic_ethdev.c   | 20 
 4 files changed, 30 insertions(+)

diff --git a/doc/guides/nics/features/ionic.ini 
b/doc/guides/nics/features/ionic.ini
index 8cd5936d6..083c7bd99 100644
--- a/doc/guides/nics/features/ionic.ini
+++ b/doc/guides/nics/features/ionic.ini
@@ -29,6 +29,7 @@ Packet type parsing  = Y
 Basic stats  = Y
 Extended stats   = Y
 Stats per queue  = Y
+FW version   = Y
 Linux UIO= Y
 Linux VFIO   = Y
 x86-64   = Y
diff --git a/drivers/net/ionic/ionic.h b/drivers/net/ionic/ionic.h
index 184fc6da0..1538df309 100644
--- a/drivers/net/ionic/ionic.h
+++ b/drivers/net/ionic/ionic.h
@@ -61,6 +61,7 @@ struct ionic_adapter {
bool intrs[IONIC_INTR_CTRL_REGS_MAX];
bool is_mgmt_nic;
bool link_up;
+   char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN];
struct rte_pci_device *pci_dev;
LIST_ENTRY(ionic_adapter) pci_adapters;
 };
diff --git a/drivers/net/ionic/ionic_dev.c b/drivers/net/ionic/ionic_dev.c
index 582c4ccd0..aba388115 100644
--- a/drivers/net/ionic/ionic_dev.c
+++ b/drivers/net/ionic/ionic_dev.c
@@ -16,6 +16,7 @@ ionic_dev_setup(struct ionic_adapter *adapter)
struct ionic_dev *idev = &adapter->idev;
uint32_t sig;
u_char *bar0_base;
+   unsigned int i;
 
/* BAR0: dev_cmd and interrupts */
if (num_bars < 1) {
@@ -47,6 +48,13 @@ ionic_dev_setup(struct ionic_adapter *adapter)
return -EFAULT;
}
 
+   for (i = 0; i < IONIC_DEVINFO_FWVERS_BUFLEN; i++)
+   adapter->fw_version[i] =
+   ioread8(&idev->dev_info->fw_version[i]);
+   adapter->fw_version[IONIC_DEVINFO_FWVERS_BUFLEN - 1] = '\0';
+
+   IONIC_PRINT(DEBUG, "Firmware version: %s", adapter->fw_version);
+
/* BAR1: doorbells */
bar++;
if (num_bars < 2) {
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 948bf05ca..da0d8fd3b 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -56,6 +56,8 @@ static int  ionic_dev_xstats_get_names(struct rte_eth_dev 
*dev,
 static int  ionic_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
unsigned int limit);
+static int  ionic_dev_fw_version_get(struct rte_eth_dev *eth_dev,
+   char *fw_version, size_t fw_size);
 
 int ionic_logtype;
 
@@ -122,6 +124,7 @@ static const struct eth_dev_ops ionic_eth_dev_ops = {
.xstats_reset   = ionic_dev_xstats_reset,
.xstats_get_names   = ionic_dev_xstats_get_names,
.xstats_get_names_by_id = ionic_dev_xstats_get_names_by_id,
+   .fw_version_get = ionic_dev_fw_version_get,
 };
 
 struct rte_ionic_xstats_name_off {
@@ -211,6 +214,23 @@ static const struct rte_ionic_xstats_name_off 
rte_ionic_xstats_strings[] = {
 #define IONIC_NB_HW_STATS (sizeof(rte_ionic_xstats_strings) / \
sizeof(rte_ionic_xstats_strings[0]))
 
+static int
+ionic_dev_fw_version_get(struct rte_eth_dev *eth_dev,
+   char *fw_version, size_t fw_size)
+{
+   struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
+   struct ionic_adapter *adapter = lif->adapter;
+
+   if (fw_version == NULL || fw_size <= 0)
+   return -EINVAL;
+
+   snprintf(fw_version, fw_size, "%s",
+adapter->fw_version);
+   fw_version[fw_size - 1] = '\0';
+
+   return 0;
+}
+
 /*
  * Set device link up, enable tx.
  */
-- 
2.17.1



Re: [dpdk-dev] [PATCH v2] net/mlx5: fix modify actions support limitation

2020-01-19 Thread Raslan Darawsheh
Hi Bing,

I see that your patch is causing some build failure on aarch64 with meson build.

-c ../../root/dpdk/drivers/net/mlx5/mlx5_flow_dv.c
../../root/dpdk/drivers/net/mlx5/mlx5_flow_dv.c: In function 
'__flow_dv_translate':
../../root/dpdk/drivers/net/mlx5/mlx5_flow_dv.c:7339:48: error: passing 
argument 1 of 'flow_dv_convert_action_modify_ipv4_dscp' from incompatible 
pointer type [-Werror=incompatible-pointer-types]
if (flow_dv_convert_action_modify_ipv4_dscp(&mhdr_res,
^
../../root/dpdk/drivers/net/mlx5/mlx5_flow_dv.c:1213:1: note: expected 'struct 
mlx5_flow_dv_modify_hdr_resource *' but argument is of type 'struct 
mlx5_flow_dv_modify_hdr_resource **'
 flow_dv_convert_action_modify_ipv4_dscp
 ^~~
../../root/dpdk/drivers/net/mlx5/mlx5_flow_dv.c:7345:48: error: passing 
argument 1 of 'flow_dv_convert_action_modify_ipv6_dscp' from incompatible 
pointer type [-Werror=incompatible-pointer-types]
if (flow_dv_convert_action_modify_ipv6_dscp(&mhdr_res,
^
../../root/dpdk/drivers/net/mlx5/mlx5_flow_dv.c:1248:1: note: expected 'struct 
mlx5_flow_dv_modify_hdr_resource *' but argument is of type 'struct 
mlx5_flow_dv_modify_hdr_resource **'
 flow_dv_convert_action_modify_ipv6_dscp
 ^~~
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.


Can you please fix that and send a V3 for it ?

Kindest regards,
Raslan Darawsheh

> -Original Message-
> From: Bing Zhao 
> Sent: Sunday, January 12, 2020 5:57 PM
> To: Ori Kam ; Slava Ovsiienko
> ; Raslan Darawsheh ;
> Matan Azrad 
> Cc: dev@dpdk.org; sta...@dpdk.org
> Subject: [PATCH v2] net/mlx5: fix modify actions support limitation
> 
> In the root table, there is some limitation of total number of header
> modify actions, 16 or 8 for each. But in other tables, there is no
> such strict limitation. In an IPv6 case, the IP fields modifying
> will occupy more actions than that in IPv4, so the total support
> number should be increased in order to support as many actions as
> possible for an IPv6 + TCP packet.
> And in the meanwhile, the memory consumption should also be taken
> into consideration because sometimes only several actions are needed.
> The root table checking could also be done in low layer driver and
> the error code will be returned if the actions number is over the
> maximal supported value.
> 
> Fixes: 0e9d00027686 ("net/mlx5: check maximum modify actions number")
> Signed-off-by: Bing Zhao 
> ---
>  drivers/net/mlx5/mlx5_flow.h|  15 +++---
>  drivers/net/mlx5/mlx5_flow_dv.c | 104 ++-
> -
>  2 files changed, 66 insertions(+), 53 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
> index 27d82ac..4b493ee 100644
> --- a/drivers/net/mlx5/mlx5_flow.h
> +++ b/drivers/net/mlx5/mlx5_flow.h
> @@ -385,11 +385,14 @@ struct mlx5_flow_dv_tag_resource {
> 
>  /*
>   * Number of modification commands.
> - * If extensive metadata registers are supported
> - * the maximal actions amount is 16 and 8 otherwise.
> + * If extensive metadata registers are supported, the maximal actions
> amount is
> + * 16 and 8 otherwise on root table. The validation could also be done in the
> + * lower driver layer.
> + * On non-root table, there is no limitation, but 32 is enough right now.
>   */
> -#define MLX5_MODIFY_NUM 16
> -#define MLX5_MODIFY_NUM_NO_MREG 8
> +#define MLX5_MAX_MODIFY_NUM  32
> +#define MLX5_ROOT_TBL_MODIFY_NUM 16
> +#define MLX5_ROOT_TBL_MODIFY_NUM_NO_MREG 8
> 
>  /* Modify resource structure */
>  struct mlx5_flow_dv_modify_hdr_resource {
> @@ -400,9 +403,9 @@ struct mlx5_flow_dv_modify_hdr_resource {
>   /**< Verbs modify header action object. */
>   uint8_t ft_type; /**< Flow table type, Rx or Tx. */
>   uint32_t actions_num; /**< Number of modification actions. */
> - struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
> - /**< Modification actions. */
>   uint64_t flags; /**< Flags for RDMA API. */
> + struct mlx5_modification_cmd actions[];
> + /**< Modification actions. */
>  };
> 
>  /* Jump action resource structure. */
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c
> index e8a764c..398d60f 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -363,7 +363,7 @@ struct field_modify_info modify_tcp[] = {
>   uint32_t mask;
>   uint32_t data;
> 
> - if (i >= MLX5_MODIFY_NUM)
> + if (i >= MLX5_MAX_MODIFY_NUM)
>   return rte_flow_error_set(error, EINVAL,
>RTE_FLOW_ERROR_TYPE_ACTION, NULL,
>"too many items to modify");
> @@ -404,11 +404,11 @@ struct field_modify_info modify_tcp[] = {
>   ++i;
>

Re: [dpdk-dev] [PATCH v3] net/mlx5: optimize Rx hash fields conversion

2020-01-19 Thread Raslan Darawsheh
Hi,

> -Original Message-
> From: Dekel Peled 
> Sent: Wednesday, January 15, 2020 11:20 PM
> To: Matan Azrad ; Slava Ovsiienko
> 
> Cc: Raslan Darawsheh ; Ori Kam
> ; dev@dpdk.org; sta...@dpdk.org
> Subject: [PATCH v3] net/mlx5: optimize Rx hash fields conversion
> 
> Previous fix added translation of Rx hash fields to PRM format.
> 
> This patch optimizes the fix, to perform value translation only
> if value is not zero.
> In case value is zero, there is no need to translate it.
> 
> Fixes: 51035775c3c7 ("net/mlx5: fix setting of Rx hash fields")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Dekel Peled 
> Acked-by: Viacheslav Ovsiienko 
> 
> ---
> v2: Modify title for clarity, change 'fix' to 'optimize'.
> Remove the 'Fixes' label.
> v3: Add back the 'Fixes' label.
> ---
> 
> ---
>  drivers/net/mlx5/mlx5_rxq.c | 34 +++---
>  1 file changed, 19 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
> index ca25e32..c936a7f 100644
> --- a/drivers/net/mlx5/mlx5_rxq.c
> +++ b/drivers/net/mlx5/mlx5_rxq.c
> @@ -2460,7 +2460,6 @@ struct mlx5_hrxq *
>   }
>   } else { /* ind_tbl->type == MLX5_IND_TBL_TYPE_DEVX */
>   struct mlx5_devx_tir_attr tir_attr;
> - struct mlx5_rx_hash_field_select *rx_hash_field_select;
>   uint32_t i;
>   uint32_t lro = 1;
> 
> @@ -2474,23 +2473,27 @@ struct mlx5_hrxq *
>   memset(&tir_attr, 0, sizeof(tir_attr));
>   tir_attr.disp_type = MLX5_TIRC_DISP_TYPE_INDIRECT;
>   tir_attr.rx_hash_fn = MLX5_RX_HASH_FN_TOEPLITZ;
> -#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
>   tir_attr.tunneled_offload_en = !!tunnel;
> - /* Translate hash_fields bitmap to PRM format. */
> - rx_hash_field_select = hash_fields & IBV_RX_HASH_INNER ?
> -&tir_attr.rx_hash_field_selector_inner :
> -&tir_attr.rx_hash_field_selector_outer;
> + /* If needed, translate hash_fields bitmap to PRM format. */
> + if (hash_fields) {
> +#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
> + struct mlx5_rx_hash_field_select
> *rx_hash_field_select =
> + hash_fields & IBV_RX_HASH_INNER ?
> +
>   &tir_attr.rx_hash_field_selector_inner :
> +
>   &tir_attr.rx_hash_field_selector_outer;
>  #else
> - rx_hash_field_select =
> &tir_attr.rx_hash_field_selector_outer;
> + struct mlx5_rx_hash_field_select
> *rx_hash_field_select =
> +
>   &tir_attr.rx_hash_field_selector_outer;
>  #endif
> - /* 1 bit: 0: IPv4, 1: IPv6. */
> - rx_hash_field_select->l3_prot_type =
> - !!(hash_fields & MLX5_IPV6_IBV_RX_HASH);
> - /* 1 bit: 0: TCP, 1: UDP. */
> - rx_hash_field_select->l4_prot_type =
> - !!(hash_fields & MLX5_UDP_IBV_RX_HASH);
> - /* Bitmask which sets which fields to use in RX Hash. */
> - rx_hash_field_select->selected_fields =
> +
> + /* 1 bit: 0: IPv4, 1: IPv6. */
> + rx_hash_field_select->l3_prot_type =
> + !!(hash_fields & MLX5_IPV6_IBV_RX_HASH);
> + /* 1 bit: 0: TCP, 1: UDP. */
> + rx_hash_field_select->l4_prot_type =
> + !!(hash_fields & MLX5_UDP_IBV_RX_HASH);
> + /* Bitmask which sets which fields to use in RX Hash.
> */
> + rx_hash_field_select->selected_fields =
>   ((!!(hash_fields & MLX5_L3_SRC_IBV_RX_HASH)) <<
> 
> MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_SRC_IP) |
>   (!!(hash_fields & MLX5_L3_DST_IBV_RX_HASH)) <<
> @@ -2499,6 +2502,7 @@ struct mlx5_hrxq *
> 
> MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_SPORT |
>   (!!(hash_fields & MLX5_L4_DST_IBV_RX_HASH)) <<
> 
> MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_DPORT;
> + }
>   if (rxq_ctrl->obj->type ==
> MLX5_RXQ_OBJ_TYPE_DEVX_HAIRPIN)
>   tir_attr.transport_domain = priv->sh->td->id;
>   else
> --
> 1.8.3.1

Fixed fixes reference,
patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh


Re: [dpdk-dev] [PATCH] ci: update travis to use bionic

2020-01-19 Thread David Marchand
On Tue, Dec 17, 2019 at 4:27 PM Andrzej Ostruszka  wrote:
>
> On 12/17/19 12:42 PM, Kevin Laatz wrote:
> > Currently, the Travis CI is using Ubuntu 16.04 LTS (Xenial) which is
> > becoming increasingly outdated. This patch updates Travis to use Ubuntu
> > 18.04 LTS (Bionic) which will give us the benefit of more up-to-date
> > packages being availble and the newer features that come with them.
>
> Acked-by: Andrzej Ostruszka 
>
> But I do have a question - should this come together with removal of
> extra sources/packages added just to overcome building problems
> resulting from outdated distro?  Or this should be responsibility of
> person that added those (e.g. I've added gcc-7 from
> ubuntu-toolchain/r-test for LTO builds)

We disabled the LTO job in Travis on 11/08:
https://git.dpdk.org/dpdk/commit/?id=20d3f48be1d1
Were you referring to something else?

Thanks.

-- 
David Marchand



Re: [dpdk-dev] [PATCH] ci: update travis to use bionic

2020-01-19 Thread David Marchand
On Tue, Dec 17, 2019 at 12:43 PM Kevin Laatz  wrote:
>
> Currently, the Travis CI is using Ubuntu 16.04 LTS (Xenial) which is
> becoming increasingly outdated. This patch updates Travis to use Ubuntu
> 18.04 LTS (Bionic) which will give us the benefit of more up-to-date
> packages being availble and the newer features that come with them.

available*

The Intel CI tests Ubuntu 16.04.
As you mentioned, 18.04 comes with a more recent clang and libabigail
which will be necessary in other series.

I am ok with this change too.

>
> Signed-off-by: Kevin Laatz 
> ---
>  .travis.yml | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index 8f90d06f2..6e0626353 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -4,7 +4,7 @@ compiler:
>- gcc
>- clang
>
> -dist: xenial
> +dist: bionic
>
>  os:
>- linux
> @@ -21,7 +21,7 @@ aarch64_packages: &aarch64_packages
>
>  extra_packages: &extra_packages
>- *required_packages
> -  - [libbsd-dev, libpcap-dev, libcrypto++-dev, libjansson4]
> +  - [libbsd-dev, libpcap-dev, libcrypto++-dev, libjansson4, abigail-tools]

I removed this change.
libabigail will be added when needed.

I also removed the distrib field for the aarch64 jobs, that were not
pushed to master yet, at the time this patch had been proposed.

Applied, thanks.


--
David Marchand



Re: [dpdk-dev] [PATCH v10 0/6] lib/ring: APIs to support custom element size

2020-01-19 Thread David Marchand
On Sat, Jan 18, 2020 at 8:33 PM Honnappa Nagarahalli
 wrote:
>
> The current rte_ring hard-codes the type of the ring element to 'void *',
> hence the size of the element is hard-coded to 32b/64b. Since the ring
> element type is not an input to rte_ring APIs, it results in couple
> of issues:
>
> 1) If an application requires to store an element which is not 64b, it
>needs to write its own ring APIs similar to rte_event_ring APIs. This
>creates additional burden on the programmers, who end up making
>work-arounds and often waste memory.
> 2) If there are multiple libraries that store elements of the same
>type, currently they would have to write their own rte_ring APIs. This
>results in code duplication.
>
> This patch adds new APIs to support configurable ring element size.
> The APIs support custom element sizes by allowing to define the ring
> element to be a multiple of 32b.
>
> The aim is to achieve same performance as the existing ring
> implementation.
>
> v10
>  - Improved comments in test case files (Olivier)
>  - Fixed possible memory leaks (Olivier)
>  - Changed 'test_ring_with_exact_size' to use unaligned
>addresses (Konstantin)
>  - Changed the commit message for eventdev (Jerin)

Thanks for working on this and a big thanks to all reviewers too.

The CI has been switched to Ubuntu 18.04, so that we won't hit the
Travis timeout with clang 7.
There is still some work on the ABI checks, because of the abidiff
report on rte_cuckoo_hash.h I mentioned: passing the public headers to
abidw/abidiff should do the trick.


Series applied.

--
David Marchand



Re: [dpdk-dev] [PATCH] net/enic: move macro to the correct file

2020-01-19 Thread Thomas Monjalon
14/01/2020 01:24, John Daley:
> +#define min_t(type, x, y) ({\
> + type __min1 = (x);  \
> + type __min2 = (y);  \
> + __min1 < __min2 ? __min1 : __min2; })
> +
> +#define max_t(type, x, y) ({\
> + type __max1 = (x);  \
> + type __max2 = (y);  \
> + __max1 > __max2 ? __max1 : __max2; })

Why not using RTE_MIN/RTE_MAX which use typeof?
You need to specify a type?




Re: [dpdk-dev] 18.11.6 (LTS) patches review and test

2020-01-19 Thread Kevin Traynor
On 19/01/2020 05:31, Yu, PingX wrote:
> Kevin,
> Intel finished the following regression test as bugs are found 18.11.6-rc1. 
> All passed.
> 

Great, thank you for the report Yu Ping.

Kevin.

> * Intel(R) Testing
> # Basic Intel(R) NIC testing
> * PF(i40e): Pass
> * Build or compile: Pass
> 
> #Basic cryptodev: Pass.
> 
> Regards,
> Yu Ping
> 
> 
>> -Original Message-
>> From: Kevin Traynor [mailto:ktray...@redhat.com]
>> Sent: Tuesday, January 14, 2020 10:41 PM
>> To: sta...@dpdk.org
>> Cc: dev@dpdk.org; Abhishek Marathe ;
>> Akhil Goyal ; Ali Alnubani ;
>> Walker, Benjamin ; David Christensen
>> ; Hemant Agrawal ;
>> Stokes, Ian ; Jerin Jacob ;
>> Mcnamara, John ; Ju-Hyoung Lee
>> ; Kevin Traynor ; Luca
>> Boccassi ; Pei Zhang ; Yu, PingX
>> ; Xu, Qian Q ; Raslan Darawsheh
>> ; Thomas Monjalon ; Peng,
>> Yuan ; Chen, Zhaoyan ; Lili
>> Deng 
>> Subject: 18.11.6 (LTS) patches review and test
>>
>> Hi all,
>>
>> Here is a list of patches targeted for LTS release 18.11.6.
>>
>> The planned date for the final release is 31st January.
>>
>> Please help with testing and validation of your use cases and report any
>> issues/results with reply-all to this mail. For the final release the fixes 
>> and
>> reported validations will be added to the release notes.
>>
>> A release candidate tarball can be found at:
>>
>> https://dpdk.org/browse/dpdk-stable/tag/?id=v18.11.6-rc2
>>
>> These patches are located at branch 18.11 of dpdk-stable repo:
>> https://dpdk.org/browse/dpdk-stable/
>>
>>
>> rc2 notes:
>> Looking at the list of commits since rc1 below and the tests reported, I 
>> suggest
>> that Red Hat, Mellanox and Microsoft do not need to re-test rc2, but of 
>> course
>> you are welcome to if you prefer.
>>
>> Intel had reported some failures so it would be good to re-test those.
>>
>> rc1 -> rc2 commits:
>> 99fc7cdad test/crypto: fix checks for null digest in null auth
>> c5518d931 net/mlx: allow build only on Linux ec7abe27e pmdinfogen: fix
>> freebsd build
>> e6eefab32 kni: fix ethtool build for gcc 9
>> dd8c3d464 net/mlx: fix build with clang 9 e86a5e81e eal: remove legacy PMD
>> log macro
>> d4cea5522 eventdev: use same log macro for all unsupported calls
>> f518f3b58 eal: drop unused macros for primary process check 46367219d ci:
>> use meson 0.47.1
>> a29b3db54 net/mlx5: block RSS action without Rx queue
>>
>> Thanks.
>>
>> Kevin.
>>
>> ---
>> Aaron Conole (1):
>>   test/interrupt: account for race with callback
>>
>> Abhishek Sachan (1):
>>   net/af_packet: fix stale sockets
>>
>> Adrian Moreno (4):
>>   vhost: fix vring memory partially mapped
>>   vhost: translate incoming log address to GPA
>>   vhost: prevent zero copy mode if IOMMU is on
>>   vhost: convert buffer addresses to GPA for logging
>>
>> Ajit Khaparde (9):
>>   net/bnxt: fix setting max RSS contexts
>>   net/bnxt: fix writing MTU to FW
>>   net/bnxt: fix crash in xstats get
>>   net/bnxt: fix resource qcaps with older FW
>>   net/bnxt: fix async link handling and update
>>   net/bnxt: fix flow flush handling
>>   net/bnxt: update trusted VF status only when it changes
>>   net/bnxt: fix doorbell register offset for Tx ring
>>   net/bnxt: get default HWRM command timeout from FW
>>
>> Akhil Goyal (1):
>>   crypto/dpaa2_sec: fix length retrieved from hardware
>>
>> Ali Alnubani (3):
>>   mk: fix build on arm64
>>   eal: fix header file install with meson
>>   net/mlx: fix build with clang 9
>>
>> Alvin Zhang (1):
>>   net/i40e: fix exception with multi-driver
>>
>> Amaranath Somalapuram (5):
>>   doc: fix l2fwd-crypto usage in CCP guide
>>   crypto/ccp: fix maximum queues and burst size
>>   crypto/ccp: fix CPU authentication crash
>>   crypto/ccp: fix scheduling of burst
>>   crypto/ccp: fix digest size capabilities
>>
>> Anatoly Burakov (2):
>>   mempool: use actual IOVA addresses when populating
>>   common/octeontx: add missing public symbol
>>
>> Andrew Rybchenko (5):
>>   ethdev: fix doc reference to FDIR disabled mode
>>   ethdev: remove redundant device info cleanup before get
>>   net/sfc: fix missing notification on link status change
>>   net/virtio: reject unsupported Tx multi-queue modes
>>   ethdev: avoid undefined behaviour on configuration copy
>>
>> Andrzej Ostruszka (4):
>>   doc: fix description of versioning macros
>>   eventdev: fix possible use of uninitialized var
>>   doc: fix tap guide
>>   net/dpaa2: fix possible use of uninitialized vars
>>
>> Anoob Joseph (1):
>>   examples/ipsec-secgw: fix access to freed packet
>>
>> Archana Muniganti (1):
>>   app/crypto-perf: fix input of AEAD decrypt
>>
>> Arek Kusztal (2):
>>   crypto/qat: fix AES CMAC mininum digest size
>>   test/crypto: fix checks for null digest in null auth
>>
>> Bernard Iremonger (1):
>>   examples/ipsec-secgw: fix unchecked return value
>>
>> Bruce Richardson (4):
>>  

Re: [dpdk-dev] [PATCH v2 0/5] ethdev: add API to dump device internal flow info

2020-01-19 Thread Thomas Monjalon
17/01/2020 20:26, Ferruh Yigit:
> On 1/17/2020 11:55 AM, Xiaoyu Min wrote:
> > Xiaoyu Min (2):
> >   ethdev: add API to dump device internal flow info
> >   net/mlx5: support flow dump API
> > 
> > Xueming Li (3):
> >   app/testpmd: new flow dump CLI
> >   net/mlx5: add socket server for external tools
> >   doc: update mlx5 document for flow dump feature
> 
> Series applied to dpdk-next-net/master, thanks.

I think we are missing an update of the testpmd doc.





Re: [dpdk-dev] [pull-request] next-net 20.02 rc1

2020-01-19 Thread Thomas Monjalon
17/01/2020 20:30, Ferruh Yigit:
>   http://dpdk.org/git/next/dpdk-next-net for-main-repo

Pulled, thanks

Note that I did few changes in the release notes to group things
and improve sorting.
I also fixed some typos in logs and comments that checkpatch reported.




Re: [dpdk-dev] [dpdk-stable] [PATCH] usertools: add telemetry python3 compatibility

2020-01-19 Thread Thomas Monjalon
+Cc Robin, known Python expert :)

16/01/2020 18:24, Ciara Power:
> The client script for use with the telemetry library did not support
> python3, as the data being sent over the socket was in string format.
> Python3 requires the data be explicitly converted to bytes before being
> sent.  Similarily, the received bytes need to be decoded into string
> format.
> 
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Ciara Power 
> ---
>  usertools/dpdk-telemetry-client.py | 17 +
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/usertools/dpdk-telemetry-client.py 
> b/usertools/dpdk-telemetry-client.py
> index 290345dcc..71a8a8852 100755
> --- a/usertools/dpdk-telemetry-client.py
> +++ b/usertools/dpdk-telemetry-client.py
> @@ -65,18 +65,19 @@ def register(self): # Connects a client to DPDK-instance
>  self.socket.recv_fd.settimeout(2)
>  self.socket.send_fd.connect("/var/run/dpdk/rte/telemetry")
>  JSON = (API_REG + self.file_path + "\"}}")
> -self.socket.send_fd.sendall(JSON)
> +self.socket.send_fd.sendall(JSON.encode())
> +
>  self.socket.recv_fd.listen(1)
>  self.socket.client_fd = self.socket.recv_fd.accept()[0]
>  
>  def unregister(self): # Unregister a given client
> -self.socket.client_fd.send(API_UNREG + self.file_path + "\"}}")
> +self.socket.client_fd.send((API_UNREG + self.file_path + 
> "\"}}").encode())
>  self.socket.client_fd.close()
>  
>  def requestMetrics(self): # Requests metrics for given client
> -self.socket.client_fd.send(METRICS_REQ)
> -data = self.socket.client_fd.recv(BUFFER_SIZE)
> -print("\nResponse: \n", str(data))
> +self.socket.client_fd.send(METRICS_REQ.encode())
> +data = self.socket.client_fd.recv(BUFFER_SIZE).decode()
> +print("\nResponse: \n", data)
>  
>  def repeatedlyRequestMetrics(self, sleep_time): # Recursively requests 
> metrics for given client
>  print("\nPlease enter the number of times you'd like to continuously 
> request Metrics:")
> @@ -88,9 +89,9 @@ def repeatedlyRequestMetrics(self, sleep_time): # 
> Recursively requests metrics f
>  time.sleep(sleep_time)
>  
>  def requestGlobalMetrics(self): #Requests global metrics for given client
> -self.socket.client_fd.send(GLOBAL_METRICS_REQ)
> -data = self.socket.client_fd.recv(BUFFER_SIZE)
> -print("\nResponse: \n", str(data))
> +self.socket.client_fd.send(GLOBAL_METRICS_REQ.encode())
> +data = self.socket.client_fd.recv(BUFFER_SIZE).decode()
> +print("\nResponse: \n", data)
>  
>  def interactiveMenu(self, sleep_time): # Creates Interactive menu within 
> the script
>  while self.choice != 4:
> 







Re: [dpdk-dev] [PATCH v5] app/test: fix build when ring PMD is disabled

2020-01-19 Thread Thomas Monjalon
Someone to review please?

23/12/2019 07:53, Reshma Pattan:
> Some unit tests has dependency on RING PMD,
> so this patch is trying to fix those and other
> closely related issues.
> 
> 1)pdump, latency, bitrate, ring PMD and test_event_eth_tx_adapter
> unit tests are dependent on ring PMD, so compile those
> tests only when ring PMD is enabled else ignore.
> 
> 2)get rid of make file error which was added by bond unit test
> for ring PMD disabled case which is not necessary.
> 
> 3)Tx adapter UT is dependent on RING PMD, but it was
> observed that it was missing from the run in meson
> build, so added it. TX adapter UT uses 'sw event and
> 'null' pmd drivers, so for shared builds the drivers .so
> path has to be passed to the test args of meson UT run.
> 
> Fixes: 086eb64db3 ("test/pdump: add unit test for pdump library")
> Fixes: fdeb30fa71 ("test/bitrate: add unit tests for bitrate library")
> Fixes: 1e3676a06e ("test/latency: add unit tests for latencystats library")
> Fixes: 46cf97e4bb ("eventdev: add test for eth Tx adapter")
> Fixes: d23e09e0ef ("app/test: link with ring pmd when needed")
> 
> CC: sta...@dpdk.org
> CC: Nikhil Rao 
> CC: Chas Williams 
> CC: Bruce Richardson 
> CC: Stephen Hemminger 
> 
> Reported-by: Stephen Hemminger 
> Signed-off-by: Reshma Pattan 
> ---
> v5: remove extra blank line.
> v4: fix event_eth_tx_adapter_autotest for shared build
> as reported by travis-ci
> https://travis-ci.com/ovsrobot/dpdk/jobs/249598391
> v3: add missing test event_eth_tx_adapter_autotest.
> Add link bonding mode4 test to drivers test.
> v2: fix comments of v1 and combine the patches 1/2 and 2/2 of v1
> ---
>  app/test/Makefile| 16 +---
>  app/test/meson.build | 36 ++--
>  app/test/process.h   |  8 
>  app/test/test.c  |  2 ++
>  4 files changed, 37 insertions(+), 25 deletions(-)






Re: [dpdk-dev] [PATCH v2] Don't combine -r and -export-dynamic linker options

2020-01-19 Thread Thomas Monjalon
12/12/2019 18:53, Rafael Ávila de Espíndola:
> Running ld with -r switches the linker to a very special mode where
> some other linker options don't make sense.
> 
> In particular, -export-dynamic normally requires that all global
> symbols be included in the dynamic symbol table, but a .o file doesn't
> even have a dynamic symbol table.
> 
> When given both options it looks like the gnu linker just ignores
> -export-dynamic.
> 
> Unfortunately some versions of lld (https://lld.llvm.org/) have a bug
> that causes it to try to create a dynamic symbol table in the output
> .o file and ends up corrupting it
> (https://bugs.llvm.org/show_bug.cgi?id=43552). Current (git) version
> of lld now issues an error.
> 
> This patch filters out -export-dynamic from $(LDFLAGS) when using
> -r. With this patch I can build dpdk with lld.
> 
> Signed-off-by: Rafael Ávila de Espíndola 

Applied, thanks




Re: [dpdk-dev] [PATCH] eal/linux: fix build when VFIO is disabled

2020-01-19 Thread Thomas Monjalon
11/12/2019 19:25, Ali Alnubani:
> The header linux/version.h isn't included when CONFIG_RTE_EAL_VFIO
> is explicitly disabled. LINUX_VERSION_CODE and KERNEL_VERSION are
> therefore undefined, causing the build failure:
> 
>   lib/librte_eal/linux/eal/eal.c: In function ‘rte_eal_init’:
>   lib/librte_eal/linux/eal/eal.c:1076:32: error: "LINUX_VERSION_CODE" is
> not defined, evaluates to 0 [-Werror=undef]
> 
> Fixes: a0dede62a537 ("eal/linux: remove KNI restriction on IOVA")
> Cc: vattun...@marvell.com
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Ali Alnubani 

Applied, thanks




Re: [dpdk-dev] [dpdk-stable] [PATCH] kni: rename variable

2020-01-19 Thread Thomas Monjalon
14/01/2020 19:43, Ferruh Yigit:
> On 12/21/2019 1:02 AM, Stephen Hemminger wrote:
> > All global variables in kernel should be prefixed by the same
> > to avoid any symbol conflics. Rename dflt_carrier to kni_default_carrier.
> > 
> > Fixes: 89397a01ce4a ("kni: set default carrier state of interface")
> > Cc: d...@adax.com
> > Cc: sta...@dpdk.org
> > Signed-off-by: Stephen Hemminger 
> 
> Acked-by: Ferruh Yigit 

Applied, thanks




Re: [dpdk-dev] [PATCH v2] cfgfile: update map file

2020-01-19 Thread Thomas Monjalon
17/12/2019 12:12, Dumitrescu, Cristian:
> 
> > -Original Message-
> > From: lir...@marvell.com 
> > Sent: Tuesday, December 17, 2019 11:52 AM
> > To: dev@dpdk.org
> > Cc: Dumitrescu, Cristian ; sta...@dpdk.org;
> > Liron Himi 
> > Subject: [PATCH v2] cfgfile: update map file
> > 
> > From: Liron Himi 
> > 
> > rte_cfgfile_section_num_entries_by_index was missing from the map
> > file.
> > meson build failed when calling this function, due to linking a binary to 
> > cfgfile
> > built
> > as a shared library
> > 
> > Fixes: 85ff364f3b ("build: align symbols with global ABI version")
> > 
> > Signed-off-by: Liron Himi 
> 
> Acked-by: Cristian Dumitrescu 


Fixing the "Fixes" line with the real root cause:

Fixes: 3d2e0448ebb5 ("cfgfile: add section number of entries by index")
Cc: sta...@dpdk.org


Applied, thanks




Re: [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free

2020-01-19 Thread Thomas Monjalon
25/11/2019 19:49, Wang, Yipeng1:
>From: Dharmik Thakkar [mailto:dharmik.thak...@arm.com]
> >Remove __hash_rw_reader_unlock() calls from lock free hash lookup
> >
> >Signed-off-by: Dharmik Thakkar 
> >Reviewed-by: Gavin Hu 
> >Reviewed-by: Honnappa Nagarahalli 
> >---
> Acked-by: Yipeng Wang 

Applied, thanks




Re: [dpdk-dev] [PATCH v4] hash: added a new API to hash to query key id

2020-01-19 Thread Thomas Monjalon
27/11/2019 02:59, Wang, Yipeng1:
> From: Amber, Kumar
> >Adding new API function to query the maximum key ID
> >that could possibly be returned by rte_hash_add_key and
> >rte_hash_add_key_with_hash. When RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD
> >is set, the maximum key id is larger than the entry count specified
> >by the user.
> >
> >Signed-off-by: Kumar Amber 
> >---
> >+ *   - A value indicating the max key of Id key slots present in the table.
> >+ */
> [Wang, Yipeng] typo: key of id -> key Id of
> 
> Other than this:
> Acked-by: Yipeng Wang 

Applied with typo fixed, thanks





Re: [dpdk-dev] [PATCH] latencystats: fix latency calculation for multithread

2020-01-19 Thread Thomas Monjalon
05/12/2019 18:18, Reshma Pattan:
> Make latency calculation multithread safe by
> using spinlock.
> 
> Fixes: 5cd3cac9ed ("latency: added new library for latency stats")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: reshma pattan 

Applied, thanks





Re: [dpdk-dev] [dpdk-stable] [PATCH] fib: fix possible integer overflow

2020-01-19 Thread Thomas Monjalon
14/01/2020 18:18, Vladimir Medvedkin:
> Coverity issue: 350596
> Coverity issue: 350597

You can merge both IDs on one line, and remove the blank line after.

> 
> Fixes: c3e12e0f0354 ("fib: add dataplane algorithm for IPv6")
> Cc: vladimir.medved...@intel.com
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Vladimir Medvedkin 

Please could you add an explanation?
Thanks




Re: [dpdk-dev] [PATCH v1] rte_timer: add rte_timer_next_ticks

2020-01-19 Thread Thomas Monjalon
20/12/2019 23:43, Carrillo, Erik G:
> Hi Stephen,
> 
> I added a comment  in-line.  With that change, it looks good to me:
> 
> Acked-by: Erik Gabriel Carrillo 

Applied with below change, thanks.

> From: Stephen Hemminger 
> 
> > It is useful to know when the next timer will expire when using
> > rte_epoll_wait (or sleep when idle). This experimental API provides a hook
> > to query the number of ticks remaining.
> > 
> > Signed-off-by: Stephen Hemminger 
> > ---
> > + * Time until the next timer
> 
> s/next timer/next timer on the current lcore






Re: [dpdk-dev] [PATCH v2 0/5] ethdev: add API to dump device internal flow info

2020-01-19 Thread Jack Min
On Sun, 20-01-19, 22:08, Thomas Monjalon wrote:
> 17/01/2020 20:26, Ferruh Yigit:
> > On 1/17/2020 11:55 AM, Xiaoyu Min wrote:
> > > Xiaoyu Min (2):
> > >   ethdev: add API to dump device internal flow info
> > >   net/mlx5: support flow dump API
> > > 
> > > Xueming Li (3):
> > >   app/testpmd: new flow dump CLI
> > >   net/mlx5: add socket server for external tools
> > >   doc: update mlx5 document for flow dump feature
> > 
> > Series applied to dpdk-next-net/master, thanks.
> 
> I think we are missing an update of the testpmd doc.
> 
Yes, you are right. I'll update testpmd doc.

-Jack


Re: [dpdk-dev] [PATCH 0/4] make vhost PMD available for secondary processes

2020-01-19 Thread Itsuro ODA
Hi vhost PMD maitainers,

I have not got any feedback yet. 
Since this is the first time I submit a patch, something
may be wrong, would you tell me what should I do ?

Thanks.

On Thu,  9 Jan 2020 08:22:05 +0900
Itsuro Oda  wrote:

> vhost PMD has not been available for secondary processes since
> DPDK v18.11.  (https://bugs.dpdk.org/show_bug.cgi?id=194)
> (for a long term !)
> This series of patches intend to make vhost PMD available for
> secondary processes.
> Because now setting vhost driver to communicate with a vhost-user
> master (ex. Qemu) is accomplished by the probe function of the
> primary process, only the primary process can be a vhost-user
> slave.
> With this patch, setting vhost driver is delayed at eth_dev
> configuration in order to be able to set it from a secondary
> process. Because (in the first place,) setting vhost driver is not
> necessary to be done at probe (it is enough to be done up to eth_dev
> start), this fix is no problem for the primary process.
> There is a precondition that the same process has to operate
> a vhost interface from beginning to end (from eth_dev configuration
> to eth_dev close). (This patch leaves it to user's responsibility.)
> This precondition will not be a problem in most use cases
> (including SPP).
> 
> v2:
> - add signed-off-by
> - fix spelling error
> 
> Itsuro Oda (4):
>   net/vhost: remove an unused member
>   net/vhost: allocate iface_name from heap
>   net/vhost: delay vhost driver setup
>   net/vhost: make secondary probe complete
> 
>  drivers/net/vhost/rte_eth_vhost.c | 152 +-
>  1 file changed, 88 insertions(+), 64 deletions(-)
> 
> -- 
> 2.17.0

-- 
Itsuro ODA 



[dpdk-dev] [PATCH] net/ice: fix FDIR flag issue

2020-01-19 Thread Beilei Xing
If there's no mark action when creating a FDIR rule,
there shouldn't be FDIR flags in mbuf.

Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
Fixes: bd984f155f49 ("net/ice/base: support FDIR")
Cc: sta...@dpdk.org

Signed-off-by: Beilei Xing 
---
 drivers/net/ice/base/ice_fdir.c  | 2 +-
 drivers/net/ice/base/ice_fdir.h  | 1 +
 drivers/net/ice/base/ice_lan_tx_rx.h | 1 +
 drivers/net/ice/ice_fdir_filter.c| 4 
 4 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c
index 87fa0af..20d64f8 100644
--- a/drivers/net/ice/base/ice_fdir.c
+++ b/drivers/net/ice/base/ice_fdir.c
@@ -418,7 +418,7 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct 
ice_fdir_fltr *input,
fdir_fltr_ctx.swap = ICE_FXD_FLTR_QW1_SWAP_NOT_SET;
fdir_fltr_ctx.comp_q = ICE_FXD_FLTR_QW0_COMP_Q_ZERO;
fdir_fltr_ctx.comp_report = ICE_FXD_FLTR_QW0_COMP_REPORT_SW;
-   fdir_fltr_ctx.fdid_prio = 3;
+   fdir_fltr_ctx.fdid_prio = input->fdid_prio;
fdir_fltr_ctx.desc_prof = 1;
fdir_fltr_ctx.desc_prof_prio = 3;
ice_set_fd_desc_val(&fdir_fltr_ctx, fdesc);
diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h
index db1f835..c811f76 100644
--- a/drivers/net/ice/base/ice_fdir.h
+++ b/drivers/net/ice/base/ice_fdir.h
@@ -202,6 +202,7 @@ struct ice_fdir_fltr {
u8 cnt_ena;
u8 fltr_status;
u16 cnt_index;
+   u8 fdid_prio;
u32 fltr_id;
 };
 
diff --git a/drivers/net/ice/base/ice_lan_tx_rx.h 
b/drivers/net/ice/base/ice_lan_tx_rx.h
index a97c63c..d6f66cf 100644
--- a/drivers/net/ice/base/ice_lan_tx_rx.h
+++ b/drivers/net/ice/base/ice_lan_tx_rx.h
@@ -162,6 +162,7 @@ struct ice_fltr_desc {
 
 #define ICE_FXD_FLTR_QW1_FDID_PRI_S25
 #define ICE_FXD_FLTR_QW1_FDID_PRI_M(0x7ULL << ICE_FXD_FLTR_QW1_FDID_PRI_S)
+#define ICE_FXD_FLTR_QW1_FDID_PRI_ZERO 0x0ULL
 #define ICE_FXD_FLTR_QW1_FDID_PRI_ONE  0x1ULL
 
 #define ICE_FXD_FLTR_QW1_FDID_MDID_S   28
diff --git a/drivers/net/ice/ice_fdir_filter.c 
b/drivers/net/ice/ice_fdir_filter.c
index fa87074..8359a8c 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1534,6 +1534,10 @@ ice_fdir_parse_action(struct ice_adapter *ad,
   RTE_FLOW_ERROR_TYPE_ACTION, actions,
   "Too many mark actions");
return -rte_errno;
+   } else if (mark_num == 0) {
+   filter->input.fdid_prio = ICE_FXD_FLTR_QW1_FDID_PRI_ZERO;
+   } else {
+   filter->input.fdid_prio = ICE_FXD_FLTR_QW1_FDID_PRI_ONE;
}
 
if (counter_num >= 2) {
-- 
2.7.4



[dpdk-dev] [PATCH] doc: update testpmd guide for flow dump command

2020-01-19 Thread Xiaoyu Min
Explanation of flow dump command is added into testpmd functions.

Signed-off-by: Xiaoyu Min 
---
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 20 
 1 file changed, 20 insertions(+)

diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst 
b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index fbb3c5a3b3..5103ff9259 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3604,6 +3604,10 @@ following sections.
 
flow isolate {port_id} {boolean}
 
+- Dump internal representation information of all flows in hardware::
+
+   flow dump {port_id} {output_file}
+
 Validating flow rules
 ~
 
@@ -4466,6 +4470,22 @@ Disabling isolated mode::
  Ingress traffic on port 0 is not restricted anymore to the defined flow rules
  testpmd>
 
+Dumping HW internal information
+
+
+``flow dump`` dumps the hardware's internal representation information of
+all flows. It is bound to ``rte_flow_dev_dump()``::
+
+   flow dump {port_id} {output_file}
+
+If successful, it will show::
+
+   Flow dump finished
+
+Otherwise, it will complain error occurred::
+
+   Caught error type [...] ([...]): [...]
+
 Sample QinQ flow rules
 ~~
 
-- 
2.24.1



Re: [dpdk-dev] [RFC] DPDK Trace support

2020-01-19 Thread Jerin Jacob Kollanukkaran
> -Original Message-
> From: d...@barachs.net 
> Sent: Saturday, January 18, 2020 8:45 PM
> To: 'Ray Kinsella' ; Jerin Jacob Kollanukkaran
> ; 'dpdk-dev' 
> Subject: [EXT] RE: [RFC] [dpdk-dev] DPDK Trace support
> 
> It would be well worth considering one of the vpp techniques to minimize trace
> impact:
> 
> static inline ring_handler_inline (..., int is_traced) {
>   for (i = 0; i < vector_size; i++)
> {
>   if (is_traced)
>   {
> do_trace_work;
>   }
>   normal_packet_processing;
> }
> }
> 
> ring_handler (...)
> {
>   if (PREDICT_FALSE(global_trace_flag != 0))
> return ring_handler_inline (..., 1 /* is_traced */);
>   else
> return ring_handler_inline (..., 0 /* is_traced */); }
> 
> This reduces the runtime tax to the absolute minimum, but costs space.
> 
> Please consider it.

Thanks Dave for your thoughts.

> 
> HTH... Dave
> 
> -Original Message-
> From: Ray Kinsella 
> Sent: Monday, January 13, 2020 6:00 AM
> To: Jerin Jacob Kollanukkaran ; dpdk-dev
> ; d...@barachs.net
> Subject: Re: [RFC] [dpdk-dev] DPDK Trace support
> 
> Hi Jerin,
> 
> Any idea why lttng performance is so poor?
> I would have naturally gone there to benefit from the existing toolchain.
> 
> Have you looked at the FD.io logging/tracing infrastructure for inspiration?
> https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__wiki.fd.io_view_VPP_elog&d=DwIFaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=1
> DGob4H4rxz6H8uITozGOCa0s5f4wCNtTa4UUKvcsvI&m=b9wJHO_k_ijKT84q47_
> fO7MrN-LddnfpVSuNh6ce6Ks&s=WNwcIA86Rk2TY_C7O4bNTj3055Ofutab-
> bMPuM9-D4A&e=
> 
> Ray K
> 
> On 13/01/2020 10:40, Jerin Jacob Kollanukkaran wrote:
> > Hi All,
> >
> > I would like to add tracing support for DPDK.
> > I am planning to add this support in v20.05 release.
> >
> > This RFC attempts to get feedback from the community on
> >
> > a) Tracing Use cases.
> > b) Tracing Requirements.
> > b) Implementation choices.
> > c) Trace format.
> >
> > Use-cases
> > -
> > - Most of the cases, The DPDK provider will not have access to the DPDK
> customer applications.
> > To debug/analyze the slow path and fast path DPDK API usage from the
> > field, we need to have integrated trace support in DPDK.
> >
> > - Need a low overhead Fast path multi-core PMD driver
> > debugging/analysis infrastructure in DPDK to fix the functional and
> performance issue(s) of PMD.
> >
> > - Post trace analysis tools can provide various status across the
> > system such as cpu_idle() using the timestamp added in the trace.
> >
> >
> > Requirements:
> > -
> > - Support for Linux, FreeBSD and Windows OS
> > - Open trace format
> > - Multi-platform Open source trace viewer
> > - Absolute low overhead trace API for DPDK fast path tracing/debugging.
> > - Dynamic enable/disable of trace events
> >
> >
> > To enable trace support in DPDK, following items need to work out:
> >
> > a) Add the DPDK trace points in the DPDK source code.
> >
> > - This includes updating DPDK functions such as,
> > rte_eth_dev_configure(), rte_eth_dev_start(), rte_eth_dev_rx_burst() to emit
> the trace.
> >
> > b) Choosing suitable serialization-format
> >
> > - Common Trace Format, CTF, is an open format and language to describe
> trace formats.
> > This enables tool reuse, of which line-textual (babeltrace) and
> > graphical (TraceCompass) variants already exist.
> >
> > CTF should look familiar to C programmers but adds stronger typing.
> > See CTF - A Flexible, High-performance Binary Trace Format.
> >
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__diamon.org_ctf_&d
> >
> =DwIFaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=1DGob4H4rxz6H8uITozGOCa0s5f4
> wCNtTa4
> > UUKvcsvI&m=b9wJHO_k_ijKT84q47_fO7MrN-
> LddnfpVSuNh6ce6Ks&s=QErjHnVHM1me2
> > 4a6NGGIwiU6O5yot32ZW0vHbPnwZRg&e=
> >
> > c) Writing the on-target serialization code,
> >
> > See the section below.(Lttng CTF trace emitter vs DPDK specific CTF
> > trace emitter)
> >
> > d) Deciding on and writing the I/O transport mechanics,
> >
> > For performance reasons, it should be backed by a huge-page and write to 
> > file
> IO.
> >
> > e) Writing the PC-side deserializer/parser,
> >
> > Both the babletrace(CLI tool) and Trace Compass(GUI tool) support CTF.
> > See:
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__lttng.org_viewers
> >
> _&d=DwIFaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=1DGob4H4rxz6H8uITozGOCa0s
> 5f4wCNt
> > Ta4UUKvcsvI&m=b9wJHO_k_ijKT84q47_fO7MrN-
> LddnfpVSuNh6ce6Ks&s=JCCywchwpf
> > jb7Cta5ykYG-SHkMnNUyqPRHh9QAFIcXg&e=
> >
> > f) Writing tools for filtering and presentation.
> >
> > See item (e)
> >
> >
> > Lttng CTF trace emitter vs DPDK specific CTF trace emitter
> > --
> >
> > I have written a performance evaluation application to measure the
> > overhead of Lttng CTF emitter(The fastpath infrastructure used by
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__lttng.org_&d=DwIF
> >
> aQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=1DGob4H4rxz6H8uITo

[dpdk-dev] [PATCH] net/ice: fix fdir GTP-U pattern

2020-01-19 Thread Qi Zhang
Base on current fdir implementation for GTP-U, inner specification is
not supported, issue a rule for eth/ipv4/gtpu/ipv4 will also match
eth/ipv4/gtpu/ipv6, the patch add new pattern list to align with exist
implementation.

Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel")
Cc: sta...@dpdk.org

Signed-off-by: Qi Zhang 
---
 drivers/net/ice/ice_fdir_filter.c  |  5 ++---
 drivers/net/ice/ice_generic_flow.c | 15 +++
 drivers/net/ice/ice_generic_flow.h |  2 ++
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ice/ice_fdir_filter.c 
b/drivers/net/ice/ice_fdir_filter.c
index 4c5ddfbdb..fcf37f650 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -125,9 +125,8 @@ static struct ice_pattern_match_item 
ice_fdir_pattern_comms[] = {
   ICE_FDIR_INSET_VXLAN_IPV4_TCP,
ICE_INSET_NONE},
{pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp,
   ICE_FDIR_INSET_VXLAN_IPV4_SCTP,   
ICE_INSET_NONE},
-   {pattern_eth_ipv4_gtpu_ipv4,   ICE_FDIR_INSET_GTPU_IPV4, 
ICE_INSET_NONE},
-   {pattern_eth_ipv4_gtpu_eh_ipv4,
-  ICE_FDIR_INSET_GTPU_EH_IPV4,  
ICE_INSET_NONE},
+   {pattern_eth_ipv4_gtpu,ICE_FDIR_INSET_GTPU_IPV4, 
ICE_INSET_NONE},
+   {pattern_eth_ipv4_gtpu_eh, ICE_FDIR_INSET_GTPU_EH_IPV4,  
ICE_INSET_NONE},
 };
 
 static struct ice_flow_parser ice_fdir_parser_os;
diff --git a/drivers/net/ice/ice_generic_flow.c 
b/drivers/net/ice/ice_generic_flow.c
index c9efa8356..38ac799d8 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -1034,6 +1034,13 @@ enum rte_flow_item_type 
pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[] = {
 };
 
 /* GTPU */
+enum rte_flow_item_type pattern_eth_ipv4_gtpu[] = {
+   RTE_FLOW_ITEM_TYPE_ETH,
+   RTE_FLOW_ITEM_TYPE_IPV4,
+   RTE_FLOW_ITEM_TYPE_UDP,
+   RTE_FLOW_ITEM_TYPE_GTPU,
+   RTE_FLOW_ITEM_TYPE_END,
+};
 enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[] = {
RTE_FLOW_ITEM_TYPE_ETH,
RTE_FLOW_ITEM_TYPE_IPV4,
@@ -1042,6 +1049,14 @@ enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[] = {
RTE_FLOW_ITEM_TYPE_IPV4,
RTE_FLOW_ITEM_TYPE_END,
 };
+enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[] = {
+   RTE_FLOW_ITEM_TYPE_ETH,
+   RTE_FLOW_ITEM_TYPE_IPV4,
+   RTE_FLOW_ITEM_TYPE_UDP,
+   RTE_FLOW_ITEM_TYPE_GTPU,
+   RTE_FLOW_ITEM_TYPE_GTP_PSC,
+   RTE_FLOW_ITEM_TYPE_END,
+};
 enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[] = {
RTE_FLOW_ITEM_TYPE_ETH,
RTE_FLOW_ITEM_TYPE_IPV4,
diff --git a/drivers/net/ice/ice_generic_flow.h 
b/drivers/net/ice/ice_generic_flow.h
index ac085b47f..adc30ee2a 100644
--- a/drivers/net/ice/ice_generic_flow.h
+++ b/drivers/net/ice/ice_generic_flow.h
@@ -336,7 +336,9 @@ extern enum rte_flow_item_type 
pattern_eth_ipv6_nvgre_eth_ipv6_sctp[];
 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[];
 
 /* GTPU */
+extern enum rte_flow_item_type pattern_eth_ipv4_gtpu[];
 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[];
+extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[];
 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[];
 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_udp[];
 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_tcp[];
-- 
2.13.6



Re: [dpdk-dev] [PATCH] net/ice: fix wrong GTP-U fdir profile

2020-01-19 Thread Zhang, Qi Z



> -Original Message-
> From: Zhang, Qi Z 
> Sent: Friday, January 17, 2020 2:21 PM
> To: Cao, Yahui ; Xing, Beilei 
> Cc: dev@dpdk.org; Zhang, Qi Z ; sta...@dpdk.org
> Subject: [PATCH] net/ice: fix wrong GTP-U fdir profile
> 
> A GTP-U fdir profile should be regarded as a tunnel type, or the profile
> target to inner IPv4 will also cover inner IPv6 packet type due to some side
> effect.
> 
> Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Qi Zhang 

Nacked-by: Qi Zhang 

https://patches.dpdk.org/patch/64903/
should be the prefer fix.

> ---
>  drivers/net/ice/ice_fdir_filter.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ice/ice_fdir_filter.c
> b/drivers/net/ice/ice_fdir_filter.c
> index fa8707455..4c5ddfbdb 100644
> --- a/drivers/net/ice/ice_fdir_filter.c
> +++ b/drivers/net/ice/ice_fdir_filter.c
> @@ -987,6 +987,7 @@ ice_fdir_input_set_conf(struct ice_pf *pf, enum
> ice_fltr_ptype flow,
>   ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH |
>  ICE_FLOW_SEG_HDR_GTPU_IP |
> ICE_FLOW_SEG_HDR_IPV4);
> + is_tunnel = true;
>   break;
>   default:
>   PMD_DRV_LOG(ERR, "not supported filter type.");
> --
> 2.13.6



Re: [dpdk-dev] [PATCH] net/ice: fix FDIR flag issue

2020-01-19 Thread Zhang, Qi Z



> -Original Message-
> From: Xing, Beilei 
> Sent: Monday, January 20, 2020 8:19 PM
> To: dev@dpdk.org; Zhang, Qi Z ; Cao, Yahui
> 
> Cc: sta...@dpdk.org
> Subject: [PATCH] net/ice: fix FDIR flag issue
> 
> If there's no mark action when creating a FDIR rule, there shouldn't be
> FDIR flags in mbuf.
> 
> Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
> Fixes: bd984f155f49 ("net/ice/base: support FDIR")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Beilei Xing 

Acked-by: Qi Zhang 




Re: [dpdk-dev] [PATCH v4 0/5] integrate librte_ipsec SAD into ipsec-secgw

2020-01-19 Thread Akhil Goyal
Hi Vladimir,
The SA lookup logic and management is purely requirement based for the 
application. The application may only cater to <128 SAs which can be handled 
based on the current logic. –single-sa option cannot handle this.
Sample applications in DPDK are there to showcase the best a hardware can 
deliver. IMO, we cannot allow this logic on NXP hardwares. We give performance 
numbers based on IPSec app to customers and we cannot allow 15% degradation.
Other vendors(Marvell, ARM, AMD) please comment?
Regards,
Akhil
From: Medvedkin, Vladimir 
Sent: Friday, January 17, 2020 10:35 PM
To: Akhil Goyal ; dev@dpdk.org
Cc: konstantin.anan...@intel.com
Subject: Re: [PATCH v4 0/5] integrate librte_ipsec SAD into ipsec-secgw

Hi Akhil,
Indeed with our tests we also seeing ~15% perf drop for small packets (~90B) 
and ~3-4% drop for 1KB packets. While I am looking on a ways to minimize the 
drop, I think it would be hard, if possible at all to eliminate it completely.
Reason for that: current SAD implementation is completely synthetic (using 
plain array structure indexed by SPI value). That provides a very low overhead, 
but doesn't provide expected functionality and can't be used in proper 
implementation.
To measure plain IPsec performance without SAD user can still use '--signle-sa' 
option.
On 15/01/2020 15:45, Akhil Goyal wrote:

Hi Vladimir,



There is more than 10% drop with this patchset on NXP hardware with both legacy 
mode and the ipsec lib mode. This would need some debugging.

Didn't you see any drop on intel?



Regards,

Akhil



-Original Message-

From: Vladimir Medvedkin 


Sent: Tuesday, January 14, 2020 7:57 PM

To: dev@dpdk.org

Cc: konstantin.anan...@intel.com; Akhil 
Goyal 

Subject: [PATCH v4 0/5] integrate librte_ipsec SAD into ipsec-secgw



This series integrates SA database (SAD) capabilities from ipsec library.

The goal is to make ipsec-secgw RFC compliant regarding inbound SAD.

Also patch series removes hardcoded limitation for maximum number of SA's

and SP's.



v4:

 - put tunnel SA's into SAD with SPI_ONLY type for performance reason



v3:

 - parse SA and SP into sorted array instead of linked list



v2:

 - get rid of maximum sp limitation



Vladimir Medvedkin (5):

  ipsec: move ipsec sad name length into .h

  examples/ipsec-secgw: implement inbound SAD

  examples/ipsec-secgw: integrate inbound SAD

  examples/ipsec-secgw: get rid of maximum sa limitation

  examples/ipsec-secgw: get rid of maximum sp limitation



 examples/ipsec-secgw/Makefile  |   1 +

 examples/ipsec-secgw/ipsec-secgw.c |   4 +-

 examples/ipsec-secgw/ipsec.h   |  11 +-

 examples/ipsec-secgw/meson.build   |   2 +-

 examples/ipsec-secgw/parser.c  |   4 +

 examples/ipsec-secgw/parser.h  |   9 ++

 examples/ipsec-secgw/sa.c  | 256 +++--

 examples/ipsec-secgw/sad.c |  90 +

 examples/ipsec-secgw/sad.h |  74 +++

 examples/ipsec-secgw/sp4.c | 114 -

 examples/ipsec-secgw/sp6.c | 112 +++-

 lib/librte_ipsec/ipsec_sad.c   |  20 +--

 lib/librte_ipsec/rte_ipsec_sad.h   |   2 +

 13 files changed, 528 insertions(+), 171 deletions(-)

 create mode 100644 examples/ipsec-secgw/sad.c

 create mode 100644 examples/ipsec-secgw/sad.h



--

2.7.4



--

Regards,

Vladimir
-->


Re: [dpdk-dev] [PATCH] net/ice: fix fdir GTP-U pattern

2020-01-19 Thread Cao, Yahui
Suggest to rename ICE_FDIR_INSET_GTPU_IPV4 to ICE_FDIR_INSET_GTPU,  and rename 
ICE_FDIR_INSET_GTPU_EH_IPV4 to ICE_FDIR_INSET_GTPU_EH

Thanks.
Yahui.

-Original Message-
From: Zhang, Qi Z  
Sent: Monday, January 20, 2020 1:08 PM
To: Cao, Yahui ; Xing, Beilei 
Cc: Sun, Chenmin ; dev@dpdk.org; Zhang, Qi Z 
; sta...@dpdk.org
Subject: [PATCH] net/ice: fix fdir GTP-U pattern

Base on current fdir implementation for GTP-U, inner specification is not 
supported, issue a rule for eth/ipv4/gtpu/ipv4 will also match 
eth/ipv4/gtpu/ipv6, the patch add new pattern list to align with exist 
implementation.

Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel")
Cc: sta...@dpdk.org

Signed-off-by: Qi Zhang 
---
 drivers/net/ice/ice_fdir_filter.c  |  5 ++---  
drivers/net/ice/ice_generic_flow.c | 15 +++  
drivers/net/ice/ice_generic_flow.h |  2 ++
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ice/ice_fdir_filter.c 
b/drivers/net/ice/ice_fdir_filter.c
index 4c5ddfbdb..fcf37f650 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -125,9 +125,8 @@ static struct ice_pattern_match_item 
ice_fdir_pattern_comms[] = {
   ICE_FDIR_INSET_VXLAN_IPV4_TCP,
ICE_INSET_NONE},
{pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp,
   ICE_FDIR_INSET_VXLAN_IPV4_SCTP,   
ICE_INSET_NONE},
-   {pattern_eth_ipv4_gtpu_ipv4,   ICE_FDIR_INSET_GTPU_IPV4, 
ICE_INSET_NONE},
-   {pattern_eth_ipv4_gtpu_eh_ipv4,
-  ICE_FDIR_INSET_GTPU_EH_IPV4,  
ICE_INSET_NONE},
+   {pattern_eth_ipv4_gtpu,ICE_FDIR_INSET_GTPU_IPV4, 
ICE_INSET_NONE},
+   {pattern_eth_ipv4_gtpu_eh, ICE_FDIR_INSET_GTPU_EH_IPV4,  
ICE_INSET_NONE},
 };
 
 static struct ice_flow_parser ice_fdir_parser_os; diff --git 
a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index c9efa8356..38ac799d8 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -1034,6 +1034,13 @@ enum rte_flow_item_type 
pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[] = {  };
 
 /* GTPU */
+enum rte_flow_item_type pattern_eth_ipv4_gtpu[] = {
+   RTE_FLOW_ITEM_TYPE_ETH,
+   RTE_FLOW_ITEM_TYPE_IPV4,
+   RTE_FLOW_ITEM_TYPE_UDP,
+   RTE_FLOW_ITEM_TYPE_GTPU,
+   RTE_FLOW_ITEM_TYPE_END,
+};
 enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[] = {
RTE_FLOW_ITEM_TYPE_ETH,
RTE_FLOW_ITEM_TYPE_IPV4,
@@ -1042,6 +1049,14 @@ enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[] = {
RTE_FLOW_ITEM_TYPE_IPV4,
RTE_FLOW_ITEM_TYPE_END,
 };
+enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[] = {
+   RTE_FLOW_ITEM_TYPE_ETH,
+   RTE_FLOW_ITEM_TYPE_IPV4,
+   RTE_FLOW_ITEM_TYPE_UDP,
+   RTE_FLOW_ITEM_TYPE_GTPU,
+   RTE_FLOW_ITEM_TYPE_GTP_PSC,
+   RTE_FLOW_ITEM_TYPE_END,
+};
 enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[] = {
RTE_FLOW_ITEM_TYPE_ETH,
RTE_FLOW_ITEM_TYPE_IPV4,
diff --git a/drivers/net/ice/ice_generic_flow.h 
b/drivers/net/ice/ice_generic_flow.h
index ac085b47f..adc30ee2a 100644
--- a/drivers/net/ice/ice_generic_flow.h
+++ b/drivers/net/ice/ice_generic_flow.h
@@ -336,7 +336,9 @@ extern enum rte_flow_item_type 
pattern_eth_ipv6_nvgre_eth_ipv6_sctp[];
 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[];
 
 /* GTPU */
+extern enum rte_flow_item_type pattern_eth_ipv4_gtpu[];
 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[];
+extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[];
 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[];  extern enum 
rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_udp[];
 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_tcp[];
--
2.13.6



Re: [dpdk-dev] [PATCH] maintainers: set git tree for test applications

2020-01-19 Thread Akhil Goyal


> Changes on the main test applications should be considered against
> subtrees where most of the API changes and development happen:
> - testpmd goes through dpdk-next-net as it is mainly about ethdev,
> - dpdk-test-compress-perf goes through dpdk-next-crypto since the
>   compress API goes through this tree,
> - dpdk-test-crypto-perf through dpdk-next-crypto,
> - dpdk-test-eventdev through dpdk-next-eventdev,
> 
> Signed-off-by: David Marchand 
> ---
Acked-by: Akhil Goyal 



[dpdk-dev] [PATCH v4] net/axgbe: add a HW quirk for register definitions

2020-01-19 Thread Selwin Sebastian
V1000/R1000 processors are using the same PCI ids for the network
device as SNOWYOWL processor but has altered register definitions
for determining the window settings for the indirect PCS access.
Add support to check for this hardware and if found use the new
register values.

Signed-off-by: Selwin Sebastian 
---
 drivers/net/axgbe/axgbe_common.h |  2 ++
 drivers/net/axgbe/axgbe_ethdev.c | 40 +---
 2 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_common.h
index 34f60f156..4a3fbac16 100644
--- a/drivers/net/axgbe/axgbe_common.h
+++ b/drivers/net/axgbe/axgbe_common.h
@@ -841,6 +841,8 @@
 #define PCS_V1_WINDOW_SELECT   0x03fc
 #define PCS_V2_WINDOW_DEF  0x9060
 #define PCS_V2_WINDOW_SELECT   0x9064
+#define PCS_V2_RV_WINDOW_DEF   0x1060
+#define PCS_V2_RV_WINDOW_SELECT0x1064
 
 /* PCS register entry bit positions and sizes */
 #define PCS_V2_WINDOW_DEF_OFFSET_INDEX 6
diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index d1f160e79..f5dbba292 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -29,6 +29,7 @@ static int  axgbe_dev_info_get(struct rte_eth_dev *dev,
 
 /* The set of PCI devices this driver supports */
 #define AMD_PCI_VENDOR_ID   0x1022
+#define AMD_PCI_RV_ROOT_COMPLEX_ID 0x15d0
 #define AMD_PCI_AXGBE_DEVICE_V2A 0x1458
 #define AMD_PCI_AXGBE_DEVICE_V2B 0x1459
 
@@ -574,6 +575,29 @@ static void axgbe_default_config(struct axgbe_port *pdata)
pdata->power_down = 0;
 }
 
+static inline int
+pci_device_cmp(const struct rte_device *dev, const void *_pci_id)
+{
+   const struct rte_pci_device *pdev = RTE_DEV_TO_PCI_CONST(dev);
+   const struct rte_pci_id *pcid = _pci_id;
+
+   if (pdev->id.vendor_id == AMD_PCI_VENDOR_ID &&
+   pdev->id.device_id == pcid->device_id)
+   return 0;
+   return 1;
+}
+
+static bool pci_search_device(int device_id)
+{
+   struct rte_bus *pci_bus;
+   struct rte_pci_id dev_id;
+
+   dev_id.device_id = device_id;
+   pci_bus = rte_bus_find_by_name("pci");
+   return (pci_bus != NULL) &&
+   (pci_bus->find_device(NULL, pci_device_cmp, &dev_id) != NULL);
+}
+
 /*
  * It returns 0 on success.
  */
@@ -605,6 +629,17 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
pdata->pci_dev = pci_dev;
 
+   /*
+* Use root complex device ID to differentiate RV AXGBE vs SNOWY AXGBE
+*/
+   if (pci_search_device(AMD_PCI_RV_ROOT_COMPLEX_ID)) {
+   pdata->xpcs_window_def_reg = PCS_V2_RV_WINDOW_DEF;
+   pdata->xpcs_window_sel_reg = PCS_V2_RV_WINDOW_SELECT;
+   } else {
+   pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF;
+   pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT;
+   }
+
pdata->xgmac_regs =
(void *)pci_dev->mem_resource[AXGBE_AXGMAC_BAR].addr;
pdata->xprop_regs = (void *)((uint8_t *)pdata->xgmac_regs
@@ -620,14 +655,13 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
pdata->vdata = &axgbe_v2b;
 
/* Configure the PCS indirect addressing support */
-   reg = XPCS32_IOREAD(pdata, PCS_V2_WINDOW_DEF);
+   reg = XPCS32_IOREAD(pdata, pdata->xpcs_window_def_reg);
pdata->xpcs_window = XPCS_GET_BITS(reg, PCS_V2_WINDOW_DEF, OFFSET);
pdata->xpcs_window <<= 6;
pdata->xpcs_window_size = XPCS_GET_BITS(reg, PCS_V2_WINDOW_DEF, SIZE);
pdata->xpcs_window_size = 1 << (pdata->xpcs_window_size + 7);
pdata->xpcs_window_mask = pdata->xpcs_window_size - 1;
-   pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF;
-   pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT;
+
PMD_INIT_LOG(DEBUG,
 "xpcs window :%x, size :%x, mask :%x ", pdata->xpcs_window,
 pdata->xpcs_window_size, pdata->xpcs_window_mask);
-- 
2.17.1



Re: [dpdk-dev] [PATCH v3] drivers: add a HW quirk for register definitions

2020-01-19 Thread Sebastian, Selwin
[AMD Official Use Only - Internal Distribution Only]

Thank you David, Ferruh,
I pushed v4 of the patch with changes. 

Thanks and Regards
Selwin Sebastian

-Original Message-
From: Ferruh Yigit  
Sent: Tuesday, January 14, 2020 6:48 PM
To: David Marchand ; Sebastian, Selwin 

Cc: dev ; Thomas Monjalon 
Subject: Re: [PATCH v3] drivers: add a HW quirk for register definitions

[CAUTION: External Email]

On 1/14/2020 12:35 PM, David Marchand wrote:
> On Tue, Jan 14, 2020 at 12:58 PM Selwin Sebastian 
>  wrote:
>>
>> V1000/R1000 processors are using the same PCI ids for the network 
>> device as SNOWYOWL processor but has altered register definitions for 
>> determining the window settings for the indirect PCS access.
>> Add support to check for this hardware and if found use the new 
>> register values.
>>
>> Added a new routine rte_pci_search_device to pci driver to search for 
>> a device.
>
> You can already iterate on a bus devices.
>
> struct rte_bus *pci_bus = rte_bus_find_by_name("pci"); return pci_bus 
> != NULL && pci_bus->find_device(NULL, callback, args) != NULL;
>
> See: 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.
> dpdk.org%2Fdpdk%2Ftree%2Fdrivers%2Fbus%2Fpci%2Fpci_params.c%23n38&
> data=02%7C01%7CSelwin.Sebastian%40amd.com%7C35db24f051c546e2d13b08d798
> f438b5%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637146047002796925
> &sdata=6wBRIab3588iwCsgBV7JJ%2FjcXU5no1mKQtHxbFxJJlc%3D&reserv
> ed=0
>

Nice, this looks better approach.


Re: [dpdk-dev] [RFC] DPDK Trace support

2020-01-19 Thread dave
It would be well worth considering one of the vpp techniques to minimize trace 
impact:

static inline ring_handler_inline (..., int is_traced)
{
  for (i = 0; i < vector_size; i++)
{
  if (is_traced)
{
  do_trace_work;
}
  normal_packet_processing;
}
}

ring_handler (...)
{
  if (PREDICT_FALSE(global_trace_flag != 0))
return ring_handler_inline (..., 1 /* is_traced */);
  else
return ring_handler_inline (..., 0 /* is_traced */);
}

This reduces the runtime tax to the absolute minimum, but costs space. 

Please consider it.

HTH... Dave

-Original Message-
From: Ray Kinsella  
Sent: Monday, January 13, 2020 6:00 AM
To: Jerin Jacob Kollanukkaran ; dpdk-dev ; 
d...@barachs.net
Subject: Re: [RFC] [dpdk-dev] DPDK Trace support

Hi Jerin,

Any idea why lttng performance is so poor?
I would have naturally gone there to benefit from the existing toolchain.

Have you looked at the FD.io logging/tracing infrastructure for inspiration?
https://wiki.fd.io/view/VPP/elog

Ray K

On 13/01/2020 10:40, Jerin Jacob Kollanukkaran wrote:
> Hi All,
> 
> I would like to add tracing support for DPDK.
> I am planning to add this support in v20.05 release.
> 
> This RFC attempts to get feedback from the community on
> 
> a) Tracing Use cases.
> b) Tracing Requirements.
> b) Implementation choices.
> c) Trace format.
> 
> Use-cases
> -
> - Most of the cases, The DPDK provider will not have access to the DPDK 
> customer applications.
> To debug/analyze the slow path and fast path DPDK API usage from the 
> field, we need to have integrated trace support in DPDK.
> 
> - Need a low overhead Fast path multi-core PMD driver 
> debugging/analysis infrastructure in DPDK to fix the functional and 
> performance issue(s) of PMD.
> 
> - Post trace analysis tools can provide various status across the 
> system such as cpu_idle() using the timestamp added in the trace.
> 
> 
> Requirements:
> -
> - Support for Linux, FreeBSD and Windows OS
> - Open trace format
> - Multi-platform Open source trace viewer
> - Absolute low overhead trace API for DPDK fast path tracing/debugging.
> - Dynamic enable/disable of trace events
> 
> 
> To enable trace support in DPDK, following items need to work out: 
> 
> a) Add the DPDK trace points in the DPDK source code.
> 
> - This includes updating DPDK functions such as, 
> rte_eth_dev_configure(), rte_eth_dev_start(), rte_eth_dev_rx_burst() to emit 
> the trace.
> 
> b) Choosing suitable serialization-format
> 
> - Common Trace Format, CTF, is an open format and language to describe trace 
> formats.
> This enables tool reuse, of which line-textual (babeltrace) and 
> graphical (TraceCompass) variants already exist.
> 
> CTF should look familiar to C programmers but adds stronger typing. 
> See CTF - A Flexible, High-performance Binary Trace Format.
> 
> https://diamon.org/ctf/
> 
> c) Writing the on-target serialization code,
> 
> See the section below.(Lttng CTF trace emitter vs DPDK specific CTF 
> trace emitter)
>  
> d) Deciding on and writing the I/O transport mechanics,
> 
> For performance reasons, it should be backed by a huge-page and write to file 
> IO.
> 
> e) Writing the PC-side deserializer/parser,
> 
> Both the babletrace(CLI tool) and Trace Compass(GUI tool) support CTF.
> See: 
> https://lttng.org/viewers/
> 
> f) Writing tools for filtering and presentation.
> 
> See item (e)
> 
> 
> Lttng CTF trace emitter vs DPDK specific CTF trace emitter
> --
> 
> I have written a performance evaluation application to measure the 
> overhead of Lttng CTF emitter(The fastpath infrastructure used by 
> https://lttng.org/ library to emit the trace)
> 
> https://github.com/jerinjacobk/lttng-overhead
> https://github.com/jerinjacobk/lttng-overhead/blob/master/README
> 
> I could improve the performance by 30% by adding the "DPDK"
> based plugin for get_clock() and get_cpu(), Here are the performance 
> numbers after adding the plugin on
> x86 and various arm64 board that I have access to,
> 
> On high-end x86, it comes around 236 cycles/~100ns @ 2.4GHz (See the 
> last line in the log(ZERO_ARG)) On arm64, it varies from 312 cycles to 1100 
> cycles(based on the class of CPU).
> In short, Based on the "IPC capabilities", The cost would be around 
> 100ns to 400ns for single void trace(a trace without any argument)
> 
> 
> [lttng-overhead-x86] $ sudo ./calibrate/build/app/calibrate -c 0xc0
> make[1]: Entering directory '/export/lttng-overhead-x86/calibrate'
> make[1]: Leaving directory '/export/lttng-overhead-x86/calibrate'
> EAL: Detected 56 lcore(s)
> EAL: Detected 2 NUMA nodes
> EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
> EAL: Selected IOVA mode 'PA'
> EAL: Probing VFIO support...
> EAL: PCI device :01:00.0 on NUMA socket 0
> EAL:   probe driver: 8086:1521 net_e1000_igb
> EAL: PCI device :01:00.1 on NUMA socket 0
> EAL:   probe driver: 8086:1521 net_e1000_

[dpdk-dev] Issue :- segmentation fault in rte_eal_wait_lcore.

2020-01-19 Thread Lalithaditya Naidu Gajula
Hi All,
 I got a segmentation fault issue regarding ret_eal_wait_lcore and
rte_eal_mp_wait_lcore(),
when i am running the code in a few logical cores using rte_eal_remote
_launch() function which has a  while (1) (infinite loop) in all the
functions launched by remote launch and when i am terminating the code with
'ctrl+c' i am getting segmentation fault at  rte_eal_mp_wait_lcore(), then
I replaced that with rte_eal_wait_lcore() for the respective logical cores
even then i am getting a segmentation fault, can anyone please clarify this
issue?