Merge i40evf_dev_stats_get and i40evf_get_statistics to be one function.
Rename i40evf_update_stats to i40evf_query_stats,
and chang i40evf_update_vsi_stats to i40evf_update_stats.
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Testpmd calculates packet throughput by getting a diff of previous stats
value and current one.
If a stats clear called after previous sample taken, the diff will be
negative and throughput calculation will be wrong.
If current stats value is smaller than previous one, set throughput to
zero.
Fixes: 0e10698030 ("app/testpmd: show throughput in port stats")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Clearing VSI stats done by setting an offset value to latest stats
and further stats values are subtracted from that offset.
This setting offset and baselining logic exists in PF driver, but for VF
there is no way to update its VSI offset in the PF.
So same baselining logic added into VF, also setting VSI offset in VF
fixed to support VF stats clear.
Fixes: da61cd0849 ("i40evf: add extended stats")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
- Use rte_malloc() instead of malloc() for the per device 'vdev' structure
so that it can be shared across processes.
- Only initialize the device if the process type is RTE_PROC_PRIMARY
- Only allow the primary process to do queue setup, start/stop, promisc
allmulticast, mac add/del, mtu.
Fixes: fefed3d1e6 ("enic: new driver")
Cc: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
tap_intr_handle_set() called by tap_dev_start(), and if LSC is disabled
(dev_conf.intr_conf.lsc == 0), it tries to unregister interrupt
callback without checking the interrupt file descriptor.
Fixes: c0bddd3a05 ("net/tap: add link status notification")
Cc: stable@dpdk.org
Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Pascal Mazon <pascal.mazon@6wind.com>
Retain user dcbx configurations till the config is applied to the adapter
i.e. till the negotiation completes. If base driver receives a config
update before negotiation completes, then base driver merges the new config
with the cached config and sends it to management FW.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Add per-PF virtual link support.
This feature adds a logical layer over the physical link to reflect the
control of OEM management protocols either thru' sideband or a switch.
For example, a switch could send a link-down tlv for a PF and this will
put down logical link and virtual link in shared mem (SHMEM) for that PF
inspite of physical link being up for that port.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
- Add an internal API ecore_dcbx_get_dscp_value() for getting the
dscp value for a given priority.
- Initialize dscp parameters in the dcbx-config cache to be used by
the clients for configuring dcbx parameters.
- Reset NIG_REG_DSCP_TO_TC_MAP_ENABLE register when user disables the dscp.
- Fix to always send "dscp + dcbx" update to FW.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Determines whether VF utilizes doorbells via limited register bar or via
the doorbell bar and return the size of the HW doorbell bar via acquire
response. By doing that limit the VF CIDs to an amount that would make sure
doorbells for all CIDs fall within the bar.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Add support for UFP (Unified Fabric Port) multi-function mode.
It includes new APIs for reading UFP configuration, handling
UFP events, retriving UFP status and UFP ramrod update etc.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Upgrade QEDE PMD FW to version 8.30.12.0.
The firmware upgrade change details are as:
- Add support for steering by IP and UDP destination port.
- Add source QP field for GSI offload.
- Add UFP support.
- Add support for outer IPv4 TX CSO with unknown tunnel type (in addition
to inner header CSO).
- Support flow ID in accelerated RFS flow.
- Allow Doorbell on empty SPQ and LL2 TX queue (for doorbell recovery).
- Enable PCI Relaxed Ordering for L2 RX data placement.
- Additional enhancements and bug fixes
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Configure only the available/requested number of app entries rather
than max entries (DCBX_MAX_APP_PROTOCOL) in ecore_dcbx_get_app_data().
Also, fixed a minor issue where incorrect size value is being passed for
memcpy().
Fixes: 26ae839d06 ("qede: add DCBX support")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Change verbosity of events related to malicious VFs to DP_NOTICE
from DP_INFO. They are not just informational events.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
- Add ECORE_IS_CMT macro (CMT: couple mode teaming) and use that in all the
places where there are checks for number of HW functions per device > 1.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
If for some reason the send message from VF to PF times out, don't bail out
right away without taking proper cleanup action. The goto statement calls
ecore_vf_pf_req_end() which will unlock the mutex previously held.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
- Make ecore_dcbx_set_local_params(), ecore_cm_init_pf() as static
- Remove src_proto()
- remove reference to PROTOCOLID_TOE when determining whether a a protocol
requires SRC ILT memory
- Add auxiliary variables in various places
- All other changes are simple semantic corrections
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
- Turn ecore_ptt_get_hw_addr() into static
- Convert ecore_dcbx_get_operational_params() to void since we don't
care about the return value
Fixes: 26ae839d06 ("qede: add DCBX support")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
- Use OSAL_PAGE_SIZE instead of assuming it to be 4096.
- While at it make sure the minimum number of doorbells that can be issued
is 4.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
- Avoid having num_of_ports as 0 [to prevent a division by 0 via
MFW_PORT()]. Also fix the MFW_PORT() macro for CMT.
- Read the device's number of ports from shmem.
- Rename num_ports_in_engines to num_ports_in_engine.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Add base driver API to read per queue coalescing from hardware.
Move ecore_set_rxq|txq_coalesce() declarations to ecore_l2.h.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Fix the ECORE_IS_[AB]0() macros to check both the chip revision and the
chip metal. Realign defines in the struct ecore_dev.
Fixes: ec94dbc573 ("qede: add base driver")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
This is an attempt to clean up many unused API parameters across the base
code. Most of the changes are related to removing unused p_hwfn or p_ptt
handlers. The warnings are generated using 'unused-parameter' cflags.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
PF checks upon stop-vport from VF whether it's legal, but if it's not it
would STILL send the request to FW, which might cause it to assert.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Block sending of mailbox command to the management FW if it is not
responsive. Use MCP_REG_CPU_STATE_SOFT_HALTED register to verify the MCP
is actually halted after sending the halt command and before proceeding
further.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Add support for doorbell overflow recovery mechanism:
The doorbell recovery mechanism consists of a list of entries which
represent doorbelling entities (l2 queues, roce sq/rq/cqs, the slowpath
spq, etc). Each entity needs to register with the mechanism and provide
the parameters describing it's doorbell, including a location where last
used doorbell data can be found. The doorbell execute function will
traverse the list and doorbell all of the registered entries.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
For chip variant CHIP_NUM_AH_xxx, MSI-x configuration for VFs is controlled
per-PF [for all of its child VFs] instead of on a per-VF basis. A flag
called "dont_override_vf_msix" is added that allows the caller/client to
specify the mode they want to operate. If dont_override_vf_msix is false as
in the case of VF of CHIP_NUM_AH_xxx, first a check is made as to what is
currently configured number. Management FW will be asked to configure the
requested number only if its bigger than the currently configured value.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Changes for management FW, change of _SHIFT defines to _OFFSET.
Accordingly, rename and fix the ECORE_MFW_GET_FIELD() and
ECORE_MFW_SET_FIELD() macros and update wherever used.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Add a function that provides default initialization to resc lock/unlock
parameters. Change acquire flow that use resources into using this
function.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
- Remove an additional wrapper function ecore_mcp_nvm_command and
instead
use ecore_mcp_nvm_wr_cmd, ecore_mcp_nvm_rd_cmd or ecore_mcp_cmd APIs
directly as appropriate.
- Remove struct ecore_mcp_nvm_params
- Add new NVM command ECORE_EXT_PHY_FW_UPGRADE and fix the expected
management FW responses in ecore_mcp_nvm_write()
- Fail the NVM write process on any failing partial write
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Revise the manamgement FW mbox access locking scheme for the access to the
MFW mailbox:
- add a new linked list called cmd_list to ecore_mcp_info that tracks all
the mailbox commands sent to management FW and ones waiting for
response.
- add a mutex lock called cmd_lock to ecore_mcp_info, a spinlock used to
serialize the access to this cmd_list and makes sure that the mbox is
not a pending one before sending a new mbox request. It protects the
access to the mailbox commands list and sending of the commands.
- add ecore_mcp_cmd_add|del|get_elem() APIs for new access scheme
- remove ecore_mcp_mb_lock() and ecore_mcp_mb_unlock()
- add a mutex lock called link_lock to ecore_mcp_info, a spinlock used for
syncing SW link-changes and link-changes originating from attention
context. This locking scheme prevents possible race conditions that may
occur, such as during link status reporting.
- Surround OSAL_{MUTEX,SPIN_LOCK}_{ALLOC,DEALLOC} with
'#ifdef CONFIG_ECORE_LOCK_ALLOC'. In case memory has to be allocated for
lock primitives, then compile driver with CONFIG_ECORE_LOCK_ALLOC flag.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
There's a possible race in multiple VF scenarios for base driver users
that use the optional APIs ecore_iov_pf_get_and_clear_pending_events,
ecore_iov_pf_add_pending_events. If the client doesn't synchronize the two
calls, it's possible for the PF to clear a VF pending message indication
without ever getting it [as 'get & clear' isn't atomic], leading to VF
timeout on the command.
The solution is to switch into a per-VF indication rather than having a
bitfield for the various VFs with pending events. As part of the solution,
the setting/clearing of the indications is done internally by base driver.
As a result, ecore_iov_pf_add_pending_events is no longer needed and
ecore_iov_pf_get_and_clear_pending_events loses the 'and_clear' from its
name as its now a proper getter.
A VF would be considered 'pending' [I.e., get_pending_events() should
have '1' for it in its bitfield] beginning with the PF's base driver
recognizing a message sent by that VF [in SP_DPC] and ending only when
that VF message is processed.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Prevent parity errors from being re-asserted. Mask any parity error, even
if it is not associated with a HW block.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Use the ptt[PF translation table] handler that is passed rather than using
main ptt from the HW function.
In ecore_hw_get_resc()'s error flow, release the MFW generic resource lock
only if needed.
Change the verbosity level of GRC timeout from DP_INFO() to DP_NOTICE().
Reduce verbosity of print in ecore_hw_bar_size().
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
- Base driver EEE (Energy efficient ethernet) support.
- Provide supported-speed mask to driver though shared memory.
- Read/use eee-supported capabilities value from the shared memory.
- Update qed_fill_link() to advertise the EEE capabilities.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
- Add support to retain/clear data for crash dump by introducing the mdump
GET_RETAIN/CLR_RETAIN sub commands, new APIs
ecore_mcp_mdump_get_retain() and ecore_mcp_mdump_clr_retain()
- Avoid checking for mdump logs and data in case of an emulator
- Fix "deadbeaf" returned value in case of pcie status command read
fails (prevent false detection)
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
- Add an option to override the default force load behavior.
- PMD will set the override force load parameter to
ECORE_OVERRIDE_FORCE_LOAD_ALWAYS.
- Modify the printout when a force load is required to include the loaded
value
- No need for 'default' when switching over enums and covering all the
values.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Add SmartAN feature that automatically detects peer switch capabilities
which relieves users from fumbling with adapter and switch configuration
Add new cmd DRV_MSG_CODE_GET_MFW_FEATURE_SUPPORT. Add new SmartLinQ config
method using NVM cfg options 239.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>