net/qede: update qede pmd to 2.0.0.1
cover net/qede: update qede pmd to 2.0.0.1
Hi,
This patch set consists of enhancements, new 8.14.x.x firmware support and semantic changes. It update the QEDE PMD version to 2.0.0.1.
Please include in DPDK 17.02 release.
Thanks!
Rasesh
Rasesh Mody (25):
net/qede/base: add request for PF FLR before load request net/qede/base: improve set field macro net/qede/base: add handling of malicious VF net/qede/base: change return codes in SR-IOV net/qede/base: make API non-static net/qede/base: rename macro
net/qede/base: add check to validate txq net/qede/base: fix updating VF queue zone id net/qede/base: improve Tx-switching performance net/qede/base: semantic change
net/qede: remove unused struct member net/qede/base: enhance resource info set printouts net/qede/base: add new enum member to status codes net/qede/base: add macros for converting pointer net/qede: add new host ring type option net/qede/base: add check for get nvm info return code net/qede/base: retrieve FW crash dump info net/qede/base: add support for external PHY net/qede/base: add support for 2x10G mode net/qede: add PCI ids for new chip variant net/qede: add 50G device PCI id
net/qede/base: add support for new firmware net/qede/base: semantic/formatting changes net/qede/base: dcbx changes for base driver net/qede: update PMD version to 2.0.0.1
config/common_base | 2 +- doc/guides/nics/qede.rst | 12 +- drivers/net/qede/base/bcm_osal.h | 1 + drivers/net/qede/base/common_hsi.h | 11 +- drivers/net/qede/base/ecore.h | 21 +- drivers/net/qede/base/ecore_chain.h | 9 +- drivers/net/qede/base/ecore_dcbx.c | 390 +++++++++++--------------- drivers/net/qede/base/ecore_dcbx.h | 6 - drivers/net/qede/base/ecore_dcbx_api.h | 1 + drivers/net/qede/base/ecore_dev.c | 349 +++++++++++++---------- drivers/net/qede/base/ecore_dev_api.h | 9 +- drivers/net/qede/base/ecore_gtt_reg_addr.h | 20 +- drivers/net/qede/base/ecore_hsi_common.h | 95 ++++--- drivers/net/qede/base/ecore_hsi_debug_tools.h | 26 +- drivers/net/qede/base/ecore_hsi_eth.h | 10 +- drivers/net/qede/base/ecore_hsi_init_tool.h | 82 +++--- drivers/net/qede/base/ecore_hw.c | 6 +- drivers/net/qede/base/ecore_init_fw_funcs.c | 45 +-- drivers/net/qede/base/ecore_init_ops.c | 26 +- drivers/net/qede/base/ecore_int.c | 6 +- drivers/net/qede/base/ecore_iov_api.h | 15 +- drivers/net/qede/base/ecore_iro_values.h | 4 +- drivers/net/qede/base/ecore_l2.c | 48 ++-- drivers/net/qede/base/ecore_l2_api.h | 20 +- drivers/net/qede/base/ecore_mcp.c | 86 +++--- drivers/net/qede/base/ecore_mcp.h | 25 +- drivers/net/qede/base/ecore_mcp_api.h | 33 ++- drivers/net/qede/base/ecore_sp_commands.c | 4 +- drivers/net/qede/base/ecore_spq.c | 23 +- drivers/net/qede/base/ecore_sriov.c | 211 ++++++++++---- drivers/net/qede/base/ecore_sriov.h | 5 +- drivers/net/qede/base/ecore_status.h | 1 + drivers/net/qede/base/ecore_utils.h | 6 + drivers/net/qede/base/ecore_vf.c | 43 ++- drivers/net/qede/base/eth_common.h | 34 ++- drivers/net/qede/base/mcp_public.h | 350 +++++++++++++---------- drivers/net/qede/base/nvm_cfg.h | 68 ++++- drivers/net/qede/qede_eth_if.c | 1 + drivers/net/qede/qede_ethdev.c | 32 ++- drivers/net/qede/qede_ethdev.h | 53 ++-- drivers/net/qede/qede_if.h | 18 +- drivers/net/qede/qede_main.c | 13 +- drivers/net/qede/qede_rxtx.c | 9 +- 43 files changed, 1286 insertions(+), 943 deletions(-)
Signature · 1 line
2.11.0.rc1
PATCH 1/25 net/qede/base: add request for PF FLR before load request
Add a request for PF FLR before a load request
Fix the location of the PF FLR initiation to be after ecore_get_hw_info() (which invokes ecore_hw_info_port_num())
--- drivers/net/qede/base/ecore_dev.c | 16 ++++++++++------ drivers/net/qede/base/ecore_dev_api.h | 2 ++ drivers/net/qede/base/ecore_mcp.c | 4 ++-- drivers/net/qede/base/ecore_mcp.h | 11 +++++++++++ drivers/net/qede/qede_main.c | 1 + 5 files changed, 26 insertions(+), 8 deletions(-)
drivers/net/qede/base/ecore_dev.c +10 -6
@@ -2998,12 +2998,6 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview, goto err1; } -if (p_hwfn ==ECORE_LEADING_HWFN (p_dev) && !p_dev->recov_in_prog) { - rc =ecore_mcp_initiate_pf_flr (p_hwfn, p_hwfn->p_main_ptt); -if (rc !=ECORE_SUCCESS ) -DP_NOTICE (p_hwfn, false,"Failed to initiate PF FLR\n" ); - } -/* Read the device configuration information from the HW and SHMEM */ rc =ecore_get_hw_info (p_hwfn, p_hwfn->p_main_ptt, p_params->personality, p_params->drv_resc_alloc);
@@ -3012,6 +3006,16 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview, goto err2; } +/* Sending a mailbox to the MFW should be after ecore_get_hw_info() is +* called, since among others it sets the ports number in an engine. +*/ +if (p_params->initiate_pf_flr && p_hwfn ==ECORE_LEADING_HWFN (p_dev) && + !p_dev->recov_in_prog) { + rc =ecore_mcp_initiate_pf_flr (p_hwfn, p_hwfn->p_main_ptt); +if (rc !=ECORE_SUCCESS ) +DP_NOTICE (p_hwfn, false,"Failed to initiate PF FLR\n" ); + } +/* Allocate the init RT array and initialize the init-ops engine */ rc =ecore_init_alloc (p_hwfn);if (rc) {
drivers/net/qede/base/ecore_dev_api.h +2 -0
@@ -147,6 +147,8 @@ struct ecore_hw_prepare_params {bool drv_resc_alloc;/* check the reg_fifo after any register access */ bool chk_reg_fifo; +/* request the MFW to initiate PF FLR */ +bool initiate_pf_flr; };/**
drivers/net/qede/base/ecore_mcp.c +2 -2
@@ -2448,6 +2448,6 @@ enum _ecore_status_t ecore_mcp_initiate_pf_flr(struct ecore_hwfn *p_hwfn, {u32 mcp_resp, mcp_param; -return ecore_mcp_cmd (p_hwfn, p_ptt,DRV_MSG_CODE_INITIATE_PF_FLR , -0 , &mcp_resp, &mcp_param); +return ecore_mcp_cmd (p_hwfn, p_ptt,DRV_MSG_CODE_INITIATE_PF_FLR ,0 , + &mcp_resp, &mcp_param); }
drivers/net/qede/base/ecore_mcp.h +11 -0
@@ -348,6 +348,17 @@ enum _ecore_status_t ecore_mcp_mdump_clear_logs(struct ecore_hwfn *p_hwfn,enum _ecore_status_t ecore_mcp_mdump_get_info (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt); +/** +* @brief - Gets the MFW allocation info for the given resource +* +* @param p_hwfn +* @param p_ptt +* @param p_resc_info +* @param p_mcp_resp +* @param p_mcp_param +* +* @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful. +*/ enum _ecore_status_t ecore_mcp_get_resc_info(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, struct resource_info *p_resc_info,
drivers/net/qede/qede_main.c +1 -0
@@ -62,6 +62,7 @@ qed_probe(struct ecore_dev *edev, struct rte_pci_device *pci_dev, hw_prepare_params.personality =ECORE_PCI_ETH ; hw_prepare_params.drv_resc_alloc = false; hw_prepare_params.chk_reg_fifo = false; + hw_prepare_params.initiate_pf_flr = true; rc =ecore_hw_prepare (edev, &hw_prepare_params);if (rc) {DP_ERR (edev,"hw prepare failed\n" );
Signature · 1 line
2.11.0.rc1
PATCH 2/25 net/qede/base: improve set field macro
In reply to Rasesh ModyImprove robustness of the SET_FIELD macro by using a mask.
--- drivers/net/qede/base/ecore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/qede/base/ecore.h +1 -1
@@ -80,7 +80,7 @@ enum ecore_nvm_cmd {#define SET_FIELD (value, name, flag) \ do { \ (value) &= ~(name##_MASK << name##_SHIFT); \ - (value) |= (((u64)flag) << (name##_SHIFT)); \ + (value) |= ((((u64)flag) & (u64)name##_MASK) << (name##_SHIFT));\ } while (0)#define GET_FIELD (value, name) \
Signature · 1 line
2.11.0.rc1
PATCH 5/25 net/qede/base: make API non-static
In reply to Rasesh ModyMove ecore_set_fw_mac_addr from ecore_l2.c to ecore_dev.c to facilitate future code reuse.
--- drivers/net/qede/base/ecore.h | 2 ++ drivers/net/qede/base/ecore_dev.c | 13 +++++++++++++ drivers/net/qede/base/ecore_l2.c | 11 ----------- 3 files changed, 15 insertions(+), 11 deletions(-)
drivers/net/qede/base/ecore.h +2 -0
@@ -811,6 +811,8 @@ int ecore_configure_pf_min_bandwidth(struct ecore_dev *p_dev, u8 min_bw);void ecore_clean_wfq_db (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt);int ecore_device_num_engines (struct ecore_dev *p_dev);int ecore_device_num_ports (struct ecore_dev *p_dev); +void ecore_set_fw_mac_addr (__le16 *fw_msb,__le16 *fw_mid,__le16 *fw_lsb, +u8 *mac);#define ECORE_LEADING_HWFN (dev) (&dev->hwfns[0])
drivers/net/qede/base/ecore_dev.c +13 -0
@@ -4297,3 +4297,16 @@ int ecore_device_num_ports(struct ecore_dev *p_dev)return p_dev->num_ports_in_engines *ecore_device_num_engines (p_dev); } + +void ecore_set_fw_mac_addr (__le16 *fw_msb, +__le16 *fw_mid, +__le16 *fw_lsb, +u8 *mac) +{ + ((u8 *)fw_msb)[0 ] = mac[1 ]; + ((u8 *)fw_msb)[1 ] = mac[0 ]; + ((u8 *)fw_mid)[0 ] = mac[3 ]; + ((u8 *)fw_mid)[1 ] = mac[2 ]; + ((u8 *)fw_lsb)[0 ] = mac[5 ]; + ((u8 *)fw_lsb)[1 ] = mac[4 ]; +}
drivers/net/qede/base/ecore_l2.c +0 -11
@@ -1012,17 +1012,6 @@ ecore_filter_action(enum ecore_filter_opcode opcode)return action; } -static void ecore_set_fw_mac_addr (__le16 *fw_msb, -__le16 *fw_mid,__le16 *fw_lsb,u8 *mac) -{ - ((u8 *)fw_msb)[0 ] = mac[1 ]; - ((u8 *)fw_msb)[1 ] = mac[0 ]; - ((u8 *)fw_mid)[0 ] = mac[3 ]; - ((u8 *)fw_mid)[1 ] = mac[2 ]; - ((u8 *)fw_lsb)[0 ] = mac[5 ]; - ((u8 *)fw_lsb)[1 ] = mac[4 ]; -} - static enum _ecore_status_t ecore_filter_ucast_common(struct ecore_hwfn *p_hwfn, u16 opaque_fid,
Signature · 1 line
2.11.0.rc1
PATCH 6/25 net/qede/base: rename macro
In reply to Rasesh ModyRename OOO_LB_TC to PKT_LB_TC to give better meaning.
--- drivers/net/qede/base/ecore.h | 2 +- drivers/net/qede/base/ecore_hw.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/qede/base/ecore.h +1 -1
@@ -800,7 +800,7 @@ static OSAL_INLINE u8 ecore_concrete_to_sw_fid(struct ecore_dev *p_dev, }#define PURE_LB_TC 8 -#define OOO_LB_TC 9 +#define PKT_LB_TC 9int ecore_configure_vport_wfq (struct ecore_dev *p_dev,u16 vp_id,u32 rate); void ecore_configure_vp_wfq_on_link_change(struct ecore_dev *p_dev,
drivers/net/qede/base/ecore_hw.c +1 -1
@@ -923,7 +923,7 @@ u16 ecore_get_qm_pq(struct ecore_hwfn *p_hwfn,case PROTOCOLID_CORE :if (p_params->core.tc ==LB_TC ) pq_id = p_hwfn->qm_info.pure_lb_pq; -else if (p_params->core.tc ==OOO_LB_TC ) +else if (p_params->core.tc ==PKT_LB_TC ) pq_id = p_hwfn->qm_info.ooo_pq;else pq_id = p_hwfn->qm_info.offload_pq;
Signature · 1 line
2.11.0.rc1
PATCH 4/25 net/qede/base: change return codes in SR-IOV
In reply to Rasesh ModyChange return codes in VF/SR-IOV base driver from int to enum _ecore_status_t.
--- drivers/net/qede/base/ecore_sriov.c | 19 +++++++++++-------- drivers/net/qede/base/ecore_sriov.h | 4 ++-- drivers/net/qede/base/ecore_vf.c | 33 ++++++++++++++++++--------------- 3 files changed, 31 insertions(+), 25 deletions(-)
drivers/net/qede/base/ecore_sriov.c +11 -8
@@ -1707,9 +1707,10 @@ ecore_iov_reconfigure_unicast_shadow(struct ecore_hwfn *p_hwfn,return rc; } -static int ecore_iov_configure_vport_forced (struct ecore_hwfn *p_hwfn, -struct ecore_vf_info *p_vf, -u64 events) +static enum _ecore_status_t +ecore_iov_configure_vport_forced (struct ecore_hwfn *p_hwfn, +struct ecore_vf_info *p_vf, +u64 events) {enum _ecore_status_t rc =ECORE_SUCCESS ;struct ecore_filter_ucast filter;
@@ -3141,9 +3142,10 @@ ecore_iov_single_vf_flr_cleanup(struct ecore_hwfn *p_hwfn,return rc; } -int ecore_iov_mark_vf_flr (struct ecore_hwfn *p_hwfn,u32 *p_disabled_vfs) +bool ecore_iov_mark_vf_flr (struct ecore_hwfn *p_hwfn,u32 *p_disabled_vfs) { -u16 i, found =0 ; +bool found; +u16 i;DP_VERBOSE (p_hwfn,ECORE_MSG_IOV ,"Marking FLR-ed VFs\n" );for (i =0 ; i < (VF_MAX_STATIC /32 ); i++)
@@ -3153,7 +3155,7 @@ int ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)if (!p_hwfn->p_dev->p_iov_info) {DP_NOTICE (p_hwfn, true,"VF flr but no IOV\n" ); -return 0 ; +return false; }/* Mark VFs */
@@ -3182,7 +3184,7 @@ int ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)* VF flr until ACKs, we're safe. */ p_flr[rel_vf_id /64 ] |=1ULL << (rel_vf_id %64 ); - found =1 ; + found = true; } }
@@ -3961,7 +3963,8 @@ bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn, u16 rel_vf_id)return (p_vf->state ==VF_ENABLED ); } -int ecore_iov_get_vf_min_rate (struct ecore_hwfn *p_hwfn,int vfid) +enum _ecore_status_t +ecore_iov_get_vf_min_rate (struct ecore_hwfn *p_hwfn,int vfid) {struct ecore_wfq_data *vf_vp_wfq;struct ecore_vf_info *vf_info;
drivers/net/qede/base/ecore_sriov.h +2 -2
@@ -277,8 +277,8 @@ u32 ecore_crc32(u32 crc,* * @return 1 iff one of the PF's vfs got FLRed. 0 otherwise. */ -int ecore_iov_mark_vf_flr (struct ecore_hwfn *p_hwfn, -u32 *disabled_vfs); +bool ecore_iov_mark_vf_flr (struct ecore_hwfn *p_hwfn, +u32 *disabled_vfs);/** * @brief Search extended TLVs in request/reply buffer.
drivers/net/qede/base/ecore_vf.c +18 -15
@@ -65,13 +65,15 @@ static void ecore_vf_pf_req_end(struct ecore_hwfn *p_hwfn,OSAL_MUTEX_RELEASE (&p_hwfn->vf_iov_info->mutex); } -static int ecore_send_msg2pf (struct ecore_hwfn *p_hwfn, -u8 *done,u32 resp_size) +static enum _ecore_status_t +ecore_send_msg2pf (struct ecore_hwfn *p_hwfn, +u8 *done,u32 resp_size) {union vfpf_tlvs *p_req = p_hwfn->vf_iov_info->vf2pf_request;struct ustorm_trigger_vf_zone trigger;struct ustorm_vf_zone *zone_data; -int rc =ECORE_SUCCESS , time =100 ; +enum _ecore_status_t rc =ECORE_SUCCESS ; +int time =100 ; zone_data = (struct ustorm_vf_zone *)PXP_VF_BAR0_START_USDM_ZONE_B ;
@@ -475,7 +477,7 @@ enum _ecore_status_t ecore_vf_pf_rxq_start(struct ecore_hwfn *p_hwfn,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_start_queue_resp_tlv *resp;struct vfpf_start_rxq_tlv *req; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_START_RXQ ,sizeof (*req));
@@ -550,7 +552,7 @@ enum _ecore_status_t ecore_vf_pf_rxq_stop(struct ecore_hwfn *p_hwfn,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct vfpf_stop_rxqs_tlv *req;struct pfvf_def_resp_tlv *resp; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_STOP_RXQS ,sizeof (*req));
@@ -591,7 +593,7 @@ enum _ecore_status_t ecore_vf_pf_txq_start(struct ecore_hwfn *p_hwfn,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_start_queue_resp_tlv *resp;struct vfpf_start_txq_tlv *req; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_START_TXQ ,sizeof (*req));
@@ -649,7 +651,7 @@ enum _ecore_status_t ecore_vf_pf_txq_stop(struct ecore_hwfn *p_hwfn, u16 tx_qid)struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct vfpf_stop_txqs_tlv *req;struct pfvf_def_resp_tlv *resp; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_STOP_TXQS ,sizeof (*req));
@@ -686,7 +688,7 @@ enum _ecore_status_t ecore_vf_pf_rxqs_update(struct ecore_hwfn *p_hwfn,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_def_resp_tlv *resp = &p_iov->pf2vf_reply->default_resp;struct vfpf_update_rxq_tlv *req; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_UPDATE_RXQ ,sizeof (*req));
@@ -728,7 +730,8 @@ ecore_vf_pf_vport_start(struct ecore_hwfn *p_hwfn, u8 vport_id,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct vfpf_vport_start_tlv *req;struct pfvf_def_resp_tlv *resp; -int rc, i; +enum _ecore_status_t rc; +int i;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_VPORT_START ,sizeof (*req));
@@ -770,7 +773,7 @@ enum _ecore_status_t ecore_vf_pf_vport_stop(struct ecore_hwfn *p_hwfn) {struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_def_resp_tlv *resp = &p_iov->pf2vf_reply->default_resp; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_VPORT_TEARDOWN,
@@ -868,7 +871,7 @@ ecore_vf_pf_vport_update(struct ecore_hwfn *p_hwfn,u8 update_rx, update_tx;u32 resp_size =0 ;u16 size, tlv; -int rc; +enum _ecore_status_t rc; resp = &p_iov->pf2vf_reply->default_resp; resp_size =sizeof (*resp);
@@ -1076,7 +1079,7 @@ enum _ecore_status_t ecore_vf_pf_reset(struct ecore_hwfn *p_hwfn)struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_def_resp_tlv *resp;struct vfpf_first_tlv *req; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_CLOSE ,sizeof (*req));
@@ -1109,8 +1112,8 @@ enum _ecore_status_t ecore_vf_pf_release(struct ecore_hwfn *p_hwfn)struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_def_resp_tlv *resp;struct vfpf_first_tlv *req; +enum _ecore_status_t rc;u32 size; -int rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_RELEASE ,sizeof (*req));
@@ -1182,7 +1185,7 @@ enum _ecore_status_t ecore_vf_pf_filter_ucast(struct ecore_hwfn *p_hwfn,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct vfpf_ucast_filter_tlv *req;struct pfvf_def_resp_tlv *resp; -int rc; +enum _ecore_status_t rc;/* Sanitize */ if (p_ucast->opcode ==ECORE_FILTER_MOVE ) {
@@ -1223,7 +1226,7 @@ enum _ecore_status_t ecore_vf_pf_int_cleanup(struct ecore_hwfn *p_hwfn) {struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_def_resp_tlv *resp = &p_iov->pf2vf_reply->default_resp; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_INT_CLEANUP,
Signature · 1 line
2.11.0.rc1
PATCH 7/25 net/qede/base: add check to validate txq
In reply to Rasesh ModyMake sure VF tx_qid and the status block index is in the allocated range, else fail the request.
--- drivers/net/qede/base/ecore_sriov.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/net/qede/base/ecore_sriov.c +13 -13
@@ -2099,26 +2099,26 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn, pq_params.eth.is_vf =1 ; pq_params.eth.vf_id = vf->relative_vf_id; - req = &mbx->req_virt->start_txq;OSAL_MEMSET (&p_params,0 ,sizeof (p_params)); + req = &mbx->req_virt->start_txq; + +if (!ecore_iov_validate_txq (p_hwfn, vf, req->tx_qid) || + !ecore_iov_validate_sb (p_hwfn, vf, req->hw_sb)) + goto out; + p_params.queue_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; p_params.vport_id = vf->vport_id; p_params.stats_id = vf->abs_vf_id +0x10 , p_params.sb = req->hw_sb; p_params.sb_idx = req->sb_index; -if (!ecore_iov_validate_txq (p_hwfn, vf, req->tx_qid) || - !ecore_iov_validate_sb (p_hwfn, vf, req->hw_sb)) - goto out; - - rc =ecore_sp_eth_txq_start_ramrod ( - p_hwfn, - vf->opaque_fid, - vf->vf_queues[req->tx_qid].fw_cid, - &p_params, - req->pbl_addr, - req->pbl_size, - &pq_params); + rc =ecore_sp_eth_txq_start_ramrod (p_hwfn, + vf->opaque_fid, + vf->vf_queues[req->tx_qid].fw_cid, + &p_params, + req->pbl_addr, + req->pbl_size, + &pq_params);if (rc) status =PFVF_STATUS_FAILURE ;
Signature · 1 line
2.11.0.rc1
PATCH 8/25 net/qede/base: fix updating VF queue zone id
In reply to Rasesh ModyPass the absolute qzone_id when creating queues.
--- drivers/net/qede/base/ecore_dev.c | 9 ++++++--- drivers/net/qede/base/ecore_l2.c | 10 +++++----- drivers/net/qede/base/ecore_l2_api.h | 11 +++++++++-- drivers/net/qede/base/ecore_sriov.c | 1 + drivers/net/qede/qede_eth_if.c | 1 + 5 files changed, 22 insertions(+), 10 deletions(-)
drivers/net/qede/base/ecore_dev.c +6 -3
@@ -542,11 +542,14 @@ enum _ecore_status_t ecore_resc_alloc(struct ecore_dev *p_dev)/* Allocate Memory for the Queue->CID mapping */ for_each_hwfn (p_dev, i) {struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i]; +u32 num_tx_conns =RESC_NUM (p_hwfn,ECORE_L2_QUEUE ); +int tx_size, rx_size;/* @@@TMP - resc management, change to actual required size */ -int tx_size =sizeof (struct ecore_hw_cid_data ) * -RESC_NUM (p_hwfn,ECORE_L2_QUEUE ); -int rx_size =sizeof (struct ecore_hw_cid_data ) * +if (p_hwfn->pf_params.eth_pf_params.num_cons > num_tx_conns) + num_tx_conns = p_hwfn->pf_params.eth_pf_params.num_cons; + tx_size =sizeof (struct ecore_hw_cid_data ) * num_tx_conns; + rx_size =sizeof (struct ecore_hw_cid_data ) *RESC_NUM (p_hwfn,ECORE_L2_QUEUE ); p_hwfn->p_tx_cids = OSAL_ZALLOC(p_hwfn->p_dev, GFP_KERNEL,
drivers/net/qede/base/ecore_l2.c +5 -5
@@ -663,7 +663,7 @@ ecore_sp_eth_rx_queue_start(struct ecore_hwfn *p_hwfn,if (IS_VF (p_hwfn->p_dev)) { return ecore_vf_pf_rxq_start(p_hwfn, - p_params->queue_id, + (u8)p_params->queue_id, p_params->sb, (u8)p_params->sb_idx, bd_max_bytes,
@@ -840,9 +840,9 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,struct ecore_spq_entry *p_ent =OSAL_NULL ;struct ecore_sp_init_data init_data;struct ecore_hw_cid_data *p_tx_cid; -u16 pq_id, abs_tx_q_id =0 ; -u8 abs_vport_id; +u16 pq_id, abs_tx_qzone_id =0 ;enum _ecore_status_t rc =ECORE_NOTIMPL ; +u8 abs_vport_id;/* Store information for the stop */ p_tx_cid = &p_hwfn->p_tx_cids[p_params->queue_id];
@@ -853,7 +853,7 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,if (rc !=ECORE_SUCCESS )return rc; - rc =ecore_fw_l2_queue (p_hwfn, p_params->queue_id, &abs_tx_q_id); + rc =ecore_fw_l2_queue (p_hwfn, p_params->qzone_id, &abs_tx_qzone_id);if (rc !=ECORE_SUCCESS )return rc;
@@ -876,7 +876,7 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn, p_ramrod->sb_index = (u8 )p_params->sb_idx; p_ramrod->stats_counter_id = p_params->stats_id; - p_ramrod->queue_zone_id =OSAL_CPU_TO_LE16 (abs_tx_q_id); + p_ramrod->queue_zone_id =OSAL_CPU_TO_LE16 (abs_tx_qzone_id); p_ramrod->pbl_size =OSAL_CPU_TO_LE16 (pbl_size);DMA_REGPAIR_LE (p_ramrod->pbl_base_addr, pbl_addr);
drivers/net/qede/base/ecore_l2_api.h +9 -2
@@ -28,10 +28,17 @@ enum ecore_rss_caps {#endif struct ecore_queue_start_common_params { -/* Rx/Tx queue id */ -u8 queue_id; +/* Rx/Tx queue relative id to keep obtained cid in corresponding array +* RX - upper-bounded by number of FW-queues +*/ +u16 queue_id;u8 vport_id; +/* q_zone_id is relative, may be different from queue id +* currently used by Tx-only, upper-bounded by number of FW-queues +*/ +u8 qzone_id; +/* stats_id is relative or absolute depends on function */ u8 stats_id;u16 sb;
drivers/net/qede/base/ecore_sriov.c +1 -0
@@ -2107,6 +2107,7 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn, goto out; p_params.queue_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; + p_params.qzone_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; p_params.vport_id = vf->vport_id; p_params.stats_id = vf->abs_vf_id +0x10 , p_params.sb = req->hw_sb;
drivers/net/qede/qede_eth_if.c +1 -0
@@ -213,6 +213,7 @@ qed_start_txq(struct ecore_dev *edev, p_hwfn = &edev->hwfns[hwfn_index]; p_params->queue_id = p_params->queue_id / edev->num_hwfns; + p_params->qzone_id = p_params->queue_id; p_params->stats_id = p_params->vport_id; rc = ecore_sp_eth_tx_queue_start(p_hwfn,
Signature · 1 line
2.11.0.rc1
PATCH 9/25 net/qede/base: improve Tx-switching performance
In reply to Rasesh ModyIn order to improve Tx switching performance an additional HSI parameter called same-as-last-id is introduced. This resource allows FW caching the txqs packet properties. Driver needs to set same-as-last-id to be equal to the qzone.
--- drivers/net/qede/base/ecore_l2.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/qede/base/ecore_l2.c +1 -0
@@ -877,6 +877,7 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn, p_ramrod->stats_counter_id = p_params->stats_id; p_ramrod->queue_zone_id =OSAL_CPU_TO_LE16 (abs_tx_qzone_id); + p_ramrod->same_as_last_id =OSAL_CPU_TO_LE16 (abs_tx_qzone_id); p_ramrod->pbl_size =OSAL_CPU_TO_LE16 (pbl_size);DMA_REGPAIR_LE (p_ramrod->pbl_base_addr, pbl_addr);
Signature · 1 line
2.11.0.rc1
PATCH 11/25 net/qede: remove unused struct member
In reply to Rasesh ModyRemove b_hw_channel from struct ecore_dev.
--- drivers/net/qede/base/ecore.h | 2 -- drivers/net/qede/base/ecore_vf.c | 10 ---------- drivers/net/qede/qede_main.c | 5 ++--- 3 files changed, 2 insertions(+), 15 deletions(-)
drivers/net/qede/base/ecore.h +0 -2
@@ -711,8 +711,6 @@ struct ecore_dev {/* SRIOV */ struct ecore_hw_sriov_info *p_iov_info;#define IS_ECORE_SRIOV (p_dev) (!!(p_dev)->p_iov_info) -bool b_hw_channel; -unsigned long tunn_mode;bool b_is_vf;
drivers/net/qede/base/ecore_vf.c +0 -10
@@ -83,16 +83,6 @@ ecore_send_msg2pf(struct ecore_hwfn *p_hwfn,/* need to add the END TLV to the message size */ resp_size +=sizeof (struct channel_list_end_tlv ); -if (!p_hwfn->p_dev->b_hw_channel) { - rc =OSAL_VF_SEND_MSG2PF (p_hwfn->p_dev, - done, - p_req, - p_hwfn->vf_iov_info->pf2vf_reply, -sizeof (union vfpf_tlvs ), resp_size); -/* TODO - no prints about message ? */ -return rc; - } -/* Send TLVs over HW channel */ OSAL_MEMSET (&trigger,0 ,sizeof (struct ustorm_trigger_vf_zone )); trigger.vf_pf_msg_valid =1 ;
drivers/net/qede/qede_main.c +2 -3
@@ -51,10 +51,9 @@ qed_probe(struct ecore_dev *edev, struct rte_pci_device *pci_dev,ecore_init_struct (edev); qdev->protocol = protocol; -if (is_vf) { +if (is_vf) edev->b_is_vf = true; - edev->b_hw_channel = true;/* @DPDK */ - } +ecore_init_dp (edev, dp_module, dp_level,NULL );qed_init_pci (edev, pci_dev);
Signature · 1 line
2.11.0.rc1
PATCH 3/25 net/qede/base: add handling of malicious VF
In reply to Rasesh ModyReceive indication that VFs are malicious and pass it to the caller/clients and stop serving those VF's additional resource requests.
--- drivers/net/qede/base/bcm_osal.h | 1 + drivers/net/qede/base/ecore_iov_api.h | 4 +- drivers/net/qede/base/ecore_l2.c | 26 ++++++- drivers/net/qede/base/ecore_l2_api.h | 9 +++ drivers/net/qede/base/ecore_sriov.c | 123 +++++++++++++++++++++++++++++----- drivers/net/qede/base/ecore_sriov.h | 1 + 6 files changed, 147 insertions(+), 17 deletions(-)
drivers/net/qede/base/bcm_osal.h +1 -0
@@ -323,6 +323,7 @@ u32 qede_find_first_zero_bit(unsigned long *, u32);#define OSAL_VF_SEND_MSG2PF (dev, done, msg, reply_addr, msg_size, reply_size) 0#define OSAL_VF_CQE_COMPLETION (_dev_p, _cqe, _protocol) (0)#define OSAL_PF_VF_MSG (hwfn, vfid) 0 +#define OSAL_PF_VF_MALICIOUS (hwfn, vfid) nothing#define OSAL_IOV_CHK_UCAST (hwfn, vfid, params) 0#define OSAL_IOV_POST_START_VPORT (hwfn, vf, vport_id, opaque_fid) nothing#define OSAL_IOV_VF_ACQUIRE (hwfn, vfid) 0
drivers/net/qede/base/ecore_iov_api.h +3 -1
@@ -52,6 +52,7 @@ enum ecore_iov_pf_to_vf_status {PFVF_STATUS_NOT_SUPPORTED ,PFVF_STATUS_NO_RESOURCE ,PFVF_STATUS_FORCED , + PFVF_STATUS_MALICIOUS, };struct ecore_mcp_link_params ;
@@ -301,12 +302,13 @@ bool ecore_iov_is_vf_pending_flr(struct ecore_hwfn *p_hwfn,* @param p_hwfn * @param rel_vf_id - Relative VF ID * @param b_enabled_only - consider only enabled VF +* @param b_non_malicious - true iff we want to validate vf isn't malicious. * * @return bool - true for valid VF ID */ bool ecore_iov_is_valid_vfid (struct ecore_hwfn *p_hwfn,int rel_vf_id, -bool b_enabled_only); +bool b_enabled_only,bool b_non_malicious);/** * @brief Get VF's public info structure
drivers/net/qede/base/ecore_l2.c +25 -1
@@ -36,9 +36,9 @@ ecore_sp_eth_vport_start(struct ecore_hwfn *p_hwfn,struct vport_start_ramrod_data *p_ramrod =OSAL_NULL ;struct ecore_spq_entry *p_ent =OSAL_NULL ;struct ecore_sp_init_data init_data; +u16 rx_mode =0 , tx_err =0 ;u8 abs_vport_id =0 ;enum _ecore_status_t rc =ECORE_NOTIMPL ; -u16 rx_mode =0 ; rc =ecore_fw_vport (p_hwfn, p_params->vport_id, &abs_vport_id);if (rc !=ECORE_SUCCESS )
@@ -71,6 +71,30 @@ ecore_sp_eth_vport_start(struct ecore_hwfn *p_hwfn, p_ramrod->rx_mode.state =OSAL_CPU_TO_LE16 (rx_mode); +/* Handle requests for strict behavior on transmission errors */ +SET_FIELD (tx_err,ETH_TX_ERR_VALS_ILLEGAL_VLAN_MODE , + p_params->b_err_illegal_vlan_mode ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_PACKET_TOO_SMALL , + p_params->b_err_small_pkt ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_ANTI_SPOOFING_ERR , + p_params->b_err_anti_spoof ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_ILLEGAL_INBAND_TAGS , + p_params->b_err_illegal_inband_mode ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_VLAN_INSERTION_W_INBAND_TAG , + p_params->b_err_vlan_insert_with_inband ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_MTU_VIOLATION , + p_params->b_err_big_pkt ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_ILLEGAL_CONTROL_FRAME , + p_params->b_err_ctrl_frame ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); + p_ramrod->tx_err_behav.values =OSAL_CPU_TO_LE16 (tx_err); +/* TPA related fields */ OSAL_MEMSET (&p_ramrod->tpa_param,0 ,sizeof (struct eth_vport_tpa_param ));
drivers/net/qede/base/ecore_l2_api.h +9 -0
@@ -274,6 +274,15 @@ struct ecore_sp_vport_start_params {bool zero_placement_offset;bool check_mac;bool check_ethtype; + +/* Strict behavior on transmission errors */ +bool b_err_illegal_vlan_mode; +bool b_err_illegal_inband_mode; +bool b_err_vlan_insert_with_inband; +bool b_err_small_pkt; +bool b_err_big_pkt; +bool b_err_anti_spoof; +bool b_err_ctrl_frame; };/**
drivers/net/qede/base/ecore_sriov.c +108 -15
231 lines not on this page · raw message
drivers/net/qede/base/ecore_sriov.h +1 -0
@@ -97,6 +97,7 @@ struct ecore_vf_info {struct ecore_iov_vf_mbx vf_mbx;enum vf_state state;bool b_init; +bool b_malicious;u8 to_disable;struct ecore_bulletin bulletin;
Signature · 1 line
2.11.0.rc1
PATCH 10/25 net/qede/base: semantic change
In reply to Rasesh ModySemantic change: No reason to have p_ prefix to non-pointers
--- drivers/net/qede/base/ecore_sriov.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
drivers/net/qede/base/ecore_sriov.c +18 -18
@@ -1987,7 +1987,7 @@ static void ecore_iov_vf_mbx_start_rxq(struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt, struct ecore_vf_info *vf) { - struct ecore_queue_start_common_params p_params; + struct ecore_queue_start_common_params params;struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;u8 status =PFVF_STATUS_NO_RESOURCE ;struct vfpf_start_rxq_tlv *req;
@@ -2000,13 +2000,13 @@ static void ecore_iov_vf_mbx_start_rxq(struct ecore_hwfn *p_hwfn, !ecore_iov_validate_sb(p_hwfn, vf, req->hw_sb)) goto out; -OSAL_MEMSET (&p_params,0 ,sizeof (p_params)); - p_params.queue_id = (u8 )vf->vf_queues[req->rx_qid].fw_rx_qid; - p_params.vf_qid = req->rx_qid; - p_params.vport_id = vf->vport_id; - p_params.stats_id = vf->abs_vf_id +0x10 , - p_params.sb = req->hw_sb; - p_params.sb_idx = req->sb_index; +OSAL_MEMSET (¶ms,0 ,sizeof (params)); + params.queue_id = (u8 )vf->vf_queues[req->rx_qid].fw_rx_qid; + params.vf_qid = req->rx_qid; + params.vport_id = vf->vport_id; + params.stats_id = vf->abs_vf_id +0x10 , + params.sb = req->hw_sb; + params.sb_idx = req->sb_index;/* Legacy VFs have their Producers in a different location, which they * calculate on their own and clean the producer prior to this.
@@ -2022,7 +2022,7 @@ static void ecore_iov_vf_mbx_start_rxq(struct ecore_hwfn *p_hwfn, rc = ecore_sp_eth_rxq_start_ramrod(p_hwfn, vf->opaque_fid, vf->vf_queues[req->rx_qid].fw_cid, - &p_params, + ¶ms, req->bd_max_bytes, req->rxq_addr, req->cqe_pbl_addr,
@@ -2087,7 +2087,7 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt, struct ecore_vf_info *vf) { - struct ecore_queue_start_common_params p_params; + struct ecore_queue_start_common_params params;struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;u8 status =PFVF_STATUS_NO_RESOURCE ;union ecore_qm_pq_params pq_params;
@@ -2099,24 +2099,24 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn, pq_params.eth.is_vf =1 ; pq_params.eth.vf_id = vf->relative_vf_id; -OSAL_MEMSET (&p_params,0 ,sizeof (p_params)); +OSAL_MEMSET (¶ms,0 ,sizeof (params)); req = &mbx->req_virt->start_txq;if (!ecore_iov_validate_txq (p_hwfn, vf, req->tx_qid) || !ecore_iov_validate_sb (p_hwfn, vf, req->hw_sb)) goto out; - p_params.queue_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; - p_params.qzone_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; - p_params.vport_id = vf->vport_id; - p_params.stats_id = vf->abs_vf_id +0x10 , - p_params.sb = req->hw_sb; - p_params.sb_idx = req->sb_index; + params.queue_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; + params.qzone_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; + params.vport_id = vf->vport_id; + params.stats_id = vf->abs_vf_id +0x10 , + params.sb = req->hw_sb; + params.sb_idx = req->sb_index; rc =ecore_sp_eth_txq_start_ramrod (p_hwfn, vf->opaque_fid, vf->vf_queues[req->tx_qid].fw_cid, - &p_params, + ¶ms, req->pbl_addr, req->pbl_size, &pq_params);
Signature · 1 line
2.11.0.rc1
PATCH 12/25 net/qede/base: enhance resource info set printouts
In reply to Rasesh ModyAdd the resources names in the ecore_hw_set_resc_info() printouts.
--- drivers/net/qede/base/ecore_dev.c | 100 +++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 50 deletions(-)
drivers/net/qede/base/ecore_dev.c +50 -50
@@ -2222,6 +2222,40 @@ static u32 ecore_hw_get_dflt_resc_num(struct ecore_hwfn *p_hwfn,return dflt_resc_num; } +static const char *ecore_hw_get_resc_name (enum ecore_resources res_id) +{ +switch (res_id) { +case ECORE_SB : +return "SB" ; +case ECORE_L2_QUEUE : +return "L2_QUEUE" ; +case ECORE_VPORT : +return "VPORT" ; +case ECORE_RSS_ENG : +return "RSS_ENG" ; +case ECORE_PQ : +return "PQ" ; +case ECORE_RL : +return "RL" ; +case ECORE_MAC : +return "MAC" ; +case ECORE_VLAN : +return "VLAN" ; +case ECORE_RDMA_CNQ_RAM : +return "RDMA_CNQ_RAM" ; +case ECORE_ILT : +return "ILT" ; +case ECORE_LL2_QUEUE : +return "LL2_QUEUE" ; +case ECORE_CMDQS_CQS : +return "CMDQS_CQS" ; +case ECORE_RDMA_STATS_QUEUE : +return "RDMA_STATS_QUEUE" ; +default : +return "UNKNOWN_RESOURCE" ; + } +} +static enum _ecore_status_t ecore_hw_set_resc_info (struct ecore_hwfn *p_hwfn,enum ecore_resources res_id,bool drv_resc_alloc)
@@ -2236,8 +2270,9 @@ static enum _ecore_status_t ecore_hw_set_resc_info(struct ecore_hwfn *p_hwfn, dflt_resc_num =ecore_hw_get_dflt_resc_num (p_hwfn, res_id);if (!dflt_resc_num) { -DP_ERR (p_hwfn,"Failed to get default amount for resource %d\n" , - res_id); +DP_ERR (p_hwfn, +"Failed to get default amount for resource %d [%s]\n" , + res_id,ecore_hw_get_resc_name (res_id));return ECORE_INVAL ; } dflt_resc_start = dflt_resc_num * p_hwfn->enabled_func_idx;
@@ -2263,8 +2298,9 @@ static enum _ecore_status_t ecore_hw_set_resc_info(struct ecore_hwfn *p_hwfn, &mcp_resp, &mcp_param);if (rc !=ECORE_SUCCESS ) {DP_NOTICE (p_hwfn, true, -"MFW resp failure for a resc alloc req [res_id %d]\n" , - res_id); +"MFW response failure for an allocation request for" +" resource %d [%s]\n" , + res_id,ecore_hw_get_resc_name (res_id));return rc; }
@@ -2277,11 +2313,11 @@ static enum _ecore_status_t ecore_hw_set_resc_info(struct ecore_hwfn *p_hwfn, mcp_resp != FW_MSG_CODE_RESOURCE_ALLOC_DEPRECATED) {/* @DPDK */ DP_INFO (p_hwfn, -"No allocation info for resc %d [mcp_resp 0x%x]." , - res_id, mcp_resp); -DP_INFO (p_hwfn, -"Applying default values [num %d, start %d].\n" , - dflt_resc_num, dflt_resc_start); +"Resource %d [%s]: No allocation info was received" +" [mcp_resp 0x%x]. Applying default values" +" [num %d, start %d].\n" , + res_id,ecore_hw_get_resc_name (res_id), mcp_resp, + dflt_resc_num, dflt_resc_start); *p_resc_num = dflt_resc_num; *p_resc_start = dflt_resc_start;
@@ -2300,13 +2336,11 @@ static enum _ecore_status_t ecore_hw_set_resc_info(struct ecore_hwfn *p_hwfn,if (*p_resc_num != dflt_resc_num || *p_resc_start != dflt_resc_start) {DP_NOTICE (p_hwfn, false, -"Resource %d: MFW allocation [num %d, start %d]" , - res_id, *p_resc_num, *p_resc_start); -DP_NOTICE (p_hwfn, false, -"differs from default values [num %d, start %d]%s\n" , - dflt_resc_num, - dflt_resc_start, - drv_resc_alloc ?" - applying default values" :"" ); +"Resource %d [%s]: MFW allocation [num %d, start %d]" +" differs from default values [num %d, start %d]%s\n" , + res_id,ecore_hw_get_resc_name (res_id), *p_resc_num, + *p_resc_start, dflt_resc_num, dflt_resc_start, + drv_resc_alloc ?" - Applying default values" :"" );if (drv_resc_alloc) { *p_resc_num = dflt_resc_num; *p_resc_start = dflt_resc_start;
@@ -2316,40 +2350,6 @@ static enum _ecore_status_t ecore_hw_set_resc_info(struct ecore_hwfn *p_hwfn,return ECORE_SUCCESS ; } -static const char *ecore_hw_get_resc_name (enum ecore_resources res_id) -{ -switch (res_id) { -case ECORE_SB : -return "SB" ; -case ECORE_L2_QUEUE : -return "L2_QUEUE" ; -case ECORE_VPORT : -return "VPORT" ; -case ECORE_RSS_ENG : -return "RSS_ENG" ; -case ECORE_PQ : -return "PQ" ; -case ECORE_RL : -return "RL" ; -case ECORE_MAC : -return "MAC" ; -case ECORE_VLAN : -return "VLAN" ; -case ECORE_RDMA_CNQ_RAM : -return "RDMA_CNQ_RAM" ; -case ECORE_ILT : -return "ILT" ; -case ECORE_LL2_QUEUE : -return "LL2_QUEUE" ; -case ECORE_CMDQS_CQS : -return "CMDQS_CQS" ; -case ECORE_RDMA_STATS_QUEUE : -return "RDMA_STATS_QUEUE" ; -default : -return "UNKNOWN_RESOURCE" ; - } -} -static enum _ecore_status_t ecore_hw_get_resc (struct ecore_hwfn *p_hwfn,bool drv_resc_alloc) {
Signature · 1 line
2.11.0.rc1
PATCH 13/25 net/qede/base: add new enum member to status codes
In reply to Rasesh ModyAdd ECORE_CONN_RESET to enum ecore_status.
--- drivers/net/qede/base/ecore_status.h | 1 + 1 file changed, 1 insertion(+)
drivers/net/qede/base/ecore_status.h +1 -0
@@ -10,6 +10,7 @@#define __ECORE_STATUS_H__enum _ecore_status_t { +ECORE_CONN_RESET =-13 ,ECORE_UNKNOWN_ERROR =-12 ,ECORE_NORESOURCES =-11 ,ECORE_NODEV =-10 ,
Signature · 1 line
2.11.0.rc1
PATCH 14/25 net/qede/base: add macros for converting pointer
In reply to Rasesh ModyAdd macros PTR_LO and PTR_HI (for converting pointer to HI and LOW bits for passing to FW hsi handles).
--- drivers/net/qede/base/ecore_utils.h | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/qede/base/ecore_utils.h +6 -0
@@ -10,6 +10,12 @@#define __ECORE_UTILS_H__/* dma_addr_t manip */ +/* Suppress "right shift count >= width of type" warning when that quantity is +* 32-bits rquires the >> 16) >> 16) +*/ +#define PTR_LO (x) ((u32)(((osal_uintptr_t)(x)) & 0xffffffff)) +#define PTR_HI (x) ((u32)((((osal_uintptr_t)(x)) >> 16) >> 16)) +#define DMA_LO (x) ((u32)(((dma_addr_t)(x)) & 0xffffffff))#define DMA_HI (x) ((u32)(((dma_addr_t)(x)) >> 32))
Signature · 1 line
2.11.0.rc1
PATCH 15/25 net/qede: add new host ring type option
In reply to Rasesh ModyAdd new option called external PBL (page base list) to ecore_chain_alloc for future use. Mark chain as external if external PBL is provided.
--- drivers/net/qede/base/ecore_chain.h | 9 ++++++++- drivers/net/qede/base/ecore_dev.c | 27 ++++++++++++++++++++------- drivers/net/qede/base/ecore_dev_api.h | 3 ++- drivers/net/qede/base/ecore_spq.c | 17 +++++++++++------ drivers/net/qede/qede_if.h | 18 ++++++++++-------- drivers/net/qede/qede_rxtx.c | 9 ++++++--- 6 files changed, 57 insertions(+), 26 deletions(-)
drivers/net/qede/base/ecore_chain.h +8 -1
@@ -54,6 +54,11 @@ struct ecore_chain_pbl_u32 {u32 cons_page_idx; }; +struct ecore_chain_ext_pbl { +dma_addr_t p_pbl_phys; +void *p_pbl_virt; +}; +struct ecore_chain_pbl {/* Base address of a pre-allocated buffer for pbl */ dma_addr_t p_phys_table;
@@ -69,6 +74,8 @@ struct ecore_chain_pbl {struct ecore_chain_pbl_u16 pbl16;struct ecore_chain_pbl_u32 pbl32; } u; + +bool external; };struct ecore_chain_u16 {
@@ -570,7 +577,7 @@ ecore_chain_init_params(struct ecore_chain *p_chain, u32 page_cnt, u8 elem_size, p_chain->page_cnt = page_cnt; p_chain->capacity = p_chain->usable_per_page * page_cnt; p_chain->size = p_chain->elem_per_page * page_cnt; - + p_chain->pbl.external = false; p_chain->pbl.p_phys_table =0 ; p_chain->pbl.p_virt_table =OSAL_NULL ; p_chain->pbl.pp_virt_addr_tbl =OSAL_NULL ;
drivers/net/qede/base/ecore_dev.c +20 -7
@@ -3193,8 +3193,10 @@ static void ecore_chain_free_pbl(struct ecore_dev *p_dev, } pbl_size = page_cnt *ECORE_CHAIN_PBL_ENTRY_SIZE ; -OSAL_DMA_FREE_COHERENT (p_dev, p_chain->pbl.p_virt_table, - p_chain->pbl.p_phys_table, pbl_size); + +if (!p_chain->pbl.external) +OSAL_DMA_FREE_COHERENT (p_dev, p_chain->pbl.p_virt_table, + p_chain->pbl.p_phys_table, pbl_size); out:OSAL_VFREE (p_dev, p_chain->pbl.pp_virt_addr_tbl); }
@@ -3294,8 +3296,10 @@ ecore_chain_alloc_single(struct ecore_dev *p_dev, struct ecore_chain *p_chain)return ECORE_SUCCESS ; } -static enum _ecore_status_t ecore_chain_alloc_pbl (struct ecore_dev *p_dev, -struct ecore_chain *p_chain) +static enum _ecore_status_t +ecore_chain_alloc_pbl (struct ecore_dev *p_dev, +struct ecore_chain *p_chain, +struct ecore_chain_ext_pbl *ext_pbl) {void *p_virt =OSAL_NULL ;u8 *p_pbl_virt =OSAL_NULL ;
@@ -3319,7 +3323,15 @@ static enum _ecore_status_t ecore_chain_alloc_pbl(struct ecore_dev *p_dev,* should be saved to allow its freeing during the error flow. */ size = page_cnt *ECORE_CHAIN_PBL_ENTRY_SIZE ; - p_pbl_virt =OSAL_DMA_ALLOC_COHERENT (p_dev, &p_pbl_phys, size); + +if (ext_pbl ==OSAL_NULL ) { + p_pbl_virt =OSAL_DMA_ALLOC_COHERENT (p_dev, &p_pbl_phys, size); + }else { + p_pbl_virt = ext_pbl->p_pbl_virt; + p_pbl_phys = ext_pbl->p_pbl_phys; + p_chain->pbl.external = true; + } +ecore_chain_init_pbl_mem (p_chain, p_pbl_virt, p_pbl_phys, pp_virt_addr_tbl);if (!p_pbl_virt) {
@@ -3357,7 +3369,8 @@ enum _ecore_status_t ecore_chain_alloc(struct ecore_dev *p_dev,enum ecore_chain_mode mode, enum ecore_chain_cnt_type cnt_type, u32 num_elems, osal_size_t elem_size, - struct ecore_chain *p_chain) + struct ecore_chain *p_chain, + struct ecore_chain_ext_pbl *ext_pbl) { u32 page_cnt;enum _ecore_status_t rc =ECORE_SUCCESS ;
@@ -3388,7 +3401,7 @@ enum _ecore_status_t ecore_chain_alloc(struct ecore_dev *p_dev, rc =ecore_chain_alloc_single (p_dev, p_chain);break ;case ECORE_CHAIN_MODE_PBL : - rc =ecore_chain_alloc_pbl (p_dev, p_chain); + rc =ecore_chain_alloc_pbl (p_dev, p_chain, ext_pbl);break ; }if (rc)
drivers/net/qede/base/ecore_dev_api.h +2 -1
@@ -370,7 +370,8 @@ ecore_chain_alloc(struct ecore_dev *p_dev,enum ecore_chain_cnt_type cnt_type, u32 num_elems, osal_size_t elem_size, - struct ecore_chain *p_chain); + struct ecore_chain *p_chain, + struct ecore_chain_ext_pbl *ext_pbl);/** * @brief ecore_chain_free - Free chain DMA memory
drivers/net/qede/base/ecore_spq.c +11 -6
@@ -373,7 +373,8 @@ struct ecore_eq *ecore_eq_alloc(struct ecore_hwfn *p_hwfn, u16 num_elem) ECORE_CHAIN_MODE_PBL,ECORE_CHAIN_CNT_TYPE_U16 , num_elem, - sizeof(union event_ring_element), &p_eq->chain)) { + sizeof(union event_ring_element), + &p_eq->chain, OSAL_NULL)) { DP_NOTICE(p_hwfn, true, "Failed to allocate eq chain\n"); goto eq_allocate_fail; }
@@ -501,10 +502,13 @@ enum _ecore_status_t ecore_spq_alloc(struct ecore_hwfn *p_hwfn) }/* SPQ ring */ -if (ecore_chain_alloc (p_hwfn->p_dev,ECORE_CHAIN_USE_TO_PRODUCE , -ECORE_CHAIN_MODE_SINGLE ,ECORE_CHAIN_CNT_TYPE_U16 ,0 , -/* N/A when the mode is SINGLE */ -sizeof (struct slow_path_element ), &p_spq->chain)) { +if (ecore_chain_alloc (p_hwfn->p_dev, +ECORE_CHAIN_USE_TO_PRODUCE , +ECORE_CHAIN_MODE_SINGLE , +ECORE_CHAIN_CNT_TYPE_U16 , +0 ,/* N/A when the mode is SINGLE */ +sizeof (struct slow_path_element ), + &p_spq->chain,OSAL_NULL )) {DP_NOTICE (p_hwfn, true,"Failed to allocate spq chain\n" ); goto spq_allocate_fail; }
@@ -956,7 +960,8 @@ struct ecore_consq *ecore_consq_alloc(struct ecore_hwfn *p_hwfn) ECORE_CHAIN_MODE_PBL, ECORE_CHAIN_CNT_TYPE_U16, ECORE_CHAIN_PAGE_SIZE / 0x80, - 0x80, &p_consq->chain)) { + 0x80, + &p_consq->chain, OSAL_NULL)) {DP_NOTICE (p_hwfn, true,"Failed to allocate consq chain" ); goto consq_allocate_fail; }
drivers/net/qede/qede_if.h +10 -8
@@ -110,14 +110,16 @@ struct qed_common_ops { uint32_t dp_module, uint8_t dp_level, bool is_vf);void (*set_id)(struct ecore_dev *edev,char name[],const char ver_str[]); -enum _ecore_status_t (*chain_alloc)(struct ecore_dev *edev, -enum ecore_chain_use_mode - intended_use, -enum ecore_chain_mode mode, -enum ecore_chain_cnt_type cnt_type, -uint32_t num_elems, -osal_size_t elem_size, -struct ecore_chain *p_chain); +enum _ecore_status_t + (*chain_alloc)(struct ecore_dev *edev, +enum ecore_chain_use_mode + intended_use, +enum ecore_chain_mode mode, +enum ecore_chain_cnt_type cnt_type, +uint32_t num_elems, +osal_size_t elem_size, +struct ecore_chain *p_chain, +struct ecore_chain_ext_pbl *ext_pbl);void (*chain_free)(struct ecore_dev *edev,struct ecore_chain *p_chain);
drivers/net/qede/qede_rxtx.c +6 -3
@@ -176,7 +176,8 @@ qede_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,ECORE_CHAIN_CNT_TYPE_U16 , rxq->nb_rx_desc,sizeof (struct eth_rx_bd ), - &rxq->rx_bd_ring); + &rxq->rx_bd_ring, + NULL);if (rc !=ECORE_SUCCESS ) { DP_NOTICE(edev, false,
@@ -196,7 +197,8 @@ qede_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,ECORE_CHAIN_CNT_TYPE_U16 , rxq->nb_rx_desc,sizeof (union eth_rx_cqe ), - &rxq->rx_comp_ring); + &rxq->rx_comp_ring, + NULL);if (rc !=ECORE_SUCCESS ) { DP_NOTICE(edev, false,
@@ -291,7 +293,8 @@ qede_tx_queue_setup(struct rte_eth_dev *dev,ECORE_CHAIN_CNT_TYPE_U16 , txq->nb_tx_desc,sizeof (union eth_tx_bd_types ), - &txq->tx_pbl); + &txq->tx_pbl, + NULL);if (rc !=ECORE_SUCCESS ) { DP_ERR(edev, "Unable to allocate memory for txbd ring on socket %u",
Signature · 1 line
2.11.0.rc1
PATCH 16/25 net/qede/base: add check for get nvm info return code
In reply to Rasesh ModyFail ecore_get_hw_info() in case ecore_hw_get_nvm_info() fails.
--- drivers/net/qede/base/ecore_dev.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/net/qede/base/ecore_dev.c +9 -4
@@ -2755,7 +2755,7 @@ ecore_get_hw_info(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,/* Since all information is common, only first hwfns should do this */ if (IS_LEAD_HWFN (p_hwfn)) { rc =ecore_iov_hw_info (p_hwfn); -if (rc) +if (rc !=ECORE_SUCCESS )return rc; }
@@ -2769,12 +2769,17 @@ ecore_get_hw_info(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,ecore_hw_info_port_num (p_hwfn, p_ptt);#ifndef ASIC_ONLY - if (CHIP_REV_IS_ASIC(p_hwfn->p_dev)) +if (CHIP_REV_IS_ASIC (p_hwfn->p_dev)) { +#endif + rc =ecore_hw_get_nvm_info (p_hwfn, p_ptt); +if (rc !=ECORE_SUCCESS ) +return rc; +#ifndef ASIC_ONLY + }#endif -ecore_hw_get_nvm_info (p_hwfn, p_ptt); rc =ecore_int_igu_read_cam (p_hwfn, p_ptt); -if (rc) +if (rc !=ECORE_SUCCESS )return rc;#ifndef ASIC_ONLY
Signature · 1 line
2.11.0.rc1
PATCH 17/25 net/qede/base: retrieve FW crash dump info
In reply to Rasesh ModyAs part of device probe, check if management FW crash dump logs are available. If available, then log an warning message and update the epoch value too. A new struct ecore_mdump_info is added to populate dump info including the new "reason" field by reading shared memory region.
--- drivers/net/qede/base/ecore_dev.c | 18 +++++++--- drivers/net/qede/base/ecore_dev_api.h | 4 +-- drivers/net/qede/base/ecore_mcp.c | 66 ++++++++++++++++++++++------------- drivers/net/qede/base/ecore_mcp.h | 22 ------------ drivers/net/qede/base/ecore_mcp_api.h | 33 +++++++++++++++--- drivers/net/qede/qede_main.c | 2 +- 6 files changed, 87 insertions(+), 58 deletions(-)
drivers/net/qede/base/ecore_dev.c +14 -4
@@ -1761,10 +1761,6 @@ enum _ecore_status_t ecore_hw_init(struct ecore_dev *p_dev,return mfw_rc; } -ecore_mcp_mdump_get_info (p_hwfn, p_hwfn->p_main_ptt); -ecore_mcp_mdump_set_values (p_hwfn, p_hwfn->p_main_ptt, - p_params->epoch); -/* send DCBX attention request command */ DP_VERBOSE (p_hwfn,ECORE_MSG_DCB ,"sending phony dcbx set command to trigger DCBx attention handling\n" );
@@ -2962,6 +2958,7 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview, struct ecore_hw_prepare_params *p_params) {struct ecore_dev *p_dev = p_hwfn->p_dev; +struct ecore_mdump_info mdump_info;enum _ecore_status_t rc =ECORE_SUCCESS ;/* Split PCI bars evenly between hwfns */
@@ -3024,6 +3021,19 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,DP_NOTICE (p_hwfn, false,"Failed to initiate PF FLR\n" ); } +/* Check if mdump logs are present and update the epoch value */ +if (p_hwfn ==ECORE_LEADING_HWFN (p_hwfn->p_dev)) { + rc =ecore_mcp_mdump_get_info (p_hwfn, p_hwfn->p_main_ptt, + &mdump_info); +if (rc ==ECORE_SUCCESS && mdump_info.num_of_logs >0 ) { +DP_NOTICE (p_hwfn, false, +"* * * IMPORTANT - HW ERROR register dump captured by device * * *\n" ); + } + +ecore_mcp_mdump_set_values (p_hwfn, p_hwfn->p_main_ptt, + p_params->epoch); + } +/* Allocate the init RT array and initialize the init-ops engine */ rc =ecore_init_alloc (p_hwfn);if (rc) {
drivers/net/qede/base/ecore_dev_api.h +2 -2
@@ -68,8 +68,6 @@ struct ecore_hw_init_params {bool allow_npar_tx_switch;/* binary fw data pointer in binary fw file */ const u8 *bin_fw_data; -/* the OS Epoch time in seconds */ -u32 epoch; };/**
@@ -149,6 +147,8 @@ struct ecore_hw_prepare_params {bool chk_reg_fifo;/* request the MFW to initiate PF FLR */ bool initiate_pf_flr; +/* the OS Epoch time in seconds */ +u32 epoch; };/**
drivers/net/qede/base/ecore_mcp.c +42 -24
96 lines not on this page · raw message
drivers/net/qede/base/ecore_mcp.h +0 -22
@@ -327,28 +327,6 @@ enum _ecore_status_t ecore_mcp_mdump_trigger(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);/** -* @brief - Clears the MFW crash dump logs. -* -* @param p_hwfn -* @param p_ptt -* -* @param return ECORE_SUCCESS upon success. -*/ -enum _ecore_status_t ecore_mcp_mdump_clear_logs (struct ecore_hwfn *p_hwfn, -struct ecore_ptt *p_ptt); - -/** -* @brief - Gets the MFW crash dump configuration and logs info. -* -* @param p_hwfn -* @param p_ptt -* -* @param return ECORE_SUCCESS upon success. -*/ -enum _ecore_status_t ecore_mcp_mdump_get_info (struct ecore_hwfn *p_hwfn, -struct ecore_ptt *p_ptt); - -/** * @brief - Gets the MFW allocation info for the given resource * * @param p_hwfn
drivers/net/qede/base/ecore_mcp_api.h +28 -5
@@ -792,14 +792,37 @@ enum _ecore_status_t ecore_mcp_mem_ecc_events(struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt, u64 *num_events); +struct ecore_mdump_info { +u32 reason; +u32 version; +u32 config; +u32 epoch; +u32 num_of_logs; +u32 valid_logs; +}; + +/** +* @brief - Gets the MFW crash dump configuration and logs info. +* +* @param p_hwfn +* @param p_ptt +* @param p_mdump_info +* +* @param return ECORE_SUCCESS upon success. +*/ +enum _ecore_status_t +ecore_mcp_mdump_get_info (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt, +struct ecore_mdump_info *p_mdump_info); +/** -* @brief Sets whether a critical error notification from the MFW is acked, or -* is it being ignored and thus allowing the MFW crash dump. +* @brief - Clears the MFW crash dump logs. * -* @param p_dev -* @param mdump_enable +* @param p_hwfn +* @param p_ptt * +* @param return ECORE_SUCCESS upon success. */ -void ecore_mcp_mdump_enable (struct ecore_dev *p_dev,bool mdump_enable); +enum _ecore_status_t ecore_mcp_mdump_clear_logs (struct ecore_hwfn *p_hwfn, +struct ecore_ptt *p_ptt);#endif
drivers/net/qede/qede_main.c +1 -1
@@ -62,6 +62,7 @@ qed_probe(struct ecore_dev *edev, struct rte_pci_device *pci_dev, hw_prepare_params.drv_resc_alloc = false; hw_prepare_params.chk_reg_fifo = false; hw_prepare_params.initiate_pf_flr = true; + hw_prepare_params.epoch = (u32 )time (NULL ); rc =ecore_hw_prepare (edev, &hw_prepare_params);if (rc) {DP_ERR (edev,"hw prepare failed\n" );
@@ -271,7 +272,6 @@ static int qed_slowpath_start(struct ecore_dev *edev, hw_init_params.int_mode =ECORE_INT_MODE_MSIX ; hw_init_params.allow_npar_tx_switch = allow_npar_tx_switching; hw_init_params.bin_fw_data = data; - hw_init_params.epoch = (u32 )time (NULL ); rc =ecore_hw_init (edev, &hw_init_params);if (rc) {DP_ERR (edev,"ecore_hw_init failed\n" );
Signature · 1 line
2.11.0.rc1
PATCH 18/25 net/qede/base: add support for external PHY
In reply to Rasesh ModyAdd support for external PHY BCM8485x.
--- drivers/net/qede/base/ecore_mcp.c | 6 +-- drivers/net/qede/base/mcp_public.h | 88 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 87 insertions(+), 7 deletions(-)
drivers/net/qede/base/ecore_mcp.c +2 -4
@@ -838,11 +838,9 @@ enum _ecore_status_t ecore_mcp_set_link(struct ecore_hwfn *p_hwfn,if (b_up)DP_VERBOSE (p_hwfn,ECORE_MSG_LINK ,"Configuring Link: Speed 0x%08x, Pause 0x%08x," -" adv_speed 0x%08x, loopback 0x%08x," -" features 0x%08x\n" , +" adv_speed 0x%08x, loopback 0x%08x\n" , p_phy_cfg->speed, p_phy_cfg->pause, - p_phy_cfg->adv_speed, p_phy_cfg->loopback_mode, - p_phy_cfg->feature_config_flags); + p_phy_cfg->adv_speed, p_phy_cfg->loopback_mode);else DP_VERBOSE (p_hwfn,ECORE_MSG_LINK ,"Resetting link\n" );
drivers/net/qede/base/mcp_public.h +85 -3
136 lines not on this page · raw message
Signature · 1 line
2.11.0.rc1
PATCH 20/25 net/qede: add PCI ids for new chip variant
In reply to Rasesh ModyAdd PCI IDs for new asic type (defined as CHIP_NUM_AH_xxx). It supports 50G, 40G, 25G and 10G speeds.
--- drivers/net/qede/base/ecore_dev.c | 7 +++++- drivers/net/qede/qede_ethdev.c | 29 ++++++++++++++++++------ drivers/net/qede/qede_ethdev.h | 47 ++++++++++++++++++++++++--------------- 3 files changed, 57 insertions(+), 26 deletions(-)
drivers/net/qede/base/ecore_dev.c +6 -1
@@ -2365,7 +2365,12 @@ static enum _ecore_status_t ecore_hw_get_resc(struct ecore_hwfn *p_hwfn,#endif for (res_id =0 ; res_id <ECORE_MAX_RESC ; res_id++) { - rc =ecore_hw_set_resc_info (p_hwfn, res_id, drv_resc_alloc); +/* @@@TMP for AH: +* Force the driver's default resource allocation in case there +* is a diff with the MFW allocation value. +*/ + rc =ecore_hw_set_resc_info (p_hwfn, res_id, + b_ah || drv_resc_alloc);if (rc !=ECORE_SUCCESS )return rc; }
drivers/net/qede/qede_ethdev.c +22 -7
@@ -2263,10 +2263,13 @@ static int qedevf_eth_dev_uninit(struct rte_eth_dev *eth_dev)static struct rte_pci_id pci_id_qedevf_map[] = { #define QEDEVF_RTE_PCI_DEVICE(dev) RTE_PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, dev) { -QEDEVF_RTE_PCI_DEVICE (PCI_DEVICE_ID_NX2_VF ) +QEDEVF_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_NX2_VF ) }, { -QEDEVF_RTE_PCI_DEVICE (PCI_DEVICE_ID_57980S_IOV ) +QEDEVF_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_57980S_IOV ) + }, + { +QEDEVF_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_AH_IOV ) }, {.vendor_id =0 ,} };
@@ -2274,19 +2277,31 @@ static struct rte_pci_id pci_id_qedevf_map[] = {static struct rte_pci_id pci_id_qede_map[] = { #define QEDE_RTE_PCI_DEVICE(dev) RTE_PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, dev) { -QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_NX2_57980E ) +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_NX2_57980E ) + }, + { +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_NX2_57980S ) + }, + { +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_57980S_40 ) + }, + { +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_57980S_25 ) + }, + { +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_57980S_100 ) }, { -QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_NX2_57980S ) +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_AH_50G ) }, { -QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_57980S_40 ) +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_AH_10G ) }, { -QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_57980S_25 ) +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_AH_40G ) }, { -QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_57980S_100 ) +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_AH_25G ) }, {.vendor_id =0 ,} };
drivers/net/qede/qede_ethdev.h +29 -18
53 lines not on this page · raw message
Signature · 1 line
2.11.0.rc1
PATCH 19/25 net/qede/base: add support for 2x10G mode
In reply to Rasesh ModyAdd support for 2x10G mode
--- doc/guides/nics/qede.rst | 2 +- drivers/net/qede/base/ecore.h | 1 + drivers/net/qede/base/ecore_dev.c | 3 +++ drivers/net/qede/base/nvm_cfg.h | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-)
doc/guides/nics/qede.rst +1 -1
@@ -32,7 +32,7 @@ QEDE Poll Mode Driver ====================== The QEDE poll mode driver library (**librte_pmd_qede**) implements support -for **QLogic FastLinQ QL4xxxx 25G/40G/100G CNA** family of adapters as well +for **QLogic FastLinQ QL4xxxx 10G/25G/40G/100G CNA** family of adapters as well as their virtual functions (VF) in SR-IOV context. It is supported on several standard Linux distros like RHEL7.x, SLES12.x and Ubuntu. It is compile-tested under FreeBSD OS.
drivers/net/qede/base/ecore.h +1 -0
@@ -302,6 +302,7 @@ enum ecore_port_mode {ECORE_PORT_MODE_DE_2X25G ,ECORE_PORT_MODE_DE_1X25G ,ECORE_PORT_MODE_DE_4X25G , + ECORE_PORT_MODE_DE_2X10G, }; enum ecore_dev_cap {
drivers/net/qede/base/ecore_dev.c +3 -0
@@ -2474,6 +2474,9 @@ static enum _ecore_status_t ecore_hw_get_nvm_info(struct ecore_hwfn *p_hwfn,case NVM_CFG1_GLOB_NETWORK_PORT_MODE_2X25G : p_hwfn->hw_info.port_mode =ECORE_PORT_MODE_DE_2X25G ;break ; +case NVM_CFG1_GLOB_NETWORK_PORT_MODE_2X10G : + p_hwfn->hw_info.port_mode =ECORE_PORT_MODE_DE_2X10G ; +break ;case NVM_CFG1_GLOB_NETWORK_PORT_MODE_1X25G : p_hwfn->hw_info.port_mode =ECORE_PORT_MODE_DE_1X25G ;break ;
drivers/net/qede/base/nvm_cfg.h +2 -0
@@ -144,6 +144,7 @@ struct nvm_cfg1_glob {#define NVM_CFG1_GLOB_NETWORK_PORT_MODE_2X25G 0xC#define NVM_CFG1_GLOB_NETWORK_PORT_MODE_1X25G 0xD#define NVM_CFG1_GLOB_NETWORK_PORT_MODE_4X25G 0xE +#define NVM_CFG1_GLOB_NETWORK_PORT_MODE_2X10G 0xF#define NVM_CFG1_GLOB_MPS10_ENFORCE_TX_FIR_CFG_MASK 0x00000100#define NVM_CFG1_GLOB_MPS10_ENFORCE_TX_FIR_CFG_OFFSET 8#define NVM_CFG1_GLOB_MPS10_ENFORCE_TX_FIR_CFG_DISABLED 0x0
@@ -578,6 +579,7 @@ struct nvm_cfg1_glob {#define NVM_CFG1_GLOB_MULTI_NETWORK_MODES_CAPABILITY_2X50G 0x40#define NVM_CFG1_GLOB_MULTI_NETWORK_MODES_CAPABILITY_BB_1X100G \ 0x80 +#define NVM_CFG1_GLOB_MULTI_NETWORK_MODES_CAPABILITY_2X10G 0x100u32 reserved[41 ];/* 0x9C */ };
Signature · 1 line
2.11.0.rc1
PATCH 21/25 net/qede: add 50G device PCI id
In reply to Rasesh ModyAdd 50G device support for 57980 series
--- config/common_base | 2 +- doc/guides/nics/qede.rst | 4 ++-- drivers/net/qede/qede_ethdev.c | 3 +++ drivers/net/qede/qede_ethdev.h | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-)
config/common_base +1 -1
@@ -315,7 +315,7 @@ CONFIG_RTE_LIBRTE_PMD_BOND=y CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB=n CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB_L1=n -# QLogic 10G/25G/40G/100G PMD +# QLogic 10G/25G/40G/50G/100G PMD # CONFIG_RTE_LIBRTE_QEDE_PMD=y CONFIG_RTE_LIBRTE_QEDE_DEBUG_INIT=n
doc/guides/nics/qede.rst +2 -2
@@ -32,7 +32,7 @@ QEDE Poll Mode Driver ====================== The QEDE poll mode driver library (**librte_pmd_qede**) implements support -for **QLogic FastLinQ QL4xxxx 10G/25G/40G/100G CNA** family of adapters as well +for **QLogic FastLinQ QL4xxxx 10G/25G/40G/50G/100G CNA** family of adapters as well as their virtual functions (VF) in SR-IOV context. It is supported on several standard Linux distros like RHEL7.x, SLES12.x and Ubuntu. It is compile-tested under FreeBSD OS.
@@ -72,7 +72,7 @@ Non-supported Features Supported QLogic Adapters ------------------------- -- QLogic FastLinQ QL4xxxx 10G/25G/40G/100G CNAs. +- QLogic FastLinQ QL4xxxx 10G/25G/40G/50G/100G CNAs. Prerequisites -------------
drivers/net/qede/qede_ethdev.c +3 -0
@@ -2292,6 +2292,9 @@ static struct rte_pci_id pci_id_qede_map[] = { QEDE_RTE_PCI_DEVICE(PCI_DEVICE_ID_QLOGIC_57980S_100) }, { + QEDE_RTE_PCI_DEVICE(PCI_DEVICE_ID_QLOGIC_57980S_50) + }, + { QEDE_RTE_PCI_DEVICE(PCI_DEVICE_ID_QLOGIC_AH_50G) }, {
drivers/net/qede/qede_ethdev.h +2 -0
@@ -102,6 +102,7 @@#define CHIP_NUM_57980S_25 0x1656#define CHIP_NUM_57980S_IOV 0x1664#define CHIP_NUM_57980S_100 0x1644 +#define CHIP_NUM_57980S_50 0x1654#define CHIP_NUM_AH_50G 0x8070#define CHIP_NUM_AH_10G 0x8071#define CHIP_NUM_AH_40G 0x8072
@@ -115,6 +116,7 @@#define PCI_DEVICE_ID_QLOGIC_57980S_25 CHIP_NUM_57980S_25#define PCI_DEVICE_ID_QLOGIC_57980S_IOV CHIP_NUM_57980S_IOV#define PCI_DEVICE_ID_QLOGIC_57980S_100 CHIP_NUM_57980S_100 +#define PCI_DEVICE_ID_QLOGIC_57980S_50 CHIP_NUM_57980S_50#define PCI_DEVICE_ID_QLOGIC_AH_50G CHIP_NUM_AH_50G#define PCI_DEVICE_ID_QLOGIC_AH_10G CHIP_NUM_AH_10G#define PCI_DEVICE_ID_QLOGIC_AH_40G CHIP_NUM_AH_40G
Signature · 1 line
2.11.0.rc1
PATCH 22/25 net/qede/base: add support for new firmware
In reply to Rasesh ModyAdd support for 8.14.x.x firmware.
--- doc/guides/nics/qede.rst | 8 +-- drivers/net/qede/base/common_hsi.h | 6 +- drivers/net/qede/base/ecore.h | 9 --- drivers/net/qede/base/ecore_dcbx.c | 17 +----- drivers/net/qede/base/ecore_dcbx.h | 6 -- drivers/net/qede/base/ecore_dev.c | 66 +++++++-------------- drivers/net/qede/base/ecore_gtt_reg_addr.h | 20 +++---- drivers/net/qede/base/ecore_hsi_common.h | 81 ++++++++++++++------------ drivers/net/qede/base/ecore_hsi_debug_tools.h | 26 ++++++--- drivers/net/qede/base/ecore_hsi_eth.h | 10 +++- drivers/net/qede/base/ecore_hsi_init_tool.h | 82 ++++++++++++--------------- drivers/net/qede/base/ecore_init_fw_funcs.c | 45 ++------------- drivers/net/qede/base/ecore_init_ops.c | 3 +- drivers/net/qede/base/ecore_iov_api.h | 11 ++++ drivers/net/qede/base/ecore_iro_values.h | 4 +- drivers/net/qede/base/ecore_mcp.c | 5 +- drivers/net/qede/base/ecore_sp_commands.c | 4 +- drivers/net/qede/base/ecore_spq.c | 3 + drivers/net/qede/base/ecore_sriov.c | 12 ++++ drivers/net/qede/base/eth_common.h | 34 ++++++++--- drivers/net/qede/base/nvm_cfg.h | 66 ++++++++++++++++++++- drivers/net/qede/qede_main.c | 5 +- 22 files changed, 279 insertions(+), 244 deletions(-)
doc/guides/nics/qede.rst +4 -4
@@ -77,10 +77,10 @@ Supported QLogic Adapters Prerequisites ------------- -- Requires firmware version **8.10.x.** and management firmware - version **8.10.x or higher**. Firmware may be available +- Requires firmware version **8.14.x.** and management firmware + version **8.14.x or higher**. Firmware may be available inbox in certain newer Linux distros under the standard directory - ``E.g. /lib/firmware/qed/qed_init_values-8.10.9.0.bin`` + ``E.g. /lib/firmware/qed/qed_init_values-8.14.6.0.bin`` - If the required firmware files are not available then visit `QLogic Driver Download Center <http://driverdownloads.qlogic.com>`_.
@@ -119,7 +119,7 @@ enabling debugging options may affect system performance. - ``CONFIG_RTE_LIBRTE_QEDE_FW`` (default **""**) Gives absolute path of firmware file. - ``Eg: "/lib/firmware/qed/qed_init_values_zipped-8.10.9.0.bin"`` + ``Eg: "/lib/firmware/qed/qed_init_values_zipped-8.14.6.0.bin"`` Empty string indicates driver will pick up the firmware file from the default location.
drivers/net/qede/base/common_hsi.h +2 -4
@@ -89,8 +89,8 @@#define FW_MAJOR_VERSION 8 -#define FW_MINOR_VERSION 10 -#define FW_REVISION_VERSION 9 +#define FW_MINOR_VERSION 14 +#define FW_REVISION_VERSION 6#define FW_ENGINEERING_VERSION 0/***********************/
@@ -726,8 +726,6 @@ union event_ring_data {struct malicious_vf_eqe_data malicious_vf/* Malicious VF data */ ;struct initial_cleanup_eqe_data vf_init_cleanup/* VF Initial Cleanup data */ ; -/* Host handle for the Async Completions */ -struct regpair iwarp_handle; };/* Event Ring Entry */ struct event_ring_entry {
drivers/net/qede/base/ecore.h +0 -9
@@ -765,15 +765,6 @@ struct ecore_dev {#define NUM_OF_ENG_PFS (dev) (ECORE_IS_BB(dev) ? MAX_NUM_PFS_BB \ : MAX_NUM_PFS_K2) -#ifndef REAL_ASIC_ONLY -#define ENABLE_EAGLE_ENG1_WORKAROUND (p_hwfn) ( \ - (ECORE_IS_BB_A0(p_hwfn->p_dev)) && \ - (ECORE_PATH_ID(p_hwfn) == 1) && \ - ((p_hwfn->hw_info.port_mode == ECORE_PORT_MODE_DE_2X40G) || \ - (p_hwfn->hw_info.port_mode == ECORE_PORT_MODE_DE_2X50G) || \ - (p_hwfn->hw_info.port_mode == ECORE_PORT_MODE_DE_2X25G))) -#endif -/** * @brief ecore_concrete_to_sw_fid - get the sw function id from * the concrete value.
drivers/net/qede/base/ecore_dcbx.c +1 -16
@@ -13,6 +13,7 @@#include "ecore_cxt.h" #include "ecore_gtt_reg_addr.h" #include "ecore_iro.h" +#include "ecore_iov_api.h" #define ECORE_DCBX_MAX_MIB_READ_TRY (100)#define ECORE_ETH_TYPE_DEFAULT (0)
@@ -79,21 +80,6 @@ static bool ecore_dcbx_local(u32 dcbx_cfg_bitmap) DCBX_CONFIG_VERSION_STATIC) ? true : false; } -/* @@@TBD A0 Eagle workaround */ -void ecore_dcbx_eagle_workaround (struct ecore_hwfn *p_hwfn, -struct ecore_ptt *p_ptt,bool set_to_pfc) -{ -if (!ENABLE_EAGLE_ENG1_WORKAROUND (p_hwfn)) -return ; - -ecore_wr (p_hwfn, p_ptt, -YSEM_REG_FAST_MEMORY +0x20000 /* RAM in FASTMEM */ + -YSTORM_FLOW_CONTROL_MODE_OFFSET , - set_to_pfc ? flow_ctrl_pfc : flow_ctrl_pause); -ecore_wr (p_hwfn, p_ptt,NIG_REG_FLOWCTRL_MODE , -EAGLE_ENG1_WORKAROUND_NIG_FLOWCTRL_MODE ); -} -static void ecore_dcbx_dp_protocol (struct ecore_hwfn *p_hwfn,struct ecore_dcbx_results *p_data)
@@ -945,7 +931,6 @@ ecore_dcbx_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,* according to negotiation results */ enabled = p_hwfn->p_dcbx_info->results.dcbx_enabled; -ecore_dcbx_eagle_workaround (p_hwfn, p_ptt, enabled); } }ecore_dcbx_get_params (p_hwfn, p_ptt, type);
drivers/net/qede/base/ecore_dcbx.h +0 -6
@@ -56,10 +56,4 @@ void ecore_dcbx_info_free(struct ecore_hwfn *, struct ecore_dcbx_info *);void ecore_dcbx_set_pf_update_params (struct ecore_dcbx_results *p_src,struct pf_update_ramrod_data *p_dest); -#ifndef REAL_ASIC_ONLY -/* @@@TBD eagle phy workaround */ -void ecore_dcbx_eagle_workaround (struct ecore_hwfn *,struct ecore_ptt *, -bool set_to_pfc); -#endif -#endif /* __ECORE_DCBX_H__ */
drivers/net/qede/base/ecore_dev.c +21 -45
148 lines not on this page · raw message
drivers/net/qede/base/ecore_gtt_reg_addr.h +10 -10
@@ -10,43 +10,43 @@#define GTT_REG_ADDR_H /* Win 2 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_IGU_CMD 0x00f000UL/* Win 3 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_TSDM_RAM 0x010000UL/* Win 4 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_MSDM_RAM 0x011000UL/* Win 5 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_MSDM_RAM_1024 0x012000UL/* Win 6 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_USDM_RAM 0x013000UL/* Win 7 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_USDM_RAM_1024 0x014000UL/* Win 8 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_USDM_RAM_2048 0x015000UL/* Win 9 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_XSDM_RAM 0x016000UL/* Win 10 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_YSDM_RAM 0x017000UL/* Win 11 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_PSDM_RAM 0x018000UL#endif
drivers/net/qede/base/ecore_hsi_common.h +45 -36
134 lines not on this page · raw message
drivers/net/qede/base/ecore_hsi_debug_tools.h +19 -7
@@ -92,6 +92,11 @@ enum block_addr {GRCBASE_MS =0x6a0000 ,GRCBASE_PHY_PCIE =0x620000 ,GRCBASE_LED =0x6b8000 , +GRCBASE_AVS_WRAP =0x6b0000 , +GRCBASE_RGFS =0x19d0000 , +GRCBASE_TGFS =0x19e0000 , +GRCBASE_PTLD =0x19f0000 , +GRCBASE_YPLD =0x1a10000 ,GRCBASE_MISC_AEU =0x8000 ,GRCBASE_BAR0_MAP =0x1c00000 ,MAX_BLOCK_ADDR
@@ -177,6 +182,11 @@ enum block_id {BLOCK_MS ,BLOCK_PHY_PCIE ,BLOCK_LED , +BLOCK_AVS_WRAP , +BLOCK_RGFS , +BLOCK_TGFS , +BLOCK_PTLD , +BLOCK_YPLD ,BLOCK_MISC_AEU ,BLOCK_BAR0_MAP ,MAX_BLOCK_ID
@@ -708,7 +718,7 @@ struct dbg_bus_data {struct dbg_bus_pci_buf_data pci_buf;__le16 reserved;/* Debug Bus data for each block */ -struct dbg_bus_block_data blocks[80 ]; +struct dbg_bus_block_data blocks[88 ];/* Debug Bus data for each block */ struct dbg_bus_storm_data storms[6 ]; };
@@ -846,12 +856,12 @@ enum dbg_bus_targets {* GRC Dump data */ struct dbg_grc_data { +/* Indicates if the GRC parameters were initialized */ +u8 params_initialized; +u8 reserved1; +__le16 reserved2;/* Value of each GRC parameter. Array size must match enum dbg_grc_params. */ -__le32 param_val[40 ]; -/* Indicates for each GRC parameter if it was set by the user (0/1). -* Array size must match the enum dbg_grc_params. -*/ -u8 param_set_by_user[40 ]; +__le32 param_val[48 ]; };
@@ -901,6 +911,8 @@ enum dbg_grc_params {DBG_GRC_PARAM_PARITY_SAFE ,DBG_GRC_PARAM_DUMP_CM /* dump CM memories (0/1) */ ,DBG_GRC_PARAM_DUMP_PHY /* dump PHY memories (0/1) */ , +DBG_GRC_PARAM_NO_MCP /* dont perform MCP commands (0/1) */ , +DBG_GRC_PARAM_NO_FW_VER /* dont read FW/MFW version (0/1) */ , MAX_DBG_GRC_PARAMS };
@@ -1014,7 +1026,7 @@ struct dbg_tools_data {struct idle_chk_data idle_chk/* Idle Check data */ ;u8 mode_enable[40 ]/* Indicates if a mode is enabled (0/1) */ ;/* Indicates if a block is in reset state (0/1) */ -u8 block_in_reset[80 ]; +u8 block_in_reset[88 ];u8 chip_id/* Chip ID (from enum chip_ids) */ ;u8 platform_id/* Platform ID (from enum platform_ids) */ ;u8 initialized/* Indicates if the data was initialized */ ;
drivers/net/qede/base/ecore_hsi_eth.h +9 -1
@@ -1446,7 +1446,15 @@ struct vport_update_ramrod_data_cmn {/* If set, MTU will be updated. Vport must be not active. */ u8 update_mtu_flg;__le16 mtu/* New MTU value. Used if update_mtu_flg are set */ ; -u8 reserved[2 ]; +/* If set, ctl_frame_mac_check_en and ctl_frame_ethtype_check_en will be +* updated +*/ +u8 update_ctl_frame_checks_en_flg; +/* If set, Contorl frames will be filtered according to MAC check. */ +u8 ctl_frame_mac_check_en; +/* If set, Contorl frames will be filtered according to ethtype check. */ +u8 ctl_frame_ethtype_check_en; +u8 reserved[15 ]; };struct vport_update_ramrod_mcast {
drivers/net/qede/base/ecore_hsi_init_tool.h +37 -45
94 lines not on this page · raw message
drivers/net/qede/base/ecore_init_fw_funcs.c +6 -39
89 lines not on this page · raw message
drivers/net/qede/base/ecore_init_ops.c +1 -2
@@ -573,8 +573,7 @@ enum _ecore_status_t ecore_init_fw_data(struct ecore_dev *p_dev,return ECORE_INVAL ; } -/* First Dword contains metadata and should be skipped */ - buf_hdr = (struct bin_buffer_hdr *)((uintptr_t )(data +sizeof (u32))); + buf_hdr = (struct bin_buffer_hdr *)(uintptr_t )data; offset = buf_hdr[BIN_BUF_INIT_FW_VER_INFO ].offset; fw->fw_ver_info = (struct fw_ver_info *)((uintptr_t )(data + offset));
drivers/net/qede/base/ecore_iov_api.h +11 -0
@@ -664,6 +664,17 @@ bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn, u16 rel_vf_id);/** +* @brief - Returm true if VF has started in FW +* +* @param p_hwfn +* @param rel_vf_id +* +* @return +*/ +bool ecore_iov_is_vf_started (struct ecore_hwfn *p_hwfn, +u16 rel_vf_id); + +/** * @brief - Get VF's vport min rate configured. * @param p_hwfn * @param rel_vf_id
drivers/net/qede/base/ecore_iro_values.h +2 -2
@@ -91,9 +91,9 @@ static const struct iro iro_arr[47] = {/* USTORM_ISCSI_RX_STATS_OFFSET(pf_id) */ { 0x11aa0, 0x38, 0x0, 0x0, 0x18},/* XSTORM_ISCSI_TX_STATS_OFFSET(pf_id) */ - { 0xa8c0, 0x30, 0x0, 0x0, 0x10}, + { 0xa8c0, 0x38, 0x0, 0x0, 0x10},/* YSTORM_ISCSI_TX_STATS_OFFSET(pf_id) */ - { 0x86f8, 0x28, 0x0, 0x0, 0x18}, + { 0x86f8, 0x30, 0x0, 0x0, 0x18},/* PSTORM_ISCSI_TX_STATS_OFFSET(pf_id) */ { 0x101f8, 0x10, 0x0, 0x0, 0x10}, /* TSTORM_FCOE_RX_STATS_OFFSET(pf_id) */
drivers/net/qede/base/ecore_mcp.c +1 -4
@@ -801,9 +801,6 @@ static void ecore_mcp_handle_link_change(struct ecore_hwfn *p_hwfn, p_link->sfp_tx_fault = !!(status &LINK_STATUS_SFP_TX_FAULT ); -if (p_link->link_up) -ecore_dcbx_eagle_workaround (p_hwfn, p_ptt, p_link->pfc_enabled); -OSAL_LINK_UPDATE (p_hwfn); }
@@ -2267,7 +2264,7 @@ enum _ecore_status_t ecore_mcp_bist_register_test(struct ecore_hwfn *p_hwfn,enum _ecore_status_t ecore_mcp_bist_clock_test (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt) { -u32 drv_mb_param =0 , rsp, param; +u32 drv_mb_param, rsp, param;enum _ecore_status_t rc =ECORE_SUCCESS ; drv_mb_param = (DRV_MB_PARAM_BIST_CLOCK_TEST <<
drivers/net/qede/base/ecore_sp_commands.c +2 -2
@@ -31,7 +31,7 @@ enum _ecore_status_t ecore_sp_init_request(struct ecore_hwfn *p_hwfn, {u32 opaque_cid = p_data->opaque_fid <<16 | p_data->cid;struct ecore_spq_entry *p_ent =OSAL_NULL ; -enum _ecore_status_t rc =ECORE_NOTIMPL ; +enum _ecore_status_t rc;if (!pp_ent)return ECORE_INVAL ;
@@ -564,7 +564,7 @@ enum _ecore_status_t ecore_sp_heartbeat_ramrod(struct ecore_hwfn *p_hwfn) {struct ecore_spq_entry *p_ent =OSAL_NULL ;struct ecore_sp_init_data init_data; -enum _ecore_status_t rc =ECORE_NOTIMPL ; +enum _ecore_status_t rc;/* Get SPQ entry */ OSAL_MEMSET (&init_data,0 ,sizeof (init_data));
drivers/net/qede/base/ecore_spq.c +3 -0
@@ -924,6 +924,9 @@ enum _ecore_status_t ecore_spq_completion(struct ecore_hwfn *p_hwfn,if (found->comp_cb.function) found->comp_cb.function (p_hwfn, found->comp_cb.cookie, p_data, fw_return_code); +else +DP_VERBOSE (p_hwfn,ECORE_MSG_SPQ , +"Got a completion without a callback function\n" );if ((found->comp_mode !=ECORE_SPQ_MODE_EBLOCK ) || (found->queue == &p_spq->unlimited_pending))
drivers/net/qede/base/ecore_sriov.c +12 -0
@@ -3964,6 +3964,18 @@ bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn, u16 rel_vf_id)return (p_vf->state ==VF_ENABLED ); } +bool ecore_iov_is_vf_started (struct ecore_hwfn *p_hwfn, +u16 rel_vf_id) +{ +struct ecore_vf_info *p_vf; + + p_vf =ecore_iov_get_vf_info (p_hwfn, rel_vf_id, true); +if (!p_vf) +return false; + +return (p_vf->state !=VF_FREE && p_vf->state !=VF_STOPPED ); +} +enum _ecore_status_t ecore_iov_get_vf_min_rate (struct ecore_hwfn *p_hwfn,int vfid) {
drivers/net/qede/base/eth_common.h +27 -7
@@ -34,6 +34,14 @@#define ETH_RX_CQE_PAGE_SIZE_BYTES 4096#define ETH_RX_NUM_NEXT_PAGE_BDS 2 +/* Limitation for Tunneled LSO Packets on the offset (in bytes) of the inner IP +* header (relevant to LSO for tunneled packet): +*/ +/* Offset is limited to 253 bytes (inclusive). */ +#define ETH_MAX_TUNN_LSO_INNER_IPV4_OFFSET 253 +/* Offset is limited to 251 bytes (inclusive). */ +#define ETH_MAX_TUNN_LSO_INNER_IPV6_OFFSET 251 +#define ETH_TX_MIN_BDS_PER_NON_LSO_PKT 1#define ETH_TX_MAX_BDS_PER_NON_LSO_PACKET 18#define ETH_TX_MAX_BDS_PER_LSO_PACKET 255
@@ -141,16 +149,23 @@ struct eth_tx_1st_bd_flags {/* Do not allow additional VLAN manipulations on this packet. */ #define ETH_TX_1ST_BD_FLAGS_FORCE_VLAN_MODE_MASK 0x1#define ETH_TX_1ST_BD_FLAGS_FORCE_VLAN_MODE_SHIFT 1 -/* IP checksum recalculation in needed */ +/* Recalculate IP checksum. For tunneled packet - relevant to inner header. */ #define ETH_TX_1ST_BD_FLAGS_IP_CSUM_MASK 0x1#define ETH_TX_1ST_BD_FLAGS_IP_CSUM_SHIFT 2 -/* TCP/UDP checksum recalculation in needed */ +/* Recalculate TCP/UDP checksum. +* For tunneled packet - relevant to inner header. +*/ #define ETH_TX_1ST_BD_FLAGS_L4_CSUM_MASK 0x1#define ETH_TX_1ST_BD_FLAGS_L4_CSUM_SHIFT 3 -/* If set, need to add the VLAN in vlan field to the packet. */ +/* If set, insert VLAN tag from vlan field to the packet. +* For tunneled packet - relevant to outer header. +*/ #define ETH_TX_1ST_BD_FLAGS_VLAN_INSERTION_MASK 0x1#define ETH_TX_1ST_BD_FLAGS_VLAN_INSERTION_SHIFT 4 -/* If set, this is an LSO packet. */ +/* If set, this is an LSO packet. Note: For Tunneled LSO packets, the offset of +* the inner IPV4 (and IPV6) header is limited to 253 (and 251 respectively) +* bytes, inclusive. +*/ #define ETH_TX_1ST_BD_FLAGS_LSO_MASK 0x1#define ETH_TX_1ST_BD_FLAGS_LSO_SHIFT 5/* Recalculate Tunnel IP Checksum (if Tunnel IP Header is IPv4) */
@@ -165,7 +180,8 @@ struct eth_tx_1st_bd_flags {* The parsing information data for the first tx bd of a given packet. */ struct eth_tx_data_1st_bd { -__le16 vlan/* VLAN tag to insert to packet (if needed). */ ; +/* VLAN tag to insert to packet (if enabled by vlan_insertion flag). */ +__le16 vlan;/* Number of BDs in packet. Should be at least 2 in non-LSO packet and at least * 3 in LSO (or Tunnel with IPv6+ext) packet. */
@@ -209,10 +225,14 @@ struct eth_tx_data_2nd_bd {/* For LSO / Tunnel header with IPv6+ext - Set if inner header is IPv6 */ #define ETH_TX_DATA_2ND_BD_TUNN_INNER_IPV6_MASK 0x1#define ETH_TX_DATA_2ND_BD_TUNN_INNER_IPV6_SHIFT 11 -/* For LSO / Tunnel header with IPv6+ext - Set if outer header has IPv6+ext */ +/* In tunneling mode - Set to 1 when the Inner header is IPv6 with extension. +* Otherwise set to 1 if the header is IPv6 with extension. +*/ #define ETH_TX_DATA_2ND_BD_IPV6_EXT_MASK 0x1#define ETH_TX_DATA_2ND_BD_IPV6_EXT_SHIFT 12 -/* Set if Tunnel header has IPv6 ext. (3rd BD is required) */ +/* Set to 1 if Tunnel (outer = encapsulating) header has IPv6 ext. (Note: 3rd BD +* is required, hence EDPM does not support Tunnel [outer] header with Ipv6Ext) +*/ #define ETH_TX_DATA_2ND_BD_TUNN_IPV6_EXT_MASK 0x1#define ETH_TX_DATA_2ND_BD_TUNN_IPV6_EXT_SHIFT 13/* Set if (inner) L4 protocol is UDP. (Required when IPv6+ext (or tunnel with
drivers/net/qede/base/nvm_cfg.h +64 -2
134 lines not on this page · raw message
drivers/net/qede/qede_main.c +2 -3
@@ -21,7 +21,7 @@ static uint8_t npar_tx_switching = 1;char fw_file[PATH_MAX ];const char *QEDE_DEFAULT_FIRMWARE = -"/lib/firmware/qed/qed_init_values-8.10.9.0.bin" ; +"/lib/firmware/qed/qed_init_values-8.14.6.0.bin" ;static void qed_update_pf_params (struct ecore_dev *edev,struct ecore_pf_params *params)
@@ -231,8 +231,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,if (IS_PF (edev)) { rc =qed_load_firmware_data (edev);if (rc) { -DP_NOTICE (edev, true, -"Failed to find fw file %s\n" , fw_file); +DP_ERR (edev,"Failed to find fw file %s\n" , fw_file); goto err; } }
Signature · 1 line
2.11.0.rc1
PATCH 23/25 net/qede/base: semantic/formatting changes
In reply to Rasesh ModyThis patch consists of semantic/formatting changes. It also includes comment additions.
--- drivers/net/qede/base/common_hsi.h | 5 +- drivers/net/qede/base/ecore_dev.c | 53 ++++--- drivers/net/qede/base/ecore_hsi_common.h | 14 +- drivers/net/qede/base/ecore_hw.c | 4 +- drivers/net/qede/base/ecore_init_ops.c | 23 ++- drivers/net/qede/base/ecore_int.c | 6 +- drivers/net/qede/base/ecore_mcp.c | 5 +- drivers/net/qede/base/ecore_spq.c | 3 +- drivers/net/qede/base/ecore_sriov.c | 8 +- drivers/net/qede/base/mcp_public.h | 262 +++++++++++++++---------------- 10 files changed, 186 insertions(+), 197 deletions(-)
drivers/net/qede/base/common_hsi.h +3 -2
@@ -721,8 +721,7 @@ union event_ring_data {u8 bytes[8 ]/* Byte Array */ ;struct vf_pf_channel_eqe_data vf_pf_channel/* VF-PF Channel data */ ;struct iscsi_eqe_data iscsi_info/* Dedicated fields to iscsi data */ ; -/* Dedicated field for RoCE affiliated asynchronous error */ ; -struct regpair roceHandle; +struct regpair roceHandle/* Dedicated field for RDMA data */ ;struct malicious_vf_eqe_data malicious_vf/* Malicious VF data */ ;struct initial_cleanup_eqe_data vf_init_cleanup/* VF Initial Cleanup data */ ;
@@ -766,6 +765,8 @@ enum protocol_type { MAX_PROTOCOL_TYPE }; + +/* * Ustorm Queue Zone */
drivers/net/qede/base/ecore_dev.c +28 -25
110 lines not on this page · raw message
drivers/net/qede/base/ecore_hsi_common.h +10 -4
@@ -1320,9 +1320,13 @@ enum personality_type {* tunnel configuration */ struct pf_start_tunnel_config { -/* Set VXLAN tunnel UDP destination port. */ +/* Set VXLAN tunnel UDP destination port to vxlan_udp_port. If not set - +* FW will use a default port +*/ u8 set_vxlan_udp_port_flg; -/* Set GENEVE tunnel UDP destination port. */ +/* Set GENEVE tunnel UDP destination port to geneve_udp_port. If not set - +* FW will use a default port +*/ u8 set_geneve_udp_port_flg;u8 tx_enable_vxlan/* If set, enable VXLAN tunnel in TX path. */ ;/* If set, enable l2 GENEVE tunnel in TX path. */
@@ -1338,8 +1342,10 @@ struct pf_start_tunnel_config {u8 tunnel_clss_ipgeneve;u8 tunnel_clss_l2gre/* Classification scheme for l2 GRE tunnel. */ ;u8 tunnel_clss_ipgre/* Classification scheme for ip GRE tunnel. */ ; -__le16 vxlan_udp_port/* VXLAN tunnel UDP destination port. */ ; -__le16 geneve_udp_port/* GENEVE tunnel UDP destination port. */ ; +/* VXLAN tunnel UDP destination port. Valid if set_vxlan_udp_port_flg=1 */ +__le16 vxlan_udp_port; +/* GENEVE tunnel UDP destination port. Valid if set_geneve_udp_port_flg=1 */ +__le16 geneve_udp_port; };/*
drivers/net/qede/base/ecore_hw.c +2 -2
@@ -496,8 +496,8 @@ static u32 ecore_dmae_idx_to_go_cmd(u8 idx)return DMAE_REG_GO_C0 + (idx <<2 ); } -static enum _ecore_status_t -ecore_dmae_post_command (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt) +static enum _ecore_status_t ecore_dmae_post_command (struct ecore_hwfn *p_hwfn, +struct ecore_ptt *p_ptt) {struct dmae_cmd *p_command = p_hwfn->dmae_info.p_dmae_cmd;u8 idx_cmd = p_hwfn->dmae_info.channel, i;
drivers/net/qede/base/ecore_init_ops.c +10 -13
@@ -63,8 +63,8 @@ static enum _ecore_status_t ecore_init_rt(struct ecore_hwfn *p_hwfn, {u32 *p_init_val = &p_hwfn->rt_data.init_val[rt_offset];bool *p_valid = &p_hwfn->rt_data.b_valid[rt_offset]; -enum _ecore_status_t rc =ECORE_SUCCESS ;u16 i, segment; +enum _ecore_status_t rc =ECORE_SUCCESS ;/* Since not all RT entries are initialized, go over the RT and * for each segment of initialized values use DMA.
@@ -190,19 +190,19 @@ static enum _ecore_status_t ecore_init_cmd_array(struct ecore_hwfn *p_hwfn, bool b_must_dmae, bool b_can_dmae) { +u32 dmae_array_offset =OSAL_LE32_TO_CPU (cmd->args.array_offset); +u32 data =OSAL_LE32_TO_CPU (cmd->data); +u32 addr =GET_FIELD (data,INIT_WRITE_OP_ADDRESS ) <<2 ;#ifdef CONFIG_ECORE_ZIPPED_FW u32 offset, output_len, input_len, max_size;#endif -u32 dmae_array_offset =OSAL_LE32_TO_CPU (cmd->args.array_offset);struct ecore_dev *p_dev = p_hwfn->p_dev; -enum _ecore_status_t rc =ECORE_SUCCESS ;union init_array_hdr *hdr;const u32 *array_data; -u32 size, addr, data; +enum _ecore_status_t rc =ECORE_SUCCESS ; +u32 size; array_data = p_dev->fw_data->arr_data; - data =OSAL_LE32_TO_CPU (cmd->data); - addr =GET_FIELD (data,INIT_WRITE_OP_ADDRESS ) <<2 ; hdr = (union init_array_hdr *) (uintptr_t )(array_data + dmae_array_offset);
@@ -272,13 +272,10 @@ static enum _ecore_status_t ecore_init_cmd_wr(struct ecore_hwfn *p_hwfn, struct init_write_op *p_cmd, bool b_can_dmae) { +u32 data =OSAL_LE32_TO_CPU (p_cmd->data); +bool b_must_dmae =GET_FIELD (data,INIT_WRITE_OP_WIDE_BUS ); +u32 addr =GET_FIELD (data,INIT_WRITE_OP_ADDRESS ) <<2 ;enum _ecore_status_t rc =ECORE_SUCCESS ; -bool b_must_dmae; -u32 addr, data; - - data =OSAL_LE32_TO_CPU (p_cmd->data); - b_must_dmae =GET_FIELD (data,INIT_WRITE_OP_WIDE_BUS ); - addr =GET_FIELD (data,INIT_WRITE_OP_ADDRESS ) <<2 ;/* Sanitize */ if (b_must_dmae && !b_can_dmae) {
@@ -452,10 +449,10 @@ enum _ecore_status_t ecore_init_run(struct ecore_hwfn *p_hwfn, int phase, int phase_id, int modes) { struct ecore_dev *p_dev = p_hwfn->p_dev; -enum _ecore_status_t rc =ECORE_SUCCESS ;u32 cmd_num, num_init_ops;union init_op *init_ops;bool b_dmae = false; +enum _ecore_status_t rc =ECORE_SUCCESS ; num_init_ops = p_dev->fw_data->init_ops_size; init_ops = p_dev->fw_data->init_ops;
drivers/net/qede/base/ecore_int.c +3 -3
@@ -1234,7 +1234,7 @@ static enum _ecore_status_t ecore_int_sb_attn_alloc(struct ecore_hwfn *p_hwfn, p_sb =OSAL_ALLOC (p_dev,GFP_KERNEL ,sizeof (*p_sb));if (!p_sb) {DP_NOTICE (p_dev, true, -"Failed to allocate `struct ecore_sb_attn_info'" ); +"Failed to allocate `struct ecore_sb_attn_info'\n" );return ECORE_NOMEM ; }
@@ -1243,7 +1243,7 @@ static enum _ecore_status_t ecore_int_sb_attn_alloc(struct ecore_hwfn *p_hwfn, SB_ATTN_ALIGNED_SIZE(p_hwfn));if (!p_virt) {DP_NOTICE (p_dev, true, -"Failed to allocate status block (attentions)" ); +"Failed to allocate status block (attentions)\n" );OSAL_FREE (p_dev, p_sb);return ECORE_NOMEM ; }
@@ -2127,8 +2127,8 @@ enum _ecore_status_t ecore_int_set_timer_res(struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt, u8 timer_res, u16 sb_id, bool tx) { - enum _ecore_status_t rc; struct cau_sb_entry sb_entry; +enum _ecore_status_t rc;if (!p_hwfn->hw_init_done) {DP_ERR (p_hwfn,"hardware not initialized yet\n" );
drivers/net/qede/base/ecore_mcp.c +2 -3
@@ -945,9 +945,8 @@ static void ecore_mcp_send_protocol_stats(struct ecore_hwfn *p_hwfn,ecore_mcp_cmd_and_union (p_hwfn, p_ptt, &mb_params); } -static void -ecore_read_pf_bandwidth (struct ecore_hwfn *p_hwfn, -struct public_func *p_shmem_info) +static void ecore_read_pf_bandwidth (struct ecore_hwfn *p_hwfn, +struct public_func *p_shmem_info) {struct ecore_mcp_function_info *p_info;
drivers/net/qede/base/ecore_spq.c +1 -2
@@ -380,8 +380,7 @@ struct ecore_eq *ecore_eq_alloc(struct ecore_hwfn *p_hwfn, u16 num_elem) }/* register EQ completion on the SP SB */ -ecore_int_register_cb (p_hwfn, - ecore_eq_completion, +ecore_int_register_cb (p_hwfn, ecore_eq_completion, p_eq, &p_eq->eq_sb_index, &p_eq->p_fw_cons);return p_eq;
drivers/net/qede/base/ecore_sriov.c +3 -5
@@ -1675,11 +1675,9 @@ ecore_iov_reconfigure_unicast_vlan(struct ecore_hwfn *p_hwfn,DP_VERBOSE (p_hwfn,ECORE_MSG_IOV ,"Reconfiguring VLAN [0x%04x] for VF [%04x]\n" , filter.vlan, p_vf->relative_vf_id); - rc =ecore_sp_eth_filter_ucast (p_hwfn, - p_vf->opaque_fid, - &filter, -ECORE_SPQ_MODE_CB , -OSAL_NULL ); + rc =ecore_sp_eth_filter_ucast (p_hwfn, p_vf->opaque_fid, + &filter,ECORE_SPQ_MODE_CB , +OSAL_NULL );if (rc) {DP_NOTICE (p_hwfn, true, "Failed to configure VLAN [%04x]"
drivers/net/qede/base/mcp_public.h +124 -138
342 lines not on this page · raw message
Signature · 1 line
2.11.0.rc1
PATCH 24/25 net/qede/base: dcbx changes for base driver
In reply to Rasesh ModyThis patch includes changes for DCBX like:
- Return empty parameters for oper-params query when negotiation is not complete
- Use the ieee specific mask value for reading the ethtype value in the ieee dcbx mode
- Endian-ness conversion is not needed for priority<->TC field, as the data is already being read/written by ecore in the bigendian way
- While writing the ets config, base driver incorrectly merges the input values with the operational values. The values should be either set or unset
- CEE selection field must be set regardless CEE/IEEE mode
- Fail the dcbx query for VF interfaces
- Semantic changes
--- drivers/net/qede/base/ecore.h | 3 + drivers/net/qede/base/ecore_dcbx.c | 375 ++++++++++++++------------------- drivers/net/qede/base/ecore_dcbx_api.h | 1 + drivers/net/qede/base/ecore_dev.c | 24 ++- 4 files changed, 185 insertions(+), 218 deletions(-)
drivers/net/qede/base/ecore.h +3 -0
@@ -373,6 +373,9 @@ struct ecore_hw_info {u32 port_mode;u32 hw_mode;unsigned long device_capabilities; + +/* Default DCBX mode */ +u8 dcbx_mode; };struct ecore_hw_cid_data {
drivers/net/qede/base/ecore_dcbx.c +158 -217
736 lines not on this page · raw message
drivers/net/qede/base/ecore_dcbx_api.h +1 -0
@@ -147,6 +147,7 @@ struct ecore_dcbx_get {#define ECORE_DCBX_VERSION_DISABLED 0#define ECORE_DCBX_VERSION_IEEE 1#define ECORE_DCBX_VERSION_CEE 2 +#define ECORE_DCBX_VERSION_DYNAMIC 3struct ecore_dcbx_set {#define ECORE_DCBX_OVERRIDE_STATE (1 << 0)
drivers/net/qede/base/ecore_dev.c +23 -1
@@ -2405,7 +2405,7 @@ static enum _ecore_status_t ecore_hw_get_resc(struct ecore_hwfn *p_hwfn,static enum _ecore_status_t ecore_hw_get_nvm_info (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt) { -u32 nvm_cfg1_offset, mf_mode, addr, generic_cont0, core_cfg; +u32 nvm_cfg1_offset, mf_mode, addr, generic_cont0, core_cfg, dcbx_mode;u32 port_cfg_addr, link_temp, nvm_cfg_addr, device_capabilities;struct ecore_mcp_link_params *link;
@@ -2469,6 +2469,28 @@ static enum _ecore_status_t ecore_hw_get_nvm_info(struct ecore_hwfn *p_hwfn,break ; } +/* Read DCBX configuration */ + port_cfg_addr =MCP_REG_SCRATCH + nvm_cfg1_offset + + OFFSETOF(struct nvm_cfg1, port[MFW_PORT(p_hwfn)]); + dcbx_mode =ecore_rd (p_hwfn, p_ptt, + port_cfg_addr + + OFFSETOF(struct nvm_cfg1_port, generic_cont0)); + dcbx_mode = (dcbx_mode &NVM_CFG1_PORT_DCBX_MODE_MASK ) + >>NVM_CFG1_PORT_DCBX_MODE_OFFSET ; +switch (dcbx_mode) { +case NVM_CFG1_PORT_DCBX_MODE_DYNAMIC : + p_hwfn->hw_info.dcbx_mode =ECORE_DCBX_VERSION_DYNAMIC ; +break ; +case NVM_CFG1_PORT_DCBX_MODE_CEE : + p_hwfn->hw_info.dcbx_mode =ECORE_DCBX_VERSION_CEE ; +break ; +case NVM_CFG1_PORT_DCBX_MODE_IEEE : + p_hwfn->hw_info.dcbx_mode =ECORE_DCBX_VERSION_IEEE ; +break ; +default : + p_hwfn->hw_info.dcbx_mode =ECORE_DCBX_VERSION_DISABLED ; + } +/* Read default link configuration */ link = &p_hwfn->mcp_info->link_input; port_cfg_addr = MCP_REG_SCRATCH + nvm_cfg1_offset +
Signature · 1 line
2.11.0.rc1
PATCH 25/25 net/qede: update PMD version to 2.0.0.1
In reply to Rasesh Mody--- drivers/net/qede/qede_ethdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/qede/qede_ethdev.h +2 -2
@@ -46,8 +46,8 @@/* Driver versions */ #define QEDE_PMD_VER_PREFIX "QEDE PMD" -#define QEDE_PMD_VERSION_MAJOR 1 -#define QEDE_PMD_VERSION_MINOR 2 +#define QEDE_PMD_VERSION_MAJOR 2 +#define QEDE_PMD_VERSION_MINOR 0#define QEDE_PMD_VERSION_REVISION 0#define QEDE_PMD_VERSION_PATCH 1
Signature · 1 line
2.11.0.rc1
Quoted 6 lines · Rasesh Mody
Hi,
This patch set consists of enhancements, new 8.14.x.x firmware support and semantic changes. It update the QEDE PMD version to 2.0.0.1.
Please include in DPDK 17.02 release.
Hi Rasesh,
This patchset seems depends to both [1] and [2], can you confirm?
[1] http://dpdk.org/ml/archives/dev/2016-December/051260.html
[2] http://dpdk.org/ml/archives/dev/2016-December/051253.html
Thanks,
ferruh
Quoted 4 lines
Thanks!
Rasesh
<...>
Hi Ferruh,
Quoted 9 lines
From: Ferruh Yigit [mailto:[email protected]]
Sent: Friday, December 09, 2016 8:53 AMQuoted 5 lines · Rasesh Mody
Hi,
This patch set consists of enhancements, new 8.14.x.x firmware support and semantic changes. It update the QEDE PMD version to 2.0.0.1.
Quoted 8 lines
Quoted 1 line
Please include in DPDK 17.02 release.
Hi Rasesh,
This patchset seems depends to both [1] and [2], can you confirm?
[1] http://dpdk.org/ml/archives/dev/2016-December/051260.html
[2] http://dpdk.org/ml/archives/dev/2016-December/051253.html
That's correct, sorry missed to mention that.
Thanks!
Rasesh
Quoted 9 lines
Thanks,
ferruhQuoted 4 lines
Thanks!
Rasesh<...>
Re: [PATCH 01/25] net/qede/base: add request for PF FLR before load request
In reply to Rasesh ModyQuoted 1 line · Rasesh Mody
Add a request for PF FLR before a load request
What does FLR stands for?
Quoted 6 lines
Fix the location of the PF FLR initiation to be after
ecore_get_hw_info()(which invokesecore_hw_info_port_num())Signed-off-by Rasesh Mody <[email protected]>---
<...>
Re: [PATCH 08/25] net/qede/base: fix updating VF queue zone id
In reply to Rasesh ModyQuoted 3 lines · Rasesh Mody
Pass the absolute
qzone_idwhen creating queues.Fixes 5cdd769a ("qede: add L2 support")
If there will a new version of the patch, please fix Fixes format, but if no new version will be send I can fix them.
Quoted 2 lines
Signed-off-by Rasesh Mody <[email protected]>
Again, nit picking, but if there will be a new version can you please update mail address with all lower case and git author information to be "Name Surname <mail_address>", currently it is "Surname, Name <mail_address>"
Thanks J
Quoted 1 line
---
<...>
Re: [PATCH 20/25] net/qede: add PCI ids for new chip variant
In reply to Rasesh ModyQuoted 15 lines · Rasesh Mody
Add PCI IDs for new asic type (defined as
CHIP_NUM_AH_xxx). It supports 50G, 40G, 25G and 10G speeds.Signed-off-by Rasesh Mody <[email protected]>--- drivers/net/qede/base/ecore_dev.c | 7 +++++- drivers/net/qede/qede_ethdev.c | 29 ++++++++++++++++++------ drivers/net/qede/qede_ethdev.h | 47 ++++++++++++++++++++++++--------------- 3 files changed, 57 insertions(+), 26 deletions(-)drivers/net/qede/base/ecore_dev.c +0
-0
drivers/net/qede/base/ecore_dev.c static enum _ecore_status_t ecore_hw_get_resc(struct ecore_hwfn *p_hwfn, · line 2373
Quoted 10 lines
drivers/net/qede/base/ecore_dev.c +6
-1@@ -2365,7 +2365,12 @@ static enum _ecore_status_t ecore_hw_get_resc(struct ecore_hwfn *p_hwfn,#endif for (res_id =0 ; res_id <ECORE_MAX_RESC ; res_id++) { - rc =ecore_hw_set_resc_info (p_hwfn, res_id, drv_resc_alloc); +/* @@@TMP for AH: +* Force the driver's default resource allocation in case there +* is a diff with the MFW allocation value. +*/ + rc =ecore_hw_set_resc_info (p_hwfn, res_id, + b_ah || drv_resc_alloc);
Just to double check, is above code piece is related to the "add PCI ids for new chip variant" ?
Quoted 3 lines
drivers/net/qede/base/ecore_dev.c +0
-0if (rc !=ECORE_SUCCESS )return rc; }
<...>
Re: [PATCH 22/25] net/qede/base: add support for new firmware
In reply to Rasesh ModyQuoted 1 line · Rasesh Mody
Add support for 8.14.x.x firmware.
Is it possible to list what has been changed with new FW here?
Quoted 3 lines
Signed-off-by Rasesh Mody <[email protected]>---
<...>
Re: [PATCH 23/25] net/qede/base: semantic/formatting changes
In reply to Rasesh ModyQuoted 2 lines · Rasesh Mody
This patch consists of semantic/formatting changes. It also includes comment additions.
As far as I can see majority of the changes are formatting, but not all.
Functional changes are hard to detect in this patch, what do you think separating formatting/comments patches into another patch, so functional changes can become more visible?
Quoted 3 lines
Signed-off-by Rasesh Mody <[email protected]>---
<...>
Re: [PATCH 01/25] net/qede/base: add request for PF FLR before load request
In reply to Ferruh YigitQuoted 7 lines
From: Ferruh Yigit [mailto:[email protected]]
Sent: Friday, December 23, 2016 7:33 AMQuoted 1 line · Rasesh Mody
Add a request for PF FLR before a load request
What does FLR stands for?
Function Level Reset or FLR
Quoted 7 lines
Quoted 6 lines
Fix the location of the PF FLR initiation to be after
ecore_get_hw_info()(which invokesecore_hw_info_port_num())Signed-off-by Rasesh Mody <[email protected]>---
<...>
Re: [PATCH 20/25] net/qede: add PCI ids for new chip variant
In reply to Ferruh YigitQuoted 26 lines
From: Ferruh Yigit [mailto:[email protected]]
Sent: Friday, December 23, 2016 7:39 AMQuoted 8 lines · Rasesh Mody
Add PCI IDs for new asic type (defined as
CHIP_NUM_AH_xxx). It supports 50G, 40G, 25G and 10G speeds.Signed-off-by Rasesh Mody <[email protected]>--- drivers/net/qede/base/ecore_dev.c | 7 +++++- drivers/net/qede/qede_ethdev.c | 29 ++++++++++++++++++------ drivers/net/qede/qede_ethdev.h | 47 ++++++++++++++++++++++++---------------
drivers/net/qede/base/ecore_dev.c
Quoted 12 lines
3 files changed, 57 insertions(+), 26 deletions(-)drivers/net/qede/base/ecore_dev.c +0
-0@@ -2365,7 +2365,12 @@ static enum _ecore_status_tecore_hw_get_resc(struct
ecore_hwfn*p_hwfn, #endifdrivers/net/qede/base/ecore_dev.c +0
-1for (res_id =0 ; res_id <ECORE_MAX_RESC ; res_id++) { - rc = ecore_hw_set_resc_info(p_hwfn, res_id,
drv_resc_alloc);
Quoted 9 lines
drivers/net/qede/base/ecore_dev.c static enum _ecore_status_t ecore_hw_get_resc(struct ecore_hwfn *p_hwfn, · line 2373
Quoted 6 lines
drivers/net/qede/base/ecore_dev.c +6
-0+/* @@@TMP for AH: +* Force the driver's default resource allocation in case there +* is a diff with the MFW allocation value. +*/ + rc =ecore_hw_set_resc_info (p_hwfn, res_id, + b_ah || drv_resc_alloc);Just to double check, is above code piece is related to the "add PCI ids for new chip variant" ?
Yes, that is correct. In case of new chip variant AH, we force the driver's default resource allocation if it differs from management firmware allocation value.
Quoted 4 lines
Quoted 3 lines
drivers/net/qede/base/ecore_dev.c +0
-0if (rc !=ECORE_SUCCESS )return rc; }<...>
Re: [PATCH 22/25] net/qede/base: add support for new firmware
In reply to Ferruh YigitHi Ferruh,
Quoted 7 lines
From: Ferruh Yigit [mailto:[email protected]]
Sent: Friday, December 23, 2016 7:40 AMQuoted 1 line · Rasesh Mody
Add support for 8.14.x.x firmware.
Is it possible to list what has been changed with new FW here?
The new firmware adds support for external PHY BCM8485x; configures fixed link speed with transceiver/cable not supporting negotiation; supports engine swap; supports overriding PCIe preset equalization value; checks pause too long for ports and reads die temperature every second for shutdown threshold. It includes change in FLR flow when there is a SW initiated FLR.
Thanks!
-Rasesh
Quoted 5 lines
Quoted 4 lines
Signed-off-by Rasesh Mody <[email protected]>---
<...>
Re: [PATCH 23/25] net/qede/base: semantic/formatting changes
In reply to Ferruh YigitQuoted 4 lines
From: Ferruh Yigit [mailto:[email protected]]
Sent: Friday, December 23, 2016 7:42 AMOn 12/3/2016 9:11 AM, Rasesh Mody wrote:
Quoted 8 lines
Quoted 2 lines
This patch consists of semantic/formatting changes. It also includes comment additions.
As far as I can see majority of the changes are formatting, but not all.
Functional changes are hard to detect in this patch, what do you think separating formatting/comments patches into another patch, so functional changes can become more visible?
There are few of places(ecore_hw_bar_size(), ecore_get_hw_info() and ecore_init_cmd_*), where there is a bit of code refactoring. However, they are not a major change. We have tried to isolate most of the functional changes and made them part of the separate patches as fit. I think, we can include a bit of description in commit message to cover it in this patch. Please let me know if you think otherwise.
Quoted 4 lines
Quoted 3 lines
Signed-off-by Rasesh Mody <[email protected]>---
<...>
Re: [PATCH 23/25] net/qede/base: semantic/formatting changes
Quoted 7 lines · Rasesh
Quoted 7 lines
From: Ferruh Yigit [mailto:[email protected]]
Sent: Friday, December 23, 2016 7:42 AMQuoted 2 lines · Rasesh Mody
This patch consists of semantic/formatting changes. It also includes comment additions.
Quoted 7 lines
Quoted 5 lines
As far as I can see majority of the changes are formatting, but not all.
Functional changes are hard to detect in this patch, what do you think separating formatting/comments patches into another patch, so functional changes can become more visible?
There are few of
places(ecore_hw_bar_size(), ecore_get_hw_info() and ecore_init_cmd_*), where there is a bit of code refactoring. However, they are not a major change. We have tried to isolate most of the functional changes and made them part of the separate patches as fit. I think, we can include a bit of description in commit message to cover it in this patch. Please let me know if you think otherwise.
I believe it is good to separate code refactoring into different patch if possible, instead of covering this in commit log.
This makes functional changes easy to find in the future. In this patch hard to spot them.
Thanks,
ferruh
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Signed-off-by Rasesh Mody <[email protected]>---
<...>
v2 cover net/qede: update qede pmd to 2.0.0.1
In reply to Rasesh ModyHi,
This patch set consists of enhancements, new 8.14.x.x firmware support and semantic changes. It update the QEDE PMD version to 2.0.0.1.
v1..v2 - addresses all the review comments
Please include in DPDK 17.02 release.
Thanks!
Rasesh
Rasesh Mody (26):
net/qede/base: add request for PF FLR before load request net/qede/base: improve set field macro net/qede/base: add handling of malicious VF net/qede/base: change return codes in SR-IOV net/qede/base: make API non-static net/qede/base: rename macro
net/qede/base: add check to validate txq net/qede/base: fix updating VF queue zone id net/qede/base: improve Tx-switching performance net/qede/base: semantic change
net/qede: remove unused struct member net/qede/base: enhance resource info set printouts net/qede/base: add new enum member to status codes net/qede/base: add macros for converting pointer net/qede: add new host ring type option net/qede/base: add check for get nvm info return code net/qede/base: retrieve FW crash dump info net/qede/base: add support for external PHY net/qede/base: add support for 2x10G mode net/qede: add PCI ids for new chip variant net/qede: add 50G device PCI id
net/qede/base: add support for new firmware net/qede/base: semantic/formatting changes net/qede/base: refactor some code bits net/qede/base: dcbx changes for base driver net/qede: update PMD version to 2.0.0.1
config/common_base | 2 +- doc/guides/nics/qede.rst | 12 +- drivers/net/qede/base/bcm_osal.h | 1 + drivers/net/qede/base/common_hsi.h | 11 +- drivers/net/qede/base/ecore.h | 21 +- drivers/net/qede/base/ecore_chain.h | 9 +- drivers/net/qede/base/ecore_dcbx.c | 390 ++++++++++--------------- drivers/net/qede/base/ecore_dcbx.h | 6 - drivers/net/qede/base/ecore_dcbx_api.h | 1 + drivers/net/qede/base/ecore_dev.c | 349 +++++++++++++--------- drivers/net/qede/base/ecore_dev_api.h | 9 +- drivers/net/qede/base/ecore_gtt_reg_addr.h | 20 +- drivers/net/qede/base/ecore_hsi_common.h | 95 +++--- drivers/net/qede/base/ecore_hsi_debug_tools.h | 26 +- drivers/net/qede/base/ecore_hsi_eth.h | 10 +- drivers/net/qede/base/ecore_hsi_init_tool.h | 82 +++--- drivers/net/qede/base/ecore_hw.c | 6 +- drivers/net/qede/base/ecore_init_fw_funcs.c | 45 +-- drivers/net/qede/base/ecore_init_ops.c | 26 +- drivers/net/qede/base/ecore_int.c | 6 +- drivers/net/qede/base/ecore_iov_api.h | 15 +- drivers/net/qede/base/ecore_iro_values.h | 4 +- drivers/net/qede/base/ecore_l2.c | 48 +-- drivers/net/qede/base/ecore_l2_api.h | 20 +- drivers/net/qede/base/ecore_mcp.c | 86 +++--- drivers/net/qede/base/ecore_mcp.h | 25 +- drivers/net/qede/base/ecore_mcp_api.h | 33 ++- drivers/net/qede/base/ecore_sp_commands.c | 4 +- drivers/net/qede/base/ecore_spq.c | 23 +- drivers/net/qede/base/ecore_sriov.c | 211 +++++++++---- drivers/net/qede/base/ecore_sriov.h | 5 +- drivers/net/qede/base/ecore_status.h | 1 + drivers/net/qede/base/ecore_utils.h | 6 + drivers/net/qede/base/ecore_vf.c | 43 ++- drivers/net/qede/base/eth_common.h | 34 ++- drivers/net/qede/base/mcp_public.h | 350 +++++++++++++--------- drivers/net/qede/base/nvm_cfg.h | 68 ++++- drivers/net/qede/qede_eth_if.c | 1 + drivers/net/qede/qede_ethdev.c | 32 +- drivers/net/qede/qede_ethdev.h | 53 ++-- drivers/net/qede/qede_if.h | 18 +- drivers/net/qede/qede_main.c | 13 +- drivers/net/qede/qede_rxtx.c | 9 +- 43 files changed, 1286 insertions(+), 943 deletions(-)
Signature · 1 line
1.7.10.3
PATCH v2 1/26 net/qede/base: add request for PF FLR before load request
In reply to Rasesh ModyAdd a request for PF Function Level Reset(FLR) before a load request
Fix the location of the PF FLR initiation to be after ecore_get_hw_info() (which invokes ecore_hw_info_port_num())
--- drivers/net/qede/base/ecore_dev.c | 16 ++++++++++------ drivers/net/qede/base/ecore_dev_api.h | 2 ++ drivers/net/qede/base/ecore_mcp.c | 4 ++-- drivers/net/qede/base/ecore_mcp.h | 11 +++++++++++ drivers/net/qede/qede_main.c | 1 + 5 files changed, 26 insertions(+), 8 deletions(-)
drivers/net/qede/base/ecore_dev.c +10 -6
@@ -2998,12 +2998,6 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview, goto err1; } -if (p_hwfn ==ECORE_LEADING_HWFN (p_dev) && !p_dev->recov_in_prog) { - rc =ecore_mcp_initiate_pf_flr (p_hwfn, p_hwfn->p_main_ptt); -if (rc !=ECORE_SUCCESS ) -DP_NOTICE (p_hwfn, false,"Failed to initiate PF FLR\n" ); - } -/* Read the device configuration information from the HW and SHMEM */ rc =ecore_get_hw_info (p_hwfn, p_hwfn->p_main_ptt, p_params->personality, p_params->drv_resc_alloc);
@@ -3012,6 +3006,16 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview, goto err2; } +/* Sending a mailbox to the MFW should be after ecore_get_hw_info() is +* called, since among others it sets the ports number in an engine. +*/ +if (p_params->initiate_pf_flr && p_hwfn ==ECORE_LEADING_HWFN (p_dev) && + !p_dev->recov_in_prog) { + rc =ecore_mcp_initiate_pf_flr (p_hwfn, p_hwfn->p_main_ptt); +if (rc !=ECORE_SUCCESS ) +DP_NOTICE (p_hwfn, false,"Failed to initiate PF FLR\n" ); + } +/* Allocate the init RT array and initialize the init-ops engine */ rc =ecore_init_alloc (p_hwfn);if (rc) {
drivers/net/qede/base/ecore_dev_api.h +2 -0
@@ -147,6 +147,8 @@ struct ecore_hw_prepare_params {bool drv_resc_alloc;/* check the reg_fifo after any register access */ bool chk_reg_fifo; +/* request the MFW to initiate PF FLR */ +bool initiate_pf_flr; };/**
drivers/net/qede/base/ecore_mcp.c +2 -2
@@ -2448,6 +2448,6 @@ enum _ecore_status_t ecore_mcp_initiate_pf_flr(struct ecore_hwfn *p_hwfn, {u32 mcp_resp, mcp_param; -return ecore_mcp_cmd (p_hwfn, p_ptt,DRV_MSG_CODE_INITIATE_PF_FLR , -0 , &mcp_resp, &mcp_param); +return ecore_mcp_cmd (p_hwfn, p_ptt,DRV_MSG_CODE_INITIATE_PF_FLR ,0 , + &mcp_resp, &mcp_param); }
drivers/net/qede/base/ecore_mcp.h +11 -0
@@ -348,6 +348,17 @@ enum _ecore_status_t ecore_mcp_mdump_clear_logs(struct ecore_hwfn *p_hwfn,enum _ecore_status_t ecore_mcp_mdump_get_info (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt); +/** +* @brief - Gets the MFW allocation info for the given resource +* +* @param p_hwfn +* @param p_ptt +* @param p_resc_info +* @param p_mcp_resp +* @param p_mcp_param +* +* @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful. +*/ enum _ecore_status_t ecore_mcp_get_resc_info(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, struct resource_info *p_resc_info,
drivers/net/qede/qede_main.c +1 -0
@@ -62,6 +62,7 @@ qed_probe(struct ecore_dev *edev, struct rte_pci_device *pci_dev, hw_prepare_params.personality =ECORE_PCI_ETH ; hw_prepare_params.drv_resc_alloc = false; hw_prepare_params.chk_reg_fifo = false; + hw_prepare_params.initiate_pf_flr = true; rc =ecore_hw_prepare (edev, &hw_prepare_params);if (rc) {DP_ERR (edev,"hw prepare failed\n" );
Signature · 1 line
1.7.10.3
PATCH v2 2/26 net/qede/base: improve set field macro
In reply to Rasesh ModyImprove robustness of the SET_FIELD macro by using a mask.
--- drivers/net/qede/base/ecore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/qede/base/ecore.h +1 -1
@@ -80,7 +80,7 @@ enum ecore_nvm_cmd {#define SET_FIELD (value, name, flag) \ do { \ (value) &= ~(name##_MASK << name##_SHIFT); \ - (value) |= (((u64)flag) << (name##_SHIFT)); \ + (value) |= ((((u64)flag) & (u64)name##_MASK) << (name##_SHIFT));\ } while (0)#define GET_FIELD (value, name) \
Signature · 1 line
1.7.10.3
PATCH v2 3/26 net/qede/base: add handling of malicious VF
In reply to Rasesh ModyReceive indication that VFs are malicious and pass it to the caller/clients and stop serving those VF's additional resource requests.
--- drivers/net/qede/base/bcm_osal.h | 1 + drivers/net/qede/base/ecore_iov_api.h | 4 +- drivers/net/qede/base/ecore_l2.c | 26 ++++++- drivers/net/qede/base/ecore_l2_api.h | 9 +++ drivers/net/qede/base/ecore_sriov.c | 123 +++++++++++++++++++++++++++++---- drivers/net/qede/base/ecore_sriov.h | 1 + 6 files changed, 147 insertions(+), 17 deletions(-)
drivers/net/qede/base/bcm_osal.h +1 -0
@@ -323,6 +323,7 @@ u32 qede_find_first_zero_bit(unsigned long *, u32);#define OSAL_VF_SEND_MSG2PF (dev, done, msg, reply_addr, msg_size, reply_size) 0#define OSAL_VF_CQE_COMPLETION (_dev_p, _cqe, _protocol) (0)#define OSAL_PF_VF_MSG (hwfn, vfid) 0 +#define OSAL_PF_VF_MALICIOUS (hwfn, vfid) nothing#define OSAL_IOV_CHK_UCAST (hwfn, vfid, params) 0#define OSAL_IOV_POST_START_VPORT (hwfn, vf, vport_id, opaque_fid) nothing#define OSAL_IOV_VF_ACQUIRE (hwfn, vfid) 0
drivers/net/qede/base/ecore_iov_api.h +3 -1
@@ -52,6 +52,7 @@ enum ecore_iov_pf_to_vf_status {PFVF_STATUS_NOT_SUPPORTED ,PFVF_STATUS_NO_RESOURCE ,PFVF_STATUS_FORCED , + PFVF_STATUS_MALICIOUS, };struct ecore_mcp_link_params ;
@@ -301,12 +302,13 @@ bool ecore_iov_is_vf_pending_flr(struct ecore_hwfn *p_hwfn,* @param p_hwfn * @param rel_vf_id - Relative VF ID * @param b_enabled_only - consider only enabled VF +* @param b_non_malicious - true iff we want to validate vf isn't malicious. * * @return bool - true for valid VF ID */ bool ecore_iov_is_valid_vfid (struct ecore_hwfn *p_hwfn,int rel_vf_id, -bool b_enabled_only); +bool b_enabled_only,bool b_non_malicious);/** * @brief Get VF's public info structure
drivers/net/qede/base/ecore_l2.c +25 -1
@@ -36,9 +36,9 @@ ecore_sp_eth_vport_start(struct ecore_hwfn *p_hwfn,struct vport_start_ramrod_data *p_ramrod =OSAL_NULL ;struct ecore_spq_entry *p_ent =OSAL_NULL ;struct ecore_sp_init_data init_data; +u16 rx_mode =0 , tx_err =0 ;u8 abs_vport_id =0 ;enum _ecore_status_t rc =ECORE_NOTIMPL ; -u16 rx_mode =0 ; rc =ecore_fw_vport (p_hwfn, p_params->vport_id, &abs_vport_id);if (rc !=ECORE_SUCCESS )
@@ -71,6 +71,30 @@ ecore_sp_eth_vport_start(struct ecore_hwfn *p_hwfn, p_ramrod->rx_mode.state =OSAL_CPU_TO_LE16 (rx_mode); +/* Handle requests for strict behavior on transmission errors */ +SET_FIELD (tx_err,ETH_TX_ERR_VALS_ILLEGAL_VLAN_MODE , + p_params->b_err_illegal_vlan_mode ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_PACKET_TOO_SMALL , + p_params->b_err_small_pkt ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_ANTI_SPOOFING_ERR , + p_params->b_err_anti_spoof ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_ILLEGAL_INBAND_TAGS , + p_params->b_err_illegal_inband_mode ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_VLAN_INSERTION_W_INBAND_TAG , + p_params->b_err_vlan_insert_with_inband ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_MTU_VIOLATION , + p_params->b_err_big_pkt ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); +SET_FIELD (tx_err,ETH_TX_ERR_VALS_ILLEGAL_CONTROL_FRAME , + p_params->b_err_ctrl_frame ? +ETH_TX_ERR_ASSERT_MALICIOUS :0 ); + p_ramrod->tx_err_behav.values =OSAL_CPU_TO_LE16 (tx_err); +/* TPA related fields */ OSAL_MEMSET (&p_ramrod->tpa_param,0 ,sizeof (struct eth_vport_tpa_param ));
drivers/net/qede/base/ecore_l2_api.h +9 -0
@@ -274,6 +274,15 @@ struct ecore_sp_vport_start_params {bool zero_placement_offset;bool check_mac;bool check_ethtype; + +/* Strict behavior on transmission errors */ +bool b_err_illegal_vlan_mode; +bool b_err_illegal_inband_mode; +bool b_err_vlan_insert_with_inband; +bool b_err_small_pkt; +bool b_err_big_pkt; +bool b_err_anti_spoof; +bool b_err_ctrl_frame; };/**
drivers/net/qede/base/ecore_sriov.c +108 -15
231 lines not on this page · raw message
drivers/net/qede/base/ecore_sriov.h +1 -0
@@ -97,6 +97,7 @@ struct ecore_vf_info {struct ecore_iov_vf_mbx vf_mbx;enum vf_state state;bool b_init; +bool b_malicious;u8 to_disable;struct ecore_bulletin bulletin;
Signature · 1 line
1.7.10.3
PATCH v2 4/26 net/qede/base: change return codes in SR-IOV
In reply to Rasesh ModyChange return codes in VF/SR-IOV base driver from int to enum _ecore_status_t.
--- drivers/net/qede/base/ecore_sriov.c | 19 +++++++++++-------- drivers/net/qede/base/ecore_sriov.h | 4 ++-- drivers/net/qede/base/ecore_vf.c | 33 ++++++++++++++++++--------------- 3 files changed, 31 insertions(+), 25 deletions(-)
drivers/net/qede/base/ecore_sriov.c +11 -8
@@ -1707,9 +1707,10 @@ ecore_iov_reconfigure_unicast_shadow(struct ecore_hwfn *p_hwfn,return rc; } -static int ecore_iov_configure_vport_forced (struct ecore_hwfn *p_hwfn, -struct ecore_vf_info *p_vf, -u64 events) +static enum _ecore_status_t +ecore_iov_configure_vport_forced (struct ecore_hwfn *p_hwfn, +struct ecore_vf_info *p_vf, +u64 events) {enum _ecore_status_t rc =ECORE_SUCCESS ;struct ecore_filter_ucast filter;
@@ -3141,9 +3142,10 @@ ecore_iov_single_vf_flr_cleanup(struct ecore_hwfn *p_hwfn,return rc; } -int ecore_iov_mark_vf_flr (struct ecore_hwfn *p_hwfn,u32 *p_disabled_vfs) +bool ecore_iov_mark_vf_flr (struct ecore_hwfn *p_hwfn,u32 *p_disabled_vfs) { -u16 i, found =0 ; +bool found; +u16 i;DP_VERBOSE (p_hwfn,ECORE_MSG_IOV ,"Marking FLR-ed VFs\n" );for (i =0 ; i < (VF_MAX_STATIC /32 ); i++)
@@ -3153,7 +3155,7 @@ int ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)if (!p_hwfn->p_dev->p_iov_info) {DP_NOTICE (p_hwfn, true,"VF flr but no IOV\n" ); -return 0 ; +return false; }/* Mark VFs */
@@ -3182,7 +3184,7 @@ int ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)* VF flr until ACKs, we're safe. */ p_flr[rel_vf_id /64 ] |=1ULL << (rel_vf_id %64 ); - found =1 ; + found = true; } }
@@ -3961,7 +3963,8 @@ bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn, u16 rel_vf_id)return (p_vf->state ==VF_ENABLED ); } -int ecore_iov_get_vf_min_rate (struct ecore_hwfn *p_hwfn,int vfid) +enum _ecore_status_t +ecore_iov_get_vf_min_rate (struct ecore_hwfn *p_hwfn,int vfid) {struct ecore_wfq_data *vf_vp_wfq;struct ecore_vf_info *vf_info;
drivers/net/qede/base/ecore_sriov.h +2 -2
@@ -277,8 +277,8 @@ u32 ecore_crc32(u32 crc,* * @return 1 iff one of the PF's vfs got FLRed. 0 otherwise. */ -int ecore_iov_mark_vf_flr (struct ecore_hwfn *p_hwfn, -u32 *disabled_vfs); +bool ecore_iov_mark_vf_flr (struct ecore_hwfn *p_hwfn, +u32 *disabled_vfs);/** * @brief Search extended TLVs in request/reply buffer.
drivers/net/qede/base/ecore_vf.c +18 -15
@@ -65,13 +65,15 @@ static void ecore_vf_pf_req_end(struct ecore_hwfn *p_hwfn,OSAL_MUTEX_RELEASE (&p_hwfn->vf_iov_info->mutex); } -static int ecore_send_msg2pf (struct ecore_hwfn *p_hwfn, -u8 *done,u32 resp_size) +static enum _ecore_status_t +ecore_send_msg2pf (struct ecore_hwfn *p_hwfn, +u8 *done,u32 resp_size) {union vfpf_tlvs *p_req = p_hwfn->vf_iov_info->vf2pf_request;struct ustorm_trigger_vf_zone trigger;struct ustorm_vf_zone *zone_data; -int rc =ECORE_SUCCESS , time =100 ; +enum _ecore_status_t rc =ECORE_SUCCESS ; +int time =100 ; zone_data = (struct ustorm_vf_zone *)PXP_VF_BAR0_START_USDM_ZONE_B ;
@@ -475,7 +477,7 @@ enum _ecore_status_t ecore_vf_pf_rxq_start(struct ecore_hwfn *p_hwfn,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_start_queue_resp_tlv *resp;struct vfpf_start_rxq_tlv *req; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_START_RXQ ,sizeof (*req));
@@ -550,7 +552,7 @@ enum _ecore_status_t ecore_vf_pf_rxq_stop(struct ecore_hwfn *p_hwfn,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct vfpf_stop_rxqs_tlv *req;struct pfvf_def_resp_tlv *resp; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_STOP_RXQS ,sizeof (*req));
@@ -591,7 +593,7 @@ enum _ecore_status_t ecore_vf_pf_txq_start(struct ecore_hwfn *p_hwfn,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_start_queue_resp_tlv *resp;struct vfpf_start_txq_tlv *req; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_START_TXQ ,sizeof (*req));
@@ -649,7 +651,7 @@ enum _ecore_status_t ecore_vf_pf_txq_stop(struct ecore_hwfn *p_hwfn, u16 tx_qid)struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct vfpf_stop_txqs_tlv *req;struct pfvf_def_resp_tlv *resp; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_STOP_TXQS ,sizeof (*req));
@@ -686,7 +688,7 @@ enum _ecore_status_t ecore_vf_pf_rxqs_update(struct ecore_hwfn *p_hwfn,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_def_resp_tlv *resp = &p_iov->pf2vf_reply->default_resp;struct vfpf_update_rxq_tlv *req; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_UPDATE_RXQ ,sizeof (*req));
@@ -728,7 +730,8 @@ ecore_vf_pf_vport_start(struct ecore_hwfn *p_hwfn, u8 vport_id,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct vfpf_vport_start_tlv *req;struct pfvf_def_resp_tlv *resp; -int rc, i; +enum _ecore_status_t rc; +int i;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_VPORT_START ,sizeof (*req));
@@ -770,7 +773,7 @@ enum _ecore_status_t ecore_vf_pf_vport_stop(struct ecore_hwfn *p_hwfn) {struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_def_resp_tlv *resp = &p_iov->pf2vf_reply->default_resp; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_VPORT_TEARDOWN,
@@ -868,7 +871,7 @@ ecore_vf_pf_vport_update(struct ecore_hwfn *p_hwfn,u8 update_rx, update_tx;u32 resp_size =0 ;u16 size, tlv; -int rc; +enum _ecore_status_t rc; resp = &p_iov->pf2vf_reply->default_resp; resp_size =sizeof (*resp);
@@ -1076,7 +1079,7 @@ enum _ecore_status_t ecore_vf_pf_reset(struct ecore_hwfn *p_hwfn)struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_def_resp_tlv *resp;struct vfpf_first_tlv *req; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_CLOSE ,sizeof (*req));
@@ -1109,8 +1112,8 @@ enum _ecore_status_t ecore_vf_pf_release(struct ecore_hwfn *p_hwfn)struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_def_resp_tlv *resp;struct vfpf_first_tlv *req; +enum _ecore_status_t rc;u32 size; -int rc;/* clear mailbox and prep first tlv */ req =ecore_vf_pf_prep (p_hwfn,CHANNEL_TLV_RELEASE ,sizeof (*req));
@@ -1182,7 +1185,7 @@ enum _ecore_status_t ecore_vf_pf_filter_ucast(struct ecore_hwfn *p_hwfn,struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct vfpf_ucast_filter_tlv *req;struct pfvf_def_resp_tlv *resp; -int rc; +enum _ecore_status_t rc;/* Sanitize */ if (p_ucast->opcode ==ECORE_FILTER_MOVE ) {
@@ -1223,7 +1226,7 @@ enum _ecore_status_t ecore_vf_pf_int_cleanup(struct ecore_hwfn *p_hwfn) {struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;struct pfvf_def_resp_tlv *resp = &p_iov->pf2vf_reply->default_resp; -int rc; +enum _ecore_status_t rc;/* clear mailbox and prep first tlv */ ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_INT_CLEANUP,
Signature · 1 line
1.7.10.3
PATCH v2 6/26 net/qede/base: rename macro
In reply to Rasesh ModyRename OOO_LB_TC to PKT_LB_TC to give better meaning.
--- drivers/net/qede/base/ecore.h | 2 +- drivers/net/qede/base/ecore_hw.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/qede/base/ecore.h +1 -1
@@ -800,7 +800,7 @@ static OSAL_INLINE u8 ecore_concrete_to_sw_fid(struct ecore_dev *p_dev, }#define PURE_LB_TC 8 -#define OOO_LB_TC 9 +#define PKT_LB_TC 9int ecore_configure_vport_wfq (struct ecore_dev *p_dev,u16 vp_id,u32 rate); void ecore_configure_vp_wfq_on_link_change(struct ecore_dev *p_dev,
drivers/net/qede/base/ecore_hw.c +1 -1
@@ -923,7 +923,7 @@ u16 ecore_get_qm_pq(struct ecore_hwfn *p_hwfn,case PROTOCOLID_CORE :if (p_params->core.tc ==LB_TC ) pq_id = p_hwfn->qm_info.pure_lb_pq; -else if (p_params->core.tc ==OOO_LB_TC ) +else if (p_params->core.tc ==PKT_LB_TC ) pq_id = p_hwfn->qm_info.ooo_pq;else pq_id = p_hwfn->qm_info.offload_pq;
Signature · 1 line
1.7.10.3
PATCH v2 5/26 net/qede/base: make API non-static
In reply to Rasesh ModyMove ecore_set_fw_mac_addr from ecore_l2.c to ecore_dev.c to facilitate future code reuse.
--- drivers/net/qede/base/ecore.h | 2 ++ drivers/net/qede/base/ecore_dev.c | 13 +++++++++++++ drivers/net/qede/base/ecore_l2.c | 11 ----------- 3 files changed, 15 insertions(+), 11 deletions(-)
drivers/net/qede/base/ecore.h +2 -0
@@ -811,6 +811,8 @@ int ecore_configure_pf_min_bandwidth(struct ecore_dev *p_dev, u8 min_bw);void ecore_clean_wfq_db (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt);int ecore_device_num_engines (struct ecore_dev *p_dev);int ecore_device_num_ports (struct ecore_dev *p_dev); +void ecore_set_fw_mac_addr (__le16 *fw_msb,__le16 *fw_mid,__le16 *fw_lsb, +u8 *mac);#define ECORE_LEADING_HWFN (dev) (&dev->hwfns[0])
drivers/net/qede/base/ecore_dev.c +13 -0
@@ -4297,3 +4297,16 @@ int ecore_device_num_ports(struct ecore_dev *p_dev)return p_dev->num_ports_in_engines *ecore_device_num_engines (p_dev); } + +void ecore_set_fw_mac_addr (__le16 *fw_msb, +__le16 *fw_mid, +__le16 *fw_lsb, +u8 *mac) +{ + ((u8 *)fw_msb)[0 ] = mac[1 ]; + ((u8 *)fw_msb)[1 ] = mac[0 ]; + ((u8 *)fw_mid)[0 ] = mac[3 ]; + ((u8 *)fw_mid)[1 ] = mac[2 ]; + ((u8 *)fw_lsb)[0 ] = mac[5 ]; + ((u8 *)fw_lsb)[1 ] = mac[4 ]; +}
drivers/net/qede/base/ecore_l2.c +0 -11
@@ -1012,17 +1012,6 @@ ecore_filter_action(enum ecore_filter_opcode opcode)return action; } -static void ecore_set_fw_mac_addr (__le16 *fw_msb, -__le16 *fw_mid,__le16 *fw_lsb,u8 *mac) -{ - ((u8 *)fw_msb)[0 ] = mac[1 ]; - ((u8 *)fw_msb)[1 ] = mac[0 ]; - ((u8 *)fw_mid)[0 ] = mac[3 ]; - ((u8 *)fw_mid)[1 ] = mac[2 ]; - ((u8 *)fw_lsb)[0 ] = mac[5 ]; - ((u8 *)fw_lsb)[1 ] = mac[4 ]; -} - static enum _ecore_status_t ecore_filter_ucast_common(struct ecore_hwfn *p_hwfn, u16 opaque_fid,
Signature · 1 line
1.7.10.3
PATCH v2 7/26 net/qede/base: add check to validate txq
In reply to Rasesh ModyMake sure VF tx_qid and the status block index is in the allocated range, else fail the request.
--- drivers/net/qede/base/ecore_sriov.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/net/qede/base/ecore_sriov.c +13 -13
@@ -2099,26 +2099,26 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn, pq_params.eth.is_vf =1 ; pq_params.eth.vf_id = vf->relative_vf_id; - req = &mbx->req_virt->start_txq;OSAL_MEMSET (&p_params,0 ,sizeof (p_params)); + req = &mbx->req_virt->start_txq; + +if (!ecore_iov_validate_txq (p_hwfn, vf, req->tx_qid) || + !ecore_iov_validate_sb (p_hwfn, vf, req->hw_sb)) + goto out; + p_params.queue_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; p_params.vport_id = vf->vport_id; p_params.stats_id = vf->abs_vf_id +0x10 , p_params.sb = req->hw_sb; p_params.sb_idx = req->sb_index; -if (!ecore_iov_validate_txq (p_hwfn, vf, req->tx_qid) || - !ecore_iov_validate_sb (p_hwfn, vf, req->hw_sb)) - goto out; - - rc =ecore_sp_eth_txq_start_ramrod ( - p_hwfn, - vf->opaque_fid, - vf->vf_queues[req->tx_qid].fw_cid, - &p_params, - req->pbl_addr, - req->pbl_size, - &pq_params); + rc =ecore_sp_eth_txq_start_ramrod (p_hwfn, + vf->opaque_fid, + vf->vf_queues[req->tx_qid].fw_cid, + &p_params, + req->pbl_addr, + req->pbl_size, + &pq_params);if (rc) status =PFVF_STATUS_FAILURE ;
Signature · 1 line
1.7.10.3
PATCH v2 8/26 net/qede/base: fix updating VF queue zone id
In reply to Rasesh ModyPass the absolute qzone_id when creating queues.
--- drivers/net/qede/base/ecore_dev.c | 9 ++++++--- drivers/net/qede/base/ecore_l2.c | 10 +++++----- drivers/net/qede/base/ecore_l2_api.h | 11 +++++++++-- drivers/net/qede/base/ecore_sriov.c | 1 + drivers/net/qede/qede_eth_if.c | 1 + 5 files changed, 22 insertions(+), 10 deletions(-)
drivers/net/qede/base/ecore_dev.c +6 -3
@@ -542,11 +542,14 @@ enum _ecore_status_t ecore_resc_alloc(struct ecore_dev *p_dev)/* Allocate Memory for the Queue->CID mapping */ for_each_hwfn (p_dev, i) {struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i]; +u32 num_tx_conns =RESC_NUM (p_hwfn,ECORE_L2_QUEUE ); +int tx_size, rx_size;/* @@@TMP - resc management, change to actual required size */ -int tx_size =sizeof (struct ecore_hw_cid_data ) * -RESC_NUM (p_hwfn,ECORE_L2_QUEUE ); -int rx_size =sizeof (struct ecore_hw_cid_data ) * +if (p_hwfn->pf_params.eth_pf_params.num_cons > num_tx_conns) + num_tx_conns = p_hwfn->pf_params.eth_pf_params.num_cons; + tx_size =sizeof (struct ecore_hw_cid_data ) * num_tx_conns; + rx_size =sizeof (struct ecore_hw_cid_data ) *RESC_NUM (p_hwfn,ECORE_L2_QUEUE ); p_hwfn->p_tx_cids = OSAL_ZALLOC(p_hwfn->p_dev, GFP_KERNEL,
drivers/net/qede/base/ecore_l2.c +5 -5
@@ -663,7 +663,7 @@ ecore_sp_eth_rx_queue_start(struct ecore_hwfn *p_hwfn,if (IS_VF (p_hwfn->p_dev)) { return ecore_vf_pf_rxq_start(p_hwfn, - p_params->queue_id, + (u8)p_params->queue_id, p_params->sb, (u8)p_params->sb_idx, bd_max_bytes,
@@ -840,9 +840,9 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,struct ecore_spq_entry *p_ent =OSAL_NULL ;struct ecore_sp_init_data init_data;struct ecore_hw_cid_data *p_tx_cid; -u16 pq_id, abs_tx_q_id =0 ; -u8 abs_vport_id; +u16 pq_id, abs_tx_qzone_id =0 ;enum _ecore_status_t rc =ECORE_NOTIMPL ; +u8 abs_vport_id;/* Store information for the stop */ p_tx_cid = &p_hwfn->p_tx_cids[p_params->queue_id];
@@ -853,7 +853,7 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,if (rc !=ECORE_SUCCESS )return rc; - rc =ecore_fw_l2_queue (p_hwfn, p_params->queue_id, &abs_tx_q_id); + rc =ecore_fw_l2_queue (p_hwfn, p_params->qzone_id, &abs_tx_qzone_id);if (rc !=ECORE_SUCCESS )return rc;
@@ -876,7 +876,7 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn, p_ramrod->sb_index = (u8 )p_params->sb_idx; p_ramrod->stats_counter_id = p_params->stats_id; - p_ramrod->queue_zone_id =OSAL_CPU_TO_LE16 (abs_tx_q_id); + p_ramrod->queue_zone_id =OSAL_CPU_TO_LE16 (abs_tx_qzone_id); p_ramrod->pbl_size =OSAL_CPU_TO_LE16 (pbl_size);DMA_REGPAIR_LE (p_ramrod->pbl_base_addr, pbl_addr);
drivers/net/qede/base/ecore_l2_api.h +9 -2
@@ -28,10 +28,17 @@ enum ecore_rss_caps {#endif struct ecore_queue_start_common_params { -/* Rx/Tx queue id */ -u8 queue_id; +/* Rx/Tx queue relative id to keep obtained cid in corresponding array +* RX - upper-bounded by number of FW-queues +*/ +u16 queue_id;u8 vport_id; +/* q_zone_id is relative, may be different from queue id +* currently used by Tx-only, upper-bounded by number of FW-queues +*/ +u8 qzone_id; +/* stats_id is relative or absolute depends on function */ u8 stats_id;u16 sb;
drivers/net/qede/base/ecore_sriov.c +1 -0
@@ -2107,6 +2107,7 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn, goto out; p_params.queue_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; + p_params.qzone_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; p_params.vport_id = vf->vport_id; p_params.stats_id = vf->abs_vf_id +0x10 , p_params.sb = req->hw_sb;
drivers/net/qede/qede_eth_if.c +1 -0
@@ -213,6 +213,7 @@ qed_start_txq(struct ecore_dev *edev, p_hwfn = &edev->hwfns[hwfn_index]; p_params->queue_id = p_params->queue_id / edev->num_hwfns; + p_params->qzone_id = p_params->queue_id; p_params->stats_id = p_params->vport_id; rc = ecore_sp_eth_tx_queue_start(p_hwfn,
Signature · 1 line
1.7.10.3
PATCH v2 9/26 net/qede/base: improve Tx-switching performance
In reply to Rasesh ModyIn order to improve Tx switching performance an additional HSI parameter called same-as-last-id is introduced. This resource allows FW caching the txqs packet properties. Driver needs to set same-as-last-id to be equal to the qzone.
--- drivers/net/qede/base/ecore_l2.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/qede/base/ecore_l2.c +1 -0
@@ -877,6 +877,7 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn, p_ramrod->stats_counter_id = p_params->stats_id; p_ramrod->queue_zone_id =OSAL_CPU_TO_LE16 (abs_tx_qzone_id); + p_ramrod->same_as_last_id =OSAL_CPU_TO_LE16 (abs_tx_qzone_id); p_ramrod->pbl_size =OSAL_CPU_TO_LE16 (pbl_size);DMA_REGPAIR_LE (p_ramrod->pbl_base_addr, pbl_addr);
Signature · 1 line
1.7.10.3
PATCH v2 11/26 net/qede: remove unused struct member
In reply to Rasesh ModyRemove b_hw_channel from struct ecore_dev.
--- drivers/net/qede/base/ecore.h | 2 -- drivers/net/qede/base/ecore_vf.c | 10 ---------- drivers/net/qede/qede_main.c | 5 ++--- 3 files changed, 2 insertions(+), 15 deletions(-)
drivers/net/qede/base/ecore.h +0 -2
@@ -711,8 +711,6 @@ struct ecore_dev {/* SRIOV */ struct ecore_hw_sriov_info *p_iov_info;#define IS_ECORE_SRIOV (p_dev) (!!(p_dev)->p_iov_info) -bool b_hw_channel; -unsigned long tunn_mode;bool b_is_vf;
drivers/net/qede/base/ecore_vf.c +0 -10
@@ -83,16 +83,6 @@ ecore_send_msg2pf(struct ecore_hwfn *p_hwfn,/* need to add the END TLV to the message size */ resp_size +=sizeof (struct channel_list_end_tlv ); -if (!p_hwfn->p_dev->b_hw_channel) { - rc =OSAL_VF_SEND_MSG2PF (p_hwfn->p_dev, - done, - p_req, - p_hwfn->vf_iov_info->pf2vf_reply, -sizeof (union vfpf_tlvs ), resp_size); -/* TODO - no prints about message ? */ -return rc; - } -/* Send TLVs over HW channel */ OSAL_MEMSET (&trigger,0 ,sizeof (struct ustorm_trigger_vf_zone )); trigger.vf_pf_msg_valid =1 ;
drivers/net/qede/qede_main.c +2 -3
@@ -51,10 +51,9 @@ qed_probe(struct ecore_dev *edev, struct rte_pci_device *pci_dev,ecore_init_struct (edev); qdev->protocol = protocol; -if (is_vf) { +if (is_vf) edev->b_is_vf = true; - edev->b_hw_channel = true;/* @DPDK */ - } +ecore_init_dp (edev, dp_module, dp_level,NULL );qed_init_pci (edev, pci_dev);
Signature · 1 line
1.7.10.3
PATCH v2 12/26 net/qede/base: enhance resource info set printouts
In reply to Rasesh ModyAdd the resources names in the ecore_hw_set_resc_info() printouts.
--- drivers/net/qede/base/ecore_dev.c | 100 ++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 50 deletions(-)
drivers/net/qede/base/ecore_dev.c +50 -50
@@ -2222,6 +2222,40 @@ static u32 ecore_hw_get_dflt_resc_num(struct ecore_hwfn *p_hwfn,return dflt_resc_num; } +static const char *ecore_hw_get_resc_name (enum ecore_resources res_id) +{ +switch (res_id) { +case ECORE_SB : +return "SB" ; +case ECORE_L2_QUEUE : +return "L2_QUEUE" ; +case ECORE_VPORT : +return "VPORT" ; +case ECORE_RSS_ENG : +return "RSS_ENG" ; +case ECORE_PQ : +return "PQ" ; +case ECORE_RL : +return "RL" ; +case ECORE_MAC : +return "MAC" ; +case ECORE_VLAN : +return "VLAN" ; +case ECORE_RDMA_CNQ_RAM : +return "RDMA_CNQ_RAM" ; +case ECORE_ILT : +return "ILT" ; +case ECORE_LL2_QUEUE : +return "LL2_QUEUE" ; +case ECORE_CMDQS_CQS : +return "CMDQS_CQS" ; +case ECORE_RDMA_STATS_QUEUE : +return "RDMA_STATS_QUEUE" ; +default : +return "UNKNOWN_RESOURCE" ; + } +} +static enum _ecore_status_t ecore_hw_set_resc_info (struct ecore_hwfn *p_hwfn,enum ecore_resources res_id,bool drv_resc_alloc)
@@ -2236,8 +2270,9 @@ static enum _ecore_status_t ecore_hw_set_resc_info(struct ecore_hwfn *p_hwfn, dflt_resc_num =ecore_hw_get_dflt_resc_num (p_hwfn, res_id);if (!dflt_resc_num) { -DP_ERR (p_hwfn,"Failed to get default amount for resource %d\n" , - res_id); +DP_ERR (p_hwfn, +"Failed to get default amount for resource %d [%s]\n" , + res_id,ecore_hw_get_resc_name (res_id));return ECORE_INVAL ; } dflt_resc_start = dflt_resc_num * p_hwfn->enabled_func_idx;
@@ -2263,8 +2298,9 @@ static enum _ecore_status_t ecore_hw_set_resc_info(struct ecore_hwfn *p_hwfn, &mcp_resp, &mcp_param);if (rc !=ECORE_SUCCESS ) {DP_NOTICE (p_hwfn, true, -"MFW resp failure for a resc alloc req [res_id %d]\n" , - res_id); +"MFW response failure for an allocation request for" +" resource %d [%s]\n" , + res_id,ecore_hw_get_resc_name (res_id));return rc; }
@@ -2277,11 +2313,11 @@ static enum _ecore_status_t ecore_hw_set_resc_info(struct ecore_hwfn *p_hwfn, mcp_resp != FW_MSG_CODE_RESOURCE_ALLOC_DEPRECATED) {/* @DPDK */ DP_INFO (p_hwfn, -"No allocation info for resc %d [mcp_resp 0x%x]." , - res_id, mcp_resp); -DP_INFO (p_hwfn, -"Applying default values [num %d, start %d].\n" , - dflt_resc_num, dflt_resc_start); +"Resource %d [%s]: No allocation info was received" +" [mcp_resp 0x%x]. Applying default values" +" [num %d, start %d].\n" , + res_id,ecore_hw_get_resc_name (res_id), mcp_resp, + dflt_resc_num, dflt_resc_start); *p_resc_num = dflt_resc_num; *p_resc_start = dflt_resc_start;
@@ -2300,13 +2336,11 @@ static enum _ecore_status_t ecore_hw_set_resc_info(struct ecore_hwfn *p_hwfn,if (*p_resc_num != dflt_resc_num || *p_resc_start != dflt_resc_start) {DP_NOTICE (p_hwfn, false, -"Resource %d: MFW allocation [num %d, start %d]" , - res_id, *p_resc_num, *p_resc_start); -DP_NOTICE (p_hwfn, false, -"differs from default values [num %d, start %d]%s\n" , - dflt_resc_num, - dflt_resc_start, - drv_resc_alloc ?" - applying default values" :"" ); +"Resource %d [%s]: MFW allocation [num %d, start %d]" +" differs from default values [num %d, start %d]%s\n" , + res_id,ecore_hw_get_resc_name (res_id), *p_resc_num, + *p_resc_start, dflt_resc_num, dflt_resc_start, + drv_resc_alloc ?" - Applying default values" :"" );if (drv_resc_alloc) { *p_resc_num = dflt_resc_num; *p_resc_start = dflt_resc_start;
@@ -2316,40 +2350,6 @@ static enum _ecore_status_t ecore_hw_set_resc_info(struct ecore_hwfn *p_hwfn,return ECORE_SUCCESS ; } -static const char *ecore_hw_get_resc_name (enum ecore_resources res_id) -{ -switch (res_id) { -case ECORE_SB : -return "SB" ; -case ECORE_L2_QUEUE : -return "L2_QUEUE" ; -case ECORE_VPORT : -return "VPORT" ; -case ECORE_RSS_ENG : -return "RSS_ENG" ; -case ECORE_PQ : -return "PQ" ; -case ECORE_RL : -return "RL" ; -case ECORE_MAC : -return "MAC" ; -case ECORE_VLAN : -return "VLAN" ; -case ECORE_RDMA_CNQ_RAM : -return "RDMA_CNQ_RAM" ; -case ECORE_ILT : -return "ILT" ; -case ECORE_LL2_QUEUE : -return "LL2_QUEUE" ; -case ECORE_CMDQS_CQS : -return "CMDQS_CQS" ; -case ECORE_RDMA_STATS_QUEUE : -return "RDMA_STATS_QUEUE" ; -default : -return "UNKNOWN_RESOURCE" ; - } -} -static enum _ecore_status_t ecore_hw_get_resc (struct ecore_hwfn *p_hwfn,bool drv_resc_alloc) {
Signature · 1 line
1.7.10.3
PATCH v2 10/26 net/qede/base: semantic change
In reply to Rasesh ModySemantic change: No reason to have p_ prefix to non-pointers
--- drivers/net/qede/base/ecore_sriov.c | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
drivers/net/qede/base/ecore_sriov.c +18 -18
@@ -1987,7 +1987,7 @@ static void ecore_iov_vf_mbx_start_rxq(struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt, struct ecore_vf_info *vf) { - struct ecore_queue_start_common_params p_params; + struct ecore_queue_start_common_params params;struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;u8 status =PFVF_STATUS_NO_RESOURCE ;struct vfpf_start_rxq_tlv *req;
@@ -2000,13 +2000,13 @@ static void ecore_iov_vf_mbx_start_rxq(struct ecore_hwfn *p_hwfn, !ecore_iov_validate_sb(p_hwfn, vf, req->hw_sb)) goto out; -OSAL_MEMSET (&p_params,0 ,sizeof (p_params)); - p_params.queue_id = (u8 )vf->vf_queues[req->rx_qid].fw_rx_qid; - p_params.vf_qid = req->rx_qid; - p_params.vport_id = vf->vport_id; - p_params.stats_id = vf->abs_vf_id +0x10 , - p_params.sb = req->hw_sb; - p_params.sb_idx = req->sb_index; +OSAL_MEMSET (¶ms,0 ,sizeof (params)); + params.queue_id = (u8 )vf->vf_queues[req->rx_qid].fw_rx_qid; + params.vf_qid = req->rx_qid; + params.vport_id = vf->vport_id; + params.stats_id = vf->abs_vf_id +0x10 , + params.sb = req->hw_sb; + params.sb_idx = req->sb_index;/* Legacy VFs have their Producers in a different location, which they * calculate on their own and clean the producer prior to this.
@@ -2022,7 +2022,7 @@ static void ecore_iov_vf_mbx_start_rxq(struct ecore_hwfn *p_hwfn, rc = ecore_sp_eth_rxq_start_ramrod(p_hwfn, vf->opaque_fid, vf->vf_queues[req->rx_qid].fw_cid, - &p_params, + ¶ms, req->bd_max_bytes, req->rxq_addr, req->cqe_pbl_addr,
@@ -2087,7 +2087,7 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt, struct ecore_vf_info *vf) { - struct ecore_queue_start_common_params p_params; + struct ecore_queue_start_common_params params;struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;u8 status =PFVF_STATUS_NO_RESOURCE ;union ecore_qm_pq_params pq_params;
@@ -2099,24 +2099,24 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn, pq_params.eth.is_vf =1 ; pq_params.eth.vf_id = vf->relative_vf_id; -OSAL_MEMSET (&p_params,0 ,sizeof (p_params)); +OSAL_MEMSET (¶ms,0 ,sizeof (params)); req = &mbx->req_virt->start_txq;if (!ecore_iov_validate_txq (p_hwfn, vf, req->tx_qid) || !ecore_iov_validate_sb (p_hwfn, vf, req->hw_sb)) goto out; - p_params.queue_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; - p_params.qzone_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; - p_params.vport_id = vf->vport_id; - p_params.stats_id = vf->abs_vf_id +0x10 , - p_params.sb = req->hw_sb; - p_params.sb_idx = req->sb_index; + params.queue_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; + params.qzone_id = (u8 )vf->vf_queues[req->tx_qid].fw_tx_qid; + params.vport_id = vf->vport_id; + params.stats_id = vf->abs_vf_id +0x10 , + params.sb = req->hw_sb; + params.sb_idx = req->sb_index; rc =ecore_sp_eth_txq_start_ramrod (p_hwfn, vf->opaque_fid, vf->vf_queues[req->tx_qid].fw_cid, - &p_params, + ¶ms, req->pbl_addr, req->pbl_size, &pq_params);
Signature · 1 line
1.7.10.3
PATCH v2 13/26 net/qede/base: add new enum member to status codes
In reply to Rasesh ModyAdd ECORE_CONN_RESET to enum ecore_status.
--- drivers/net/qede/base/ecore_status.h | 1 + 1 file changed, 1 insertion(+)
drivers/net/qede/base/ecore_status.h +1 -0
@@ -10,6 +10,7 @@#define __ECORE_STATUS_H__enum _ecore_status_t { +ECORE_CONN_RESET =-13 ,ECORE_UNKNOWN_ERROR =-12 ,ECORE_NORESOURCES =-11 ,ECORE_NODEV =-10 ,
Signature · 1 line
1.7.10.3
PATCH v2 14/26 net/qede/base: add macros for converting pointer
In reply to Rasesh ModyAdd macros PTR_LO and PTR_HI (for converting pointer to HI and LOW bits for passing to FW hsi handles).
--- drivers/net/qede/base/ecore_utils.h | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/qede/base/ecore_utils.h +6 -0
@@ -10,6 +10,12 @@#define __ECORE_UTILS_H__/* dma_addr_t manip */ +/* Suppress "right shift count >= width of type" warning when that quantity is +* 32-bits rquires the >> 16) >> 16) +*/ +#define PTR_LO (x) ((u32)(((osal_uintptr_t)(x)) & 0xffffffff)) +#define PTR_HI (x) ((u32)((((osal_uintptr_t)(x)) >> 16) >> 16)) +#define DMA_LO (x) ((u32)(((dma_addr_t)(x)) & 0xffffffff))#define DMA_HI (x) ((u32)(((dma_addr_t)(x)) >> 32))
Signature · 1 line
1.7.10.3
PATCH v2 15/26 net/qede: add new host ring type option
In reply to Rasesh ModyAdd new option called external PBL (page base list) to ecore_chain_alloc for future use. Mark chain as external if external PBL is provided.
--- drivers/net/qede/base/ecore_chain.h | 9 ++++++++- drivers/net/qede/base/ecore_dev.c | 27 ++++++++++++++++++++------- drivers/net/qede/base/ecore_dev_api.h | 3 ++- drivers/net/qede/base/ecore_spq.c | 17 +++++++++++------ drivers/net/qede/qede_if.h | 18 ++++++++++-------- drivers/net/qede/qede_rxtx.c | 9 ++++++--- 6 files changed, 57 insertions(+), 26 deletions(-)
drivers/net/qede/base/ecore_chain.h +8 -1
@@ -54,6 +54,11 @@ struct ecore_chain_pbl_u32 {u32 cons_page_idx; }; +struct ecore_chain_ext_pbl { +dma_addr_t p_pbl_phys; +void *p_pbl_virt; +}; +struct ecore_chain_pbl {/* Base address of a pre-allocated buffer for pbl */ dma_addr_t p_phys_table;
@@ -69,6 +74,8 @@ struct ecore_chain_pbl {struct ecore_chain_pbl_u16 pbl16;struct ecore_chain_pbl_u32 pbl32; } u; + +bool external; };struct ecore_chain_u16 {
@@ -570,7 +577,7 @@ ecore_chain_init_params(struct ecore_chain *p_chain, u32 page_cnt, u8 elem_size, p_chain->page_cnt = page_cnt; p_chain->capacity = p_chain->usable_per_page * page_cnt; p_chain->size = p_chain->elem_per_page * page_cnt; - + p_chain->pbl.external = false; p_chain->pbl.p_phys_table =0 ; p_chain->pbl.p_virt_table =OSAL_NULL ; p_chain->pbl.pp_virt_addr_tbl =OSAL_NULL ;
drivers/net/qede/base/ecore_dev.c +20 -7
@@ -3193,8 +3193,10 @@ static void ecore_chain_free_pbl(struct ecore_dev *p_dev, } pbl_size = page_cnt *ECORE_CHAIN_PBL_ENTRY_SIZE ; -OSAL_DMA_FREE_COHERENT (p_dev, p_chain->pbl.p_virt_table, - p_chain->pbl.p_phys_table, pbl_size); + +if (!p_chain->pbl.external) +OSAL_DMA_FREE_COHERENT (p_dev, p_chain->pbl.p_virt_table, + p_chain->pbl.p_phys_table, pbl_size); out:OSAL_VFREE (p_dev, p_chain->pbl.pp_virt_addr_tbl); }
@@ -3294,8 +3296,10 @@ ecore_chain_alloc_single(struct ecore_dev *p_dev, struct ecore_chain *p_chain)return ECORE_SUCCESS ; } -static enum _ecore_status_t ecore_chain_alloc_pbl (struct ecore_dev *p_dev, -struct ecore_chain *p_chain) +static enum _ecore_status_t +ecore_chain_alloc_pbl (struct ecore_dev *p_dev, +struct ecore_chain *p_chain, +struct ecore_chain_ext_pbl *ext_pbl) {void *p_virt =OSAL_NULL ;u8 *p_pbl_virt =OSAL_NULL ;
@@ -3319,7 +3323,15 @@ static enum _ecore_status_t ecore_chain_alloc_pbl(struct ecore_dev *p_dev,* should be saved to allow its freeing during the error flow. */ size = page_cnt *ECORE_CHAIN_PBL_ENTRY_SIZE ; - p_pbl_virt =OSAL_DMA_ALLOC_COHERENT (p_dev, &p_pbl_phys, size); + +if (ext_pbl ==OSAL_NULL ) { + p_pbl_virt =OSAL_DMA_ALLOC_COHERENT (p_dev, &p_pbl_phys, size); + }else { + p_pbl_virt = ext_pbl->p_pbl_virt; + p_pbl_phys = ext_pbl->p_pbl_phys; + p_chain->pbl.external = true; + } +ecore_chain_init_pbl_mem (p_chain, p_pbl_virt, p_pbl_phys, pp_virt_addr_tbl);if (!p_pbl_virt) {
@@ -3357,7 +3369,8 @@ enum _ecore_status_t ecore_chain_alloc(struct ecore_dev *p_dev,enum ecore_chain_mode mode, enum ecore_chain_cnt_type cnt_type, u32 num_elems, osal_size_t elem_size, - struct ecore_chain *p_chain) + struct ecore_chain *p_chain, + struct ecore_chain_ext_pbl *ext_pbl) { u32 page_cnt;enum _ecore_status_t rc =ECORE_SUCCESS ;
@@ -3388,7 +3401,7 @@ enum _ecore_status_t ecore_chain_alloc(struct ecore_dev *p_dev, rc =ecore_chain_alloc_single (p_dev, p_chain);break ;case ECORE_CHAIN_MODE_PBL : - rc =ecore_chain_alloc_pbl (p_dev, p_chain); + rc =ecore_chain_alloc_pbl (p_dev, p_chain, ext_pbl);break ; }if (rc)
drivers/net/qede/base/ecore_dev_api.h +2 -1
@@ -370,7 +370,8 @@ ecore_chain_alloc(struct ecore_dev *p_dev,enum ecore_chain_cnt_type cnt_type, u32 num_elems, osal_size_t elem_size, - struct ecore_chain *p_chain); + struct ecore_chain *p_chain, + struct ecore_chain_ext_pbl *ext_pbl);/** * @brief ecore_chain_free - Free chain DMA memory
drivers/net/qede/base/ecore_spq.c +11 -6
@@ -373,7 +373,8 @@ struct ecore_eq *ecore_eq_alloc(struct ecore_hwfn *p_hwfn, u16 num_elem) ECORE_CHAIN_MODE_PBL,ECORE_CHAIN_CNT_TYPE_U16 , num_elem, - sizeof(union event_ring_element), &p_eq->chain)) { + sizeof(union event_ring_element), + &p_eq->chain, OSAL_NULL)) { DP_NOTICE(p_hwfn, true, "Failed to allocate eq chain\n"); goto eq_allocate_fail; }
@@ -501,10 +502,13 @@ enum _ecore_status_t ecore_spq_alloc(struct ecore_hwfn *p_hwfn) }/* SPQ ring */ -if (ecore_chain_alloc (p_hwfn->p_dev,ECORE_CHAIN_USE_TO_PRODUCE , -ECORE_CHAIN_MODE_SINGLE ,ECORE_CHAIN_CNT_TYPE_U16 ,0 , -/* N/A when the mode is SINGLE */ -sizeof (struct slow_path_element ), &p_spq->chain)) { +if (ecore_chain_alloc (p_hwfn->p_dev, +ECORE_CHAIN_USE_TO_PRODUCE , +ECORE_CHAIN_MODE_SINGLE , +ECORE_CHAIN_CNT_TYPE_U16 , +0 ,/* N/A when the mode is SINGLE */ +sizeof (struct slow_path_element ), + &p_spq->chain,OSAL_NULL )) {DP_NOTICE (p_hwfn, true,"Failed to allocate spq chain\n" ); goto spq_allocate_fail; }
@@ -956,7 +960,8 @@ struct ecore_consq *ecore_consq_alloc(struct ecore_hwfn *p_hwfn) ECORE_CHAIN_MODE_PBL, ECORE_CHAIN_CNT_TYPE_U16, ECORE_CHAIN_PAGE_SIZE / 0x80, - 0x80, &p_consq->chain)) { + 0x80, + &p_consq->chain, OSAL_NULL)) {DP_NOTICE (p_hwfn, true,"Failed to allocate consq chain" ); goto consq_allocate_fail; }
drivers/net/qede/qede_if.h +10 -8
@@ -110,14 +110,16 @@ struct qed_common_ops { uint32_t dp_module, uint8_t dp_level, bool is_vf);void (*set_id)(struct ecore_dev *edev,char name[],const char ver_str[]); -enum _ecore_status_t (*chain_alloc)(struct ecore_dev *edev, -enum ecore_chain_use_mode - intended_use, -enum ecore_chain_mode mode, -enum ecore_chain_cnt_type cnt_type, -uint32_t num_elems, -osal_size_t elem_size, -struct ecore_chain *p_chain); +enum _ecore_status_t + (*chain_alloc)(struct ecore_dev *edev, +enum ecore_chain_use_mode + intended_use, +enum ecore_chain_mode mode, +enum ecore_chain_cnt_type cnt_type, +uint32_t num_elems, +osal_size_t elem_size, +struct ecore_chain *p_chain, +struct ecore_chain_ext_pbl *ext_pbl);void (*chain_free)(struct ecore_dev *edev,struct ecore_chain *p_chain);
drivers/net/qede/qede_rxtx.c +6 -3
@@ -176,7 +176,8 @@ qede_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,ECORE_CHAIN_CNT_TYPE_U16 , rxq->nb_rx_desc,sizeof (struct eth_rx_bd ), - &rxq->rx_bd_ring); + &rxq->rx_bd_ring, + NULL);if (rc !=ECORE_SUCCESS ) { DP_NOTICE(edev, false,
@@ -196,7 +197,8 @@ qede_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,ECORE_CHAIN_CNT_TYPE_U16 , rxq->nb_rx_desc,sizeof (union eth_rx_cqe ), - &rxq->rx_comp_ring); + &rxq->rx_comp_ring, + NULL);if (rc !=ECORE_SUCCESS ) { DP_NOTICE(edev, false,
@@ -291,7 +293,8 @@ qede_tx_queue_setup(struct rte_eth_dev *dev,ECORE_CHAIN_CNT_TYPE_U16 , txq->nb_tx_desc,sizeof (union eth_tx_bd_types ), - &txq->tx_pbl); + &txq->tx_pbl, + NULL);if (rc !=ECORE_SUCCESS ) { DP_ERR(edev, "Unable to allocate memory for txbd ring on socket %u",
Signature · 1 line
1.7.10.3
PATCH v2 16/26 net/qede/base: add check for get nvm info return code
In reply to Rasesh ModyFail ecore_get_hw_info() in case ecore_hw_get_nvm_info() fails.
--- drivers/net/qede/base/ecore_dev.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/net/qede/base/ecore_dev.c +9 -4
@@ -2755,7 +2755,7 @@ ecore_get_hw_info(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,/* Since all information is common, only first hwfns should do this */ if (IS_LEAD_HWFN (p_hwfn)) { rc =ecore_iov_hw_info (p_hwfn); -if (rc) +if (rc !=ECORE_SUCCESS )return rc; }
@@ -2769,12 +2769,17 @@ ecore_get_hw_info(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,ecore_hw_info_port_num (p_hwfn, p_ptt);#ifndef ASIC_ONLY - if (CHIP_REV_IS_ASIC(p_hwfn->p_dev)) +if (CHIP_REV_IS_ASIC (p_hwfn->p_dev)) { +#endif + rc =ecore_hw_get_nvm_info (p_hwfn, p_ptt); +if (rc !=ECORE_SUCCESS ) +return rc; +#ifndef ASIC_ONLY + }#endif -ecore_hw_get_nvm_info (p_hwfn, p_ptt); rc =ecore_int_igu_read_cam (p_hwfn, p_ptt); -if (rc) +if (rc !=ECORE_SUCCESS )return rc;#ifndef ASIC_ONLY
Signature · 1 line
1.7.10.3
PATCH v2 17/26 net/qede/base: retrieve FW crash dump info
In reply to Rasesh ModyAs part of device probe, check if management FW crash dump logs are available. If available, then log an warning message and update the epoch value too. A new struct ecore_mdump_info is added to populate dump info including the new "reason" field by reading shared memory region.
--- drivers/net/qede/base/ecore_dev.c | 18 +++++++-- drivers/net/qede/base/ecore_dev_api.h | 4 +- drivers/net/qede/base/ecore_mcp.c | 66 +++++++++++++++++++++------------ drivers/net/qede/base/ecore_mcp.h | 22 ----------- drivers/net/qede/base/ecore_mcp_api.h | 33 ++++++++++++++--- drivers/net/qede/qede_main.c | 2 +- 6 files changed, 87 insertions(+), 58 deletions(-)
drivers/net/qede/base/ecore_dev.c +14 -4
@@ -1761,10 +1761,6 @@ enum _ecore_status_t ecore_hw_init(struct ecore_dev *p_dev,return mfw_rc; } -ecore_mcp_mdump_get_info (p_hwfn, p_hwfn->p_main_ptt); -ecore_mcp_mdump_set_values (p_hwfn, p_hwfn->p_main_ptt, - p_params->epoch); -/* send DCBX attention request command */ DP_VERBOSE (p_hwfn,ECORE_MSG_DCB ,"sending phony dcbx set command to trigger DCBx attention handling\n" );
@@ -2962,6 +2958,7 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview, struct ecore_hw_prepare_params *p_params) {struct ecore_dev *p_dev = p_hwfn->p_dev; +struct ecore_mdump_info mdump_info;enum _ecore_status_t rc =ECORE_SUCCESS ;/* Split PCI bars evenly between hwfns */
@@ -3024,6 +3021,19 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,DP_NOTICE (p_hwfn, false,"Failed to initiate PF FLR\n" ); } +/* Check if mdump logs are present and update the epoch value */ +if (p_hwfn ==ECORE_LEADING_HWFN (p_hwfn->p_dev)) { + rc =ecore_mcp_mdump_get_info (p_hwfn, p_hwfn->p_main_ptt, + &mdump_info); +if (rc ==ECORE_SUCCESS && mdump_info.num_of_logs >0 ) { +DP_NOTICE (p_hwfn, false, +"* * * IMPORTANT - HW ERROR register dump captured by device * * *\n" ); + } + +ecore_mcp_mdump_set_values (p_hwfn, p_hwfn->p_main_ptt, + p_params->epoch); + } +/* Allocate the init RT array and initialize the init-ops engine */ rc =ecore_init_alloc (p_hwfn);if (rc) {
drivers/net/qede/base/ecore_dev_api.h +2 -2
@@ -68,8 +68,6 @@ struct ecore_hw_init_params {bool allow_npar_tx_switch;/* binary fw data pointer in binary fw file */ const u8 *bin_fw_data; -/* the OS Epoch time in seconds */ -u32 epoch; };/**
@@ -149,6 +147,8 @@ struct ecore_hw_prepare_params {bool chk_reg_fifo;/* request the MFW to initiate PF FLR */ bool initiate_pf_flr; +/* the OS Epoch time in seconds */ +u32 epoch; };/**
drivers/net/qede/base/ecore_mcp.c +42 -24
96 lines not on this page · raw message
drivers/net/qede/base/ecore_mcp.h +0 -22
@@ -327,28 +327,6 @@ enum _ecore_status_t ecore_mcp_mdump_trigger(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);/** -* @brief - Clears the MFW crash dump logs. -* -* @param p_hwfn -* @param p_ptt -* -* @param return ECORE_SUCCESS upon success. -*/ -enum _ecore_status_t ecore_mcp_mdump_clear_logs (struct ecore_hwfn *p_hwfn, -struct ecore_ptt *p_ptt); - -/** -* @brief - Gets the MFW crash dump configuration and logs info. -* -* @param p_hwfn -* @param p_ptt -* -* @param return ECORE_SUCCESS upon success. -*/ -enum _ecore_status_t ecore_mcp_mdump_get_info (struct ecore_hwfn *p_hwfn, -struct ecore_ptt *p_ptt); - -/** * @brief - Gets the MFW allocation info for the given resource * * @param p_hwfn
drivers/net/qede/base/ecore_mcp_api.h +28 -5
@@ -792,14 +792,37 @@ enum _ecore_status_t ecore_mcp_mem_ecc_events(struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt, u64 *num_events); +struct ecore_mdump_info { +u32 reason; +u32 version; +u32 config; +u32 epoch; +u32 num_of_logs; +u32 valid_logs; +}; + +/** +* @brief - Gets the MFW crash dump configuration and logs info. +* +* @param p_hwfn +* @param p_ptt +* @param p_mdump_info +* +* @param return ECORE_SUCCESS upon success. +*/ +enum _ecore_status_t +ecore_mcp_mdump_get_info (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt, +struct ecore_mdump_info *p_mdump_info); +/** -* @brief Sets whether a critical error notification from the MFW is acked, or -* is it being ignored and thus allowing the MFW crash dump. +* @brief - Clears the MFW crash dump logs. * -* @param p_dev -* @param mdump_enable +* @param p_hwfn +* @param p_ptt * +* @param return ECORE_SUCCESS upon success. */ -void ecore_mcp_mdump_enable (struct ecore_dev *p_dev,bool mdump_enable); +enum _ecore_status_t ecore_mcp_mdump_clear_logs (struct ecore_hwfn *p_hwfn, +struct ecore_ptt *p_ptt);#endif
drivers/net/qede/qede_main.c +1 -1
@@ -62,6 +62,7 @@ qed_probe(struct ecore_dev *edev, struct rte_pci_device *pci_dev, hw_prepare_params.drv_resc_alloc = false; hw_prepare_params.chk_reg_fifo = false; hw_prepare_params.initiate_pf_flr = true; + hw_prepare_params.epoch = (u32 )time (NULL ); rc =ecore_hw_prepare (edev, &hw_prepare_params);if (rc) {DP_ERR (edev,"hw prepare failed\n" );
@@ -274,7 +275,6 @@ static int qed_slowpath_start(struct ecore_dev *edev, hw_init_params.int_mode =ECORE_INT_MODE_MSIX ; hw_init_params.allow_npar_tx_switch = allow_npar_tx_switching; hw_init_params.bin_fw_data = data; - hw_init_params.epoch = (u32 )time (NULL ); rc =ecore_hw_init (edev, &hw_init_params);if (rc) {DP_ERR (edev,"ecore_hw_init failed\n" );
Signature · 1 line
1.7.10.3
PATCH v2 19/26 net/qede/base: add support for 2x10G mode
In reply to Rasesh ModyAdd support for 2x10G mode
--- doc/guides/nics/qede.rst | 2 +- drivers/net/qede/base/ecore.h | 1 + drivers/net/qede/base/ecore_dev.c | 3 +++ drivers/net/qede/base/nvm_cfg.h | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-)
doc/guides/nics/qede.rst +1 -1
@@ -32,7 +32,7 @@ QEDE Poll Mode Driver ====================== The QEDE poll mode driver library (**librte_pmd_qede**) implements support -for **QLogic FastLinQ QL4xxxx 25G/40G/100G CNA** family of adapters as well +for **QLogic FastLinQ QL4xxxx 10G/25G/40G/100G CNA** family of adapters as well as their virtual functions (VF) in SR-IOV context. It is supported on several standard Linux distros like RHEL7.x, SLES12.x and Ubuntu. It is compile-tested under FreeBSD OS.
drivers/net/qede/base/ecore.h +1 -0
@@ -302,6 +302,7 @@ enum ecore_port_mode {ECORE_PORT_MODE_DE_2X25G ,ECORE_PORT_MODE_DE_1X25G ,ECORE_PORT_MODE_DE_4X25G , + ECORE_PORT_MODE_DE_2X10G, }; enum ecore_dev_cap {
drivers/net/qede/base/ecore_dev.c +3 -0
@@ -2474,6 +2474,9 @@ static enum _ecore_status_t ecore_hw_get_nvm_info(struct ecore_hwfn *p_hwfn,case NVM_CFG1_GLOB_NETWORK_PORT_MODE_2X25G : p_hwfn->hw_info.port_mode =ECORE_PORT_MODE_DE_2X25G ;break ; +case NVM_CFG1_GLOB_NETWORK_PORT_MODE_2X10G : + p_hwfn->hw_info.port_mode =ECORE_PORT_MODE_DE_2X10G ; +break ;case NVM_CFG1_GLOB_NETWORK_PORT_MODE_1X25G : p_hwfn->hw_info.port_mode =ECORE_PORT_MODE_DE_1X25G ;break ;
drivers/net/qede/base/nvm_cfg.h +2 -0
@@ -144,6 +144,7 @@ struct nvm_cfg1_glob {#define NVM_CFG1_GLOB_NETWORK_PORT_MODE_2X25G 0xC#define NVM_CFG1_GLOB_NETWORK_PORT_MODE_1X25G 0xD#define NVM_CFG1_GLOB_NETWORK_PORT_MODE_4X25G 0xE +#define NVM_CFG1_GLOB_NETWORK_PORT_MODE_2X10G 0xF#define NVM_CFG1_GLOB_MPS10_ENFORCE_TX_FIR_CFG_MASK 0x00000100#define NVM_CFG1_GLOB_MPS10_ENFORCE_TX_FIR_CFG_OFFSET 8#define NVM_CFG1_GLOB_MPS10_ENFORCE_TX_FIR_CFG_DISABLED 0x0
@@ -578,6 +579,7 @@ struct nvm_cfg1_glob {#define NVM_CFG1_GLOB_MULTI_NETWORK_MODES_CAPABILITY_2X50G 0x40#define NVM_CFG1_GLOB_MULTI_NETWORK_MODES_CAPABILITY_BB_1X100G \ 0x80 +#define NVM_CFG1_GLOB_MULTI_NETWORK_MODES_CAPABILITY_2X10G 0x100u32 reserved[41 ];/* 0x9C */ };
Signature · 1 line
1.7.10.3
PATCH v2 18/26 net/qede/base: add support for external PHY
In reply to Rasesh ModyAdd support for external PHY BCM8485x.
--- drivers/net/qede/base/ecore_mcp.c | 6 +-- drivers/net/qede/base/mcp_public.h | 88 ++++++++++++++++++++++++++++++++++-- 2 files changed, 87 insertions(+), 7 deletions(-)
drivers/net/qede/base/ecore_mcp.c +2 -4
@@ -838,11 +838,9 @@ enum _ecore_status_t ecore_mcp_set_link(struct ecore_hwfn *p_hwfn,if (b_up)DP_VERBOSE (p_hwfn,ECORE_MSG_LINK ,"Configuring Link: Speed 0x%08x, Pause 0x%08x," -" adv_speed 0x%08x, loopback 0x%08x," -" features 0x%08x\n" , +" adv_speed 0x%08x, loopback 0x%08x\n" , p_phy_cfg->speed, p_phy_cfg->pause, - p_phy_cfg->adv_speed, p_phy_cfg->loopback_mode, - p_phy_cfg->feature_config_flags); + p_phy_cfg->adv_speed, p_phy_cfg->loopback_mode);else DP_VERBOSE (p_hwfn,ECORE_MSG_LINK ,"Resetting link\n" );
drivers/net/qede/base/mcp_public.h +85 -3
136 lines not on this page · raw message
Signature · 1 line
1.7.10.3
PATCH v2 21/26 net/qede: add 50G device PCI id
In reply to Rasesh ModyAdd 50G device support for 57980 series
--- config/common_base | 2 +- doc/guides/nics/qede.rst | 4 ++-- drivers/net/qede/qede_ethdev.c | 3 +++ drivers/net/qede/qede_ethdev.h | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-)
config/common_base +1 -1
@@ -316,7 +316,7 @@ CONFIG_RTE_LIBRTE_PMD_BOND=y CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB=n CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB_L1=n -# QLogic 10G/25G/40G/100G PMD +# QLogic 10G/25G/40G/50G/100G PMD # CONFIG_RTE_LIBRTE_QEDE_PMD=y CONFIG_RTE_LIBRTE_QEDE_DEBUG_INIT=n
doc/guides/nics/qede.rst +2 -2
@@ -32,7 +32,7 @@ QEDE Poll Mode Driver ====================== The QEDE poll mode driver library (**librte_pmd_qede**) implements support -for **QLogic FastLinQ QL4xxxx 10G/25G/40G/100G CNA** family of adapters as well +for **QLogic FastLinQ QL4xxxx 10G/25G/40G/50G/100G CNA** family of adapters as well as their virtual functions (VF) in SR-IOV context. It is supported on several standard Linux distros like RHEL7.x, SLES12.x and Ubuntu. It is compile-tested under FreeBSD OS.
@@ -72,7 +72,7 @@ Non-supported Features Supported QLogic Adapters ------------------------- -- QLogic FastLinQ QL4xxxx 10G/25G/40G/100G CNAs. +- QLogic FastLinQ QL4xxxx 10G/25G/40G/50G/100G CNAs. Prerequisites -------------
drivers/net/qede/qede_ethdev.c +3 -0
@@ -2293,6 +2293,9 @@ static struct rte_pci_id pci_id_qede_map[] = { QEDE_RTE_PCI_DEVICE(PCI_DEVICE_ID_QLOGIC_57980S_100) }, { + QEDE_RTE_PCI_DEVICE(PCI_DEVICE_ID_QLOGIC_57980S_50) + }, + { QEDE_RTE_PCI_DEVICE(PCI_DEVICE_ID_QLOGIC_AH_50G) }, {
drivers/net/qede/qede_ethdev.h +2 -0
@@ -102,6 +102,7 @@#define CHIP_NUM_57980S_25 0x1656#define CHIP_NUM_57980S_IOV 0x1664#define CHIP_NUM_57980S_100 0x1644 +#define CHIP_NUM_57980S_50 0x1654#define CHIP_NUM_AH_50G 0x8070#define CHIP_NUM_AH_10G 0x8071#define CHIP_NUM_AH_40G 0x8072
@@ -115,6 +116,7 @@#define PCI_DEVICE_ID_QLOGIC_57980S_25 CHIP_NUM_57980S_25#define PCI_DEVICE_ID_QLOGIC_57980S_IOV CHIP_NUM_57980S_IOV#define PCI_DEVICE_ID_QLOGIC_57980S_100 CHIP_NUM_57980S_100 +#define PCI_DEVICE_ID_QLOGIC_57980S_50 CHIP_NUM_57980S_50#define PCI_DEVICE_ID_QLOGIC_AH_50G CHIP_NUM_AH_50G#define PCI_DEVICE_ID_QLOGIC_AH_10G CHIP_NUM_AH_10G#define PCI_DEVICE_ID_QLOGIC_AH_40G CHIP_NUM_AH_40G
Signature · 1 line
1.7.10.3
PATCH v2 20/26 net/qede: add PCI ids for new chip variant
In reply to Rasesh ModyAdd PCI IDs for new asic type (defined as CHIP_NUM_AH_xxx). It supports 50G, 40G, 25G and 10G speeds.
--- drivers/net/qede/base/ecore_dev.c | 7 +++++- drivers/net/qede/qede_ethdev.c | 29 +++++++++++++++++------ drivers/net/qede/qede_ethdev.h | 47 +++++++++++++++++++++++-------------- 3 files changed, 57 insertions(+), 26 deletions(-)
drivers/net/qede/base/ecore_dev.c +6 -1
@@ -2365,7 +2365,12 @@ static enum _ecore_status_t ecore_hw_get_resc(struct ecore_hwfn *p_hwfn,#endif for (res_id =0 ; res_id <ECORE_MAX_RESC ; res_id++) { - rc =ecore_hw_set_resc_info (p_hwfn, res_id, drv_resc_alloc); +/* @@@TMP for AH: +* Force the driver's default resource allocation in case there +* is a diff with the MFW allocation value. +*/ + rc =ecore_hw_set_resc_info (p_hwfn, res_id, + b_ah || drv_resc_alloc);if (rc !=ECORE_SUCCESS )return rc; }
drivers/net/qede/qede_ethdev.c +22 -7
@@ -2264,10 +2264,13 @@ static int qedevf_eth_dev_uninit(struct rte_eth_dev *eth_dev)static struct rte_pci_id pci_id_qedevf_map[] = { #define QEDEVF_RTE_PCI_DEVICE(dev) RTE_PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, dev) { -QEDEVF_RTE_PCI_DEVICE (PCI_DEVICE_ID_NX2_VF ) +QEDEVF_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_NX2_VF ) }, { -QEDEVF_RTE_PCI_DEVICE (PCI_DEVICE_ID_57980S_IOV ) +QEDEVF_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_57980S_IOV ) + }, + { +QEDEVF_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_AH_IOV ) }, {.vendor_id =0 ,} };
@@ -2275,19 +2278,31 @@ static struct rte_pci_id pci_id_qedevf_map[] = {static struct rte_pci_id pci_id_qede_map[] = { #define QEDE_RTE_PCI_DEVICE(dev) RTE_PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, dev) { -QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_NX2_57980E ) +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_NX2_57980E ) + }, + { +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_NX2_57980S ) + }, + { +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_57980S_40 ) + }, + { +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_57980S_25 ) + }, + { +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_57980S_100 ) }, { -QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_NX2_57980S ) +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_AH_50G ) }, { -QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_57980S_40 ) +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_AH_10G ) }, { -QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_57980S_25 ) +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_AH_40G ) }, { -QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_57980S_100 ) +QEDE_RTE_PCI_DEVICE (PCI_DEVICE_ID_QLOGIC_AH_25G ) }, {.vendor_id =0 ,} };
drivers/net/qede/qede_ethdev.h +29 -18
53 lines not on this page · raw message
Signature · 1 line
1.7.10.3
PATCH v2 22/26 net/qede/base: add support for new firmware
In reply to Rasesh ModyAdd support for 8.14.x.x firmware.
The new firmware adds support for external PHY BCM8485x; configures fixed link speed with transceiver/cable not supporting negotiation; supports engine swap; supports overriding PCIe preset equalization value; checks pause too long for ports and reads die temperature every second for shutdown threshold.
It includes change in FLR flow when there is a SW initiated FLR.
--- doc/guides/nics/qede.rst | 8 +-- drivers/net/qede/base/common_hsi.h | 6 +- drivers/net/qede/base/ecore.h | 9 --- drivers/net/qede/base/ecore_dcbx.c | 17 +---- drivers/net/qede/base/ecore_dcbx.h | 6 -- drivers/net/qede/base/ecore_dev.c | 66 +++++++------------- drivers/net/qede/base/ecore_gtt_reg_addr.h | 20 +++--- drivers/net/qede/base/ecore_hsi_common.h | 81 +++++++++++++----------- drivers/net/qede/base/ecore_hsi_debug_tools.h | 26 +++++--- drivers/net/qede/base/ecore_hsi_eth.h | 10 ++- drivers/net/qede/base/ecore_hsi_init_tool.h | 82 +++++++++++-------------- drivers/net/qede/base/ecore_init_fw_funcs.c | 45 ++------------ drivers/net/qede/base/ecore_init_ops.c | 3 +- drivers/net/qede/base/ecore_iov_api.h | 11 ++++ drivers/net/qede/base/ecore_iro_values.h | 4 +- drivers/net/qede/base/ecore_mcp.c | 5 +- drivers/net/qede/base/ecore_sp_commands.c | 4 +- drivers/net/qede/base/ecore_spq.c | 3 + drivers/net/qede/base/ecore_sriov.c | 12 ++++ drivers/net/qede/base/eth_common.h | 34 +++++++--- drivers/net/qede/base/nvm_cfg.h | 66 +++++++++++++++++++- drivers/net/qede/qede_main.c | 5 +- 22 files changed, 279 insertions(+), 244 deletions(-)
doc/guides/nics/qede.rst +4 -4
@@ -77,10 +77,10 @@ Supported QLogic Adapters Prerequisites ------------- -- Requires firmware version **8.10.x.** and management firmware - version **8.10.x or higher**. Firmware may be available +- Requires firmware version **8.14.x.** and management firmware + version **8.14.x or higher**. Firmware may be available inbox in certain newer Linux distros under the standard directory - ``E.g. /lib/firmware/qed/qed_init_values-8.10.9.0.bin`` + ``E.g. /lib/firmware/qed/qed_init_values-8.14.6.0.bin`` - If the required firmware files are not available then visit `QLogic Driver Download Center <http://driverdownloads.qlogic.com>`_.
@@ -119,7 +119,7 @@ enabling debugging options may affect system performance. - ``CONFIG_RTE_LIBRTE_QEDE_FW`` (default **""**) Gives absolute path of firmware file. - ``Eg: "/lib/firmware/qed/qed_init_values_zipped-8.10.9.0.bin"`` + ``Eg: "/lib/firmware/qed/qed_init_values_zipped-8.14.6.0.bin"`` Empty string indicates driver will pick up the firmware file from the default location.
drivers/net/qede/base/common_hsi.h +2 -4
@@ -89,8 +89,8 @@#define FW_MAJOR_VERSION 8 -#define FW_MINOR_VERSION 10 -#define FW_REVISION_VERSION 9 +#define FW_MINOR_VERSION 14 +#define FW_REVISION_VERSION 6#define FW_ENGINEERING_VERSION 0/***********************/
@@ -726,8 +726,6 @@ union event_ring_data {struct malicious_vf_eqe_data malicious_vf/* Malicious VF data */ ;struct initial_cleanup_eqe_data vf_init_cleanup/* VF Initial Cleanup data */ ; -/* Host handle for the Async Completions */ -struct regpair iwarp_handle; };/* Event Ring Entry */ struct event_ring_entry {
drivers/net/qede/base/ecore.h +0 -9
@@ -765,15 +765,6 @@ struct ecore_dev {#define NUM_OF_ENG_PFS (dev) (ECORE_IS_BB(dev) ? MAX_NUM_PFS_BB \ : MAX_NUM_PFS_K2) -#ifndef REAL_ASIC_ONLY -#define ENABLE_EAGLE_ENG1_WORKAROUND (p_hwfn) ( \ - (ECORE_IS_BB_A0(p_hwfn->p_dev)) && \ - (ECORE_PATH_ID(p_hwfn) == 1) && \ - ((p_hwfn->hw_info.port_mode == ECORE_PORT_MODE_DE_2X40G) || \ - (p_hwfn->hw_info.port_mode == ECORE_PORT_MODE_DE_2X50G) || \ - (p_hwfn->hw_info.port_mode == ECORE_PORT_MODE_DE_2X25G))) -#endif -/** * @brief ecore_concrete_to_sw_fid - get the sw function id from * the concrete value.
drivers/net/qede/base/ecore_dcbx.c +1 -16
@@ -13,6 +13,7 @@#include "ecore_cxt.h" #include "ecore_gtt_reg_addr.h" #include "ecore_iro.h" +#include "ecore_iov_api.h" #define ECORE_DCBX_MAX_MIB_READ_TRY (100)#define ECORE_ETH_TYPE_DEFAULT (0)
@@ -79,21 +80,6 @@ static bool ecore_dcbx_local(u32 dcbx_cfg_bitmap) DCBX_CONFIG_VERSION_STATIC) ? true : false; } -/* @@@TBD A0 Eagle workaround */ -void ecore_dcbx_eagle_workaround (struct ecore_hwfn *p_hwfn, -struct ecore_ptt *p_ptt,bool set_to_pfc) -{ -if (!ENABLE_EAGLE_ENG1_WORKAROUND (p_hwfn)) -return ; - -ecore_wr (p_hwfn, p_ptt, -YSEM_REG_FAST_MEMORY +0x20000 /* RAM in FASTMEM */ + -YSTORM_FLOW_CONTROL_MODE_OFFSET , - set_to_pfc ? flow_ctrl_pfc : flow_ctrl_pause); -ecore_wr (p_hwfn, p_ptt,NIG_REG_FLOWCTRL_MODE , -EAGLE_ENG1_WORKAROUND_NIG_FLOWCTRL_MODE ); -} -static void ecore_dcbx_dp_protocol (struct ecore_hwfn *p_hwfn,struct ecore_dcbx_results *p_data)
@@ -945,7 +931,6 @@ ecore_dcbx_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,* according to negotiation results */ enabled = p_hwfn->p_dcbx_info->results.dcbx_enabled; -ecore_dcbx_eagle_workaround (p_hwfn, p_ptt, enabled); } }ecore_dcbx_get_params (p_hwfn, p_ptt, type);
drivers/net/qede/base/ecore_dcbx.h +0 -6
@@ -56,10 +56,4 @@ void ecore_dcbx_info_free(struct ecore_hwfn *, struct ecore_dcbx_info *);void ecore_dcbx_set_pf_update_params (struct ecore_dcbx_results *p_src,struct pf_update_ramrod_data *p_dest); -#ifndef REAL_ASIC_ONLY -/* @@@TBD eagle phy workaround */ -void ecore_dcbx_eagle_workaround (struct ecore_hwfn *,struct ecore_ptt *, -bool set_to_pfc); -#endif -#endif /* __ECORE_DCBX_H__ */
drivers/net/qede/base/ecore_dev.c +21 -45
148 lines not on this page · raw message
drivers/net/qede/base/ecore_gtt_reg_addr.h +10 -10
@@ -10,43 +10,43 @@#define GTT_REG_ADDR_H /* Win 2 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_IGU_CMD 0x00f000UL/* Win 3 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_TSDM_RAM 0x010000UL/* Win 4 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_MSDM_RAM 0x011000UL/* Win 5 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_MSDM_RAM_1024 0x012000UL/* Win 6 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_USDM_RAM 0x013000UL/* Win 7 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_USDM_RAM_1024 0x014000UL/* Win 8 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_USDM_RAM_2048 0x015000UL/* Win 9 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_XSDM_RAM 0x016000UL/* Win 10 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_YSDM_RAM 0x017000UL/* Win 11 */ -/* Access:RW DataWidth:0x20 Chips: BB_A0 BB_B0 K2 */ +/* Access:RW DataWidth:0x20 Chips: BB_B0 K2 E5 */ #define GTT_BAR0_MAP_REG_PSDM_RAM 0x018000UL#endif
drivers/net/qede/base/ecore_hsi_common.h +45 -36
134 lines not on this page · raw message
drivers/net/qede/base/ecore_hsi_debug_tools.h +19 -7
@@ -92,6 +92,11 @@ enum block_addr {GRCBASE_MS =0x6a0000 ,GRCBASE_PHY_PCIE =0x620000 ,GRCBASE_LED =0x6b8000 , +GRCBASE_AVS_WRAP =0x6b0000 , +GRCBASE_RGFS =0x19d0000 , +GRCBASE_TGFS =0x19e0000 , +GRCBASE_PTLD =0x19f0000 , +GRCBASE_YPLD =0x1a10000 ,GRCBASE_MISC_AEU =0x8000 ,GRCBASE_BAR0_MAP =0x1c00000 ,MAX_BLOCK_ADDR
@@ -177,6 +182,11 @@ enum block_id {BLOCK_MS ,BLOCK_PHY_PCIE ,BLOCK_LED , +BLOCK_AVS_WRAP , +BLOCK_RGFS , +BLOCK_TGFS , +BLOCK_PTLD , +BLOCK_YPLD ,BLOCK_MISC_AEU ,BLOCK_BAR0_MAP ,MAX_BLOCK_ID
@@ -708,7 +718,7 @@ struct dbg_bus_data {struct dbg_bus_pci_buf_data pci_buf;__le16 reserved;/* Debug Bus data for each block */ -struct dbg_bus_block_data blocks[80 ]; +struct dbg_bus_block_data blocks[88 ];/* Debug Bus data for each block */ struct dbg_bus_storm_data storms[6 ]; };
@@ -846,12 +856,12 @@ enum dbg_bus_targets {* GRC Dump data */ struct dbg_grc_data { +/* Indicates if the GRC parameters were initialized */ +u8 params_initialized; +u8 reserved1; +__le16 reserved2;/* Value of each GRC parameter. Array size must match enum dbg_grc_params. */ -__le32 param_val[40 ]; -/* Indicates for each GRC parameter if it was set by the user (0/1). -* Array size must match the enum dbg_grc_params. -*/ -u8 param_set_by_user[40 ]; +__le32 param_val[48 ]; };
@@ -901,6 +911,8 @@ enum dbg_grc_params {DBG_GRC_PARAM_PARITY_SAFE ,DBG_GRC_PARAM_DUMP_CM /* dump CM memories (0/1) */ ,DBG_GRC_PARAM_DUMP_PHY /* dump PHY memories (0/1) */ , +DBG_GRC_PARAM_NO_MCP /* dont perform MCP commands (0/1) */ , +DBG_GRC_PARAM_NO_FW_VER /* dont read FW/MFW version (0/1) */ , MAX_DBG_GRC_PARAMS };
@@ -1014,7 +1026,7 @@ struct dbg_tools_data {struct idle_chk_data idle_chk/* Idle Check data */ ;u8 mode_enable[40 ]/* Indicates if a mode is enabled (0/1) */ ;/* Indicates if a block is in reset state (0/1) */ -u8 block_in_reset[80 ]; +u8 block_in_reset[88 ];u8 chip_id/* Chip ID (from enum chip_ids) */ ;u8 platform_id/* Platform ID (from enum platform_ids) */ ;u8 initialized/* Indicates if the data was initialized */ ;
drivers/net/qede/base/ecore_hsi_eth.h +9 -1
@@ -1446,7 +1446,15 @@ struct vport_update_ramrod_data_cmn {/* If set, MTU will be updated. Vport must be not active. */ u8 update_mtu_flg;__le16 mtu/* New MTU value. Used if update_mtu_flg are set */ ; -u8 reserved[2 ]; +/* If set, ctl_frame_mac_check_en and ctl_frame_ethtype_check_en will be +* updated +*/ +u8 update_ctl_frame_checks_en_flg; +/* If set, Contorl frames will be filtered according to MAC check. */ +u8 ctl_frame_mac_check_en; +/* If set, Contorl frames will be filtered according to ethtype check. */ +u8 ctl_frame_ethtype_check_en; +u8 reserved[15 ]; };struct vport_update_ramrod_mcast {
drivers/net/qede/base/ecore_hsi_init_tool.h +37 -45
94 lines not on this page · raw message
drivers/net/qede/base/ecore_init_fw_funcs.c +6 -39
89 lines not on this page · raw message
drivers/net/qede/base/ecore_init_ops.c +1 -2
@@ -573,8 +573,7 @@ enum _ecore_status_t ecore_init_fw_data(struct ecore_dev *p_dev,return ECORE_INVAL ; } -/* First Dword contains metadata and should be skipped */ - buf_hdr = (struct bin_buffer_hdr *)((uintptr_t )(data +sizeof (u32))); + buf_hdr = (struct bin_buffer_hdr *)(uintptr_t )data; offset = buf_hdr[BIN_BUF_INIT_FW_VER_INFO ].offset; fw->fw_ver_info = (struct fw_ver_info *)((uintptr_t )(data + offset));
drivers/net/qede/base/ecore_iov_api.h +11 -0
@@ -664,6 +664,17 @@ bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn, u16 rel_vf_id);/** +* @brief - Returm true if VF has started in FW +* +* @param p_hwfn +* @param rel_vf_id +* +* @return +*/ +bool ecore_iov_is_vf_started (struct ecore_hwfn *p_hwfn, +u16 rel_vf_id); + +/** * @brief - Get VF's vport min rate configured. * @param p_hwfn * @param rel_vf_id
drivers/net/qede/base/ecore_iro_values.h +2 -2
@@ -91,9 +91,9 @@ static const struct iro iro_arr[47] = {/* USTORM_ISCSI_RX_STATS_OFFSET(pf_id) */ { 0x11aa0, 0x38, 0x0, 0x0, 0x18},/* XSTORM_ISCSI_TX_STATS_OFFSET(pf_id) */ - { 0xa8c0, 0x30, 0x0, 0x0, 0x10}, + { 0xa8c0, 0x38, 0x0, 0x0, 0x10},/* YSTORM_ISCSI_TX_STATS_OFFSET(pf_id) */ - { 0x86f8, 0x28, 0x0, 0x0, 0x18}, + { 0x86f8, 0x30, 0x0, 0x0, 0x18},/* PSTORM_ISCSI_TX_STATS_OFFSET(pf_id) */ { 0x101f8, 0x10, 0x0, 0x0, 0x10}, /* TSTORM_FCOE_RX_STATS_OFFSET(pf_id) */
drivers/net/qede/base/ecore_mcp.c +1 -4
@@ -801,9 +801,6 @@ static void ecore_mcp_handle_link_change(struct ecore_hwfn *p_hwfn, p_link->sfp_tx_fault = !!(status &LINK_STATUS_SFP_TX_FAULT ); -if (p_link->link_up) -ecore_dcbx_eagle_workaround (p_hwfn, p_ptt, p_link->pfc_enabled); -OSAL_LINK_UPDATE (p_hwfn); }
@@ -2267,7 +2264,7 @@ enum _ecore_status_t ecore_mcp_bist_register_test(struct ecore_hwfn *p_hwfn,enum _ecore_status_t ecore_mcp_bist_clock_test (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt) { -u32 drv_mb_param =0 , rsp, param; +u32 drv_mb_param, rsp, param;enum _ecore_status_t rc =ECORE_SUCCESS ; drv_mb_param = (DRV_MB_PARAM_BIST_CLOCK_TEST <<
drivers/net/qede/base/ecore_sp_commands.c +2 -2
@@ -31,7 +31,7 @@ enum _ecore_status_t ecore_sp_init_request(struct ecore_hwfn *p_hwfn, {u32 opaque_cid = p_data->opaque_fid <<16 | p_data->cid;struct ecore_spq_entry *p_ent =OSAL_NULL ; -enum _ecore_status_t rc =ECORE_NOTIMPL ; +enum _ecore_status_t rc;if (!pp_ent)return ECORE_INVAL ;
@@ -564,7 +564,7 @@ enum _ecore_status_t ecore_sp_heartbeat_ramrod(struct ecore_hwfn *p_hwfn) {struct ecore_spq_entry *p_ent =OSAL_NULL ;struct ecore_sp_init_data init_data; -enum _ecore_status_t rc =ECORE_NOTIMPL ; +enum _ecore_status_t rc;/* Get SPQ entry */ OSAL_MEMSET (&init_data,0 ,sizeof (init_data));
drivers/net/qede/base/ecore_spq.c +3 -0
@@ -924,6 +924,9 @@ enum _ecore_status_t ecore_spq_completion(struct ecore_hwfn *p_hwfn,if (found->comp_cb.function) found->comp_cb.function (p_hwfn, found->comp_cb.cookie, p_data, fw_return_code); +else +DP_VERBOSE (p_hwfn,ECORE_MSG_SPQ , +"Got a completion without a callback function\n" );if ((found->comp_mode !=ECORE_SPQ_MODE_EBLOCK ) || (found->queue == &p_spq->unlimited_pending))
drivers/net/qede/base/ecore_sriov.c +12 -0
@@ -3964,6 +3964,18 @@ bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn, u16 rel_vf_id)return (p_vf->state ==VF_ENABLED ); } +bool ecore_iov_is_vf_started (struct ecore_hwfn *p_hwfn, +u16 rel_vf_id) +{ +struct ecore_vf_info *p_vf; + + p_vf =ecore_iov_get_vf_info (p_hwfn, rel_vf_id, true); +if (!p_vf) +return false; + +return (p_vf->state !=VF_FREE && p_vf->state !=VF_STOPPED ); +} +enum _ecore_status_t ecore_iov_get_vf_min_rate (struct ecore_hwfn *p_hwfn,int vfid) {
drivers/net/qede/base/eth_common.h +27 -7
@@ -34,6 +34,14 @@#define ETH_RX_CQE_PAGE_SIZE_BYTES 4096#define ETH_RX_NUM_NEXT_PAGE_BDS 2 +/* Limitation for Tunneled LSO Packets on the offset (in bytes) of the inner IP +* header (relevant to LSO for tunneled packet): +*/ +/* Offset is limited to 253 bytes (inclusive). */ +#define ETH_MAX_TUNN_LSO_INNER_IPV4_OFFSET 253 +/* Offset is limited to 251 bytes (inclusive). */ +#define ETH_MAX_TUNN_LSO_INNER_IPV6_OFFSET 251 +#define ETH_TX_MIN_BDS_PER_NON_LSO_PKT 1#define ETH_TX_MAX_BDS_PER_NON_LSO_PACKET 18#define ETH_TX_MAX_BDS_PER_LSO_PACKET 255
@@ -141,16 +149,23 @@ struct eth_tx_1st_bd_flags {/* Do not allow additional VLAN manipulations on this packet. */ #define ETH_TX_1ST_BD_FLAGS_FORCE_VLAN_MODE_MASK 0x1#define ETH_TX_1ST_BD_FLAGS_FORCE_VLAN_MODE_SHIFT 1 -/* IP checksum recalculation in needed */ +/* Recalculate IP checksum. For tunneled packet - relevant to inner header. */ #define ETH_TX_1ST_BD_FLAGS_IP_CSUM_MASK 0x1#define ETH_TX_1ST_BD_FLAGS_IP_CSUM_SHIFT 2 -/* TCP/UDP checksum recalculation in needed */ +/* Recalculate TCP/UDP checksum. +* For tunneled packet - relevant to inner header. +*/ #define ETH_TX_1ST_BD_FLAGS_L4_CSUM_MASK 0x1#define ETH_TX_1ST_BD_FLAGS_L4_CSUM_SHIFT 3 -/* If set, need to add the VLAN in vlan field to the packet. */ +/* If set, insert VLAN tag from vlan field to the packet. +* For tunneled packet - relevant to outer header. +*/ #define ETH_TX_1ST_BD_FLAGS_VLAN_INSERTION_MASK 0x1#define ETH_TX_1ST_BD_FLAGS_VLAN_INSERTION_SHIFT 4 -/* If set, this is an LSO packet. */ +/* If set, this is an LSO packet. Note: For Tunneled LSO packets, the offset of +* the inner IPV4 (and IPV6) header is limited to 253 (and 251 respectively) +* bytes, inclusive. +*/ #define ETH_TX_1ST_BD_FLAGS_LSO_MASK 0x1#define ETH_TX_1ST_BD_FLAGS_LSO_SHIFT 5/* Recalculate Tunnel IP Checksum (if Tunnel IP Header is IPv4) */
@@ -165,7 +180,8 @@ struct eth_tx_1st_bd_flags {* The parsing information data for the first tx bd of a given packet. */ struct eth_tx_data_1st_bd { -__le16 vlan/* VLAN tag to insert to packet (if needed). */ ; +/* VLAN tag to insert to packet (if enabled by vlan_insertion flag). */ +__le16 vlan;/* Number of BDs in packet. Should be at least 2 in non-LSO packet and at least * 3 in LSO (or Tunnel with IPv6+ext) packet. */
@@ -209,10 +225,14 @@ struct eth_tx_data_2nd_bd {/* For LSO / Tunnel header with IPv6+ext - Set if inner header is IPv6 */ #define ETH_TX_DATA_2ND_BD_TUNN_INNER_IPV6_MASK 0x1#define ETH_TX_DATA_2ND_BD_TUNN_INNER_IPV6_SHIFT 11 -/* For LSO / Tunnel header with IPv6+ext - Set if outer header has IPv6+ext */ +/* In tunneling mode - Set to 1 when the Inner header is IPv6 with extension. +* Otherwise set to 1 if the header is IPv6 with extension. +*/ #define ETH_TX_DATA_2ND_BD_IPV6_EXT_MASK 0x1#define ETH_TX_DATA_2ND_BD_IPV6_EXT_SHIFT 12 -/* Set if Tunnel header has IPv6 ext. (3rd BD is required) */ +/* Set to 1 if Tunnel (outer = encapsulating) header has IPv6 ext. (Note: 3rd BD +* is required, hence EDPM does not support Tunnel [outer] header with Ipv6Ext) +*/ #define ETH_TX_DATA_2ND_BD_TUNN_IPV6_EXT_MASK 0x1#define ETH_TX_DATA_2ND_BD_TUNN_IPV6_EXT_SHIFT 13/* Set if (inner) L4 protocol is UDP. (Required when IPv6+ext (or tunnel with
drivers/net/qede/base/nvm_cfg.h +64 -2
134 lines not on this page · raw message
drivers/net/qede/qede_main.c +2 -3
@@ -21,7 +21,7 @@ static uint8_t npar_tx_switching = 1;char fw_file[PATH_MAX ];const char *QEDE_DEFAULT_FIRMWARE = -"/lib/firmware/qed/qed_init_values-8.10.9.0.bin" ; +"/lib/firmware/qed/qed_init_values-8.14.6.0.bin" ;static void qed_update_pf_params (struct ecore_dev *edev,struct ecore_pf_params *params)
@@ -234,8 +234,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,if (IS_PF (edev)) { rc =qed_load_firmware_data (edev);if (rc) { -DP_NOTICE (edev, true, -"Failed to find fw file %s\n" , fw_file); +DP_ERR (edev,"Failed to find fw file %s\n" , fw_file); goto err; } }
Signature · 1 line
1.7.10.3
PATCH v2 23/26 net/qede/base: semantic/formatting changes
In reply to Rasesh ModyThis patch consists of semantic/formatting changes. It also includes comment additions.
--- drivers/net/qede/base/common_hsi.h | 5 +- drivers/net/qede/base/ecore_dev.c | 14 +- drivers/net/qede/base/ecore_hsi_common.h | 14 +- drivers/net/qede/base/ecore_hw.c | 4 +- drivers/net/qede/base/ecore_init_ops.c | 4 +- drivers/net/qede/base/ecore_int.c | 6 +- drivers/net/qede/base/ecore_mcp.c | 5 +- drivers/net/qede/base/ecore_spq.c | 3 +- drivers/net/qede/base/ecore_sriov.c | 8 +- drivers/net/qede/base/mcp_public.h | 262 ++++++++++++++---------------- 10 files changed, 158 insertions(+), 167 deletions(-)
drivers/net/qede/base/common_hsi.h +3 -2
@@ -721,8 +721,7 @@ union event_ring_data {u8 bytes[8 ]/* Byte Array */ ;struct vf_pf_channel_eqe_data vf_pf_channel/* VF-PF Channel data */ ;struct iscsi_eqe_data iscsi_info/* Dedicated fields to iscsi data */ ; -/* Dedicated field for RoCE affiliated asynchronous error */ ; -struct regpair roceHandle; +struct regpair roceHandle/* Dedicated field for RDMA data */ ;struct malicious_vf_eqe_data malicious_vf/* Malicious VF data */ ;struct initial_cleanup_eqe_data vf_init_cleanup/* VF Initial Cleanup data */ ;
@@ -766,6 +765,8 @@ enum protocol_type { MAX_PROTOCOL_TYPE }; + +/* * Ustorm Queue Zone */
drivers/net/qede/base/ecore_dev.c +8 -6
@@ -1623,7 +1623,8 @@ enum _ecore_status_t ecore_hw_init(struct ecore_dev *p_dev,u32 load_code, param;int i; -if (p_params->int_mode ==ECORE_INT_MODE_MSI && p_dev->num_hwfns >1 ) { +if ((p_params->int_mode ==ECORE_INT_MODE_MSI ) && + (p_dev->num_hwfns >1 )) {DP_NOTICE (p_dev, false,"MSI mode is not supported for CMT devices\n" );return ECORE_INVAL ;
@@ -2937,8 +2938,9 @@ void ecore_prepare_hibernate(struct ecore_dev *p_dev)#endif static enum _ecore_status_t -ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview, - void OSAL_IOMEM *p_doorbells, +ecore_hw_prepare_single (struct ecore_hwfn *p_hwfn, + void OSAL_IOMEM * p_regview, + void OSAL_IOMEM * p_doorbells,struct ecore_hw_prepare_params *p_params) {struct ecore_dev *p_dev = p_hwfn->p_dev;
@@ -3280,8 +3282,8 @@ ecore_chain_alloc_next_ptr(struct ecore_dev *p_dev, struct ecore_chain *p_chain)static enum _ecore_status_t ecore_chain_alloc_single (struct ecore_dev *p_dev,struct ecore_chain *p_chain) { -void *p_virt =OSAL_NULL ;dma_addr_t p_phys =0 ; +void *p_virt =OSAL_NULL ; p_virt =OSAL_DMA_ALLOC_COHERENT (p_dev, &p_phys,ECORE_CHAIN_PAGE_SIZE );if (!p_virt) {
@@ -3809,10 +3811,10 @@ enum _ecore_status_t ecore_set_rxq_coalesce(struct ecore_hwfn *p_hwfn, u16 coalesce, u8 qid, u16 sb_id) { struct ustorm_eth_queue_zone eth_qzone; +u8 timeset, timer_res;u16 fw_qid =0 ;u32 address;enum _ecore_status_t rc; -u8 timeset, timer_res;/* Coalesce = (timeset << timer-resolution), timeset is 7bit wide */ if (coalesce <=0x7F ) {
@@ -3852,10 +3854,10 @@ enum _ecore_status_t ecore_set_txq_coalesce(struct ecore_hwfn *p_hwfn, u16 coalesce, u8 qid, u16 sb_id) { struct xstorm_eth_queue_zone eth_qzone; +u8 timeset, timer_res;u16 fw_qid =0 ;u32 address;enum _ecore_status_t rc; -u8 timeset, timer_res;/* Coalesce = (timeset << timer-resolution), timeset is 7bit wide */ if (coalesce <=0x7F ) {
drivers/net/qede/base/ecore_hsi_common.h +10 -4
@@ -1320,9 +1320,13 @@ enum personality_type {* tunnel configuration */ struct pf_start_tunnel_config { -/* Set VXLAN tunnel UDP destination port. */ +/* Set VXLAN tunnel UDP destination port to vxlan_udp_port. If not set - +* FW will use a default port +*/ u8 set_vxlan_udp_port_flg; -/* Set GENEVE tunnel UDP destination port. */ +/* Set GENEVE tunnel UDP destination port to geneve_udp_port. If not set - +* FW will use a default port +*/ u8 set_geneve_udp_port_flg;u8 tx_enable_vxlan/* If set, enable VXLAN tunnel in TX path. */ ;/* If set, enable l2 GENEVE tunnel in TX path. */
@@ -1338,8 +1342,10 @@ struct pf_start_tunnel_config {u8 tunnel_clss_ipgeneve;u8 tunnel_clss_l2gre/* Classification scheme for l2 GRE tunnel. */ ;u8 tunnel_clss_ipgre/* Classification scheme for ip GRE tunnel. */ ; -__le16 vxlan_udp_port/* VXLAN tunnel UDP destination port. */ ; -__le16 geneve_udp_port/* GENEVE tunnel UDP destination port. */ ; +/* VXLAN tunnel UDP destination port. Valid if set_vxlan_udp_port_flg=1 */ +__le16 vxlan_udp_port; +/* GENEVE tunnel UDP destination port. Valid if set_geneve_udp_port_flg=1 */ +__le16 geneve_udp_port; };/*
drivers/net/qede/base/ecore_hw.c +2 -2
@@ -496,8 +496,8 @@ static u32 ecore_dmae_idx_to_go_cmd(u8 idx)return DMAE_REG_GO_C0 + (idx <<2 ); } -static enum _ecore_status_t -ecore_dmae_post_command (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt) +static enum _ecore_status_t ecore_dmae_post_command (struct ecore_hwfn *p_hwfn, +struct ecore_ptt *p_ptt) {struct dmae_cmd *p_command = p_hwfn->dmae_info.p_dmae_cmd;u8 idx_cmd = p_hwfn->dmae_info.channel, i;
drivers/net/qede/base/ecore_init_ops.c +2 -2
@@ -63,8 +63,8 @@ static enum _ecore_status_t ecore_init_rt(struct ecore_hwfn *p_hwfn, {u32 *p_init_val = &p_hwfn->rt_data.init_val[rt_offset];bool *p_valid = &p_hwfn->rt_data.b_valid[rt_offset]; -enum _ecore_status_t rc =ECORE_SUCCESS ;u16 i, segment; +enum _ecore_status_t rc =ECORE_SUCCESS ;/* Since not all RT entries are initialized, go over the RT and * for each segment of initialized values use DMA.
@@ -452,10 +452,10 @@ enum _ecore_status_t ecore_init_run(struct ecore_hwfn *p_hwfn, int phase, int phase_id, int modes) { struct ecore_dev *p_dev = p_hwfn->p_dev; -enum _ecore_status_t rc =ECORE_SUCCESS ;u32 cmd_num, num_init_ops;union init_op *init_ops;bool b_dmae = false; +enum _ecore_status_t rc =ECORE_SUCCESS ; num_init_ops = p_dev->fw_data->init_ops_size; init_ops = p_dev->fw_data->init_ops;
drivers/net/qede/base/ecore_int.c +3 -3
@@ -1234,7 +1234,7 @@ static enum _ecore_status_t ecore_int_sb_attn_alloc(struct ecore_hwfn *p_hwfn, p_sb =OSAL_ALLOC (p_dev,GFP_KERNEL ,sizeof (*p_sb));if (!p_sb) {DP_NOTICE (p_dev, true, -"Failed to allocate `struct ecore_sb_attn_info'" ); +"Failed to allocate `struct ecore_sb_attn_info'\n" );return ECORE_NOMEM ; }
@@ -1243,7 +1243,7 @@ static enum _ecore_status_t ecore_int_sb_attn_alloc(struct ecore_hwfn *p_hwfn, SB_ATTN_ALIGNED_SIZE(p_hwfn));if (!p_virt) {DP_NOTICE (p_dev, true, -"Failed to allocate status block (attentions)" ); +"Failed to allocate status block (attentions)\n" );OSAL_FREE (p_dev, p_sb);return ECORE_NOMEM ; }
@@ -2127,8 +2127,8 @@ enum _ecore_status_t ecore_int_set_timer_res(struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt, u8 timer_res, u16 sb_id, bool tx) { - enum _ecore_status_t rc; struct cau_sb_entry sb_entry; +enum _ecore_status_t rc;if (!p_hwfn->hw_init_done) {DP_ERR (p_hwfn,"hardware not initialized yet\n" );
drivers/net/qede/base/ecore_mcp.c +2 -3
@@ -945,9 +945,8 @@ static void ecore_mcp_send_protocol_stats(struct ecore_hwfn *p_hwfn,ecore_mcp_cmd_and_union (p_hwfn, p_ptt, &mb_params); } -static void -ecore_read_pf_bandwidth (struct ecore_hwfn *p_hwfn, -struct public_func *p_shmem_info) +static void ecore_read_pf_bandwidth (struct ecore_hwfn *p_hwfn, +struct public_func *p_shmem_info) {struct ecore_mcp_function_info *p_info;
drivers/net/qede/base/ecore_spq.c +1 -2
@@ -380,8 +380,7 @@ struct ecore_eq *ecore_eq_alloc(struct ecore_hwfn *p_hwfn, u16 num_elem) }/* register EQ completion on the SP SB */ -ecore_int_register_cb (p_hwfn, - ecore_eq_completion, +ecore_int_register_cb (p_hwfn, ecore_eq_completion, p_eq, &p_eq->eq_sb_index, &p_eq->p_fw_cons);return p_eq;
drivers/net/qede/base/ecore_sriov.c +3 -5
@@ -1675,11 +1675,9 @@ ecore_iov_reconfigure_unicast_vlan(struct ecore_hwfn *p_hwfn,DP_VERBOSE (p_hwfn,ECORE_MSG_IOV ,"Reconfiguring VLAN [0x%04x] for VF [%04x]\n" , filter.vlan, p_vf->relative_vf_id); - rc =ecore_sp_eth_filter_ucast (p_hwfn, - p_vf->opaque_fid, - &filter, -ECORE_SPQ_MODE_CB , -OSAL_NULL ); + rc =ecore_sp_eth_filter_ucast (p_hwfn, p_vf->opaque_fid, + &filter,ECORE_SPQ_MODE_CB , +OSAL_NULL );if (rc) {DP_NOTICE (p_hwfn, true, "Failed to configure VLAN [%04x]"
drivers/net/qede/base/mcp_public.h +124 -138
342 lines not on this page · raw message
Signature · 1 line
1.7.10.3
PATCH v2 24/26 net/qede/base: refactor some code bits
In reply to Rasesh ModyBits of code refactoring in ecore_hw_bar_size(), ecore_get_hw_info() and ecore_init_cmd_*.
--- drivers/net/qede/base/ecore_dev.c | 39 ++++++++++++++++---------------- drivers/net/qede/base/ecore_init_ops.c | 19 +++++++--------- 2 files changed, 28 insertions(+), 30 deletions(-)
drivers/net/qede/base/ecore_dev.c +20 -19
@@ -70,28 +70,26 @@ static u32 ecore_hw_bar_size(struct ecore_hwfn *p_hwfn, enum BAR_ID bar_id) } val =ecore_rd (p_hwfn, p_hwfn->p_main_ptt, bar_reg); +if (val) +return 1 << (val +15 );/* The above registers were updated in the past only in CMT mode. Since * they were found to be useful MFW started updating them from 8.7.7.0. * In older MFW versions they are set to 0 which means disabled. */ -if (!val) { -if (p_hwfn->p_dev->num_hwfns >1 ) { -DP_NOTICE (p_hwfn, false, -"BAR size not configured. Assuming BAR size" ); -DP_NOTICE (p_hwfn, false, -"of 256kB for GRC and 512kB for DB\n" ); -return BAR_ID_0 ?256 *1024 :512 *1024 ; - }else { -DP_NOTICE (p_hwfn, false, -"BAR size not configured. Assuming BAR size" ); -DP_NOTICE (p_hwfn, false, -"of 512kB for GRC and 512kB for DB\n" ); -return 512 *1024 ; - } +if (p_hwfn->p_dev->num_hwfns >1 ) { +DP_NOTICE (p_hwfn, false, +"BAR size not configured. Assuming BAR size of 256kB" +" for GRC and 512kB for DB\n" ); + val =BAR_ID_0 ?256 *1024 :512 *1024 ; + }else { +DP_NOTICE (p_hwfn, false, +"BAR size not configured. Assuming BAR size of 512kB" +" for GRC and 512kB for DB\n" ); + val =512 *1024 ; } -return 1 << (val +15 ); +return val; } void ecore_init_dp(struct ecore_dev *p_dev,
@@ -2785,11 +2783,14 @@ ecore_get_hw_info(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,ecore_mcp_cmd_port_init (p_hwfn, p_ptt); } -if (personality !=ECORE_PCI_DEFAULT ) +if (personality !=ECORE_PCI_DEFAULT ) { p_hwfn->hw_info.personality = personality; -else if (ecore_mcp_is_init (p_hwfn)) - p_hwfn->hw_info.personality = - p_hwfn->mcp_info->func_info.protocol; + }else if (ecore_mcp_is_init (p_hwfn)) { +enum ecore_pci_personality protocol; + + protocol = p_hwfn->mcp_info->func_info.protocol; + p_hwfn->hw_info.personality = protocol; + }#ifndef ASIC_ONLY /* To overcome ILT lack for emulation, until at least until we'll have
drivers/net/qede/base/ecore_init_ops.c +8 -11
@@ -190,19 +190,19 @@ static enum _ecore_status_t ecore_init_cmd_array(struct ecore_hwfn *p_hwfn, bool b_must_dmae, bool b_can_dmae) { +u32 dmae_array_offset =OSAL_LE32_TO_CPU (cmd->args.array_offset); +u32 data =OSAL_LE32_TO_CPU (cmd->data); +u32 addr =GET_FIELD (data,INIT_WRITE_OP_ADDRESS ) <<2 ;#ifdef CONFIG_ECORE_ZIPPED_FW u32 offset, output_len, input_len, max_size;#endif -u32 dmae_array_offset =OSAL_LE32_TO_CPU (cmd->args.array_offset);struct ecore_dev *p_dev = p_hwfn->p_dev; -enum _ecore_status_t rc =ECORE_SUCCESS ;union init_array_hdr *hdr;const u32 *array_data; -u32 size, addr, data; +enum _ecore_status_t rc =ECORE_SUCCESS ; +u32 size; array_data = p_dev->fw_data->arr_data; - data =OSAL_LE32_TO_CPU (cmd->data); - addr =GET_FIELD (data,INIT_WRITE_OP_ADDRESS ) <<2 ; hdr = (union init_array_hdr *) (uintptr_t )(array_data + dmae_array_offset);
@@ -272,13 +272,10 @@ static enum _ecore_status_t ecore_init_cmd_wr(struct ecore_hwfn *p_hwfn, struct init_write_op *p_cmd, bool b_can_dmae) { +u32 data =OSAL_LE32_TO_CPU (p_cmd->data); +bool b_must_dmae =GET_FIELD (data,INIT_WRITE_OP_WIDE_BUS ); +u32 addr =GET_FIELD (data,INIT_WRITE_OP_ADDRESS ) <<2 ;enum _ecore_status_t rc =ECORE_SUCCESS ; -bool b_must_dmae; -u32 addr, data; - - data =OSAL_LE32_TO_CPU (p_cmd->data); - b_must_dmae =GET_FIELD (data,INIT_WRITE_OP_WIDE_BUS ); - addr =GET_FIELD (data,INIT_WRITE_OP_ADDRESS ) <<2 ;/* Sanitize */ if (b_must_dmae && !b_can_dmae) {
Signature · 1 line
1.7.10.3
PATCH v2 26/26 net/qede: update PMD version to 2.0.0.1
In reply to Rasesh Mody--- drivers/net/qede/qede_ethdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/qede/qede_ethdev.h +2 -2
@@ -46,8 +46,8 @@/* Driver versions */ #define QEDE_PMD_VER_PREFIX "QEDE PMD" -#define QEDE_PMD_VERSION_MAJOR 1 -#define QEDE_PMD_VERSION_MINOR 2 +#define QEDE_PMD_VERSION_MAJOR 2 +#define QEDE_PMD_VERSION_MINOR 0#define QEDE_PMD_VERSION_REVISION 0#define QEDE_PMD_VERSION_PATCH 1
Signature · 1 line
1.7.10.3
PATCH v2 25/26 net/qede/base: dcbx changes for base driver
In reply to Rasesh ModyThis patch includes changes for DCBX like:
- Return empty parameters for oper-params query when negotiation is not complete
- Use the ieee specific mask value for reading the ethtype value in the ieee dcbx mode
- Endian-ness conversion is not needed for priority<->TC field, as the data is already being read/written by ecore in the bigendian way
- While writing the ets config, base driver incorrectly merges the input values with the operational values. The values should be either set or unset
- CEE selection field must be set regardless CEE/IEEE mode
- Fail the dcbx query for VF interfaces
- Semantic changes
--- drivers/net/qede/base/ecore.h | 3 + drivers/net/qede/base/ecore_dcbx.c | 375 ++++++++++++++------------------ drivers/net/qede/base/ecore_dcbx_api.h | 1 + drivers/net/qede/base/ecore_dev.c | 24 +- 4 files changed, 185 insertions(+), 218 deletions(-)
drivers/net/qede/base/ecore.h +3 -0
@@ -373,6 +373,9 @@ struct ecore_hw_info {u32 port_mode;u32 hw_mode;unsigned long device_capabilities; + +/* Default DCBX mode */ +u8 dcbx_mode; };struct ecore_hw_cid_data {
drivers/net/qede/base/ecore_dcbx.c +158 -217
736 lines not on this page · raw message
drivers/net/qede/base/ecore_dcbx_api.h +1 -0
@@ -147,6 +147,7 @@ struct ecore_dcbx_get {#define ECORE_DCBX_VERSION_DISABLED 0#define ECORE_DCBX_VERSION_IEEE 1#define ECORE_DCBX_VERSION_CEE 2 +#define ECORE_DCBX_VERSION_DYNAMIC 3struct ecore_dcbx_set {#define ECORE_DCBX_OVERRIDE_STATE (1 << 0)
drivers/net/qede/base/ecore_dev.c +23 -1
@@ -2405,7 +2405,7 @@ static enum _ecore_status_t ecore_hw_get_resc(struct ecore_hwfn *p_hwfn,static enum _ecore_status_t ecore_hw_get_nvm_info (struct ecore_hwfn *p_hwfn,struct ecore_ptt *p_ptt) { -u32 nvm_cfg1_offset, mf_mode, addr, generic_cont0, core_cfg; +u32 nvm_cfg1_offset, mf_mode, addr, generic_cont0, core_cfg, dcbx_mode;u32 port_cfg_addr, link_temp, nvm_cfg_addr, device_capabilities;struct ecore_mcp_link_params *link;
@@ -2469,6 +2469,28 @@ static enum _ecore_status_t ecore_hw_get_nvm_info(struct ecore_hwfn *p_hwfn,break ; } +/* Read DCBX configuration */ + port_cfg_addr =MCP_REG_SCRATCH + nvm_cfg1_offset + + OFFSETOF(struct nvm_cfg1, port[MFW_PORT(p_hwfn)]); + dcbx_mode =ecore_rd (p_hwfn, p_ptt, + port_cfg_addr + + OFFSETOF(struct nvm_cfg1_port, generic_cont0)); + dcbx_mode = (dcbx_mode &NVM_CFG1_PORT_DCBX_MODE_MASK ) + >>NVM_CFG1_PORT_DCBX_MODE_OFFSET ; +switch (dcbx_mode) { +case NVM_CFG1_PORT_DCBX_MODE_DYNAMIC : + p_hwfn->hw_info.dcbx_mode =ECORE_DCBX_VERSION_DYNAMIC ; +break ; +case NVM_CFG1_PORT_DCBX_MODE_CEE : + p_hwfn->hw_info.dcbx_mode =ECORE_DCBX_VERSION_CEE ; +break ; +case NVM_CFG1_PORT_DCBX_MODE_IEEE : + p_hwfn->hw_info.dcbx_mode =ECORE_DCBX_VERSION_IEEE ; +break ; +default : + p_hwfn->hw_info.dcbx_mode =ECORE_DCBX_VERSION_DISABLED ; + } +/* Read default link configuration */ link = &p_hwfn->mcp_info->link_input; port_cfg_addr = MCP_REG_SCRATCH + nvm_cfg1_offset +
Signature · 1 line
1.7.10.3
Re: [PATCH 23/25] net/qede/base: semantic/formatting changes
In reply to Ferruh YigitQuoted 24 lines
From: Ferruh Yigit [mailto:[email protected]]
Sent: Tuesday, January 03, 2017 7:41 AMQuoted 7 lines · Rasesh
Quoted 7 lines
From: Ferruh Yigit [mailto:[email protected]]
Sent: Friday, December 23, 2016 7:42 AMQuoted 2 lines · Rasesh Mody
This patch consists of semantic/formatting changes. It also includes comment additions.
Quoted 7 lines
Quoted 5 lines
As far as I can see majority of the changes are formatting, but not all.
Functional changes are hard to detect in this patch, what do you think separating formatting/comments patches into another patch, so functional changes can become more visible?
There are few of places(ecore_hw_bar_size(),
ecore_get_hw_info()andecore_init_cmd_*), where there is a bit of code refactoring. However, they are not a major change. We have tried to isolate most of the functional changes and made them part of the separate patches as fit. I think, we can include a bit of description in commit message to cover it in this patch. Please let me know if you think otherwise.
Quoted 5 lines
I believe it is good to separate code refactoring into different patch if possible, instead of covering this in commit log.
This makes functional changes easy to find in the future. In this patch hard to spot them.
V2 series has been submitted to separate code refactoring changes and address few other comments received for this patch set. Thanks!
-Rasesh
Quoted 8 lines
Thanks,
ferruhQuoted 5 lines
Quoted 5 lines
Quoted 4 lines
Signed-off-by Rasesh Mody <[email protected]>---
<...>
Quoted 31 lines · Rasesh Mody
Hi,
This patch set consists of enhancements, new 8.14.x.x firmware support and semantic changes. It update the QEDE PMD version to 2.0.0.1.
v1..v2 - addresses all the review comments
Please include in DPDK 17.02 release.
Thanks!
RaseshRasesh Mody (26):
net/qede/base: add request for PF FLR before load requestnet/qede/base: improve set field macronet/qede/base: add handling of malicious VFnet/qede/base: change return codes in SR-IOVnet/qede/base: make API non-staticnet/qede/base: rename macro
net/qede/base: add check to validate txqnet/qede/base: fix updating VF queue zone idnet/qede/base: improve Tx-switching performancenet/qede/base: semantic change
net/qede: remove unused struct membernet/qede/base: enhance resource info set printoutsnet/qede/base: add new enum member to status codesnet/qede/base: add macros for converting pointer net/qede: add new host ring type optionnet/qede/base: add check for get nvm info return codenet/qede/base: retrieve FW crash dump infonet/qede/base: add support for external PHY
Quoted 9 lines
net/qede/base: add support for 2x10G mode
net/qede: add PCI ids for new chip variant
net/qede: add 50G device PCI id
net/qede/base: add support for new firmware
net/qede/base: semantic/formatting changes
net/qede/base: refactor some code bits
net/qede/base: dcbx changes for base driver
net/qede: update PMD version to 2.0.0.1
<...>
Series applied to dpdk-next-net/master, thanks.