Commit Graph

11032 Commits

Author SHA1 Message Date
Pavan Nikhilesh
7d6321de8d mempool/octeontx: implement dynamic logging
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Pavan Nikhilesh
4d35a276c1 net/octeontx: implement dynamic logging
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Pavan Nikhilesh
c563443c64 net/thunderx: implement dynamic logging
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Stephen Hemminger
70e28c612d net/liquidio: implement dynamic logging
This driver mostly uses the common pattern. Convert this to the
dynamic logging.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Stephen Hemminger
69b6573980 net/qede: implement dynamic logging
This driver is mostly like others with slightly different logging
macros. The semantics were retained, with some minor reformatting.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Stephen Hemminger
8bc0acae97 net/ena: implement dynamic logging
Use dynamic rather static configuration for logging.
Also include ena_assert_msg.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Stephen Hemminger
1ad18ef8bf net/fm10k: implement dynamic logging
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Stephen Hemminger
c73f9b2662 net/nfp: implement dynamic logging
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

---
v2: remove unsed macro RTE_LIBRTE_NFP_NET_DEBUG_INIT
2018-01-16 18:47:49 +01:00
Stephen Hemminger
0062818856 net/virtio: implement dynamic logging
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2018-01-16 18:47:49 +01:00
Stephen Hemminger
ed5bbb767c net/e1000: implement dynamic logging
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Stephen Hemminger
174dae95c9 net/ixgbe: implement dynamic logging
Convert all drivers possible to dynamic logging.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Stephen Hemminger
79daffdcb6 net/vmxnet3: implement dynamic logging
Replace compile time configuration with runtime.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Stephen Hemminger
4f3419a602 net/bnx2x: implement dynamic logging
Replace compile time option for init and driver log with
dynamic value.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

---
v2: remove remaining RTE_LIBRTE_BNX2X_DEBUG usage
2018-01-16 18:47:49 +01:00
Stephen Hemminger
e6b790c065 net/avp: implement dynamic logging
All PMD should be using dynamic log levels.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-16 18:47:49 +01:00
Radu Nicolau
c5cf2a0429 net/tap: renamed netlink functions
Functions like nl_recev and nl_send name clash functions in the
libnl library (https://www.infradead.org/~tgr/libnl/).
All functions declared in tap_netlink.h were decorated with tap_
for consistency.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-01-16 18:47:49 +01:00
Pavan Nikhilesh
5452a17d3c net/octeontx: advertise supported mbuf pool ops
Advertise mempool/octeontx as the only supported mempool ops when the
application checks using `rte_eth_dev_pool_ops_supported`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-01-16 18:47:49 +01:00
Elza Mathew
4773152f85 ethdev: optimize xstats by ids APIs
Introduced a check to detect if the stats IDs being
requested are all basic stats IDs. In that case,
ensured that only the basic stats would be retrieved.

Previously, both basic stats and xstats were being
retrieved even if all the IDs were basic stats IDs.

Signed-off-by: Elza Mathew <elza.mathew@intel.com>
Reviewed-by: Lee Daly <lee.daly@intel.com>
2018-01-16 18:47:49 +01:00
Elza Mathew
185e538146 ethdev: refactor basic stats code
Moved the code to get the basic stats names and values
into static functions.

Signed-off-by: Elza Mathew <elza.mathew@intel.com>
Reviewed-by: Lee Daly <lee.daly@intel.com>
2018-01-16 18:47:49 +01:00
Maxime Coquelin
e291093235 vhost: destroy unused virtqueues when multiqueue not negotiated
QEMU sends VHOST_USER_SET_VRING_CALL requests for all queues
declared in QEMU command line before the guest is started.
It has the effect in DPDK vhost-user backend to allocate vrings
for all queues declared by QEMU.

If the first driver being used does not support multiqueue,
the device never changes to VIRTIO_DEV_RUNNING state as only
the first queue pair is initialized. One driver impacted by
this bug is virtio-net's iPXE driver which does not support
VIRTIO_NET_F_MQ feature.

It is safe to destroy unused virtqueues in SET_FEATURES request
handler, as it is ensured the device is not in running state
at this stage, so virtqueues aren't being processed.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Maxime Coquelin
467fe22df9 vhost: extract virtqueue cleaning and freeing functions
This patch extracts needed code for vhost_user.c to be able
to clean and free virtqueues unitary.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Maxime Coquelin
59fe5e17d9 vhost: propagate set features handling error
Not propagating VHOST_USER_SET_FEATURES request handling
error may result in unpredictable behavior, as host and
guests features may no more be synchronized.

This patch fixes this by reporting the error to the upper
layer, which would result in the device being destroyed
and the connection with the master to be closed.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Maxime Coquelin
07f8db29b8 vhost: prevent features to be changed while device is running
As section 2.2 of the Virtio spec states about features
negotiation:
"During device initialization, the driver reads this and tells
the device the subset that it accepts. The only way to
renegotiate is to reset the device."

This patch implements a check to prevent illegal features change
while the device is running.

One exception is the VHOST_F_LOG_ALL feature bit, which is enabled
when live-migration is initiated. But this feature is not negotiated
with the Virtio driver, but directly with the Vhost master.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Jiayu Hu
6d18505efa vhost: support UDP Fragmentation Offload
In virtio, UDP Fragmentation Offload (UFO) includes two parts: host UFO
and guest UFO. Guest UFO means the frontend can receive large UDP
packets, and host UFO means the backend can receive large UDP packets.
This patch supports host UFO and guest UFO for vhost-user.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Junjie Chen
a3fdb53270 examples/vhost: fix sending ARP packet to self
ARP packets are not dropped when dest vdev is itself, which breaks
RX ring inconspicuously.

Fixes: 9c5ef51207 ("examples/vhost: handle broadcast packet")
Cc: stable@dpdk.org

Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Stefan Hajnoczi
6c299bb732 vhost: introduce vring call API
Users of librte_vhost currently implement the vring call operation
themselves.  Each caller performs the operation slightly differently.

This patch introduces a new librte_vhost API called
rte_vhost_vring_call() that performs the operation so that vhost-user
applications don't have to duplicate it.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Stefan Hajnoczi
413a8fee30 vhost: add vring call helper
Extract the callfd eventfd signal operation so virtio_net.c does not
have to repeat it multiple times.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Tiwei Bie
5b56d18d3b net/virtio: remove redundant macro definitions for vector Rx
RTE_VIRTIO_VPMD_RX_BURST and RTE_VIRTIO_VPMD_RX_REARM_THRESH
have been defined and used in virtio_rxtx_simple.h, but are
defined again in virtio_rxtx_simple_*.c. It just happens to
work. So remove the redundant definitions from the *.c files.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Tiwei Bie
8786702e2d net/virtio: remove a redundant macro definition for ctrl vq
VIRTIO_NET_CTRL_MAC_ADDR_SET is defined two times in
virtqueue.h, the second one is obviously not wanted.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Tiwei Bie
b628cb2429 net/virtio: fix typo in LRO support
Fixes: 86d59b2146 ("net/virtio: support LRO")
Fixes: ec9f3d122a ("net/virtio: revert not claiming LRO support")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Tiwei Bie
bcf55c9302 net/virtio: fix vector Rx flushing
The vector Rx will be broken if backend has consumed all
the descs in the avail ring before the device is started.
Because in current implementation, vector Rx will return
immediately without refilling the avail ring if the used
ring is empty. So we have to refill the avail ring after
flushing the elements in the used ring for vector Rx.

Besides, vector Rx has a different ring layout assumption
and mbuf management. So we need to handle it differently.

Fixes: d8227497ec ("net/virtio: flush Rx queues on start")
Cc: stable@dpdk.org

Reported-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Didier Pallard
43ec842ca4 net/virtio: fix incorrect cast
The rx_queues and tx_queues fields of the data structure points to a
struct virtnet_rx or virtnet_tx. Casting it to a virtqueue is an error.

It does not trigger any bug because pointer is not dereferenced inside
the function, but it can become a bug if this code is copy/pasted and
vq is dereferenced.

Fixes: 01ad44fd37 ("net/virtio: split Rx/Tx queue")
Cc: stable@dpdk.org

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Jiayu Hu
ee1bc7d0dc vhost: support Generic Segmentation Offload
In virtio, Generic Segmentation Offload (GSO) is the feature for the
backend, which means the backend can receive packets with any GSO
type.

Virtio-net enables the GSO feature by default, and vhost-net supports it.
To make live migration from vhost-net to vhost-user possible, this patch
enables GSO for vhost-user.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Zhiyong Yang
67090011f4 net/virtio: remove unnecessary macro definitions
DPDK has already the definition of Ethernet numeric link speeds in Mbps
in the file Rte_ethdev.h, it is unnecessary to rededine virtio specific
link speeds macros again.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Junjie Chen
803aeecef1 vhost: fix dequeue zero copy with virtio1
This fix dequeue zero copy can not work with Qemu
version >= 2.7. Since from Qemu 2.7 virtio device
use virtio-1 protocol, the zero copy code path
forget to add offset to buffer address.

Fixes: b0a985d1f3 ("vhost: add dequeue zero copy")
Cc: stable@dpdk.org

Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Jianfeng Tan
cab278dee9 vhost: fix crash
In a running VM, operations (like device attach/detach) will
trigger the QEMU to resend set_mem_table to vhost-user backend.

DPDK vhost-user handles this message rudely by unmap all existing
regions and map new ones. This might lead to segfault if there
is pmd thread just trying to touch those unmapped memory regions.

But for most cases, except VM memory hotplug, QEMU still sends the
set_mem_table message even the memory regions are not changed as
QEMU vhost-user filters out those not backed by file (fd > 0).

To fix this case, we add a check in the handler to see if the
memory regions are really changed; if not, we just keep old memory
regions.

Fixes: 8f972312b8 ("vhost: support vhost-user")
CC: stable@dpdk.org

Reported-by: Yang Zhang <zy107165@alibaba-inc.com>
Reported-by: Xin Long <longxin.xl@alibaba-inc.com>
Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
Olivier Matz
b8a0cebdda net/i40e: fix setting of MAC address on i40evf
When setting the MAC address, the ethdev layer copies the new mac
address in dev->data->mac_addrs[0] before calling the dev_ops.

Therefore, "is_same_ether_addr(mac_addr, dev->data->mac_addrs)" was
always true, and the MAC was never set. Remove this test to fix the
issue.

Fixes: 943c2d899a ("net/i40e: set VF MAC from VF")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-16 18:47:49 +01:00
Wei Zhao
feca6c428a examples/flow_filtering: add Tx queues setup process
This example does not have the process to set up the Tx queues,
which is required by Intel NICs. So this patch adds that Tx setup
to the application.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
2018-01-16 18:47:49 +01:00
Wei Zhao
0ecc6d6c66 net/i40e: add FDIR NVGRE parameter check
Add mask parameter check to nvgre parser for flow API.

Fixes: 30965ca341 ("net/i40e: add NVGRE flow parsing")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-01-16 18:47:49 +01:00
Wei Zhao
aa29195927 net/ixgbe: fix tunnel filter fail problem
Add a mode type check for tunnel mode, if FDIR is in this mode,
it does not need to do sanity check for x550.

Fixes: a2ba854ec6 ("net/ixgbe: fix MAC VLAN filter fail problem")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2018-01-16 18:47:49 +01:00
Radu Nicolau
198e0ce485 net/ixgbe: remove ipsec keys from private data
All ipsec related settings are being held in the driver
private data to allow easy add and remove of SAS. There
is no need to keep a record of the keys, and also
storing the keys can be a security issue.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2018-01-16 18:47:49 +01:00
Yanglong Wu
3a838ab649 net/i40e: support MAC loopback
According to loopback mode, setup loopback link or not.
If loopback link is set, packets transmitted will be
looped back to received side directly.

Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-16 18:47:49 +01:00
Beilei Xing
024c72a8f3 net/i40e: enable VF Tx offload
Enable VF Tx offload including outer ip checksum,
TSO and tunnel TSO.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-01-16 18:47:49 +01:00
Beilei Xing
11556c915a net/i40e: improve packet type parser
Add support for PPPoE and L2TP packet types parser.
Change parser as new metadata 'OIPV4' and 'OIPV6'
added in profile to distinguish outer IP and inner
IP.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-01-16 18:47:49 +01:00
Beilei Xing
108b6a28e8 mbuf: add PPPoE and L2TP packet types
Add support of PPPoE and L2TP packet types.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-01-16 18:47:49 +01:00
Wei Zhao
46ea969177 net/ixgbe: add ntuple support to flow parser
ixgbe ntuple filter in rte_flow needs to support diversion data
with less than 5 tuple parameters. So it adds this new support
in parser code. This patch also adds parsering vlan pattern code
in ntuple filter in order to handle some cases like vlan in flow
API.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2018-01-16 18:47:49 +01:00
Beilei Xing
fade5c8743 net/i40e: fix FDIR input set conflict
The first FDIR rule for some PCTYPE will configure input set and
create flow, the following flows must use the same input set,
otherwise it will cause input set conflict and fail to create flow.
If it creates the first rule after flow flush, input set should be
re-configured.

Fixes: 42044b69c6 ("net/i40e: support input set selection for FDIR")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-01-16 18:47:49 +01:00
Beilei Xing
54f19c9c3b net/i40e: fix VLAN offload setting issue
When using kernel PF + DPDK VF, if setting VLAN strip on
or off in VF side after setting PVID for VF with ethtool in
PF side, it will cause VF Tx error. The root cause is that
Rx VLAN offload is not permitted after setting PVID for VF
in kernel PF side.
This patch fixes the issue by check VLAN offload capability
when setting VLAN offload.

Fixes: 5f0b95d59a ("net/i40e: support VLAN stripping for VF")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2018-01-16 18:47:49 +01:00
Rami Rosen
a634522fc7 net/i40e: remove forward declaration
This trivial patch removes unnecessary forward declaration
of i40e_xmit_pkts_simple() in i40e_rxtx.c.

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2018-01-16 18:47:49 +01:00
Yangchao Zhou
3b7eb565e5 net/fm10k: remove RSS restriction with num of queues
FM10K HW does not have such restrictions.

Enabling RSS with single queue is not used to distribute flow, but
it can be used to compute a RSS hash value. It can reduce CPU
cycles of computing a hash value with five tuples. In addition,
there is an explicit method to disable RSS instead of an obscure
way.

Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2018-01-16 18:47:49 +01:00
Yangchao Zhou
e761a104d2 net/igb: fix Tx queue number assignment
Internal variable containing the number of TX queues for a device,
was being incorrectly assigned the number of RX queues, instead of TX.

Fixes: 27b609cbd1 ("ethdev: move the multi-queue mode check to specific drivers")
Cc: stable@dpdk.org

Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
Acked-by: Wei Dai <wei.dai@intel.com>
2018-01-16 18:47:49 +01:00