Fm10k host driver can't manage PHY directly and provides a fake link
status by always reporting LINK_UP. We should initialize link status
in device start, otherwise application will get LINK_DOWN status
when LSC configured.
Fixes: 9ae6068c86 ("fm10k: add dev start/stop")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Instead of many PMD define their own macro, define a generic one in
ethdev and use that in PMDs.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
remove __rte_unused instances that are not required.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
The vector PMD is very sensitive to the layout of the mbuf, especially on
the RX path. Add in some compile-time checks to make sure the mbuf layout
assumptions are valid, and to provide hints to anyone changing the mbuf
where things may need to be updated.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Different drivers use internal macros like force_inline for compiler
always inline feature.
Standardizing it through __rte_always_inline macro.
Verified the change by comparing the output binary file.
No difference found in the output binary file with this change.
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
vfio is the kernel framework used by the vfio-pci kernel driver.
DPDK drivers do not rely solely on vfio, but rather on vfio-pci to gain
access to pci resources.
Fixes: 0880c40113 ("drivers: advertise kmod dependencies in pmdinfo")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
For base code in drivers shared with other projects, disable the new
warnings from gcc 7 about unlabelled fall-through in switch statements.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Some customers find adding MAC addr to VF sometimes can fail,
but it is still stored in dev->data->mac_addrs[ ]. So this
can lead to some errors that assumes the non-zero entry in
dev->data->mac_addrs[ ] is valid.
Following acknowledgements are from specific NIC PMD
maintainer for their managing part.
This patch changes the ethdev internal API, it should not be
backported to a stable/LTS release so far.
Fixes: af75078fec ("first public release")
Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
The patch change the prototype of callback function
(rte_intr_callback_fn) by removing the unnecessary parameter.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
To avoid multiple stores on fast path, Ethernet drivers
aggregate the writes to data_off, refcnt, nb_segs and port
to an uint64_t data and write the data in one shot
with uint64_t* at &mbuf->rearm_data address.
Some of the non-IA platforms have store operation overhead
if the store address is not naturally aligned.This patch
fixes the performance issue on those targets.
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Document the function and make it public, since it is used at several
places in the drivers. The old one is marked as deprecated.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
If the primary process has initialized all the queues to vector
pmd mode, the secondary process should not use scalar code path,
because the per queue data structures haven't been prepared for
that, e.g. txq->ops is for vector Tx rather than scalar Tx.
Fixes: a6ce64a975 ("fm10k: introduce vector driver")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
To add a wrapper function to remove the limit of tx burst size.
The patch makes fm10k vec function an best effort to transmit
pkts in the consistent behavior like fm10k_xmit_pkts does that.
Cc: Jing Chen <jing.d.chen@intel.com>
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
The device specific data is located at dev->data->dev_private.
Fixes: 162f32290a ("fm10k: move parameters initialization")
Fixes: 039991bc28 ("fm10k: add vector pre-condition check")
Fixes: 77a8ab47eb ("fm10k: select best Rx function")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
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.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Before this patch, the management of dependencies between directories
had several issues:
- the generation of .depdirs, done at configuration is slow: it can take
more than one minute on some slow targets (usually ~10s on a standard
PC without -j).
- for instance, it is possible to express a dependency like:
- app/foo depends on lib/librte_foo
- and lib/librte_foo depends on app/bar
But this won't work because the directories are traversed with a
depth-first algorithm, so we have to choose between doing 'app' before
or after 'lib'.
- the script depdirs-rule.sh is too complex.
- we cannot use "make -d" for debug, because the output of make is used for
the generation of .depdirs.
This patch moves the DEPDIRS-* variables in the upper Makefile, making
the dependencies much easier to calculate. A DEPDIRS variable is still
used to process library dependencies in LDLIBS.
After this commit, "make config" is almost immediate.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Robin Jarry <robin.jarry@6wind.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
dev_flags is wrongly overwritten with RTE_ETH_DEV_DETACHABLE value
in drivers after rte_eth_copy_pci_info().
Previous values of the dev_flags set in rte_eth_copy_pci_info(),
like RTE_ETH_DEV_INTR_LSC, are get lost. That will fail the device
configuration.
Fix by preventing dev_flags overwritten.
Fixes: 22dda618c0 ("pci: separate detaching ethernet ports from PCI devices")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Jeff Guo <jia.guo@intel.com>
Replace the raw I/O device memory read/write access with eal
abstraction for I/O device memory read/write access to fix
portability issues across different architectures.
CC: Jing Chen <jing.d.chen@intel.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Attaching and detaching ethernet ports from an application
is not the same thing as physically removing a PCI device,
so clarify the flags indicating support. All PCI devices
are assumed to be physically removable, so no flag is
necessary in the PCI layer.
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
The function rte_eth_xstats_get() return an array of tuples (id,
value). The value is the statistic counter, while the id references a
name in the array returned by rte_eth_xstats_get_name().
Today, each 'id' returned by rte_eth_xstats_get() is equal to the index
in the returned array, making this value useless. It also prevents a
driver from having different indexes for names and value, like in the
example below:
rte_eth_xstats_get_name() returns:
0: "rx0_stat"
1: "rx1_stat"
2: ...
7: "rx7_stat"
8: "tx0_stat"
9: "tx1_stat"
...
15: "tx7_stat"
rte_eth_xstats_get() returns:
0: id=0, val=<stat> ("rx0_stat")
1: id=1, val=<stat> ("rx1_stat")
2: id=8, val=<stat> ("tx0_stat")
3: id=9, val=<stat> ("tx1_stat")
This patch fixes the drivers to set the 'id' in their ethdev->xstats_get()
(except e1000 which was already doing it), and fixes ethdev by not setting
the 'id' field to the index of the table for pmd-specific stats: instead,
they should just be shifted by the max number of generic statistics.
Fixes: bd6aa172cf ("ethdev: fetch extended statistics with integer ids")
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
This makes struct rte_eth_dev independent of struct rte_pci_device by
replacing it with a pointer to the generic struct rte_device.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Only the drivers itself can decide if it could fill PCI information fields
of dev_info.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Add a new macro RTE_PMD_REGISTER_KMOD_DEP() that allows a driver to
declare the list of kernel modules required to run properly.
Today, most PCI drivers require uio/vfio.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
The SGLORT (Source Global Resource Tag) of the VF queues should be
assigned by PF driver, VF driver should not set these registers.
Fixes: 3b845bf6bc ("fm10k: fix switch manager high CPU usage")
Reported-by: Sarath Somasekharan <sarathx.somasekharan@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
In vPMD, when we load Rx desc with _mm_loadu_si128, the volatile
modifier will be cast away, allowing the compiler to reorder the
load instructions.
The Rx recv function's correctness is relying on these load
instructions following a strict sequence, reading the descriptors
in reverse order, so we add compiler barrier to prevent compiler
reorder.
Fixes: 7092be8437 ("fm10k: add vector Rx")
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
All macros related to driver registeration renamed from DRIVER_*
to RTE_PMD_*
This includes:
DRIVER_REGISTER_PCI -> RTE_PMD_REGISTER_PCI
DRIVER_REGISTER_PCI_TABLE -> RTE_PMD_REGISTER_PCI_TABLE
DRIVER_REGISTER_VDEV -> RTE_PMD_REGISTER_VDEV
DRIVER_REGISTER_PARAM_STRING -> RTE_PMD_REGISTER_PARAM_STRING
DRIVER_EXPORT_* -> RTE_PMD_EXPORT_*
Fix PMDINFOGEN tool to look for matches of RTE_PMD_REGISTER_*.
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.
Since vector Rx supports checksum offload, this patch removes the
hw_ip_checksum check in fm10k_rx_vec_condition_check().
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
A previous patch removed some necessary lines about Rx checksum offload
by mistake, this patch adds them back.
Fixes: 6046898f50 ("net/mbuf: remove unused Rx error flags")
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
When testpmd quits with two ports, the second port's MAC address
remains in the MAC table of switch manager.
There needs to be some time for HW to quiesce when closing a port,
otherwise a subsequent port close won't be handled correctly.
This patch adds a delay after turning off a logic port, just as
the kernel driver does.
Fixes: 8b5c9ec20b ("fm10k: support VMDQ in MAC/VLAN filter")
Reported-by: Xueqin Lin <xueqin.lin@intel.com>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>