Commit Graph

11536 Commits

Author SHA1 Message Date
Moti Haimovsky
709676bc9c net/failsafe: add Rx interrupts
This patch is the last patch in the series of patches aimed
to add support for registering and waiting for Rx interrupts
in failsafe PMD. This allows applications to wait for Rx events
from the PMD using the DPDK rte_epoll subsystem.
The failsafe PMD presents to the application a facade of a single
device to be handled by the application while internally it manages
several devices on behalf of the application including packets
transmission and reception.
The Proposed failsafe Rx interrupt scheme follows this approach.
The failsafe PMD will present the application with a single set of
Rx interrupt vectors representing the failsafe Rx queues, while
internally it will serve as an interrupt proxy for its subdevices.
will allow applications to wait for Rx traffic from the failsafe
PMD by registering and waiting for Rx events from its Rx queues.
In order to support this the following is suggested:
  * Every Rx queue in the failsafe (virtual) device will be assigned
  * a Linux event file descriptor (efd) and an enable_interrupts flag.
  * The failsafe PMD will fill in its rte_intr_handle structure with
    the Rx efds assigned previously and register them with the EAL.
  * The failsafe driver will create a private epoll fd (epfd) and
  * will allocate enough space to handle all the Rx events from all its
    subdevices.
  * Acting as an application,
    for each Rx queue in each active subdevice the failsafe will:
      o Register the Rx queue with the EAL.
      o Pass the EAL the failsafe private epoll fd as the epfd to
        register the Rx queue event on.
      o Pass the EAL, as a parameter, the pointer to the failsafe Rx
        queue that handles this Rx queue.
      o Using the DPDK service callbacks, the failsafe PMD will launch
        an Rx proxy service that will Wait on the epoll fd for Rx
        events from the sub-devices.
      o For each Rx event received the proxy service will
          - Retrieve the pointer to failsafe Rx queue that handles
            this subdevice Rx queue from the user info returned by the
            EAL.
          - Trigger a failsafe Rx event on that queue by writing to
            the event fd unless interrupts are disabled for that queue.
  * The failsafe pmd will also implement the rx_queue_intr_enable
  * and rx_queue_intr_disable routines that will enable and disable Rx
    interrupts respectively on both on the failsafe and its subdevices.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-01-29 10:04:28 +01:00
Moti Haimovsky
f234e5bd99 net/failsafe: register slaves Rx interrupts
This commit adds the following functionality to failsafe PMD:
* Register and unregister slaves Rx interrupts.
* Enable and Disable slaves Rx interrupts.
The interrupts events generated by the slaves are not handled in this
commit.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-01-29 10:04:28 +01:00
Moti Haimovsky
9e0360aebf net/failsafe: register as Rx interrupt mode
This patch adds registering the Rx queues of the failsafe PMD with EAL
Rx interrupts subsystem.
Each failsafe RX queue is assigned with a unique eventfd and an enable
interrupts flag.
The PMD creates an interrupt vector containing the above eventfds and
Registers it with  EAL. The PMD also implements the Rx interrupts enable
and disable interface routines.
This patch does not implement the generation of Rx interrupts, so an
application can now wait for failsafe Rx interrupts but it will not
receive one.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-01-29 10:04:28 +01:00
Tomasz Duszynski
532af7700b doc: update MUSDK library build instructions
By default both static and shared libraries should be created while
building MUSDK library. It turns out that this will not happen if
host parameter is not explicitly passed to the configure script.

Specifying host makes sure configure will detect support for shared
libraries.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
2018-01-29 10:04:28 +01:00
Natalie Samsonov
ac6881ea6b net/mrvl: fix mbuf to bpool lookup
Since in DPDK 17.11 port type was changed from uint8_t to uint16_t
the MBUF_INVALID_PORT value became 0xffff but in mrvl_tx_pkt_burst()
when trying to lookup bpool using mbuf port, we check if the port
is invalid according to value 0xff. This causes segmentation fault.

Solution: since the valid port value cannot exceed RTE_MAX_ETHPORTS
(size of bpool lookup table) any other values consider as invalid so
the packet should be returned to DPDK pool.

Fixes: afb4d0d0bf ("net/mrvl: add Rx/Tx support")
Cc: stable@dpdk.org

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
2018-01-29 10:04:28 +01:00
Ajit Khaparde
dbcabb69e2 net/bnxt: fix number of pools for RSS
While using RSS, the pool count should be 1.

Fixes: 8103a57ab4 ("net/bnxt: handle Rx multi queue creation properly")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-29 10:04:28 +01:00
Ajit Khaparde
90ed2b7229 net/bnxt: add 100G speed detection
When the driver is loaded on a 100G NIC, the port speed is not
displayed correctly. Parse the 100G speed before displaying it.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-29 10:04:28 +01: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
Ajit Khaparde
be160484a4 net/bnxt: check if MAC address is all zeros
In certain cases the MAC address of a port could be all zeros.
Catch it early, log a message and fail the initialization.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-29 10:04:28 +01:00
Ajit Khaparde
12213821a8 net/bnxt: register for more async events
Register for async events from the FW.
New events we are registering for include Link speed config changes,
PF driver unload and VF config change. Also log a message when the
async event arrives on the completion ring.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-29 10:04:28 +01:00
Ajit Khaparde
3e92fd4e4e net/bnxt: use dynamic log type
This patch implements driver specific log type doing away with
usage of RTE_LOG() for logging.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-29 10:04:28 +01:00
Ajit Khaparde
c771d289cb net/bnxt: fix size of Tx ring in HW
During Tx ring allocation, the actual ring size configured in the HW
ends up being twice the number of txd parameter specified to the driver.
The power of 2 ring size wrongly adds a +1 while sending the ring
create command to the FW.

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

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-29 10:04:28 +01:00
Wenzhuo Lu
61c1f1b791 net/e1000: fix VF Rx interrupt enabling
When using UIO, after enabling the interrupt to get the PF
message, VF RX queue interrupt is not working.
It's expected, as UIO doesn't support multiple interrupt.
So, PMD should not try to enable RX queue interrupt. Then
APP can know the RX queue interrupt is not enabled and only
choose the polling mode.

Fixes: 316f4f1adc ("net/igb: support VF mailbox interrupt for link up/down")
CC: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-29 10:04:28 +01:00
Wenzhuo Lu
8d1f13f96c net/ixgbe: fix VF Rx interrupt enabling
When using UIO, after enabling the interrupt to get the PF
message, VF RX queue interrupt is not working.
It's expected, as UIO doesn't support multiple interrupt.
So, PMD should not try to enable RX queue interrupt. Then
APP can know the RX queue interrupt is not enabled and only
choose the polling mode.

Fixes: 77234603fb ("net/ixgbe: support VF mailbox interrupt for link up/down")
CC: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-29 10:04:28 +01:00
Wenzhuo Lu
4ae1d081fb net/i40e: fix VF Rx interrupt enabling
When using UIO, after enabling the interrupt to get the PF
message, VF RX queue interrupt is not working.
It's expected, as UIO doesn't support multiple interrupt.
So, PMD should not try to enable RX queue interrupt. Then
APP can know the RX queue interrupt is not enabled and only
choose the polling mode.

Fixes: ae19955e7c ("i40evf: support reporting PF reset")
CC: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-29 10:04:28 +01:00
Wenzhuo Lu
492180e03a net/avf: fix VF Rx interrupt enabling
As UIO doesn't support multiple interrupt, and the interrupt
is occupied by the control plane. PMD should not try to enable
RX queue interrupt. Then APP can know the RX queue interrupt
is not enabled and only choose the polling mode.

Fixes: d6bde6b5ea ("net/avf: enable Rx interrupt")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-29 10:04:28 +01:00
Olivier Matz
727411f50a net/virtio: fix typo in function name
Fixes: c1f86306a0 ("virtio: add new driver")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-29 10:04:28 +01:00
Olivier Matz
bdb32afbb6 net/virtio: rationalize queue flushing
Use the same kind of loop than in virtio_free_queues() and factorize
common code.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-29 10:04:28 +01:00
Olivier Matz
3669a1af89 net/virtio: fix memory leak when reinitializing device
Free the previous queues and the attached mbufs before initializing new
ones.

The function virtio_dev_free_mbufs() is now called when reconfiguring the
device, so we also need to add a check to ensure that it won't crash for
uninitialized queues.

Cc: stable@dpdk.org
Fixes: 60e6f4707e ("net/virtio: reinitialize device when configuring")

Signed-off-by: Zijie Pan <zijie.pan@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-29 10:04:28 +01:00
Olivier Matz
e67ae1e27e net/virtio: fix queue flushing with vector Rx enabled
When using vector Rx mode (use_simple_rx = 1), vq->vq_descx[] is not
kept up to date. To properly detach the mbufs in this case, browse
sw_ring[] instead, as it's done in virtqueue_rxvq_flush().

Since we need virtio_get_queue_type(), also move this function in
virtqueue.h as a static inline.

Fixes: fc3d66212f ("virtio: add vector Rx")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-29 10:04:28 +01:00
Samuel Gauthier
8f3d451dff net/virtio: fix Rx and Tx handler selection for ARM32
On arm32, we were always selecting the simple handler, but it is only
available if neon is present.

This is due to a typo in the name of the config option.
CONFIG_RTE_ARCH_ARM is for Makefiles. One should use RTE_ARCH_ARM.

Fixes: 2d7c37194e ("net/virtio: add NEON based Rx handler")
Cc: stable@dpdk.org

Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-29 10:04:28 +01:00
Jianfeng Tan
0d6a8752ac net/virtio-user: fix crash as features change
Since commit 59fe5e17d9 ("vhost: propagate set features handling error"),
vhost does not allow to set different features without reset.

The virtio-user driver fails to reset the device in below commit.

To fix, we send the reset message as stopping the device.

Fixes: c12a26ee20 ("net/virtio-user: fix not properly reset device")
Cc: stable@dpdk.org

Reported-by: Lei Yao <lei.a.yao@intel.com>
Reported-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-29 10:04:28 +01:00
Zhihong Wang
5a8bb6e902 vhost: claim to support any layout feature
The VIRTIO_F_ANY_LAYOUT feature indicates the device accepts arbitrary
descriptor layouts. The vhost-user lib already supports it, but the
feature declaration is missing. This patch fixes the mismatch.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-29 10:04:28 +01:00
Rafal Kozik
fd61779567 net/ena: do not set Tx L4 offloads in Rx path
Information about received packet type detected by NIC should be
stored in packet_type field of rte_mbuf. TX L4 offload flags should
not be set in RX path. Only fields that could be set in of_flags
during packet receiving are information if L4 and L3 checksum is
correct.

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

Reported-by: Matthew Smith <mgsmith@netgate.com>
Signed-off-by: Rafal Kozik <rk@semihalf.com>
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2018-01-29 10:04:28 +01:00
Xueming Li
4a98415343 net/mlx5: map UAR address around huge pages
Reserving the memory space for the UAR near huge pages helps to
**reduce** the cases where the secondary process cannot start. Those
pages being physical pages they must be mapped at the same virtual
address as in the primary process to have a
working secondary process.

As this remap is almost the latest being done by the processes
(libraries, heaps, stacks are already loaded), similar to huge pages,
there is **no guarantee** this mechanism will always work.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-29 10:04:28 +01:00
Shahaf Shuler
25f28d9d29 net/mlx5: fix memory region boundary checks
Since commit f81ec74843 ("net/mlx5: fix memory region lookup") the
Memory Region (MR) are no longer overlaps.

Comparing the end address of the MR should be exclusive, otherwise two
contiguous MRs may cause wrong matching.

Fixes: f81ec74843 ("net/mlx5: fix memory region lookup")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-29 10:04:28 +01:00
Shahaf Shuler
627cbfad1c net/mlx5: fix memory region cache last index
In case Memory Region cache is full, the new mempool will be
inserted in the last index of the array.

Update the last entry being hit to reflect it.

Fixes: b0b0938457 ("net/mlx5: use buffer address for LKEY search")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-29 10:04:28 +01:00
Shahaf Shuler
bb6883120a net/mlx5: warn for unsuccessful memory registration
Memory registration can fail, add the proper warning for such scenario
for it at least to be visible in debug mode.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-29 10:04:28 +01:00
Shahaf Shuler
1b2a3baaed net/mlx5: remove assert un-accessible from secondary process
Verbs structs such as ibv_mr are not accessible from the secondary
process.

Choose to remove the assert in favor of performing more checks on the
critical data path.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-29 10:04:28 +01:00
Shahaf Shuler
a482a41a63 net/mlx5: fix secondary process mempool registration
Secondary process is not allowed to register mempools on the flight.

The code will return invalid memory key for such case.

Fixes: 87ec44ce16 ("net/mlx5: add operations for secondary process")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-29 10:04:28 +01:00
Shahaf Shuler
95086c6543 net/mlx5: fix memory region cache lookup
The Memory Region (MR) cache contains pointers to mlx5_mr.
The MR cache indexes are filled when a new MR is created. As it is
possible for MR to be created on the flight, an extra validation must be
added to avoid segmentation fault.

Fixes: b0b0938457 ("net/mlx5: use buffer address for LKEY search")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-29 10:04:28 +01:00
Shahaf Shuler
e313ef4c2f net/mlx5: fix link state on device start
Following commit c7bf62255e ("net/mlx5: fix handling link status event")
the link state must be up in order for the burst function to be set on
the device ops.

As the link may take time to move between down and up state it is
possible the rte_eth_dev_start call will return with wrong burst
function (either null or the empty burst function).

Fixing it by forcing the link to be up before returning from device
start. In case the link is still not up after 5 seconds fail the function.
In addition initialize the burst function on device probe to prevent
crashes before the link is up.

Fixes: c7bf62255e ("net/mlx5: fix handling link status event")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-29 10:04:28 +01:00
Nélio Laranjeiro
5a29b9a35a net/mlx5: fix reception of multiple MAC addresses
When promiscuous is disabled, adding/removing a mac address is ignored
causing the packet to not be received or still being received corresponding
to the add or remove request.

Fixes: 272733b5eb ("net/mlx5: use flow to enable unicast traffic")
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-01-29 10:04:28 +01:00
Nélio Laranjeiro
c1236ad707 net/mlx5: use RSS table max size from config
Maximum indirection table size has not been updated accordingly.

Fixes: 7fe24446e9 ("net/mlx5: add device configuration structure")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
2018-01-29 10:04:28 +01:00
Nélio Laranjeiro
0fb2c9842b net/mlx5: support IPv4 time-to-live filter
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-01-29 10:04:28 +01:00
Nélio Laranjeiro
537e168450 net/mlx5: fix flow item validation
Two masks were compared instead of verifying the spec was included in the
supported mask.

Fixes: 2097d0d1e2 ("net/mlx5: support basic flow items and actions")
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-01-29 10:04:28 +01:00
Nélio Laranjeiro
d10f422fd5 net/mlx5: fix flow director conversion
Flow director must provide the same spec and mask to be sure to be
validated.

Fixes: 4c3e9bcdd5 ("net/mlx5: support flow director")
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-01-29 10:04:28 +01:00
Shahaf Shuler
b233b02749 net/mlx5: fix missing RSS capability
The PMD was not reporting the supported RSS capabilities.

Fixes: 2f97422e77 ("mlx5: support RSS hash update and get")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-01-29 10:04:28 +01:00
Yuanhan Liu
ad831a1176 net/mlx5: use PCI address as port name
It is suggested to use PCI BDF to identify a port for port addition
in OVS-DPDK. While mlx5 has its own naming style: name it by ib dev
name. This breaks the typical OVS DPDK use case and brings more puzzle
to the end users.

To fix it, this patch changes it to use PCI BDF as the name, too.
Also, a postfix " port %u" is added, just in case their might be more
than 1 port associated with a PCI device.

Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-29 10:04:28 +01:00
Qi Zhang
94e31ad3e5 net/i40e: fix RSS flow action parser
Parameter action_flag is not used correctly in i40e_flow_parse_rss_action.
Also change it from point type to value type since it is not an output
parameter.

Fixes: ecad87d223 ("net/i40e: move RSS to flow API")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Zhiyong Yang <zhiyong.yang@intel.com>
2018-01-29 10:04:28 +01:00
Yong Wang
b4502b43f0 net/i40e: fix memory leak
There are several func calls to rte_zmalloc() which don't have null
pointer check on the return value. And before return, the memory
is not freed. It fixes by adding null pointer check and rte_free().

Fixes: 078259773d ("net/i40e: store ethertype filter")
Fixes: 425c3325f0 ("net/i40e: store tunnel filter")
Fixes: c50474f31e ("net/i40e: support tunnel filter to VF")
Fixes: 5c53c82c81 ("net/i40e: store flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-29 10:04:28 +01:00
Yong Wang
516e525ebf net/e1000: fix null pointer check
There are several func calls to rte_zmalloc() which don't have null
pointer check for the return value. It fixes that by adding null
pointer check.

Fixes: 22bb13410c ("net/igb: create consistent filter")
Cc: stable@dpdk.org

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2018-01-29 10:04:28 +01:00
Zhiyong Yang
8cc99ad1db net/i40e: remove unnecessary explicit type casting
Remove some unnecessary explicit type casting, to clean the code.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-01-29 10:04:28 +01:00
Zhiyong Yang
6014215a8c examples/flow_filtering: fix port id size
Ethdev port id has been extended 16bits from 8bits in DPDK 17.11 release,
the patch fixes mismatch use.

Fixes: 4a3ef59a10 ("examples/flow_filtering: add simple demo of flow API")
Cc: stable@dpdk.org

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-01-29 10:04:28 +01:00
Radu Nicolau
ffe353bd2c net/bonding: check dequeue result before proceeding
Coverity issue: 257015
Fixes: 09150784a7 ("net/bonding: burst mode hash calculation")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
2018-01-29 10:04:28 +01:00
Radu Nicolau
1e4a3cf6fa net/bonding: add MAC set operation
Fixes: aa7791ba8d ("net/bonding: fix setting slave MAC addresses")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
2018-01-29 10:04:28 +01:00
Chas Williams
b61d834002 net/bonding: do not early mark device as bonded
bonding immediately marks the incoming eth device as bonded and doesn't
clear this in later error paths.  Delay marking the dev until we are
certain that we are going to add this eth device to the bond group.

Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2018-01-29 10:04:28 +01:00
Matan Azrad
745b72dab9 net/failsafe: fix Rx burst infinite loop
In case of plugged out device, the fail-safe PMD uses failsafe_rx_burst
function for packet receiving.

This function iterates over the present sub-devices until it
receives a traffic from one of them or they are all cannot receive
packets.

The corrupted code didn't advance the sub-device pointer when the
sub-device was not present and caused to infinite loop.

Advance the sub-device pointer also in plugged-out sub-device case.

Fixes: 8052bbd9d5 ("net/failsafe: improve Rx sub-devices iteration")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-01-29 10:04:28 +01:00
Hyong Youb Kim
d26ddeaf11 net/enic: set L4 checksum flags for IPv6 packets
enic_cq_rx_to_pkt_flags() currently sets checksum good/bad flags only
for IPv4.  The hardware actually validates the TCP/UDP checksum of
IPv6 packets too. Set PKT_RX_L4_CKSUM_{GOOD,BAD} accordingly.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-01-29 10:04:28 +01:00
Hyong Youb Kim
1e81dbb532 net/enic: add Tx prepare handler
Like most NICs, this hardware (Cisco VIC) also requires partial
checksum in the packet for checksum offload and TSO. So, add
the tx_pkt_prepare handler like other PMDs do.

Technically, VIC has an offload mode that does not require partial
checksum for non-TSO packets. But, it has no such mode for TSO
packets, making tx_pkt_prepare unavoidable.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2018-01-29 10:04:28 +01:00