The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
To improve code quality we want to turn on as many warnings as we can in
the DPDK code, so turn on the "unused-parameter" warning in meson builds to
match that of the make builds. To ensure correct compilation, disable the
warning selectively for driver base code that otherwise would have issues.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Since we change these macros, we might as well avoid triggering complaints
from checkpatch because of mixed case.
old=RTE_IPv4
new=RTE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"
old=RTE_ETHER_TYPE_IPv4
new=RTE_ETHER_TYPE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"
old=RTE_ETHER_TYPE_IPv6
new=RTE_ETHER_TYPE_IPV6
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
After setting up the link on x552/X557-AT 10GBASE-T NICs, sometimes the
link does not get set up properly and as a result all the subsequent
calls to ixgbe_check_link() from ixgbe_dev_link_update_share() fail.
Introduce a delay time of 1s in ixgbe_setup_mac_link_t_X550em() before
beginning to set up the external PHY link speed to ensure that the
controller can acquire the link.
Signed-off-by: Ashijeet Acharya <ashijeet.acharya@6wind.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Add 'RTE_' prefix to defines:
- rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN.
- rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN.
- rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN.
- rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN.
- rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN.
- rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN.
- rename ETHER_MTU as RTE_ETHER_MTU.
- rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN.
- rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID.
- rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN.
- rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU.
- rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR.
- rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR.
- rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4.
- rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6.
- rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP.
- rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN.
- rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP.
- rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ.
- rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG.
- rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588.
- rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW.
- rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB.
- rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP.
- rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS.
- rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM.
- rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN.
- rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE.
- rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4.
- rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6.
- rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH.
- rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH.
- rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS.
- rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP.
- rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG.
- rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN.
Do not update the command line library to avoid adding a dependency to
librte_net.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Add 'rte_' prefix to structures:
- rename struct ether_addr as struct rte_ether_addr.
- rename struct ether_hdr as struct rte_ether_hdr.
- rename struct vlan_hdr as struct rte_vlan_hdr.
- rename struct vxlan_hdr as struct rte_vxlan_hdr.
- rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr.
Do not update the command line library to avoid adding a dependency to
librte_net.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tx desc's DD status is not cleaned by NIC automatically after packets
have been transmitted until software refill a new packet during next
loop. So when tx_free_thresh + tx_rs_thresh > nb_desc, it is possible
that an outdated DD status be checked as tx_next_dd, then segment fault
happen due to free a NULL mbuf pointer.
Then patch fixes this issue by
1. try to adapt tx_rs_thresh to an aggressive tx_free_thresh.
2. queue setup fail when tx_free_thresh + tx_rs_thresh > nb_desc
Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
The nic's interrupt source has some active handler, which maybe call
ixgbe_dev_link_update() to set link handler. We should cancel the
link handler before remove dev to prevent executing the link handler.
It triggers segfault.
Fixes: 0408f47ba4 ("net/ixgbe: fix busy polling while fiber link update")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
Compiling on Fedora 30, we get the following warning, causing build failure
when Werror flag is set:
../drivers/net/ixgbe/ixgbe_rxtx.c:2141:14: warning:
‘nmb’ may be used uninitialized in this function [-Wmaybe-uninitialized]
2141 | rxe->mbuf = nmb;
| ~~~~~~~~~~^~~~~
Initializing the value to "NULL" fixes the issue.
Fixes: 8eecb3295a ("ixgbe: add LRO support")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Currently, if requested MTU is bigger than mbuf size and scattered
receive is not enabled, setting MTU to that value fails.
This patch allows setting this special MTU when device is stopped,
because scattered_rx will be re-configured during next port start
and driver may enable scattered receive according new MTU value.
After this patch, driver may select different receive function
automatically after MTU set, according MTU values selected.
Signed-off-by: David Harton <dharton@cisco.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
This patch enable 10Mb/s link for ixgbe X553.
This new device has own device id of 0x15E4 and 0x15E5, so
ixgbe PMD driver need to special check when setup link for
these two types of device.
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Do a global replace of snprintf(..."%s",...) with strlcpy, adding in the
rte_string_fns.h header if needed. The function changes in this patch were
auto-generated via command:
spatch --sp-file devtools/cocci/strlcpy.cocci --dir . --in-place
and then the files edited using awk to add in the missing header:
gawk -i inplace '/include <rte_/ && ! seen { \
print "#include <rte_string_fns.h>"; seen=1} {print}'
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
This commit sets the min and max supported MTU values for ixgbe VF
devices via the ixgbevf_dev_set_mtu() function. Min MTU supported is
set to ETHER_MIN_MTU and max MTU is calculated as the max packet length
supported minus the transport overhead. As transport overhead is the
same for VF and PF ixgbe devices, reuse MACRO 'IXGBE_ETH_OVERHEAD' to
avoid duplication.
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit sets the min and max supported MTU values for ixgbe devices
via the ixgbe_dev_info_get() function. Min MTU supported is set to
ETHER_MIN_MTU and max MTU is calculated as the max packet length
supported minus the transport overhead. To aid in these calculations
a new MACRO 'IXGBE_ETH_OVERHEAD' has been introduced to consolidate
overhead calculation and avoid duplication.
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
ixgbevf VLAN strip and extend capabilities were removed when
migrating to the bit flags implementation.
Restoring the capability to enable the VLAN strip offload at
configuration time.
Fixes: ec3b1124d1 ("net/ixgbe: convert to new Rx offloads API")
Cc: stable@dpdk.org
Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
The patch adds the PF counterpart changes to support VF promiscuous
mode by DPDK PF driver.
For ixgbe, in order to support VF VLAN promiscuous or unicast
promiscuous, PF need to set register PFVML2FLT of bit UPE and VPE.
The patch aligned to kernel driver's implementation.
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
The NIC's interrupt source has some active handler when the
port removed. We should cancel the delay handler before removing
dev to prevent executing the delay handler.
Call Trace:
#0 ixgbe_disable_intr (hw=0x0, hw=0x0)
at /usr/src/debug/dpdk-18.11/drivers/net/ixgbe/ixgbe_ethdev.c:852
#1 ixgbe_dev_interrupt_delayed_handler (param=0xadb9c0
<rte_eth_devices@@DPDK_2.2+33024>)
at /usr/src/debug/dpdk-18.11/drivers/net/ixgbe/ixgbe_ethdev.c:4386
#2 0x00007f05782147af in eal_alarm_callback (arg=<optimized out>)
at /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/
eal_alarm.c:90
#3 0x00007f057821320a in eal_intr_process_interrupts (nfds=1,
events=0x7f056cbf3e88) at /usr/src/debug/dpdk-18.11/lib/
librte_eal/linuxapp/eal/eal_interrupts.c:838
#4 eal_intr_handle_interrupts (totalfds=<optimized out>, pfd=18)
at /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/
eal_interrupts.c:885
#5 eal_intr_thread_main (arg=<optimized out>)
at /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/
eal_interrupts.c:965
#6 0x00007f05708a0e45 in start_thread () from /usr/lib64/libpthread.so.0
#7 0x00007f056eb4ab5d in clone () from /usr/lib64/libc.so.6
Fixes: 2866c5f1b8 ("ixgbe: support port hotplug")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Loopback mode is also supported on X540 and X550 NICs, according to
their datasheet (section 15.2). The way to set it up is a little
different of the 82599.
Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
Only TX->RX loopback is supported currently on 82599EB. If a user wants
to apply an another loopback configuration (!= IXGBE_LPBK_82599_TX_RX),
ixgbe PMD ignores it and continues the configuration without raising
any error.
Let's increase robustness of this part by checking if the requested
loopback mode is correct for the current device, before starting it.
If it is not valid, PMD will refuse to start.
Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
According to the current implementation, all VFs will set bit
IXGBE_VMOLR_ROMPE during initialization, this cause any VF
will accept packets that match the MTA table. Since the MTA
table is shared by all VFs which means if one VF update MTA
table in function ixgbe_vf_set_multicast, then all other VFs
will receive multicast packets which cause unnecessary
performance overhead.
So it's better to set VF's ROPE bit of register VMOLR only
if multicast address filter is required on that VF.
Also, the ROPE bit should be reset when multicast address
filter is requested to clean.
This patch also aligns to the related fix on ixgbe
kernel driver 5.3.7.
Fixes: 00e30184da ("ixgbe: add PF support")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
When starting the device, the RSS table is initialized. So the RSS
update before device_start would be overwritten. This patch allows users
to update the RSS reta table before device_start.
Fixes: db5b65301d ("ethdev: allow to set RSS hash computation flags and/or key")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
ixgbe is able to recognize 1G SX and LX id, but it is missing the LHA.
Add it, so that it can handle LHA SFP plugin.
Fixes: d2e72774e5 ("ixgbe/base: support X550")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
The only time that software should write to the TDH register
is after a reset (hardware reset or CTRL.RST) and
before enabling the transmit function (TXDCTL.ENABLE).
If software were to write to this register while the transmit
function was enabled, the on-chip descriptor buffers might
be invalidated and the hardware could become confused.
Fixes: 029fd06d40 ("ixgbe: queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
As the code has changed the max wait time to 1000ms, the comment should
be changed accordingly.
Fixes: 64f1c8539c ("net/ixgbe: wait longer for link after fiber MAC setup")
Cc: stable@dpdk.org
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
For ixgbevf kernel driver, link status changes from down to up
will trigger vf kernel driver send IXGBE_VF_RESET message to pf
kernel driver, after this, vf kernel driver will disable and enable
it self. By these series operations, the vf kernel driver report
link up. Besides, all these operations handles in kernel thread.
For DPDK user space driver, it only gets link status changes from
down to up, but miss IXGBE_VF_RESET message sending and reset itself.
If we will add fully implementation of link status change for DPDK
user space driver, we need take much more modification. We have
aligned that for link status changes from down to up we only notify
link is up, users need to reset vf port.
Fixes: dc66e5fd01 ("net/ixgbe: improve link state check on VF")
Cc: stable@dpdk.org
Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
If the multispeed fiber link is in DOWN state, ixgbe_setup_link
could take around a second of busy polling. This is highly
inconvenient for the case where single thread periodically
checks the link statuses. For example, OVS main thread
periodically updates the link statuses and hangs for a really
long time busy waiting on ixgbe_setup_link() for a DOWN fiber
ports. For case with 3 down ports it hangs for a 3 seconds and
unable to do anything including packet processing.
Fix that by shifting that workaround to a separate thread by
alarm handler that will try to set up link if it is DOWN.
Fixes: c12d22f65b ("net/ixgbe: ensure link status is updated")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Since we have enabled the hotplug mechanism for multi-process, it's not
necessary to return -EPERM when try detaches a device from a secondary
process.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Some global variables can indeed be static, add static keyword to them.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
NICs uses different delays up to a second during their
configuration. It makes no sense to busy-wait so long wasting
CPU cycles and preventing any other threads to execute on the
same CPU core. These busy polling are the rudiments that came
from the kernel drivers where you can not sleep in interrupt
context, but as we're in userspace, we're able and should
sleep to allow other threads to run.
Delays never called on rx/tx path, so this should not affect
performance.
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tx offload mask is updated in following commit: commit 1037ed842c
("mbuf: fix Tx offload mask"). Currently, the new added offload
flags are not supported in PMD and application will fail to call
PMD transmit prepare function.
This patch updates IXGBE_TX_OFFFLOAD_MASK.
Fixes: 1037ed842c ("mbuf: fix Tx offload mask")
Cc: stable@dpdk.org
Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
For function ixgbe_crypto_create_session, fetches ic_session from the
mempool. But on failure scenarios, the object is not released back to
mempool. Using rte_mempool_put the ic_session is put back to mempool.
Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
If hash function is 0, it should disable RSS then return 0.
Fixes: 518cc3927b ("net/ixgbe: move RSS to flow API")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
In ixgbe_flow_create function, ntuple filter is parsed first. If the
flow is considered to be ntuple filter, it will not go on to judge
ethertype filter, syn filter and fdir filter.
In the function ntuple_filter_to_5tuple, 5 tuple info is checked,
but it's too late to jump over the ntuple filter if it's a fdir filter.
Fixes: 46ea969177 ("net/ixgbe: add ntuple support to flow parser")
Cc: stable@dpdk.org
Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
The representor id is added in rte_eth_dev_data in order to be able
to match a port with its representor id in devargs.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
This is a clean-up of common ethdev data freeing.
All data freeing are moved to rte_eth_dev_release_port()
and done only in case of primary process.
It is probably fixing some memory leaks for PMDs which were
not freeing all data.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
eal: add shorthand __rte_weak macro
qat: update code to use __rte_weak macro
avf: update code to use __rte_weak macro
fm10k: update code to use __rte_weak macro
i40e: update code to use __rte_weak macro
ixgbe: update code to use __rte_weak macro
mlx5: update code to use __rte_weak macro
virtio: update code to use __rte_weak macro
acl: update code to use __rte_weak macro
bpf: update code to use __rte_weak macro
Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
At the tail end of comment about barriers (I feel your pain);
remove mild profanity.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
After setting up the link on a fiber port, the maximum wait time for
the link to come up is 500 ms in ixgbe_setup_mac_link_multispeed_fiber().
On an x550 SFP+ port, this is often not sufficiently long for the link
to come up. This can result in never being able to retrieve accurate
link status for the port using rte_eth_link_get_nowait().
Increase the maximum wait time in ixgbe_setup_mac_link_multispeed_fiber()
to 1 s.
Bugzilla ID: 69
Fixes: f3430431ab ("ixgbe/base: add SFP+ dual-speed support")
Cc: stable@dpdk.org
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Since rte_intr_enable is called at init and start time. Remove it in
interrupt_action function to avoid too many system calls.
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
In former API, ETH_TXQ_FLAGS_NOMULTSEGS was merely a hint indicating
that application will never send multisegmented packets, allowing
pmd to choose different tx methods accordingly.
In new API, DEV_TX_OFFLOAD_MULTI_SEGS became an offload capability
that is advertised by pmds, some of them do not advertise it and
expect to never receive fragmented packets (octeontx, axgbe)
So an ethdev that supports multisegmented packets should properly
advertise it.
Problem was spotted and tested on e1000, should be also present in
ixgbe_vf representor.
Fixes: cf80ba6e20 ("net/ixgbe: add support for representor ports")
Cc: stable@dpdk.org
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>