Commit Graph

25 Commits

Author SHA1 Message Date
Michal Krawczyk
117ba4a604 net/ena: get device info statically
Whenever the app is calling rte_eth_dev_info_get(), it shouldn't use the
admin command. It was causing problems, if it was called from the
secondary process - the main process was crashing, and the secondary app
wasn't getting any result, as the admin request couldn't be processed by
the process which was requesting the data.

To fix that, the data is being written to the adapter structure during
device initialization routine.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2019-02-20 16:41:43 +01:00
Rafal Kozik
94c3e3765d net/ena: add new way of getting Rx drops
The Rx drops cannot be acquired using the older API. Now, it must be
read in keep alive message.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-12-21 16:22:40 +01:00
Solganik Alexander
7830e905b7 net/ena: expose extended stats
ENA PMD is having it's own custom statistics counters. They are exposed
to the application by using the xstats DPDK API.

The deprecated and unused statistics are removed, together with old API.

Signed-off-by: Solganik Alexander <sashas@lightbitslabs.com>
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-12-21 16:22:40 +01:00
Michal Krawczyk
45b6d86184 net/ena: add per-queue software counters stats
Those counters provide information regards sent/received bytes and
packets per queue.

Signed-off-by: Solganik Alexander <sashas@lightbitslabs.com>
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-12-21 16:22:40 +01:00
Michal Krawczyk
2fca2a98c0 net/ena: support LLQv2
LLQ (Low Latency Queue) is the feature that allows pushing header
directly to the device through PCI before even DMA is triggered.
It reduces latency, because device can start preparing packet before
payload is sent through DMA.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-12-21 16:22:40 +01:00
Rafal Kozik
ea93d37eb4 net/ena: add HW queues depth setup
The device now allows driver to reconfigure Tx and Rx queues depth
independently. Moreover, maximum size for Tx and Rx can be different.
Those maximum values are received from the device.

After reset, previous ring configuration is restored.

If number of descriptor is set to RTE_ETH_DEV_FALLBACK_RX_RINGSIZE
or RTE_ETH_DEV_FALLBACK_TX_RINGSIZE, the maximum value is restored.

Remove checks, if provided number is not too big, as this is done in
generic functions (rte_eth_rx_queue_setup and rte_eth_tx_queue_setup).

Maximum number of segments is being set for Rx packets and provided to
ena_com_rx_pkt() for validation.

Unused definitions were removed.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-12-21 16:22:40 +01:00
Rafal Kozik
79405ee175 net/ena: fix out of order completion
rx_buffer_info should be refill not linearly, but out of order.
IDs should be taken from empty_rx_reqs array.

rx_refill_buffer is introduced to temporary storage
bulk of mbufs taken from pool.

In case of error unused mbufs are put back to pool.

Fixes: c203497667 ("net/ena: add Rx out of order completion")
Cc: stable@dpdk.org

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-11-22 09:50:39 +01:00
Rafal Kozik
241da076b1 net/ena: adjust error checking and cleaning
Adjust error checking and cleaning to Linux driver:
 * add checking if MTU is to small,
 * fix error messages (mismatched Rx and Tx),
 * return error received from base driver or proper error
   code instead of -1,
 * in case of error release occupied resources,
 * in case of Rx error trigger NIC reset.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Rafal Kozik
2061fe41f2 net/ena: linearize Tx mbuf
Function ena_check_and_linearize_mbuf check Tx mbuf for number of
segments and linearize (defragment) it if necessary. It is called
before sending each packet.

Information about maximum number of segments is stored per each ring.

Maximum number of segments supported by NIC is taken from ENA COM in
ena_calc_queue_size function and stored in adapter structure.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Michal Krawczyk
c203497667 net/ena: add Rx out of order completion
This feature allows Rx packets to be cleaned up out of order.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Rafal Kozik
e859d2b862 net/ena: make watchdog configurable
Add variable wd_state to make driver functional without keep alive
AENQ handler.
The watchdog will be executed only if the aenq group has keep alive
enabled.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Michal Krawczyk
5efb9fc743 net/ena: check for admin queue state
The admin queue can stop responding or became inactive due to unexpected
behaviour of the device. In that case, the whole device should be
restarted.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Michal Krawczyk
d9b8b106bf net/ena: add watchdog and keep alive AENQ handler
Keep alive is executing AENQ interrupt periodically. It allows to check
health of the device and trigger reset event if the device will stop
responding.

To check for the state of the device, the DPDK application must call
rte_timer_manage().

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Michal Krawczyk
2081d5e2e9 net/ena: add reset routine
Reset routine can be used by the DPDK application to reset the device in
case of receiving RTE_ETH_EVENT_INTR_RESET from the PMD.

The reset event is not triggered by the driver, yet. It will be added in
next commits to enable error recovery in case of misfunctioning of the
device.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Michal Krawczyk
ca148440e0 net/ena: add LSC intr support and AENQ handling
To make the LSC interrupt working, the AENQ must be configured properly
in the ENA device. The AENQ interrupt is common for all maintenance
interrupts - the proper handler is then executed depending on the
received descriptor.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Michal Krawczyk
eb0ef49dd5 net/ena: add stop and uninit routines
Lack of uninit routine could lead to memory leak.
Stop was added to fulfill allowed PMD operations.

Checks for the PMD states in the start and configure routine were
removed, as the upper layer is already checking for them.

The interrupt setup was moved from start to init function.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-06-14 19:27:50 +02:00
Rafal Kozik
7369f88f88 net/ena: convert to new Rx offloads API
Ethdev Rx offloads API has changed since:

commit ce17eddefc ("ethdev: introduce Rx queue offloads API")

This commit support the new Rx offloads API.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-01-21 15:51:52 +01:00
Rafal Kozik
56b8b9b7e5 net/ena: convert to new Tx offloads API
Ethdev Tx offloads API has changed since:

commit cba7f53b71 ("ethdev: introduce Tx queue offloads API")

This commit support the new Tx offloads API. Queue configuration
is stored in ena_ring.offloads. During preparing mbufs for tx, offloads are
allowed only if appropriate flags in this field are set.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2018-01-21 15:51:52 +01:00
Gaetan Rivet
c752998b5e pci: introduce library and driver
The PCI lib defines the types and methods allowing to use PCI elements.

The PCI bus implements a bus driver for PCI devices by constructing
rte_bus elements using the PCI lib.

Move the relevant code out of the EAL to its expected place.

Libraries, drivers, unit tests and applications are updated to use the
new rte_bus_pci.h header when necessary.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-10-26 23:17:31 +02:00
Jakub Palider
83277a7ccc net/ena: prepare TSO offload calculation
While ENA can handle checksum calculations in almost all cases,
it cannot do so when DF bit in IPv4 header is not set,
that is DF=0, and TSO is requested. For that situation pseudo
header must be prepared manually.

Signed-off-by: Jakub Palider <jpa@semihalf.com>
2017-01-30 22:18:26 +01:00
Jakub Palider
1daff5260f net/ena: use unmasked head and tail
The next_to_clean and next_to_use ring pointers sometimes were kept
wrapped around ring size, sometimes used beyond this limit. From now
on we increment them without regard to ring size limits, but when
reading the values they are wrapped accordingly. Moreover unit16_t
are unsed whenever possible.

Signed-off-by: Tal Avraham <talavr@annapurnalabs.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
2016-11-07 17:55:41 +01:00
Jan Medala
c414455701 net/ena: disable readless communication when no HW support
Depending on HW revision readless communcation between host and device
may be unavailable. In that case prevent PMD from setting up readless
communication mechanism.

"readless" refers to ability to read ENA registers without actually
issuing read request from host (x86). Instead, host programs 2 registers
on the device that triggers a DMA from device to host and reports a
register value. However, this functionality is not going to be available
in all types of devices. The decision if this mode is supported or not,
is taken from revision_id in pci configuration space.

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
2016-07-08 15:19:40 +02:00
Jan Medala
372c1af5ed net/ena: add dedicated memory area for extra device info
Increase maintenance and debug potentiality with dedicated areas of memory
where additional information can be stored by the ENA device.

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
2016-07-08 15:19:40 +02:00
Thomas Monjalon
a61dc000d5 ethdev: remove deprecated statistics
Some statistics were deprecated since release 2.1 (49f386542a).
The last deprecated counter to be used was imcasts.

The VF loopback statistics are also removed as they are used only
in igb and duplicated in extended statistics.

The new counters should be added to extended statistics.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-04-20 13:49:31 +02:00
Jan Medala
1173fca25a ena: add polling-mode driver
This is a PMD for the Amazon ethernet ENA (Elastic Network Adapters)
family.
The driver operates variety of ENA adapters through feature negotiation
with the adapter and upgradable commands set.
ENA driver handles PCI Physical and Virtual ENA functions.

Signed-off-by: Evgeny Schemeilin <evgenys@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>

Release Note addition:
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2016-03-25 18:56:43 +01:00