dpdk.git
5 years agonet/virtio: fix in-order Tx path for packed ring
Tiwei Bie [Tue, 19 Feb 2019 10:59:49 +0000 (18:59 +0800)]
net/virtio: fix in-order Tx path for packed ring

When IN_ORDER feature is negotiated, device may just write out a
single used descriptor for a batch of buffers:

"""
Some devices always use descriptors in the same order in which they
have been made available. These devices can offer the VIRTIO_F_IN_ORDER
feature. If negotiated, this knowledge allows devices to notify the
use of a batch of buffers to the driver by only writing out a single
used descriptor with the Buffer ID corresponding to the last descriptor
in the batch.

The device then skips forward in the ring according to the size of the
batch. The driver needs to look up the used Buffer ID and calculate the
batch size to be able to advance to where the next used descriptor will
be written by the device.
"""

But the Tx path of packed ring can't handle this. With this patch,
when IN_ORDER is negotiated, driver will manage the IDs linearly,
look up the used buffer ID and advance to the next used descriptor
that will be written by the device.

Fixes: 892dc798fa9c ("net/virtio: implement Tx path for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: fix in-order Tx path for split ring
Tiwei Bie [Tue, 19 Feb 2019 10:59:48 +0000 (18:59 +0800)]
net/virtio: fix in-order Tx path for split ring

When IN_ORDER feature is negotiated, device may just write out a
single used ring entry for a batch of buffers:

"""
Some devices always use descriptors in the same order in which they
have been made available. These devices can offer the VIRTIO_F_IN_ORDER
feature. If negotiated, this knowledge allows devices to notify the
use of a batch of buffers to the driver by only writing out a single
used ring entry with the id corresponding to the head entry of the
descriptor chain describing the last buffer in the batch.

The device then skips forward in the ring according to the size of
the batch. Accordingly, it increments the used idx by the size of
the batch.

The driver needs to look up the used id and calculate the batch size
to be able to advance to where the next used ring entry will be written
by the device.
"""

Currently, the in-order Tx path in split ring can't handle this.
With this patch, driver will allocate desc_extra[] based on the
index in avail/used ring instead of the index in descriptor table.
And driver can just relay on the used->idx written by device to
reclaim the descriptors and Tx buffers.

Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: fix Tx desc cleanup for packed ring
Tiwei Bie [Tue, 19 Feb 2019 10:59:47 +0000 (18:59 +0800)]
net/virtio: fix Tx desc cleanup for packed ring

We should try to cleanup at least the 'need' number of descs.

Fixes: 892dc798fa9c ("net/virtio: implement Tx path for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agotest/pmd_perf: fix the way to drain the port
Julien Meunier [Wed, 20 Feb 2019 21:06:08 +0000 (23:06 +0200)]
test/pmd_perf: fix the way to drain the port

If the port has received less than ``pkt_per_port`` packets (for
example, the port has missed some packets), the test is in an infinite
loop.

Instead of expecting a number of packet to receive, let the port to be
drained by itself. If no more packets are received, the test can
continue.

Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bonding: fix reset active slave
Hari Kumar Vemula [Mon, 18 Feb 2019 11:59:23 +0000 (11:59 +0000)]
net/bonding: fix reset active slave

test_alb_reply_from_client test fails due to incorrect active slave
array's index. This was due to invalid active slave count.

Count of internals->active_slave is not updated even when active slave
is deactivated.
Hence active slave count always keeps incrementing beyond the actual
active slaves.

Fix is to set the internals->active_slave to starting index 0 whenever
it exceeds the number of slaves in active slave list and also update
the active slave count during slave de-activation.

Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness")
Cc: stable@dpdk.org
Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Chas Williams <chas3@att.com>
5 years agonet/bonding: avoid warning for invalid port
Hyong Youb Kim [Thu, 10 Jan 2019 10:22:34 +0000 (02:22 -0800)]
net/bonding: avoid warning for invalid port

For active-backup, tlb, and alb mode,
bond_ethdev_promiscuous_{enable,disable} tries to set promisc mode on
the primary port, even when there are no slaves. It is harmless, as
rte_eth_promiscuous_{enable,disable} does nothing if the port number
is invalid. But, it does print a warning message. Here is an example
from testpmd.

testpmd> create bonded device 5 0
Created new bonded device net_bonding_testpmd_0 on (port 4).
Invalid port_id=33
testpmd> set promisc 4 off
Invalid port_id=33

33 in this case is RTE_MAX_ETHPORTS + 1, the invalid primary port
number used within the bonding driver. This warning message is
harmless but can be confusing to the user. So do not try to set
promisc on a primary port when we know it does not exist (i.e. no
slaves).

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Acked-by: Chas Williams <chas3@att.com>
5 years agonet/qede: fix Tx packet prepare for tunnel packets
Shahed Shaikh [Wed, 13 Feb 2019 17:53:33 +0000 (09:53 -0800)]
net/qede: fix Tx packet prepare for tunnel packets

This patch fixes a regression introduced by
commit 49d3978d5723 ("net/qede: fix Tx tunnel offload support mask")
in which qede_xmit_prep_pkts() breaks the loop for successful
check of Tunneling offload flags instead of continuing, resulting
in tx_pkt_prepare return a failure.

Fixes: 49d3978d5723 ("net/qede: fix Tx tunnel offload support mask")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
5 years agoethdev: remove unused variable
Thomas Monjalon [Thu, 14 Feb 2019 16:29:20 +0000 (17:29 +0100)]
ethdev: remove unused variable

When removing the old attach function, the racy variable for getting
the last port id became unused.

Fixes: c9cce42876f5 ("ethdev: remove deprecated attach/detach functions")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agodoc: fix a minor typo in testpmd guide
Rami Rosen [Sat, 16 Feb 2019 11:13:23 +0000 (13:13 +0200)]
doc: fix a minor typo in testpmd guide

This patch fixes a minor typo in testpmd guide.

Fixes: 3c272b280a50 ("app/testpmd: add commands for RSS queue region")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
5 years agonet/ena: get device info statically
Michal Krawczyk [Fri, 15 Feb 2019 08:36:39 +0000 (09:36 +0100)]
net/ena: get device info statically

Whenever the app is calling rte_eth_dev_info_get(), it shouldn't use the
admin command. It was causing problems, if it was called from the
secondary process - the main process was crashing, and the secondary app
wasn't getting any result, as the admin request couldn't be processed by
the process which was requesting the data.

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

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
5 years agonet/bonding: fix link status
Chas Williams [Thu, 14 Feb 2019 19:11:12 +0000 (14:11 -0500)]
net/bonding: fix link status

Copying the link properties of the first slave added may copy an
invalid link status. The speed and duplex of the slave may not
be known at this time. Delay setting the properties until the
first slave reports as link up. Note that we are still ignoring
an error from link_properties_valid. For some bonding modes,
802.3ad, we should not activate the slave if it does not have
matching link properties.

Fixes: a45b288ef21a ("bond: support link status polling")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <chas3@att.com>
5 years agonet/bonding: fix slave Tx burst for mode 4
Chas Williams [Thu, 14 Feb 2019 19:09:58 +0000 (14:09 -0500)]
net/bonding: fix slave Tx burst for mode 4

The Tx burst routine always needs to check for pending LACPDUs
and send them if available. Do this first to prioritize the
control traffic.  We can still early exit, before calculating
the distribution slaves, if there isn't any data packets.

Fixes: 09150784a776 ("net/bonding: burst mode hash calculation")
Cc: stable@dpdk.org
Reported-by: Hui Zhao <zhaohui8@huawei.com>
Signed-off-by: Chas Williams <chas3@att.com>
5 years agonet/ice: enable VLAN filter offloads support
Wei Zhao [Wed, 13 Feb 2019 03:49:48 +0000 (11:49 +0800)]
net/ice: enable VLAN filter offloads support

VLAN filter is required to be configured during dev_start according to
dev_conf.rxmod.offloads setting, so ice_vlan_offload_set is called to
handle this.

Fixes: 690175ee51bf ("net/ice: support getting device information")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/avf: fix admin queue interrupt for ICE
Wei Zhao [Wed, 13 Feb 2019 08:54:13 +0000 (16:54 +0800)]
net/avf: fix admin queue interrupt for ICE

Enable CLEARPBA bit is required by ice NIC of A0/A1 version to
enable admin queue interrupt.
Also enable CLEARPBA bit does no impact on AVF behaviour when be
hosted by other devices, so we can make it as default.

Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/bnxt: support IOVA VA mode
Davide Caratti [Tue, 12 Feb 2019 18:30:19 +0000 (19:30 +0100)]
net/bnxt: support IOVA VA mode

Set RTE_PCI_DRV_IOVA_AS_VA in drv_flags: this allows initializing bnxt
PMD as non-root also on Linux v4.x, where /proc/self/pagemap can't be
accessed without CAP_SYS_ADMIN privileges.

Cc: stable@dpdk.org
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bonding: fix Tx in 802.3ad mode
Chas Williams [Mon, 11 Feb 2019 16:34:36 +0000 (11:34 -0500)]
net/bonding: fix Tx in 802.3ad mode

We can transmit if there is at least one distributing slave.

Fixes: 09150784a776 ("net/bonding: burst mode hash calculation")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <chas3@att.com>
5 years agonet/ice: fix crash on device detach
Qi Zhang [Wed, 30 Jan 2019 08:23:46 +0000 (16:23 +0800)]
net/ice: fix crash on device detach

Fix segment fault when detach a device due to some redundant function
call in ice_dev_uninit.

Fixes: f9cf4f864150 ("net/ice: support device initialization")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/mlx: support firmware version query
Thomas Monjalon [Wed, 6 Feb 2019 22:25:19 +0000 (23:25 +0100)]
net/mlx: support firmware version query

The API function rte_eth_dev_fw_version_get() is querying drivers
via the operation callback fw_version_get().
The implementation of this operation is added for mlx4 and mlx5.
Both functions are copying the same ibverbs field fw_ver
which is retrieved when calling ibv_query_device[_ex]()
during the port probing.

It is tested with command "drvinfo" of examples/ethtool/.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix Tx metadata for multi-segment packet
Dekel Peled [Wed, 30 Jan 2019 06:43:29 +0000 (08:43 +0200)]
net/mlx5: fix Tx metadata for multi-segment packet

Original patch implemented the use of match_metadata offload in the
different burst functions.
The concurrent use of match_metadata and multi_segs offloads was
not handled.

This patch updates function txq_scatter_v(), to pass metadata value
from mbuf to wqe, when indicated by offload flags.

Fixes: 6bd7fbd03c62 ("net/mlx5: support metadata as flow rule criteria")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agombuf: fix a typo
Rami Rosen [Mon, 11 Feb 2019 18:52:18 +0000 (20:52 +0200)]
mbuf: fix a typo

This trivial patch fixes a typo in rte_mbuf.h.

Fixes: f20b50b946da ("mbuf: optimize refcnt update")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
5 years agotest: fix autotest list
Rami Rosen [Mon, 11 Feb 2019 18:38:59 +0000 (20:38 +0200)]
test: fix autotest list

This patch fixes a broken build; when running
make test
we get the following error:
...
Traceback (most recent call last):
  File "test/test/autotest.py", line 49, in <module>
    num_fails = runner.run_all_tests()
  File "test/test/autotest_runner.py", line 345, in run_all_tests
    self.parallel_tests)
  File "test/test/autotest_runner.py", line 264, in __filter_test
    test_cmd = test["Command"]
KeyError: 'Command'
...
The reason is that the pdump autotest entry uses "Comamnd"
instead of "Command"; this patch fixes it.

Bugzilla ID: 205
Fixes: 086eb64db39e ("test/pdump: add unit test for pdump library")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoeal: support strlcat function
Bruce Richardson [Thu, 17 Jan 2019 17:30:32 +0000 (17:30 +0000)]
eal: support strlcat function

Add the strlcat function to DPDK to exist alongside the strlcpy one.
While strncat is generally safe for use for concatenation, the API for the
strlcat function is perhaps a little nicer to use, and supports truncation
detection.

See commit 5364de644a4b ("eal: support strlcpy function") for more
details on the function selection logic, since we only should be using the
DPDK-provided version when no system-provided version is present.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agovhost: add external message handling to the API
Darek Stojaczyk [Thu, 17 Jan 2019 15:32:26 +0000 (16:32 +0100)]
vhost: add external message handling to the API

External message callbacks are used e.g. by vhost crypto
to parse crypto-specific vhost-user messages.

We are now publishing the API to register those callbacks,
so that other backends outside of DPDK can use them as well.

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: remove forward declaration
Rami Rosen [Wed, 23 Jan 2019 17:29:48 +0000 (19:29 +0200)]
net/virtio: remove forward declaration

This minor cleanup patch removes an unnecessary forward
declaration of virtio_intr_enable() in net/virtio PMD.

Fixes: fe19d49cb525 ("net/virtio: fix Rx interrupt with VFIO")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: remove vDPA available ring relay helper
Xiao Wang [Wed, 23 Jan 2019 13:02:59 +0000 (21:02 +0800)]
vhost: remove vDPA available ring relay helper

We don't need to relay available ring and check the desc, vdpa device
can access the available ring in the guest directly. With this patch,
we can achieve better throughput and lower CPU usage.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: set offload flag for jumbo frames
Jens Freimann [Tue, 5 Feb 2019 11:17:02 +0000 (12:17 +0100)]
net/virtio: set offload flag for jumbo frames

Port configuration fails because offload flags don't match the expected
value when max-pkt-len is set to a value that should enable receive port
offloading but doesn't.

The .dev_infos_get callback can be called before the configure callback.
At that time we don't know the maximum packet size yet because it is
only set up when ports are started. So in virtio_dev_info_get() just
always set the jumbo packet offload flag.

Check the maximum packet length at device configure time, because then we
have access to the max-pkt-len value provided by the user. If the
max-pkt-len exceeds the maximum MTU supported by the device we remove
the VIRTIO_NET_F_MTU flag from requested features.

Fixes: a4996bd89c42 ("ethdev: new Rx/Tx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: add missing read barrier for packed dequeue
Ilya Maximets [Thu, 24 Jan 2019 16:59:02 +0000 (19:59 +0300)]
net/virtio: add missing read barrier for packed dequeue

Read barrier is required between reading the flags (desc_is_used)
and the content of descriptor to ensure the ordering.
Otherwise, speculative read of desc.id could be reordered with
reading of the desc.flags.

Fixes: a76290c8f1cf ("net/virtio: implement Rx path for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: add barriers for extra descriptors on Rx split
Ilya Maximets [Thu, 24 Jan 2019 16:59:01 +0000 (19:59 +0300)]
net/virtio: add barriers for extra descriptors on Rx split

There should be read barrier between checking VIRTQUEUE_NUSED (reading
the used->idx) and reading these descriptors. It's done for the first
checks at the beginning of these functions but missed while checking
for extra required descriptors.

Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx")
Fixes: 13ce5e7eb94f ("virtio: mergeable buffers")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: fix read barriers on packed Tx cleanup
Ilya Maximets [Thu, 24 Jan 2019 16:59:00 +0000 (19:59 +0300)]
net/virtio: fix read barriers on packed Tx cleanup

Read barrier must be implied between reading descriptor flags
and descriptor id. Otherwise, in case of reordering, we could
read wrong descriptor id.

For the reference, similar barrier for split rings is the read
barrier between VIRTQUEUE_NUSED (reading the used->idx) and
the call to the virtio_xmit_cleanup().

Additionally removed double update of 'used_idx'. It's enough
to set it in the end of the loop.

Fixes: 892dc798fa9c ("net/virtio: implement Tx path for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/sfc/base: share macro to increment per-event type stats
Andrew Rybchenko [Thu, 7 Feb 2019 16:29:43 +0000 (16:29 +0000)]
net/sfc/base: share macro to increment per-event type stats

Move duplicate macro to increment per-event type stats to
internal header. These stats are NIC family independent and
stored in generic event queue structure.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: improve MCDI interface header inclusion
Andrew Rybchenko [Thu, 7 Feb 2019 16:29:42 +0000 (16:29 +0000)]
net/sfc/base: improve MCDI interface header inclusion

Include efx_mcdi.h from main internal header efx_impl.h directly
instead of indirect inclusion via family-specific header.
It avoids duplication and fixes Medford and Medford2 cases where
the header inclusion is lost.
Correctness is still guaranteed by checks in efx_check.h which
require EFSYS_OPT_MCDI for corresponding families and do not
allow to enable the option if no family requires it.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: avoid division by 0 if no event queue timers
Andrew Rybchenko [Thu, 7 Feb 2019 16:29:41 +0000 (16:29 +0000)]
net/sfc/base: avoid division by 0 if no event queue timers

If event queue timers are not supported, enc_evq_timer_quantum_ns and
enc_evq_timer_max_us should be set to 0. Make sure that division by 0
does not happen in libefx, if public function efx_ev_usecs_to_ticks()
is used in this case.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: simplify EF10 family run-time checks
Andrew Rybchenko [Thu, 7 Feb 2019 16:29:40 +0000 (16:29 +0000)]
net/sfc/base: simplify EF10 family run-time checks

Add EFX_FAMILY_IS_EF10() which may be used as synonym of any EF10-based
NIC family (i.e. Huntigton, Medford or Medford2 at the time of addition).

Suggested-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: simplify EF10 family conditional code checks
Andrew Rybchenko [Thu, 7 Feb 2019 16:29:39 +0000 (16:29 +0000)]
net/sfc/base: simplify EF10 family conditional code checks

Add EFX_OPTS_EF10() which may be used as synonym of any EF10-based
NIC (i.e. Huntigton, Medford or Medford2 at the time of addition).

Suggested-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: pass Rx buffer size to RxQ init if supported
Andrew Rybchenko [Thu, 7 Feb 2019 16:29:38 +0000 (16:29 +0000)]
net/sfc/base: pass Rx buffer size to RxQ init if supported

Riverhead requires Rx buffer size to be specified in INIT_RXQ.
If the parameter is not supported (e.g. on EF10 family adapters),
zero must be used on INIT_RXQ.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: allow to specify Rx buffer size on queue setup
Andrew Rybchenko [Thu, 7 Feb 2019 16:29:37 +0000 (16:29 +0000)]
net/sfc/base: allow to specify Rx buffer size on queue setup

Rx buffer size must be specified on Rx queue creation on
Riverhead.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: make bundle partition type available for X2
Richard Houldsworth [Thu, 7 Feb 2019 16:29:36 +0000 (16:29 +0000)]
net/sfc/base: make bundle partition type available for X2

Supports the firmware update mechanism described in SF-121352-AN.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: add Rx parse incomplete event queue statistic
Andrew Lee [Thu, 7 Feb 2019 16:29:35 +0000 (16:29 +0000)]
net/sfc/base: add Rx parse incomplete event queue statistic

Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: rename header with MCDI strings
Andrew Rybchenko [Thu, 7 Feb 2019 16:29:34 +0000 (16:29 +0000)]
net/sfc/base: rename header with MCDI strings

The header was incorrectly named on addition since it did not
match naming conventions.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: support the Rx event mode w/o continue
Mark Spender [Thu, 7 Feb 2019 16:29:33 +0000 (16:29 +0000)]
net/sfc/base: support the Rx event mode w/o continue

The recently added NO_CONT_EV mode is recommended for when looking for
maximum throughput on 100G links as it allows the firmware to operate
more efficiently. The biggest benefit is when using scatter and jumbo
frames, but it is also necessary to achieve line rate in other cases.

Support for NO_CONT_EV when scatter is disabled is simple - the main
datapath change is to always read the packet length from the prefix,
not the event. This requires storing a flag with the event queue so
the event handler knows NO_CONT_EV mode is in use.

Supporting NO_CONT_EV with scatter would require an API change.

(Now the ee_flags field in efx_evq_t is used on the datapath, move it
next to other fields which are also read on the datapath to try to avoid
reading an additional cache line.)

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: update auto-generated MCDI definition headers
Andrew Rybchenko [Thu, 7 Feb 2019 16:29:32 +0000 (16:29 +0000)]
net/sfc/base: update auto-generated MCDI definition headers

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: remove deprecated macros that get queue sizes
Igor Romanov [Thu, 7 Feb 2019 16:29:31 +0000 (16:29 +0000)]
net/sfc/base: remove deprecated macros that get queue sizes

The macros are deprecated and are not used anymore, so they can
be deleted.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: remove deprecated min/max desc defines
Igor Romanov [Thu, 7 Feb 2019 16:29:30 +0000 (16:29 +0000)]
net/sfc/base: remove deprecated min/max desc defines

Symbols for maximum and minimum number of Tx, Rx and event descriptors
are deprecated. They are not used anymore, so they can be deleted.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: use NIC event descriptor size instead of common
Igor Romanov [Thu, 7 Feb 2019 16:29:29 +0000 (16:29 +0000)]
net/sfc: use NIC event descriptor size instead of common

Use of the macro for calculating a Rx queue size is deprecated. Replace
it with a call to a function that uses descriptor size specified for
every NIC.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: use NIC Rx descriptor size instead of common
Igor Romanov [Thu, 7 Feb 2019 16:29:28 +0000 (16:29 +0000)]
net/sfc: use NIC Rx descriptor size instead of common

Use of the macro for calculating a Rx queue size is deprecated. Replace
it with a call to a function that uses descriptor size specified for
every NIC.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: use NIC Tx descriptor size instead of common
Igor Romanov [Thu, 7 Feb 2019 16:29:27 +0000 (16:29 +0000)]
net/sfc: use NIC Tx descriptor size instead of common

Use of the macro for calculating a Tx queue size is deprecated. Replace
it with a call to a function that uses descriptor size specified for
every NIC.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: round number of queue buffers up
Igor Romanov [Thu, 7 Feb 2019 16:29:26 +0000 (16:29 +0000)]
net/sfc/base: round number of queue buffers up

Functions efx_*q_nbufs return the number of a queue buffers by dividing
the queue size by page size. If minimum size of a queue is smaller than
one page, we still need the page and number of buffers should not be 0.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: support different event descriptor sizes
Igor Romanov [Thu, 7 Feb 2019 16:29:25 +0000 (16:29 +0000)]
net/sfc/base: support different event descriptor sizes

For consistency with the size of Tx descriptors, the size of event
descriptors should be a part of NIC config, not a macro that is
common for all NIC families. Also, add a max number of EvQ buffers
define which is needed to initialize an MCDI buffer at compile time.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: support different Rx descriptor sizes
Igor Romanov [Thu, 7 Feb 2019 16:29:24 +0000 (16:29 +0000)]
net/sfc/base: support different Rx descriptor sizes

For consistency with the size of Tx descriptors, the size of Rx
descriptors should be a part of NIC config, not a macro that is
common for all NIC families.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: support different Tx descriptor sizes
Igor Romanov [Thu, 7 Feb 2019 16:29:23 +0000 (16:29 +0000)]
net/sfc/base: support different Tx descriptor sizes

Size of Tx descriptor is different on Riverhead. So, the size
should be a part of NIC config, not a macro that is common for
all NIC families.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: make NIC pointer const in NIC config get
Igor Romanov [Thu, 7 Feb 2019 16:29:22 +0000 (16:29 +0000)]
net/sfc/base: make NIC pointer const in NIC config get

The change is needed for the functions that accept const efx_nic_t
pointer and have to get efx_nic_cfg_t.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: make max number of TxQ bufs EF10-specific
Igor Romanov [Thu, 7 Feb 2019 16:29:21 +0000 (16:29 +0000)]
net/sfc/base: make max number of TxQ bufs EF10-specific

The define EFX_TXQ_MAX_BUFS is used only by EF10 family implementation.
Since the macro is not used by any drivers, it does not require
exposed libefx interface.
Make the define EF10-specific.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: move a macro to Siena implementation header
Igor Romanov [Thu, 7 Feb 2019 16:29:20 +0000 (16:29 +0000)]
net/sfc/base: move a macro to Siena implementation header

The macro EFX_RXQ_DC_NDESCS() is used only by Siena implementation.
Since the macro is not used by any drivers, it does not require
exposed libefx interface.
Make the macro Siena-specific.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: move EVQ descs number check to generic place
Igor Romanov [Thu, 7 Feb 2019 16:29:19 +0000 (16:29 +0000)]
net/sfc/base: move EVQ descs number check to generic place

Now we have min/max limits in NIC config, so we can do check against
min/max in a generic place instead of NIC family specific functions.
Check that the descriptors number is a power of 2 is also can be
made common. It removes code duplication and makes NIC family
specific functions a bit shorter.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: move Rx descs number check to generic place
Igor Romanov [Thu, 7 Feb 2019 16:29:18 +0000 (16:29 +0000)]
net/sfc/base: move Rx descs number check to generic place

Now we have min/max limits in NIC config, so we can do check against
min/max in a generic place instead of NIC family specific functions.
Check that the descriptors number is a power of 2 is also can be
made common. It removes code duplication and makes NIC family
specific functions a bit shorter.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: move Tx descs number check to generic place
Igor Romanov [Thu, 7 Feb 2019 16:29:17 +0000 (16:29 +0000)]
net/sfc/base: move Tx descs number check to generic place

Now we have min/max limits in NIC config, so we can do check against
min/max in a generic place instead of NIC family specific functions.
Check that the descriptors number is a power of 2 is also can be made
common. It removes code duplication and makes NIC family
specific functions a bit shorter.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: use NIC EVQ descs limits instead of defines
Igor Romanov [Thu, 7 Feb 2019 16:29:16 +0000 (16:29 +0000)]
net/sfc: use NIC EVQ descs limits instead of defines

Descriptor limits are not common for all NIC families. Use the variables
from NIC configuration instead of deprecated defines.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: use NIC Rx descs limits instead of defines
Igor Romanov [Thu, 7 Feb 2019 16:29:15 +0000 (16:29 +0000)]
net/sfc: use NIC Rx descs limits instead of defines

Descriptor limits are not common for all NIC families. Use the variables
from NIC configuration instead of deprecated defines.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: use NIC min number of Tx descs instead of define
Igor Romanov [Thu, 7 Feb 2019 16:29:14 +0000 (16:29 +0000)]
net/sfc: use NIC min number of Tx descs instead of define

Min limit is not common for all NIC families. Use the variable from
NIC configuration instead of deprecated define.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: remove min/max defines for number of events
Igor Romanov [Thu, 7 Feb 2019 16:29:13 +0000 (16:29 +0000)]
net/sfc/base: remove min/max defines for number of events

EF100/Riverhead has different min/max limits. So, these limits should
be a part of NIC config, not defines common for all NIC families.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: remove min/max defines for number of Rx descs
Igor Romanov [Thu, 7 Feb 2019 16:29:12 +0000 (16:29 +0000)]
net/sfc/base: remove min/max defines for number of Rx descs

EF100/Riverhead has different min/max limits. So, these limits should
be a part of NIC config, not defines common for all NIC families.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: define max desc number for every EF10 NIC
Igor Romanov [Thu, 7 Feb 2019 16:29:11 +0000 (16:29 +0000)]
net/sfc/base: define max desc number for every EF10 NIC

For consistency with defines of min descriptor number, define max
descriptor number for Huntington, Medford and Medford2.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: remove min define for number of Tx descs
Igor Romanov [Thu, 7 Feb 2019 16:29:10 +0000 (16:29 +0000)]
net/sfc/base: remove min define for number of Tx descs

EF100/Riverhead has different min limit. So, this limit should
be a part of NIC config, not define common for all NIC families.
Define maximum Tx descriptor number for Siena in the same way as
minimum for consistency.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: report support for Tx checksum op descriptors
Ivan Malov [Thu, 7 Feb 2019 16:29:09 +0000 (16:29 +0000)]
net/sfc/base: report support for Tx checksum op descriptors

FreeBSD driver needs a patch to provide a means for packets
which do not need checksum offload but have flow ID set
to avoid hitting only the first Tx queue (which has been used
for packets not needing checksum offload).

This should be possible on Huntington, Medford or Medford2 chips
since these support toggling checksum offload on any given queue
dynamically by means of pushing option descriptors.

The patch for FreeBSD driver will then need a means to figure out
whether the feature can be used, and testing adapter family might
not be a good solution.

This patch adds a feature bit specifically to indicate support
for checksum option descriptors. The new feature bits may have
more users in future, apart from the mentioned FreeBSD patch.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: ensure EvQ poll stops when abort is requested
Mark Spender [Thu, 7 Feb 2019 16:29:08 +0000 (16:29 +0000)]
net/sfc/base: ensure EvQ poll stops when abort is requested

If an event handler requested an abort, only the inner loop was
guaranteed to be broken out of - the outer loop could continue
if total == batch.

Fix this by poisoning batch to ensure it is different to total.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: update external port number calculation
Richard Houldsworth [Thu, 7 Feb 2019 16:29:07 +0000 (16:29 +0000)]
net/sfc/base: update external port number calculation

Revise the external port calculation to support all
X2 port modes. The previous algorithm could not
handle different port numbering schemes on each cage.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc/base: correct annotations where NULL input is OK
Richard Houldsworth [Thu, 7 Feb 2019 16:29:06 +0000 (16:29 +0000)]
net/sfc/base: correct annotations where NULL input is OK

Correct annotations where NULL input can be permitted

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: support Rx packet types get in secondary process
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:53 +0000 (12:17 +0000)]
net/sfc: support Rx packet types get in secondary process

Secondary process needs to know packet classes supported
by the NIC on Rx.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: separate adapter primary process and shared data
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:52 +0000 (12:17 +0000)]
net/sfc: separate adapter primary process and shared data

Make sfc_adapter primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: remove adapter locks from secondary process ops
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:51 +0000 (12:17 +0000)]
net/sfc: remove adapter locks from secondary process ops

Adapter lock will become primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move isolated flag in adapter shared
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:50 +0000 (12:17 +0000)]
net/sfc: move isolated flag in adapter shared

The flag is required in default RSS RETA get which does not make sense
in isolated mode.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move RSS config to adapter shared
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:49 +0000 (12:17 +0000)]
net/sfc: move RSS config to adapter shared

RSS get requests are supported in secondary process.

Prepare to make sfc_adapter primary process private data.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move TxQ shared information to adapter shared
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:48 +0000 (12:17 +0000)]
net/sfc: move TxQ shared information to adapter shared

Prepare to make sfc_adapter primary process private data.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move RxQ shared information to adapter shared
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:47 +0000 (12:17 +0000)]
net/sfc: move RxQ shared information to adapter shared

Prepare to make sfc_adapter primary process private data.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: make main logging macro reusable in secondary
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:46 +0000 (12:17 +0000)]
net/sfc: make main logging macro reusable in secondary

Logging should be supported in secondary process and now we have
everything required to share at least main logging macro.
sfc_adapter is going to become primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move Rx/Tx datapath names to shared state
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:45 +0000 (12:17 +0000)]
net/sfc: move Rx/Tx datapath names to shared state

Prepare to make sfc_adapter primary process private data.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: start to factor out multi-process shared data
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:44 +0000 (12:17 +0000)]
net/sfc: start to factor out multi-process shared data

sfc_adapter structure will become primary process only private data.
Start to factor out shared data into dedicated structure which will
become separate structure finally.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: remove TxQ control from shared TxQ info
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:43 +0000 (12:17 +0000)]
net/sfc: remove TxQ control from shared TxQ info

libefx is not multi-process aware and all related structures
should be moved to primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: remove RxQ control from shared RxQ info
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:42 +0000 (12:17 +0000)]
net/sfc: remove RxQ control from shared RxQ info

libefx is not multi-process aware and all related structures
should be moved to primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: remove unnecessary functions to get TxQ index
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:41 +0000 (12:17 +0000)]
net/sfc: remove unnecessary functions to get TxQ index

TxQ index is stored in generic datapath queue structure.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: remove unnecessary functions to get RxQ index
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:40 +0000 (12:17 +0000)]
net/sfc: remove unnecessary functions to get RxQ index

RxQ index is stored in generic datapath queue structure.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: support RSS RETA and hash config get in secondary
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:39 +0000 (12:17 +0000)]
net/sfc: support RSS RETA and hash config get in secondary

RSS RETA query and hash configuration get functions use shared
adapter data only. No libefx functions are called.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: support Tx descriptor status in secondary process
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:38 +0000 (12:17 +0000)]
net/sfc: support Tx descriptor status in secondary process

If Tx datapath supports multi-process, secondary process should be
able to use Tx descriptor status API.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move datapath TxQ handle to shared TxQ info
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:37 +0000 (12:17 +0000)]
net/sfc: move datapath TxQ handle to shared TxQ info

If datapath supports multi-process, it should be possible to get
its TxQ structure by the queue index.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move TxQ state to multi-process shared location
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:36 +0000 (12:17 +0000)]
net/sfc: move TxQ state to multi-process shared location

Secondary process needs to know TxQ state.
TxQ control structure will become primary process private.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: support Rx descriptor status in secondary process
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:35 +0000 (12:17 +0000)]
net/sfc: support Rx descriptor status in secondary process

If Rx datapath supports multi-process, secondary process should be
able to use Rx descriptor status and related API.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move datapath RxQ handle to shared RxQ info
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:34 +0000 (12:17 +0000)]
net/sfc: move datapath RxQ handle to shared RxQ info

If datapath supports multi-process, it should be possible to get
its RxQ structure by the queue index.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move RxQ state to multi-process shared location
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:33 +0000 (12:17 +0000)]
net/sfc: move RxQ state to multi-process shared location

Secondary process needs to know RxQ state.
RxQ control structure will become primary process private.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move main log type to process private data
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:32 +0000 (12:17 +0000)]
net/sfc: move main log type to process private data

Dynamic log type value may differ in primary and secondary processes.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move datapath ops pointers to process private data
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:31 +0000 (12:17 +0000)]
net/sfc: move datapath ops pointers to process private data

The change is required to support datapath-dependent device operations
for secondary process. It is just a step in the direction.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: make it simpler to change datapath ops location
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:30 +0000 (12:17 +0000)]
net/sfc: make it simpler to change datapath ops location

Rx and Tx datapath ops should be stored in process private
data since these structures are located in the data section
(not allocated from shared memory).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: remove wrappers around Rx descriptor count and done
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:29 +0000 (12:17 +0000)]
net/sfc: remove wrappers around Rx descriptor count and done

These wrappers are used in single place and just complicate reading
and understanding if these ops could be supported in secondary process.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: avoid usage of TxQ control structure in info get
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:28 +0000 (12:17 +0000)]
net/sfc: avoid usage of TxQ control structure in info get

TxQ control structure contains primary process only data and will become
primary process only. TxQ info get is supported in secondary process.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: avoid usage of RxQ control structure in info get
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:27 +0000 (12:17 +0000)]
net/sfc: avoid usage of RxQ control structure in info get

RxQ control structure contains primary process only data and will
become primary process only. RxQ info get is supported in secondary
process.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: fix logging from secondary process
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:26 +0000 (12:17 +0000)]
net/sfc: fix logging from secondary process

Dynamic log type value may differ in different processes.

Fixes: f28ede500c2e ("net/sfc: support multi-process")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: remove control path logging from Rx queue count
Andrew Rybchenko [Thu, 7 Feb 2019 12:17:25 +0000 (12:17 +0000)]
net/sfc: remove control path logging from Rx queue count

Rx queue count may be used from data core and it should not
generate control path logs.

Fixes: 04aa6b9c5fd7 ("net/sfc: get RxQ pending descriptors count")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: log port ID as 16-bit unsigned integer on panic
Ivan Malov [Thu, 7 Feb 2019 12:17:24 +0000 (12:17 +0000)]
net/sfc: log port ID as 16-bit unsigned integer on panic

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/bonding: fix values of descriptor limits
Hari Kumar Vemula [Tue, 5 Feb 2019 13:39:39 +0000 (13:39 +0000)]
net/bonding: fix values of descriptor limits

test_create_bonded_device is failing due to improper initialisation in
bonded device configuration. Which leads to crash while setting up
queues.

The value of nb_rx_desc is checked if it is not in range of rx_desc_lim
of bonded device which fails.
This is due to "rx_desc_lim" is set to 0 as default value of bonded
device during bond_alloc().
Hence nb_rx_desc (1024) is > 0 and test fails.

Fix is to set the default values of rx_desc_lim of bonded device to
appropriate value.
Receive the values from slaves configuration like done for other
existing slave configuration

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Acked-by: Chas Williams <chas3@att.com>
5 years agonet/pcap: fix memory leak
Qi Zhang [Wed, 30 Jan 2019 01:08:54 +0000 (09:08 +0800)]
net/pcap: fix memory leak

Fix potential memory leak due to kvlist not be freed.

Fixes: 0d0dd2d9d8ff ("net/pcap: enable data path for secondary process")
Cc: stable@dpdk.org
Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: add TOS and TTL fields to VXLAN encapsulation
Viacheslav Ovsiienko [Tue, 22 Jan 2019 10:57:04 +0000 (10:57 +0000)]
app/testpmd: add TOS and TTL fields to VXLAN encapsulation

The new testpmd set vxlan-tos-ttl command is added. It
allows to specify tos and tll fields for encapsulation IP
header.

IPv4 VXLAN outer header:

  testpmd> set vxlan-tos-ttl ip-version ipv4 vni 4 udp-src 4
           udp-dst 4 ip-tos 0 ip-ttl 255 ip-src 127.0.0.1
           ip-dst 128.0.0.1 eth-src 11:11:11:11:11:11
           eth-dst 22:22:22:22:22:22

IPv6 VXLAN outer header:
  testpmd> set vxlan-tos-ttl ip-version ipv6 vni 4 udp-src 4
           udp-dst 4 ip-tos 0 ip-ttl 255 ::1 ip-dst ::2222
           eth-src 11:11:11:11:11:11 eth-dst
           22:22:22:22:22:22

Note: ip-ttl parameter corresponds the nop_limits field for IPv6.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>