Rasesh Mody [Sat, 18 Mar 2017 06:50:21 +0000 (23:50 -0700)]
net/qede/base: fix numbering L2 VF queues
There are some constellations where Due to lack of resource allocation
in MFW, There would be an insufficient number of L2 queues for all the
VFs.
This introduces a new feature ECORE_VF_L2_QUE which correctly numbers
the number of VF queues. Notice it might be larger than the actual
number of VFs in configuration space, in which case its the ecore
client responsibility not to try activating that many.
As part of the fix, also correct the nubmering of the VF queues. As
their numbering is dependent on the SBs of the PF, which might only be
partially used by L2 [as half would be assigned for RDMA which doesn't
require L2 queues], we make the numbering consecutive with that of the
L2 queues only.
Fixes: ec94dbc57362 ("qede: add base driver") Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Rasesh Mody [Sat, 18 Mar 2017 06:50:19 +0000 (23:50 -0700)]
net/qede/base: fix printout
Prints in ecore_get_dev_info showed only chip revision,
and did that as number instead of letter.
I.e., BB A0 --> BB0, BB B0 --> BB1, AH A0 --> AH0, AH A1 --> AH0.
Correct the printing scheme into
{AH, BB} {A, B}{0, 1}
Fixes: ec94dbc57362 ("qede: add base driver") Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Rasesh Mody [Sat, 18 Mar 2017 06:50:18 +0000 (23:50 -0700)]
net/qede/base: fix TM block ILT initialization
Fix Timer(TM) block Internal Lookup Table(or ILT for logical to
physical address translation) initialization for SRIOV's coexistence
with other protocols.
Fixes: ec94dbc57362 ("qede: add base driver") Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Rasesh Mody [Sat, 18 Mar 2017 06:48:36 +0000 (23:48 -0700)]
net/qede/base: fix incorrect typecasting of flag
dcbx-update-flag is incorrectly converted to boolean before assigining
it to ramrod data, fix this typecasting. Also, added more debug
messages in the dcbx code paths.
Andrew Rybchenko [Mon, 20 Mar 2017 10:15:07 +0000 (10:15 +0000)]
net/sfc: use different callbacks for event queues
Use different sets of libefx EvQ callbacks for management,
transmit and receive event queue. It makes event handling
more robust against unexpected events.
Also it is required for alternative datapath support.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Yongseok Koh [Wed, 15 Mar 2017 23:55:44 +0000 (16:55 -0700)]
net/mlx5: add enhanced multi-packet send for ConnectX-5
ConnectX-5 supports enhanced version of multi-packet send (MPS). An MPS Tx
descriptor can carry multiple packets either by including pointers of
packets or by inlining packets. Inlining packet data can be helpful to
better utilize PCIe bandwidth. In addition, Enhanced MPS supports hybrid
mode - mixing inlined packets and pointers in a descriptor. This feature is
enabled by default if supported by HW.
Ivan Malov [Thu, 16 Mar 2017 11:01:35 +0000 (11:01 +0000)]
net/sfc: add callback to retrieve FW version
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Ivan Malov [Thu, 16 Mar 2017 11:01:34 +0000 (11:01 +0000)]
net/sfc/base: add advanced function to extract FW version
Some libefx-based drivers might need this functionality to
indicate DPCPU FW IDs as part of FW version info to assist
experienced users.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Wenzhuo Lu [Thu, 16 Mar 2017 03:09:45 +0000 (11:09 +0800)]
net/i40e: fix broadcast promiscuous mode setting
When setting up the VSIs, MAC filter is used for
receiving MAC broadcast packets.
We should follow it to implement the broadcast
promiscuous mode setting.
Fixes: 61fff9b4c68b ("net/i40e: set VF broadcast mode from PF") Cc: stable@dpdk.org Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Chas Williams [Wed, 15 Mar 2017 12:35:10 +0000 (08:35 -0400)]
net/vmxnet3: fix queue size changes
If the user reconfigures the queue size, then the previously allocated
memzone may potentially be too small. Release the memzone when a queue
is released and allocate a new one each time a queue is setup.
While here convert to rte_eth_dma_zone_reserve() which does basically
the same things as the private function.
Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation") Cc: stable@dpdk.org Signed-off-by: Chas Williams <ciwillia@brocade.com> Acked-by: Jan Blunck <jblunck@infradead.org> Acked-by: Shrikrishna Khare <skhare@vmware.com>
Pascal Mazon [Wed, 15 Mar 2017 14:48:17 +0000 (15:48 +0100)]
net/tap: add multicast addresses management
A tap netdevice actually receives every packet, without any filtering
whatsoever. There is no need for any multicast address registration
to receive multicast packets.
Pascal Mazon [Wed, 15 Mar 2017 14:48:15 +0000 (15:48 +0100)]
net/tap: add MTU management
The MTU is assigned to the tap netdevice according to the argument, but
packet transmission and reception just write/read on an fd with the
default limit being the socket buffer size.
As a new rte_eth_dev_data is allocated during tap device init, ensure it
is set again dev->data->mtu.
Once the actual netdevice is created via tun_alloc(), make sure to apply
the desired MTU to the netdevice.
Pascal Mazon [Wed, 15 Mar 2017 14:48:12 +0000 (15:48 +0100)]
net/tap: remove NO-ARP setting
There is no reason not to support ARP on a tap netdevice. Remove
IFF_NOARP flags.
Focus on IFF_UP when a link status change is required.
Fixes: f457b472b1f2 ("net/tap: add link up and down operations") Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Ivan Malov [Thu, 9 Mar 2017 17:23:03 +0000 (17:23 +0000)]
net/sfc: add VFs to the table of PCI IDs for supported NICs
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Ivan Malov [Thu, 9 Mar 2017 17:23:02 +0000 (17:23 +0000)]
net/sfc: support MCDI proxy
The patch is to add support for MCDI proxy which comes in
useful, particularly, while running over VF: few commands
will normally fail with EPERM, but in some cases the host
driver (i.e. running over the corresponding PF, typically,
within a hypervisor) may set itself as a proxy to conduct
authorization for the commands coming from VFs; these are
forwarded to the corresponding access control application
which may decline or approve authorization by replying to
the requests; all in all, the guest driver has to process
the replies forwarded back by the firmware MC in order to
give up gracefully (by setting return code which could be
understood by 'libefx') or re-issue the original commands
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Ivan Malov [Thu, 9 Mar 2017 17:23:01 +0000 (17:23 +0000)]
net/sfc: avoid failure on port start if Rx mode is rejected
If Rx mode is unacceptable, in particular, when promiscuous
or all-multicast filters are not allowed while running over
PCI function which is not a member of appropriate privilege
groups, the driver has to cope with the failures gracefully
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Ivan Malov [Thu, 9 Mar 2017 17:23:00 +0000 (17:23 +0000)]
net/sfc: poll MAC stats if periodic DMA is not supported
If periodic DMA statistics feature is absent (particularly,
while running over VF), the PMD must provide an ability to
cope with it using explicit update requests which are kept
restrained according to 'stats_update_period_ms' parameter
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Ivan Malov [Thu, 9 Mar 2017 17:22:59 +0000 (17:22 +0000)]
net/sfc: add kvarg control for MAC statistics update period
The patch is to make MAC statistics update interval tunable
by means of 'stats_update_period_ms' kvarg parameter making
it possible to use values different from 1000 ms in case of
SFN8xxx boards provided that firmware version is 6.2.1.1033
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Shahaf Shuler [Tue, 14 Mar 2017 13:03:08 +0000 (15:03 +0200)]
eal/linux: support external Rx interrupt
Prior to this patch only UIO/VFIO interrupt handlers types were supported.
This patch adds support for the external interrupt handler type, allowing
external drivers to set their own fds with specific interrupt handlers.
Adrien Mazarguil [Tue, 14 Mar 2017 12:51:58 +0000 (13:51 +0100)]
net/tap: add Rx trigger
This commit adds a signal-based trigger to the Rx burst function in order
to avoid unnecessary system calls while Rx queues are empty.
Triggered Rx bursts put less pressure on the kernel, free up CPU resources
for applications and result in a noticeable performance improvement when
sharing CPU threads with other PMDs.
Measuring the traffic forwarding rate between two physical devices in
testpmd (IO mode, single thread, 64B packets) before and after adding two
tap PMD instances (4 ports total) that do not process any traffic and
comparing results yields:
Jerin Jacob [Mon, 13 Mar 2017 08:02:11 +0000 (13:32 +0530)]
net/thunderx: check data offset alignment requirement
nicvf HW expects the DMA address of the packet data to be
aligned with cache line size.
Packet data offset is a function of struct mbuf size,
mbuf private size and headroom. mbuf private size can
be changed from the application in pool creation, this
check detects HW alignment requirement constraint in pmd
start function.
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Allain Legacy [Fri, 10 Mar 2017 14:38:21 +0000 (09:38 -0500)]
net/e1000: advertise offload capabilities for the EM PMD
The hardware offload capabilities are not being advertised for the EM PMD.
Because of this, applications that only enable these features if the device
advertises them will never do so.
Normally this is not an issue since normal packet processing should work
even if hardware offload is not available. But, in older versions of
Virtual Box the e1000 device emulation (Intel PRO/1000 MT Desktop 82540EM)
assumes that it should enable VLAN stripping even if the driver does not
request it. This means that any ingress packets that have a VLAN tag will
be stripped. Since the application did not request to enable VLAN
stripping it is not expecting these packets so they are not processed as
VLAN packets.
Regardless of the Virtual Box issue, the driver should be advertising
supported capabilities as is done in other drivers.
Signed-off-by: Allain Legacy <allain.legacy@windriver.com> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Ivan Malov [Thu, 9 Mar 2017 16:21:30 +0000 (16:21 +0000)]
net/sfc: set multicast address list in started state only
According to 'libefx' API requirements, one is allowed to
apply multicast address list to the port in started state
only, otherwise the new array should be copied to a local
storage in order to be applied during the next port start
Coverity issue: 141296 Fixes: 0fa0070e4391 ("net/sfc: support multicast addresses list controls") Fixes: e9ddf37a507d ("net/sfc: fix setting empty multicast list") Cc: stable@dpdk.org Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Roman Zhukov [Thu, 9 Mar 2017 15:26:33 +0000 (15:26 +0000)]
net/sfc: add unknown unicast/multicast match in flow API
Support individual/group destination address match (unknown unicast
and all-multicast correspondingly in terms of firmware).
Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Roman Zhukov [Thu, 9 Mar 2017 15:26:32 +0000 (15:26 +0000)]
net/sfc: support UDP in flow API filters
Exact match of source and destination ports is supported by parser.
IP protocol match is enforced to UDP.
Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Roman Zhukov [Thu, 9 Mar 2017 15:26:31 +0000 (15:26 +0000)]
net/sfc: support TCP in flow API filters
Exact match of source and destination ports is supported by parser.
IP protocol match is enforced to TCP.
Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Roman Zhukov [Thu, 9 Mar 2017 15:26:30 +0000 (15:26 +0000)]
net/sfc: support IPV6 in flow API filters
Exact match of IP protocol, source and destination
addresses is supported by parser.
EtherType match is enforced to IPv6 EtherType.
Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Roman Zhukov [Thu, 9 Mar 2017 15:26:29 +0000 (15:26 +0000)]
net/sfc: support IPV4 in flow API filters
Exact match of IP protocol, source and destination
addresses is supported by parser.
EtherType match is enforced to IPv4 EtherType.
Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
Roman Zhukov [Thu, 9 Mar 2017 15:26:28 +0000 (15:26 +0000)]
net/sfc: support VLAN in flow API filters
Exact match of VLAN ID bits is supported only and required in VLAN item.
Mask to match VLAN ID bits only is required, default mask to match entire
TCI is not supported.
Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com>
net/sfc: provide a way to check if filter is supported
The information is obtained from firmware on attach. It may
change after MC reboot (firmware version or variant change).
Cache should be refreshed after MC reboot when it is handled
properly (not yet).
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com> Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
Just log error for all filter types and return no support indication.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com> Reviewed-by: Andy Moreton <amoreton@solarflare.com> Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
Mark Spender [Thu, 9 Mar 2017 15:26:24 +0000 (15:26 +0000)]
net/sfc/base: improve API to get supported filter matches
The previous API had various problems, including the length of the
caller provided buffer not being specified, no means being available
to discover how big the buffer needs to be, and a lack of clarity of
what the resulting list contains.
To improve it:
- add the buffer length as a parameter
- if the provided buffer is too short, fail with ENOSPC and return
the required length
- ensure that the list contents are valid and add comments describing it
It is safe to change this API as, unsurprisingly, it has no users.
Signed-off-by: Mark Spender <mspender@solarflare.com> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Mark Spender [Thu, 9 Mar 2017 15:26:23 +0000 (15:26 +0000)]
net/sfc/base: split local MAC I/G back into separate flags
The flag EFX_FILTER_MATCH_LOC_MAC_IG to represent filtering on the
individual/group bit of the MAC address (with the two cases being
distinguished by the MAC address in the filter specification) was
introduced to mirror the Linux driver filtering code, but the
implementations are different enough anyway that it isn't of much
value.
Having separate flags for unknown unicast and multicast simplifies
the code and allows the set of flags to match those used by MCDI.
It will also makes it easier to report whether these filters are
supported.
In the MCDI definitions, the unknown multicast and unicast flags
have the values 0x40000000 and 0x80000000 respectively, and so using
the same values for simplicity requires 32 bits in the filter
specification to store the flags. This means the structure is now
a little bigger than 64 bytes, but filters are not often used on
critical paths so this shouldn't have much impact - on Linux they
are also bigger than they used to be.
Signed-off-by: Mark Spender <mspender@solarflare.com> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Qi Zhang [Wed, 8 Mar 2017 06:19:05 +0000 (01:19 -0500)]
net/fm10k/base: request reset on mailbox state change
Multiple IES API resets can cause a race condition where the mailbox
interrupt request bits can be cleared before being handled. This can
leave certain mailbox messages from the PF to be untreated and the PF
will enter in some inactive state. If this situation occurs, the IES API
will initiate a mailbox version reset which, then, trigger a mailbox
state change. Once this mailbox transition occurs (from OPEN to CONNECT
state), a request for reset will be returned.
Qi Zhang [Wed, 8 Mar 2017 06:19:04 +0000 (01:19 -0500)]
net/fm10k/base: replace macros
Other shared code bases are planning on using
IS_MULTICAST_ETHER_ADDR and friends without leaving the driver
name in the macro.
Remove reference to FM10K here so that we can re-use the specific
compat flags from Linux.
Qi Zhang [Wed, 8 Mar 2017 06:19:03 +0000 (01:19 -0500)]
net/fm10k/base: improve re-map queues handle
Avoid potential FUM fault errors on a VF when updating MAC address
and VLAN information. Only use the register flow when the mailbox is
disconnected, by checking if the enqueue_tx returns
FM10K_MBX_ERR_NO_MBX. If the mailbox message can be sent, there is no
reason to bother with the register writes which are only intended to
be used during VF driver initialization.
Qi Zhang [Wed, 8 Mar 2017 06:19:01 +0000 (01:19 -0500)]
net/fm10k/base: do not stop reset
Don't report FM10K_ERR_REQUESTS_PENDING when we fail to disable queues
within the timeout. This can occur due to a hardware Tx hang, or when
the switch ethernet fabric is resetting while we are transmitting
traffic. It can sometimes take up to 500ms before the Tx DMA engine
gives up. Instead, just skip the DMA engine check and perform
a data-path reset anyways. Add a statistic counter to keep track of the
number of resets occurring while we have pending DMA on the rings.
In order to prevent having to assign err = FM10K_SUCCESS, re-order the
last few items of the reset_hw_pf function so that we don't perform
"return err" at the end.
Qi Zhang [Wed, 8 Mar 2017 06:18:59 +0000 (01:18 -0500)]
net/fm10k/base: enable lport map request
If the fm10k interface is brought up, but the switch manager software is
not running, the driver will continuously request the lport map every
few seconds in the base driver watchdog routine. Eventually after
several minutes the switch mailbox Tx fifo will fill up and the mailbox
will timeout, resulting in a reset. This reset will appear as if for no
reason, and occurs regularly every few minutes until the switch manager
software is loaded.
The VF uses a multi-bit update request to clear unused VLANs whenever it
resets. However, an accident in a previous refactor broke multi-bit
updates for VFs, due to misreading a comment in fm10k_vf.c and
attempting to reduce code duplication. The problem occurs because
a multi-bit request has a non-zero length, and the PF would simply drop
any request with the upper 16 bits set. In addition, a multi-bit vlan
update does not have a concept for "VLAN 0" as the single bit update
does.
A previous revision of this patch resolved the issue by simply removing
the upper 16 bit check and the iov_select_vid checks. However, this would
remove the checks for default VID and for ensuring no other VLANs can be
enabled except pf_vid when it has been set. To resolve that issue, this
revision uses the iov_select_vid when we have a single-bit update, and
denies any multi-bit update when the VLAN was administratively set by
the PF. This should be ok since the PF properly updates VLAN_TABLE when
it assigns the PF vid. This ensures that requests to add or "remove" the
PF vid work as expected, but a rogue VF could not use the multi-bit
update as a loophole to attempt receiving traffic on other VLANs.
The original comment may be read incorrectly as referring to checking
the *entire* length is zero. However, it merely checks only the reserved
bits of both length and reserved in a small amount of code. Update the
comment to indicate this is a clever trick and clearly spell out that it
only checks the reserve bits.
Qi Zhang [Wed, 8 Mar 2017 06:18:56 +0000 (01:18 -0500)]
net/fm10k/base: use different name for override bit
Use a new #define FM10K_VLAN_OVERRIDE even though we're using
the exact same bit. The reason for this is clarity in the code,
otherwise you can read FM10K_VLAN_CLEAR and think it should be
removed. Also add a comment explaining why the FM10K_VLAN_OVERRIDE
bit is set.
Qi Zhang [Wed, 8 Mar 2017 06:18:55 +0000 (01:18 -0500)]
net/fm10k/base: update comment to use 8 bit notation
The diagram represents bit layout of the multi-bit VLAN update
message format. Re-draw the numbers using base 8, and mark the
bit values every 8 bits at the top. This should make it more
easy to grasp the table quickly.
Qi Zhang [Wed, 8 Mar 2017 06:18:54 +0000 (01:18 -0500)]
net/fm10k/base: add new item to lport msg attr
Add FM10K_PF_ATTR_ID_ERR, since it is possible for the switch manager
to send out an error message indicating status of the LPORT_MAP due to
zero allocated bandwidth.
Qi Zhang [Wed, 8 Mar 2017 06:18:53 +0000 (01:18 -0500)]
net/fm10k/base: clean up the logic
Clean up the logic in fm10k_tlv_attr_parse, we
should not reply on that FM10K_NOT_IMPLEMENTED is
greater than zero, as this can easily cause confusion.
The patch also correct a minor document error.
Qi Zhang [Wed, 8 Mar 2017 06:18:50 +0000 (01:18 -0500)]
net/fm10k/base: reset multicast mode when deleting lport
Deleting lport when multicast mod is configured to
FM10K_XCAST_MODE_ALLMULTI or FM10K_XCAST_MODE_PROMISC will
result in generating orphaned multicast-group entries in the
switch manager.
Before deleting the lport, reset multicast mode to
FM10K_XCAST_MODE_NONE to flush out these multicast-group
entries.
net/sfc/base: separate limitations on Tx DMA descriptors
Siena has limitation on maximum byte count and 4k boundary crosssing
(which is stricter than maximum byte count).
EF10 has limitation on maximum byte count only.
Fixes: f7dc06bf35f2 ("net/sfc/base: import 5xxx/6xxx family support") Fixes: e7cd430c864f ("net/sfc/base: import SFN7xxx family support") Fixes: 94190e3543bf ("net/sfc/base: import SFN8xxx family support") Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>