[dpdk-dev] [PATCH] net/mlx5: fix redundant use of directive

2019-08-05 Thread Dekel Peled
Part of the code in function flow_dv_matcher_enable() is enclosed in
'#ifdef HAVE_MLX5DV_DR' preprocessor directive.
Using this directive is not needed here, and prevents compilation of
relevant code.

This patch removes the redundant preprocessor directive.

Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")

Signed-off-by: Dekel Peled 
---
 drivers/net/mlx5/mlx5_flow_dv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 9c0a261..582f644 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -4324,11 +4324,9 @@ struct field_modify_info modify_tcp[] = {
match_criteria_enable |=
(!HEADER_IS_ZERO(match_criteria, misc_parameters_2)) <<
MLX5_MATCH_CRITERIA_ENABLE_MISC2_BIT;
-#ifdef HAVE_MLX5DV_DR
match_criteria_enable |=
(!HEADER_IS_ZERO(match_criteria, misc_parameters_3)) <<
MLX5_MATCH_CRITERIA_ENABLE_MISC3_BIT;
-#endif
return match_criteria_enable;
 }
 
-- 
1.8.3.1



Re: [dpdk-dev] [PATCH 1/3] crypto/dpaa_sec: support IPv6 tunnel for protocol offload

2019-08-05 Thread Akhil Goyal
> 
> outer IP header is formed at the time of session initialization
> using the ipsec xform. This outer IP header will be appended by
> hardware for each packet.
> 
> Signed-off-by: Akhil Goyal 
> ---
Self NACK
Will send it again.


[dpdk-dev] [PATCH] net/ice: fix potential null pointer dereferences

2019-08-05 Thread Xiaolong Ye
This patch fixes two null pointer dereferences in flow code detected by
coverity scan.

Fixes: 94f00800d78b ("net/ice: fix VXLAN/NVGRE flow matching")
Cc: ying.a.w...@intel.com

Signed-off-by: Xiaolong Ye 
---
 drivers/net/ice/ice_generic_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/ice_generic_flow.c 
b/drivers/net/ice/ice_generic_flow.c
index 5fcf4289c..1c0adc779 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -464,7 +464,7 @@ static uint64_t ice_get_flow_field(const struct 
rte_flow_item pattern[],
   "Invalid VXLAN item");
return 0;
}
-   if (vxlan_mask->vni[0] == UINT8_MAX &&
+   if (vxlan_mask && vxlan_mask->vni[0] == UINT8_MAX &&
vxlan_mask->vni[1] == UINT8_MAX &&
vxlan_mask->vni[2] == UINT8_MAX)
input_set |= ICE_INSET_TUN_ID;
@@ -486,7 +486,7 @@ static uint64_t ice_get_flow_field(const struct 
rte_flow_item pattern[],
   "Invalid NVGRE item");
return 0;
}
-   if (nvgre_mask->tni[0] == UINT8_MAX &&
+   if (nvgre_mask && nvgre_mask->tni[0] == UINT8_MAX &&
nvgre_mask->tni[1] == UINT8_MAX &&
nvgre_mask->tni[2] == UINT8_MAX)
input_set |= ICE_INSET_TUN_ID;
-- 
2.17.1



Re: [dpdk-dev] [PATCH 1/2] net/mlx4: fix crash in dev_info_get in secondary process

2019-08-05 Thread Raslan Darawsheh
Hi,
> -Original Message-
> From: Raslan Darawsheh
> Sent: Sunday, August 4, 2019 9:58 AM
> To: Stephen Hemminger ; Matan Azrad
> ; Shahaf Shuler ;
> Yongseok Koh ; Slava Ovsiienko
> 
> Cc: dev@dpdk.org; s...@paloaltonetworks.com; sta...@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH 1/2] net/mlx4: fix crash in dev_info_get in
> secondary process
> 
> Hi Stephen,
> 
> Wrong headline format:
> net/mlx4: fix crash in dev_info_get in secondary process can you 
> please
> fix it? You shouldn't use the _ in the title format
> 
> Kindest regards,
> Raslan Darawsheh
> 
> > -Original Message-
> > From: dev  On Behalf Of Stephen Hemminger
> > Sent: Friday, July 12, 2019 11:54 PM
> > To: Matan Azrad ; Shahaf Shuler
> > ; Yongseok Koh ; Slava
> > Ovsiienko 
> > Cc: dev@dpdk.org; s...@paloaltonetworks.com; Stephen Hemminger
> > ; sta...@dpdk.org
> > Subject: [dpdk-dev] [PATCH 1/2] net/mlx4: fix crash in dev_info_get in
> > secondary process
> >
> > mlx4_dev_info_get calls mlx4_get_ifname, but mlx4_get_ifname uses
> > priv->ctx which is not a valid pointer in a secondary process. The fix
> > is to cache the value in primary.
> >
> > In the primary process, get and store the interface index of the
> > device so that secondary process can see it.
> >
> > Bugzilla ID:320
> > Fixes: 61cbdd419478 ("net/mlx4: separate device control functions")
> > Cc: sta...@dpdk.org
> > Reported-by: Suyang Ju 
> > Signed-off-by: Stephen Hemminger 
> > ---
> >  drivers/net/mlx4/mlx4.c| 19 +--
> >  drivers/net/mlx4/mlx4.h|  1 +
> >  drivers/net/mlx4/mlx4_ethdev.c |  4 +---
> >  3 files changed, 11 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index
> > 2e169b0887a7..bab2cadbe519 100644
> > --- a/drivers/net/mlx4/mlx4.c
> > +++ b/drivers/net/mlx4/mlx4.c
> > @@ -763,6 +763,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv,
> > struct rte_pci_device *pci_dev)
> > };
> > unsigned int vf;
> > int i;
> > +   char ifname[IF_NAMESIZE];
> >
> > (void)pci_drv;
> > err = mlx4_init_once();
> > @@ -1002,17 +1003,15 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv,
> > struct rte_pci_device *pci_dev)
> >  mac.addr_bytes[4], mac.addr_bytes[5]);
> > /* Register MAC address. */
> > priv->mac[0] = mac;
> > -#ifndef NDEBUG
> > -   {
> > -   char ifname[IF_NAMESIZE];
> > -
> > -   if (mlx4_get_ifname(priv, &ifname) == 0)
> > -   DEBUG("port %u ifname is \"%s\"",
> > - priv->port, ifname);
> > -   else
> > -   DEBUG("port %u ifname is unknown", priv-
> > >port);
> > +
> > +   if (mlx4_get_ifname(priv, &ifname) == 0) {
> > +   DEBUG("port %u ifname is \"%s\"",
> > + priv->port, ifname);
> > +   priv->if_index = if_nametoindex(ifname);
> > +   } else {
> > +   DEBUG("port %u ifname is unknown", priv->port);
> > }
> > -#endif
> > +
> > /* Get actual MTU if possible. */
> > mlx4_mtu_get(priv, &priv->mtu);
> > DEBUG("port %u MTU is %u", priv->port, priv->mtu); diff --git
> > a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index
> > cd0d637ac2bf..81b529ee8030 100644
> > --- a/drivers/net/mlx4/mlx4.h
> > +++ b/drivers/net/mlx4/mlx4.h
> > @@ -159,6 +159,7 @@ struct mlx4_priv {
> > struct ibv_device_attr device_attr; /**< Device properties. */
> > struct ibv_pd *pd; /**< Protection Domain. */
> > /* Device properties. */
> > +   unsigned int if_index;  /**< Associated network device index */
> > uint16_t mtu; /**< Configured MTU. */
> > uint8_t port; /**< Physical port number. */
> > uint32_t started:1; /**< Device started, flows enabled. */ diff
> > --git a/drivers/net/mlx4/mlx4_ethdev.c
> > b/drivers/net/mlx4/mlx4_ethdev.c index ceef921620a8..5d28c0116d21
> > 100644
> > --- a/drivers/net/mlx4/mlx4_ethdev.c
> > +++ b/drivers/net/mlx4/mlx4_ethdev.c
> > @@ -616,7 +616,6 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev,
> struct
> > rte_eth_dev_info *info)  {
> > struct mlx4_priv *priv = dev->data->dev_private;
> > unsigned int max;
> > -   char ifname[IF_NAMESIZE];
> >
> > /* FIXME: we should ask the device for these values. */
> > info->min_rx_bufsize = 32;
> > @@ -637,8 +636,7 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev,
> struct
> > rte_eth_dev_info *info)
> > info->rx_queue_offload_capa = mlx4_get_rx_queue_offloads(priv);
> > info->rx_offload_capa = (mlx4_get_rx_port_offloads(priv) |
> >  info->rx_queue_offload_capa);
> > -   if (mlx4_get_ifname(priv, &ifname) == 0)
> > -   info->if_index = if_nametoindex(ifname);
> > +   info->if_index = priv->if_index;
> > info->hash_key_size = MLX4_RSS_HASH_KEY_SIZE;
> > info->speed_capa =
> >   

[dpdk-dev] [Bug 336] Unable to exit DPDK application when running as separate thread.

2019-08-05 Thread bugzilla
https://bugs.dpdk.org/show_bug.cgi?id=336

Bug ID: 336
   Summary: Unable to exit DPDK application when running as
separate thread.
   Product: DPDK
   Version: 17.11
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: normal
  Priority: Normal
 Component: other
  Assignee: dev@dpdk.org
  Reporter: ullas-d.b...@hpe.com
  Target Milestone: ---

We have written application where EAL initialization and resource allocation
done in main program. Then we are launching/calling a function below
code(Reference 1).Launched Function is responsible for creating thread and
perform corresponding job,but we see that after thread completes it's job we
are not able to exit from application it gets hanged. 
And we are seeing newly created thread unable to access lcore value as accessed
by main thread.
using below function 
rte_lcore_id()

 Below is command used to run application.

#./ -l 1-2 -d /usr/local/lib/librte_pmd_e1000.so.1.1 -w
:04:00.1 -w :04:00.2

Also whatever statement/code written after below code is not executed in main
thread.

Reference 1: Code to launch function in main program. 


rte_eal_mp_remote_launch(,NULL, CALL_MASTER);
RTE_LCORE_FOREACH_SLAVE(lcore) {
  if(rte_eal_wait_lcore(lcore) < 0 ) {
 return -1;
   }
 }


can you please guide us what is the correct procedure to run DPDK application
as separate thread/Tell us what is the mistake we are doing?.

Thanks & Regards,
ullas

-- 
You are receiving this mail because:
You are the assignee for the bug.

[dpdk-dev] [PATCH] net/thunderx: fix nicvf cleanup on detaching PCI dev

2019-08-05 Thread agupta3
From: Amit Gupta 

There was a bug while doing PCI detach because of that
app gets seg fault as eth_dev is released without
stopping/cleaning up mapped nicvf.

Fixed this bug by adding nicvf cleanup stupport on PCI detach.

Fixes: fdf91e0f2fac ("drivers/net: do not use ethdev driver")
Signed-off-by: Amit Gupta 
---
 drivers/net/thunderx/nicvf_ethdev.c | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/thunderx/nicvf_ethdev.c 
b/drivers/net/thunderx/nicvf_ethdev.c
index ec57692..56769ef 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -2083,6 +2083,16 @@ static void nicvf_vf_stop(struct rte_eth_dev *dev, 
struct nicvf *nic,
return ret;
 }
 static int
+nicvf_eth_dev_uninit(struct rte_eth_dev *dev)
+{
+   PMD_INIT_FUNC_TRACE();
+
+   if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+   nicvf_dev_close(dev);
+
+   return 0;
+}
+static int
 nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)
 {
int ret;
@@ -2256,7 +2266,7 @@ static int nicvf_eth_pci_probe(struct rte_pci_driver 
*pci_drv __rte_unused,
 
 static int nicvf_eth_pci_remove(struct rte_pci_device *pci_dev)
 {
-   return rte_eth_dev_pci_generic_remove(pci_dev, NULL);
+   return rte_eth_dev_pci_generic_remove(pci_dev, nicvf_eth_dev_uninit);
 }
 
 static struct rte_pci_driver rte_nicvf_pmd = {
-- 
1.8.3.1



[dpdk-dev] [PATCH] net/mlx5: fix link speed info when link is down

2019-08-05 Thread Xiaoyu Min
When the link is down, the link speed returned by ethtool is
UINT32_MAX and the link status is 0.

In this case, the DPDK ethdev link speed should be set to
ETH_SPEED_NUM_NONE.
Otherwise since link speed is non-zero but link status is zero, this
is an inconsistent situation and -EAGAIN is returned, which is not right.

Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds")
Cc: sta...@dpdk.org

Signed-off-by: Xiaoyu Min 
---
 drivers/net/mlx5/mlx5_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 9629cfb333..33a32fc2fa 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -908,7 +908,8 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev,
dev->data->port_id, strerror(rte_errno));
return ret;
}
-   dev_link.link_speed = ecmd->speed;
+   dev_link.link_speed = (ecmd->speed == UINT32_MAX) ? ETH_SPEED_NUM_NONE :
+   ecmd->speed;
sc = ecmd->link_mode_masks[0] |
((uint64_t)ecmd->link_mode_masks[1] << 32);
priv->link_speed_capa = 0;
-- 
2.21.0



[dpdk-dev] [PATCH] net/mvpp2: remove resources when port is closed

2019-08-05 Thread lironh
From: Liron Himi 

Since 18.11, it is suggested that driver should release all its private
resources at the dev_close routine. So all resources previously released
in remove routine are now released at the dev_close routine, and the
dev_close routine will be called in driver remove routine in order to
support removing a device without closing its ports.

Above behavior changes are supported by setting RTE_ETH_DEV_CLOSE_REMOVE
flag during probe stage.

Signed-off-by: Liron Himi 
Reviewed-by: Yuri Chipchev 
---
 drivers/net/mvpp2/mrvl_ethdev.c | 79 +++--
 1 file changed, 29 insertions(+), 50 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index d1d0d41..810a703 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -144,6 +144,9 @@ static uint16_t mrvl_tx_pkt_burst(void *txq, struct 
rte_mbuf **tx_pkts,
  uint16_t nb_pkts);
 static uint16_t mrvl_tx_sg_pkt_burst(void *txq,struct rte_mbuf 
**tx_pkts,
 uint16_t nb_pkts);
+static int rte_pmd_mrvl_remove(struct rte_vdev_device *vdev);
+static void mrvl_deinit_pp2(void);
+static void mrvl_deinit_hifs(void);
 
 
 #define MRVL_XSTATS_TBL_ENTRY(name) { \
@@ -898,6 +901,22 @@ mrvl_dev_close(struct rte_eth_dev *dev)
pp2_cls_plcr_deinit(priv->default_policer);
priv->default_policer = NULL;
}
+
+
+   if (priv->bpool) {
+   pp2_bpool_deinit(priv->bpool);
+   used_bpools[priv->pp_id] &= ~(1 << priv->bpool_bit);
+   priv->bpool = NULL;
+   }
+
+   mrvl_dev_num--;
+
+   if (mrvl_dev_num == 0) {
+   MRVL_LOG(INFO, "Perform MUSDK deinit");
+   mrvl_deinit_hifs();
+   mrvl_deinit_pp2();
+   rte_mvep_deinit(MVEP_MOD_T_PP2);
+   }
 }
 
 /**
@@ -2809,6 +2828,9 @@ mrvl_eth_dev_create(struct rte_vdev_device *vdev, const 
char *name)
mrvl_set_tx_function(eth_dev);
eth_dev->dev_ops = &mrvl_ops;
 
+   /* Flag to call rte_eth_dev_release_port() in rte_eth_dev_close(). */
+   eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
+
rte_eth_dev_probing_finish(eth_dev);
return 0;
 out_free:
@@ -2818,28 +2840,6 @@ mrvl_eth_dev_create(struct rte_vdev_device *vdev, const 
char *name)
 }
 
 /**
- * Cleanup previously created device representing Ethernet port.
- *
- * @param name
- *   Pointer to the port name.
- */
-static void
-mrvl_eth_dev_destroy(const char *name)
-{
-   struct rte_eth_dev *eth_dev;
-   struct mrvl_priv *priv;
-
-   eth_dev = rte_eth_dev_allocated(name);
-   if (!eth_dev)
-   return;
-
-   priv = eth_dev->data->dev_private;
-   pp2_bpool_deinit(priv->bpool);
-   used_bpools[priv->pp_id] &= ~(1 << priv->bpool_bit);
-   rte_eth_dev_release_port(eth_dev);
-}
-
-/**
  * Callback used by rte_kvargs_process() during argument parsing.
  *
  * @param key
@@ -2959,20 +2959,15 @@ rte_pmd_mrvl_probe(struct rte_vdev_device *vdev)
ret = mrvl_eth_dev_create(vdev, ifnames.names[i]);
if (ret)
goto out_cleanup;
+   mrvl_dev_num++;
}
-   mrvl_dev_num += ifnum;
 
rte_kvargs_free(kvlist);
 
return 0;
 out_cleanup:
-   for (; i > 0; i--)
-   mrvl_eth_dev_destroy(ifnames.names[i]);
+   rte_pmd_mrvl_remove(vdev);
 
-   if (mrvl_dev_num == 0) {
-   mrvl_deinit_pp2();
-   rte_mvep_deinit(MVEP_MOD_T_PP2);
-   }
 out_free_kvlist:
rte_kvargs_free(kvlist);
 
@@ -2991,28 +2986,12 @@ rte_pmd_mrvl_probe(struct rte_vdev_device *vdev)
 static int
 rte_pmd_mrvl_remove(struct rte_vdev_device *vdev)
 {
-   int i;
-   const char *name;
+   uint16_t port_id;
 
-   name = rte_vdev_device_name(vdev);
-   if (!name)
-   return -EINVAL;
-
-   MRVL_LOG(INFO, "Removing %s", name);
-
-   RTE_ETH_FOREACH_DEV(i) { /* FIXME: removing all devices! */
-   char ifname[RTE_ETH_NAME_MAX_LEN];
-
-   rte_eth_dev_get_name_by_port(i, ifname);
-   mrvl_eth_dev_destroy(ifname);
-   mrvl_dev_num--;
-   }
-
-   if (mrvl_dev_num == 0) {
-   MRVL_LOG(INFO, "Perform MUSDK deinit");
-   mrvl_deinit_hifs();
-   mrvl_deinit_pp2();
-   rte_mvep_deinit(MVEP_MOD_T_PP2);
+   RTE_ETH_FOREACH_DEV(port_id) {
+   if (rte_eth_devices[port_id].device != &vdev->device)
+   continue;
+   rte_eth_dev_close(port_id);
}
 
return 0;
-- 
2.7.4



Re: [dpdk-dev] [PATCH] doc: announce API change in mbuf

2019-08-05 Thread Andrew Rybchenko

On 8/1/19 3:41 PM, Thomas Monjalon wrote:

In order to prepare for a long term stable API, the mbuf library
has to change: allowing more features as dynamic fields,
and fixing the lack of rte_ prefix in the namespace.
The namespace fix should not break the compatibility by keeping
some aliases during few releases to give time for migration.

Signed-off-by: Thomas Monjalon 
---
  doc/guides/rel_notes/deprecation.rst | 5 +
  1 file changed, 5 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst 
b/doc/guides/rel_notes/deprecation.rst
index 37b8592b6..e4939f1fe 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -51,6 +51,11 @@ Deprecation Notices
structure would be made internal (or removed if all dependencies are 
cleared)
in future releases.
  
+* mbuf: Some fields will be moved or converted to dynamic API in DPDK 19.11

+  in order to offer more space for the dynamic fields in future.
+  The namespace will be fixed at the same time while keeping a backward
+  compatibility for some time.
+
  * ethdev: the legacy filter API, including
``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well
as filter types MACVLAN, ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR,


The deprecation notice is better than nothing, but "some fields" is
hardly useful since it doe not provide enough information if an
application is affected or not.

Also we have no yet information on performance impact of
switching to dynamic fields.

May be it is not a problem if switching does not happen.

I have no strong opinion, just trying to raise my concerns.
May be you already have answers on it.



Re: [dpdk-dev] [PATCH] net/mlx5: fix validation of VLAN pcp item

2019-08-05 Thread Raslan Darawsheh
Hi,

> -Original Message-
> From: dev  On Behalf Of Dekel Peled
> Sent: Monday, July 29, 2019 6:15 PM
> To: Yongseok Koh ; Slava Ovsiienko
> ; Shahaf Shuler 
> Cc: Ori Kam ; dev@dpdk.org; sta...@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix validation of VLAN pcp item
> 
> Function mlx5_flow_validate_item_vlan() validates the user setting is
> supported by NIC, using a mask with TCI mask 0x0fff.
> This check will reject a flow rule specifying a vlan pcp item.
> 
> This patch updates mlx5_flow_validate_item_vlan() to use mask 0x, so
> flow rules with vlan pcp item are accepted.
> 
> Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Dekel Peled 
> ---
>  drivers/net/mlx5/mlx5_flow.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index 3d2d5fc..ec25fde 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -1218,8 +1218,8 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
>   const struct rte_flow_item_vlan *spec = item->spec;
>   const struct rte_flow_item_vlan *mask = item->mask;
>   const struct rte_flow_item_vlan nic_mask = {
> - .tci = RTE_BE16(0x0fff),
> - .inner_type = RTE_BE16(0x),
> + .tci = RTE_BE16(UINT16_MAX),
> + .inner_type = RTE_BE16(UINT16_MAX),
>   };
>   uint16_t vlan_tag = 0;
>   const int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
> --
> 1.8.3.1


Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh


[dpdk-dev] [PATCH v2 2/3] crypto/dpaa2_sec: support IPv6 tunnel for protocol offload

2019-08-05 Thread Akhil Goyal
outer IP header is formed at the time of session initialization
using the ipsec xform. This outer IP header will be appended by
hardware for each packet.

Signed-off-by: Akhil Goyal 
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 73 +++--
 drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h   |  2 +
 2 files changed, 55 insertions(+), 20 deletions(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c 
b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 26458e5d1..12961e313 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -2465,23 +2466,9 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
 
session->ctxt_type = DPAA2_SEC_IPSEC;
if (ipsec_xform->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {
-   struct ip ip4_hdr;
+   uint8_t *hdr = NULL;
 
flc->dhr = SEC_FLC_DHR_OUTBOUND;
-   ip4_hdr.ip_v = IPVERSION;
-   ip4_hdr.ip_hl = 5;
-   ip4_hdr.ip_len = rte_cpu_to_be_16(sizeof(ip4_hdr));
-   ip4_hdr.ip_tos = ipsec_xform->tunnel.ipv4.dscp;
-   ip4_hdr.ip_id = 0;
-   ip4_hdr.ip_off = 0;
-   ip4_hdr.ip_ttl = ipsec_xform->tunnel.ipv4.ttl;
-   ip4_hdr.ip_p = IPPROTO_ESP;
-   ip4_hdr.ip_sum = 0;
-   ip4_hdr.ip_src = ipsec_xform->tunnel.ipv4.src_ip;
-   ip4_hdr.ip_dst = ipsec_xform->tunnel.ipv4.dst_ip;
-   ip4_hdr.ip_sum = calc_chksum((uint16_t *)(void *)&ip4_hdr,
-   sizeof(struct ip));
-
/* For Sec Proto only one descriptor is required. */
memset(&encap_pdb, 0, sizeof(struct ipsec_encap_pdb));
encap_pdb.options = (IPVERSION << PDBNH_ESP_ENCAP_SHIFT) |
@@ -2490,18 +2477,64 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
PDBHMO_ESP_ENCAP_DTTL |
PDBHMO_ESP_SNR;
encap_pdb.spi = ipsec_xform->spi;
-   encap_pdb.ip_hdr_len = sizeof(struct ip);
-
session->dir = DIR_ENC;
+
+   if (ipsec_xform->tunnel.type ==
+   RTE_SECURITY_IPSEC_TUNNEL_IPV4) {
+   struct ip ip4_hdr;
+
+   encap_pdb.ip_hdr_len = sizeof(struct ip);
+   ip4_hdr.ip_v = IPVERSION;
+   ip4_hdr.ip_hl = 5;
+   ip4_hdr.ip_len = rte_cpu_to_be_16(sizeof(ip4_hdr));
+   ip4_hdr.ip_tos = ipsec_xform->tunnel.ipv4.dscp;
+   ip4_hdr.ip_id = 0;
+   ip4_hdr.ip_off = 0;
+   ip4_hdr.ip_ttl = ipsec_xform->tunnel.ipv4.ttl;
+   ip4_hdr.ip_p = IPPROTO_ESP;
+   ip4_hdr.ip_sum = 0;
+   ip4_hdr.ip_src = ipsec_xform->tunnel.ipv4.src_ip;
+   ip4_hdr.ip_dst = ipsec_xform->tunnel.ipv4.dst_ip;
+   ip4_hdr.ip_sum = calc_chksum((uint16_t *)(void *)
+   &ip4_hdr, sizeof(struct ip));
+   hdr = (uint8_t *)&ip4_hdr;
+   } else if (ipsec_xform->tunnel.type ==
+   RTE_SECURITY_IPSEC_TUNNEL_IPV6) {
+   struct rte_ipv6_hdr ip6_hdr;
+
+   ip6_hdr.vtc_flow = rte_cpu_to_be_32(
+   DPAA2_IPv6_DEFAULT_VTC_FLOW |
+   ((ipsec_xform->tunnel.ipv6.dscp <<
+   RTE_IPV6_HDR_TC_SHIFT) &
+   RTE_IPV6_HDR_TC_MASK) |
+   ((ipsec_xform->tunnel.ipv6.flabel <<
+   RTE_IPV6_HDR_FL_SHIFT) &
+   RTE_IPV6_HDR_FL_MASK));
+   /* Payload length will be updated by HW */
+   ip6_hdr.payload_len = 0;
+   ip6_hdr.hop_limits =
+   ipsec_xform->tunnel.ipv6.hlimit;
+   ip6_hdr.proto = (ipsec_xform->proto ==
+   RTE_SECURITY_IPSEC_SA_PROTO_ESP) ?
+   IPPROTO_ESP : IPPROTO_AH;
+   memcpy(&ip6_hdr.src_addr,
+   &ipsec_xform->tunnel.ipv6.src_addr, 16);
+   memcpy(&ip6_hdr.dst_addr,
+   &ipsec_xform->tunnel.ipv6.dst_addr, 16);
+   encap_pdb.ip_hdr_len = sizeof(struct rte_ipv6_hdr);
+   hdr = (uint8_t *)&ip6_hdr;
+   }
bufsize = cnstr_shdsc_ipsec_new_encap(priv->flc_desc[0].desc,
1, 0, SHR_SERIAL, &encap_pdb,
-   (uint8_t *)&ip4_hdr,
- 

[dpdk-dev] [PATCH v2 0/3] support IPv6 tunnel for lookaside crypto

2019-08-05 Thread Akhil Goyal


changes in v2:
used RTE_IPV6_HDR_* macros instead of localized driver specific macros.


Akhil Goyal (3):
  crypto/dpaa_sec: support IPv6 tunnel for protocol offload
  crypto/dpaa2_sec: support IPv6 tunnel for protocol offload
  examples/ipsec-secgw: support IPv6 tunnel for lookaside proto

 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 73 +++--
 drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h   |  2 +
 drivers/crypto/dpaa_sec/dpaa_sec.c  | 71 +++-
 drivers/crypto/dpaa_sec/dpaa_sec.h  |  7 +-
 examples/ipsec-secgw/ipsec.c| 14 +++-
 5 files changed, 127 insertions(+), 40 deletions(-)

-- 
2.17.1



[dpdk-dev] [PATCH v2 1/3] crypto/dpaa_sec: support IPv6 tunnel for protocol offload

2019-08-05 Thread Akhil Goyal
outer IP header is formed at the time of session initialization
using the ipsec xform. This outer IP header will be appended by
hardware for each packet.

Signed-off-by: Akhil Goyal 
---
 drivers/crypto/dpaa_sec/dpaa_sec.c | 71 ++
 drivers/crypto/dpaa_sec/dpaa_sec.h |  7 ++-
 2 files changed, 59 insertions(+), 19 deletions(-)

diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c 
b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 122c80a07..e6f57ce3d 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -2230,26 +2230,58 @@ dpaa_sec_set_ipsec_session(__rte_unused struct 
rte_cryptodev *dev,
}
 
if (ipsec_xform->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {
-   memset(&session->encap_pdb, 0, sizeof(struct ipsec_encap_pdb) +
+   if (ipsec_xform->tunnel.type ==
+   RTE_SECURITY_IPSEC_TUNNEL_IPV4) {
+   memset(&session->encap_pdb, 0,
+   sizeof(struct ipsec_encap_pdb) +
sizeof(session->ip4_hdr));
-   session->ip4_hdr.ip_v = IPVERSION;
-   session->ip4_hdr.ip_hl = 5;
-   session->ip4_hdr.ip_len = rte_cpu_to_be_16(
+   session->ip4_hdr.ip_v = IPVERSION;
+   session->ip4_hdr.ip_hl = 5;
+   session->ip4_hdr.ip_len = rte_cpu_to_be_16(
sizeof(session->ip4_hdr));
-   session->ip4_hdr.ip_tos = ipsec_xform->tunnel.ipv4.dscp;
-   session->ip4_hdr.ip_id = 0;
-   session->ip4_hdr.ip_off = 0;
-   session->ip4_hdr.ip_ttl = ipsec_xform->tunnel.ipv4.ttl;
-   session->ip4_hdr.ip_p = (ipsec_xform->proto ==
-   RTE_SECURITY_IPSEC_SA_PROTO_ESP) ? IPPROTO_ESP
-   : IPPROTO_AH;
-   session->ip4_hdr.ip_sum = 0;
-   session->ip4_hdr.ip_src = ipsec_xform->tunnel.ipv4.src_ip;
-   session->ip4_hdr.ip_dst = ipsec_xform->tunnel.ipv4.dst_ip;
-   session->ip4_hdr.ip_sum = calc_chksum((uint16_t *)
+   session->ip4_hdr.ip_tos = ipsec_xform->tunnel.ipv4.dscp;
+   session->ip4_hdr.ip_id = 0;
+   session->ip4_hdr.ip_off = 0;
+   session->ip4_hdr.ip_ttl = ipsec_xform->tunnel.ipv4.ttl;
+   session->ip4_hdr.ip_p = (ipsec_xform->proto ==
+   RTE_SECURITY_IPSEC_SA_PROTO_ESP) ?
+   IPPROTO_ESP : IPPROTO_AH;
+   session->ip4_hdr.ip_sum = 0;
+   session->ip4_hdr.ip_src =
+   ipsec_xform->tunnel.ipv4.src_ip;
+   session->ip4_hdr.ip_dst =
+   ipsec_xform->tunnel.ipv4.dst_ip;
+   session->ip4_hdr.ip_sum = calc_chksum((uint16_t *)
(void *)&session->ip4_hdr,
sizeof(struct ip));
-
+   session->encap_pdb.ip_hdr_len = sizeof(struct ip);
+   } else if (ipsec_xform->tunnel.type ==
+   RTE_SECURITY_IPSEC_TUNNEL_IPV6) {
+   memset(&session->encap_pdb, 0,
+   sizeof(struct ipsec_encap_pdb) +
+   sizeof(session->ip6_hdr));
+   session->ip6_hdr.vtc_flow = rte_cpu_to_be_32(
+   DPAA_IPv6_DEFAULT_VTC_FLOW |
+   ((ipsec_xform->tunnel.ipv6.dscp <<
+   RTE_IPV6_HDR_TC_SHIFT) &
+   RTE_IPV6_HDR_TC_MASK) |
+   ((ipsec_xform->tunnel.ipv6.flabel <<
+   RTE_IPV6_HDR_FL_SHIFT) &
+   RTE_IPV6_HDR_FL_MASK));
+   /* Payload length will be updated by HW */
+   session->ip6_hdr.payload_len = 0;
+   session->ip6_hdr.hop_limits =
+   ipsec_xform->tunnel.ipv6.hlimit;
+   session->ip6_hdr.proto = (ipsec_xform->proto ==
+   RTE_SECURITY_IPSEC_SA_PROTO_ESP) ?
+   IPPROTO_ESP : IPPROTO_AH;
+   memcpy(&session->ip6_hdr.src_addr,
+   &ipsec_xform->tunnel.ipv6.src_addr, 16);
+   memcpy(&session->ip6_hdr.dst_addr,
+   &ipsec_xform->tunnel.ipv6.dst_addr, 16);
+   session->encap_pdb.ip_hdr_len =
+   sizeof(struct rte_ipv6_hdr);
+   }
   

[dpdk-dev] [PATCH v2 3/3] examples/ipsec-secgw: support IPv6 tunnel for lookaside proto

2019-08-05 Thread Akhil Goyal
IPv6 tunnels are already supported in case of inline and
lookaside none cases. In case of protocol offload, the details
for IPv6 header need to be added in session configuration
for security session create.

Signed-off-by: Akhil Goyal 
---
 examples/ipsec-secgw/ipsec.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index dc85adfe5..317faed7a 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -33,8 +33,20 @@ set_ipsec_conf(struct ipsec_sa *sa, struct 
rte_security_ipsec_xform *ipsec)
 
memcpy((uint8_t *)&tunnel->ipv4.dst_ip,
(uint8_t *)&sa->dst.ip.ip4, 4);
+   } else if (IS_IP6_TUNNEL(sa->flags)) {
+   tunnel->type =
+   RTE_SECURITY_IPSEC_TUNNEL_IPV6;
+   tunnel->ipv6.hlimit = IPDEFTTL;
+   tunnel->ipv6.dscp = 0;
+   tunnel->ipv6.flabel = 0;
+
+   memcpy((uint8_t *)&tunnel->ipv6.src_addr,
+   (uint8_t *)&sa->src.ip.ip6.ip6_b, 16);
+
+   memcpy((uint8_t *)&tunnel->ipv6.dst_addr,
+   (uint8_t *)&sa->dst.ip.ip6.ip6_b, 16);
}
-   /* TODO support for Transport and IPV6 tunnel */
+   /* TODO support for Transport */
}
ipsec->esn_soft_limit = IPSEC_OFFLOAD_ESN_SOFTLIMIT;
 }
-- 
2.17.1



[dpdk-dev] [PATCH] net/memif: fix coverity defects

2019-08-05 Thread Jakub Grajciar
fixes CID: 343440, 343459, 343464, 343394

Signed-off-by: Jakub Grajciar 
---
 drivers/net/memif/memif_socket.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 01a935f87..65dff321c 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -852,7 +852,7 @@ memif_listener_handler(void *arg)
return;
 
  error:
-   if (sockfd > 0) {
+   if (sockfd >= 0) {
close(sockfd);
sockfd = -1;
}
@@ -921,6 +921,8 @@ memif_socket_create(struct pmd_internals *pmd, char *key, 
uint8_t listener)
rte_vdev_device_name(pmd->vdev), key, strerror(errno));
if (sock != NULL)
rte_free(sock);
+   if (sockfd >= 0)
+   close (sockfd);
return NULL;
 }
 
@@ -1010,6 +1012,7 @@ memif_socket_remove_device(struct rte_eth_dev *dev)
struct memif_socket *socket = NULL;
struct memif_socket_dev_list_elt *elt, *next;
struct rte_hash *hash;
+   int ret;
 
hash = rte_hash_find_existing(MEMIF_SOCKET_HASH_NAME);
if (hash == NULL)
@@ -1037,7 +1040,10 @@ memif_socket_remove_device(struct rte_eth_dev *dev)
/* remove listener socket file,
 * so we can create new one later.
 */
-   remove(socket->filename);
+   ret = remove(socket->filename);
+   if (ret < 0)
+   MIF_LOG(ERR, "Failed to remove socket file: %s",
+   socket->filename);
}
rte_free(socket);
}
@@ -1113,7 +1119,7 @@ memif_connect_slave(struct rte_eth_dev *dev)
return 0;
 
  error:
-   if (sockfd > 0) {
+   if (sockfd >= 0) {
close(sockfd);
sockfd = -1;
}
-- 
2.17.1



[dpdk-dev] [PATCH v2] net/memif: fix coverity defects

2019-08-05 Thread Jakub Grajciar
fixes CID: 343440, 343459, 343464, 343394

Signed-off-by: Jakub Grajciar 
---
 drivers/net/memif/memif_socket.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

V2:
- fix coding style

diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 01a935f87..137033f68 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -852,7 +852,7 @@ memif_listener_handler(void *arg)
return;

  error:
-   if (sockfd > 0) {
+   if (sockfd >= 0) {
close(sockfd);
sockfd = -1;
}
@@ -921,6 +921,8 @@ memif_socket_create(struct pmd_internals *pmd, char *key, 
uint8_t listener)
rte_vdev_device_name(pmd->vdev), key, strerror(errno));
if (sock != NULL)
rte_free(sock);
+   if (sockfd >= 0)
+   close(sockfd);
return NULL;
 }

@@ -1010,6 +1012,7 @@ memif_socket_remove_device(struct rte_eth_dev *dev)
struct memif_socket *socket = NULL;
struct memif_socket_dev_list_elt *elt, *next;
struct rte_hash *hash;
+   int ret;

hash = rte_hash_find_existing(MEMIF_SOCKET_HASH_NAME);
if (hash == NULL)
@@ -1037,7 +1040,10 @@ memif_socket_remove_device(struct rte_eth_dev *dev)
/* remove listener socket file,
 * so we can create new one later.
 */
-   remove(socket->filename);
+   ret = remove(socket->filename);
+   if (ret < 0)
+   MIF_LOG(ERR, "Failed to remove socket file: %s",
+   socket->filename);
}
rte_free(socket);
}
@@ -1113,7 +1119,7 @@ memif_connect_slave(struct rte_eth_dev *dev)
return 0;

  error:
-   if (sockfd > 0) {
+   if (sockfd >= 0) {
close(sockfd);
sockfd = -1;
}
--
2.17.1


[dpdk-dev] [PATCH v2] net/ice: fix potential null pointer dereferences

2019-08-05 Thread Xiaolong Ye
This patch fixes two null pointer dereferences in flow code detected by
coverity scan.

Coverity issue: 345815, 345816
Fixes: 94f00800d78b ("net/ice: fix VXLAN/NVGRE flow matching")
Cc: ying.a.w...@intel.com

Signed-off-by: Xiaolong Ye 
---
v2 change:

- add coverity ids

 drivers/net/ice/ice_generic_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/ice_generic_flow.c 
b/drivers/net/ice/ice_generic_flow.c
index 5fcf4289c..1c0adc779 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -464,7 +464,7 @@ static uint64_t ice_get_flow_field(const struct 
rte_flow_item pattern[],
   "Invalid VXLAN item");
return 0;
}
-   if (vxlan_mask->vni[0] == UINT8_MAX &&
+   if (vxlan_mask && vxlan_mask->vni[0] == UINT8_MAX &&
vxlan_mask->vni[1] == UINT8_MAX &&
vxlan_mask->vni[2] == UINT8_MAX)
input_set |= ICE_INSET_TUN_ID;
@@ -486,7 +486,7 @@ static uint64_t ice_get_flow_field(const struct 
rte_flow_item pattern[],
   "Invalid NVGRE item");
return 0;
}
-   if (nvgre_mask->tni[0] == UINT8_MAX &&
+   if (nvgre_mask && nvgre_mask->tni[0] == UINT8_MAX &&
nvgre_mask->tni[1] == UINT8_MAX &&
nvgre_mask->tni[2] == UINT8_MAX)
input_set |= ICE_INSET_TUN_ID;
-- 
2.17.1



[dpdk-dev] [PATCH v2] doc: add a co-existence consideration for qede PMD

2019-08-05 Thread Rasesh Mody
Add and update co-existence considerations for qede PMD

v2:
Made co-existence considerations for QLogic adapters more specific

Cc: sta...@dpdk.org

Signed-off-by: Rasesh Mody 
---
 doc/guides/nics/qede.rst | 25 ++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/doc/guides/nics/qede.rst b/doc/guides/nics/qede.rst
index c0a383381..05a6aef57 100644
--- a/doc/guides/nics/qede.rst
+++ b/doc/guides/nics/qede.rst
@@ -7,7 +7,7 @@ QEDE Poll Mode Driver
 
 The QEDE poll mode driver library (**librte_pmd_qede**) implements support
 for **QLogic FastLinQ QL4 10G/25G/40G/50G/100G Intelligent Ethernet 
Adapters (IEA) and Converged Network Adapters (CNA)** family of adapters as 
well as SR-IOV virtual functions (VF). It is supported on
-several standard Linux distros like RHEL7.x, SLES12.x and Ubuntu.
+several standard Linux distros like RHEL, SLES, Ubuntu etc.
 It is compile-tested under FreeBSD OS.
 
 More information can be found at `QLogic Corporation's Website
@@ -47,8 +47,27 @@ Non-supported Features
 
 Co-existence considerations
 ---
-- QLogic FastLinQ QL4 CNAs can have both NIC and Storage personalities. 
However, coexistence with storage protocol drivers (qedi and qedf) is not 
supported on the same adapter. So storage personality has to be disabled on 
that adapter when used in DPDK applications.
-- For SR-IOV case, qede PMD will be used to bind to SR-IOV VF device and Linux 
native kernel driver (qede) will be attached to SR-IOV PF.
+
+- QLogic FastLinQ QL4 CNAs support Ethernet, RDMA, iSCSI and FCoE
+  functionalities. These functionalities are supported using
+  QLogic Linux kernel drivers qed, qede, qedr, qedi and qedf. DPDK is
+  supported on these adapters using qede PMD.
+
+- When SR-IOV is not enabled on the adapter,
+  QLogic Linux kernel drivers (qed, qede, qedr, qedi and qedf) and qede
+  PMD can’t be attached to different PFs on a given QLogic FastLinQ
+  QL4xxx adapter.
+  A given adapter needs to be completely used by DPDK or Linux drivers
+  Before binding DPDK driver to one or more PFs on the adapter,
+  please make sure to unbind Linux drivers from all PFs of the adapter.
+  If there are multiple adapters on the system, one or more adapters
+  can be used by DPDK driver completely and other adapters can be used
+  by Linux drivers completely.
+
+- When SR-IOV is enabled on the adapter,
+  Linux kernel drivers (qed, qede, qedr, qedi and qedf) can be bound
+  to the PFs of a given adapter and either qede PMD or Linux drivers
+  (qed and qede) can be bound to the VFs of the adapter.
 
 Supported QLogic Adapters
 -
-- 
2.18.0



[dpdk-dev] [PATCH v2 2/2] doc: add a co-existence consideration for bnx2x PMD

2019-08-05 Thread Rasesh Mody
Add and update co-existence considerations for bnx2x PMD
Cc: sta...@dpdk.org

v2:
Made co-existence considerations for QLogic adapters more specific

Signed-off-by: Rasesh Mody 
---
 doc/guides/nics/bnx2x.rst | 30 +-
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
index a7dee0c10..00e131484 100644
--- a/doc/guides/nics/bnx2x.rst
+++ b/doc/guides/nics/bnx2x.rst
@@ -33,7 +33,7 @@ BNX2X Poll Mode Driver
 The BNX2X poll mode driver library (**librte_pmd_bnx2x**) implements support
 for **QLogic 578xx** 10/20 Gbps family of adapters as well as their virtual
 functions (VF) in SR-IOV context. It is supported on several standard Linux
-distros like Red Hat 7.x and SLES12 OS. It is compile-tested under FreeBSD OS.
+distros like RHEL and SLES. It is compile-tested under FreeBSD OS.
 
 More information can be found at `QLogic Corporation's Official Website
 `_.
@@ -64,14 +64,26 @@ The features not yet supported include:
 Co-existence considerations
 ---
 
-- BCM578xx being a CNA can have both NIC and Storage personalities.
-  However, coexistence with storage protocol drivers (cnic, bnx2fc and
-  bnx2fi) is not supported on the same adapter. So storage personality
-  has to be disabled on that adapter when used in DPDK applications.
-
-- For SR-IOV case, bnx2x PMD will be used to bind to SR-IOV VF device and
-  Linux native kernel driver (bnx2x) will be attached to SR-IOV PF.
-
+- QLogic 578xx CNAs support Ethernet, iSCSI and FCoE functionalities.
+  These functionalities are supported using QLogic Linux kernel
+  drivers bnx2x, cnic, bnx2i and bnx2fc. DPDK is supported on these
+  adapters using bnx2x PMD.
+
+- When SR-IOV is not enabled on the adapter,
+  QLogic Linux kernel drivers (bnx2x, cnic, bnx2i and bnx2fc) and bnx2x
+  PMD can’t be attached to different PFs on a given QLogic 578xx
+  adapter.
+  A given adapter needs to be completely used by DPDK or Linux drivers.
+  Before binding DPDK driver to one or more PFs on the adapter,
+  please make sure to unbind Linux drivers from all PFs of the adapter.
+  If there are multiple adapters on the system, one or more adapters
+  can be used by DPDK driver completely and other adapters can be used
+  by Linux drivers completely.
+
+- When SR-IOV is enabled on the adapter,
+  Linux kernel drivers (bnx2x, cnic, bnx2i and bnx2fc) can be bound
+  to the PFs of a given adapter and either bnx2x PMD or Linux drivers
+  bnx2x can be bound to the VFs of the adapter.
 
 Supported QLogic NICs
 -
-- 
2.18.0



[dpdk-dev] [PATCH v2 1/2] doc: use SPDX tag for bnx2x PMD guide

2019-08-05 Thread Rasesh Mody
Use SPDX tag for bnx2x PMD guide

v2:
add short patch description

Signed-off-by: Rasesh Mody 
---
 doc/guides/nics/bnx2x.rst | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
index cecbfc2e7..a7dee0c10 100644
--- a/doc/guides/nics/bnx2x.rst
+++ b/doc/guides/nics/bnx2x.rst
@@ -1,6 +1,5 @@
-..  BSD LICENSE
+..  SPDX-License-Identifier: BSD-3-Clause
 Copyright (c) 2015 QLogic Corporation
-All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
-- 
2.18.0



Re: [dpdk-dev] [PATCH] doc: add a co-existence consideration for qede PMD

2019-08-05 Thread Rasesh Mody
Hi Thomas,

>From: Thomas Monjalon 
>Sent: Wednesday, July 31, 2019 1:31 AM
>
>31/07/2019 10:02, Rasesh Mody:
>> Add and update co-existence considerations for qede PMD
>>
>> Signed-off-by: Rasesh Mody 
>> ---
>>  doc/guides/nics/qede.rst | 21 +++--
>>  1 file changed, 19 insertions(+), 2 deletions(-)
>>
>> +- Linux kernel drivers and qede PMD can’t be mixed on a given FastLinQ
>> +  QL4xxx adapter. This type of coexistence is unsupported. A given
>> +  adapter needs to be completely used by DPDK or Linux drivers, when
>> +  SR-IOV is not enabled. Before binging DPDK driver to one or more
>> +  devices on the adapter, please make sure to unbind Linux drivers from
>> +  all devices of the adapter. If there are multiple adapters on the
>> +  system, one or more adapter can be used by DPDK driver and other
>> +  adapters can be used by Linux drivers.
>> +
>> +- When SR-IOV is enabled, Linux native kernel driver (qede) can be bound
>> +  to the PFs of a given adapter and either DPDK or Linux drivers can be
>> +  bound to the VFs of the adapter.
>
>This part is not specific to qede, but related to UIO/VFIO behaviour.
>I think we already have this kind of explanation in the Linux guide.
>If not, please update it and add a reference link from here.

I've sent updated v2 version of co-existence consideration for Qlogic adapters. 
These considerations are specific to qede PMD. Usage of DPDK and QLogic Linux 
drivers across multiple PFs on the same adapter is not possible and unique for 
our architecture. We do not want to add notes regarding UIO/VFIO behavior here 
as its common to others as well.

Thanks!
-Rasesh
 
>Thanks
>




Re: [dpdk-dev] [PATCH 2/2] doc: add a co-existence consideration for bnx2x PMD

2019-08-05 Thread Rasesh Mody
>From: Thomas Monjalon 
>Sent: Wednesday, July 31, 2019 1:33 AM
>
>31/07/2019 10:02, Rasesh Mody:
>> Add and update co-existence considerations for bnx2x PMD
>>
>> Signed-off-by: Rasesh Mody 
>> ---
>>  doc/guides/nics/bnx2x.rst | 15 ---
>>  1 file changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
>> index a7dee0c10..358ed7927 100644
>> --- a/doc/guides/nics/bnx2x.rst
>> +++ b/doc/guides/nics/bnx2x.rst
>> @@ -69,9 +69,18 @@ Co-existence considerations
>>bnx2fi) is not supported on the same adapter. So storage personality
>>has to be disabled on that adapter when used in DPDK applications.
>>
>> -- For SR-IOV case, bnx2x PMD will be used to bind to SR-IOV VF device
>> and
>> -  Linux native kernel driver (bnx2x) will be attached to SR-IOV PF.
>> -
>> +- Linux kernel drivers and bnx2x PMD can’t be mixed on a given
>> +BCM578xx
>> +  adapter. This type of coexistence is unsupported. A given adapter
>> +  needs to be completely used by DPDK or Linux drivers, when SR-IOV
>> +  is not enabled. Before binging DPDK driver to one or more devices
>> +on
>> +  the adapter, please make sure to unbind Linux drivers from all
>> +devices
>> +  of the adapter. If there are multiple adapters on the system, one
>> +or
>> +  more adapter can be used by DPDK driver and other adapters can be
>> +used
>> +  by Linux drivers.
>> +
>> +- When SR-IOV is enabled, Linux native kernel driver (bnx2x) can be
>> +  bound to the PFs of a given adapter and either DPDK or Linux
>> +drivers
>> +  can be bound to the VFs of the adapter.
>
>Same comment as for qede: this is not specific to the PMD.
>Please update and reference the Linux guide.

Please see the v2 set with documentation specific to QLogic adapters and use of 
bnx2x PMD.

Thanks!
-Rasesh



Re: [dpdk-dev] [PATCH v3] eal: warn on legacy memory allocation requirement

2019-08-05 Thread Thomas Monjalon
31/07/2019 11:15, Burakov, Anatoly:
> On 30-Jul-19 6:21 PM, Thomas Monjalon wrote:
> > When using --no-huge mode, dynamic allocation is not supported.
> > Because of this limitation, the option --legacy-mem is implied
> > and -m may be needed to specify the amount of memory to allocate.
> > Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.
> > 
> > The option --socket-mem can also be used with --legacy-mem
> > when hugepages are supported.
> > 
> > Signed-off-by: Thomas Monjalon 
> 
> Acked-by: Anatoly Burakov 

Applied





Re: [dpdk-dev] [dpdk-stable] [PATCH] eal: hide internal function

2019-08-05 Thread Thomas Monjalon
31/07/2019 14:07, David Marchand:
> This function has never been used outside of this code unit.
> Mark it static and remove it from the eal internal header.
> 
> Fixes: 9e29251b2afa ("eal: thread affinity API")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: David Marchand 

Applied, thanks




Re: [dpdk-dev] [PATCH] bus/pci: remove unused x86 Linux macro

2019-08-05 Thread Thomas Monjalon
02/08/2019 11:54, David Marchand:
> This macro is unused after a previous fix.
> 
> Fixes: fe822eb8c565 ("bus/pci: use IOVA DMA mask check when setting IOVA 
> mode")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: David Marchand 

Applied, thanks





Re: [dpdk-dev] [PATCH v2] bus/pci: always check IOMMU capabilities

2019-08-05 Thread Thomas Monjalon
05/08/2019 08:23, David Marchand:
> IOMMU capabilities won't change and must be checked even if no PCI device
> seem to be supported yet when EAL initialised.
> 
> This is to accommodate with SPDK that registers its drivers after
> rte_eal_init(), especially on PPC platform where the IOMMU does not
> support VA.
> 
> Fixes: 703458e19c16 ("bus/pci: consider only usable devices for IOVA mode")
> 
> Signed-off-by: David Marchand 
> Reviewed-by: David Christensen 
> Acked-by: Jerin Jacob 
> Tested-by: Jerin Jacob 
> Tested-by: Takeshi Yoshimura 

Applied, thanks





Re: [dpdk-dev] [PATCH] doc: announce API change in mbuf

2019-08-05 Thread Thomas Monjalon
05/08/2019 10:05, Andrew Rybchenko:
> On 8/1/19 3:41 PM, Thomas Monjalon wrote:
> > In order to prepare for a long term stable API, the mbuf library
> > has to change: allowing more features as dynamic fields,
> > and fixing the lack of rte_ prefix in the namespace.
> > The namespace fix should not break the compatibility by keeping
> > some aliases during few releases to give time for migration.
> >
> > Signed-off-by: Thomas Monjalon 
[..]
> > +* mbuf: Some fields will be moved or converted to dynamic API in DPDK 19.11
> > +  in order to offer more space for the dynamic fields in future.
> > +  The namespace will be fixed at the same time while keeping a backward
> > +  compatibility for some time.
> 
> The deprecation notice is better than nothing, but "some fields" is
> hardly useful since it doe not provide enough information if an
> application is affected or not.
> 
> Also we have no yet information on performance impact of
> switching to dynamic fields.
> 
> May be it is not a problem if switching does not happen.
> 
> I have no strong opinion, just trying to raise my concerns.
> May be you already have answers on it.

Unfortunately I don't have answers because I did not start this work.
We will have to evaluate the impact and discuss what to move or not.




Re: [dpdk-dev] [PATCH] doc: add a co-existence consideration for qede PMD

2019-08-05 Thread Thomas Monjalon
05/08/2019 11:26, Rasesh Mody:
> Hi Thomas,
> 
> >From: Thomas Monjalon 
> >Sent: Wednesday, July 31, 2019 1:31 AM
> >
> >31/07/2019 10:02, Rasesh Mody:
> >> Add and update co-existence considerations for qede PMD
> >>
> >> Signed-off-by: Rasesh Mody 
> >> ---
> >>  doc/guides/nics/qede.rst | 21 +++--
> >>  1 file changed, 19 insertions(+), 2 deletions(-)
> >>
> >> +- Linux kernel drivers and qede PMD can’t be mixed on a given FastLinQ
> >> +  QL4xxx adapter. This type of coexistence is unsupported. A given
> >> +  adapter needs to be completely used by DPDK or Linux drivers, when
> >> +  SR-IOV is not enabled. Before binging DPDK driver to one or more
> >> +  devices on the adapter, please make sure to unbind Linux drivers from
> >> +  all devices of the adapter. If there are multiple adapters on the
> >> +  system, one or more adapter can be used by DPDK driver and other
> >> +  adapters can be used by Linux drivers.
> >> +
> >> +- When SR-IOV is enabled, Linux native kernel driver (qede) can be bound
> >> +  to the PFs of a given adapter and either DPDK or Linux drivers can be
> >> +  bound to the VFs of the adapter.
> >
> >This part is not specific to qede, but related to UIO/VFIO behaviour.
> >I think we already have this kind of explanation in the Linux guide.
> >If not, please update it and add a reference link from here.
> 
> I've sent updated v2 version of co-existence consideration for Qlogic 
> adapters. These considerations are specific to qede PMD. Usage of DPDK and 
> QLogic Linux drivers across multiple PFs on the same adapter is not possible 
> and unique for our architecture. We do not want to add notes regarding 
> UIO/VFIO behavior here as its common to others as well.

OK, looks good.




Re: [dpdk-dev] [dpdk-stable] [PATCH] test/eal: do not scan PCI devices for memory tests

2019-08-05 Thread Thomas Monjalon
03/08/2019 11:51, David Marchand:
> On Fri, Aug 2, 2019 at 10:57 PM Thomas Monjalon  wrote:
> >
> > 01/08/2019 14:27, David Marchand:
> > > The memory tests currently check that, for normal mode (not legacy mode),
> > > there is no memory left behind when exiting.
> >
> > I think this is the real bug:
> > we are checking a behaviour that we cannot achieve currently.
> >
> > > The problem is that if a ethdev port is allocated when scanning pci
> > > devices (even if the driver probe fails like when you have a virtio
> > > management interface attached to the kernel), on exit, dpdk won't free
> > > the associated memory since ethdev never frees the ethdev memzone.
> >
> > As you said in this thread, we could think about how to free it properly
> > in a future release.
> > For 19.08, I would suggest to disable the test with a comment
> > explaining the reason.
> 
> For 19.08, as long as we test shared builds in the CI, then it just
> "works", because the net drivers are not loaded.
> No net driver, no ethdev leak ;-)

So we keep the bug with the unit test not running with a static build
for 19.08, and we'll try to fix it in 19.11?




Re: [dpdk-dev] [PATCH] ethdev: sort experimental symbols per release

2019-08-05 Thread Thomas Monjalon
31/07/2019 15:45, Ferruh Yigit:
> On 7/31/2019 1:27 PM, David Marchand wrote:
> > Sort the experimental symbols per release to make it easier/quicker to
> > check for how long we have them.
> > 
> > Signed-off-by: David Marchand 
> 
> Acked-by: Ferruh Yigit 

Applied, thanks





Re: [dpdk-dev] [PATCH] net/iavf: fix Rx bytes stats

2019-08-05 Thread Andrew Rybchenko

On 7/17/19 7:55 AM, Stephen Hemminger wrote:

On Wed, 17 Jul 2019 12:31:00 +0800
Qi Zhang  wrote:


Exclude 4 bytes CRC for rx bytes stats.
This also aligned Rx stats calculation with PF.

Fixes: f4a41a6953af ("net/avf: support stats")
Cc: sta...@dpdk.org

Signed-off-by: Qi Zhang 
---
  drivers/net/iavf/iavf_ethdev.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 53dc05c78..fe75e86ab 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1047,6 +1047,7 @@ iavf_dev_stats_get(struct rte_eth_dev *dev, struct 
rte_eth_stats *stats)
stats->imissed = pstats->rx_discards;
stats->oerrors = pstats->tx_errors + pstats->tx_discards;
stats->ibytes = pstats->rx_bytes;
+   stats->ibytes -= stats->ipackets * RTE_ETHER_CRC_LEN;
stats->obytes = pstats->tx_bytes;
} else {
PMD_DRV_LOG(ERR, "Get statistics failed");

Correct, DPDK statistics should not include CRC.


Stephen, Thomas, Ferruh,

is it documented somewhere? May be we should update fields
description and rte_eth_stats_get() which mentions these fields
as well to highlight it?

Thanks,
Andrew.


Re: [dpdk-dev] [PATCH v4 1/2] vhost: support inflight share memory protocol feature

2019-08-05 Thread Yu, Jin
Thanks Tiwei.

> -Original Message-
> From: Bie, Tiwei
> Sent: Thursday, August 1, 2019 2:38 PM
> To: Yu, Jin 
> Cc: dev@dpdk.org; Liu, Changpeng ;
> maxime.coque...@redhat.com; Wang, Zhihong ;
> Lin Li ; Xun Ni ; Yu Zhang
> 
> Subject: Re: [PATCH v4 1/2] vhost: support inflight share memory protocol
> feature
> 
> On Thu, Aug 01, 2019 at 04:40:49AM +0800, JinYu wrote:
> > This patch introduces two new messages VHOST_USER_GET_INFLIGHT_FD
> and
> > VHOST_USER_SET_INFLIGHT_FD to support transferring a shared buffer
> > between qemu and backend.
> >
> > Firstly, qemu uses VHOST_USER_GET_INFLIGHT_FD to get the shared buffer
> > from backend. Then qemu should send it back through
> > VHOST_USER_SET_INFLIGHT_FD each time we start vhost-user.
> >
> > This shared buffer is used to process inflight I/O when backend
> > reconnect.
> >
> > Signed-off-by: Lin Li 
> > Signed-off-by: Xun Ni 
> > Signed-off-by: Yu Zhang 
> > Signed-off-by: Jin Yu 
> > ---
> > v1 - specify the APIs are split-ring only
> > v2 - fix APIs and judge split or packed
> > v3 - Add rte_vhost_ prefix and fix one issue.
> > v4 - add the packed ring support
> > ---
> >  lib/librte_vhost/rte_vhost.h   | 301 +-
> >  lib/librte_vhost/rte_vhost_version.map |  12 +
> >  lib/librte_vhost/vhost.c   | 399 ++-
> >  lib/librte_vhost/vhost.h   |  54 ++--
> >  lib/librte_vhost/vhost_user.c  | 423 -
> >  lib/librte_vhost/vhost_user.h  |  13 +-
> >  6 files changed, 1173 insertions(+), 29 deletions(-)
> 
> There are some coding style issues reported by devtools/checkpatches.sh,
> please get them fixed:

Sorry. Will fix them in the next version.
> 
> WARNING:LONG_LINE: line over 80 characters
> #372: FILE: lib/librte_vhost/rte_vhost.h:952:
> + uint16_t queue_id, bool *avail_wrap_counter, bool
> +*used_wrap_counter);
> 
> WARNING:LONG_LINE: line over 80 characters
> #622: FILE: lib/librte_vhost/vhost.c:935:
> + vq->inflight_packed->desc[free_head].addr =
> +vq->desc_packed[head].addr;
> 
> WARNING:LONG_LINE: line over 80 characters
> #623: FILE: lib/librte_vhost/vhost.c:936:
> + vq->inflight_packed->desc[free_head].len = vq-
> >desc_packed[head].len;
> 
> WARNING:LONG_LINE: line over 80 characters
> #624: FILE: lib/librte_vhost/vhost.c:937:
> + vq->inflight_packed->desc[free_head].flags =
> +vq->desc_packed[head].flags;
> 
> WARNING:LONG_LINE: line over 80 characters
> #625: FILE: lib/librte_vhost/vhost.c:938:
> + vq->inflight_packed->desc[free_head].id = vq-
> >desc_packed[head].id;
> 
> WARNING:LONG_LINE: line over 80 characters
> #783: FILE: lib/librte_vhost/vhost.c:1096:
> + vq->inflight_packed->used_idx &= vq->inflight_packed-
> >desc_num - 1;
> 
> WARNING:LONG_LINE: line over 80 characters
> #803: FILE: lib/librte_vhost/vhost.c:1278:
> + if (dev == NULL || avail_wrap_counter == NULL ||
> used_wrap_counter ==
> +NULL)
> 
> WARNING:LONG_LINE: line over 80 characters
> #826: FILE: lib/librte_vhost/vhost.c:1301:
> + *last_avail_idx =
> +dev->virtqueue[queue_id]->inflight_packed->old_used_idx;
> 
> WARNING:LONG_LINE: line over 80 characters
> #833: FILE: lib/librte_vhost/vhost.c:1308:
> + uint16_t queue_id, bool *avail_wrap_counter, bool
> *used_wrap_counter)
> 
> WARNING:LONG_LINE: line over 80 characters
> #837: FILE: lib/librte_vhost/vhost.c:1312:
> + if (dev == NULL || avail_wrap_counter == NULL ||
> used_wrap_counter ==
> +NULL)
> 
> WARNING:LONG_LINE: line over 80 characters
> #1116: FILE: lib/librte_vhost/vhost_user.c:1248:
> + sizeof(uint64_t) * 1 + sizeof(uint16_t) * 4,
> INFLIGHT_ALIGNMENT);
> 
> WARNING:LONG_LINE: line over 80 characters
> #1122: FILE: lib/librte_vhost/vhost_user.c:1254:
> + sizeof(uint64_t) * 1 + sizeof(uint16_t) * 6 + sizeof(uint8_t) * 
> 9,
> 
> WARNING:LONG_LINE: line over 80 characters
> #1258: FILE: lib/librte_vhost/vhost_user.c:1390:
> + vq->inflight_packed = (struct inflight_info_packed
> *)addr;
> 
> WARNING:LONG_LINE: line over 80 characters
> #1293: FILE: lib/librte_vhost/vhost_user.c:1454:
> +vhost_check_queue_inflights_split(struct virtio_net *dev, struct
> +vhost_virtqueue *vq)
> 
> WARNING:LONG_LINE: line over 80 characters
> #1318: FILE: lib/librte_vhost/vhost_user.c:1479:
> + inflight_split->desc[inflight_split->last_inflight_io].inflight 
> = 0;
> 
> WARNING:LONG_LINE: line over 80 characters
> #1349: FILE: lib/librte_vhost/vhost_user.c:1510:
> + resubmit->resubmit_list[resubmit-
> >resubmit_num].index = i;
> 
> WARNING:LONG_LINE: line over 80 characters
> #1350: FILE: lib/librte_vhost/vhost_user.c:1511:
> + resubmit->resubmit_list[resubmit-
> >resubmit_num].counter =
> 
> WARNING:LONG_LINE: line over 80 characters
> #1394: FILE: lib/librte_vhost/vhost_user.c:1555:
> + if (inflight_packed-

Re: [dpdk-dev] [PATCH] net/mlx5: fix redundant use of directive

2019-08-05 Thread Slava Ovsiienko
> -Original Message-
> From: Dekel Peled 
> Sent: Monday, August 5, 2019 10:07
> To: Yongseok Koh ; Slava Ovsiienko
> ; Shahaf Shuler 
> Cc: Ori Kam ; dev@dpdk.org
> Subject: [PATCH] net/mlx5: fix redundant use of directive
> 
> Part of the code in function flow_dv_matcher_enable() is enclosed in '#ifdef
> HAVE_MLX5DV_DR' preprocessor directive.
> Using this directive is not needed here, and prevents compilation of relevant
> code.
> 
> This patch removes the redundant preprocessor directive.
> 
> Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
> 
> Signed-off-by: Dekel Peled 
Acked-by: Viacheslav Ovsiienko 

> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 9c0a261..582f644 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -4324,11 +4324,9 @@ struct field_modify_info modify_tcp[] = {
>   match_criteria_enable |=
>   (!HEADER_IS_ZERO(match_criteria, misc_parameters_2)) <<
>   MLX5_MATCH_CRITERIA_ENABLE_MISC2_BIT;
> -#ifdef HAVE_MLX5DV_DR
>   match_criteria_enable |=
>   (!HEADER_IS_ZERO(match_criteria, misc_parameters_3)) <<
>   MLX5_MATCH_CRITERIA_ENABLE_MISC3_BIT;
> -#endif
>   return match_criteria_enable;
>  }
> 
> --
> 1.8.3.1



[dpdk-dev] [PATCH] net/mlx5: fix order of lines in loop

2019-08-05 Thread Dekel Peled
Function flow_dv_zero_encap_udp_csum() uses a while loop to iterate
over vlan items in flow rule.
Pointer next_hdr is incremented to the next item before it is used,
so the first item is skipped.

This patch moves the incrementing of next_hdr to the correct place.

Fixes: bf1d7d9a033a ("net/mlx5: zero out UDP checksum in encapsulation")
Cc: el...@mellanox.com

Signed-off-by: Dekel Peled 
---
 drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 536059d..6c58634 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1504,9 +1504,9 @@ struct field_modify_info modify_tcp[] = {
 
/* VLAN skipping */
while (proto == RTE_ETHER_TYPE_VLAN || proto == RTE_ETHER_TYPE_QINQ) {
-   next_hdr += sizeof(struct rte_vlan_hdr);
vlan = (struct rte_vlan_hdr *)next_hdr;
proto = RTE_BE16(vlan->eth_proto);
+   next_hdr += sizeof(struct rte_vlan_hdr);
}
 
/* HW calculates IPv4 csum. no need to proceed */
-- 
1.8.3.1



[dpdk-dev] [PATCH] app/testpmd: remove duplicated support for Rx offloading

2019-08-05 Thread Flavia Musatescu
The testpmd application provides two sets of commands for RX offload
flags configuration. The purpose of this patch is to eliminate this
duplication by removing the old set of commands:
“port config all crc-strip|scatter|rx-cksum|rx-timestamp|hw-vlan|
hw-vlan-filter|hw-vlan-strip|hw-vlan-extend on|off”

The other commands set that can be used instead in order to enable
or disable the same RX offloading flags on all RX queues of a port is:
"port config  rx_offload crc_strip|scatter|ipv4_cksum|
udp_cksum|tcp_cksum|timestamp|vlan_strip|vlan_filter|vlan_extend on|off"

This patch also fixes the "drop-en" command, which enables packets
dropping on all RX queues of all ports when no receive buffers available
“port config all drop-en on|off”

Fixes: 384161e00627 ("app/testpmd: adjust on the fly VLAN configuration")
Cc: shah...@mellanox.com
Cc: sta...@dpdk.org

Signed-off-by: Flavia Musatescu 
---
 app/test-pmd/cmdline.c  | 120 
 doc/guides/rel_notes/release_19_08.rst  |   9 +++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  81 +--
 3 files changed, 25 insertions(+), 185 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index a28362d..eb85548 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -778,11 +778,9 @@ static void cmd_help_long_parsed(void *parsed_result,
"port config all max-pkt-len (value)\n"
"Set the max packet length.\n\n"
 
-   "port config all 
(crc-strip|scatter|rx-cksum|rx-timestamp|hw-vlan|hw-vlan-filter|"
-   "hw-vlan-strip|hw-vlan-extend|drop-en)"
-   " (on|off)\n"
-   "Set 
crc-strip/scatter/rx-checksum/hardware-vlan/drop_en"
-   " for ports.\n\n"
+   "port config all drop-en (on|off)\n"
+   "Enable or disable packet drop on all RX queues of 
all ports when no "
+   "receive buffers available.\n\n"
 
"port config all rss (all|default|ip|tcp|udp|sctp|"

"ether|port|vxlan|geneve|nvgre|vxlan-gpe|none|)\n"
@@ -2109,112 +2107,24 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result,
__attribute__((unused)) void *data)
 {
struct cmd_config_rx_mode_flag *res = parsed_result;
-   portid_t pid;
-   int k;
 
if (!all_ports_stopped()) {
printf("Please stop all ports first\n");
return;
}
 
-   RTE_ETH_FOREACH_DEV(pid) {
-   struct rte_port *port;
-   uint64_t rx_offloads;
-
-   port = &ports[pid];
-   rx_offloads = port->dev_conf.rxmode.offloads;
-   if (!strcmp(res->name, "crc-strip")) {
-   if (!strcmp(res->value, "on")) {
-   rx_offloads &= ~DEV_RX_OFFLOAD_KEEP_CRC;
-   } else if (!strcmp(res->value, "off")) {
-   rx_offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
-   } else {
-   printf("Unknown parameter\n");
-   return;
-   }
-   } else if (!strcmp(res->name, "scatter")) {
-   if (!strcmp(res->value, "on")) {
-   rx_offloads |= DEV_RX_OFFLOAD_SCATTER;
-   } else if (!strcmp(res->value, "off")) {
-   rx_offloads &= ~DEV_RX_OFFLOAD_SCATTER;
-   } else {
-   printf("Unknown parameter\n");
-   return;
-   }
-   } else if (!strcmp(res->name, "rx-cksum")) {
-   if (!strcmp(res->value, "on"))
-   rx_offloads |= DEV_RX_OFFLOAD_CHECKSUM;
-   else if (!strcmp(res->value, "off"))
-   rx_offloads &= ~DEV_RX_OFFLOAD_CHECKSUM;
-   else {
-   printf("Unknown parameter\n");
-   return;
-   }
-   } else if (!strcmp(res->name, "rx-timestamp")) {
-   if (!strcmp(res->value, "on"))
-   rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
-   else if (!strcmp(res->value, "off"))
-   rx_offloads &= ~DEV_RX_OFFLOAD_TIMESTAMP;
-   else {
-   printf("Unknown parameter\n");
-   return;
-   }
-   } else if (!strcmp(res->name, "hw-vlan")) {
-   if (!strcmp(res->value, "on")) {
-   rx_offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER |
-   DE

[dpdk-dev] [PATCH] doc: remove major in designation of normal releases

2019-08-05 Thread Thomas Monjalon
The word "major" was used to differentiate with release candidates
or stable maintenance releases.
However the word "major" can be understood as "LTS",
so it is less confusing to avoid this word.

Reported-by: Ori Kam 
Signed-off-by: Thomas Monjalon 
---
 doc/guides/contributing/documentation.rst | 2 +-
 doc/guides/contributing/stable.rst| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/guides/contributing/documentation.rst 
b/doc/guides/contributing/documentation.rst
index 27e4b13be..550d8dec2 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -62,7 +62,7 @@ added to by the developer.
 
   The Release Notes document which features have been added in the current and 
previous releases of DPDK and highlight
   any known issues.
-  The Releases Notes also contain notifications of features that will change 
ABI compatibility in the next major release.
+  The Releases Notes also contain notifications of features that will change 
ABI compatibility in the next release.
 
   Developers should include updates to the Release Notes with patch sets that 
relate to any of the following sections:
 
diff --git a/doc/guides/contributing/stable.rst 
b/doc/guides/contributing/stable.rst
index 6a5eee9bd..24b9e8b7d 100644
--- a/doc/guides/contributing/stable.rst
+++ b/doc/guides/contributing/stable.rst
@@ -25,7 +25,7 @@ Release to indicate longer term support.
 Stable Releases
 ---
 
-Any major release of DPDK can be designated as a Stable Release if a
+Any release of DPDK can be designated as a Stable Release if a
 maintainer volunteers to maintain it and there is a commitment from major
 contributors to validate it before releases. If a release is to be designated
 as a Stable Release, it should be done by 1 month after the master release.
-- 
2.21.0



Re: [dpdk-dev] [PATCH] net/mlx5: fix order of lines in loop

2019-08-05 Thread Slava Ovsiienko
> -Original Message-
> From: Dekel Peled 
> Sent: Monday, August 5, 2019 14:51
> To: Yongseok Koh ; Slava Ovsiienko
> ; Shahaf Shuler 
> Cc: Ori Kam ; dev@dpdk.org; Eli Britstein
> 
> Subject: [PATCH] net/mlx5: fix order of lines in loop
> 
> Function flow_dv_zero_encap_udp_csum() uses a while loop to iterate over
> vlan items in flow rule.
> Pointer next_hdr is incremented to the next item before it is used, so the 
> first
> item is skipped.
> 
> This patch moves the incrementing of next_hdr to the correct place.
> 
> Fixes: bf1d7d9a033a ("net/mlx5: zero out UDP checksum in encapsulation")
> Cc: el...@mellanox.com
> 
> Signed-off-by: Dekel Peled 
Acked-by: Viacheslav Ovsiienko 

> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 536059d..6c58634 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -1504,9 +1504,9 @@ struct field_modify_info modify_tcp[] = {
> 
>   /* VLAN skipping */
>   while (proto == RTE_ETHER_TYPE_VLAN || proto ==
> RTE_ETHER_TYPE_QINQ) {
> - next_hdr += sizeof(struct rte_vlan_hdr);
>   vlan = (struct rte_vlan_hdr *)next_hdr;
>   proto = RTE_BE16(vlan->eth_proto);
> + next_hdr += sizeof(struct rte_vlan_hdr);
>   }
> 
>   /* HW calculates IPv4 csum. no need to proceed */
> --
> 1.8.3.1



Re: [dpdk-dev] [PATCH v2 0/2] Enable fast-unit tests under travis

2019-08-05 Thread David Marchand
On Mon, Aug 5, 2019 at 8:26 AM David Marchand  wrote:
>
> On Sat, Aug 3, 2019 at 12:00 AM Thomas Monjalon  wrote:
> >
> > 02/08/2019 23:25, Aaron Conole:
> > > This series turns the fast unit tests on for a limited set of
> > > builds under the travis build system.  An example run is available
> > > at:
> > >
> > > https://travis-ci.org/orgcandman/dpdk/builds/565991679
> > >
> > > The builds which execute the unit tests may be distinguished by the
> > > "RUN_TESTS" parameter.
> > >
> > > Aaron Conole (1):
> > >   ci: enable unit tests under travis-ci
> > >
> > > Michael Santana (1):
> > >   tests: Fix unit tests for shared builds
> >
> > Applied with change in comments of first patch, as described in this thread.
> > Thanks
>
> Not sure I understand this error:
> https://travis-ci.com/DPDK/dpdk/jobs/222141682
>
> The 'static' config worked fine:
> https://travis-ci.com/DPDK/dpdk/jobs/222141683
>
>
> Maybe a network issue ? But I would expect some kind of related
> warning/error message.
>

Ah something like those messages:
https://travis-ci.com/DPDK/dpdk/jobs/222407326
https://travis-ci.com/DPDK/dpdk/jobs/222417471

Is there a way to retry builds?
Automatically?


-- 
David Marchand


Re: [dpdk-dev] [PATCH] net/mlx5: fix redundant use of directive

2019-08-05 Thread Raslan Darawsheh
Hi,

> -Original Message-
> From: dev  On Behalf Of Dekel Peled
> Sent: Monday, August 5, 2019 10:07 AM
> To: Yongseok Koh ; Slava Ovsiienko
> ; Shahaf Shuler 
> Cc: Ori Kam ; dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix redundant use of directive
> 
> Part of the code in function flow_dv_matcher_enable() is enclosed in '#ifdef
> HAVE_MLX5DV_DR' preprocessor directive.
> Using this directive is not needed here, and prevents compilation of relevant
> code.
> 
> This patch removes the redundant preprocessor directive.
> 
> Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
> 
> Signed-off-by: Dekel Peled 
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 9c0a261..582f644 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -4324,11 +4324,9 @@ struct field_modify_info modify_tcp[] = {
>   match_criteria_enable |=
>   (!HEADER_IS_ZERO(match_criteria, misc_parameters_2)) <<
>   MLX5_MATCH_CRITERIA_ENABLE_MISC2_BIT;
> -#ifdef HAVE_MLX5DV_DR
>   match_criteria_enable |=
>   (!HEADER_IS_ZERO(match_criteria, misc_parameters_3)) <<
>   MLX5_MATCH_CRITERIA_ENABLE_MISC3_BIT;
> -#endif
>   return match_criteria_enable;
>  }
> 
> --
> 1.8.3.1

Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh


Re: [dpdk-dev] [PATCH] net/mlx5: fix VLAN inner type matching on DR/DV

2019-08-05 Thread Raslan Darawsheh
Hi,
> -Original Message-
> From: dev  On Behalf Of Xiaoyu Min
> Sent: Friday, August 2, 2019 12:18 PM
> To: Shahaf Shuler ; Yongseok Koh
> ; Slava Ovsiienko 
> Cc: dev@dpdk.org; Ori Kam 
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix VLAN inner type matching on
> DR/DV
> 
> The rte_flow_item_vlan has the inner_type, which is missing on DR/DV flow
> engine.
> 
> By adding this support, the example testpmd commands could be:
> 
>  - matching all vlan traffic with id 2:
> 
>  testpmd> flow create 0 ingress pattern eth / vlan vid is 2 / end
>   actions queue index 2 / end
> 
>  - matching all ipv4 traffic in vlan with id 2:
> 
>  testpmd> flow create 0 ingress pattern eth / vlan vid is 2
>   inner_type is 0x0800 / end actions queue index 2 / end
> 
> Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items")
> Cc: or...@mellanox.com
> 
> Signed-off-by: Xiaoyu Min 
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 9c0a2613d5..f786c7a2c4 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -3469,10 +3469,6 @@ flow_dv_translate_item_vlan(struct mlx5_flow
> *dev_flow,  {
>   const struct rte_flow_item_vlan *vlan_m = item->mask;
>   const struct rte_flow_item_vlan *vlan_v = item->spec;
> - const struct rte_flow_item_vlan nic_mask = {
> - .tci = RTE_BE16(0x0fff),
> - .inner_type = RTE_BE16(0x),
> - };
>   void *headers_m;
>   void *headers_v;
>   uint16_t tci_m;
> @@ -3481,7 +3477,7 @@ flow_dv_translate_item_vlan(struct mlx5_flow
> *dev_flow,
>   if (!vlan_v)
>   return;
>   if (!vlan_m)
> - vlan_m = &nic_mask;
> + vlan_m = &rte_flow_item_vlan_mask;
>   if (inner) {
>   headers_m = MLX5_ADDR_OF(fte_match_param, matcher,
>inner_headers);
> @@ -3507,6 +3503,10 @@ flow_dv_translate_item_vlan(struct mlx5_flow
> *dev_flow,
>   MLX5_SET(fte_match_set_lyr_2_4, headers_v, first_cfi, tci_v >> 12);
>   MLX5_SET(fte_match_set_lyr_2_4, headers_m, first_prio, tci_m >>
> 13);
>   MLX5_SET(fte_match_set_lyr_2_4, headers_v, first_prio, tci_v >>
> 13);
> + MLX5_SET(fte_match_set_lyr_2_4, headers_m, ethertype,
> +  rte_be_to_cpu_16(vlan_m->inner_type));
> + MLX5_SET(fte_match_set_lyr_2_4, headers_v, ethertype,
> +  rte_be_to_cpu_16(vlan_m->inner_type & vlan_v-
> >inner_type));
>  }
> 
>  /**
> --
> 2.21.0


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh



[dpdk-dev] [PATCH v2 0/6] fix transmit datapath cumulative series

2019-08-05 Thread Viacheslav Ovsiienko
This series provides the fixes for mlx5 Tx datapath, mostly
resolving the minor performance and setup issues:

  - various inline data settings
  - wrong assert condition on minimal data length
  - large burst SQ overflow due to inefficient CQ drain

Signed-off-by: Viacheslav Ovsiienko 
Acked-by: Matan Azrad 

---
v1 was sent as separated patches:
  - http://patches.dpdk.org/patch/57347/
  - http://patches.dpdk.org/patch/57348/
  - http://patches.dpdk.org/patch/57410/
  - http://patches.dpdk.org/patch/57411/
  - http://patches.dpdk.org/patch/57412/ (reverted in v2)
  - http://patches.dpdk.org/patch/57413/
  - http://patches.dpdk.org/patch/57414/


Viacheslav Ovsiienko (6):
  net/mlx5: fix default minimal data inline
  net/mlx5: fix inline data len assert condition
  net/mlx5: fix completion queue drain loop
  net/mlx5: fix inline data settings
  net/mlx5: fix packet size inline settings
  net/mlx5: fix completion queue overflow for large bursts

 doc/guides/nics/mlx5.rst |   2 +-
 drivers/net/mlx5/mlx5.c  |   5 +-
 drivers/net/mlx5/mlx5_prm.h  |   5 +-
 drivers/net/mlx5/mlx5_rxtx.c | 136 ---
 drivers/net/mlx5/mlx5_rxtx.h |   9 +--
 drivers/net/mlx5/mlx5_txq.c  |  39 ++---
 6 files changed, 115 insertions(+), 81 deletions(-)

-- 
1.8.3.1



[dpdk-dev] [PATCH v2 1/6] net/mlx5: fix default minimal data inline

2019-08-05 Thread Viacheslav Ovsiienko
The patch [Fixes] sets the default value of required minimal
inline data to 0 bytes. On some configurations (depends
on switchdev/legacy settings and FW version/settings)
the ConnectX-4LX NIC requires minimal 18 bytes of
Tx descriptor inline data to operate correctly.

Wrongly set to 0 default value may prevent NIC from operating
with out-of-the-box settings, this patch reverts default
value for ConnectX-4LX back to 18 bytes (inline L2).

Fixes: 9f350504bb32 ("net/mlx5: fix ConnectX-4LX minimal inline data limit")

Signed-off-by: Viacheslav Ovsiienko 
Acked-by: Matan Azrad 
---
 drivers/net/mlx5/mlx5.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 909c22e..a3eacdb 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1325,12 +1325,9 @@ struct mlx5_dev_spawn_data {
switch (spawn->pci_dev->id.device_id) {
case PCI_DEVICE_ID_MELLANOX_CONNECTX4:
case PCI_DEVICE_ID_MELLANOX_CONNECTX4VF:
-   config->txq_inline_min = MLX5_INLINE_HSIZE_L2;
-   config->hw_vlan_insert = 0;
-   break;
case PCI_DEVICE_ID_MELLANOX_CONNECTX4LX:
case PCI_DEVICE_ID_MELLANOX_CONNECTX4LXVF:
-   config->txq_inline_min = MLX5_INLINE_HSIZE_NONE;
+   config->txq_inline_min = MLX5_INLINE_HSIZE_L2;
config->hw_vlan_insert = 0;
break;
case PCI_DEVICE_ID_MELLANOX_CONNECTX5:
-- 
1.8.3.1



[dpdk-dev] [PATCH v2 5/6] net/mlx5: fix packet size inline settings

2019-08-05 Thread Viacheslav Ovsiienko
This patch fixes the default settings for packet size to inline
with Enhanced Multi-Packet Write feature, allowing 256B packets
to be inlined with Out-Of-the-Box settings.

Fixes: 50724e1bba76 ("net/mlx5: update Tx definitions")

Signed-off-by: Viacheslav Ovsiienko 
Acked-by: Matan Azrad 
---
 doc/guides/nics/mlx5.rst| 2 +-
 drivers/net/mlx5/mlx5_prm.h | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 46538b8..5102bcd 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -449,7 +449,7 @@ Run-time configuration
   and CPU resources are scarce), data inline is not performed by the driver.
   Assigning ``txqs_min_inline`` with zero always enables the data inline.
 
-  The default ``txq_inline_mpw`` value is 188. The specified value may be 
adjusted
+  The default ``txq_inline_mpw`` value is 268. The specified value may be 
adjusted
   by the driver in order not to exceed the limit (930 bytes) and to provide 
better
   WQE space filling without gaps, the adjustment is reflected in the debug log.
   Due to multiple packets may be included to the same WQE with Enhanced Multi
diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h
index 4ee6d89..d62837e 100644
--- a/drivers/net/mlx5/mlx5_prm.h
+++ b/drivers/net/mlx5/mlx5_prm.h
@@ -72,9 +72,8 @@
  * boundary with accounting the title Control and Ethernet
  * segments.
  */
-#define MLX5_EMPW_DEF_INLINE_LEN (3u * MLX5_WQE_SIZE + \
- MLX5_DSEG_MIN_INLINE_SIZE - \
- MLX5_WQE_DSEG_SIZE)
+#define MLX5_EMPW_DEF_INLINE_LEN (4u * MLX5_WQE_SIZE + \
+ MLX5_DSEG_MIN_INLINE_SIZE)
 /*
  * Maximal inline data length sent with enhanced MPW.
  * Is based on maximal WQE size.
-- 
1.8.3.1



[dpdk-dev] [PATCH v2 3/6] net/mlx5: fix completion queue drain loop

2019-08-05 Thread Viacheslav Ovsiienko
The completion loop speed optimizations for error-free
operations are done - no CQE field fetch on each loop
iteration. Also, code size is oprimized - the flush
buffers routine is invoked once.

Fixes: 318ea4cfa1b1 ("net/mlx5: fix Tx completion descriptors fetching loop")

Signed-off-by: Viacheslav Ovsiienko 
Acked-by: Matan Azrad 
---
 drivers/net/mlx5/mlx5_rxtx.c | 98 +---
 drivers/net/mlx5/mlx5_rxtx.h |  8 ++--
 2 files changed, 68 insertions(+), 38 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 1ec3793..a890f41 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -654,9 +654,10 @@ enum mlx5_txcmp_code {
  *   Pointer to the error CQE.
  *
  * @return
- *   The last Tx buffer element to free.
+ *   Negative value if queue recovery failed,
+ *   the last Tx buffer element to free otherwise.
  */
-uint16_t
+int
 mlx5_tx_error_cqe_handle(struct mlx5_txq_data *restrict txq,
 volatile struct mlx5_err_cqe *err_cqe)
 {
@@ -706,6 +707,7 @@ enum mlx5_txcmp_code {
return txq->elts_head;
}
/* Recovering failed - try again later on the same WQE. */
+   return -1;
} else {
txq->cq_ci++;
}
@@ -2010,6 +2012,45 @@ enum mlx5_txcmp_code {
 }
 
 /**
+ * Update completion queue consuming index via doorbell
+ * and flush the completed data buffers.
+ *
+ * @param txq
+ *   Pointer to TX queue structure.
+ * @param valid CQE pointer
+ *   if not NULL update txq->wqe_pi and flush the buffers
+ * @param itail
+ *   if not negative - flush the buffers till this index.
+ * @param olx
+ *   Configured Tx offloads mask. It is fully defined at
+ *   compile time and may be used for optimization.
+ */
+static __rte_always_inline void
+mlx5_tx_comp_flush(struct mlx5_txq_data *restrict txq,
+  volatile struct mlx5_cqe *last_cqe,
+  int itail,
+  unsigned int olx __rte_unused)
+{
+   uint16_t tail;
+
+   if (likely(last_cqe != NULL)) {
+   txq->wqe_pi = rte_be_to_cpu_16(last_cqe->wqe_counter);
+   tail = ((volatile struct mlx5_wqe_cseg *)
+   (txq->wqes + (txq->wqe_pi & txq->wqe_m)))->misc;
+   } else if (itail >= 0) {
+   tail = (uint16_t)itail;
+   } else {
+   return;
+   }
+   rte_compiler_barrier();
+   *txq->cq_db = rte_cpu_to_be_32(txq->cq_ci);
+   if (likely(tail != txq->elts_tail)) {
+   mlx5_tx_free_elts(txq, tail, olx);
+   assert(tail == txq->elts_tail);
+   }
+}
+
+/**
  * Manage TX completions. This routine checks the CQ for
  * arrived CQEs, deduces the last accomplished WQE in SQ,
  * updates SQ producing index and frees all completed mbufs.
@@ -2028,10 +2069,11 @@ enum mlx5_txcmp_code {
  unsigned int olx __rte_unused)
 {
unsigned int count = MLX5_TX_COMP_MAX_CQE;
-   bool update = false;
-   uint16_t tail = txq->elts_tail;
+   volatile struct mlx5_cqe *last_cqe = NULL;
int ret;
 
+   static_assert(MLX5_CQE_STATUS_HW_OWN < 0, "Must be negative value");
+   static_assert(MLX5_CQE_STATUS_SW_OWN < 0, "Must be negative value");
do {
volatile struct mlx5_cqe *cqe;
 
@@ -2043,32 +2085,30 @@ enum mlx5_txcmp_code {
assert(ret == MLX5_CQE_STATUS_HW_OWN);
break;
}
-   /* Some error occurred, try to restart. */
+   /*
+* Some error occurred, try to restart.
+* We have no barrier after WQE related Doorbell
+* written, make sure all writes are completed
+* here, before we might perform SQ reset.
+*/
rte_wmb();
-   tail = mlx5_tx_error_cqe_handle
+   ret = mlx5_tx_error_cqe_handle
(txq, (volatile struct mlx5_err_cqe *)cqe);
-   if (likely(tail != txq->elts_tail)) {
-   mlx5_tx_free_elts(txq, tail, olx);
-   assert(tail == txq->elts_tail);
-   }
-   /* Allow flushing all CQEs from the queue. */
-   count = txq->cqe_s;
-   } else {
-   volatile struct mlx5_wqe_cseg *cseg;
-
-   /* Normal transmit completion. */
-   ++txq->cq_ci;
-   rte_cio_rmb();
-   txq->wqe_pi = rte_be_to_cpu_16(cqe->wqe_counter);
-   cseg = (volatile struct mlx5_wqe_cseg *)
-   (txq->wqes + (txq->wqe_pi & txq->wqe_m));
-   tail =

[dpdk-dev] [PATCH v2 2/6] net/mlx5: fix inline data len assert condition

2019-08-05 Thread Viacheslav Ovsiienko
The debug assert wrongly triggers on the inline data 18B,
this should be passed successfully.

Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template")

Signed-off-by: Viacheslav Ovsiienko 
Acked-by: Matan Azrad 
---
 drivers/net/mlx5/mlx5_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index a4fc388..1ec3793 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -2594,7 +2594,7 @@ enum mlx5_txcmp_code {
 sizeof(struct rte_vlan_hdr) +
 2 * RTE_ETHER_ADDR_LEN),
  "invalid Ethernet Segment data size");
-   assert(inlen > MLX5_ESEG_MIN_INLINE_SIZE);
+   assert(inlen >= MLX5_ESEG_MIN_INLINE_SIZE);
es->inline_hdr_sz = rte_cpu_to_be_16(inlen);
pdst = (uint8_t *)&es->inline_data;
if (MLX5_TXOFF_CONFIG(VLAN) && vlan) {
-- 
1.8.3.1



[dpdk-dev] [PATCH v2 4/6] net/mlx5: fix inline data settings

2019-08-05 Thread Viacheslav Ovsiienko
If the minimal inline data are required the data inline feature
must be engaged. There were the incorrect settings enabling the
entire small packet inline (in size up to 82B) which may result
in sending rate declining if there is no enough cores. The same
problem was raised if inline was enabled to support VLAN tag
insertion by software.

Fixes: 38b4b397a57d ("net/mlx5: add Tx configuration and setup")

Signed-off-by: Viacheslav Ovsiienko 
Acked-by: Matan Azrad 
---
 drivers/net/mlx5/mlx5_txq.c | 39 ++-
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index fe3b4ec..81f3b40 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -784,13 +784,11 @@ struct mlx5_txq_ibv *
txq_ctrl->txq.vlan_en = config->hw_vlan_insert;
vlan_inline = (dev_txoff & DEV_TX_OFFLOAD_VLAN_INSERT) &&
  !config->hw_vlan_insert;
-   if (vlan_inline)
-   inlen_send = RTE_MAX(inlen_send, MLX5_ESEG_MIN_INLINE_SIZE);
/*
 * If there are few Tx queues it is prioritized
 * to save CPU cycles and disable data inlining at all.
 */
-   if ((inlen_send && priv->txqs_n >= txqs_inline) || vlan_inline) {
+   if (inlen_send && priv->txqs_n >= txqs_inline) {
/*
 * The data sent with ordinal MLX5_OPCODE_SEND
 * may be inlined in Ethernet Segment, align the
@@ -825,32 +823,31 @@ struct mlx5_txq_ibv *
 MLX5_WQE_CSEG_SIZE -
 MLX5_WQE_ESEG_SIZE -
 MLX5_WQE_DSEG_SIZE * 2);
-   txq_ctrl->txq.inlen_send = inlen_send;
-   txq_ctrl->txq.inlen_mode = inlen_mode;
-   txq_ctrl->txq.inlen_empw = 0;
-   } else {
+   } else if (inlen_mode) {
/*
 * If minimal inlining is requested we must
 * enable inlining in general, despite the
-* number of configured queues.
+* number of configured queues. Ignore the
+* txq_inline_max devarg, this is not
+* full-featured inline.
 */
inlen_send = inlen_mode;
-   if (inlen_mode) {
-   /*
-* Extend space for inline data to allow
-* optional alignment of data buffer
-* start address, it may improve PCIe
-* performance.
-*/
-   inlen_send = RTE_MIN(inlen_send + MLX5_WQE_SIZE,
-MLX5_SEND_MAX_INLINE_LEN);
-   }
-   txq_ctrl->txq.inlen_send = inlen_send;
-   txq_ctrl->txq.inlen_mode = inlen_mode;
-   txq_ctrl->txq.inlen_empw = 0;
+   inlen_empw = 0;
+   } else if (vlan_inline) {
+   /*
+* Hardware does not report offload for
+* VLAN insertion, we must enable data inline
+* to implement feature by software.
+*/
+   inlen_send = MLX5_ESEG_MIN_INLINE_SIZE;
+   inlen_empw = 0;
+   } else {
inlen_send = 0;
inlen_empw = 0;
}
+   txq_ctrl->txq.inlen_send = inlen_send;
+   txq_ctrl->txq.inlen_mode = inlen_mode;
+   txq_ctrl->txq.inlen_empw = 0;
if (inlen_send && inlen_empw && priv->txqs_n >= txqs_inline) {
/*
 * The data sent with MLX5_OPCODE_ENHANCED_MPSW
-- 
1.8.3.1



[dpdk-dev] [PATCH v2 6/6] net/mlx5: fix completion queue overflow for large bursts

2019-08-05 Thread Viacheslav Ovsiienko
There is the limit on completion descriptor fetch to improve
latency. If burst size is large there might be not enough
resources freed in completion processing. This fix reiterates
sending loop and allows multiple completion descriptor fetch
and processing.

Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template")

Signed-off-by: Viacheslav Ovsiienko 
Acked-by: Matan Azrad 
---
 drivers/net/mlx5/mlx5_rxtx.c | 36 +++-
 drivers/net/mlx5/mlx5_rxtx.h |  1 +
 2 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index a890f41..39076df 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -2142,8 +2142,7 @@ enum mlx5_txcmp_code {
uint16_t head = txq->elts_head;
unsigned int part;
 
-   part = MLX5_TXOFF_CONFIG(INLINE) ? 0 : loc->pkts_sent -
-   (MLX5_TXOFF_CONFIG(MULTI) ? loc->pkts_copy : 0);
+   part = MLX5_TXOFF_CONFIG(INLINE) ? 0 : loc->pkts_sent - loc->pkts_copy;
head += part;
if ((uint16_t)(head - txq->elts_comp) >= MLX5_TX_COMP_THRESH ||
 (MLX5_TXOFF_CONFIG(INLINE) &&
@@ -4520,6 +4519,14 @@ enum mlx5_txcmp_code {
 
assert(txq->elts_s >= (uint16_t)(txq->elts_head - txq->elts_tail));
assert(txq->wqe_s >= (uint16_t)(txq->wqe_ci - txq->wqe_pi));
+   if (unlikely(!pkts_n))
+   return 0;
+   loc.pkts_sent = 0;
+   loc.pkts_copy = 0;
+   loc.wqe_last = NULL;
+
+send_loop:
+   loc.pkts_loop = loc.pkts_sent;
/*
 * Check if there are some CQEs, if any:
 * - process an encountered errors
@@ -4527,9 +4534,7 @@ enum mlx5_txcmp_code {
 * - free related mbufs
 * - doorbell the NIC about processed CQEs
 */
-   if (unlikely(!pkts_n))
-   return 0;
-   rte_prefetch0(*pkts);
+   rte_prefetch0(*(pkts + loc.pkts_sent));
mlx5_tx_handle_completion(txq, olx);
/*
 * Calculate the number of available resources - elts and WQEs.
@@ -4546,10 +4551,7 @@ enum mlx5_txcmp_code {
loc.wqe_free = txq->wqe_s -
(uint16_t)(txq->wqe_ci - txq->wqe_pi);
if (unlikely(!loc.elts_free || !loc.wqe_free))
-   return 0;
-   loc.pkts_sent = 0;
-   loc.pkts_copy = 0;
-   loc.wqe_last = NULL;
+   return loc.pkts_sent;
for (;;) {
/*
 * Fetch the packet from array. Usually this is
@@ -4715,8 +4717,8 @@ enum mlx5_txcmp_code {
 */
assert(MLX5_TXOFF_CONFIG(INLINE) || loc.pkts_sent >= loc.pkts_copy);
/* Take a shortcut if nothing is sent. */
-   if (unlikely(loc.pkts_sent == 0))
-   return 0;
+   if (unlikely(loc.pkts_sent == loc.pkts_loop))
+   return loc.pkts_sent;
/*
 * Ring QP doorbell immediately after WQE building completion
 * to improve latencies. The pure software related data treatment
@@ -4725,8 +4727,7 @@ enum mlx5_txcmp_code {
 */
mlx5_tx_dbrec_cond_wmb(txq, loc.wqe_last, 0);
/* Not all of the mbufs may be stored into elts yet. */
-   part = MLX5_TXOFF_CONFIG(INLINE) ? 0 : loc.pkts_sent -
-   (MLX5_TXOFF_CONFIG(MULTI) ? loc.pkts_copy : 0);
+   part = MLX5_TXOFF_CONFIG(INLINE) ? 0 : loc.pkts_sent - loc.pkts_copy;
if (!MLX5_TXOFF_CONFIG(INLINE) && part) {
/*
 * There are some single-segment mbufs not stored in elts.
@@ -4738,6 +4739,7 @@ enum mlx5_txcmp_code {
 * inlined mbufs.
 */
mlx5_tx_copy_elts(txq, pkts + loc.pkts_copy, part, olx);
+   loc.pkts_copy = loc.pkts_sent;
}
 #ifdef MLX5_PMD_SOFT_COUNTERS
/* Increment sent packets counter. */
@@ -4745,6 +4747,14 @@ enum mlx5_txcmp_code {
 #endif
assert(txq->elts_s >= (uint16_t)(txq->elts_head - txq->elts_tail));
assert(txq->wqe_s >= (uint16_t)(txq->wqe_ci - txq->wqe_pi));
+   if (pkts_n > loc.pkts_sent) {
+   /*
+* If burst size is large there might be no enough CQE
+* fetched from completion queue and no enough resources
+* freed to send all the packets.
+*/
+   goto send_loop;
+   }
return loc.pkts_sent;
 }
 
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index aaa02a2..bad9e9c 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -239,6 +239,7 @@ struct mlx5_txq_local {
struct rte_mbuf *mbuf; /* first mbuf to process. */
uint16_t pkts_copy; /* packets copied to elts. */
uint16_t pkts_sent; /* packets sent. */
+   uint16_t pkts_loop; /* packets sent on loop entry. */
uint16_t elts_free; /* available elts remain. */
uint16_t wqe_free; /* available wqe remain. */
uint16_t mbuf_off; /* data o

Re: [dpdk-dev] [PATCH BUG 335 3/3] net/virtio: fix compilation error with 0 headroom

2019-08-05 Thread Maxime Coquelin



On 8/1/19 10:09 AM, Hemant Agrawal wrote:
> HI,
>> On 7/26/19 2:25 PM, Olivier Matz wrote:
>>> Hi,
>>>
>>> On Thu, Jul 25, 2019 at 04:36:45PM +0530, Hemant Agrawal wrote:
 When using RTE_PKTMBUF_HEADROOM as 0, virito ethdev driver throws
 compilation error
 virtio_ethdev.c:1851:2: note: in expansion of macro ‘RTE_BUILD_BUG_ON’
 RTE_BUILD_BUG_ON(RTE_PKTMBUF_HEADROOM
< sizeof(struct virtio_net_hdr_mrg_rxbuf));

 This patch change it into run-time check.
 Reported as:

>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbug

>> s.dpdk.org%2Fshow_bug.cgi%3Fid%3D335&data=02%7C01%7Chemant.
>> agrawa

>> l%40nxp.com%7C303b7755f6ff4c44721a08d714f2cbb5%7C686ea1d3bc2b4c6
>> fa92c

>> d99c5c301635%7C0%7C0%7C637000905339982654&sdata=oQ4b4TZ36x
>> WiHOtKE
 %2BwCZfy2ND%2FgP%2FESfGL%2FEdoJbYI%3D&reserved=0

 Fixes: 198ab33677c9 ("net/virtio: move device initialization in a
 function")
>>>
>>> I think the proper commit is:
>>> Fixes: dec08c28c0b3 ("virtio: check packet headroom at compile time")
>>
>> Indeed.
>>
>>> It looks this patch more or less reverts this old commit.
>>> +CC Stephen
>>
>> I wonder whether we could have a warning at build time so that the one who
>> builds DPDK is aware some driver may not be usable, in addition to the
>> below patch that fails virtio-net init.
> 
> [Hemant] I will also prefer compile time check instead of run-time check for 
> any non-default configs.
> If someone is modifying the config, he can very well disable the drivers, 
> which don't like those settings. 
> 
> However, earlier discussion w.r.t this bug moved in other direction to make 
> DPDK compliable for all cases and allow regress testing.

Ok, I don't have a strong opinion on this, so feel free to apply this
patch as is. We can add a build-ime warning later if we find it useful.

Acked-by: Maxime Coquelin 

Thanks,
Maxime

> 
>>
>> Any thoughts?
>>
>> Thanks,
>> Maxime
>>
 Cc: sta...@dpdk.org
 Cc: Olivier Matz 

 Signed-off-by: Hemant Agrawal 
 ---
   drivers/net/virtio/virtio_ethdev.c | 9 -
   1 file changed, 8 insertions(+), 1 deletion(-)

 diff --git a/drivers/net/virtio/virtio_ethdev.c
 b/drivers/net/virtio/virtio_ethdev.c
 index 62c827443..3e2e8bd2a 100644
 --- a/drivers/net/virtio/virtio_ethdev.c
 +++ b/drivers/net/virtio/virtio_ethdev.c
 @@ -1848,7 +1848,14 @@ eth_virtio_dev_init(struct rte_eth_dev
>> *eth_dev)
struct virtio_hw *hw = eth_dev->data->dev_private;
int ret;

 -  RTE_BUILD_BUG_ON(RTE_PKTMBUF_HEADROOM < sizeof(struct
>> virtio_net_hdr_mrg_rxbuf));
 +  if (sizeof(struct virtio_net_hdr_mrg_rxbuf) >
>> RTE_PKTMBUF_HEADROOM) {
 +  PMD_INIT_LOG(ERR,
 +  "Not sufficient headroom required = %d, avail = %d",
 +  (int)sizeof(struct virtio_net_hdr_mrg_rxbuf),
 +  RTE_PKTMBUF_HEADROOM);
 +
 +  return -1;
 +  }

eth_dev->dev_ops = &virtio_eth_dev_ops;

 --
 2.17.1

>>>


Re: [dpdk-dev] [PATCH] doc: update release note for i40e support for MARK+RSS

2019-08-05 Thread Zhang, Qi Z



> -Original Message-
> From: Mcnamara, John
> Sent: Tuesday, July 30, 2019 5:33 PM
> To: Ergin, Mesut A ; Xing, Beilei
> ; Zhang, Qi Z 
> Cc: dev@dpdk.org; Ergin, Mesut A 
> Subject: RE: [dpdk-dev] [PATCH] doc: update release note for i40e support for
> MARK+RSS
> 
> 
> 
> > -Original Message-
> > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Mesut Ali Ergin
> > Sent: Thursday, July 25, 2019 11:11 PM
> > To: Xing, Beilei ; Zhang, Qi Z
> > 
> > Cc: dev@dpdk.org; Ergin, Mesut A 
> > Subject: [dpdk-dev] [PATCH] doc: update release note for i40e support
> > for
> > MARK+RSS
> >
> > Signed-off-by: Mesut Ali Ergin 
> 
> Acked-by: John McNamara 

Applied to dpdk-next-net-intel.

Thanks
Qi



Re: [dpdk-dev] [PATCH 0/5] blank lines at EOF fixes

2019-08-05 Thread Thomas Monjalon
31/07/2019 17:38, Bruce Richardson:
> On Wed, Jul 31, 2019 at 07:57:37AM -0700, Stephen Hemminger wrote:
> > Using a simple shell script which cleans up trailing whitespace
> > found several places with extra lines at end of file.
> > 
> > More in base drivers but they are known to be problematic.
> > 
> > Stephen Hemminger (5):
> >   examples: remove extra blank lines at eof
> >   test: remove blank lines at eof
> >   pmdinfogen: remove blank line at eof
> >   net/ipn3ke: cleanup blank line at eof
> >   net/mlx5: remove blank lines at eof
> > 
> >  app/test/test_cryptodev_asym_util.h   | 4 
> >  app/test/test_table_combined.c| 1 -
> >  app/test/test_table_tables.c  | 3 +--
> >  buildtools/pmdinfogen/pmdinfogen.h| 1 -
> >  drivers/net/ipn3ke/ipn3ke_flow.c  | 1 -
> >  drivers/net/ipn3ke/ipn3ke_tm.c| 1 -
> >  drivers/net/mlx5/mlx5_rxtx.c  | 2 --
> >  examples/flow_filtering/flow_blocks.c | 1 -
> >  examples/l3fwd-power/perf_core.c  | 1 -
> >  examples/vhost_scsi/vhost_scsi.c  | 1 -
> >  10 files changed, 1 insertion(+), 15 deletions(-)
> > 
> Series-acked-by: Bruce Richardson 

Applied and squashed, thanks




[dpdk-dev] [PATCH v1 1/1] net/octeontx2: fix optimal default smq buffer count

2019-08-05 Thread vattunuru
From: Vamsi Attunuru 

Patch extends minimum supported max_sqb_count devarg value
such that it can limit the max sqb count to 8 buffers and
also defines NIX_DEF_SQB and uses it to compute the number
of smq buffers required for the egress traffic.

NIX_DEF_SQB is defined as 16 which is optimal across multiple
octeontx2 platforms to scale up the performance proportional
to the corresponding port/queue to lcore mappings.

Fixes: fb0198b7dc07 ("net/octeontx2: add devargs parsing functions")

Signed-off-by: Vamsi Attunuru 
---
 drivers/net/octeontx2/otx2_ethdev.c | 2 +-
 drivers/net/octeontx2/otx2_ethdev.h | 3 ++-
 drivers/net/octeontx2/otx2_ethdev_devargs.c | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/octeontx2/otx2_ethdev.c 
b/drivers/net/octeontx2/otx2_ethdev.c
index 3fb7bd9..3615ed2 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -810,7 +810,7 @@ nix_alloc_sqb_pool(int port, struct otx2_eth_txq *txq, 
uint16_t nb_desc)
 
nb_sqb_bufs = nb_desc / sqes_per_sqb;
/* Clamp up to devarg passed SQB count */
-   nb_sqb_bufs =  RTE_MIN(dev->max_sqb_count, RTE_MAX(NIX_MIN_SQB,
+   nb_sqb_bufs =  RTE_MIN(dev->max_sqb_count, RTE_MAX(NIX_DEF_SQB,
  nb_sqb_bufs + NIX_SQB_LIST_SPACE));
 
txq->sqb_pool = rte_mempool_create_empty(name, NIX_MAX_SQB, blk_sz,
diff --git a/drivers/net/octeontx2/otx2_ethdev.h 
b/drivers/net/octeontx2/otx2_ethdev.h
index 720386f..027b909 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -66,7 +66,8 @@
(NIX_MAX_FRS - NIX_L2_OVERHEAD)
 
 #define NIX_MAX_SQB512
-#define NIX_MIN_SQB32
+#define NIX_DEF_SQB16
+#define NIX_MIN_SQB8
 #define NIX_SQB_LIST_SPACE 2
 #define NIX_RSS_RETA_SIZE_MAX  256
 /* Group 0 will be used for RSS, 1 -7 will be used for rte_flow RSS action*/
diff --git a/drivers/net/octeontx2/otx2_ethdev_devargs.c 
b/drivers/net/octeontx2/otx2_ethdev_devargs.c
index 85e7e31..7dc6e92 100644
--- a/drivers/net/octeontx2/otx2_ethdev_devargs.c
+++ b/drivers/net/octeontx2/otx2_ethdev_devargs.c
@@ -160,6 +160,6 @@ RTE_PMD_REGISTER_PARAM_STRING(net_octeontx2,
  OTX2_RSS_RETA_SIZE "=<64|128|256>"
  OTX2_PTYPE_DISABLE "=1"
  OTX2_SCL_ENABLE "=1"
- OTX2_MAX_SQB_COUNT "=<32-512>"
+ OTX2_MAX_SQB_COUNT "=<8-512>"
  OTX2_FLOW_PREALLOC_SIZE "=<1-32>"
  OTX2_FLOW_MAX_PRIORITY "=<1-32>");
-- 
2.8.4



Re: [dpdk-dev] [PATCH] net/mlx5: fix link speed info when link is down

2019-08-05 Thread Slava Ovsiienko
> -Original Message-
> From: Xiaoyu Min 
> Sent: Monday, August 5, 2019 11:02
> To: Shahaf Shuler ; Yongseok Koh
> ; Slava Ovsiienko 
> Cc: dev@dpdk.org; sta...@dpdk.org
> Subject: [PATCH] net/mlx5: fix link speed info when link is down
> 
> When the link is down, the link speed returned by ethtool is UINT32_MAX
> and the link status is 0.
> 
> In this case, the DPDK ethdev link speed should be set to
> ETH_SPEED_NUM_NONE.
> Otherwise since link speed is non-zero but link status is zero, this is an
> inconsistent situation and -EAGAIN is returned, which is not right.
> 
> Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Xiaoyu Min 
Acked-by: Viacheslav Ovsiienko 

> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> b/drivers/net/mlx5/mlx5_ethdev.c index 9629cfb333..33a32fc2fa 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -908,7 +908,8 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev
> *dev,
>   dev->data->port_id, strerror(rte_errno));
>   return ret;
>   }
> - dev_link.link_speed = ecmd->speed;
> + dev_link.link_speed = (ecmd->speed == UINT32_MAX) ?
> ETH_SPEED_NUM_NONE :
> + ecmd->speed;
>   sc = ecmd->link_mode_masks[0] |
>   ((uint64_t)ecmd->link_mode_masks[1] << 32);
>   priv->link_speed_capa = 0;
> --
> 2.21.0



Re: [dpdk-dev] [PATCH 0/3] testpmd: fixes for 19.08

2019-08-05 Thread Thomas Monjalon
> Stephen Hemminger (3):
>   testpmd: allow configuring log level on command line
>   testpmd: block secondary process
>   testpmd: use exit instead of panic

Applied, thanks





Re: [dpdk-dev] [PATCH v2] Update supported Intel NIC driver version and firmware version

2019-08-05 Thread Thomas Monjalon
29/07/2019 05:36, Chen, Zhaoyan:
> Update supported Intel NIC driver version and firmware version
> 
> Signed-off-by: Chen, Zhaoyan 

Applied with updated title and author name:
http://git.dpdk.org/dpdk/commit/?id=cb8a35c22




Re: [dpdk-dev] [PATCH v2 0/2] Enable fast-unit tests under travis

2019-08-05 Thread Michael Santana Francisco
On Mon, Aug 5, 2019 at 8:52 AM David Marchand  wrote:
>
> On Mon, Aug 5, 2019 at 8:26 AM David Marchand  
> wrote:
> >
> > On Sat, Aug 3, 2019 at 12:00 AM Thomas Monjalon  wrote:
> > >
> > > 02/08/2019 23:25, Aaron Conole:
> > > > This series turns the fast unit tests on for a limited set of
> > > > builds under the travis build system.  An example run is available
> > > > at:
> > > >
> > > > https://travis-ci.org/orgcandman/dpdk/builds/565991679
> > > >
> > > > The builds which execute the unit tests may be distinguished by the
> > > > "RUN_TESTS" parameter.
> > > >
> > > > Aaron Conole (1):
> > > >   ci: enable unit tests under travis-ci
> > > >
> > > > Michael Santana (1):
> > > >   tests: Fix unit tests for shared builds
> > >
> > > Applied with change in comments of first patch, as described in this 
> > > thread.
> > > Thanks
> >
> > Not sure I understand this error:
> > https://travis-ci.com/DPDK/dpdk/jobs/222141682
> >
> > The 'static' config worked fine:
> > https://travis-ci.com/DPDK/dpdk/jobs/222141683
> >
> >
> > Maybe a network issue ? But I would expect some kind of related
> > warning/error message.
It's either that or some other issue with the travis infrastructure.
There is nothing wrong in our end which is the frustrating part. I am
being hopeful and optimistic that it's _just a hiccup_ and it will go
away on its own. If it really keeps happening then we might need to
report the issue to travis
> >
>
> Ah something like those messages:
> https://travis-ci.com/DPDK/dpdk/jobs/222407326
> https://travis-ci.com/DPDK/dpdk/jobs/222417471
>
> Is there a way to retry builds?
Yes, at the very top, to the right there is a 'Restart job' button.
You have to be logged in as the owner of the repo to be able to see it
and click on it. That will restart the job from the very start.
> Automatically?
That's the million dollar question. We'll have to investigate if it's possible
>
>
> --
> David Marchand


Re: [dpdk-dev] [PATCH] doc: replace PVP text licence with SPDX tag

2019-08-05 Thread Thomas Monjalon
> > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Maxime Coquelin
> 
> Acked-by: John McNamara 

Applied, thanks





Re: [dpdk-dev] [PATCH] vhost: replace iotlb licence text with SPDX tag

2019-08-05 Thread Thomas Monjalon
> Acked-by: Hemant Agrawal 

Applied, thanks





Re: [dpdk-dev] [PATCH] doc: change tools guide to SPDX license

2019-08-05 Thread Thomas Monjalon
01/08/2019 09:15, Hemant Agrawal:
> Hi Thomas,
>   Please apply this patch.
> Regards,
> Hemant
> On Wed, Jun 6, 2018 at 5:39 PM Hemant Agrawal  wrote:
> >
> > Christian,
> > Will you please ack it?  A ack from canonical is must to change the 
> > license (even if it is just the style).
> 
> Sorry Hemant for the extra delay, I was on PTO and this was lost in the mail 
> flood afterwards.
> Thanks Thomas & Colin for the extra pings to not get lost.
> 
> Acked-By: Christian Ehrhardt 

Applied, thanks




Re: [dpdk-dev] [PATCH v2 0/2] Enable fast-unit tests under travis

2019-08-05 Thread Aaron Conole
Michael Santana Francisco  writes:

> On Mon, Aug 5, 2019 at 8:52 AM David Marchand  
> wrote:
>>
>> On Mon, Aug 5, 2019 at 8:26 AM David Marchand  
>> wrote:
>> >
>> > On Sat, Aug 3, 2019 at 12:00 AM Thomas Monjalon  
>> > wrote:
>> > >
>> > > 02/08/2019 23:25, Aaron Conole:
>> > > > This series turns the fast unit tests on for a limited set of
>> > > > builds under the travis build system.  An example run is available
>> > > > at:
>> > > >
>> > > > https://travis-ci.org/orgcandman/dpdk/builds/565991679
>> > > >
>> > > > The builds which execute the unit tests may be distinguished by the
>> > > > "RUN_TESTS" parameter.
>> > > >
>> > > > Aaron Conole (1):
>> > > >   ci: enable unit tests under travis-ci
>> > > >
>> > > > Michael Santana (1):
>> > > >   tests: Fix unit tests for shared builds
>> > >
>> > > Applied with change in comments of first patch, as described in this 
>> > > thread.
>> > > Thanks
>> >
>> > Not sure I understand this error:
>> > https://travis-ci.com/DPDK/dpdk/jobs/222141682
>> >
>> > The 'static' config worked fine:
>> > https://travis-ci.com/DPDK/dpdk/jobs/222141683
>> >
>> >
>> > Maybe a network issue ? But I would expect some kind of related
>> > warning/error message.
> It's either that or some other issue with the travis infrastructure.
> There is nothing wrong in our end which is the frustrating part. I am
> being hopeful and optimistic that it's _just a hiccup_ and it will go
> away on its own. If it really keeps happening then we might need to
> report the issue to travis
>> >
>>
>> Ah something like those messages:
>> https://travis-ci.com/DPDK/dpdk/jobs/222407326
>> https://travis-ci.com/DPDK/dpdk/jobs/222417471
>>
>> Is there a way to retry builds?
> Yes, at the very top, to the right there is a 'Restart job' button.
> You have to be logged in as the owner of the repo to be able to see it
> and click on it. That will restart the job from the very start.
>> Automatically?
> That's the million dollar question. We'll have to investigate if it's
> possible

It's possible.  I need to get the robot polling travis correctly still.

At the moment it can poll, but we don't have enough of the data
recorded.  It's coming though.

One thing I notice is that some of the tests are still failing
'sporadically' and that's difficult to discern.  So we might just use
the robot as 'warn' rather than 'error' for now and maintainers will
have to make a best determination.

>>
>>
>> --
>> David Marchand


Re: [dpdk-dev] [PATCH v2 0/2] Enable fast-unit tests under travis

2019-08-05 Thread Thomas Monjalon
05/08/2019 16:18, Aaron Conole:
> One thing I notice is that some of the tests are still failing
> 'sporadically' and that's difficult to discern.  So we might just use
> the robot as 'warn' rather than 'error' for now and maintainers will
> have to make a best determination.

Yes it can be a good first step.




[dpdk-dev] [v2 0/5] fix dereference after null check coverity

2019-08-05 Thread Xiao Zhang
This patch tries to fix (dereference after null check) coverity issue.
The address of first segmented packets for ice, iavf, i40e fm10k and ixgbe
was not set correctly during reassembling packets which led to this issue.

Coverity issue: 343452
Coverity issue: 343407
Fixes: c68a52b8 ("net/ice: support vector SSE in Rx")
Coverity issue: 343447
Fixes: 319c421f ("net/avf: enable SSE Rx Tx")
Coverity issue: 343422 Coverity issue: 343403
Fixes: ca74903b ("net/i40e: extract non-x86 specific code from vector driver")
Coverity issue: 343416
Fixes: fe65e1e1 ("fm10k: add vector scatter Rx")
Coverity issue: 13245
Fixes: 8a44c15a ("net/ixgbe: extract non-x86 specific code from vector driver")
Cc: sta...@dpdk.org

v2 Add cover letter and move the fix after invalidation check

Xiao Zhang (5):
  net/ixgbe: fix dereference after null check coverity
  net/ice: fix dereference after null check coverity
  net/i40e: fix dereference after null check coverity
  net/iavf: fix dereference after null check coverity
  net/fm10k: fix dereference after null check coverity

 drivers/net/fm10k/fm10k_rxtx_vec.c | 1 +
 drivers/net/i40e/i40e_rxtx_vec_avx2.c  | 1 +
 drivers/net/i40e/i40e_rxtx_vec_sse.c   | 1 +
 drivers/net/iavf/iavf_rxtx_vec_sse.c   | 1 +
 drivers/net/ice/ice_rxtx_vec_avx2.c| 1 +
 drivers/net/ice/ice_rxtx_vec_sse.c | 1 +
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 1 +
 7 files changed, 7 insertions(+)

-- 
2.7.4



[dpdk-dev] [PATCH v2 3/5] net/i40e: fix dereference after null check coverity

2019-08-05 Thread Xiao Zhang
This patch fixes (dereference after null check) coverity issue.
The address of first segmented packets was not set correctly during
reassembling packets which led to this issue.

Coverity issue: 343422
Coverity issue: 343403
Fixes: ca74903b ("net/i40e: extract non-x86 specific code from vector
driver")
Cc: sta...@dpdk.org

Signed-off-by: Xiao Zhang 
---
 drivers/net/i40e/i40e_rxtx_vec_avx2.c | 1 +
 drivers/net/i40e/i40e_rxtx_vec_sse.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c 
b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index c4dc990..6f32789 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -590,6 +590,7 @@ i40e_recv_scattered_burst_vec_avx2(void *rx_queue, struct 
rte_mbuf **rx_pkts,
i++;
if (i == nb_bufs)
return nb_bufs;
+   rxq->pkt_first_seg = rx_pkts[i];
}
return i + reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
&split_flags[i]);
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c 
b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 3b22588..1fc66b7 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -506,6 +506,7 @@ i40e_recv_scattered_pkts_vec(void *rx_queue, struct 
rte_mbuf **rx_pkts,
i++;
if (i == nb_bufs)
return nb_bufs;
+   rxq->pkt_first_seg = rx_pkts[i];
}
return i + reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
&split_flags[i]);
-- 
2.7.4



[dpdk-dev] [PATCH v2 4/5] net/iavf: fix dereference after null check coverity

2019-08-05 Thread Xiao Zhang
This patch fixes (dereference after null check) coverity issue.
The address of first segmented packets was not set correctly during
reassembling packets which led to this issue.

Coverity issue: 343447
Fixes: 319c421f ("net/avf: enable SSE Rx Tx")
Cc: sta...@dpdk.org

Signed-off-by: Xiao Zhang 
---
 drivers/net/iavf/iavf_rxtx_vec_sse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/iavf/iavf_rxtx_vec_sse.c 
b/drivers/net/iavf/iavf_rxtx_vec_sse.c
index 3d98514..cc71f23 100644
--- a/drivers/net/iavf/iavf_rxtx_vec_sse.c
+++ b/drivers/net/iavf/iavf_rxtx_vec_sse.c
@@ -521,6 +521,7 @@ iavf_recv_scattered_pkts_vec(void *rx_queue, struct 
rte_mbuf **rx_pkts,
i++;
if (i == nb_bufs)
return nb_bufs;
+   rxq->pkt_first_seg = rx_pkts[i];
}
return i + reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
&split_flags[i]);
-- 
2.7.4



[dpdk-dev] [PATCH v2 2/5] net/ice: fix dereference after null check coverity

2019-08-05 Thread Xiao Zhang
This patch fixes (dereference after null check) coverity issue.
The address of first segmented packets was not set correctly during
reassembling packets which led to this issue.

Coverity issue: 343452
Coverity issue: 343407
Fixes: c68a52b8 ("net/ice: support vector SSE in Rx")
Cc: sta...@dpdk.org

Signed-off-by: Xiao Zhang 
---
 drivers/net/ice/ice_rxtx_vec_avx2.c | 1 +
 drivers/net/ice/ice_rxtx_vec_sse.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/ice/ice_rxtx_vec_avx2.c 
b/drivers/net/ice/ice_rxtx_vec_avx2.c
index fac869a..5ce29c2 100644
--- a/drivers/net/ice/ice_rxtx_vec_avx2.c
+++ b/drivers/net/ice/ice_rxtx_vec_avx2.c
@@ -656,6 +656,7 @@ ice_recv_scattered_burst_vec_avx2(void *rx_queue, struct 
rte_mbuf **rx_pkts,
i++;
if (i == nb_bufs)
return nb_bufs;
+   rxq->pkt_first_seg = rx_pkts[i];
}
return i + ice_rx_reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
 &split_flags[i]);
diff --git a/drivers/net/ice/ice_rxtx_vec_sse.c 
b/drivers/net/ice/ice_rxtx_vec_sse.c
index 049f60d..967a7b1 100644
--- a/drivers/net/ice/ice_rxtx_vec_sse.c
+++ b/drivers/net/ice/ice_rxtx_vec_sse.c
@@ -509,6 +509,7 @@ ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf 
**rx_pkts,
i++;
if (i == nb_bufs)
return nb_bufs;
+   rxq->pkt_first_seg = rx_pkts[i];
}
return i + ice_rx_reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
 &split_flags[i]);
-- 
2.7.4



[dpdk-dev] [PATCH v2 1/5] net/ixgbe: fix dereference after null check coverity

2019-08-05 Thread Xiao Zhang
This patch fixes (dereference after null check) coverity issue.
The address of first segmented packets was not set correctly during
reassembling packets which led to this issue.

Coverity issue: 13245
Fixes: 8a44c15a ("net/ixgbe: extract non-x86 specific code from vector
driver")

Cc: sta...@dpdk.org

Signed-off-by: Xiao Zhang 
---
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c 
b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index c9ba482..599ba30 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -609,6 +609,7 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct 
rte_mbuf **rx_pkts,
i++;
if (i == nb_bufs)
return nb_bufs;
+   rxq->pkt_first_seg = rx_pkts[i];
}
return i + reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
&split_flags[i]);
-- 
2.7.4



[dpdk-dev] [PATCH v2 5/5] net/fm10k: fix dereference after null check coverity

2019-08-05 Thread Xiao Zhang
This patch fixes (dereference after null check) coverity issue.
The address of first segmented packets was not set correctly during
reassembling packets which led to this issue.

Coverity issue: 343416
Fixes: fe65e1e1 ("fm10k: add vector scatter Rx")

Cc: sta...@dpdk.org

Signed-off-by: Xiao Zhang 
---
 drivers/net/fm10k/fm10k_rxtx_vec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c 
b/drivers/net/fm10k/fm10k_rxtx_vec.c
index 788e248..45542be 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -678,6 +678,7 @@ fm10k_recv_scattered_pkts_vec(void *rx_queue,
i++;
if (i == nb_bufs)
return nb_bufs;
+   rxq->pkt_first_seg = rx_pkts[i];
}
return i + fm10k_reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
&split_flags[i]);
-- 
2.7.4



Re: [dpdk-dev] unimplemented API heads-up notice

2019-08-05 Thread Thomas Monjalon
Ping
What is the status of this deprecation plan?

28/12/2018 17:18, Ananyev, Konstantin:
> Hi everyone,
> As you probably know, all un-implemented API inside DPDK
> planned to be deprecated in 19.05 and removed in 19.08.
> For more details, please refer to:
> https://mails.dpdk.org/archives/dev/2018-November/118697.html
> Below is the list (probably incomplete) of currently un-implemented API. 
> If you are aware of some extra unimplemented API that is not in that list,
> or you believe that something was added into the list by mistake,
> please reply to that message.
> Happy NY :)
> Konstantin
> 
> 1) rte_security
>a)  RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL
>b)  RTE_SECURITY_RX_HW_TRAILER_OFFLOAD, RTE_SECURITY_TX_HW_TRAILER_OFFLOAD
>c)  rte_security_ops methods: 
>  - get_userdata
>  - session_update
>  - session_stats_get (and rte_security_stats)
> 
> 2) rte_ethdev
> a) RTE_ETH_EVENT_IPSEC_*
> b) rx offloads:
>  -   DEV_RX_OFFLOAD_SCTP_CKSUM
>  -  DEV_RX_OFFLOAD_OUTER_UDP_CKSUM
>  -  DEV_RX_OFFLOAD_HEADER_SPLIT
>  -  DEV_RX_OFFLOAD_MACSEC_STRIP 
> 
>  3) rte_mbuf
>  a) rte_mbuf.inner_esp_next_proto
>  b) RTE_PTYPE_TUNNEL_ESP
> 
>  4) rte_bbdev
> a) rte_bbdev_ops methods:
>- setup_queues
>- intr_enable
>- start
>- stop
>- close
>- stats_get
>- stats_reset
>- queue_start
>- queue_stop
>- queue_intr_enable
>- queue_intr_disable
> 







Re: [dpdk-dev] [PATCH] doc: announce malloc virt2phys symbol removal

2019-08-05 Thread Thomas Monjalon
02/08/2019 15:29, David Marchand:
> This symbol has been deprecated for quite some time.
> Let's drop it in the next release.
> ---
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> +* eal: The ``rte_malloc_virt2phy`` function has been deprecated and replaced
> +  by ``rte_malloc_virt2iova`` since v17.11 and will be removed in DPDK 19.11.

For this patch and another one about removing rte_cpu_check_supported(),
I have a general comment on the date of removal.

As was stated recently in the contribution guide:
http://git.dpdk.org/dpdk/commit/?id=7abe4a24cc
"Deprecated APIs are removed completely just after the next LTS."

The idea behind this policy is to avoid removals during LTS releases,
in order to have at least one release before X.11 LTS for end users
to prepare replacing the usage of the removed API.

Does it make sense to postpone any API removal after 19.11?




Re: [dpdk-dev] [PATCH v2 1/6] net/mlx5: fix default minimal data inline

2019-08-05 Thread Raslan Darawsheh
Hi,

> -Original Message-
> From: dev  On Behalf Of Viacheslav Ovsiienko
> Sent: Monday, August 5, 2019 4:04 PM
> To: dev@dpdk.org
> Cc: Yongseok Koh ; Matan Azrad
> 
> Subject: [dpdk-dev] [PATCH v2 1/6] net/mlx5: fix default minimal data inline
> 
> The patch [Fixes] sets the default value of required minimal inline data to 0
> bytes. On some configurations (depends on switchdev/legacy settings and
> FW version/settings) the ConnectX-4LX NIC requires minimal 18 bytes of Tx
> descriptor inline data to operate correctly.
> 
> Wrongly set to 0 default value may prevent NIC from operating with out-of-
> the-box settings, this patch reverts default value for ConnectX-4LX back to 18
> bytes (inline L2).
> 
> Fixes: 9f350504bb32 ("net/mlx5: fix ConnectX-4LX minimal inline data limit")
> 
> Signed-off-by: Viacheslav Ovsiienko 
> Acked-by: Matan Azrad 
> ---
>  drivers/net/mlx5/mlx5.c | 5 +
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index
> 909c22e..a3eacdb 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -1325,12 +1325,9 @@ struct mlx5_dev_spawn_data {
>   switch (spawn->pci_dev->id.device_id) {
>   case PCI_DEVICE_ID_MELLANOX_CONNECTX4:
>   case PCI_DEVICE_ID_MELLANOX_CONNECTX4VF:
> - config->txq_inline_min = MLX5_INLINE_HSIZE_L2;
> - config->hw_vlan_insert = 0;
> - break;
>   case PCI_DEVICE_ID_MELLANOX_CONNECTX4LX:
>   case PCI_DEVICE_ID_MELLANOX_CONNECTX4LXVF:
> - config->txq_inline_min = MLX5_INLINE_HSIZE_NONE;
> + config->txq_inline_min = MLX5_INLINE_HSIZE_L2;
>   config->hw_vlan_insert = 0;
>   break;
>   case PCI_DEVICE_ID_MELLANOX_CONNECTX5:
> --
> 1.8.3.1

Series applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh


[dpdk-dev] [PATCH 2/2] net/bonding: fix selection logic

2019-08-05 Thread kkanas
From: Krzysztof Kanas 

Fix max_index to return uint16_t as it is valid slave_id type.

Arrays agg_count and agg_bandwidth should be indexed by slave_id not by
aggregator port_id.

Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
Cc: danielx.t.mrzyg...@intel.com

Signed-off-by: Krzysztof Kanas 
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c 
b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 89a8ba3de963..b923e69ef23a 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -639,7 +639,7 @@ tx_machine(struct bond_dev_private *internals, uint16_t 
slave_id)
SM_FLAG_CLR(port, NTT);
 }
 
-static uint8_t
+static uint16_t
 max_index(uint64_t *a, int n)
 {
if (n <= 0)
@@ -673,8 +673,8 @@ selection_logic(struct bond_dev_private *internals, 
uint16_t slave_id)
uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] = {0};
uint64_t agg_count[RTE_MAX_ETHPORTS] = {0};
uint16_t default_slave = 0;
-   uint8_t mode_count_id, mode_band_id;
struct rte_eth_link link_info;
+   uint16_t agg_new_idx = 0;
 
slaves = internals->active_slaves;
slaves_count = internals->active_slave_count;
@@ -687,9 +687,9 @@ selection_logic(struct bond_dev_private *internals, 
uint16_t slave_id)
if (agg->aggregator_port_id != slaves[i])
continue;
 
-   agg_count[agg->aggregator_port_id] += 1;
+   agg_count[i] += 1;
rte_eth_link_get_nowait(slaves[i], &link_info);
-   agg_bandwidth[agg->aggregator_port_id] += link_info.link_speed;
+   agg_bandwidth[i] += link_info.link_speed;
 
/* Actors system ID is not checked since all slave device have 
the same
 * ID (MAC address). */
@@ -710,14 +710,12 @@ selection_logic(struct bond_dev_private *internals, 
uint16_t slave_id)
 
switch (internals->mode4.agg_selection) {
case AGG_COUNT:
-   mode_count_id = max_index(
-   (uint64_t *)agg_count, slaves_count);
-   new_agg_id = mode_count_id;
+   agg_new_idx = max_index(agg_count, slaves_count);
+   new_agg_id = slaves[agg_new_idx];
break;
case AGG_BANDWIDTH:
-   mode_band_id = max_index(
-   (uint64_t *)agg_bandwidth, slaves_count);
-   new_agg_id = mode_band_id;
+   agg_new_idx = max_index(agg_bandwidth, slaves_count);
+   new_agg_id = slaves[agg_new_idx];
break;
case AGG_STABLE:
if (default_slave == slaves_count)
-- 
2.21.0



[dpdk-dev] [PATCH 1/2] net/bonding: fix stack overflow in selection logic

2019-08-05 Thread kkanas
From: Krzysztof Kanas 

Bonding selection logic uses agg_bandwidth, agg_count indexed by port_id
but those arrays are 8 entries long.

Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
Cc: danielx.t.mrzyg...@intel.com

Signed-off-by: Krzysztof Kanas 
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c 
b/drivers/net/bonding/rte_eth_bond_8023ad.c
index d764dad331ed..89a8ba3de963 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -670,8 +670,8 @@ selection_logic(struct bond_dev_private *internals, 
uint16_t slave_id)
struct port *agg, *port;
uint16_t slaves_count, new_agg_id, i, j = 0;
uint16_t *slaves;
-   uint64_t agg_bandwidth[8] = {0};
-   uint64_t agg_count[8] = {0};
+   uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] = {0};
+   uint64_t agg_count[RTE_MAX_ETHPORTS] = {0};
uint16_t default_slave = 0;
uint8_t mode_count_id, mode_band_id;
struct rte_eth_link link_info;
-- 
2.21.0



Re: [dpdk-dev] [PATCH] doc: announce malloc virt2phys symbol removal

2019-08-05 Thread David Marchand
On Mon, Aug 5, 2019 at 4:39 PM Thomas Monjalon  wrote:
>
> 02/08/2019 15:29, David Marchand:
> > This symbol has been deprecated for quite some time.
> > Let's drop it in the next release.
> > ---
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > +* eal: The ``rte_malloc_virt2phy`` function has been deprecated and 
> > replaced
> > +  by ``rte_malloc_virt2iova`` since v17.11 and will be removed in DPDK 
> > 19.11.
>
> For this patch and another one about removing rte_cpu_check_supported(),
> I have a general comment on the date of removal.
>
> As was stated recently in the contribution guide:
> http://git.dpdk.org/dpdk/commit/?id=7abe4a24cc
> "Deprecated APIs are removed completely just after the next LTS."
>
> The idea behind this policy is to avoid removals during LTS releases,
> in order to have at least one release before X.11 LTS for end users
> to prepare replacing the usage of the removed API.
>
> Does it make sense to postpone any API removal after 19.11?

Those symbols have been marked as deprecated for a long time.
Users had to either disable Werror or they actually migrated to the new apis.
If they chose the lazy way of not migrating to the new apis, I suspect
they forgot about it and/or they won't look at the release notes.


I don't particularly have a problem with waiting for 20.02, those are
easy to remove anyway.

-- 
David Marchand


Re: [dpdk-dev] [PATCH 0/6] add SPDX tag to files for Power architecture

2019-08-05 Thread Thomas Monjalon
30/07/2019 22:01, David Christensen:
> This patchset replaces the full BSD 3 clause license headers with the
> SPDX tag for remaining files used for Power architecture.
> 
> David Christensen (6):
>   config: replace license text with SPDX tag
>   librte_eal: replace license text with SPDX tag
>   librte_acl: replace license text with SPDX tag
>   librte_eal: replace license text with SPDX tag
>   librte_lpm: replace license text with SPDX tag
>   mk: replace license text with SPDX tag

Applied, thanks





Re: [dpdk-dev] [PATCH 1/2] net/bonding: fix stack overflow in selection logic

2019-08-05 Thread David Marchand
On Mon, Aug 5, 2019 at 4:46 PM  wrote:
>
> From: Krzysztof Kanas 
>
> Bonding selection logic uses agg_bandwidth, agg_count indexed by port_id
> but those arrays are 8 entries long.

Idem http://mails.dpdk.org/archives/dev/2019-July/140020.html

I did not get a reply from you.


-- 
David Marchand


Re: [dpdk-dev] [PATCH] doc: announce malloc virt2phys symbol removal

2019-08-05 Thread Thomas Monjalon
05/08/2019 17:05, David Marchand:
> On Mon, Aug 5, 2019 at 4:39 PM Thomas Monjalon  wrote:
> > 02/08/2019 15:29, David Marchand:
> > > This symbol has been deprecated for quite some time.
> > > Let's drop it in the next release.
> > > ---
> > > --- a/doc/guides/rel_notes/deprecation.rst
> > > +++ b/doc/guides/rel_notes/deprecation.rst
> > > +* eal: The ``rte_malloc_virt2phy`` function has been deprecated and 
> > > replaced
> > > +  by ``rte_malloc_virt2iova`` since v17.11 and will be removed in DPDK 
> > > 19.11.
> >
> > For this patch and another one about removing rte_cpu_check_supported(),
> > I have a general comment on the date of removal.
> >
> > As was stated recently in the contribution guide:
> > http://git.dpdk.org/dpdk/commit/?id=7abe4a24cc
> > "Deprecated APIs are removed completely just after the next LTS."
> >
> > The idea behind this policy is to avoid removals during LTS releases,
> > in order to have at least one release before X.11 LTS for end users
> > to prepare replacing the usage of the removed API.
> >
> > Does it make sense to postpone any API removal after 19.11?
> 
> Those symbols have been marked as deprecated for a long time.
> Users had to either disable Werror or they actually migrated to the new apis.
> If they chose the lazy way of not migrating to the new apis, I suspect
> they forgot about it and/or they won't look at the release notes.

Yes I agree.
That's why they can be surprised when hitting the removal.
Avoiding this removal in LTS release is one more care for
the lazy users. The question: is too much caution?

> I don't particularly have a problem with waiting for 20.02, those are
> easy to remove anyway.





Re: [dpdk-dev] [PATCH] net/mlx5: fix order of lines in loop

2019-08-05 Thread Raslan Darawsheh
Hi,

> -Original Message-
> From: dev  On Behalf Of Dekel Peled
> Sent: Monday, August 5, 2019 2:51 PM
> To: Yongseok Koh ; Slava Ovsiienko
> ; Shahaf Shuler 
> Cc: Ori Kam ; dev@dpdk.org; Eli Britstein
> 
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix order of lines in loop
> 
> Function flow_dv_zero_encap_udp_csum() uses a while loop to iterate
> over vlan items in flow rule.
> Pointer next_hdr is incremented to the next item before it is used,
> so the first item is skipped.
> 
> This patch moves the incrementing of next_hdr to the correct place.
> 
> Fixes: bf1d7d9a033a ("net/mlx5: zero out UDP checksum in encapsulation")
> Cc: el...@mellanox.com
> 
> Signed-off-by: Dekel Peled 
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c
> index 536059d..6c58634 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -1504,9 +1504,9 @@ struct field_modify_info modify_tcp[] = {
> 
>   /* VLAN skipping */
>   while (proto == RTE_ETHER_TYPE_VLAN || proto ==
> RTE_ETHER_TYPE_QINQ) {
> - next_hdr += sizeof(struct rte_vlan_hdr);
>   vlan = (struct rte_vlan_hdr *)next_hdr;
>   proto = RTE_BE16(vlan->eth_proto);
> + next_hdr += sizeof(struct rte_vlan_hdr);
>   }
> 
>   /* HW calculates IPv4 csum. no need to proceed */
> --
> 1.8.3.1

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh


Re: [dpdk-dev] [PATCH] net/mlx5: fix link speed info when link is down

2019-08-05 Thread Raslan Darawsheh
Hi,

> -Original Message-
> From: dev  On Behalf Of Xiaoyu Min
> Sent: Monday, August 5, 2019 11:02 AM
> To: Shahaf Shuler ; Yongseok Koh
> ; Slava Ovsiienko 
> Cc: dev@dpdk.org; sta...@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix link speed info when link is down
> 
> When the link is down, the link speed returned by ethtool is
> UINT32_MAX and the link status is 0.
> 
> In this case, the DPDK ethdev link speed should be set to
> ETH_SPEED_NUM_NONE.
> Otherwise since link speed is non-zero but link status is zero, this
> is an inconsistent situation and -EAGAIN is returned, which is not right.
> 
> Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Xiaoyu Min 
> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> b/drivers/net/mlx5/mlx5_ethdev.c
> index 9629cfb333..33a32fc2fa 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -908,7 +908,8 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev
> *dev,
>   dev->data->port_id, strerror(rte_errno));
>   return ret;
>   }
> - dev_link.link_speed = ecmd->speed;
> + dev_link.link_speed = (ecmd->speed == UINT32_MAX) ?
> ETH_SPEED_NUM_NONE :
> + ecmd->speed;
>   sc = ecmd->link_mode_masks[0] |
>   ((uint64_t)ecmd->link_mode_masks[1] << 32);
>   priv->link_speed_capa = 0;
> --
> 2.21.0

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh


Re: [dpdk-dev] [PATCH v3 2/2] devtools: allow misc options in null test

2019-08-05 Thread Thomas Monjalon
30/07/2019 19:34, Thomas Monjalon:
> In order to ease basic testing with customized options,
> EAL and testpmd options can be added as third and fourth arguments
> of the "null PMD" script.
> 
> Also, the first argument becomes more flexible by accepting
> the testpmd path as an alternative to the build directory.
> 
> Signed-off-by: Thomas Monjalon 

Applied





Re: [dpdk-dev] [PATCH v2 1/2] doc: use SPDX tag for bnx2x PMD guide

2019-08-05 Thread Jerin Jacob Kollanukkaran
> -Original Message-
> From: Rasesh Mody 
> Sent: Monday, August 5, 2019 2:54 PM
> To: dev@dpdk.org; Thomas Monjalon 
> Cc: Rasesh Mody ; Hemant Agrawal
> ; Jerin Jacob Kollanukkaran
> ; John McNamara ; GR-
> Everest-DPDK-Dev 
> Subject: [PATCH v2 1/2] doc: use SPDX tag for bnx2x PMD guide
> 
> Use SPDX tag for bnx2x PMD guide
> 
> v2:
> add short patch description
> 
> Signed-off-by: Rasesh Mody 

Series applied to dpdk-next-net-mrvl/master. Thanks.


Re: [dpdk-dev] [PATCH v2] doc: add a co-existence consideration for qede PMD

2019-08-05 Thread Jerin Jacob Kollanukkaran
> -Original Message-
> From: Rasesh Mody 
> Sent: Monday, August 5, 2019 2:50 PM
> To: dev@dpdk.org; Thomas Monjalon 
> Cc: Rasesh Mody ; John McNamara
> ; Jerin Jacob Kollanukkaran
> ; GR-Everest-DPDK-Dev  d...@marvell.com>; sta...@dpdk.org
> Subject: [PATCH v2] doc: add a co-existence consideration for qede PMD
> 
> Add and update co-existence considerations for qede PMD
> 
> v2:
> Made co-existence considerations for QLogic adapters more specific
> 
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Rasesh Mody 

Applied to dpdk-next-net-mrvl/master. Thanks


> ---
>  doc/guides/nics/qede.rst | 25 ++---
>  1 file changed, 22 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/guides/nics/qede.rst b/doc/guides/nics/qede.rst index
> c0a383381..05a6aef57 100644
> --- a/doc/guides/nics/qede.rst
> +++ b/doc/guides/nics/qede.rst
> @@ -7,7 +7,7 @@ QEDE Poll Mode Driver
> 
>  The QEDE poll mode driver library (**librte_pmd_qede**) implements
> support  for **QLogic FastLinQ QL4 10G/25G/40G/50G/100G Intelligent
> Ethernet Adapters (IEA) and Converged Network Adapters (CNA)** family of
> adapters as well as SR-IOV virtual functions (VF). It is supported on -several
> standard Linux distros like RHEL7.x, SLES12.x and Ubuntu.
> +several standard Linux distros like RHEL, SLES, Ubuntu etc.
>  It is compile-tested under FreeBSD OS.
> 
>  More information can be found at `QLogic Corporation's Website @@ -47,8
> +47,27 @@ Non-supported Features
> 
>  Co-existence considerations
>  ---
> -- QLogic FastLinQ QL4 CNAs can have both NIC and Storage
> personalities. However, coexistence with storage protocol drivers (qedi and
> qedf) is not supported on the same adapter. So storage personality has to be
> disabled on that adapter when used in DPDK applications.
> -- For SR-IOV case, qede PMD will be used to bind to SR-IOV VF device and
> Linux native kernel driver (qede) will be attached to SR-IOV PF.
> +
> +- QLogic FastLinQ QL4 CNAs support Ethernet, RDMA, iSCSI and FCoE
> +  functionalities. These functionalities are supported using
> +  QLogic Linux kernel drivers qed, qede, qedr, qedi and qedf. DPDK is
> +  supported on these adapters using qede PMD.
> +
> +- When SR-IOV is not enabled on the adapter,
> +  QLogic Linux kernel drivers (qed, qede, qedr, qedi and qedf) and qede
> +  PMD can’t be attached to different PFs on a given QLogic FastLinQ
> +  QL4xxx adapter.
> +  A given adapter needs to be completely used by DPDK or Linux drivers
> +  Before binding DPDK driver to one or more PFs on the adapter,
> +  please make sure to unbind Linux drivers from all PFs of the adapter.
> +  If there are multiple adapters on the system, one or more adapters
> +  can be used by DPDK driver completely and other adapters can be used
> +  by Linux drivers completely.
> +
> +- When SR-IOV is enabled on the adapter,
> +  Linux kernel drivers (qed, qede, qedr, qedi and qedf) can be bound
> +  to the PFs of a given adapter and either qede PMD or Linux drivers
> +  (qed and qede) can be bound to the VFs of the adapter.
> 
>  Supported QLogic Adapters
>  -
> --
> 2.18.0



[dpdk-dev] [PATCH 0/5] improve mlx5 guide

2019-08-05 Thread Thomas Monjalon
The mlx5 guide is a bit complex. It needs some clean-up
in some areas, some details are missing, etc.
This series is a first step of improvement for 19.08.
More in-depth improvements are expected for 19.11.

Thomas Monjalon (5):
  doc: improve firmware configuration in mlx5 guide
  doc: fix wording and formatting of mlx5 guide
  doc: remove useless console syntax in mlx guides
  doc: add mlx5 design details
  doc: add more details about mlx5 offloads

 doc/guides/nics/mlx4.rst |  92 -
 doc/guides/nics/mlx5.rst | 289 ++-
 2 files changed, 155 insertions(+), 226 deletions(-)

-- 
2.21.0



[dpdk-dev] [PATCH 1/5] doc: improve firmware configuration in mlx5 guide

2019-08-05 Thread Thomas Monjalon
The command mlxconfig was not enough explained and too much verbose
at the same time.
The syntax is now explained in introduction before listing the options,
without repeating the commands.
Some options, which are explained elsewhere in the doc,
are added to this list.

Signed-off-by: Thomas Monjalon 
---
 doc/guides/nics/mlx5.rst | 53 +++-
 1 file changed, 30 insertions(+), 23 deletions(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 46538b8f1..32b1900bd 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -575,46 +575,53 @@ Run-time configuration
 Firmware configuration
 ~~
 
-- L3 VXLAN and VXLAN-GPE destination UDP port
+Firmware features can be configured as key/value pairs.
 
-   .. code-block:: console
+The command to set a value is::
 
- mlxconfig -d  set IP_OVER_VXLAN_EN=1
- mlxconfig -d  set IP_OVER_VXLAN_PORT=
+  mlxconfig -d  set =
 
-  Verify configurations are set:
+The command to query a value is::
 
-   .. code-block:: console
+  mlxconfig -d  query | grep 
 
- mlxconfig -d  query | grep IP_OVER_VXLAN
- IP_OVER_VXLAN_ENTrue(1)
- IP_OVER_VXLAN_PORT  
+The device name for the command ``mlxconfig`` can be either the PCI address,
+or the mst device name found with::
 
-- enable ICMP/ICMP6's code/type field matching
+  mst status
 
-   .. code-block:: console
+Below are some firmware configurations listed.
 
- mlxconfig -d  set FLEX_PARSER_PROFILE_ENABLE=2
+- link type::
 
-  Verify configurations are set:
+LINK_TYPE_P1
+LINK_TYPE_P2
+value: 1=Infiniband 2=Ethernet 3=VPI(auto-sense)
 
-   .. code-block:: console
+- enable SR-IOV::
 
- mlxconfig -d  query | grep FLEX_PARSER_PROFILE_ENABLE
- FLEX_PARSER_PROFILE_ENABLE 2
+SRIOV_EN=1
 
-- IP-in-IP tunnel enable
+- maximum number of SR-IOV virtual functions::
 
-   .. code-block:: console
+NUM_OF_VFS=
 
- mlxconfig -d  set FLEX_PARSER_PROFILE_ENABLE=0
+- aggressive CQE zipping::
 
-  Verify configurations are set:
+CQE_COMPRESSION=1
 
-   .. code-block:: console
+- L3 VXLAN and VXLAN-GPE destination UDP port::
 
- mlxconfig -d  query | grep FLEX_PARSER_PROFILE_ENABLE
- FLEX_PARSER_PROFILE_ENABLE  0
+IP_OVER_VXLAN_EN=1
+IP_OVER_VXLAN_PORT=
+
+- enable IP-in-IP tunnel flow matching::
+
+FLEX_PARSER_PROFILE_ENABLE=0
+
+- enable ICMP/ICMP6 code/type fields matching::
+
+FLEX_PARSER_PROFILE_ENABLE=2
 
 Prerequisites
 -
-- 
2.21.0



[dpdk-dev] [PATCH 2/5] doc: fix wording and formatting of mlx5 guide

2019-08-05 Thread Thomas Monjalon
These are simple fixes of punctuation, anchor placement
or wording.
The table format is fixed to avoid having a long line
in the first column.

Signed-off-by: Thomas Monjalon 
---
 doc/guides/nics/mlx5.rst | 57 +++-
 1 file changed, 27 insertions(+), 30 deletions(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 32b1900bd..59c9537c0 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -32,9 +32,9 @@ kernel support), librte_pmd_mlx5 relies heavily on system 
calls for control
 operations such as querying/updating the MTU and flow control parameters.
 
 For security reasons and robustness, this driver only deals with virtual
-memory addresses. The way resources allocations are handled by the kernel
-combined with hardware specifications that allow it to handle virtual memory
-addresses directly ensure that DPDK applications cannot access random
+memory addresses. The way resources allocations are handled by the kernel,
+combined with hardware specifications that allow to handle virtual memory
+addresses directly, ensure that DPDK applications cannot access random
 physical memory (or memory that does not belong to the current process).
 
 This capability allows the PMD to coexist with kernel network interfaces
@@ -80,7 +80,7 @@ Features
 - Tunnel types: VXLAN, L3 VXLAN, VXLAN-GPE, GRE, MPLSoGRE, MPLSoUDP, IP-in-IP.
 - Tunnel HW offloads: packet type, inner/outer RSS, IP and UDP checksum 
verification.
 - NIC HW offloads: encapsulation (vxlan, gre, mplsoudp, mplsogre), NAT, 
routing, TTL
-  increment/decrement, count, drop, mark. For details please see 
:ref:`Supported hardware offloads using rte_flow API`.
+  increment/decrement, count, drop, mark. For details please see 
:ref:`mlx5_offloads_support`.
 - Flow insertion rate of more then million flows per second, when using Direct 
Rules.
 - Support for multiple rte_flow groups.
 - Hardware LRO.
@@ -173,7 +173,7 @@ Limitations
 Statistics
 --
 
-MLX5 supports various of methods to report statistics:
+MLX5 supports various methods to report statistics:
 
 Port statistics can be queried using ``rte_eth_stats_get()``. The received and 
sent statistics are through SW only and counts the number of packets received 
or sent successfully by the PMD. The imissed counter is the amount of packets 
that could not be delivered to SW because a queue was full. Packets not 
received due to congestion in the bus or on the NIC can be queried via the 
rx_discards_phy xstats counter.
 
@@ -972,62 +972,59 @@ Performance tuning
- Configure per-lcore cache when creating Mempools for packet buffer.
- Refrain from dynamically allocating/freeing memory in run-time.
 
+.. _mlx5_offloads_support:
+
 Supported hardware offloads using rte_flow API
 --
 
-.. _Supported hardware offloads using rte_flow API:
-
 .. table:: Supported hardware offloads using rte_flow API
 
+---+-+-+
-   | Offload   | E-Switch| NIC |
-   |   | | |
+   | Offload   | with E-Switch   | with vNIC   |
+===+=+=+
| Count | | DPDK 19.05| | DPDK 19.02|
|   | | OFED 4.6  | | OFED 4.6  |
-   |   | | RDMA-CORE V24 | | RDMA-CORE V23 |
+   |   | | rdma-core 24  | | rdma-core 23  |
|   | | ConnectX-5| | ConnectX-5|
+---+-+-+
| Drop / Queue / RSS| | DPDK 19.05| | DPDK 18.11|
|   | | OFED 4.6  | | OFED 4.5  |
-   |   | | RDMA-CORE V24 | | RDMA-CORE V23 |
+   |   | | rdma-core 24  | | rdma-core 23  |
|   | | ConnectX-5| | ConnectX-4|
+---+-+-+
| Encapsulation | | DPDK 19.05| | DPDK 19.02|
-   | (VXLAN / NVGRE / RAW) | | OFED 4.6.2| | OFED 4.6  |
-   |   | | RDMA-CORE V24 | | RDMA-CORE V23 |
+   | (VXLAN / NVGRE / RAW) | | OFED 4.6-2| | OFED 4.6  |
+   |   | | rdma-core 24  | | rdma-core 23  |
|   | | ConnectX-5| | ConnectX-5|
+---+-+-+
-   | Header rewrite| | DPDK 19.05| | DPDK 19.02|
-   | (set_ipv4_src /   | | OFED 4.6.2| | OFED 4.6.2|
-   | set_ipv4_dst /| | RDMA-CORE V24 | | RDMA-CORE V23 |
-   | set_ipv6_src /| | ConnectX-5| | ConnectX-5|
-   | set_ipv6_dst /| | |
-   | set_tp_src /  | | |
-   | set_tp_dst /  | 

[dpdk-dev] [PATCH 5/5] doc: add more details about mlx5 offloads

2019-08-05 Thread Thomas Monjalon
Add firmware config for MPLS and DevX (required by LRO and DR).

Add a table for queue offloads requirements.

Signed-off-by: Thomas Monjalon 
---
 doc/guides/nics/mlx5.rst | 35 ++-
 1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index b9cabfe96..0f92100e1 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -172,10 +172,13 @@ Limitations
   - can be applied to VF ports only.
   - must specify PF port action (packet redirection from VF to PF).
 
-- ICMP/ICMP6 code/type matching cannot be supported togeter with IP-in-IP 
tunnel.
+- ICMP/ICMP6 code/type matching, IP-in-IP and MPLS flow matching are all
+  mutually exclusive features which cannot be supported together
+  (see :ref:`mlx5_firmware_config`).
 
 - LRO:
 
+  - Requires DevX to be enabled.
   - KEEP_CRC offload cannot be supported with LRO.
   - The first mbuf length, without head-room,  must be big enough to include 
the
 TCP header (122B).
@@ -582,6 +585,8 @@ Run-time configuration
   If this parameter is not specified, by default PMD will set
   the smallest value supported by HW.
 
+.. _mlx5_firmware_config:
+
 Firmware configuration
 ~~
 
@@ -616,6 +621,10 @@ Below are some firmware configurations listed.
 
 NUM_OF_VFS=
 
+- enable DevX (required by Direct Rules and other features)::
+
+UCTX_EN=1
+
 - aggressive CQE zipping::
 
 CQE_COMPRESSION=1
@@ -629,6 +638,10 @@ Below are some firmware configurations listed.
 
 FLEX_PARSER_PROFILE_ENABLE=0
 
+- enable MPLS flow matching::
+
+FLEX_PARSER_PROFILE_ENABLE=1
+
 - enable ICMP/ICMP6 code/type fields matching::
 
 FLEX_PARSER_PROFILE_ENABLE=2
@@ -940,10 +953,22 @@ Performance tuning
 
 .. _mlx5_offloads_support:
 
-Supported hardware offloads using rte_flow API
---
+Supported hardware offloads
+---
 
-.. table:: Supported hardware offloads using rte_flow API
+.. table:: Minimal SW/HW versions for queue offloads
+
+   == = = = = == ==
+   OffloadDPDK  Linux rdma-core OFED   firmware   hardware
+   == = = = = == ==
+   common base17.11  4.1416 4.2-1 12.21.1000 ConnectX-4
+   checksums  17.11  4.1416 4.2-1 12.21.1000 ConnectX-4
+   Rx timestamp   17.11  4.1416 4.2-1 12.21.1000 ConnectX-4
+   TSO17.11  4.1416 4.2-1 12.21.1000 ConnectX-4
+   LRO19.08  N/A N/A4.6-4 16.25.6406 ConnectX-5
+   == = = = = == ==
+
+.. table:: Minimal SW/HW versions for rte_flow offloads
 
+---+-+-+
| Offload   | with E-Switch   | with vNIC   |
@@ -976,7 +1001,7 @@ Supported hardware offloads using rte_flow API
| | set_mac_dst)| | |
+---+-+-+
| Jump  | | DPDK 19.05| | DPDK 19.02|
-   |   | | OFED 4.6-2| | OFED 4.6-2|
+   |   | | OFED 4.6-4| | OFED 4.6-4|
|   | | rdma-core 24  | | N/A   |
|   | | ConnectX-5| | ConnectX-5|
+---+-+-+
-- 
2.21.0



[dpdk-dev] [PATCH 3/5] doc: remove useless console syntax in mlx guides

2019-08-05 Thread Thomas Monjalon
It is not needed to use "console" syntax highlighting
for literal blocks.
The file is easier to read by removing the code-block lines
and simply having double colons in previous line.

Signed-off-by: Thomas Monjalon 
---
 doc/guides/nics/mlx4.rst |  92 +++-
 doc/guides/nics/mlx5.rst | 128 ++-
 2 files changed, 55 insertions(+), 165 deletions(-)

diff --git a/doc/guides/nics/mlx4.rst b/doc/guides/nics/mlx4.rst
index 5c6bbdea1..d0e8a8b2f 100644
--- a/doc/guides/nics/mlx4.rst
+++ b/doc/guides/nics/mlx4.rst
@@ -272,33 +272,23 @@ Installing Mellanox OFED
 2. Install the required libraries and kernel modules either by installing
only the required set, or by installing the entire Mellanox OFED:
 
-   For bare metal use:
-
-   .. code-block:: console
+   For bare metal use::
 
 ./mlnxofedinstall --dpdk --upstream-libs
 
-   For SR-IOV hypervisors use:
-
-   .. code-block:: console
+   For SR-IOV hypervisors use::
 
 ./mlnxofedinstall --dpdk --upstream-libs --enable-sriov --hypervisor
 
-   For SR-IOV virtual machine use:
-
-   .. code-block:: console
+   For SR-IOV virtual machine use::
 
 ./mlnxofedinstall --dpdk --upstream-libs --guest
 
-3. Verify the firmware is the correct one:
-
-   .. code-block:: console
+3. Verify the firmware is the correct one::
 
 ibv_devinfo
 
-4. Set all ports links to Ethernet, follow instructions on the screen:
-
-   .. code-block:: console
+4. Set all ports links to Ethernet, follow instructions on the screen::
 
 connectx_port_config
 
@@ -314,9 +304,7 @@ Supported NICs
 Quick Start Guide
 -
 
-1. Set all ports links to Ethernet
-
-   .. code-block:: console
+1. Set all ports links to Ethernet::
 
 PCI=
 echo eth > "/sys/bus/pci/devices/$PCI/mlx4_port0"
@@ -331,9 +319,7 @@ Quick Start Guide
 .. _QSG_2:
 
 2. In case of bare metal or hypervisor, configure optimized steering mode
-   by adding the following line to ``/etc/modprobe.d/mlx4_core.conf``:
-
-   .. code-block:: console
+   by adding the following line to ``/etc/modprobe.d/mlx4_core.conf``::
 
 options mlx4_core log_num_mgm_entry_size=-7
 
@@ -342,15 +328,11 @@ Quick Start Guide
 If VLAN filtering is used, set log_num_mgm_entry_size=-1.
 Performance degradation can occur on this case.
 
-3. Restart the driver:
-
-   .. code-block:: console
+3. Restart the driver::
 
 /etc/init.d/openibd restart
 
-   or:
-
-   .. code-block:: console
+   or::
 
 service openibd restart
 
@@ -360,17 +342,13 @@ Quick Start Guide
 Performance tuning
 --
 
-1. Verify the optimized steering mode is configured:
-
-  .. code-block:: console
+1. Verify the optimized steering mode is configured::
 
 cat /sys/module/mlx4_core/parameters/log_num_mgm_entry_size
 
 2. Use the CPU near local NUMA node to which the PCIe adapter is connected,
for better performance. For VMs, verify that the right CPU
-   and NUMA node are pinned according to the above. Run:
-
-   .. code-block:: console
+   and NUMA node are pinned according to the above. Run::
 
 lstopo-no-graphics
 
@@ -382,9 +360,7 @@ Performance tuning
This in order to forward packets from one to the other without
NUMA performance penalty.
 
-4. Disable pause frames:
-
-   .. code-block:: console
+4. Disable pause frames::
 
 ethtool -A  rx off tx off
 
@@ -398,15 +374,11 @@ Performance tuning
 to set the PCI max read request parameter to 1K. This can be
 done in the following way:
 
-To query the read request size use:
-
-.. code-block:: console
+To query the read request size use::
 
 setpci -s  68.w
 
-If the output is different than 3XXX, set it by:
-
-.. code-block:: console
+If the output is different than 3XXX, set it by::
 
 setpci -s  68.w=3XXX
 
@@ -425,16 +397,12 @@ Usage example
 This section demonstrates how to launch **testpmd** with Mellanox ConnectX-3
 devices managed by librte_pmd_mlx4.
 
-#. Load the kernel modules:
-
-   .. code-block:: console
+#. Load the kernel modules::
 
   modprobe -a ib_uverbs mlx4_en mlx4_core mlx4_ib
 
Alternatively if MLNX_OFED is fully installed, the following script can
-   be run:
-
-   .. code-block:: console
+   be run::
 
   /etc/init.d/openibd restart
 
@@ -444,24 +412,18 @@ devices managed by librte_pmd_mlx4.
   not have to be loaded.
 
 #. Make sure Ethernet interfaces are in working order and linked to kernel
-   verbs. Related sysfs entries should be present:
-
-   .. code-block:: console
+   verbs. Related sysfs entries should be present::
 
   ls -d /sys/class/net/*/device/infiniband_verbs/uverbs* | cut -d / -f 5
 
-   Example output:
-
-   .. code-block:: console
+   Example output::
 
   eth2
   eth3
   eth4
   eth5
 
-#. Optionally, retrieve their PCI bus addresses for whitelisting:
-
-

[dpdk-dev] [PATCH 4/5] doc: add mlx5 design details

2019-08-05 Thread Thomas Monjalon
Some details about libibverbs were missing:
- automatic detection by meson
- main ways to access the device

Signed-off-by: Thomas Monjalon 
---
 doc/guides/nics/mlx5.rst | 20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index dcefc65ec..b9cabfe96 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -20,12 +20,12 @@ There is also a `section dedicated to this poll mode driver
 
 .. note::
 
-   Due to external dependencies, this driver is disabled by default. It must
-   be enabled manually by setting ``CONFIG_RTE_LIBRTE_MLX5_PMD=y`` and
-   recompiling DPDK.
+   Due to external dependencies, this driver is disabled in default 
configuration
+   of the "make" build. It can be enabled with ``CONFIG_RTE_LIBRTE_MLX5_PMD=y``
+   or by using "meson" build system which will detect dependencies.
 
-Implementation details
---
+Design
+--
 
 Besides its dependency on libibverbs (that implies libmlx5 and associated
 kernel support), librte_pmd_mlx5 relies heavily on system calls for control
@@ -44,6 +44,16 @@ This means legacy linux control tools (for example: ethtool, 
ifconfig and
 more) can operate on the same network interfaces that owned by the DPDK
 application.
 
+The PMD can use libibverbs and libmlx5 to access the device firmware
+or directly the hardware components.
+There are different levels of objects and bypassing abilities
+to get the best performances:
+
+- Verbs is a complete high-level generic API
+- Direct Verbs is a device-specific API
+- DevX allows to access firmware objects
+- Direct Rules manages flow steering at low-level hardware layer
+
 Enabling librte_pmd_mlx5 causes DPDK applications to be linked against
 libibverbs.
 
-- 
2.21.0



[dpdk-dev] [PATCH v2 1/1] net/octeontx2: fix optimal default sqe buffer count

2019-08-05 Thread vattunuru
From: Vamsi Attunuru 

Patch extends minimum supported max_sqb_count devarg value
such that it can limit the max sqb count to 8 buffers and
also defines NIX_DEF_SQB and uses it to compute the number
of sqe buffers required for the egress traffic.

NIX_DEF_SQB is defined as 16 which is optimal across multiple
octeontx2 platforms to scale up the performance proportional
to the corresponding port/queue to lcore mappings.

Fixes: fb0198b7dc07 ("net/octeontx2: add devargs parsing functions")

Signed-off-by: Vamsi Attunuru 
---
V2 Changes:
* Minor correction in commit message. 

 drivers/net/octeontx2/otx2_ethdev.c | 2 +-
 drivers/net/octeontx2/otx2_ethdev.h | 3 ++-
 drivers/net/octeontx2/otx2_ethdev_devargs.c | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/octeontx2/otx2_ethdev.c 
b/drivers/net/octeontx2/otx2_ethdev.c
index 3fb7bd9..3615ed2 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -810,7 +810,7 @@ nix_alloc_sqb_pool(int port, struct otx2_eth_txq *txq, 
uint16_t nb_desc)
 
nb_sqb_bufs = nb_desc / sqes_per_sqb;
/* Clamp up to devarg passed SQB count */
-   nb_sqb_bufs =  RTE_MIN(dev->max_sqb_count, RTE_MAX(NIX_MIN_SQB,
+   nb_sqb_bufs =  RTE_MIN(dev->max_sqb_count, RTE_MAX(NIX_DEF_SQB,
  nb_sqb_bufs + NIX_SQB_LIST_SPACE));
 
txq->sqb_pool = rte_mempool_create_empty(name, NIX_MAX_SQB, blk_sz,
diff --git a/drivers/net/octeontx2/otx2_ethdev.h 
b/drivers/net/octeontx2/otx2_ethdev.h
index 720386f..027b909 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -66,7 +66,8 @@
(NIX_MAX_FRS - NIX_L2_OVERHEAD)
 
 #define NIX_MAX_SQB512
-#define NIX_MIN_SQB32
+#define NIX_DEF_SQB16
+#define NIX_MIN_SQB8
 #define NIX_SQB_LIST_SPACE 2
 #define NIX_RSS_RETA_SIZE_MAX  256
 /* Group 0 will be used for RSS, 1 -7 will be used for rte_flow RSS action*/
diff --git a/drivers/net/octeontx2/otx2_ethdev_devargs.c 
b/drivers/net/octeontx2/otx2_ethdev_devargs.c
index 85e7e31..7dc6e92 100644
--- a/drivers/net/octeontx2/otx2_ethdev_devargs.c
+++ b/drivers/net/octeontx2/otx2_ethdev_devargs.c
@@ -160,6 +160,6 @@ RTE_PMD_REGISTER_PARAM_STRING(net_octeontx2,
  OTX2_RSS_RETA_SIZE "=<64|128|256>"
  OTX2_PTYPE_DISABLE "=1"
  OTX2_SCL_ENABLE "=1"
- OTX2_MAX_SQB_COUNT "=<32-512>"
+ OTX2_MAX_SQB_COUNT "=<8-512>"
  OTX2_FLOW_PREALLOC_SIZE "=<1-32>"
  OTX2_FLOW_MAX_PRIORITY "=<1-32>");
-- 
2.8.4



Re: [dpdk-dev] [PATCH v2] doc: add tested Marvell integrated NIC platforms

2019-08-05 Thread Jerin Jacob Kollanukkaran
> -Original Message-
> From: Mcnamara, John 
> Sent: Friday, August 2, 2019 7:16 PM
> To: Jerin Jacob Kollanukkaran ; dev@dpdk.org;
> Kovacevic, Marko 
> Cc: tho...@monjalon.net; Vijaya Bhaskar Annayyolla 
> Subject: RE: [dpdk-dev] [PATCH v2] doc: add tested Marvell integrated NIC
> platforms
> 
> 
> 
> > -Original Message-
> > From: jer...@marvell.com [mailto:jer...@marvell.com]
> > Sent: Wednesday, July 31, 2019 4:46 PM
> > To: dev@dpdk.org; Mcnamara, John ;
> Kovacevic,
> > Marko 
> > Cc: tho...@monjalon.net; avi...@marvell.com; Jerin Jacob
> > 
> > Subject: [dpdk-dev] [PATCH v2] doc: add tested Marvell integrated NIC
> > platforms
> >
> 
> 
> Acked-by: John McNamara 

Applied to dpdk-next-net-mrvl/master. Thanks






Re: [dpdk-dev] [v2 0/5] fix dereference after null check coverity

2019-08-05 Thread Ye Xiaolong
On 08/06, Xiao Zhang wrote:
>This patch tries to fix (dereference after null check) coverity issue.
>The address of first segmented packets for ice, iavf, i40e fm10k and ixgbe
>was not set correctly during reassembling packets which led to this issue.
>
>Coverity issue: 343452
>Coverity issue: 343407
>Fixes: c68a52b8 ("net/ice: support vector SSE in Rx")
>Coverity issue: 343447
>Fixes: 319c421f ("net/avf: enable SSE Rx Tx")
>Coverity issue: 343422 Coverity issue: 343403
>Fixes: ca74903b ("net/i40e: extract non-x86 specific code from vector driver")
>Coverity issue: 343416
>Fixes: fe65e1e1 ("fm10k: add vector scatter Rx")
>Coverity issue: 13245
>Fixes: 8a44c15a ("net/ixgbe: extract non-x86 specific code from vector driver")
>Cc: sta...@dpdk.org
>
>v2 Add cover letter and move the fix after invalidation check
>
>Xiao Zhang (5):
>  net/ixgbe: fix dereference after null check coverity
>  net/ice: fix dereference after null check coverity
>  net/i40e: fix dereference after null check coverity
>  net/iavf: fix dereference after null check coverity
>  net/fm10k: fix dereference after null check coverity
>
> drivers/net/fm10k/fm10k_rxtx_vec.c | 1 +
> drivers/net/i40e/i40e_rxtx_vec_avx2.c  | 1 +
> drivers/net/i40e/i40e_rxtx_vec_sse.c   | 1 +
> drivers/net/iavf/iavf_rxtx_vec_sse.c   | 1 +
> drivers/net/ice/ice_rxtx_vec_avx2.c| 1 +
> drivers/net/ice/ice_rxtx_vec_sse.c | 1 +
> drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 1 +
> 7 files changed, 7 insertions(+)
>
>-- 
>2.7.4
>

For the series:
Acked-by: Xiaolong Ye 


Re: [dpdk-dev] [PATCH] net/octeontx2: drop Rx and L2 error packets

2019-08-05 Thread Jerin Jacob Kollanukkaran
> -Original Message-
> From: Pavan Nikhilesh Bhagavatula 
> Sent: Sunday, August 4, 2019 8:52 AM
> To: Jerin Jacob Kollanukkaran ; Jerin Jacob
> Kollanukkaran ; Nithin Kumar Dabilpuram
> ; Kiran Kumar Kokkilagadda
> 
> Cc: dev@dpdk.org; tho...@monjalon.net; ferruh.yi...@intel.com
> Subject: RE: [dpdk-dev] [PATCH] net/octeontx2: drop Rx and L2 error packets
> 
> >-Original Message-
> >From: dev  On Behalf Of jer...@marvell.com
> >Sent: Tuesday, July 30, 2019 7:57 PM
> >To: Jerin Jacob Kollanukkaran ; Nithin Kumar
> >Dabilpuram ; Kiran Kumar Kokkilagadda
> >
> >Cc: dev@dpdk.org; tho...@monjalon.net; ferruh.yi...@intel.com
> >Subject: [EXT] [dpdk-dev] [PATCH] net/octeontx2: drop Rx and L2 error
> >packets
> >From: Jerin Jacob 
> >
> >From B0 HW revision onwards, HW can drop the Rx and L2 error packets.
> >Enable this by default if the feature is available.
> >Since this bit field is used as reserved in old HW revisions, No need
> >to have additional HW version check.
> >
> >Signed-off-by: Jerin Jacob 
> 
> Acked-by: Pavan Nikhilesh 

Applied to dpdk-next-net-mrvl/master. Thanks

> 
> >---
> > drivers/net/octeontx2/otx2_ethdev.c | 1 +
> > 1 file changed, 1 insertion(+)
> >



Re: [dpdk-dev] [PATCH v5 1/4] examples/multi_process/client_server_mp: check port validity

2019-08-05 Thread Stephen Hemminger
On Sun, 4 Aug 2019 08:31:54 +
Matan Azrad  wrote:

> > > > /* convert parameter to a number and verify */
> > > > pm = strtoul(portmask, &end, 16);
> > > > -   if (end == NULL || *end != '\0' || pm == 0)
> > > > +   if (end == NULL || *end != '\0' || pm > UINT16_MAX || pm == 0)  
> > >
> > > Why pm > UINT16_MAX ? should be something like > (1 <<  
> > RTE_MAX_ETHPORTS) - 1.  
> > > And need to be sure pm type can hold RTE_MAX_ETHPORTS bits,  
> > otherwise port 0 may unlikely be all the time visible in the loop below.  
> > >  
> > 
> > The DPDK assumes a lot of places that unsigned long will hold a port mask.  
> 
> So, all are bugs, no?

I don't think 32 bit build is that well tested. But yes a mask
needs to hold 64 ports.


> > If some extra bits are set, the error is visible later when the bits are 
> > leftover
> > after finding ports.  
> 
> Yes, but if there is a valid port which its port id is bigger than the 
> portmask bits number - port 0 will be all the time visible in the check -> 
> bug.
> 
> > The original code had worse problems, it would not catch invalid pm values 
> > at
> > all and truncate silently.  
> 
> Yes, maybe, but I really don't understand why you chose to limit for 16 
> ports, where this number come from?
> So, my approach here, 2 options:

The problem  here was my mistake for not having wide enough portmask.



Re: [dpdk-dev] [PATCH] common/octeontx2: update ready message response

2019-08-05 Thread Jerin Jacob Kollanukkaran


> -Original Message-
> From: jer...@marvell.com 
> Sent: Sunday, August 4, 2019 12:12 AM
> To: dev@dpdk.org; Jerin Jacob Kollanukkaran ; Nithin
> Kumar Dabilpuram ; Vamsi Krishna Attunuru
> 
> Cc: tho...@monjalon.net
> Subject: [dpdk-dev] [PATCH] common/octeontx2: update ready message
> response
> 
> From: Jerin Jacob 
> 
> The kernel mbox server driver(AF) updated the ready message response.
> Sync with AF driver.
> 
> Signed-off-by: Jerin Jacob 


Applied to dpdk-next-net-mrvl/master. Thanks



Re: [dpdk-dev] [PATCH v2 1/1] net/octeontx2: fix optimal default sqe buffer count

2019-08-05 Thread Jerin Jacob Kollanukkaran



> -Original Message-
> From: vattun...@marvell.com 
> Sent: Monday, August 5, 2019 9:08 PM
> To: dev@dpdk.org
> Cc: tho...@monjalon.net; Jerin Jacob Kollanukkaran ;
> Vamsi Krishna Attunuru 
> Subject: [dpdk-dev] [PATCH v2 1/1] net/octeontx2: fix optimal default sqe
> buffer count
> 
> From: Vamsi Attunuru 
> 
> Patch extends minimum supported max_sqb_count devarg value such that it
> can limit the max sqb count to 8 buffers and also defines NIX_DEF_SQB and
> uses it to compute the number of sqe buffers required for the egress traffic.
> 
> NIX_DEF_SQB is defined as 16 which is optimal across multiple
> octeontx2 platforms to scale up the performance proportional to the
> corresponding port/queue to lcore mappings.
> 
> Fixes: fb0198b7dc07 ("net/octeontx2: add devargs parsing functions")
> 
> Signed-off-by: Vamsi Attunuru 


Acked-by: Jerin Jacob 
Applied to dpdk-next-net-mrvl/master. Thanks

> ---
> V2 Changes:
> * Minor correction in commit message.
> 
>  drivers/net/octeontx2/otx2_ethdev.c | 2 +-
>  drivers/net/octeontx2/otx2_ethdev.h | 3 ++-
>  drivers/net/octeontx2/otx2_ethdev_devargs.c | 2 +-
>  3 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/octeontx2/otx2_ethdev.c
> b/drivers/net/octeontx2/otx2_ethdev.c
> index 3fb7bd9..3615ed2 100644
> --- a/drivers/net/octeontx2/otx2_ethdev.c
> +++ b/drivers/net/octeontx2/otx2_ethdev.c
> @@ -810,7 +810,7 @@ nix_alloc_sqb_pool(int port, struct otx2_eth_txq
> *txq, uint16_t nb_desc)
> 
>   nb_sqb_bufs = nb_desc / sqes_per_sqb;
>   /* Clamp up to devarg passed SQB count */
> - nb_sqb_bufs =  RTE_MIN(dev->max_sqb_count,
> RTE_MAX(NIX_MIN_SQB,
> + nb_sqb_bufs =  RTE_MIN(dev->max_sqb_count,
> RTE_MAX(NIX_DEF_SQB,
> nb_sqb_bufs + NIX_SQB_LIST_SPACE));
> 
>   txq->sqb_pool = rte_mempool_create_empty(name,
> NIX_MAX_SQB, blk_sz, diff --git a/drivers/net/octeontx2/otx2_ethdev.h
> b/drivers/net/octeontx2/otx2_ethdev.h
> index 720386f..027b909 100644
> --- a/drivers/net/octeontx2/otx2_ethdev.h
> +++ b/drivers/net/octeontx2/otx2_ethdev.h
> @@ -66,7 +66,8 @@
>   (NIX_MAX_FRS - NIX_L2_OVERHEAD)
> 
>  #define NIX_MAX_SQB  512
> -#define NIX_MIN_SQB  32
> +#define NIX_DEF_SQB  16
> +#define NIX_MIN_SQB  8
>  #define NIX_SQB_LIST_SPACE   2
>  #define NIX_RSS_RETA_SIZE_MAX256
>  /* Group 0 will be used for RSS, 1 -7 will be used for rte_flow RSS action*/
> diff --git a/drivers/net/octeontx2/otx2_ethdev_devargs.c
> b/drivers/net/octeontx2/otx2_ethdev_devargs.c
> index 85e7e31..7dc6e92 100644
> --- a/drivers/net/octeontx2/otx2_ethdev_devargs.c
> +++ b/drivers/net/octeontx2/otx2_ethdev_devargs.c
> @@ -160,6 +160,6 @@
> RTE_PMD_REGISTER_PARAM_STRING(net_octeontx2,
> OTX2_RSS_RETA_SIZE "=<64|128|256>"
> OTX2_PTYPE_DISABLE "=1"
> OTX2_SCL_ENABLE "=1"
> -   OTX2_MAX_SQB_COUNT "=<32-512>"
> +   OTX2_MAX_SQB_COUNT "=<8-512>"
> OTX2_FLOW_PREALLOC_SIZE "=<1-32>"
> OTX2_FLOW_MAX_PRIORITY "=<1-32>");
> --
> 2.8.4



Re: [dpdk-dev] [PATCH] net/octeontx2: add 96xx A1 silicon revision support

2019-08-05 Thread Jerin Jacob Kollanukkaran
> -Original Message-
> From: Nithin Dabilpuram 
> Sent: Monday, August 5, 2019 11:11 AM
> To: Jerin Jacob Kollanukkaran ; Nithin Kumar
> Dabilpuram ; Vamsi Krishna Attunuru
> ; Kiran Kumar Kokkilagadda
> 
> Cc: dev@dpdk.org
> Subject: [PATCH] net/octeontx2: add 96xx A1 silicon revision support
> 
> Update workaround changes for erratas that are fixed on 96xx A1.
> This patch also enables cq drop for all the passes for maintaining
> performance along with updating a default Rx ring size in dev_info.
> 
> Signed-off-by: Nithin Dabilpuram 

Applied to dpdk-next-net-mrvl/master. Thanks


[dpdk-dev] [PATCH v7 1/2] examples/multi_process/client_server_mp: check port validity

2019-08-05 Thread Stephen Hemminger
From: Stephen Hemminger 

The mp_server incorrectly allows a port mask that included hidden
ports and which later caused either lost packets or failed initialization.

This fixes explicitly checking that each bit in portmask is a
valid port before using it.

Fixes: 5b7ba31148a8 ("ethdev: add port ownership")
Signed-off-by: Stephen Hemminger 
---
 .../client_server_mp/mp_server/args.c | 40 ++-
 .../client_server_mp/mp_server/args.h |  2 +-
 .../client_server_mp/mp_server/init.c |  7 +---
 3 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/examples/multi_process/client_server_mp/mp_server/args.c 
b/examples/multi_process/client_server_mp/mp_server/args.c
index b0d8d7665c85..3c2ca266b096 100644
--- a/examples/multi_process/client_server_mp/mp_server/args.c
+++ b/examples/multi_process/client_server_mp/mp_server/args.c
@@ -10,6 +10,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include "common.h"
@@ -41,31 +42,34 @@ usage(void)
  * array variable
  */
 static int
-parse_portmask(uint8_t max_ports, const char *portmask)
+parse_portmask(const char *portmask)
 {
char *end = NULL;
-   unsigned long pm;
-   uint16_t count = 0;
+   unsigned long long pm;
+   uint16_t id;
 
if (portmask == NULL || *portmask == '\0')
return -1;
 
/* convert parameter to a number and verify */
-   pm = strtoul(portmask, &end, 16);
-   if (end == NULL || *end != '\0' || pm == 0)
+   errno = 0;
+   pm = strtoull(portmask, &end, 16);
+   if (errno != 0 || end == NULL || *end != '\0')
return -1;
 
-   /* loop through bits of the mask and mark ports */
-   while (pm != 0){
-   if (pm & 0x01){ /* bit is set in mask, use port */
-   if (count >= max_ports)
-   printf("WARNING: requested port %u not present"
-   " - ignoring\n", (unsigned)count);
-   else
-   ports->id[ports->num_ports++] = count;
-   }
-   pm = (pm >> 1);
-   count++;
+   RTE_ETH_FOREACH_DEV(id) {
+   unsigned long msk = 1u << id;
+
+   if ((pm & msk) == 0)
+   continue;
+
+   pm &= ~msk;
+   ports->id[ports->num_ports++] = id;
+   }
+
+   if (pm != 0) {
+   printf("WARNING: leftover ports in mask %#llx - ignoring\n",
+  pm);
}
 
return 0;
@@ -99,7 +103,7 @@ parse_num_clients(const char *clients)
  * on error.
  */
 int
-parse_app_args(uint16_t max_ports, int argc, char *argv[])
+parse_app_args(int argc, char *argv[])
 {
int option_index, opt;
char **argvopt = argv;
@@ -112,7 +116,7 @@ parse_app_args(uint16_t max_ports, int argc, char *argv[])
&option_index)) != EOF){
switch (opt){
case 'p':
-   if (parse_portmask(max_ports, optarg) != 0){
+   if (parse_portmask(optarg) != 0) {
usage();
return -1;
}
diff --git a/examples/multi_process/client_server_mp/mp_server/args.h 
b/examples/multi_process/client_server_mp/mp_server/args.h
index 79c190a33a37..52c8cc86e6f0 100644
--- a/examples/multi_process/client_server_mp/mp_server/args.h
+++ b/examples/multi_process/client_server_mp/mp_server/args.h
@@ -5,6 +5,6 @@
 #ifndef _ARGS_H_
 #define _ARGS_H_
 
-int parse_app_args(uint16_t max_ports, int argc, char *argv[]);
+int parse_app_args(int argc, char *argv[]);
 
 #endif /* ifndef _ARGS_H_ */
diff --git a/examples/multi_process/client_server_mp/mp_server/init.c 
b/examples/multi_process/client_server_mp/mp_server/init.c
index 3af5dc6994bf..1b0569937b51 100644
--- a/examples/multi_process/client_server_mp/mp_server/init.c
+++ b/examples/multi_process/client_server_mp/mp_server/init.c
@@ -238,7 +238,7 @@ init(int argc, char *argv[])
 {
int retval;
const struct rte_memzone *mz;
-   uint16_t i, total_ports;
+   uint16_t i;
 
/* init EAL, parsing EAL args */
retval = rte_eal_init(argc, argv);
@@ -247,9 +247,6 @@ init(int argc, char *argv[])
argc -= retval;
argv += retval;
 
-   /* get total number of ports */
-   total_ports = rte_eth_dev_count_total();
-
/* set up array for port data */
mz = rte_memzone_reserve(MZ_PORT_INFO, sizeof(*ports),
rte_socket_id(), NO_FLAGS);
@@ -259,7 +256,7 @@ init(int argc, char *argv[])
ports = mz->addr;
 
/* parse additional, application arguments */
-   retval = parse_app_args(total_ports, argc, argv);
+   retval = parse_app_args(argc, argv);
if (retval != 0)
return -1;
 
-- 
2.20.1



[dpdk-dev] [PATCH v7 2/2] examples/multi_process/client_server_mp - fix crash in mp_client with sparse ports

2019-08-05 Thread Stephen Hemminger
From: Stephen Hemminger 

The mp_client crashes if run on Azure or any system where ethdev
ports are owned. In that case, the tx_buffer and tx_stats for the
real port were initialized correctly, but the wrong port was used.

For example if the server has Ports 3 and 5. Then calling
rte_eth_tx_buffer_flush on any other buffer will dereference null
because the tx buffer for that port was not allocated.

Also:
   - the flush code is common enough that it should not be marked
 unlikely
   - combine conditions to reduce indentation
   - avoid unnecessary if() if sent is zero.

Fixes: e2366e74e029 ("examples: use buffered Tx")
Signed-off-by: Stephen Hemminger 
---
 .../client_server_mp/mp_client/client.c| 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/examples/multi_process/client_server_mp/mp_client/client.c 
b/examples/multi_process/client_server_mp/mp_client/client.c
index c23dd3f378f7..361d90b54b2d 100644
--- a/examples/multi_process/client_server_mp/mp_client/client.c
+++ b/examples/multi_process/client_server_mp/mp_client/client.c
@@ -246,19 +246,19 @@ main(int argc, char *argv[])
 
for (;;) {
uint16_t i, rx_pkts;
-   uint16_t port;
 
rx_pkts = rte_ring_dequeue_burst(rx_ring, pkts,
PKT_READ_SIZE, NULL);
 
-   if (unlikely(rx_pkts == 0)){
-   if (need_flush)
-   for (port = 0; port < ports->num_ports; port++) 
{
-   sent = 
rte_eth_tx_buffer_flush(ports->id[port], client_id,
-   tx_buffer[port]);
-   if (unlikely(sent))
-   tx_stats->tx[port] += sent;
-   }
+   if (rx_pkts == 0 && need_flush) {
+   for (i = 0; i < ports->num_ports; i++) {
+   uint16_t port = ports->id[i];
+
+   sent = rte_eth_tx_buffer_flush(port,
+  client_id,
+  tx_buffer[port]);
+   tx_stats->tx[port] += sent;
+   }
need_flush = 0;
continue;
}
-- 
2.20.1



[dpdk-dev] [PATCH v7 0/2] examples/client_server_mp: port id (fixes only)

2019-08-05 Thread Stephen Hemminger
v7 - widen port mask to allow 64 ports

v6 - just include fixes; cleanups can wait until 19.11

v5 - change logic in server_mp for evaluating port mask

v4 - fix checkpatch warning
 add patches to fix style issues and use ether format addr

v3 - merge both patches in one series
 use alternative algorithm to check port ownership (N^2)
 because reviewer didn't like direct check.

Stephen Hemminger (2):
  examples/multi_process/client_server_mp: check port validity
  examples/multi_process/client_server_mp - fix crash in mp_client with
sparse ports

 .../client_server_mp/mp_client/client.c   | 18 -
 .../client_server_mp/mp_server/args.c | 40 ++-
 .../client_server_mp/mp_server/args.h |  2 +-
 .../client_server_mp/mp_server/init.c |  7 +---
 4 files changed, 34 insertions(+), 33 deletions(-)

-- 
2.20.1



Re: [dpdk-dev] [PATCH] drivers/octeontx2: fix coverity issues

2019-08-05 Thread Jerin Jacob Kollanukkaran



> -Original Message-
> From: dev  On Behalf Of Jerin Jacob Kollanukkaran
> Sent: Monday, August 5, 2019 9:35 AM
> To: Harman Kalra ; Nithin Kumar Dabilpuram
> ; Vamsi Krishna Attunuru
> ; Kiran Kumar Kokkilagadda
> 
> Cc: dev@dpdk.org; tho...@monjalon.net
> Subject: Re: [dpdk-dev] [PATCH] drivers/octeontx2: fix coverity issues
> 
> 
> 
> > -Original Message-
> > From: Harman Kalra 
> > Sent: Sunday, August 4, 2019 12:51 PM
> > To: Jerin Jacob Kollanukkaran ; Nithin Kumar
> > Dabilpuram ; Vamsi Krishna Attunuru
> > ; Kiran Kumar Kokkilagadda
> > 
> > Cc: dev@dpdk.org; Harman Kalra 
> > Subject: [PATCH] drivers/octeontx2: fix coverity issues
> >
> > Addresed issues reported by coverity: NULL pointer dereferencing
> > issues, unchecked return value, uinitialized scalar value, probable
> > deadcode cases, unintended sign extension, bad bit shift operation,
> > Wrong sizeof argument
> > (SIZEOF_MISMATCH)
> >
> > Coverity issue: 343396, 345028, 344977, 345015, 345025, 344969,
> > Coverity
> > issue: 345014, 344966, 343437, 344993, 345007, 344988, Coverity issue:
> > 343405, 344999, 345003
> >
> > Fixes: 58f6f93c34c1 ("net/octeontx2: add module EEPROM dump")
> > Fixes: 38f566280abb ("net/octeontx2: add link stats operations")
> > Fixes: b5dc3140448e ("net/octeontx2: support base PTP")
> > Fixes: ba1b3b081edf ("net/octeontx2: support VLAN offloads")
> > Fixes: 092b38341859 ("net/octeontx2: add flow init and fini")
> > Fixes: 3da1b85b6d06 ("common/octeontx2: add FLR IRQ handler")
> > Fixes: 2548ab774f92 ("mempool/octeontx2: add context dump support")
> > Fixes: 2b71657c8660 ("common/octeontx2: add mbox request and
> response
> > definition")
> >
> > Signed-off-by: Harman Kalra 
> 
> Acked-by: Jerin Jacob 

Applied to dpdk-next-net-mrvl/master. Thanks


Re: [dpdk-dev] [PATCH] net/thunderx: fix nicvf cleanup on detaching PCI dev

2019-08-05 Thread Jerin Jacob Kollanukkaran
> -Original Message-
> From: agup...@marvell.com 
> Sent: Monday, August 5, 2019 1:31 PM
> To: Jerin Jacob Kollanukkaran ; Maciej Czekaj
> ; Anatoly Burakov 
> Cc: dev@dpdk.org; sta...@dpdk.org; Amit Gupta 
> Subject: [PATCH] net/thunderx: fix nicvf cleanup on detaching PCI dev
> 
> From: Amit Gupta 
> 
> There was a bug while doing PCI detach because of that app gets seg fault as
> eth_dev is released without stopping/cleaning up mapped nicvf.
> 
> Fixed this bug by adding nicvf cleanup stupport on PCI detach.
> 
> Fixes: fdf91e0f2fac ("drivers/net: do not use ethdev driver")
> Signed-off-by: Amit Gupta 

Cc: sta...@dpdk.org

Acked-by: Jerin Jacob 

Fixed check-git-log.sh issues and applied to dpdk-next-net-mrvl/master. Thanks

> ---
>  drivers/net/thunderx/nicvf_ethdev.c | 12 +++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/thunderx/nicvf_ethdev.c
> b/drivers/net/thunderx/nicvf_ethdev.c
> index ec57692..56769ef 100644
> --- a/drivers/net/thunderx/nicvf_ethdev.c
> +++ b/drivers/net/thunderx/nicvf_ethdev.c
> @@ -2083,6 +2083,16 @@ static void nicvf_vf_stop(struct rte_eth_dev *dev,
> struct nicvf *nic,
>   return ret;
>  }
>  static int
> +nicvf_eth_dev_uninit(struct rte_eth_dev *dev) {
> + PMD_INIT_FUNC_TRACE();
> +
> + if (rte_eal_process_type() == RTE_PROC_PRIMARY)
> + nicvf_dev_close(dev);
> +
> + return 0;
> +}
> +static int
>  nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)  {
>   int ret;
> @@ -2256,7 +2266,7 @@ static int nicvf_eth_pci_probe(struct rte_pci_driver
> *pci_drv __rte_unused,
> 
>  static int nicvf_eth_pci_remove(struct rte_pci_device *pci_dev)  {
> - return rte_eth_dev_pci_generic_remove(pci_dev, NULL);
> + return rte_eth_dev_pci_generic_remove(pci_dev,
> nicvf_eth_dev_uninit);
>  }
> 
>  static struct rte_pci_driver rte_nicvf_pmd = {
> --
> 1.8.3.1



Re: [dpdk-dev] [PATCH BUG 335 3/3] net/virtio: fix compilation error with 0 headroom

2019-08-05 Thread Thomas Monjalon
05/08/2019 15:07, Maxime Coquelin:
> On 8/1/19 10:09 AM, Hemant Agrawal wrote:
> >> On 7/26/19 2:25 PM, Olivier Matz wrote:
> >>> On Thu, Jul 25, 2019 at 04:36:45PM +0530, Hemant Agrawal wrote:
>  When using RTE_PKTMBUF_HEADROOM as 0, virito ethdev driver throws
>  compilation error
>  virtio_ethdev.c:1851:2: note: in expansion of macro ‘RTE_BUILD_BUG_ON’
>  RTE_BUILD_BUG_ON(RTE_PKTMBUF_HEADROOM
>   < sizeof(struct virtio_net_hdr_mrg_rxbuf));
> 
>  This patch change it into run-time check.
[...]
> 
>  Fixes: 198ab33677c9 ("net/virtio: move device initialization in a
>  function")
> >>>
> >>> I think the proper commit is:
> >>> Fixes: dec08c28c0b3 ("virtio: check packet headroom at compile time")
> >>
> >> Indeed.
> >>
> >>> It looks this patch more or less reverts this old commit.
> >>> +CC Stephen
> >>
> >> I wonder whether we could have a warning at build time so that the one who
> >> builds DPDK is aware some driver may not be usable, in addition to the
> >> below patch that fails virtio-net init.
> > 
> > [Hemant] I will also prefer compile time check instead of run-time check 
> > for any non-default configs.
> > If someone is modifying the config, he can very well disable the drivers, 
> > which don't like those settings. 
> > 
> > However, earlier discussion w.r.t this bug moved in other direction to make 
> > DPDK compliable for all cases and allow regress testing.
> 
> Ok, I don't have a strong opinion on this, so feel free to apply this
> patch as is. We can add a build-ime warning later if we find it useful.
> 
> Acked-by: Maxime Coquelin 

Series applied, thanks.

I think the right fix should be a check in meson.





  1   2   >