Enabling/disabling of allmulticast mode is not always successful and
it should be taken into account to be able to handle it properly.
When correct return status is unclear from driver code, -EAGAIN is used.
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Change return value of the callbacks from void to int. Make
implementations across all drivers return negative errno
values in case of error conditions.
Both callbacks are updated together because a large number of
drivers assign the same function to both callbacks.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Enabling/disabling of promiscuous mode is not always successful and
it should be taken into account to be able to handle it properly.
When correct return status is unclear from driver code, -EAGAIN is used.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Change eth_dev_infos_get_t return value from void to int.
Make eth_dev_infos_get_t implementations across all drivers to return
negative errno values if case of error conditions.
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Substitute driver-defined P2ROUNDUP() h with EFX_P2ROUNDUP()
defined in libefx.
Cast value and alignment to one specified type to guarantee result
correctness.
Fixes: e1b9445985 ("net/sfc: build libefx")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the resources
for the port can be freed by rte_eth_dev_close() and the ethdev
port freed.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
PCI device may be unplugged when ethdev is not closed yet.
Fixes: aaa3f5f0f7 ("net/sfc: add configure and close stubs")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
When Rx interrupts are disabled, we simply disable rearm when
the interrupt fires the next time. So, the next packet will
trigger interrupt (if it is not happened yet after previous Rx
burst processing).
Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.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>
Rx queue setup function checks configured MTU to make sure that
no oversized packets can be received. But a following call to
set MTU function might make this check irrelevant.
Add a function to check MTU size against Rx buffer size and
additional Rx queue info, including Rx scatter offload.
Fixes: e961cf425e ("net/sfc: support MTU change")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Implement generic checks in Tx prepare function and update Tx burst
function accordingly.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Phy capabilities are bit offsets in libefx, but was used as bit masks.
Fixes: d23f3a89ab ("net/sfc: support link speed and duplex settings")
Fixes: f82e33afbb ("net/sfc: support link speeds up to 100G")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Secondary process needs to know RxQ state.
RxQ control structure will become primary process private.
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
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>
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>
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>
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>
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>
Dynamic log type value may differ in different processes.
Fixes: f28ede500c ("net/sfc: support multi-process")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Rx queue count may be used from data core and it should not
generate control path logs.
Fixes: 04aa6b9c5f ("net/sfc: get RxQ pending descriptors count")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Errors, missed and pauses should not be included in delivered
good Rx packets reported by ipackets.
Fixes: 1caab2f1e6 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Rx and Tx datapath references were mixed up in a couple
of log statements and commentary blocks in the original
commit. Correct datapath name references in said places.
Fixes: f28ede500c ("net/sfc: support multi-process")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
VADAPTER_RX_OVERFLOW means Rx statistics overflow, not a missed
packet because of overflow.
VADAPTER_RX_BAD_PACKETS accumulates a number of error conditions,
but mainly impossibility to deliver because of no descriptors
available, so it is better to classify it as imissed.
Fixes: 1caab2f1e6 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org
Signed-off-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>
If global RSS is not enabled in the multiqueue mode setting,
it will not be possible to change RSS configuration. However,
querying default RSS settings should be possible in any case since
it may be needed by RTE flow API users to find out what RSS settings
will be used by default for a flow rule with RSS action if custom
RSS key and hash function choice are not specified.
Fixes: 63ab5e0c8f ("net/sfc: use zero RSS channels as disabled RSS indicator")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>