dpdk.git
4 years agonet/ice: rework switch filter
Wei Zhao [Wed, 16 Oct 2019 18:33:56 +0000 (02:33 +0800)]
net/ice: rework switch filter

The patch reworks packet process engine's binary classifier
(switch) for the new framework. It also adds support for new
packet type like PPPoE for switch filter.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: add pattern manifest
Ying A Wang [Wed, 16 Oct 2019 18:33:55 +0000 (02:33 +0800)]
net/ice: add pattern manifest

The patch adds a manifest for all patterns which can be selected
by low level filter engine to compose their supported list.

Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: rework for generic flow enabling
Ying A Wang [Wed, 16 Oct 2019 18:33:54 +0000 (02:33 +0800)]
net/ice: rework for generic flow enabling

The patch reworks the generic flow API (rte_flow) implementation.
It introduces an abstract layer which provides a unified interface
for low-level filter engine (switch, fdir, hash) to register supported
patterns and actions and implement flow validate/create/destroy/flush/
query activities.

The patch also removes the existing switch filter implementation to
avoid compile error. Switch filter implementation for the new framework
will be added in the following patch.

Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: add devargs to control pipeline mode
Qiming Yang [Wed, 16 Oct 2019 18:33:53 +0000 (02:33 +0800)]
net/ice: add devargs to control pipeline mode

Added a devarg to control the mode in generic flow API.
We use none-pipeline mode by default.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: clean up redundant assignment and indentations
Ying A Wang [Wed, 16 Oct 2019 18:33:52 +0000 (02:33 +0800)]
net/ice: clean up redundant assignment and indentations

The patch removes redundant code and cleans up some wrong indentations.

Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agovhost: improve performance by supporting large buffer
Flavio Leitner [Tue, 15 Oct 2019 18:59:51 +0000 (15:59 -0300)]
vhost: improve performance by supporting large buffer

The rte_vhost_dequeue_burst supports two ways of dequeuing data.
If the data fits into a buffer, then all data is copied and a
single linear buffer is returned. Otherwise it allocates
additional mbufs and chains them together to return a multiple
segments mbuf.

While that covers most use cases, it forces applications that
need to work with larger data sizes to support multiple segments
mbufs. The non-linear characteristic brings complexity and
performance implications to the application.

To resolve the issue, add support to attach external buffer
to a pktmbuf and let the host provide during registration if
attaching an external buffer to pktmbuf is supported and if
only linear buffer are supported.

Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/virtio: fix descriptor addressed in Tx
Andrew Rybchenko [Tue, 15 Oct 2019 08:11:27 +0000 (09:11 +0100)]
net/virtio: fix descriptor addressed in Tx

Previous fix removes usage of rte_pktmbuf_prepend() to get pointer
to virtio net header which changes mbuf data_off and data_len.
Size of virtio net header is added to segment length when Tx descriptor
is composed, but segment address (calculated using data_off) is not
adjusted to take size of virtio net header into account.

Fixes: 1ae55ad38e5e ("net/virtio: fix mbuf data and packet length mismatch")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
4 years agovhost: add packed ring support to vring related APIs
Jin Yu [Wed, 9 Oct 2019 20:48:36 +0000 (04:48 +0800)]
vhost: add packed ring support to vring related APIs

This patch add packed ring support in two APIs
so user can get the packed ring`.

Signed-off-by: Lin Li <lilin24@baidu.com>
Signed-off-by: Xun Ni <nixun@baidu.com>
Signed-off-by: Yu Zhang <zhangyu31@baidu.com>
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: add APIs to get inflight ring
Jin Yu [Wed, 9 Oct 2019 20:48:35 +0000 (04:48 +0800)]
vhost: add APIs to get inflight ring

This patch introduces two APIs. one is for getting inflgiht
ring and the other is for getting base.

Signed-off-by: Lin Li <lilin24@baidu.com>
Signed-off-by: Xun Ni <nixun@baidu.com>
Signed-off-by: Yu Zhang <zhangyu31@baidu.com>
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: add APIs to operate inflight ring
Jin Yu [Wed, 9 Oct 2019 20:48:34 +0000 (04:48 +0800)]
vhost: add APIs to operate inflight ring

This patch introduces three APIs to operate the inflight
ring. Three APIs are set, set last and clear. It includes
split and packed ring.

Signed-off-by: Lin Li <lilin24@baidu.com>
Signed-off-by: Xun Ni <nixun@baidu.com>
Signed-off-by: Yu Zhang <zhangyu31@baidu.com>
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: checkout resubmit inflight information
Jin Yu [Wed, 9 Oct 2019 20:48:33 +0000 (04:48 +0800)]
vhost: checkout resubmit inflight information

This patch shows how to checkout the inflight ring and construct
the resubmit information also include destroying resubmit info.

Signed-off-by: Lin Li <lilin24@baidu.com>
Signed-off-by: Xun Ni <nixun@baidu.com>
Signed-off-by: Yu Zhang <zhangyu31@baidu.com>
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: support inflight info sharing
Jin Yu [Wed, 9 Oct 2019 20:48:32 +0000 (04:48 +0800)]
vhost: support inflight info sharing

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.

Signed-off-by: Lin Li <lilin24@baidu.com>
Signed-off-by: Xun Ni <nixun@baidu.com>
Signed-off-by: Yu Zhang <zhangyu31@baidu.com>
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: add inflight structures
Jin Yu [Wed, 9 Oct 2019 20:48:31 +0000 (04:48 +0800)]
vhost: add inflight structures

This patch adds the inflight queue region structure include
the split and packed.

Signed-off-by: Lin Li <lilin24@baidu.com>
Signed-off-by: Xun Ni <nixun@baidu.com>
Signed-off-by: Yu Zhang <zhangyu31@baidu.com>
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: add packed ring into vring struct
Jin Yu [Wed, 9 Oct 2019 20:48:30 +0000 (04:48 +0800)]
vhost: add packed ring into vring struct

This patch add the packed ring in the rte_vhost_vring.

Signed-off-by: Lin Li <lilin24@baidu.com>
Signed-off-by: Xun Ni <nixun@baidu.com>
Signed-off-by: Yu Zhang <zhangyu31@baidu.com>
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: add inflight description
Jin Yu [Wed, 9 Oct 2019 20:48:29 +0000 (04:48 +0800)]
vhost: add inflight description

This patch add the inflight message description and
the inflight share fd protocol feature flag.

Signed-off-by: Lin Li <lilin24@baidu.com>
Signed-off-by: Xun Ni <nixun@baidu.com>
Signed-off-by: Yu Zhang <zhangyu31@baidu.com>
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: prevent zero copy mode if IOMMU is on
Adrian Moreno [Wed, 9 Oct 2019 11:54:32 +0000 (13:54 +0200)]
vhost: prevent zero copy mode if IOMMU is on

The simultaneous use of dequeue_zero_copy and IOMMU is problematic.
Not only because IOVA_VA mode is not supported but also because the
potential invalidation of guest pages while the buffers are in use,
is not handled.

Prevent these two features to be enabled simultaneously.

Fixes: 69c90e98f483 ("vhost: enable IOMMU support")
Cc: stable@dpdk.org
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: convert buffer addresses to GPA for logging
Adrian Moreno [Wed, 9 Oct 2019 11:54:31 +0000 (13:54 +0200)]
vhost: convert buffer addresses to GPA for logging

Add IOVA versions of dirty page logging functions.

Note that the API facing rte_vhost_log_write is not modified.
So, make explicit that it expects the address in GPA space.

Fixes: 69c90e98f483 ("vhost: enable IOMMU support")
Cc: stable@dpdk.org
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: translate incoming log address to GPA
Adrian Moreno [Wed, 9 Oct 2019 11:54:30 +0000 (13:54 +0200)]
vhost: translate incoming log address to GPA

When IOMMU is enabled the incoming log address is in IOVA space. In that
case, look in IOTLB table and translate the resulting HVA to GPA.

If IOMMU is not enabled, the incoming log address is already a GPA so no
transformation is needed.

Fixes: 69c90e98f483 ("vhost: enable IOMMU support")
Cc: stable@dpdk.org
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/virtio: fix Rx AltiVec path by getting all packets
David Christensen [Mon, 30 Sep 2019 18:42:16 +0000 (11:42 -0700)]
net/virtio: fix Rx AltiVec path by getting all packets

The loop to read packets does not take all packets as the number of
available packets (nb_used) is decremented in the loop.

Fixes: 52b5a707e6ca ("net/virtio: add Altivec Rx")

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/virtio: fix Rx stats on AltiVec path
David Christensen [Mon, 30 Sep 2019 18:27:54 +0000 (11:27 -0700)]
net/virtio: fix Rx stats on AltiVec path

With vectorized functions, only the rx stats for number of packets is
incremented.
Update also the other statistics.

Fixes: 52b5a707e6ca ("net/virtio: add Altivec Rx")

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/virtio: improve perf via one-way barriers on used flag
Joyce Kong [Tue, 17 Sep 2019 05:28:26 +0000 (13:28 +0800)]
net/virtio: improve perf via one-way barriers on used flag

In case VIRTIO_F_ORDER_PLATFORM(36) is not negotiated, then the frontend
and backend are assumed to be implemented in software, that is they can
run on identical CPUs in an SMP configuration.
Thus a weak form of memory barriers like rte_smp_r/wmb, other than
rte_cio_r/wmb, is sufficient for this case(vq->hw->weak_barriers == 1)
and yields better performance.
For the above case, this patch helps yielding even better performance
by replacing the two-way barriers with C11 one-way barriers for used
flags in packed ring.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/virtio: improve perf via one-way barrier on avail flag
Joyce Kong [Tue, 17 Sep 2019 05:28:25 +0000 (13:28 +0800)]
net/virtio: improve perf via one-way barrier on avail flag

In case VIRTIO_F_ORDER_PLATFORM(36) is not negotiated, then the frontend
and backend are assumed to be implemented in software, that is they can
run on identical CPUs in an SMP configuration.
Thus a weak form of memory barriers like rte_smp_r/wmb, other than
rte_cio_r/wmb, is sufficient for this case(vq->hw->weak_barriers == 1)
and yields better performance.
For the above case, this patch helps yielding even better performance
by replacing the two-way barriers with C11 one-way barriers for avail
flags in packed ring.

Meanwhile, a read barrier is required to ensure ordering between
descriptor's flags and content reads [1]. With C11, load-acquire can
enforce the ordering instead of rmb barrier.

[1] https://patchwork.dpdk.org/patch/49109/

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/ice: support RSS in AVX path
Leyi Rong [Tue, 15 Oct 2019 07:50:34 +0000 (15:50 +0800)]
net/ice: support RSS in AVX path

Support 32 bits RSS in FlexMD fields in AVX path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
4 years agonet/ice: support RSS in SSE path
Leyi Rong [Tue, 15 Oct 2019 07:50:33 +0000 (15:50 +0800)]
net/ice: support RSS in SSE path

Support 32 bits RSS in FlexMD fields in SSE path.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
4 years agonet/ice: fix LUT type for RSS
Simei Su [Fri, 11 Oct 2019 05:12:27 +0000 (13:12 +0800)]
net/ice: fix LUT type for RSS

This patch changes RSS lut_type to corresponding macro.

Fixes: ff963bfa7cb1 ("net/ice: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: fix integer overflow
Xiao Zhang [Tue, 15 Oct 2019 05:29:19 +0000 (13:29 +0800)]
net/i40e: fix integer overflow

When configuring i40e rx queue, the temporary variable to store max
packet length is not big enough which leads to integer overflow issue.
This patch fixes the issue by removing the variable and using the
expression directly since the variable is only used once.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: fix protocol extraction devargs parsing
Haiyue Wang [Mon, 14 Oct 2019 14:50:05 +0000 (22:50 +0800)]
net/ice: fix protocol extraction devargs parsing

If the default dev args 'proto_xtr' is not in the first position, it
will overwrite the parsed queue map value, so use an new variable to
save the default.

And enhance the error message printing to show the right information.

Fixes: 7e124ff12c85 ("net/ice: support protocol extraction per Rx queue")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: fix memory leak on dev closed
Haiyue Wang [Mon, 14 Oct 2019 14:50:04 +0000 (22:50 +0800)]
net/ice: fix memory leak on dev closed

The original protocol extraction memory free is removed by introducing
new design for releasing port upon close.

Fixes: bd513ece3c40 ("net/ice: release port upon close")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agoapp/testpmd: fix CRC strip command
Ting Xu [Tue, 15 Oct 2019 09:14:20 +0000 (09:14 +0000)]
app/testpmd: fix CRC strip command

This patch fixed the bug that a failure appeared when config
rx_offload crc_strip using command "port config all crc-strip
on|off". The reason is that this command was removed in Commit
e5db17a1e54e. The current command is "port config <port_id>
rx_offload keep_crc on|off" instead.

In this patch, some codes left over about 'crc_strip' are
removed to make the current command clearer.

Fixes: e5db17a1e54e ("app/testpmd: remove duplicated Rx offload commands")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
4 years agoapp/testpmd: show Rx/Tx burst mode description
Haiyue Wang [Tue, 15 Oct 2019 07:51:33 +0000 (15:51 +0800)]
app/testpmd: show Rx/Tx burst mode description

Add the 'Burst mode' section into command 'show rxq|txq info <port_id>
<queue_id>' to show the Rx/Tx burst mode description like:
  "Burst mode: Vector AVX2 Scattered"

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: support Rx/Tx burst mode info
Haiyue Wang [Tue, 15 Oct 2019 07:51:32 +0000 (15:51 +0800)]
net/ice: support Rx/Tx burst mode info

Retrieve burst mode options according to the selected Rx/Tx burst
function name.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/i40e: support Rx/Tx burst mode info
Haiyue Wang [Tue, 15 Oct 2019 07:51:31 +0000 (15:51 +0800)]
net/i40e: support Rx/Tx burst mode info

Retrieve burst mode options according to the selected Rx/Tx burst
function name.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agoethdev: add API for getting burst mode information
Haiyue Wang [Tue, 15 Oct 2019 07:51:30 +0000 (15:51 +0800)]
ethdev: add API for getting burst mode information

Some PMDs have more than one Rx/Tx burst paths, add the ethdev API
that allows an application to retrieve the mode information about
Rx/Tx packet burst such as Scalar or Vector, and Vector technology
like AVX2.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/bnxt: fix error handling in xstats
Kalesh AP [Fri, 11 Oct 2019 05:16:44 +0000 (10:46 +0530)]
net/bnxt: fix error handling in xstats

Add missing return instead of setting the error status in case of error.

Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix endianness while retrieving MTU from FW
Kalesh AP [Tue, 24 Sep 2019 10:19:45 +0000 (15:49 +0530)]
net/bnxt: fix endianness while retrieving MTU from FW

In bnxt_hwrm_func_qcfg(), use rte_le_to_cpu_16 while getting
the mtu value from command response.

Fixes: 905cd45ce30e ("net/bnxt: use configured MTU during load")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix race between interrupt handler and dev config
Somnath Kotur [Fri, 11 Oct 2019 04:44:16 +0000 (10:14 +0530)]
net/bnxt: fix race between interrupt handler and dev config

Fix a possible that while interrupt handler is in the middle of
processing, dev_configure_op() might come in and try to destroy/realloc
the default completion ring on which interrupt completions arrive.
Synchronize the two so they don't race each other

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: move macro definitions to header file
Kalesh AP [Thu, 10 Oct 2019 09:44:32 +0000 (15:14 +0530)]
net/bnxt: move macro definitions to header file

Move device and vendor ids macro definition from bnxt_ethdev.c
to bnxt.h.
There is no functionality impact.

Fixes: 882aa9c6e2e1 ("net/bnxt: move PCI device ids to the driver")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: cleanup comments
Kalesh AP [Thu, 10 Oct 2019 08:44:23 +0000 (14:14 +0530)]
net/bnxt: cleanup comments

- updated one comment for more readability and understanding
- fixed typo in comments
- moved a comment to right place
- removed one out-of-date comment
- removed few commented code

Fixes: f2a768d4d186 ("net/bnxt: add completion ring")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: reset Rx allocation state on Rx queue restart
Lance Richardson [Wed, 9 Oct 2019 17:43:34 +0000 (13:43 -0400)]
net/bnxt: reset Rx allocation state on Rx queue restart

Call bnxt_rxq_vec_setup() to ensure that rxq->rxrearm_nb and
rxq->rxrearm_start are initialized correctly when a receive
queue is restarted.

Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Xiaobing Zhang <xiaobing.zhang@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix dereference before null check
Kalesh AP [Wed, 9 Oct 2019 08:46:17 +0000 (14:16 +0530)]
net/bnxt: fix dereference before null check

This patch fixes potential null pointer access in bnxt_alloc_ag_data().
Fix to return an error if null check is true.

Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/ice/base: improve misc code style
Qi Zhang [Tue, 8 Oct 2019 01:50:18 +0000 (09:50 +0800)]
net/ice/base: improve misc code style

Combine a couple of function definitions that can fit on one line.
RCT a variable declaration.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: add QFI for flow director
Qi Zhang [Tue, 8 Oct 2019 01:50:17 +0000 (09:50 +0800)]
net/ice/base: add QFI for flow director

Added the GTP QFI field to the Flow director interface to allow
matching against this field. Since this field only appears in GTP
packets with extension headers, this also requires adding profile
TCAM mask matching capability.  This allows comprehending different
PTYPE attributes by examining flags from the parser. Using this
method, different profiles can be used by examining flag values
from the parser.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: fix switch rule programming for all profiles
Qi Zhang [Tue, 8 Oct 2019 01:50:16 +0000 (09:50 +0800)]
net/ice/base: fix switch rule programming for all profiles

In switch rule programming, if the caller requested tunnel type of
ICE_SW_TUN_AND_NON_TUN, then the code would incorrectly attempt to
add a tunneled UDP port in the training packet, this would cause the
rule addition to fail. This patch does not attempt to add the UDP
port so that the rule programming will succeed.

Fixes: c3d6ac02c0c3 ("net/ice/base: update switch training packets with open ports")

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: fix flow raw field vector extraction
Qi Zhang [Tue, 8 Oct 2019 01:50:15 +0000 (09:50 +0800)]
net/ice/base: fix flow raw field vector extraction

Correct the ordering of raw field extraction in the field vector
by taking into account the ordering setting for requesting block.

Fixes: aa1cd410fa64 ("net/ice/base: add flow module")
Cc: stable@dpdk.org
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: fix unexpected switch rule overwrite
Qi Zhang [Tue, 8 Oct 2019 01:50:14 +0000 (09:50 +0800)]
net/ice/base: fix unexpected switch rule overwrite

A switch rule with "drop" action will be overwritten by a
rule with same pattern match but with a "to queue" action.
While in an inversed flow creation sequence, the "to queue"
can't be overwritten by the "drop" rule.

The inconsistent behavior is not expected, the patch
fix the issue by preventing rule overwrite in both cases.

Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: initialize structures to zero
Qi Zhang [Tue, 8 Oct 2019 01:50:13 +0000 (09:50 +0800)]
net/ice/base: initialize structures to zero

Some functions create ice_pkg_enum structure, but it seems it's possible
some of the members are used un-initialized.  So we'll initialize all
instantiations of this structure within ice_flex_pipe.c

The patch also fix header comment mismatch issue for
ice_init_prof_result_bm

Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: remove dead error condition
Qi Zhang [Tue, 8 Oct 2019 01:50:12 +0000 (09:50 +0800)]
net/ice/base: remove dead error condition

The pointer cmd is set to an address of a structure, which can never be
NULL.  Remove the check-for-NULL lines since it's dead code anyway.

Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: improve flow director masking
Qi Zhang [Tue, 8 Oct 2019 01:50:11 +0000 (09:50 +0800)]
net/ice/base: improve flow director masking

Currently, 3-tuple FD matching is implemented using masking. However,
this is using up twenty-four of the thirty-two FD masks available. This
patch uses the swap register more efficiently to implement the 3-tuple
matches, which saves all FD masks for other uses.

Added IPV6 versions of DSCP, TTL and Protocol fields for flow director
use.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: support GTPU TEID for flow director
Qi Zhang [Tue, 8 Oct 2019 01:50:10 +0000 (09:50 +0800)]
net/ice/base: support GTPU TEID for flow director

Added the training packet for GTPU TEID field to the Flow director to
allow matching against this field.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: update flow packet type bitmaps
Qi Zhang [Tue, 8 Oct 2019 01:50:09 +0000 (09:50 +0800)]
net/ice/base: update flow packet type bitmaps

In the flow API, the outer first ptype bitmaps contained many
references to inner ptypes. Because of PTG assignments, these were
causing issues when programming rules on the inner ptypes.
For example, in RSS when programming the outer IPV6 hash fields,
it also programmed several inner IPV4 PTGs with the same extraction.

There were several ptypes that have been removed, thus this patch
removes those bits from the type bitmaps.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: fix NVGRE switch rule programming
Qi Zhang [Tue, 8 Oct 2019 01:50:08 +0000 (09:50 +0800)]
net/ice/base: fix NVGRE switch rule programming

Correct for GRE/NVGRE training packets to include the
correct protocol IDs for TCP and UDP respectively.

Fixes: b83a0c290322 ("net/ice/base: fix inner TCP and UDP support for GRE")
Cc: stable@dpdk.org
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice/base: fix adding PPPoE switch rule
Qi Zhang [Tue, 8 Oct 2019 01:50:07 +0000 (09:50 +0800)]
net/ice/base: fix adding PPPoE switch rule

Update VLAN protocol ID to correct value for single VXLAN scenario.
Fix the missing ethertype offset for PPPoE dummy packet offset to
allow matching the corresponding field.

Fixes: d1c2f76b440a ("net/ice/base: support GTP and PPPoE protocols")

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agoapp/testpmd: introduce Rx offloads option
Vivek Sharma [Thu, 10 Oct 2019 04:34:26 +0000 (10:04 +0530)]
app/testpmd: introduce Rx offloads option

Introduce boot time argument for configuring all rx offloads.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: introduce QinQ offload option
Vivek Sharma [Fri, 11 Oct 2019 02:36:54 +0000 (08:06 +0530)]
app/testpmd: introduce QinQ offload option

Introduce boot time argument for configuring QinQ strip
offload.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: support QinQ offload in VLAN set command
Vivek Sharma [Fri, 11 Oct 2019 04:05:21 +0000 (09:35 +0530)]
app/testpmd: support QinQ offload in VLAN set command

Segregate QinQ from Extend Offload and support QinQ offload
in vlan set command. Merge all port wise rx vlan offloads in
command line help and documentation for a cleaner structure.

Fix port info display to distinguish between qinq strip and
extend offloads. Flatten all VLAN offload info into a single
line to reduce info length.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/dpaa2: set port in mbuf
Nipun Gupta [Wed, 9 Oct 2019 11:13:23 +0000 (16:43 +0530)]
net/dpaa2: set port in mbuf

This patch sets the port in mbuf for event scenarios as well

Fixes: b677d4c6d281 ("net/dpaa2: add API for event Rx adapter")
Fixes: 2d3788631862 ("net/dpaa2: support atomic queues")
Fixes: 16c4a3c46ab7 ("bus/fslmc: add enqueue response read in qbman")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agodoc: replace license text with SPDX tag in AVP guide
Hemant Agrawal [Fri, 27 Sep 2019 09:04:32 +0000 (14:34 +0530)]
doc: replace license text with SPDX tag in AVP guide

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
4 years agodoc: replace license text with SPDX tag in ARK guide
Hemant Agrawal [Fri, 27 Sep 2019 09:04:31 +0000 (14:34 +0530)]
doc: replace license text with SPDX tag in ARK guide

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ed Czeck <ed.czeck@atomicrules.com>
4 years agonet/memif: optimize with one-way barrier
Phil Yang [Mon, 26 Aug 2019 11:00:14 +0000 (19:00 +0800)]
net/memif: optimize with one-way barrier

Using 'rte_mb' to synchronize the shared ring head/tail between producer
and consumer will stall the pipeline and damage performance on the weak
memory model platforms, such like aarch64. Meanwhile update the shared
ring head and tail are observable and ordered between CPUs on IA.

Optimized this full barrier with the one-way barrier can improve the
throughput. On aarch64 n1sdp server this patch make testpmd throughput
boost 2.1%. On Intel E5-2640, testpmd got 3.98% performance gain.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Jakub Grajciar <jgrajcia@cisco.com>
4 years agonet/qede: print adapter info during init failure
Rasesh Mody [Sun, 6 Oct 2019 20:14:09 +0000 (13:14 -0700)]
net/qede: print adapter info during init failure

Dump the info logs banner with available information in case of
device initialization failure.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/qede/base: update FW to 8.40.25.0
Rasesh Mody [Sun, 6 Oct 2019 20:14:08 +0000 (13:14 -0700)]
net/qede/base: update FW to 8.40.25.0

This patch updates the FW to 8.40.25.0 and corresponding base driver
changes. It also updates the PMD version to 2.11.0.1. The FW updates
consists of enhancements and fixes as described below.

 - VF RX queue start ramrod can get stuck due to completion error.
   Return EQ completion with error, when fail to load VF data. Use VF
   FID in RX queue start ramrod
 - Fix big receive buffer initialization for 100G to address failure
   leading to BRB hardware assertion
 - GRE tunnel traffic doesn't run when non-L2 ethernet protocol is
   enabled, fix FW to not forward tunneled SYN packets to LL2.
 - Fix the FW assert that is caused during vport_update when
   tx-switching is enabled
 - Add initial FW support for VF Representors
 - Add ecore_get_hsi_def_val() API to get default HSI values
 - Move following from .c to .h files:
   TSTORM_QZONE_START and MSTORM_QZONE_START
   enum ilt_clients
   renamed struct ecore_dma_mem to phys_mem_desc and moved
 - Add ecore_cxt_set_cli() and ecore_cxt_set_blk() APIs to set client
   config and block details
 - Use SET_FIELD() macro where appropriate
 - Address spell check and code alignment issues

Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/qede/base: update HSI
Rasesh Mody [Sun, 6 Oct 2019 20:14:07 +0000 (13:14 -0700)]
net/qede/base: update HSI

Update hardware software common base driver code in preparation to
update the firmware to version 8.40.25.0.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/qede/base: move DMAE to HSI
Rasesh Mody [Sun, 6 Oct 2019 20:14:06 +0000 (13:14 -0700)]
net/qede/base: move DMAE to HSI

Move DMA engine (DMAE) structures from base driver to HSI module.
Use DMAE_PARAMS_* in place of ECORE_DMAE_FLAG_*.
Enforce SET_FIELD() macro where appropriate.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/qede/base: update RT defs NVM cfg and MCP
Rasesh Mody [Sun, 6 Oct 2019 20:14:05 +0000 (13:14 -0700)]
net/qede/base: update RT defs NVM cfg and MCP

Update and add runtime array offsets (rt defs), non-volatile memory
configuration options (nvm cfg) and management co-processor (mcp)
shared code in preparation to update the firmware to version 8.40.25.0.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/qede/base: rename HSI datatypes and functions
Rasesh Mody [Sun, 6 Oct 2019 20:14:04 +0000 (13:14 -0700)]
net/qede/base: rename HSI datatypes and functions

This patch changes code with E4/E5/e4/e5/BB_K2 prefixes and suffixes.
 - HSI datatypes renaming - removed all e5 datatypes and renamed
   all e4 datatypes to be prefix less/suffix less.
   (s/_E4//; s/_e4//; s/E4_//).
 - HSI functions - removed e4/e5 prefixes/suffixes.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/qede/base: lock entire QM reconfiguration flow
Rasesh Mody [Sun, 6 Oct 2019 20:14:03 +0000 (13:14 -0700)]
net/qede/base: lock entire QM reconfiguration flow

Multiple flows can issue QM reconfiguration, hence hold the lock longer
to account for entire duration of reconfiguration flow.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/qede/base: change MFW mailbox command log verbosity
Rasesh Mody [Sun, 6 Oct 2019 20:14:02 +0000 (13:14 -0700)]
net/qede/base: change MFW mailbox command log verbosity

Change management FW mailboxes DP_VERBOSE module to ECORE_MSG_HW

Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/qede/base: fix page index for PBL chains
Rasesh Mody [Sun, 6 Oct 2019 20:14:01 +0000 (13:14 -0700)]
net/qede/base: fix page index for PBL chains

ecore_chain_set_prod/cons() sets the wrong page index in chains with
non-power of 2 page count. Fix ecore_chain_set_prod/cons() for PBL
chains with non power of 2 page count.
Calculate the right page index according to current indexes.

Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rmody@marvell.com>
4 years agonet/hinic: support getting Rx/Tx queues info
Xiaoyun Wang [Thu, 10 Oct 2019 14:52:03 +0000 (22:52 +0800)]
net/hinic: support getting Rx/Tx queues info

This patch adds support for getting rxq or txq info.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: optimize Rx performance
Xiaoyun Wang [Thu, 10 Oct 2019 14:52:02 +0000 (22:52 +0800)]
net/hinic: optimize Rx performance

This patch optimizes receive packets performance
on arm platform.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic/base: optimize AEQ interfaces
Xiaoyun Wang [Thu, 10 Oct 2019 14:52:01 +0000 (22:52 +0800)]
net/hinic/base: optimize AEQ interfaces

This patch deletes ceq interfaces that not needed,
fix aeq buges in some scenarios.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: document missing features
Xiaoyun Wang [Thu, 10 Oct 2019 14:52:00 +0000 (22:52 +0800)]
net/hinic: document missing features

Add features to ini file.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: support LRO offload
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:59 +0000 (22:51 +0800)]
net/hinic: support LRO offload

This patch supports LRO offload.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: support inner L3 checksum offload
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:58 +0000 (22:51 +0800)]
net/hinic: support inner L3 checksum offload

This patch supports inner L3 checksum offload for VXLAN packets,
modifies rx checksum offload.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: get firmware version
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:57 +0000 (22:51 +0800)]
net/hinic: get firmware version

This patch adds support for getting firmware version.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: set link down and up
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:56 +0000 (22:51 +0800)]
net/hinic: set link down and up

This patch supports setting link down and up.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: flush flow director filter
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:55 +0000 (22:51 +0800)]
net/hinic: flush flow director filter

Supports to flush fdir filter.
Destroy all flow rules associated with a port on hinic.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: create and destroy flow director filter
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:54 +0000 (22:51 +0800)]
net/hinic: create and destroy flow director filter

Add support for creating/destroying fdir filter.
The filter rule includes LACP,ARP and ICMP packet type.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: create and destroy ntuple filter
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:53 +0000 (22:51 +0800)]
net/hinic: create and destroy ntuple filter

Add support for creating/destroying ntuple filter.
The filter rule includes BGP and VRRP packet type.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: add flow validation operations
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:52 +0000 (22:51 +0800)]
net/hinic: add flow validation operations

This patch is to validate the filter rules, which includes
ntuple filter, ethertype filter and fdir filter. The packets
type that supported are BGP,VRRP,LACP,ARP and ICMP.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic/base: add flow director config interface
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:51 +0000 (22:51 +0800)]
net/hinic/base: add flow director config interface

This patch adds fdir config operation, including set fdir filter,
normal filter, set and clear fdir tcam.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: add unicast and multicast MAC set
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:50 +0000 (22:51 +0800)]
net/hinic: add unicast and multicast MAC set

This patch adds unicast and multicast set interfaces.
Application can add or remove unicast MAC address, also can set
multicast MAC address, the maximum multicast list size is 2048.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: add allmulticast mode and MTU set
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:49 +0000 (22:51 +0800)]
net/hinic: add allmulticast mode and MTU set

When enable allmulticast mode, all multicast packets
can be received. This patch also adds support for MTU set,
the range of MTU is from 256 to 9600.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: add VLAN filter and offload
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:48 +0000 (22:51 +0800)]
net/hinic: add VLAN filter and offload

This patch adds support for VLAN filter and VLAN offload.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: support VF
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:47 +0000 (22:51 +0800)]
net/hinic: support VF

This patch adds VF PMD operation interfaces to support SR-IOV.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic/base: add HW interfaces for SR-IOV
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:46 +0000 (22:51 +0800)]
net/hinic/base: add HW interfaces for SR-IOV

This patch introduces some HW interfaces required for SR-IOV function,
including: init hwdev, set port state, get default cos,
VF DMA attribute table, VF txrx flush and so on.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic/base: add mbox command channel for SR-IOV
Xiaoyun Wang [Thu, 10 Oct 2019 14:51:45 +0000 (22:51 +0800)]
net/hinic/base: add mbox command channel for SR-IOV

Add mbox command channel for SR-IOV, which is used to
communicate between VF and VF, VF and PF. This patch
introduces data structures, initialization, interfaces
and commands of mbox channel.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/bnxt: remove unnecessary variable assignment
Kalesh AP [Thu, 10 Oct 2019 01:41:53 +0000 (18:41 -0700)]
net/bnxt: remove unnecessary variable assignment

There is no need to assign return value to a temporary variable.
Instead return error directly in case of failure.

Fixes: 1fe427fd08ee ("net/bnxt: support enable/disable interrupt")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
4 years agonet/bnxt: fix coding style
Kalesh AP [Thu, 10 Oct 2019 01:41:52 +0000 (18:41 -0700)]
net/bnxt: fix coding style

- Remove unnecessary new line
- Remove unnecessary blank lines
- Align rte_* header file inclusion at one place

Fixes: 37d6161a68ba ("net/bnxt: add ring group alloc/free")
Fixes: ec77c6298301 ("net/bnxt: add stats context allocation")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix handling interface change status
Kalesh AP [Thu, 10 Oct 2019 01:41:51 +0000 (18:41 -0700)]
net/bnxt: fix handling interface change status

Driver issues hwrm_if_change when the port is started and stopped.
This command returns whether the fw has undergone a reset while port
was down. Fix to handle hwrm_if_change status during port start only.

Fixes: 0b533591238f ("net/bnxt: inform firmware about IF state changes")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
4 years agonet/bnxt: enable interrupts according interface status
Kalesh AP [Thu, 10 Oct 2019 01:41:50 +0000 (18:41 -0700)]
net/bnxt: enable interrupts according interface status

Driver issues hwrm_if_change when the port is started. This command
returns whether the fw has undergone a reset while port was down and
driver does re-init of resources if fw has undergone a reset.
Fix to enable interrupts only after this check.

Fixes: c023cd5b2192 ("net/bnxt: fix async link handling and update")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: change MSI-X vector to queue mapping
Rahul Gupta [Thu, 10 Oct 2019 01:41:49 +0000 (18:41 -0700)]
net/bnxt: change MSI-X vector to queue mapping

DPDK PCIe-VFIO framework configures base MSIX vector for interrupts
which is supported by other h/w. In case of bnxt, base MSIX vector
starts with the RX completion queue 0. To comply with the DPDK
framework We need to increase the map index by 1 so that RXTX
completion queues events can be delivered to appropriate event listeners
by kernel VFIO.

Fixes: bd0a14c99f65 ("net/bnxt: use dedicated CPR for async events")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: reduce cleanup time during reset recovery
Rahul Gupta [Thu, 10 Oct 2019 01:41:48 +0000 (18:41 -0700)]
net/bnxt: reduce cleanup time during reset recovery

In stop_op(), don't wait for link down event's ASYNC response from FW.

Fixes: c023cd5b2192 ("net/bnxt: fix async link handling and update")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: get default HWRM command timeout from FW
Ajit Khaparde [Thu, 10 Oct 2019 01:41:47 +0000 (18:41 -0700)]
net/bnxt: get default HWRM command timeout from FW

The HWRM command timeout is set to a very high value.
VER_GET command response returns the default request timeout value.
Use this value for waiting for HWRM commands to complete.
Poll for the valid bit every 1us instead of 600us.

Fixes: cbcd375d37d2 ("net/bnxt: fix HWRM macros and locking")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
4 years agonet/bnxt: update trusted VF status only when it changes
Ajit Khaparde [Thu, 10 Oct 2019 01:41:46 +0000 (18:41 -0700)]
net/bnxt: update trusted VF status only when it changes

We are currently logging trusted VF information everytime a VF config
change is indicated by the async message. Update it only when new
setting is different from the current setting.

Fixes: b42c15c83e88 ("net/bnxt: support trusted VF")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: remove redundant header file inclusion
Kalesh AP [Thu, 10 Oct 2019 01:41:45 +0000 (18:41 -0700)]
net/bnxt: remove redundant header file inclusion

bnxt.h header includes bnxt_cpr.h and bnxt_util.h.
There is no need to include these headers file explicitly.

This commit does not cause any functional change.

Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: return error if setting link up fails
Kalesh AP [Thu, 10 Oct 2019 01:41:44 +0000 (18:41 -0700)]
net/bnxt: return error if setting link up fails

Currently bnxt driver does not return error in case setting link up fails.

Fixes: 5c206086feaa ("net/bnxt: add link state operations")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: free default completion ring before VF config
Santoshkumar Karanappa Rastapur [Thu, 10 Oct 2019 01:41:43 +0000 (18:41 -0700)]
net/bnxt: free default completion ring before VF config

If the VF resources need to be reconfigured using the
bnxt_hwrm_func_reserve_vf_resc, make sure that the default completion
ring is freed first before the resources are reserved.

Reallocate the ring once the VF resources are configured.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix stats errors handling
Kalesh AP [Thu, 10 Oct 2019 01:41:42 +0000 (18:41 -0700)]
net/bnxt: fix stats errors handling

This patch fixes few checks and few return values while getting
and clearing device statistics.

1. Fixed to return standard error code.
2. Clubbed few error checks
3. Removed an unnecessary return check

Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
Fixes: 88920136688c ("net/bnxt: support xstats get by id")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/pfe: add link status update
Gagandeep Singh [Thu, 10 Oct 2019 06:32:33 +0000 (12:02 +0530)]
net/pfe: add link status update

This patch add link related operations like
link update, up and down.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>