Decouple ice_cfg_lldp_mib_change from the ice_init_dcb function call.
Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Once upon a time, the ice_flow_create_xtrct_seq() function in ice_flow.c
extracted only protocol fields explicitly specified by the caller of the
ice_flow_add_prof() function via its struct ice_flow_seg_info instances.
However, to support different ingress and egress flow profiles with the
same matching criteria, it would be necessary to also match on the
packet Direction metadata. The primary reason was because there could
not be more than one HW profile with the same CDID, PTG, and VSIG. The
Direction metadata was not a parameter used to select HW profile IDs.
Thus, for ACL, the direction flag would need to be added to the
extraction sequence. This information will be use later as one criteria
for ACL scenario entry matching.
Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
According to API, 'rte_dev_probe()' and 'rte_dev_remove()' must
return 0 or negative error code. Bus code returns positive values
if device wasn't recognized by any driver, so the result of
'bus->plug/unplug()' must be converted. 'local_dev_probe()' and
'local_dev_remove()' also has their internal API, so the conversion
should be done there.
Positive on remove means that device not found by driver.
Positive on probe means that there are no suitable buses/drivers,
i.e. device is not supported.
Users of these API fixed to provide a good example by respecting
DPDK API. This also will allow to catch such issues in the future.
Fixes: a3ee360f44 ("eal: add hotplug add/remove device")
Fixes: 244d513071 ("eal: enable hotplug on multi-process")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Putting a '__attribute__((deprecated))' in the middle of a function
prototype does not result in the expected result with gcc (while clang
is fine with this syntax).
$ cat deprecated.c
void * __attribute__((deprecated)) incorrect() { return 0; }
__attribute__((deprecated)) void *correct(void) { return 0; }
int main(int argc, char *argv[]) { incorrect(); correct(); return 0; }
$ gcc -o deprecated.o -c deprecated.c
deprecated.c: In function ‘main’:
deprecated.c:3:1: warning: ‘correct’ is deprecated (declared at
deprecated.c:2) [-Wdeprecated-declarations]
int main(int argc, char *argv[]) { incorrect(); correct(); return 0; }
^
Move the tag on a separate line and make it the first thing of function
prototypes.
This is not perfect but we will trust reviewers to catch the other not
so easy to detect patterns.
sed -i \
-e '/^\([^#].*\)\?__rte_experimental */{' \
-e 's//\1/; s/ *$//; i\' \
-e __rte_experimental \
-e '/^$/d}' \
$(git grep -l __rte_experimental -- '*.h')
Special mention for rte_mbuf_data_addr_default():
There is either a bug or a (not yet understood) issue with gcc.
gcc won't drop this inline when unused and rte_mbuf_data_addr_default()
calls rte_mbuf_buf_addr() which itself is experimental.
This results in a build warning when not accepting experimental apis
from sources just including rte_mbuf.h.
For this specific case, we hide the call to rte_mbuf_buf_addr() under
the ALLOW_EXPERIMENTAL_API flag.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
We had some inconsistencies between functions prototypes and actual
definitions.
Let's avoid this by only adding the experimental tag to the prototypes.
Tests with gcc and clang show it is enough.
git grep -l __rte_experimental |grep \.c$ |while read file; do
sed -i -e '/^__rte_experimental$/d' $file;
sed -i -e 's/ *__rte_experimental//' $file;
sed -i -e 's/__rte_experimental *//' $file;
done
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Those symbols are declared in the library map but the prototypes are
missing the experimental tag.
Without it, existing users won't notice it is experimental.
Fixes: ec0dec44ec ("net/atlantic: enable MACsec configuration")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
This driver had a bogus assert which could never happen.
This triggers "expression is always false warnings" with some
compilers which causes build failure.
Just remove it.
Fixes: 2af14ca79c ("net/qede: support 100G")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Rasesh Mody <rmody@marvell.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
This driver had a bogus assert which could never happen.
This triggers "expression is always false warnings" with some
compilers which causes build failure.
Just remove it.
Fixes: 6041aa619f ("net/bnx2x: fix poll link status")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Rasesh Mody <rmody@marvell.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
We should check the descriptor state instead of vq's internal
free count (i.e. the number of descriptors that we haven't made
available) for the remaining mergeable packets.
Fixes: a76290c8f1 ("net/virtio: implement Rx path for packed queues")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
When there is no enough segments for a packet in mergeable
packed Rx path, we should free the whole mbuf chain instead
of just recycling the last segment.
Fixes: a76290c8f1 ("net/virtio: implement Rx path for packed queues")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
When there is no enough segments for a packet in mergeable
Rx path, we should free the whole mbuf chain instead of just
recycling the last segment.
Fixes: bcac5aa207 ("net/virtio: improve batching in mergeable path")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
When there is no enough segments for a packet in in-order
mergeable Rx path, we should free the whole mbuf chain instead
of just recycling the last segment.
Fixes: e5f456a98d ("net/virtio: support in-order Rx and Tx")
Cc: stable@dpdk.org
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
VLAN tag insertion should be in Tx prepare, not in Tx burst functions.
One of Tx prepare goals is to be able to do preparations in advance
(possibly on different CPU core) and then transmit it fast.
Also Tx prepare can report that a packet does not pass Tx offloads
check. E.g. has no enough headroom to insert VLAN header.
Fixes: 4fb7e803eb ("ethdev: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Virtio requires pseudo-header checksum in TCP/UDP checksum to do
offload, but it was lost when Tx prepare is introduced. Also
rte_validate_tx_offload() should be used to validate Tx offloads.
Also it is incorrect to do virtio_tso_fix_cksum() after prepend
to mbuf without taking prepended size into account, since layer 2/3/4
lengths provide incorrect offsets after prepend.
Fixes: 4fb7e803eb ("ethdev: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private
resources for the port can be freed by rte_eth_dev_close().
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
We should unmap the device when we failed to initialize the device.
Fixes: 6ba1f63b5a ("virtio: support specification 1.0")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
For legacy devices, we should also unmap the port IO
resource on device removal.
Fixes: b8f04520ad ("virtio: use PCI ioport API")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
We should free queues when we failed to initialize the virtio device.
Fixes: 26b683b4f7 ("net/virtio: setup Rx queue interrupts")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
DEBUG_DUMP_DESC flag is commented out in IAVF Makefile and to enable
it user needs to edit the Makefile. It is felt that this method is not
good. Hence removing this flag from IAVF makefile and adding a flag
CONFIG_RTE_LIBRTE_IAVF_DEBUG_DUMP_DESC to config/common_base.
Signed-off-by: Lavanya Govindarajan <lavanyax.govindarajan@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
This driver was inserting its own stub for queue_stats_mapping which
did nothing but cause this device to return a different errno
than every other device driver. All devices that don't implement
queue stats mapping should return the same error.
Maybe the plan originally was to implement something, if that
ever happens, just put in the right code.
Fixes: 4861cde461 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Copy/paste from i40e, let's align with the fix on i40e.
Fixes: a37bde5631 ("net/ice: support statistics")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
i40e and i40evf currently use two different names for the statistic on
dropped packets on the rx and tx sides.
Let's prefer i40evf so that all statistics are suffixed with _packets.
This also avoids a statistic name conflict in OVS.
Fixes: f4a91c38b4 ("i40e: add extended stats")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
In 'ipn3ke_hw_tm_node_wr()', elements of 'n->parent_node' are accessed
but 'n->parent_node' can be NULL.
After applying this patch, this null pointer dereference is avoided.
Coverity issue: 337921
Fixes: c820468ac9 ("net/ipn3ke: support TM")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Check input argument "rte_eth_dev *ethdev", to be sure variable is not
NULL before operating on it.
Coverity issue: 337922
Fixes: 70d6b7f550 ("net/ipn3ke: add representor")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Whether the if statement is true or not, the operation is identical.
It is unnecessary to check the if statement, so just delete the if
statement.
Coverity issue: 337928
Fixes: c820468ac9 ("net/ipn3ke: support TM")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
The VF spinlock was never initialized. It works because it is
in zmalloc'd memory and an unlocked lock on x86 is 0.
But for good practice, all spinlock's should be initialized.
Fixes: dc7680e859 ("net/netvsc: support integrated VF")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Implement the efx_proxy_auth_privilege_mask_get() to get a function's
privilege mask and efx_proxy_auth_privilege_modify() to add/remove
privileges for a function specified by PF and VF index.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Hypervisor should be able to track VF statistics.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Implement functions to set vPort VLAN and MAC address and reset the vPort.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Implement the APIs for PROXY_CMD, PROXY_COMPLETE and PRIVILEGE_MASK
messages to allow client drivers authorize VF operations like set MAC,
set MTU etc. with firmware.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Add the capability to receive MCDI proxy event from firmware and
invoke the client driver registered function to handle it.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
VMware expects that certain kind of configurations made on the VFs are
authorized by the ESXi before these are applied e.g. assigning a MAC
address to the VF, setting MTU etc. Firmware supports a feature called
MCDI proxy which will be used to implement this authorization check.
The proxy auth module is governed by EFSYS_OPT_MCDI_PROXY_AUTH switch.
This patch adds the framework for proxy auth module along with the APIs
required for SR-IOV initialization.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
ef10_nic_init() allocates a vAdaptor for the physical port in current
flow. In case of SR-IOV, this vAdaptor must be created for the PF as the
vSwitch is allocated on the physical port. So, the call to
efx_mcdi_vadaptor_alloc() should be avoided in ef10_nic_init() in SR-IOV
flow. To achieve this, for SR-IOV use case, the vSwitch is created
before NIC initialization and its handle is used to prevent vAdaptor
allocation in ef10_nic_init(). This approach has been taken to minimize
the changes in NIC initialization flow.
This is also the case with Linux driver where vSwitch creation happens
before NIC initialization.
Also, when DMA queues need to be allocated for Tx/Rx functionality
(MC_CMD_INIT_RXQ / MC_CMD_INIT_TXQ), the correct vPort is selected
based on efx_vswitch_t property of efx_nic_t structure - vport
corresponding to PF in case of SR-IOV use case and EVB_PORT_ID_ASSIGNED
for physical port.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Separate out vAdaptor allocation from ef10_nic_init() as it is not
required for SR-IOV use case. In case of SR-IOV, vAdaptor is allocated
early along with vSwitch creation and vPort configuration.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
The vSwitch create API takes an array of num_vports client driver
allocated vPort config entries where entry at index 0 contains the PF
configuration and rest num_vports-1 entries refer to vPort configuration
for VFs 0 to (num_vports-2). The required hierarchy
(vswitch/vport/vadaptor) is created within this API. The destroy API
tears down this hierarchy and releases memory for the vSwitch object.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Implement functions to allocate and free vSwitch, vPort and vAdaptor.
Also, implement functions to add and delete vPort MAC address and EVB
port assign.
Most of the efx_evb_ops_t functions take vSwitch ID as a parameter for
future enhancements. Currently, firmware doesn't implement vSwitch
identifier and hence this parameter is unused for EF10 architecture
implementation.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Add the functions to implement the vPort and vSwitch MCDI calls.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Implement the framework for Enterprise Virtual Briding (EVB) module.
SR-IOV augments the software virtual switch with NIC capabilities
supported from EVB module.
Further patches will add APIs to create and destroy EVB switching
hierarchy required for SR-IOV and APIs to set vPort properties like MAC,
VLAN etc.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Proxy authorization module for SR-IOV requires one instance of proxy
data structures per card. In order to achieve this, proxy data
structures will be allocated only for primary port (port id 0) and other
secondary ports in the card will access those data structures through
reference to primary port. Accordingly, the port number obtained from
efx_mcdi_get_port_assignment is stored in NIC configuration as
enc_mcdi_port.
Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Allows to enable additional functionality related to this OEM
(e.g. vendor extensions to VPD, NC-SI etc.)
Signed-off-by: Kevin Lampis <klampis@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Request firmware updates be performed in background mode.
In this mode MCDI to the function processing the update
remains accessible and the client polls for completion.
This is supported for lengthy partition updates such as
MCFW and bundles. The MC ignores the flags used for this
mode for other partition updates.
Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Old NVRAM info API required function prototype too often.
Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
All signed images other than for the MCFW partition should
be written fully to the partition with no rearrangement.
Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Add definitions header for reflash header IDs. This is required to
support different handling modes for signed firmware images.
Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Add function to query partition characteristics.
Refactor efx_nvram_size to share implementation.
Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>