Commit Graph

7219 Commits

Author SHA1 Message Date
Somnath Kotur
11e5e19695 net/bnxt: support redirecting tunnel packets to VF
Add code to redirect GRE, NVGRE and VXLAN tunnel packets
to the specified VF.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-14 00:01:06 +09:00
John Daley
889dcfd571 net/enic: remove flow locks
There is no requirement for thread safety in the flow PMD code and no
need for the locks.

Fixes: 6ced137607 ("net/enic: flow API for NICs with advanced filters enabled")
Cc: stable@dpdk.org

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
2019-06-14 00:01:06 +09:00
John Daley
d74111a9a1 net/enic: remove flow count action support
The firmware in 1400 series VIC adapters which would support COUNT
flow action was postponed and reworked. The capability will be
re-added in a future release when the firmware is available.

This reverts the following commits.
commit 86df6c4e2f ("net/enic: support flow counter action")
commit 1b4ce87dc5 ("net/enic: fix counter action")

Cc: stable@dpdk.org

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
2019-06-14 00:01:06 +09:00
Hyong Youb Kim
f1edcfe692 net/enic: report speed capabilities
Available link speeds are based on VIC adapter model, which is encoded
in PCI subsystem device ID.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2019-06-14 00:01:06 +09:00
Hyong Youb Kim
95104e02d3 net/enic: set min and max MTU
These values correspond to those used in the MTU handler (enic_set_mtu).

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2019-06-14 00:01:06 +09:00
Georgiy Levashov
1245e3fabc net/sfc: support Rx interrupts for ef10 datapath
Similar to support for efx datapath, Rx interrupt disabling
just avoids rearming the next time.

Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-14 00:01:06 +09:00
Georgiy Levashov
4279b54e28 net/sfc: support Rx interrupts for efx datapath
When Rx interrupts are disabled, we simply disable rearm when
the interrupt fires the next time. So, the next packet will
trigger interrupt (if it is not happened yet after previous Rx
burst processing).

Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-14 00:01:00 +09:00
Andrew Rybchenko
fcae1808f8 net/vmxnet3: fix Tx prepare to set positive rte_errno
Fixes: baf3bbae55 ("net/vmxnet3: add Tx preparation")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2019-06-13 23:54:30 +09:00
Andrew Rybchenko
48aa952c9b net/qede: fix Tx prepare to set positive rte_errno
Fixes: 29540be7ef ("net/qede: support LRO/TSO offloads")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:30 +09:00
Andrew Rybchenko
53dd95c10b net/ixgbe: fix Tx prepare to set positive rte_errno
Fixes: 7829b8d52b ("net/ixgbe: add Tx preparation")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:30 +09:00
Andrew Rybchenko
9f9969e147 net/ice: fix Tx prepare to set positive rte_errno
Fixes: 17c7d0f9d6 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:30 +09:00
Andrew Rybchenko
5e129a2ddc net/iavf: fix Tx prepare to set positive rte_errno
Fixes: a2b29a7733 ("net/avf: enable basic Rx Tx")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:30 +09:00
Andrew Rybchenko
39be55654e net/i40e: fix Tx prepare to set positive rte_errno
Fixes: 3f33e643e5 ("net/i40e: add Tx preparation")
Fixes: bfeed0262b ("net/i40e: check illegal packets")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:30 +09:00
Andrew Rybchenko
dafc6dbcb4 net/fm10k: fix Tx prepare to set positive rte_errno
Fixes: 9b134aa397 ("net/fm10k: add Tx preparation")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
2019-06-13 23:54:30 +09:00
Andrew Rybchenko
ad8473ef0a net/enic: fix Tx prepare to set positive rte_errno
Fixes: 1e81dbb532 ("net/enic: add Tx prepare handler")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:30 +09:00
Andrew Rybchenko
ecafec261e net/e1000: fix Tx prepare to set positive rte_errno
Fixes: 2b76648872 ("net/e1000: add Tx preparation")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:30 +09:00
Andrew Rybchenko
328121fd9e net/atlantic: fix Tx prepare to set positive rte_errno
Fixes: 2b1472d715 ("net/atlantic: implement Tx path")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:30 +09:00
Shahed Shaikh
65a45ecc76 net/bnx2x: fix supported max Rx/Tx descriptor count
Driver does not provide limit on number Rx and Tx descriptors per queue,
this may result in application configuring 64k descriptors (default set
by rte_eth_dev_info_get()) and further result in issues in PMD and HW
flows due to unsupported number.

Fixes: 540a211084 ("bnx2x: driver core")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
2019-06-13 23:54:30 +09:00
Shahed Shaikh
6c5b9b2aaf net/bnx2x: fix link state
Don't call bnx2x_link_status_update() from bnx2x_link_update().
Actual use case of bnx2x_link_status_update() is to update the link
status in shared memory between driver and MFW, and not to get the
link status from HW.

So ideally, bnx2x_link_status_update() should be called when there
is an actual link event or change in link status.

Calling bnx2x_link_status_update() from bnx2x_link_update() may
corrupt the data of link status in shared memory and result
in inconsistent state of link.

Fixes: 540a211084 ("bnx2x: driver core")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
2019-06-13 23:54:30 +09:00
Shahed Shaikh
0cf8fdce99 net/bnx2x: fix memory leak
bnx2x_free_hsi_mem() does not free DMA memory.
Fix it here.

Fixes: 540a211084 ("bnx2x: driver core")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
2019-06-13 23:54:30 +09:00
Shahed Shaikh
f0219d98de net/bnx2x: fix interrupt flood
PMD sets up and clears the slow path interrupt status block in dev_start
and dev_stop flow and slow path interrupt status block DMA memory for
device is allocated in dev_configure flow.

This situation creates a state where, after dev_stop is called, and if
there is a slow path interrupt from device, PMD sees the old value of
status block consumer in dev_start flow, since DMA memory for status
block belongs to old configuration and dev_start will result in
new slow path interrupt status block configuration.
And since PMD fails to ack new slow path interrupt with correct status
block consumer value, device continues to trigger interrupt causing an
interrupt flood.

Fix is to create and destroy status block DMA memory in dev_start and
dev_stop flow instead of dev_configure and dev_close flow.

Fixes: 540a211084 ("bnx2x: driver core")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
2019-06-13 23:54:30 +09:00
Shahed Shaikh
08a6e472c3 net/bnx2x: fix packet drop
Patch "8bd31421c593 ("net/bnx2x: fix ramrod timeout")"
introduced a regression where sc->scan_fp flags is
set for unexpectedly long time. So the slow path completion
handler flow is run unnecessarily which walks over receive
descriptor ring of fast path and drops the data packets while looking
for slow path completion descriptor out of fast path ring.

This issue is seen under heavy traffic with link events happening
in background.

Fixes: 8bd31421c5 ("net/bnx2x: fix ramrod timeout")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
2019-06-13 23:54:30 +09:00
Michal Krawczyk
4217cb0b7d net/ena: fix assigning NUMA node to IO queue
Previous solution was using memzones in invalid way in hope to assign
IO queue to the appropriate NUMA zone.

The right way is to use socket_id from the rx/tx queue setup function
and then pass it to the IO queue.

Fixes: 3d3edc265f ("net/ena: make coherent memory allocation NUMA-aware")
Cc: stable@dpdk.org

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2019-06-13 23:54:30 +09:00
Xiaolong Ye
32d2bf01a3 net/af_xdp: remove unused struct member
Fixes: f1debd77ef ("net/af_xdp: introduce AF_XDP PMD")
Cc: stable@dpdk.org

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-06-13 23:54:30 +09:00
Xiaolong Ye
339b88c6a9 net/af_xdp: support multi-queue
This patch adds two parameters `start_queue` and `queue_count` to
specify the range of netdev queues used by AF_XDP pmd.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-06-13 23:54:30 +09:00
Xiaolong Ye
e9ff8bb719 net/af_xdp: enable zero copy by external mbuf
Implement zero copy of af_xdp pmd through mbuf's external memory
mechanism to achieve high performance.

This patch also provides a new parameter "pmd_zero_copy" for user, so they
can choose to enable zero copy of af_xdp pmd or not.

To be clear, "zero copy" here is different from the "zero copy mode" of
AF_XDP, it is about zero copy between af_xdp umem and mbuf used in dpdk
application.

Suggested-by: Vipin Varghese <vipin.varghese@intel.com>
Suggested-by: Tummala Sivaprasad <sivaprasad.tummala@intel.com>
Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-06-13 23:54:30 +09:00
Stephen Hemminger
4586be3743 net/failsafe: fix reported device info
The failsafe driver device info had several issues in the
info it reported in dev_info_get:
  - it cleared dev_info->device set in rte_eth_dev_info_get
  - many fields (for example max_rx_queue) should be the minimum
    of all sub devices
  - it reported tx capa for the active transmit device, but
    the device may change.

There was enough messed up that ended up reworking the info_get
handler. There is no need to save current values or have a
template for defaults.

Fixes: 4e31ee26ed ("net/failsafe: report actual device capabilities")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2019-06-13 23:54:30 +09:00
Mesut Ali Ergin
9159bcb25a net/i40e: fix uninitialized value
Initializes mark_spec pointer to NULL.

Coverity issue: 341075
Fixes: 0bbcfc706a ("net/i40e: support MARK and RSS flow action")

Signed-off-by: Mesut Ali Ergin <mesut.a.ergin@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
2019-06-13 23:54:30 +09:00
Lance Richardson
38412304b5 net/bnxt: enable RSS for thor-based controllers
Make changes needed to support rss for thor-based controllers.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13 23:54:30 +09:00
Lance Richardson
e2a8184f48 net/bnxt: enable completion coalescing for thor
Enable completion coalescing for Thor-based adapters.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13 23:54:30 +09: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
61d2b9a71d net/bnxt: refactor ring allocation
Reduce code duplication and prepare for supporting hardware with
different ring allocation requirements by refactoring ring
allocation code.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13 23:54:29 +09:00
Lance Richardson
bb0546edfa net/bnxt: refactor doorbell handling
Reduce code duplication and prepare for newer controllers that
use different doorbell protocols by refactoring doorbell handling
code.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13 23:54:29 +09:00
Lance Richardson
79cc1efd99 net/bnxt: support extended HWRM request sizes
Enable support for extended request sizes.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13 23:54:29 +09:00
Lance Richardson
5a8d1496a5 net/bnxt: reset function earlier in initialization
Move function reset to beginnng of initialization sequence.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13 23:54:29 +09:00
Lance Richardson
17cdfc00a2 net/bnxt: use consistent values for VNIC RSS rule
Use consistent values for vnic->rss_rule. No functional change,
these all equate to uint16_t 0xffff.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13 23:54:29 +09:00
Lance Richardson
26f568ccce net/bnxt: fix variable width in endian conversion
Use 32-bit conversion width when converting to 32-bit values.

Fixes: 6371b91fb6 ("net/bnxt: add ring alloc/free")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13 23:54:29 +09:00
Lance Richardson
1f91ae9857 net/bnxt: fix ring type macro name
Use consistent macro names for ring type values. (There is no
functional change, the "alloc" and "free" values are identical.)

Fixes: 6371b91fb6 ("net/bnxt: add ring alloc/free")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13 23:54:29 +09:00
Lance Richardson
3858965c3a net/bnxt: fix endianness in ring macros
Descriptor fields in CP ring are in little-endian form, convert
to CPU endian before performing arithmetic operations.

Also use more general comparison when checking for ring
index wrap.

Fixes: f2a768d4d1 ("net/bnxt: add completion ring")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-06-13 23:54:29 +09:00
Andrew Rybchenko
9aa0afd1e9 net/sfc: advertise offload capabilities by Tx datapaths
Tx datapath feature bits were useful on migration from the old offload API
to the new one. However, right now it just adds indirection which
complicates code reading and understanding. Also addition of a new
offloads requires addition of a new feature bits and makes patches longer
and harder to understand. So, remove feature bits which correspond to Tx
offloads and simply advertise device and per-queue offloads directly.
Generic code could still mask some offloads if running HW or FW does not
support it.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2019-06-13 23:54:29 +09:00
Andrew Rybchenko
f08d113d55 net/sfc: advertise offload capabilities by Rx datapaths
Rx datapath feature bits were useful on migration from the old offload API
to the new one. However, right now it just adds indirection which
complicates code reading and understanding. Also addition of a new
offloads requires addition of a new feature bits and makes patches longer
and harder to understand. So, remove feature bits which correspond to Rx
offloads and simply advertise device and per-queue offloads directly.
Generic code could still mask some offloads if running HW or FW does not
support it.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2019-06-13 23:54:29 +09:00
Michal Krawczyk
ef74b5f7b6 net/ena: fix Rx checksum errors statistics
Rx checksum flags and input errors shouldn't be updated on Tx, as it
would work only for packets forwarding.

The ierrors statistic should be updated on Rx, right after checking
Rx checksum flags if the Rx checksum offload is enabled.

Fixes: 1173fca25a ("ena: add polling-mode driver")
Cc: stable@dpdk.org

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2019-06-13 23:54:29 +09:00
Rafal Kozik
5673e285a6 net/ena: fix Tx statistics
Instead of counting number of used NIC Tx bufs just count number
of Tx packets.

Fixes: 45b6d86184 ("net/ena: add per-queue software counters stats")
Cc: stable@dpdk.org

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2019-06-13 23:54:29 +09:00
Jakub Grajciar
09c7e63a71 net/memif: introduce memory interface PMD
Shared memory packet interface (memif) PMD allows for DPDK and any other
client using memif (DPDK, VPP, libmemif) to communicate using shared
memory. The created device transmits packets in a raw format. It can be
used with Ethernet mode, IP mode, or Punt/Inject. At this moment, only
Ethernet mode is supported in DPDK memif implementation. Memif is Linux
only.

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00
Maxime Coquelin
fce0663996 net/virtio: remove useless pointer checks
This patch removes useless checks on 'prev' pointer, as it
is always set before with a valid value.

Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-06-13 23:54:29 +09:00
Maxime Coquelin
3291bb21bb net/virtio: fix segment length in mergeable packed Rx
Head segment data_len field is wrongly summed with the length
of all the segments of the chain, whereas it should be the
length of the first segment only.

Fixes: a76290c8f1 ("net/virtio: implement Rx path for packed queues")
Cc: stable@dpdk.org

Reported-by: Yaroslav Brustinov <ybrustin@cisco.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-06-13 23:54:29 +09:00
Maxime Coquelin
366599450d net/virtio: fix mergeable Rx with segmented packet
After having dequeued a burst of descriptors, there may be a
need to dequeue a few more if the last packet was segmented
and not complete. When it happens, the extra segments were
not properly attached to the mbuf chain, and so were lost.

Also, head segment data_len field is wrongly summed with
the length of all the segments of the chain.

This patch fixes both the mbuf chaining and head segment's
data_len field

Fixes: bcac5aa207 ("net/virtio: improve batching in mergeable path")
Cc: stable@dpdk.org

Reported-by: Yaroslav Brustinov <ybrustin@cisco.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-06-13 23:54:29 +09:00
Maxime Coquelin
61d0bec3ba net/virtio: fix in-order Rx with segmented packet
After having dequeued a burst of descriptors, there may be a
need to dequeue a few more if the last packet was segmented
and not complete. When it happens, the extra segments were
not properly attached to the mbuf chain, and so were lost.

Also, head segment data_len field is wrongly summed with
the length of all the segments of the chain.

This patch fixes both the mbuf chaining and head segment's
data_len field.

Fixes: e5f456a98d ("net/virtio: support in-order Rx and Tx")
Cc: stable@dpdk.org

Reported-by: Yaroslav Brustinov <ybrustin@cisco.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-06-13 23:54:29 +09:00
Tiwei Bie
fa2407ac30 net/vhost: release port upon close
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private
resources for the port can be freed by rte_eth_dev_close().

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-06-13 23:54:29 +09:00
David Marchand
711b07ce6e net/virtio: remove useless check on mempool
This .rx_queue_setup devop is called after ethdev already dereferenced
the mempool pointer.
No need to check and we can remove this rte_exit.

Fixes: 48cec290a3 ("net/virtio: move queue configure code to proper place")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-06-13 23:54:29 +09:00
David Harton
02ad704708 net/i40e: eliminate weak symbols in data path
Use of weak symbols can hide makefile errors especially when
custom makefiles are used.  Removing the use of weak symbols
to avoid a stub function being linked in production code.

Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-06-13 23:54:29 +09:00
William Tu
bf2644cd38 net/af_xdp: fix remove path
When users call rte_eth_dev_close() and rte_dev_remove(), the af_xdp
pmd return -1 (EPERM) due to eth_dev == NULL.

Since the af_xdp pmd driver advertises RTE_ETH_DEV_CLOSE_REMOVE, all
the resources are freed on rte_eth_dev_close().  rte_dev_remove() tries
to detach device and subsequently calls rte_pmd_af_xdp_remove() that
tries to free already freed resources and fails.
Fix it by return success.

Fixes: f1debd77ef ("net/af_xdp: introduce AF_XDP PMD")
Cc: stable@dpdk.org

Reported-at: https://patchwork.ozlabs.org/patch/1106528/
Suggested-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: William Tu <u9012063@gmail.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-06-13 23:54:29 +09:00
Stephen Hemminger
d812a3c21e net/mlx5: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00
Stephen Hemminger
07dcd23788 net/ixgbe: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00
Stephen Hemminger
fc7a79b808 net/i40e: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00
Stephen Hemminger
69b16b36b0 net/enic: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00
Stephen Hemminger
890728ff21 net/ena: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00
Stephen Hemminger
130d2b77f0 net/e1000: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00
Stephen Hemminger
63a97e588b net/cxgbe: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00
Stephen Hemminger
0b07f6e992 net/bonding: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00
Stephen Hemminger
78466c95f8 net/bnxt: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
2019-06-13 23:54:29 +09:00
Stephen Hemminger
0bc212a8ae net/axgbe: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:29 +09:00
Stephen Hemminger
0bf8b0f16a net/ark: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:28 +09:00
Stephen Hemminger
78e4a0fada net/atlantic: remove unnecessary cast
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-13 23:54:28 +09:00
Ajit Khaparde
89414e8f73 net/bnxt: update HWRM API to version 1.10.0.74
Update HWRM API to version 1.10.0.74

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
2019-06-13 23:54:28 +09:00
Ajit Khaparde
3100ab4b09 net/bnxt: update HWRM API to version 1.10.0.48
Update HWRM version to 1.10.0.48

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
2019-06-13 23:54:23 +09:00
Ajit Khaparde
3df746eb52 net/bnxt: update HWRM API to version 1.10.0.19
Update HWRM API to version 1.10.0.19

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
2019-06-13 23:51:27 +09:00
Ajit Khaparde
378ab645bb net/bnxt: fix RSS RETA indirection table ops
We are trying to update the indirection table for all the VNICs.
We should update the table only for the default vnic0.

Fix the reta update function to only update table entries that are
selected by the update mask. Translate queue number to firmware
group ID when updating an entry.

Fix reta query op to only return table entries as identfied by the
provided mask. Translate firmware group IDs to queue numbers.

Removed extraneous code from bnxt_reta_query_op().

Fixes: d819382543 ("net/bnxt: add RSS redirection table operations")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
2019-06-13 23:37:59 +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
Lance Richardson
ff9031492c net/bnxt: compute and store scattered Rx status
In preparation for a bnxt vector-mode driver, compute and store
scattered_rx status for the device when started.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-06-13 23:37:58 +09:00
Lance Richardson
355b482e12 net/bnxt: move Tx bd checking to header file
To allow sharing of tx_bds_in_hw() and bnxt_tx_avail() between
vector-mode and non-vector transmit functions, move these functions
into bnxt_txr.h.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-06-13 23:37:58 +09:00
Viacheslav Ovsiienko
5897ac1393 net/mlx5: fix event handler uninstall
When device is being closed and tries to unregister interrupt callback,
there is a chance the handler is still active (called in context of
eal_intr_thread_main thread). If so the rte_intr_callback_unregister
returns -EAGAIN and keeps the handler registered, causing crash when
underlaying resourse is gone away.

This race condition may happen if event handling in application takes
a long time. We should check the return code of unregistering routine
and try again to unregister the handler. The diagnostic messages are
shown once a second, while trying to unregister.

Fixes: 028b2a28c3 ("net/mlx5: update event handler for multiport IB devices")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2019-06-06 20:21:20 +09:00
Dekel Peled
0d51a5ec26 net/mlx5: fix order of items in NEON scatter
Previous patch added handling of metadata for multi-segment packet.
Function txq_scatter_v in file mlx5_rxtx_vec_neon.h was updated
incorrectly, items were inserted into WQE in wrong order.

This patch fixes the issue, inserting items into WQE correctly.

Fixes: 7f4019d370 ("net/mlx5: fix Tx metadata for multi-segment packet")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-06-06 20:21:20 +09:00
Tom Barbette
e571ad5541 net/mlx5: support reading clock
Implements support for read_clock for the mlx5 driver. mlx5 supports
hardware timestamp offload, setting packets timestamp field to the
device clock. rte_eth_read_clock allows to read the device's current
clock value and therefore compare values on similar time base.

See rxtx_callbacks for an example.

Signed-off-by: Tom Barbette <barbette@kth.se>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-06-06 20:21:20 +09:00
David Marchand
6d84612124 net/tap: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: 02f96a0a82 ("net/tap: add TUN/TAP device PMD")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2019-06-06 20:21:20 +09:00
David Marchand
fffe9d0431 net/szedata2: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: abef3dd62e ("szedata2: add new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-06 20:21:20 +09:00
David Marchand
c1f9d6c698 net/ring: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: e1e4017751 ("ring: add new driver")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-06 20:21:20 +09:00
David Marchand
48d3313341 net/pcap: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: 4c173302c3 ("pcap: add new driver")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-06 20:21:20 +09:00
David Marchand
c6bc117c99 net/null: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: c743e50c47 ("null: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-06 20:21:20 +09:00
David Marchand
81d03bff26 net/mlx5: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: 87011737b7 ("mlx5: add software counters")
Fixes: 9f9a48eb29 ("net/mlx5: fix Tx stats error counter definition")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-06-06 20:21:20 +09:00
David Marchand
6a1bc531ac net/mlx4: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: 7fae69eeff ("mlx4: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-06-06 20:21:20 +09:00
David Marchand
90c3547116 net/kni: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: 75e2bc54c0 ("net/kni: add KNI PMD")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-06 20:21:20 +09:00
David Marchand
01b5e419de net/cxgbe: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: 856505d303 ("cxgbe: add port statistics")
Fixes: a0a344a8f7 ("net/cxgbe: add VF port statistics")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-06 20:21:20 +09:00
David Marchand
eeb05ecc4d net/bnxt: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: 577d3dced0 ("net/bnxt: refactor the query stats")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-06 20:21:19 +09:00
David Marchand
f75916cf88 net/avp: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: 5a5abe2de9 ("net/avp: add device statistics operations")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
2019-06-06 20:21:19 +09:00
David Marchand
3b79ed8a39 net/af_packet: fix RxQ errors stat
Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: 364e08f2bb ("af_packet: add PMD for AF_PACKET-based virtual devices")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-06-06 20:21:19 +09:00
Anatoly Burakov
c7ef989970 ipc: handle unsupported IPC in sync request
Currently, IPC API will silently ignore unsupported IPC.
Fix the API call and its callers to explicitly handle
unsupported IPC cases.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-06-05 11:28:05 +02:00
Anatoly Burakov
edf73dd330 ipc: handle unsupported IPC in action register
Currently, IPC API will silently ignore unsupported IPC.
Fix the API call and its callers to explicitly handle
unsupported IPC cases.

For primary processes, it is OK to not have IPC because
there may not be any secondary processes in the first place,
and there are valid use cases that disable IPC support, so
all primary process usages are fixed up to ignore IPC
failures.

For secondary processes, IPC will be crucial, so leave all
of the error handling as is.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-06-05 11:27:36 +02:00
Yongseok Koh
69c06d0e35 net/mlx: support IOVA VA mode
Set RTE_PCI_DRV_IOVA_AS_VA to driver's drv_flags as device's IOMMU takes
virtual address.

Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-06-04 00:34:54 +02:00
Bruce Richardson
982e43658c build: warn on unused parameter
To improve code quality we want to turn on as many warnings as we can in
the DPDK code, so turn on the "unused-parameter" warning in meson builds to
match that of the make builds. To ensure correct compilation, disable the
warning selectively for driver base code that otherwise would have issues.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-06-04 00:22:50 +02:00
Bruce Richardson
8741a90745 net/nfp: disable for 32-bit meson builds
From comment in the build config for the make build-system:

 "NFP PMD is not supported on 32-bit"

Therefore disable NFP for 32-bit meson builds as well as for 32-bit
make ones.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-06-03 23:52:55 +02:00
David Marchand
0c9da7555d net: replace IPv4/v6 constants with uppercase name
Since we change these macros, we might as well avoid triggering complaints
from checkpatch because of mixed case.

old=RTE_IPv4
new=RTE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

old=RTE_ETHER_TYPE_IPv4
new=RTE_ETHER_TYPE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

old=RTE_ETHER_TYPE_IPv6
new=RTE_ETHER_TYPE_IPV6
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
2019-06-03 16:54:54 +02:00
David Marchand
aa5d6a72de net/tap: revert rte prefixing
This source is compiled as a bpf program out of dpdk.
Revert to structures/macros coming from libc.

Fixes: 6d13ea8e8e ("net: add rte prefix to ether structures")
Fixes: 24ac604ef7 ("net: add rte prefix to IP defines")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
2019-06-03 16:54:43 +02:00
David Marchand
9c6b199354 net/softnic: do not dereference global config struct
Prefer the existing apis rather than direct access the configuration
structure.

Fixes: a958a5c07f ("net/softnic: support service cores")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-05-30 00:29:09 +02:00
David Marchand
64a46f14f6 net/cxgbe: do not dereference global config struct
Prefer the existing apis rather than direct access the configuration
structure.

Fixes: 92c8a63223 ("cxgbe: add device configuration and Rx support")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-05-30 00:28:40 +02:00
Michael Santana
f4be6a9a29 fix off-by-one errors in snprintf
snprintf guarantees to always correctly place a null terminator
in the buffer string. So manually placing a null terminator
in a buffer right after a call to snprintf is redundant code.

Additionally, there is no need to use 'sizeof(buffer) - 1' in snprintf as this
means we are not using the last character in the buffer. 'sizeof(buffer)' is
enough.

Cc: stable@dpdk.org

Signed-off-by: Michael Santana <msantana@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-05-29 13:02:53 +02:00
Ashijeet Acharya
d31b95860d net/ixgbe/base: wait for link after copper MAC setup
After setting up the link on x552/X557-AT 10GBASE-T NICs, sometimes the
link does not get set up properly and as a result all the subsequent
calls to ixgbe_check_link() from ixgbe_dev_link_update_share() fail.

Introduce a delay time of 1s in ixgbe_setup_mac_link_t_X550em() before
beginning to set up the external PHY link speed to ensure that the
controller can acquire the link.

Signed-off-by: Ashijeet Acharya <ashijeet.acharya@6wind.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-05-28 11:32:47 +02:00
Yogev Chaimovich
de80fbfddb net/vmxnet3: fix uninitialized variable
Coverity issue: 323479
Fixes: 30f77abecd ("net/vmxnet3: support stats reset")
Cc: stable@dpdk.org

Signed-off-by: Yogev Chaimovich <yogev@cgstowernetworks.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2019-05-27 18:21:54 +02:00
Beilei Xing
270854e996 net/ixgbe: enable new device
This patch enables new device, the device id is 0x15B0.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-05-27 18:14:32 +02:00
Ajit Khaparde
5ef3592c97 net/bnxt: support bulk free of Tx mbufs
The driver currently uses rte_pktmbuf_free() to free each mbuf
after transmit completion. This is optimized to free multiple
mbufs using rte_mempool_put_bulk().

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
2019-05-27 18:09:07 +02:00
Sriharsha Basavapatna
220de9869b net/bnxt: optimize Tx batching
This patch adds a few optimizations to Tx batching. Instead of
specifying 'cmpl_next' to bnxt_start_xmit() as a hint to enable
completion for a given packet, request for completion on the last
successfully enqueued TxBD. This takes care of both success and
error cases. It eliminates 'cmpl_next' arg and related per-packet
condition checks around it.

Fixes: 5735eb2419 ("net/bnxt: support Tx batching")
Cc: stable@dpdk.org

Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-05-27 18:09:07 +02:00
Sriharsha Basavapatna
adcee0fc84 net/bnxt: fix Tx batching
This patch addresses the following issues with Tx batching:

1. Tx stall observed in some conditions:

The batching code doesn't request for a completion when only a partial
chain of packets is transmitted due to mbuf allocation errors. Because
of this, Tx consumer index is not updated correctly and it eventually
leads to qfull condition. Fix this by requesting a completion for the
last packet in the partial chain that is transmitted successfully.

2. Tx stall seen with Jumbo frames:

With jumbo frames, number of TxBDs is > 1. While setting up these
additional BDs in bnxt_start_xmit(), the flags field is being set using
the OR-assignment operator. We end up using a stale value of the flags
field (from a previous use of that descriptor). This results in an
invalid completion and eventually leads to tx stall. Fix this to just
assign the flags field with the right value.

Fixes: 5735eb2419 ("net/bnxt: support Tx batching")
Cc: stable@dpdk.org

Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-05-27 18:09:07 +02:00
Ajit Khaparde
77942f509b net/bnxt: check for error conditions in Tx path
The HW can have limits on the minimum packet size it can support,
or the maximum number of segments it can support. Check for such
possibilities. Also check if we are going to have a 0 length buffer.

Fixes: 6eb3cc2294 ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
2019-05-27 18:09:07 +02:00
Ajit Khaparde
1d76c878b2 net/bnxt: support updating IPID
Add support to update ipid during TSO.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
2019-05-27 18:09:07 +02:00
Ajit Khaparde
c750eae57f net/bnxt: fix TSO
We wrongly update lflags in the Tx descriptor; avoid it.
Also, instead of calculating the last producer index to see if mbuf
segments are chained, check if the pointer is NULL to iterate through
the segment list.

Fixes: 6eb3cc2294 ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
2019-05-27 18:09:07 +02:00
Dekel Peled
9e44476448 net/mlx5: fix memory free on queue create error
In function mlx5_rxq_ibv_new(), pointer *tmpl allocation is attempted
at the start, but not validated or freed in case of error.
In function mlx5_txq_ibv_new(), pointer *txq_ibv allocation is
attempted at the start, but not freed in case of error.

This patch adds pointers initialization, validation and freeing.

Fixes: 09cb5b5817 ("net/mlx5: separate DPDK from verbs Rx queue objects")
Fixes: faf2667fe8 ("net/mlx5: separate DPDK from verbs Tx queue objects")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2019-05-27 10:21:04 +02:00
Dekel Peled
73f008334f net/mlx5: remove redundant size calculation macro
Patch [1] added, among other definitions, the macro MLX5_ST_SZ_DB.
Patch [2] added later the macro MLX5_ST_SZ_BYTES, which is exactly
the same macro with a different name.
Each of these macros was used in very few places.

This patch removes the definition of MLX5_ST_SZ_DB, and replaces it
with MLX5_ST_SZ_BYTES wherever it was used.
Macro MLX5_ST_SZ_BYTES was preffered since it is the same macro
name used in kernel code, see [3].

[1] http://patches.dpdk.org/patch/45254/
[2] http://patches.dpdk.org/patch/49403/
[3] https://lists.openwall.net/netdev/2014/10/02/75

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-05-27 10:20:55 +02:00
Jack Min
fe3b65c202 net/mlx5: support match on TCP flags
Add support to match all TCP control bits (flags)
except "NS (ECN-nonce)" via Direct Verbs (DV) or Direct Rule (DR)
engine.

Signed-off-by: Jack Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2019-05-27 10:20:48 +02:00
Stephen Hemminger
11a34bf2c0 net/mlx4: use dynamic log type
This driver should use dynamic log level not RTE_LOGTYPE_PMD.
Other drivers were converted back in 18.02.

This is really a bug, all other drivers use dynamic log levels
by now.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-27 10:20:45 +02:00
Dekel Peled
50254b6d2a net/mlx5: move locally used functions to static
Multiple functions were declared in header file mlx5_rxtx.h,
implemented in mlx5_rxq.c, and called only in mlx5_rxq.c.

This patch moves all these functions declarations into mlx5_rxq.c,
as static functions.
Some functions implementation was copied higher in the file to
precede the functions calls.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2019-05-24 14:56:36 +02:00
Dekel Peled
cf9f7115f0 net/mlx5: fix description of return value
Return value of function mlx5_rxq_releasable() was not described
correctly in function description.

This patch updates the description to correctly describe the optional
return values.

Fixes: a6d83b6a92 ("net/mlx5: standardize on negative errno values")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2019-05-24 14:56:36 +02:00
Dekel Peled
3a3d398280 net/mlx5: fix missing validation of null pointer
Function mlx5_rxq_ibv_release() is called in several places.
Before each call except one, the input parameter is validated to make
sure it is not null.

This patch adds the validation where it is missing.
It also changes a priv_ prefix, left in a comment, to mlx5_ prefix.

Fixes: af4f09f282 ("net/mlx5: prefix all functions with mlx5")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2019-05-24 14:56:36 +02:00
Dekel Peled
a65c2d6637 net/mlx5: remove unused functions
Functions implemented but never called:
mlx5_rxq_ibv_releasable()
mlx5_rxq_cleanup()
mlx5_txq_ibv_releasable()

Function declared but not implemented:
rxq_alloc_mprq_buf()

This patch removes these functions from code and header file.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2019-05-24 14:56:36 +02:00
Mesut Ali Ergin
0bbcfc706a net/i40e: support MARK and RSS flow action
Currently, i40e Flow Director action parser only allows following nine
action combinations: (QUEUE, PASSTHRU, DROP, QUEUE + MARK, PASSTHRU +
MARK, DROP + MARK, QUEUE + FLAG, PASSTHRU + FLAG, DROP + FLAG)

Using the existing Cloud Filter profile on the NIC, it is possible to
add support for two more combinations as: (MARK + RSS, MARK + FLAG +
RSS)

Addition of these new combinations would allow more applications to
utilize DPDK rte_flow to implement hardware flow offloads with Intel
Ethernet 700 series network adapters, including but not limited to the
existing OVS DPDK partial hardware flow offload feature.

Signed-off-by: Mesut Ali Ergin <mesut.a.ergin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-05-24 14:12:33 +02:00
Olivier Matz
e73e3547ce net: add rte prefix to UDP structure
Add 'rte_' prefix to structures:
- rename struct udp_hdr as struct rte_udp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
f41b5156fe net: add rte prefix to TCP structure
Add 'rte_' prefix to structures:
- rename struct tcp_hdr as struct rte_tcp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
09d9ae1ac9 net: add rte prefix to SCTP structure
Add 'rte_' prefix to structures:
- rename struct sctp_hdr as struct rte_sctp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
24ac604ef7 net: add rte prefix to IP defines
Add 'RTE_' prefix to defines:
- rename IPv4( as RTE_IPv4(.
- rename IPV4_MAX_PKT_LEN as RTE_IPV4_MAX_PKT_LEN.
- rename IPV4_HDR_IHL_MASK as RTE_IPV4_HDR_IHL_MASK.
- rename IPV4_IHL_MULTIPLIER as RTE_IPV4_IHL_MULTIPLIER.
- rename IPV4_HDR_DF_SHIFT as RTE_IPV4_HDR_DF_SHIFT.
- rename IPV4_HDR_MF_SHIFT as RTE_IPV4_HDR_MF_SHIFT.
- rename IPV4_HDR_FO_SHIFT as RTE_IPV4_HDR_FO_SHIFT.
- rename IPV4_HDR_DF_FLAG as RTE_IPV4_HDR_DF_FLAG.
- rename IPV4_HDR_MF_FLAG as RTE_IPV4_HDR_MF_FLAG.
- rename IPV4_HDR_OFFSET_MASK as RTE_IPV4_HDR_OFFSET_MASK.
- rename IPV4_HDR_OFFSET_UNITS as RTE_IPV4_HDR_OFFSET_UNITS.
- rename IPV4_ANY as RTE_IPV4_ANY.
- rename IPV4_LOOPBACK as RTE_IPV4_LOOPBACK.
- rename IPV4_BROADCAST as RTE_IPV4_BROADCAST.
- rename IPV4_ALLHOSTS_GROUP as RTE_IPV4_ALLHOSTS_GROUP.
- rename IPV4_ALLRTRS_GROUP as RTE_IPV4_ALLRTRS_GROUP.
- rename IPV4_MAX_LOCAL_GROUP as RTE_IPV4_MAX_LOCAL_GROUP.
- rename IPV4_MIN_MCAST as RTE_IPV4_MIN_MCAST.
- rename IPV4_MAX_MCAST as RTE_IPV4_MAX_MCAST.
- rename IS_IPV4_MCAST as RTE_IS_IPV4_MCAST.
- rename IPV6_HDR_FL_SHIFT as RTE_IPV6_HDR_FL_SHIFT.
- rename IPV6_HDR_TC_SHIFT as RTE_IPV6_HDR_TC_SHIFT.
- rename IPV6_HDR_FL_MASK as RTE_IPV6_HDR_FL_MASK.
- rename IPV6_HDR_TC_MASK as RTE_IPV6_HDR_TC_MASK.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
a7c528e5d7 net: add rte prefix to IP structure
Add 'rte_' prefix to structures:
- rename struct ipv4_hdr as struct rte_ipv4_hdr.
- rename struct ipv6_hdr as struct rte_ipv6_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
be11774d45 net: add rte prefix to GRE structure
Add 'rte_' prefix to structures:
- rename struct gre_hdr as struct rte_gre_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
35b2d13fd6 net: add rte prefix to ether defines
Add 'RTE_' prefix to defines:
- rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN.
- rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN.
- rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN.
- rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN.
- rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN.
- rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN.
- rename ETHER_MTU as RTE_ETHER_MTU.
- rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN.
- rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID.
- rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN.
- rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU.
- rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR.
- rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR.
- rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4.
- rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6.
- rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP.
- rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN.
- rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP.
- rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ.
- rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG.
- rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588.
- rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW.
- rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB.
- rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP.
- rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS.
- rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM.
- rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN.
- rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE.
- rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4.
- rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6.
- rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH.
- rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH.
- rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS.
- rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP.
- rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG.
- rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN.

Do not update the command line library to avoid adding a dependency to
librte_net.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
538da7a1ca net: add rte prefix to ether functions
Add 'rte_' prefix to functions:
- rename is_same_ether_addr() as rte_is_same_ether_addr().
- rename is_zero_ether_addr() as rte_is_zero_ether_addr().
- rename is_unicast_ether_addr() as rte_is_unicast_ether_addr().
- rename is_multicast_ether_addr() as rte_is_multicast_ether_addr().
- rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr().
- rename is_universal_ether_addr() as rte_is_universal_ether_addr().
- rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr().
- rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr().
- rename eth_random_addr() as rte_eth_random_addr().
- rename ether_addr_copy() as rte_ether_addr_copy().
- rename ether_format_addr() as rte_ether_format_addr().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
6d13ea8e8e net: add rte prefix to ether structures
Add 'rte_' prefix to structures:
- rename struct ether_addr as struct rte_ether_addr.
- rename struct ether_hdr as struct rte_ether_hdr.
- rename struct vlan_hdr as struct rte_vlan_hdr.
- rename struct vxlan_hdr as struct rte_vxlan_hdr.
- rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr.

Do not update the command line library to avoid adding a dependency to
librte_net.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
e482e0fa6a net: add rte prefix to ARP defines
Add 'RTE_' prefix to defines:
- rename ARP_HRD_ETHER as RTE_ARP_HRD_ETHER.
- rename ARP_OP_REQUEST as RTE_ARP_OP_REQUEST.
- rename ARP_OP_REPLY as RTE_ARP_OP_REPLY.
- rename ARP_OP_REVREQUEST as RTE_ARP_OP_REVREQUEST.
- rename ARP_OP_REVREPLY as RTE_ARP_OP_REVREPLY.
- rename ARP_OP_INVREQUEST as RTE_ARP_OP_INVREQUEST.
- rename ARP_OP_INVREPLY as RTE_ARP_OP_INVREPLY.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:44 +02:00
Olivier Matz
f2745bfebc net: add rte prefix to ARP structures
Also rename arp_hrd, arp_pro, arp_hln, arp_pln and arp_op fields
to avoid conflict with the #defines in gnu libc.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:44 +02:00
Haiyue Wang
df5ff0ba72 net/ice: update RSS RETA size with supported values
Since ice can support 128, 512, 2K RSS RETA size value, change the
update API to set it to resize the RSS RETA table. And by default,
use 512 to sync with ETH_RSS_RETA_SIZE_x maximum value definition.
Also the flag ICE_FLAG_RSS_AQ_CAPABLE is missed to set.

Fixes: 690175ee51 ("net/ice: support getting device information")
Fixes: ff963bfa7c ("net/ice: support RSS")
Cc: stable@dpdk.org

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2019-05-21 18:40:06 +02:00
Beilei Xing
4b748eef85 net/i40e: enable new device
This patch removes ifdef to enable new device.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-05-21 18:40:06 +02:00
Qi Zhang
9f5d2352fe net/ixgbe: fix Tx threshold setup
Tx desc's DD status is not cleaned by NIC automatically after packets
have been transmitted until software refill a new packet during next
loop. So when tx_free_thresh + tx_rs_thresh > nb_desc, it is possible
that an outdated DD status be checked as tx_next_dd, then segment fault
happen due to free a NULL mbuf pointer.

Then patch fixes this issue by
1. try to adapt tx_rs_thresh to an aggressive tx_free_thresh.
2. queue setup fail when tx_free_thresh + tx_rs_thresh > nb_desc

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2019-05-21 18:40:06 +02:00
Qi Zhang
fb69492c04 net/ice: fix Tx threshold setup
Tx desc's DD status is not cleaned by NIC automatically after packets
have been transmitted until software refill a new packet during next
loop. So when tx_free_thresh + tx_rs_thresh > nb_desc, it is possible
that an outdated DD status be checked as tx_next_dd, then segment fault
happen due to free a NULL mbuf pointer.

Then patch fixes this issue by
1. try to adapt tx_rs_thresh to an aggressive tx_free_thresh.
2. queue setup fail when tx_free_thresh + tx_rs_thresh > nb_desc

Fixes: 50370662b7 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2019-05-21 18:40:06 +02:00
Qi Zhang
1c5c7c91d3 net/i40e: fix Tx threshold setup
Tx desc's DD status is not cleaned by NIC automatically after packets
have been transmitted until software refill a new packet during next
loop. So when tx_free_thresh + tx_rs_thresh > nb_desc, it is possible
that an outdated DD status be checked as tx_next_dd, then segment fault
happen due to free a NULL mbuf pointer.

Then patch fixes this issue by
1. try to adapt tx_rs_thresh to an aggressive tx_free_thresh.
2. queue setup fail when tx_free_thresh + tx_rs_thresh > nb_desc

Fixes: 4861cde461 ("i40e: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2019-05-21 18:40:06 +02:00
Xiao Wang
1d7be86e38 net/fm10k: advertise supported RSS hash function
PMD should advertise supported RSS hash functions via
dev_info.flow_type_rss_offloads variable [1], otherwise upper level check
would fail on configuring RSS, leading to MQ RSS failure.

[1] commit aa1a6d87f1 ("ethdev: force RSS offload rules again")
Cc: stable@dpdk.org

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-05-21 18:40:06 +02:00
Yunjian Wang
03bb633aa8 net/ixgbe: fix unexpected link handler
The nic's interrupt source has some active handler, which maybe call
ixgbe_dev_link_update() to set link handler. We should cancel the
link handler before remove dev to prevent executing the link handler.
It triggers segfault.

Fixes: 0408f47ba4 ("net/ixgbe: fix busy polling while fiber link update")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
2019-05-21 18:40:06 +02:00
Qi Zhang
c352338e44 net/ice: set min and max MTU
This commit sets the min and max supported MTU values for ice devices
via the ice_dev_info_get() function. Min MTU supported is set to
ETHER_MIN_MTU and max mtu is calculated as the max packet length
supported minus the transport overhead.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2019-05-21 18:40:06 +02:00
Wei Zhao
b2319e4c01 net/i40e: forbid two RSS flow rules
Refuse to create the second RSS flow rule as only one RSS key and
HASH register for each PF port. Users should delete the first rule
before setup the second rule.

Fixes: ecad87d223 ("net/i40e: move RSS to flow API")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Wenjie Li <wenjiex.a.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-05-21 18:40:06 +02:00
Xiao Wang
f0e1ba5e95 net/fm10k: support Rx queue count API
Some application, e.g. the l3fwd-power sample uses rte_eth_rx_queue_count()
API to get the get the number of used descriptors of a Rx queue. This patch
adds fm10k implementation for this API.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-05-21 18:40:06 +02:00
Haiyue Wang
e6161345d8 net/ice: support link status change
Support link up and down functions for ice, and when stop the ice,
makes the link down also.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-05-21 18:40:06 +02:00
Viacheslav Ovsiienko
40d9f906f4 net/mlx5: fix device removal handler for multiport
IBV_EVENT_DEVICE_FATAL event is generated by the driver once for
the entire multiport Infiniband device, not for each existing ports.
The port index is zero and it causes dropping the device removal
event. We should invoke the removal event processing routine
for each port we have installed handler for.

Fixes: 028b2a28c3 ("net/mlx5: update event handler for multiport IB devices")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-05-12 13:45:57 +02:00
Ori Kam
617ecc9000 net/mlx5: fix errno for unsupported Direct Rules
When Direct Rules API is not supported we don't set the errno.
This results in failing the function but with errno equals to zero.
The result of this is that a function that failed, is considered as
a function that worked correctly.

This commit fixes this issue by setting the errno to ENOTSUP and
returning this error when error value should be returned.

Since RDMA-CORE are returning positive errno we are also returning
positive error values.

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

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-05-08 17:29:31 +02:00
Dekel Peled
10cfa5f2d4 net/mlx5: fix release of Rx queue object
Function mlx5_rx_intr_disable() calls mlx5_rxq_ibv_get() and performs
some actions on the returned rxq_ibv.
It doesn't release the rxq_ibv when all is completed with success.

This patch adds call to mlx5_rxq_ibv_release() where it's missing.

Fixes: 09cb5b5817 ("net/mlx5: separate DPDK from verbs Rx queue objects")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-05-08 17:29:31 +02:00
Yongseok Koh
4594487b78 net/mlx5: fix Multi-Packet RQ mempool name
Currently, the name of MPRQ mempool is set by
	snprintf(name, sizeof(name), "%s-mprq", dev->device->name);
For port representor, the name is duplicate of its master and failed to
create such a mempool having the same name. Port ID is used in the name
instead.

Fixes: 7d6bf6b866 ("net/mlx5: add Multi-Packet Rx support")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-05-08 17:29:31 +02:00
Dekel Peled
09ba4c58e5 net/mlx5: fix init with zero Rx queue
Recent patch [1] added, at the end of mlx5_dev_configure(), a call to
mlx5_proc_priv_init(), initializing process_private data of eth_dev.
This call is not reached if PMD is started with zero Rx queues.
In this case mlx5_dev_configure() returns earlier due to the check:
	if (rxqs_n == priv->rxqs_n)
		return 0;
In such a scenario, later references to uninitialized process_private
data will result in segmentation fault.
For example see in function txq_uar_init().

This patch changes the check logic. The following code is executed
if (rxqs_n != priv->rxqs_n), and skipped otherwise.
Function mlx5_proc_priv_init() is always invoked, to ensure
process_private data is initialized.

[1] http://patches.dpdk.org/patch/52629/

Fixes: 120dc4a7dc ("net/mlx5: remove device register remap")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2019-05-08 17:29:31 +02:00
Qi Zhang
c387effde8 net/iavf: enable more link speed
Enable advanced link speed mode (VIRTCHNL_VF_CAP_ADV_LINK_SPEED) so iavf
PMD can identify more link speed that reported by pf.

Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
2019-05-07 12:01:56 +02:00
Rosen Xu
18daca5ecc net/i40e: add device id for X710/XXV710 of ipn3ke
New PCI device ids are created to support X710/XXV710 of Intel FPGA
Programmable Acceleration card N3000, also called ipn3ke.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-05-07 12:01:49 +02:00
Xiao Wang
4e968cacb8 net/ice: fix EEPROM range check
The last word should not cross shadow RAM boundary.

Fixes: 68a1ab82ad ("net/ice: speed up to retrieve EEPROM")
Cc: stable@dpdk.org

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-05-07 12:00:31 +02:00
Xiao Wang
8df10eb60f net/ice: clean up minor issues
This patch is a cleanup on comment, variable modifier, coding style.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2019-05-07 12:00:31 +02:00
Stephen Hemminger
8428da7285 net/netvsc: free all queues on close
When dev_close is called, the netvsc driver will clean up all
queues including the primary ring buffer.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2019-05-03 18:45:23 +02:00
Stephen Hemminger
05bfd4b491 net/netvsc: reset mbuf port on VF Rx
Redo the receive logic to set m->port on packets received on VF.

When using VF, still need to check for packets and completions
arriving on the VMBus path even if application is not doing bursting
(ie n_rx == 0).

Also, fix comment.

Fixes: dc7680e859 ("net/netvsc: support integrated VF")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2019-05-03 18:45:23 +02:00
Mark Gillott
273168f150 net/vmxnet3: add VLAN filter capability
The driver supports VLAN filtering, but the option is not included in
the advertised list of capabilities. Thus any attempt to enable VLAN
filtering always fails. Update the list of offload capabilities to
include DEV_RX_OFFLOAD_VLAN_FILTER.

Fixes: 95e4a96ccb ("net/vmxnet3: convert to new Rx offload API")
Cc: stable@dpdk.org

Signed-off-by: Mark Gillott <mgillott@vyatta.att-mail.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2019-05-03 18:45:23 +02:00
Herakliusz Lipiec
9ad43ad8fb net/tap: fix potential IPC buffer overrun
When secondary to primary process synchronization occurs
there is no check for number of fds which could cause buffer overrun.

Bugzilla ID: 252
Fixes: c9aa56edec ("net/tap: access primary process queues from secondary")
Cc: stable@dpdk.org

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-03 18:45:23 +02:00
Ori Kam
d1e64fbf63 net/mlx5: fix Direct Rules API
The RDMA-CORE Direct Rules API was changed in latest upstream code

This commit update the API accordingly.

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

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2019-05-03 18:45:23 +02:00