Re: [dpdk-dev] [PATCH] net/sfc: cut non VLAN ID bits from TCI
On 05.07.2018 22:23, Adrien Mazarguil wrote: On Thu, Jul 05, 2018 at 01:14:49PM +0200, Adrien Mazarguil wrote: On Fri, Jun 29, 2018 at 04:23:31PM +0100, Andrew Rybchenko wrote: TCI may contain PCP or DEI bits. Matching of these bits is not supported, but the bits still may be set in specification value and not covered by mask. So, these bits should be ignored. Fixes: 894080975e1e ("net/sfc: support VLAN in flow API filters") Cc: sta...@dpdk.org Signed-off-by: Andrew Rybchenko Reviewed-by: Roman Zhukov --- drivers/net/sfc/sfc_flow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c index 5613d59a9..18387415e 100644 --- a/drivers/net/sfc/sfc_flow.c +++ b/drivers/net/sfc/sfc_flow.c @@ -371,7 +371,8 @@ sfc_flow_parse_vlan(const struct rte_flow_item *item, * the outer tag and the next matches the inner tag. */ if (mask->tci == supp_mask.tci) { - vid = rte_bswap16(spec->tci); + /* Apply mask to keep VID only */ + vid = rte_bswap16(spec->tci & mask->tci); if (!(efx_spec->efs_match_flags & EFX_FILTER_MATCH_OUTER_VID)) { I think there is an issue with this patch when spec->mask is user-provided, PMDs have to trust it. They must not simply ignore bits they cannot handle but explicitly reject the flow rule for correctness. Most devices cannot match PCP and DEI, this is why the default TCI mask was modified in v18.05 by commit 0730ab674cb1 ("ethdev: fix default VLAN TCI mask in flow API") to cover the VID part only. I wrote a helper for mlx5 to help with such basic sanity checks on pattern items in a generic(ish) fashion, maybe you could reuse something. Have a look at mlx5_nl_flow_item_mask() [1]. [1] "net/mlx5: add L2-L4 pattern items to switch flow rules" https://mails.dpdk.org/archives/dev/2018-June/105579.html Seems like I misread the original patch and PMD code, both are in fact correct. Please ignore my previous comment, sorry for the noise! No problem. Many thanks for reviewing it. Andrew.
Re: [dpdk-dev] [PATCH v3 2/6] ethdev: add function for checking IOVAs by a device
On 04.07.2018 15:53, Alejandro Lucero wrote: A PMD should invoke this function for checking memsegs iovas are within the supported range by the device. Signed-off-by: Alejandro Lucero --- lib/librte_ether/rte_ethdev.h | 13 + lib/librte_ether/rte_ethdev_version.map | 1 + 2 files changed, 14 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index eba11ca..e51a432 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -2799,6 +2799,19 @@ int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on); /** + * check device dma mask within expected range based on dma mask. + * + * @param maskbits + * mask length in bits + * + */ +static inline int +rte_eth_dev_check_dma_mask(uint8_t maskbits) +{ + return rte_eal_check_dma_mask(maskbits); I'm afraid I don't understand why do we need the wrapper. May PMD use EAL function directly? +} + +/** * * Retrieve a burst of input packets from a receive queue of an Ethernet * device. The retrieved packets are stored in *rte_mbuf* structures whose diff --git a/lib/librte_ether/rte_ethdev_version.map b/lib/librte_ether/rte_ethdev_version.map index e9681ac..0b11b8a 100644 --- a/lib/librte_ether/rte_ethdev_version.map +++ b/lib/librte_ether/rte_ethdev_version.map @@ -191,6 +191,7 @@ DPDK_17.08 { DPDK_17.11 { global: + rte_eth_dev_check_dma_mask; rte_eth_dev_get_sec_ctx; rte_eth_dev_pool_ops_supported; rte_eth_dev_reset;
Re: [dpdk-dev] [PATCH] ethdev: document xstats API assumption
On 28.06.2018 17:16, Ferruh Yigit wrote: Documents the assumption that 'xstats[i].id == i' and key=xstats_names[i].name, value=xstats[i].value xstats[i].id is still used for xstats _by_id() APIs. This patch reverts some part of the commit 6d52d1d4afb4 ("ethdev: clarify extended statistics documentation") Signed-off-by: Ferruh Yigit Acked-by: Andrew Rybchenko
Re: [dpdk-dev] Compilation of MLX5 driver
Hi Shahaf, Thanks for the useful information! -Original Message- From: Shahaf Shuler [mailto:shah...@mellanox.com] Sent: Tuesday, July 3, 2018 02:16 PM To: Asaf Sinai Cc: dev@dpdk.org; Nitin Katiyar ; Nélio Laranjeiro Subject: RE: [dpdk-dev] Compilation of MLX5 driver Tuesday, July 3, 2018 10:01 AM, Asaf Sinai: > Subject: Re: [dpdk-dev] Compilation of MLX5 driver > > Additional questions: > Is it possible to use MLNX_OFED-4.3 on Ubuntu 12.04? I am not sure if there is such build, the oldest OFED build I see is for ubuntu14.10. ubuntu12.04 is really old. > Why is the driver related to OS version? Because once you install MLNX_OFED it needs to backport patches, so the base version is important. > > -Original Message- > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Asaf Sinai > Sent: Monday, July 2, 2018 05:22 PM > To: Shahaf Shuler > Cc: dev@dpdk.org; Nitin Katiyar ; Nélio > Laranjeiro > Subject: Re: [dpdk-dev] Compilation of MLX5 driver > > Hi Shahaf, > > 1. Can you please explain what is the meaning of upstream-libs? Upstream-libs means the DPDK works w/ rdma-core library instead of legacy verbs which exists only on Mellanox OFED. > 2. We use Ubuntu 12.04. so if we would like to stay with it, and use > MLNX_OFED-4.0, which latest DPDK version should be used? That will be v17.05 > > Thanks, > Asaf > > -Original Message- > From: Shahaf Shuler [mailto:shah...@mellanox.com] > Sent: Monday, July 2, 2018 05:11 PM > To: Asaf Sinai > Cc: dev@dpdk.org; Nitin Katiyar ; Nélio > Laranjeiro > Subject: RE: [dpdk-dev] Compilation of MLX5 driver > > Hi Asaf, > > Monday, July 2, 2018 3:46 PM, Asaf Sinai: > > Subject: RE: [dpdk-dev] Compilation of MLX5 driver > > > > Additional details: > > > > Ubuntu: 12.04.3 > > Linux: 3.2.0-53-virtual > > GCC: 4.7.2 (Ubuntu/Linaro 4.7.2-11precise2) > > > > I tried to build DPDK 18.05 after installing the Mellanox OFED > > driver > > DPDK version 18.05 supports only upstream-libs (rdma-core). > > > (MLNX_OFED_LINUX-4.0-2.0.0.1-ubuntu12.04-x86_64), but it failed with > > the mentioned error. > > So I removed the OFED driver and installed the EN driver > > (mlnx-en-4.0- 2.0.0.1-ubuntu12.04-x86_64), but it also failed with the same > > error. > > Both drivers were compiled with "--dpdk" argument ("--upstream-libs" > > is not supported). > > Yes MLNX_OFED-4.0 is too old for upstream libs. You should use > MLNX_OFED-4.2 and above. > Or alternatively use an older DPDK version (not recommended). > > > > > -Original Message- > > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Asaf Sinai > > Sent: Monday, July 2, 2018 03:20 PM > > To: Shahaf Shuler > > Cc: dev@dpdk.org; Nitin Katiyar ; Nélio > > Laranjeiro > > Subject: Re: [dpdk-dev] Compilation of MLX5 driver > > > > Hi Shahaf, > > > > I face similar problem with DPDK 18.05, where missing file is "mlx5dv.h": > > > > == Build drivers/net/mlx5 > > CC mlx5.o > > In file included from > > /net/emcradware/CM_Users/asafsi/work/drivers/dpdk/dpdk- > > 18.05/drivers/net/mlx5/mlx5.h:35:0, > > from > > /net/emcradware/CM_Users/asafsi/work/drivers/dpdk/dpdk- > > 18.05/drivers/net/mlx5/mlx5.c:40: > > /net/emcradware/CM_Users/asafsi/work/drivers/dpdk/dpdk- > > 18.05/drivers/net/mlx5/mlx5_mr.h:19:31: fatal error: infiniband/mlx5dv.h: > > No such file or directory > > #include > >^ > > compilation terminated. > > > > Can you please advise? > > > > Thanks, > > Asaf > > > > -Original Message- > > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Nitin Katiyar > > Sent: Thursday, May 31, 2018 02:44 PM > > To: Nélio Laranjeiro > > Cc: Shahaf Shuler ; dev@dpdk.org > > Subject: Re: [dpdk-dev] Compilation of MLX5 driver > > > > Thanks Shahaf, it worked after removing the options you specified. > > > > Regards, > > Nitin > > > > -Original Message- > > From: Nélio Laranjeiro [mailto:nelio.laranje...@6wind.com] > > Sent: Thursday, May 31, 2018 3:23 PM > > To: Nitin Katiyar > > Cc: Shahaf Shuler ; dev@dpdk.org > > Subject: Re: [dpdk-dev] Compilation of MLX5 driver > > > > On Thu, May 31, 2018 at 09:14:03AM +, Nitin Katiyar wrote: > > > Yes,I installed it using --dpdk --upstream-libs. What is the way > > > forward now? > > > > In v17.05 MLX5 PMD is still relying on libibverbs and libmlx5, the > > way Those options you used are necessary to select in their package > > the installation of > > libverbs,libmlx5 or rdma-core. > > Doing this you have selected rdma-core which is not supported in > > v17.05 DPDK version. > > > > You need to install Mellanox OFED without those two options to > > select libibverbs, libmlx5 to make it work. > > > > Regards, > > > > > Regards, > > > Nitin > > > > > > -Original Message- > > > From: Nélio Laranjeiro [mailto:nelio.laranje...@6wind.com] > > > Sent: Thursday, May 31, 2018 1:36 PM > > > To: Nitin Katiyar > > > Cc: Shahaf Shuler ;
[dpdk-dev] [PATCH] net/bnx2x: move SPDX tags to source files
We were using LICENSE.bnx2x_pmd to reference inclusion of SPDX licensing tag from all the source file. Remove the LICENSE.bnx2x_pmd file and directly include SPDX tags in source files. Signed-off-by: Rasesh Mody --- drivers/net/bnx2x/LICENSE.bnx2x_pmd |3 --- drivers/net/bnx2x/Makefile |2 +- drivers/net/bnx2x/bnx2x.c |2 +- drivers/net/bnx2x/bnx2x.h |2 +- drivers/net/bnx2x/bnx2x_ethdev.c|2 +- drivers/net/bnx2x/bnx2x_ethdev.h|2 +- drivers/net/bnx2x/bnx2x_logs.h |2 +- drivers/net/bnx2x/bnx2x_rxtx.c |2 +- drivers/net/bnx2x/bnx2x_rxtx.h |2 +- drivers/net/bnx2x/bnx2x_stats.c |2 +- drivers/net/bnx2x/bnx2x_stats.h |2 +- drivers/net/bnx2x/bnx2x_vfpf.c |2 +- drivers/net/bnx2x/bnx2x_vfpf.h |2 +- drivers/net/bnx2x/ecore_fw_defs.h |2 +- drivers/net/bnx2x/ecore_hsi.h |2 +- drivers/net/bnx2x/ecore_init.h |2 +- drivers/net/bnx2x/ecore_init_ops.h |2 +- drivers/net/bnx2x/ecore_mfw_req.h |2 +- drivers/net/bnx2x/ecore_reg.h |2 +- drivers/net/bnx2x/ecore_sp.c|2 +- drivers/net/bnx2x/ecore_sp.h|2 +- drivers/net/bnx2x/elink.c |2 +- drivers/net/bnx2x/elink.h |2 +- 23 files changed, 22 insertions(+), 25 deletions(-) delete mode 100644 drivers/net/bnx2x/LICENSE.bnx2x_pmd diff --git a/drivers/net/bnx2x/LICENSE.bnx2x_pmd b/drivers/net/bnx2x/LICENSE.bnx2x_pmd deleted file mode 100644 index 64c6ef2..000 --- a/drivers/net/bnx2x/LICENSE.bnx2x_pmd +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright (c) 2014-2018 Cavium Inc. - */ diff --git a/drivers/net/bnx2x/Makefile b/drivers/net/bnx2x/Makefile index 150b4cf..f5221f8 100644 --- a/drivers/net/bnx2x/Makefile +++ b/drivers/net/bnx2x/Makefile @@ -2,7 +2,7 @@ #All rights reserved. #www.cavium.com # -#See LICENSE.bnx2x_pmd for copyright and licensing details. +#SPDX-License-Identifier: BSD-3-Clause include $(RTE_SDK)/mk/rte.vars.mk # diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 84ade5f..24663f8 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -10,7 +10,7 @@ * All rights reserved. * www.cavium.com * - * See LICENSE.bnx2x_pmd for copyright and licensing details. + * SPDX-License-Identifier: BSD-3-Clause */ #define BNX2X_DRIVER_VERSION "1.78.18" diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index 4150fd8..adc69a2 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h @@ -10,7 +10,7 @@ * All rights reserved. * www.cavium.com * - * See LICENSE.bnx2x_pmd for copyright and licensing details. + * SPDX-License-Identifier: BSD-3-Clause */ #ifndef __BNX2X_H__ diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index 6a9cd58..7636e73 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -5,7 +5,7 @@ * All rights reserved. * www.cavium.com * - * See LICENSE.bnx2x_pmd for copyright and licensing details. + * SPDX-License-Identifier: BSD-3-Clause */ #include "bnx2x.h" diff --git a/drivers/net/bnx2x/bnx2x_ethdev.h b/drivers/net/bnx2x/bnx2x_ethdev.h index f05be7e..233d55d 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.h +++ b/drivers/net/bnx2x/bnx2x_ethdev.h @@ -5,7 +5,7 @@ * All rights reserved. * www.cavium.com * - * See LICENSE.bnx2x_pmd for copyright and licensing details. + * SPDX-License-Identifier: BSD-3-Clause */ #ifndef PMD_BNX2X_ETHDEV_H diff --git a/drivers/net/bnx2x/bnx2x_logs.h b/drivers/net/bnx2x/bnx2x_logs.h index 69a2fe1..67ee348 100644 --- a/drivers/net/bnx2x/bnx2x_logs.h +++ b/drivers/net/bnx2x/bnx2x_logs.h @@ -5,7 +5,7 @@ * All rights reserved. * www.cavium.com * - * See LICENSE.bnx2x_pmd for copyright and licensing details. + * SPDX-License-Identifier: BSD-3-Clause */ #ifndef _PMD_LOGS_H_ diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c index 331884c..727a72a 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.c +++ b/drivers/net/bnx2x/bnx2x_rxtx.c @@ -5,7 +5,7 @@ * All rights reserved. * www.cavium.com * - * See LICENSE.bnx2x_pmd for copyright and licensing details. + * SPDX-License-Identifier: BSD-3-Clause */ #include "bnx2x.h" diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h index 94b9e1b..84979f1 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.h +++ b/drivers/net/bnx2x/bnx2x_rxtx.h @@ -5,7 +5,7 @@ * All rights reserved. * www.cavium.com * - * See LICENSE.bnx2x_pmd for copyright and licensing details. + * SPDX-License-Identifier: BSD-3-Clause */ #ifndef _BNX2X_RXTX_H_ diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c index e3880ab..47d8a3e 100644 --- a/drivers/net/bnx2x/bnx2x_stats.c +++ b/drivers/net/bnx2x/bnx2x_stats.c @@ -10,7 +10,7 @@ * All rights reserved. * www.cavium.com * - * See
[dpdk-dev] [PATCH] net/qede: move SPDX tags to source files
We were using LICENSE.qede_pmd to reference inclusion of SPDX licensing tag from all the source file. Remove the LICENSE.qede_pmd file and directly include SPDX tags in source files. Signed-off-by: Rasesh Mody --- drivers/net/qede/LICENSE.qede_pmd |3 --- drivers/net/qede/Makefile |2 +- drivers/net/qede/base/bcm_osal.c |2 +- drivers/net/qede/base/bcm_osal.h |2 +- drivers/net/qede/base/common_hsi.h|2 +- drivers/net/qede/base/ecore.h |2 +- drivers/net/qede/base/ecore_attn_values.h |2 +- drivers/net/qede/base/ecore_chain.h |2 +- drivers/net/qede/base/ecore_cxt.c |2 +- drivers/net/qede/base/ecore_cxt.h |2 +- drivers/net/qede/base/ecore_cxt_api.h |2 +- drivers/net/qede/base/ecore_dcbx.c|2 +- drivers/net/qede/base/ecore_dcbx.h|2 +- drivers/net/qede/base/ecore_dcbx_api.h|2 +- drivers/net/qede/base/ecore_dev.c |2 +- drivers/net/qede/base/ecore_dev_api.h |2 +- drivers/net/qede/base/ecore_gtt_reg_addr.h|2 +- drivers/net/qede/base/ecore_gtt_values.h |2 +- drivers/net/qede/base/ecore_hsi_common.h |2 +- drivers/net/qede/base/ecore_hsi_debug_tools.h |2 +- drivers/net/qede/base/ecore_hsi_eth.h |2 +- drivers/net/qede/base/ecore_hsi_init_func.h |2 +- drivers/net/qede/base/ecore_hsi_init_tool.h |2 +- drivers/net/qede/base/ecore_hw.c |2 +- drivers/net/qede/base/ecore_hw.h |2 +- drivers/net/qede/base/ecore_hw_defs.h |2 +- drivers/net/qede/base/ecore_init_fw_funcs.c |2 +- drivers/net/qede/base/ecore_init_fw_funcs.h |2 +- drivers/net/qede/base/ecore_init_ops.c|2 +- drivers/net/qede/base/ecore_init_ops.h|2 +- drivers/net/qede/base/ecore_int.c |2 +- drivers/net/qede/base/ecore_int.h |2 +- drivers/net/qede/base/ecore_int_api.h |2 +- drivers/net/qede/base/ecore_iov_api.h |2 +- drivers/net/qede/base/ecore_iro.h |2 +- drivers/net/qede/base/ecore_iro_values.h |2 +- drivers/net/qede/base/ecore_l2.c |2 +- drivers/net/qede/base/ecore_l2.h |2 +- drivers/net/qede/base/ecore_l2_api.h |2 +- drivers/net/qede/base/ecore_mcp.c |2 +- drivers/net/qede/base/ecore_mcp.h |2 +- drivers/net/qede/base/ecore_mcp_api.h |2 +- drivers/net/qede/base/ecore_mng_tlv.c |2 +- drivers/net/qede/base/ecore_proto_if.h|2 +- drivers/net/qede/base/ecore_rt_defs.h |2 +- drivers/net/qede/base/ecore_sp_api.h |2 +- drivers/net/qede/base/ecore_sp_commands.c |2 +- drivers/net/qede/base/ecore_sp_commands.h |2 +- drivers/net/qede/base/ecore_spq.c |2 +- drivers/net/qede/base/ecore_spq.h |2 +- drivers/net/qede/base/ecore_sriov.c |2 +- drivers/net/qede/base/ecore_sriov.h |2 +- drivers/net/qede/base/ecore_status.h |2 +- drivers/net/qede/base/ecore_utils.h |2 +- drivers/net/qede/base/ecore_vf.c |2 +- drivers/net/qede/base/ecore_vf.h |2 +- drivers/net/qede/base/ecore_vf_api.h |2 +- drivers/net/qede/base/ecore_vfpf_if.h |2 +- drivers/net/qede/base/eth_common.h|2 +- drivers/net/qede/base/mcp_public.h|2 +- drivers/net/qede/base/nvm_cfg.h |2 +- drivers/net/qede/base/reg_addr.h |2 +- drivers/net/qede/qede_ethdev.c|2 +- drivers/net/qede/qede_ethdev.h|2 +- drivers/net/qede/qede_fdir.c |2 +- drivers/net/qede/qede_if.h|2 +- drivers/net/qede/qede_logs.h |2 +- drivers/net/qede/qede_main.c |2 +- drivers/net/qede/qede_rxtx.c |2 +- drivers/net/qede/qede_rxtx.h |2 +- 70 files changed, 69 insertions(+), 72 deletions(-) delete mode 100644 drivers/net/qede/LICENSE.qede_pmd diff --git a/drivers/net/qede/LICENSE.qede_pmd b/drivers/net/qede/LICENSE.qede_pmd deleted file mode 100644 index 022085a..000 --- a/drivers/net/qede/LICENSE.qede_pmd +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright (c) 2016 - 2018 Cavium Inc. - */ diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile index c30a867..45ad579 100644 --- a/drivers/net/qede/Makefile +++ b/drivers/net/qede/Makefile @@ -2,7 +2,7 @@ #All rights reserved. #www.cavium.com # -#See LICENSE.qede_pmd for copyright and licensing details. +#SPDX-License-Identifier: BSD-3-Clause include $(RTE_SDK)/mk/rte.vars.mk diff --git a/drive
[dpdk-dev] expectation from rte_eth_dev_stop(start)
Hi ethdev maintainers, I am looking for the exact expectation from the PMD upon a call for rte_eth_dev_stop. The doc is a bit lacking[1]. Assuming stop should do the opposite of start[2], Does it mean after call to dev_stop the DPDK port should no longer receive traffic? What should be the link status after a call to dev_stop? From [2] it seems like a don't care since the link_status callback is not enabled. [1] /** * Stop an Ethernet device. The device can be restarted with a call to * rte_eth_dev_start() * * @param port_id * The port identifier of the Ethernet device. */ void rte_eth_dev_stop(uint16_t port_id); [2] /** * Start an Ethernet device. * * The device start step is the last one and consists of setting the configured * offload features and in starting the transmit and the receive units of the * device. * On success, all basic functions exported by the Ethernet API (link status, * receive/transmit, and so on) can be invoked. * * @param port_id * The port identifier of the Ethernet device. * @return * - 0: Success, Ethernet device started. * - <0: Error code of the driver device start function. */ int rte_eth_dev_start(uint16_t port_id);