- 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>
Add a sanity check that the offset being used to access the runtime array
is not greater/equal than/to RUNTIME_ARRAY_SIZE
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Fix ecore_configure_vp_wfq_on_link_change() to use a provided ptt[PF
translation table] handle instead of directly using p_dpc_ptt
Fixes: ec94dbc573 ("qede: add base driver")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Status Block reallocation - allow a PF and its child VF to change SB
between them using new base driver APIs.
The changes that are inside base driver flows are:
New APIs ecore_int_igu_reset_cam() and ecore_int_igu_reset_cam_default()
added to reset IGU CAM.
a. During hw_prepare(), driver would re-initialize the IGU CAM.
b. During hw_stop(), driver would initialize the IGU CAM to default.
Use igu_sb_id instead of sb_idx [protocol index] to allow setting of
the timer-resolution in CAU[coalescing algorithm unit] for all SBs,
sb_idx could limit SBs 0-11 only to be able change their timer-resolution.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Allow opening Multiple Tx queues on a single qzone for VFs.
This is supported by Rx/Tx TLVs now having an additional extended TLV that
passes the `qid_usage_idx', a unique number per each queue-cid that was
opened for a given queue-zone.
Fix to overcome TX timeout issue due to more than 16 CIDs by adding an
additional VF legacy mode. This will detach the CIDs from the original
only-existing legacy mode suited for older releases.
Following this change, only VFs that would publish VFPF_ACQUIRE_CAP_QIDS
would have the new CIDs scheme applied. I.e., the new 'legacy' mode is
actually whether this capability is published or not.
Changed the logic to clear doorbells for legacy and non-legacy VFs, so
the PF is cleaning the doorbells for both cases.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Change the order by which we allocate the resources to align with
management FW by first allocating the VF l2 queues and only
afterwards use what's left for the PF.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Move ecore_crc32() macro to within base driver to qede_crc32() and use
OSAL_CRC32() where required.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
- Add transceivers temperature monitoring/reporting feature
- Add new mbox command DRV_MSG_CODE_FEATURE_SUPPORT to exchange info
between drivers and management FW regarding features supported
- Add EEE to Link Flap Avoidance check, etc.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
rx/tx_queue_setup functions are shared between PF and VF
drivers. So the var 'pf' should not be assigned at the beginning.
This patch fixes the issue, and also corrects the return err code.
Fixes: b6583ee402 ("i40e: full VMDQ pools support")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Use stdbool.h instead of defining the bool type, to make
sure the virtchnnl msg format definition is the same
between PF and VF.
Fixes: 4861cde461 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
The size of "flex_filter.filter_info.mask" and "filter->mask" are 16
bytes, but the length of memcpy--"RTE_ALIGN(filter->len, sizeof(char))
/ sizeof(char)" may reach 128 bytes which may cause array access out
of bound.
Fix it by replacing "sizeof(char)" by "CHAR_BIT".
Fixes: 231d43909a ("igb: migrate flex filter to new API")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>