Commit Graph

27 Commits

Author SHA1 Message Date
Ajit Khaparde
657c2a7f1d net/bnxt: create aggregation rings when needed
Aggregation rings are needed when PMD needs to support jumbo frames, LRO.
Currently we are creating the aggregation rings whether jumbo frames or
LRO has been enabled or disabled. This causes unnecessary allocation of
mbufs needing larger mbuf pool which is not used at all.

This patch modifies the code to create aggregation rings only when
needed.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-10-12 22:35:13 +02:00
Xueming Li
7483341ae5 ethdev: change queue release callback
Currently, most ethdev callback API use queue ID as parameter, but Rx
and Tx queue release callback use queue object which is used by Rx and
Tx burst data plane callback.

To align with other eth device queue configuration callbacks:
- queue release callbacks are changed to use queue ID
- all drivers are adapted

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-10-06 19:16:03 +02:00
Somnath Kotur
03c8f2fe11 net/bnxt: detect bad opaque in Rx completion
There is a rare hardware bug that can cause a bad opaque value in the RX
or TPA start completion. When this happens, the hardware may have used the
same buffer twice for 2 Rx packets.  In addition, the driver might also
crash later using the bad opaque as an index into the ring.

The Rx opaque value is predictable and is always monotonically increasing.
The workaround is to keep track of the expected next opaque value and
compare it with the one returned by hardware during RX and TPA start
completions. If they miscompare, log it, discard the completion,
schedule a ring reset and move on to the next one.

Fixes: 0958d8b643 ("net/bnxt: support LRO")
Cc: stable@dpdk.org

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-06-08 19:17:25 +02:00
Ajit Khaparde
2addc463ee net/bnxt: update copyright year
Update copyright year in various files.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2021-01-29 18:16:10 +01:00
Rahul Gupta
33ac72d741 net/bnxt: fix Rx performance by removing spinlock
The spinlock was trying to protect scenarios where rx_queue stop/start
could be initiated dynamically. Assigning bnxt_dummy_recv_pkts and
bnxt_dummy_xmit_pkts immediately to avoid concurrent access of mbuf in Rx
and cleanup path should help achieve the same result.

Fixes: 14255b3515 ("net/bnxt: fix queue start/stop operations")

Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
2020-11-03 23:35:03 +01:00
Lance Richardson
b80da220c1 net/bnxt: remove unused macros and fields
Remove unused structure fields and macro definitions.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2020-10-16 19:18:47 +02:00
Lance Richardson
bd881e8d2a net/bnxt: fix drop enable in get Rx queue info
Return correct value for rx_drop_en. Add per-queue field to
track rx_drop_en configuration.

Fixes: 2fc201884b ("net/bnxt: support rxq/txq get information")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-09-30 19:19:10 +02:00
Lance Richardson
deae85145c net/bnxt: handle multiple packets per loop in vector Rx
Process four receive descriptors per inner loop in vector mode
burst receive functions.

Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
2020-09-18 18:55:09 +02:00
Lance Richardson
aade665a1e net/bnxt: increase max burst size for vector path
Increase the maximum supported burst size for the bnxt vector
mode PMD from 32 to 64.

With larger burst sizes, per-burst overhead is amortized over more
packets, improving overall performance. For small packets this has
been measured to provide a 4-10% increase in single-core throughput
with testpmd iofwd.

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
2020-09-18 18:55:09 +02:00
Lance Richardson
cec43bbf38 net/bnxt: improve small ring sizes support
Improve support for small ring sizes:
   - Ensure that transmit free threshold is no more than 1/4 ring size.
   - Ensure that receive free threshold is no more than 1/4 ring size.
   - Validate requested ring sizes against minimum supported size.
   - Use rxq receive free threshold instead of fixed maximum burst
     size to trigger bulk receive buffer allocation.

Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
2020-09-18 18:55:09 +02:00
Lance Richardson
3983583414 net/bnxt: support NEON
Add bnxt vector PMD support using NEON SIMD instructions.
Also update the 20.08 release notes with this information.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2020-07-11 06:18:52 +02:00
Lance Richardson
683e5cf792 net/bnxt: use common NQ ring
Thor queue scaling is currently limited by the number of NQs that
can be allocated. Fix by using a common NQ for all receive/transmit
rings instead of allocating a separate NQ for each ring.

Fixes: f8168ca0e6 ("net/bnxt: support thor controller")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2019-10-08 12:14:32 +02:00
Kalesh AP
3955e26870 net/bnxt: fix Rx queue start/stop
Driver should not change "deferred_start" state of the rx queues.
It should get the state in queue_setup_op() and use that value.

Since the deferred start state was being used in the packet receive
functions to determine whether a stopped rx ring should be polled,
introduced a per-rxq flag to track queue stopped/started state.

Fixes: 9b63c6fd70 ("net/bnxt: support Rx/Tx queue start/stop")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-10-08 12:14:30 +02:00
Santoshkumar Karanappa Rastapur
09aac391a5 net/bnxt: fix forwarding with higher mbuf size
Maximum frame length supported by hw is 9600 bytes.
When user launches testpmd with --mbuf-size=9729,
we are posting buffer descriptors of size 9601 to the ring.
This was causing packets getting discarded.

Fixes: daef48efe5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org

Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
2019-10-08 12:14:30 +02:00
Lance Richardson
f8168ca0e6 net/bnxt: support thor controller
This commit adds support to the bnxt PMD for devices
based on the BCM57508 "thor" Ethernet controller.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
2019-06-13 23:54:30 +09:00
Lance Richardson
bc4a000f2f net/bnxt: implement SSE vector mode
Introduce SSE vector mode support for the bnxt pmd.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13 23:37:58 +09:00
Ajit Khaparde
14255b3515 net/bnxt: fix queue start/stop operations
Packets destined to the to-be-stopped queue should not be dropped
(neither in HW nor in the driver), so re-program the RSS Table without
this queue on stop and add it back to the table on start unless it
is a Representor VF.

Since 0th entry is used for default ring, use fw_grp_id + 1 to change
the RSS table population logic by programming valid IDs instead of the
default zeroth entry in case of an invalid fw_grp_id.

Destroy and recreate the trio of Rx rings(compl, Rx, AG) every time in
start so that HW is in sync with software.

Fixes: 9b63c6fd70 ("net/bnxt: support Rx/Tx queue start/stop")
Cc: stable@dpdk.org

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-07-03 01:35:58 +02:00
Ajit Khaparde
23460b4c6a net/bnxt: avoid freeing memzone multiple times
Since we are storing the mem_zone address for each ring created,
we are freeing the same address multiple times.
For example the memory zone created for Rx is being freed during
Rx ring cleanup, AGG ring cleanup and CQ cleanup.
Avoid this by storing the memory zone address in RXQ instead and
free it as a part of queue_release dev_op.
In the same way do the same for TX queues as well.

Fixes: 51c87ebafc ("net/bnxt: add Tx queue create/destroy")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-04-27 15:54:56 +01:00
Ajit Khaparde
472193a710 net/bnxt: maintain mbuf alloc failure counter per queue
Currently we have a single counter for mbuf alloc failure.
Make it per RxQ instead.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-04-27 15:54:56 +01:00
Scott Branden
fd710bb1f6 net/bnxt: convert to SPDX license tag
Update the license header on bnxt files to be the standard
BSD-3-Clause license used for the rest of DPDK,
bring the files in compliance with the DPDK licensing policy.

Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-04-14 00:40:21 +02:00
Ajit Khaparde
9b63c6fd70 net/bnxt: support Rx/Tx queue start/stop
Currently this is implemented entirely in the PMD as there is no
explicit support in the HW. Re-program the RSS Table without this queue
on stop and add it back to the table on start.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-29 10:04:28 +01:00
Ilya V. Matveychikov
5aac4f74cd net/bnxt: remove unused field from Rx queue struct
Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>
2018-01-16 18:47:49 +01:00
Zhiyong Yang
f8244c6399 ethdev: increase port id range
Extend port_id definition from uint8_t to uint16_t in lib and drivers
data structures, specifically rte_eth_dev_data. Modify the APIs,
drivers and app using port_id at the same time.

Fix some checkpatch issues from the original code and remove some
unnecessary cast operations.

release_17_11 and deprecation docs have been updated in this patch.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-06 18:23:25 +02:00
Somnath Kotur
1fe427fd08 net/bnxt: support enable/disable interrupt
Implement Rx Queue interrupt enable/disable functions

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
0958d8b643 net/bnxt: support LRO
This patch adds support to enable and disable LRO
To support this feature, the driver creates an aggregator ring.
When the hardware starts doing LRO, it sends a tpa_start completion.
When the driver receives a tpa_end completion, it indicates that the
LRO chaining is complete.

Signed-off-by: Steeven Li <steeven.li@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
daef48efe5 net/bnxt: support set MTU
This patch adds support to modify MTU using the set_mtu dev_op.
To support frames > 2k, the PMD creates an aggregator ring.
When a frame greater than 2k is received, it is fragmented
and the resulting fragments are DMA'ed to the aggregator ring.
Now the driver can support jumbo frames upto 9500 bytes.

Signed-off-by: Steeven Li <steeven.li@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
6133f20797 net/bnxt: add Rx queue create/destroy
In this patch we are adding the bnxt_rx_queue_setup_op() and
bnxt_rx_queue_release_op() functions. These will be tied to the
rx_queue_setup and rx_queue_release dev_ops in a subsequent patch.
In these functions we allocate/free memory for the RX queues.

This still requires support to create a RX ring in the ASIC which
will be completed in a future commit. Each Rx queue created via the
rx_queue_setup dev_op will have an associated Rx ring in the hardware.

The Rx logic in the hardware picks a Rx ring for each Rx frame received
by the hardware depending on the properties like RSS, MAC and VLAN
settings configured in the hardware. These packets in the end arrive
on the Rx queue corresponding to the Rx ring in the hardware.

We are also adding some functions like bnxt_mq_rx_configure()
bnxt_free_rx_mbufs() and bnxt_free_rxq_stats() which will be used in
subsequent patches.

We are also adding hwrm_vnic_rss_cfg_* structures, which will be used
in subsequent patches to enable RSS configuration.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Reviewed-by: David Christensen <david.christensen@broadcom.com>
2016-06-20 17:21:51 +02:00