Intel Wired LAN Driver Updates 2023-02-06 (i40e)
Subsystems (3)
Tony Nguyen
maintainerThis series contains updates to i40e driver only.
Sebastian adds implementation to control source pruning for VFs.
Jan removes i40e_status from the driver; replacing them with standard kernel error codes.
Kees Cook replaces 0-length array with flexible array.
The following are changes since commit c21adf256f8dcfbc07436d45be4ba2edf7a6f463:
Merge branch 'tuntap-socket-uid'
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 40GbE
Jan Sokolowski (4):
i40e: Remove unused i40e status codes
i40e: Remove string printing for i40e_status
i40e: use int for i40e_status
i40e: use ERR_PTR error print in i40e messages
Kees Cook (1):
net/i40e: Replace 0-length array with flexible array
Sebastian Czapla (1):
i40e: Add flag for disabling VF source pruning
drivers/net/ethernet/intel/i40e/i40e.h | 10 +- drivers/net/ethernet/intel/i40e/i40e_adminq.c | 68 +- drivers/net/ethernet/intel/i40e/i40e_alloc.h | 22 +- drivers/net/ethernet/intel/i40e/i40e_client.c | 12 +- drivers/net/ethernet/intel/i40e/i40e_common.c | 1038 +++++++---------- drivers/net/ethernet/intel/i40e/i40e_dcb.c | 60 +- drivers/net/ethernet/intel/i40e/i40e_dcb.h | 28 +- drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | 16 +- drivers/net/ethernet/intel/i40e/i40e_ddp.c | 14 +- .../net/ethernet/intel/i40e/i40e_debugfs.c | 8 +- drivers/net/ethernet/intel/i40e/i40e_diag.c | 12 +- drivers/net/ethernet/intel/i40e/i40e_diag.h | 4 +- .../net/ethernet/intel/i40e/i40e_ethtool.c | 78 +- drivers/net/ethernet/intel/i40e/i40e_hmc.c | 56 +- drivers/net/ethernet/intel/i40e/i40e_hmc.h | 46 +- .../net/ethernet/intel/i40e/i40e_lan_hmc.c | 94 +- .../net/ethernet/intel/i40e/i40e_lan_hmc.h | 34 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 467 ++++---- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 252 ++-- drivers/net/ethernet/intel/i40e/i40e_osdep.h | 1 - .../net/ethernet/intel/i40e/i40e_prototype.h | 643 +++++----- drivers/net/ethernet/intel/i40e/i40e_status.h | 35 - .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 160 ++- .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 + 24 files changed, 1555 insertions(+), 1605 deletions(-)
Signature · 1 line
2.38.1
Tony Nguyen
maintainerPATCH 1/6 i40e: Add flag for disabling VF source pruning
From: Sebastian Czapla <[email protected]>
Allow user to change source pruning for VF VSIs. This allows VFs to receive packets with MAC_SRC and MAC_DST equal to VFs mac.
Added priv flag vf-source-pruning to allow user to change source pruning setting. Reset all VSIs to commit the setting. If vf-source-pruning is off and VF is trusted on with spoofchk off then disable source pruning on specific VF takes effect.
Without this patch it is not possible to change source pruning setting on VF VSIs.
--- drivers/net/ethernet/intel/i40e/i40e.h | 2 + .../net/ethernet/intel/i40e/i40e_ethtool.c | 13 +++- drivers/net/ethernet/intel/i40e/i40e_main.c | 70 ++++++++++++++----- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 66 ++++++++++++++++- .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 + 5 files changed, 134 insertions(+), 19 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +2 -0
@@ -604,6 +604,7 @@ struct i40e_pf {* in abilities field of i40e_aq_set_phy_config structure */ #define I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED BIT(27) +#define I40E_FLAG_VF_SOURCE_PRUNING BIT(31)struct i40e_client_instance *cinst;bool stat_offsets_loaded;
@@ -1288,6 +1289,7 @@ void i40e_ptp_stop(struct i40e_pf *pf);int i40e_ptp_alloc_pins (struct i40e_pf *pf);int i40e_update_adq_vsi_queues (struct i40e_vsi *vsi,int vsi_offset);int i40e_is_vsi_uplink_mode_veb (struct i40e_vsi *vsi); +i40e_status i40e_configure_source_pruning (struct i40e_vsi *vsi,bool enable);i40e_status i40e_get_partition_bw_setting (struct i40e_pf *pf);i40e_status i40e_set_partition_bw_setting (struct i40e_pf *pf);i40e_status i40e_commit_partition_bw_setting (struct i40e_pf *pf);
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +12 -1
@@ -457,6 +457,7 @@ static const struct i40e_priv_flags i40e_gstrings_priv_flags[] = {I40E_PRIV_FLAG ("base-r-fec" ,I40E_FLAG_BASE_R_FEC ,0 ),I40E_PRIV_FLAG ("vf-vlan-pruning" ,I40E_FLAG_VF_VLAN_PRUNING ,0 ), + I40E_PRIV_FLAG("vf-source-pruning", I40E_FLAG_VF_SOURCE_PRUNING, 0), };#define I40E_PRIV_FLAGS_STR_LEN ARRAY_SIZE(i40e_gstrings_priv_flags)
@@ -5294,7 +5295,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)if (changed_flags &I40E_FLAG_DISABLE_FW_LLDP ) reset_needed =I40E_PF_RESET_AND_REBUILD_FLAG ;if (changed_flags & (I40E_FLAG_VEB_STATS_ENABLED | -I40E_FLAG_LEGACY_RX |I40E_FLAG_SOURCE_PRUNING_DISABLED )) +I40E_FLAG_LEGACY_RX |I40E_FLAG_SOURCE_PRUNING_DISABLED | +I40E_FLAG_VF_SOURCE_PRUNING )) reset_needed =BIT (__I40E_PF_RESET_REQUESTED);/* Before we finalize any flag changes, we need to perform some
@@ -5446,6 +5448,15 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags) } } +if (changed_flags &I40E_FLAG_VF_SOURCE_PRUNING ) { +if (orig_flags &I40E_FLAG_VF_SOURCE_PRUNING ) +dev_info (&pf->pdev->dev, +"VF source pruning disabled. To take effect please make sure to disable spoof checking and enable trust on selected VF's\n" ); +else +dev_info (&pf->pdev->dev, +"VF source pruning enabled on all VF's\n" ); + } +/* Now that we've checked to ensure that the new flags are valid, load * them into place. Since we only modify flags either (a) during * initialization or (b) while holding the RTNL lock, we don't need
drivers/net/ethernet/intel/i40e/i40e_main.c +53 -17
89 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +65 -1
97 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +2 -0
@@ -80,6 +80,8 @@ struct i40e_vf {u16 port_vlan_id;bool pf_set_mac;/* The VMM admin set the VF MAC address */ bool trusted; +bool source_pruning; +/* VSI indices - actual VSI pointers are maintained in the PF structure * When assigned, these will be non-zero, because VSI 0 is always
Signature · 1 line
2.38.1
Jakub Kicinski
maintainerRe: [PATCH net-next 1/6] i40e: Add flag for disabling VF source pruning
Quoted 10 lines · On Mon, 6 Feb 2023 15:56:30 -0800 Tony Nguyen wrote:
Allow user to change source pruning for VF VSIs. This allows VFs to receive packets with
MAC_SRCandMAC_DSTequal to VFs mac.Added priv flag vf-source-pruning to allow user to change source pruning setting. Reset all VSIs to commit the setting. If vf-source-pruning is off and VF is trusted on with spoofchk off then disable source pruning on specific VF takes effect.
Without this patch it is not possible to change source pruning setting on VF VSIs.
Intel keeps trickling in private flags to adjust the behavior of legacy SR-IOV NDOs. No documentation, no well understood semantics. This does not seem defensible upstream when we already started rejecting any use of legacy SR-IOV NDOs in new drivers.
Quite sad this is bundled in the same series as the much appreciated removal of magic status codes.
Tony Nguyen
maintainerRe: [PATCH net-next 1/6] i40e: Add flag for disabling VF source pruning
Quoted 9 lines · Jakub Kicinski
Quoted 8 lines · On Mon, 6 Feb 2023 15:56:30 -0800 Tony Nguyen wrote:
Allow user to change source pruning for VF VSIs. This allows VFs to receive packets with
MAC_SRCandMAC_DSTequal to VFs mac.Added priv flag vf-source-pruning to allow user to change source pruning setting. Reset all VSIs to commit the setting. If vf-source-pruning is off and VF is trusted on with spoofchk off then disable source pruning on specific VF takes effect.
Quoted 7 lines
Quoted 2 lines
Without this patch it is not possible to change source pruning setting on VF VSIs.
Intel keeps trickling in private flags to adjust the behavior of legacy SR-IOV NDOs. No documentation, no well understood semantics. This does not seem defensible upstream when we already started rejecting any use of legacy SR-IOV NDOs in new drivers.
Will drop this patch.
Thanks,
Tony
Tony Nguyen
maintainerPATCH 2/6 i40e: Remove unused i40e status codes
In reply to Tony NguyenFrom: Jan Sokolowski <[email protected]>
In an effort to remove i40e status codes and replace them with standard kernel errornums, unused values of i40e_status_code were removed.
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 70 ------------------- drivers/net/ethernet/intel/i40e/i40e_status.h | 35 ---------- 2 files changed, 105 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_common.c +0 -70
@@ -138,106 +138,40 @@ const char *i40e_stat_str(struct i40e_hw *hw, i40e_status stat_err)return "I40E_ERR_NVM" ;case I40E_ERR_NVM_CHECKSUM :return "I40E_ERR_NVM_CHECKSUM" ; -case I40E_ERR_PHY : -return "I40E_ERR_PHY" ;case I40E_ERR_CONFIG :return "I40E_ERR_CONFIG" ;case I40E_ERR_PARAM :return "I40E_ERR_PARAM" ; -case I40E_ERR_MAC_TYPE : -return "I40E_ERR_MAC_TYPE" ;case I40E_ERR_UNKNOWN_PHY :return "I40E_ERR_UNKNOWN_PHY" ; -case I40E_ERR_LINK_SETUP : -return "I40E_ERR_LINK_SETUP" ; -case I40E_ERR_ADAPTER_STOPPED : -return "I40E_ERR_ADAPTER_STOPPED" ;case I40E_ERR_INVALID_MAC_ADDR :return "I40E_ERR_INVALID_MAC_ADDR" ;case I40E_ERR_DEVICE_NOT_SUPPORTED :return "I40E_ERR_DEVICE_NOT_SUPPORTED" ; -case I40E_ERR_PRIMARY_REQUESTS_PENDING : -return "I40E_ERR_PRIMARY_REQUESTS_PENDING" ; -case I40E_ERR_INVALID_LINK_SETTINGS : -return "I40E_ERR_INVALID_LINK_SETTINGS" ; -case I40E_ERR_AUTONEG_NOT_COMPLETE : -return "I40E_ERR_AUTONEG_NOT_COMPLETE" ;case I40E_ERR_RESET_FAILED :return "I40E_ERR_RESET_FAILED" ; -case I40E_ERR_SWFW_SYNC : -return "I40E_ERR_SWFW_SYNC" ;case I40E_ERR_NO_AVAILABLE_VSI :return "I40E_ERR_NO_AVAILABLE_VSI" ;case I40E_ERR_NO_MEMORY :return "I40E_ERR_NO_MEMORY" ;case I40E_ERR_BAD_PTR :return "I40E_ERR_BAD_PTR" ; -case I40E_ERR_RING_FULL : -return "I40E_ERR_RING_FULL" ; -case I40E_ERR_INVALID_PD_ID : -return "I40E_ERR_INVALID_PD_ID" ; -case I40E_ERR_INVALID_QP_ID : -return "I40E_ERR_INVALID_QP_ID" ; -case I40E_ERR_INVALID_CQ_ID : -return "I40E_ERR_INVALID_CQ_ID" ; -case I40E_ERR_INVALID_CEQ_ID : -return "I40E_ERR_INVALID_CEQ_ID" ; -case I40E_ERR_INVALID_AEQ_ID : -return "I40E_ERR_INVALID_AEQ_ID" ;case I40E_ERR_INVALID_SIZE :return "I40E_ERR_INVALID_SIZE" ; -case I40E_ERR_INVALID_ARP_INDEX : -return "I40E_ERR_INVALID_ARP_INDEX" ; -case I40E_ERR_INVALID_FPM_FUNC_ID : -return "I40E_ERR_INVALID_FPM_FUNC_ID" ; -case I40E_ERR_QP_INVALID_MSG_SIZE : -return "I40E_ERR_QP_INVALID_MSG_SIZE" ; -case I40E_ERR_QP_TOOMANY_WRS_POSTED : -return "I40E_ERR_QP_TOOMANY_WRS_POSTED" ; -case I40E_ERR_INVALID_FRAG_COUNT : -return "I40E_ERR_INVALID_FRAG_COUNT" ;case I40E_ERR_QUEUE_EMPTY :return "I40E_ERR_QUEUE_EMPTY" ; -case I40E_ERR_INVALID_ALIGNMENT : -return "I40E_ERR_INVALID_ALIGNMENT" ; -case I40E_ERR_FLUSHED_QUEUE : -return "I40E_ERR_FLUSHED_QUEUE" ; -case I40E_ERR_INVALID_PUSH_PAGE_INDEX : -return "I40E_ERR_INVALID_PUSH_PAGE_INDEX" ; -case I40E_ERR_INVALID_IMM_DATA_SIZE : -return "I40E_ERR_INVALID_IMM_DATA_SIZE" ;case I40E_ERR_TIMEOUT :return "I40E_ERR_TIMEOUT" ; -case I40E_ERR_OPCODE_MISMATCH : -return "I40E_ERR_OPCODE_MISMATCH" ; -case I40E_ERR_CQP_COMPL_ERROR : -return "I40E_ERR_CQP_COMPL_ERROR" ; -case I40E_ERR_INVALID_VF_ID : -return "I40E_ERR_INVALID_VF_ID" ; -case I40E_ERR_INVALID_HMCFN_ID : -return "I40E_ERR_INVALID_HMCFN_ID" ; -case I40E_ERR_BACKING_PAGE_ERROR : -return "I40E_ERR_BACKING_PAGE_ERROR" ; -case I40E_ERR_NO_PBLCHUNKS_AVAILABLE : -return "I40E_ERR_NO_PBLCHUNKS_AVAILABLE" ; -case I40E_ERR_INVALID_PBLE_INDEX : -return "I40E_ERR_INVALID_PBLE_INDEX" ;case I40E_ERR_INVALID_SD_INDEX :return "I40E_ERR_INVALID_SD_INDEX" ;case I40E_ERR_INVALID_PAGE_DESC_INDEX :return "I40E_ERR_INVALID_PAGE_DESC_INDEX" ;case I40E_ERR_INVALID_SD_TYPE :return "I40E_ERR_INVALID_SD_TYPE" ; -case I40E_ERR_MEMCPY_FAILED : -return "I40E_ERR_MEMCPY_FAILED" ;case I40E_ERR_INVALID_HMC_OBJ_INDEX :return "I40E_ERR_INVALID_HMC_OBJ_INDEX" ;case I40E_ERR_INVALID_HMC_OBJ_COUNT :return "I40E_ERR_INVALID_HMC_OBJ_COUNT" ; -case I40E_ERR_INVALID_SRQ_ARM_LIMIT : -return "I40E_ERR_INVALID_SRQ_ARM_LIMIT" ; -case I40E_ERR_SRQ_ENABLED : -return "I40E_ERR_SRQ_ENABLED" ;case I40E_ERR_ADMIN_QUEUE_ERROR :return "I40E_ERR_ADMIN_QUEUE_ERROR" ;case I40E_ERR_ADMIN_QUEUE_TIMEOUT :
@@ -248,14 +182,10 @@ const char *i40e_stat_str(struct i40e_hw *hw, i40e_status stat_err)return "I40E_ERR_ADMIN_QUEUE_FULL" ;case I40E_ERR_ADMIN_QUEUE_NO_WORK :return "I40E_ERR_ADMIN_QUEUE_NO_WORK" ; -case I40E_ERR_BAD_IWARP_CQE : -return "I40E_ERR_BAD_IWARP_CQE" ;case I40E_ERR_NVM_BLANK_MODE :return "I40E_ERR_NVM_BLANK_MODE" ;case I40E_ERR_NOT_IMPLEMENTED :return "I40E_ERR_NOT_IMPLEMENTED" ; -case I40E_ERR_PE_DOORBELL_NOT_ENABLED : -return "I40E_ERR_PE_DOORBELL_NOT_ENABLED" ;case I40E_ERR_DIAG_TEST_FAILED :return "I40E_ERR_DIAG_TEST_FAILED" ;case I40E_ERR_NOT_READY :
drivers/net/ethernet/intel/i40e/i40e_status.h +0 -35
@@ -9,65 +9,30 @@ enum i40e_status_code {I40E_SUCCESS =0 ,I40E_ERR_NVM =-1 ,I40E_ERR_NVM_CHECKSUM =-2 , -I40E_ERR_PHY =-3 ,I40E_ERR_CONFIG =-4 ,I40E_ERR_PARAM =-5 , -I40E_ERR_MAC_TYPE =-6 ,I40E_ERR_UNKNOWN_PHY =-7 , -I40E_ERR_LINK_SETUP =-8 , -I40E_ERR_ADAPTER_STOPPED =-9 ,I40E_ERR_INVALID_MAC_ADDR =-10 ,I40E_ERR_DEVICE_NOT_SUPPORTED =-11 , -I40E_ERR_PRIMARY_REQUESTS_PENDING =-12 , -I40E_ERR_INVALID_LINK_SETTINGS =-13 , -I40E_ERR_AUTONEG_NOT_COMPLETE =-14 ,I40E_ERR_RESET_FAILED =-15 , -I40E_ERR_SWFW_SYNC =-16 ,I40E_ERR_NO_AVAILABLE_VSI =-17 ,I40E_ERR_NO_MEMORY =-18 ,I40E_ERR_BAD_PTR =-19 , -I40E_ERR_RING_FULL =-20 , -I40E_ERR_INVALID_PD_ID =-21 , -I40E_ERR_INVALID_QP_ID =-22 , -I40E_ERR_INVALID_CQ_ID =-23 , -I40E_ERR_INVALID_CEQ_ID =-24 , -I40E_ERR_INVALID_AEQ_ID =-25 ,I40E_ERR_INVALID_SIZE =-26 , -I40E_ERR_INVALID_ARP_INDEX =-27 , -I40E_ERR_INVALID_FPM_FUNC_ID =-28 , -I40E_ERR_QP_INVALID_MSG_SIZE =-29 , -I40E_ERR_QP_TOOMANY_WRS_POSTED =-30 , -I40E_ERR_INVALID_FRAG_COUNT =-31 ,I40E_ERR_QUEUE_EMPTY =-32 , -I40E_ERR_INVALID_ALIGNMENT =-33 , -I40E_ERR_FLUSHED_QUEUE =-34 , -I40E_ERR_INVALID_PUSH_PAGE_INDEX =-35 , -I40E_ERR_INVALID_IMM_DATA_SIZE =-36 ,I40E_ERR_TIMEOUT =-37 , -I40E_ERR_OPCODE_MISMATCH =-38 , -I40E_ERR_CQP_COMPL_ERROR =-39 , -I40E_ERR_INVALID_VF_ID =-40 , -I40E_ERR_INVALID_HMCFN_ID =-41 , -I40E_ERR_BACKING_PAGE_ERROR =-42 , -I40E_ERR_NO_PBLCHUNKS_AVAILABLE =-43 , -I40E_ERR_INVALID_PBLE_INDEX =-44 ,I40E_ERR_INVALID_SD_INDEX =-45 ,I40E_ERR_INVALID_PAGE_DESC_INDEX =-46 ,I40E_ERR_INVALID_SD_TYPE =-47 , -I40E_ERR_MEMCPY_FAILED =-48 ,I40E_ERR_INVALID_HMC_OBJ_INDEX =-49 ,I40E_ERR_INVALID_HMC_OBJ_COUNT =-50 , -I40E_ERR_INVALID_SRQ_ARM_LIMIT =-51 , -I40E_ERR_SRQ_ENABLED =-52 ,I40E_ERR_ADMIN_QUEUE_ERROR =-53 ,I40E_ERR_ADMIN_QUEUE_TIMEOUT =-54 ,I40E_ERR_BUF_TOO_SHORT =-55 ,I40E_ERR_ADMIN_QUEUE_FULL =-56 ,I40E_ERR_ADMIN_QUEUE_NO_WORK =-57 , -I40E_ERR_BAD_IWARP_CQE =-58 ,I40E_ERR_NVM_BLANK_MODE =-59 ,I40E_ERR_NOT_IMPLEMENTED =-60 , -I40E_ERR_PE_DOORBELL_NOT_ENABLED =-61 ,I40E_ERR_DIAG_TEST_FAILED =-62 ,I40E_ERR_NOT_READY =-63 , I40E_NOT_SUPPORTED = -64,
Signature · 1 line
2.38.1
Tony Nguyen
maintainerPATCH 3/6 i40e: Remove string printing for i40e_status
In reply to Tony NguyenFrom: Jan Sokolowski <[email protected]>
Remove the i40e_stat_str() function which prints the string representation of the i40e_status error code. With upcoming changes moving away from i40e_status, there will be no need for this function
--- drivers/net/ethernet/intel/i40e/i40e_client.c | 8 +- drivers/net/ethernet/intel/i40e/i40e_common.c | 78 ----- drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | 16 +- .../net/ethernet/intel/i40e/i40e_ethtool.c | 41 ++- drivers/net/ethernet/intel/i40e/i40e_main.c | 315 +++++++++--------- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 4 +- .../net/ethernet/intel/i40e/i40e_prototype.h | 1 - .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 28 +- 8 files changed, 206 insertions(+), 285 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_client.c +4 -4
@@ -686,8 +686,8 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev, ctxt.flags =I40E_AQ_VSI_TYPE_PF ;if (err) {dev_info (&pf->pdev->dev, -"couldn't get PF vsi config, err %s aq_err %s\n" , -i40e_stat_str (&pf->hw, err), +"couldn't get PF vsi config, err %d aq_err %s\n" , + err,i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));return -ENOENT ;
@@ -714,8 +714,8 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev, err =i40e_aq_update_vsi_params (&vsi->back->hw, &ctxt,NULL );if (err) {dev_info (&pf->pdev->dev, -"update VSI ctxt for PE failed, err %s aq_err %s\n" , -i40e_stat_str (&pf->hw, err), +"update VSI ctxt for PE failed, err %d aq_err %s\n" , + err,i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status)); }
drivers/net/ethernet/intel/i40e/i40e_common.c +0 -78
84 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c +8 -8
@@ -135,8 +135,8 @@ static int i40e_dcbnl_ieee_setets(struct net_device *netdev, ret =i40e_hw_dcb_config (pf, &pf->tmp_cfg);if (ret) {dev_info (&pf->pdev->dev, -"Failed setting DCB ETS configuration err %s aq_err %s\n" , -i40e_stat_str (&pf->hw, ret), +"Failed setting DCB ETS configuration err %d aq_err %s\n" , + ret,i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));return -EINVAL ; }
@@ -174,8 +174,8 @@ static int i40e_dcbnl_ieee_setpfc(struct net_device *netdev, ret =i40e_hw_dcb_config (pf, &pf->tmp_cfg);if (ret) {dev_info (&pf->pdev->dev, -"Failed setting DCB PFC configuration err %s aq_err %s\n" , -i40e_stat_str (&pf->hw, ret), +"Failed setting DCB PFC configuration err %d aq_err %s\n" , + ret,i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));return -EINVAL ; }
@@ -225,8 +225,8 @@ static int i40e_dcbnl_ieee_setapp(struct net_device *netdev, ret =i40e_hw_dcb_config (pf, &pf->tmp_cfg);if (ret) {dev_info (&pf->pdev->dev, -"Failed setting DCB configuration err %s aq_err %s\n" , -i40e_stat_str (&pf->hw, ret), +"Failed setting DCB configuration err %d aq_err %s\n" , + ret,i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));return -EINVAL ; }
@@ -290,8 +290,8 @@ static int i40e_dcbnl_ieee_delapp(struct net_device *netdev, ret =i40e_hw_dcb_config (pf, &pf->tmp_cfg);if (ret) {dev_info (&pf->pdev->dev, -"Failed setting DCB configuration err %s aq_err %s\n" , -i40e_stat_str (&pf->hw, ret), +"Failed setting DCB configuration err %d aq_err %s\n" , + ret,i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));return -EINVAL ; }
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +20 -21
97 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_main.c +158 -157
795 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_nvm.c +2 -2
@@ -1429,8 +1429,8 @@ static i40e_status i40e_nvmupd_exec_aq(struct i40e_hw *hw, buff_size, &cmd_details);if (status) {i40e_debug (hw,I40E_DEBUG_NVM , -"i40e_nvmupd_exec_aq err %s aq_err %s\n" , -i40e_stat_str (hw, status), +"%s err %d aq_err %s\n" , + __func__, status,i40e_aq_str (hw, hw->aq.asq_last_status)); *perrno =i40e_aq_rc_to_posix (status, hw->aq.asq_last_status);return status;
drivers/net/ethernet/intel/i40e/i40e_prototype.h +0 -1
@@ -55,7 +55,6 @@ void i40e_idle_aq(struct i40e_hw *hw);bool i40e_check_asq_alive (struct i40e_hw *hw);i40e_status i40e_aq_queue_shutdown (struct i40e_hw *hw,bool unloading);const char *i40e_aq_str (struct i40e_hw *hw,enum i40e_admin_queue_err aq_err); -const char *i40e_stat_str (struct i40e_hw *hw,i40e_status stat_err);i40e_status i40e_aq_get_rss_lut (struct i40e_hw *hw,u16 seid,bool pf_lut,u8 *lut,u16 lut_size);
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +14 -14
@@ -1323,9 +1323,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,int aq_err = pf->hw.aq.asq_last_status;dev_err (&pf->pdev->dev, -"VF %d failed to set multicast promiscuous mode err %s aq_err %s\n" , +"VF %d failed to set multicast promiscuous mode err %d aq_err %s\n" , vf->vf_id, -i40e_stat_str (&pf->hw, aq_ret), + aq_ret,i40e_aq_str (&pf->hw, aq_err));return aq_ret;
@@ -1339,9 +1339,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,int aq_err = pf->hw.aq.asq_last_status;dev_err (&pf->pdev->dev, -"VF %d failed to set unicast promiscuous mode err %s aq_err %s\n" , +"VF %d failed to set unicast promiscuous mode err %d aq_err %s\n" , vf->vf_id, -i40e_stat_str (&pf->hw, aq_ret), + aq_ret,i40e_aq_str (&pf->hw, aq_err)); }
@@ -1356,9 +1356,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,int aq_err = pf->hw.aq.asq_last_status;dev_err (&pf->pdev->dev, -"VF %d failed to set multicast promiscuous mode err %s aq_err %s\n" , +"VF %d failed to set multicast promiscuous mode err %d aq_err %s\n" , vf->vf_id, -i40e_stat_str (&pf->hw, aq_ret), + aq_ret,i40e_aq_str (&pf->hw, aq_err));if (!aq_tmp)
@@ -1372,9 +1372,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,int aq_err = pf->hw.aq.asq_last_status;dev_err (&pf->pdev->dev, -"VF %d failed to set unicast promiscuous mode err %s aq_err %s\n" , +"VF %d failed to set unicast promiscuous mode err %d aq_err %s\n" , vf->vf_id, -i40e_stat_str (&pf->hw, aq_ret), + aq_ret,i40e_aq_str (&pf->hw, aq_err));if (!aq_tmp)
@@ -3676,8 +3676,8 @@ static void i40e_del_all_cloud_filters(struct i40e_vf *vf) ret =i40e_add_del_cloud_filter (vsi, cfilter, false);if (ret)dev_err (&pf->pdev->dev, -"VF %d: Failed to delete cloud filter, err %s aq_err %s\n" , - vf->vf_id,i40e_stat_str (&pf->hw, ret), +"VF %d: Failed to delete cloud filter, err %d aq_err %s\n" , + vf->vf_id, ret,i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));
@@ -3779,8 +3779,8 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg) ret =i40e_add_del_cloud_filter (vsi, &cfilter, false);if (ret) {dev_err (&pf->pdev->dev, -"VF %d: Failed to delete cloud filter, err %s aq_err %s\n" , - vf->vf_id,i40e_stat_str (&pf->hw, ret), +"VF %d: Failed to delete cloud filter, err %d aq_err %s\n" , + vf->vf_id, ret,i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status)); goto err; }
@@ -3913,8 +3913,8 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) ret =i40e_add_del_cloud_filter (vsi, cfilter, true);if (ret) {dev_err (&pf->pdev->dev, -"VF %d: Failed to add cloud filter, err %s aq_err %s\n" , - vf->vf_id,i40e_stat_str (&pf->hw, ret), +"VF %d: Failed to add cloud filter, err %d aq_err %s\n" , + vf->vf_id, ret,i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status)); goto err_free; }
Signature · 1 line
2.38.1
Tony Nguyen
maintainerPATCH 4/6 i40e: use int for i40e_status
In reply to Tony NguyenFrom: Jan Sokolowski <[email protected]>
To prepare for removal of i40e_status, change the variables from i40e_status to int. This eases the transition when values are changed to return standard int error codes over enum i40e_status.
As such changes often also change variable orders, a cleanup is also applied here to make variables conform to RCT and some lines are also reformatted where applicable.
--- drivers/net/ethernet/intel/i40e/i40e.h | 8 +- drivers/net/ethernet/intel/i40e/i40e_adminq.c | 68 +- drivers/net/ethernet/intel/i40e/i40e_alloc.h | 22 +- drivers/net/ethernet/intel/i40e/i40e_client.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_common.c | 890 +++++++++--------- drivers/net/ethernet/intel/i40e/i40e_dcb.c | 60 +- drivers/net/ethernet/intel/i40e/i40e_dcb.h | 28 +- drivers/net/ethernet/intel/i40e/i40e_ddp.c | 14 +- .../net/ethernet/intel/i40e/i40e_debugfs.c | 8 +- drivers/net/ethernet/intel/i40e/i40e_diag.c | 12 +- drivers/net/ethernet/intel/i40e/i40e_diag.h | 4 +- .../net/ethernet/intel/i40e/i40e_ethtool.c | 24 +- drivers/net/ethernet/intel/i40e/i40e_hmc.c | 56 +- drivers/net/ethernet/intel/i40e/i40e_hmc.h | 46 +- .../net/ethernet/intel/i40e/i40e_lan_hmc.c | 94 +- .../net/ethernet/intel/i40e/i40e_lan_hmc.h | 34 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 101 +- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 248 ++--- drivers/net/ethernet/intel/i40e/i40e_osdep.h | 1 - .../net/ethernet/intel/i40e/i40e_prototype.h | 642 ++++++------- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 66 +- 21 files changed, 1224 insertions(+), 1206 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +4 -4
@@ -1289,10 +1289,10 @@ void i40e_ptp_stop(struct i40e_pf *pf);int i40e_ptp_alloc_pins (struct i40e_pf *pf);int i40e_update_adq_vsi_queues (struct i40e_vsi *vsi,int vsi_offset);int i40e_is_vsi_uplink_mode_veb (struct i40e_vsi *vsi); -i40e_status i40e_configure_source_pruning (struct i40e_vsi *vsi,bool enable); -i40e_status i40e_get_partition_bw_setting (struct i40e_pf *pf); -i40e_status i40e_set_partition_bw_setting (struct i40e_pf *pf); -i40e_status i40e_commit_partition_bw_setting (struct i40e_pf *pf); +int i40e_configure_source_pruning (struct i40e_vsi *vsi,bool enable); +int i40e_get_partition_bw_setting (struct i40e_pf *pf); +int i40e_set_partition_bw_setting (struct i40e_pf *pf); +int i40e_commit_partition_bw_setting (struct i40e_pf *pf);void i40e_print_link_message (struct i40e_vsi *vsi,bool isup);void i40e_set_fec_in_flags (u8 fec_cfg,u32 *flags);
drivers/net/ethernet/intel/i40e/i40e_adminq.c +34 -34
214 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_alloc.h +11 -11
@@ -20,16 +20,16 @@ enum i40e_memory_type { };/* prototype for functions used for dynamic memory allocation */ -i40e_status i40e_allocate_dma_mem (struct i40e_hw *hw, -struct i40e_dma_mem *mem, -enum i40e_memory_type type, -u64 size,u32 alignment); -i40e_status i40e_free_dma_mem (struct i40e_hw *hw, -struct i40e_dma_mem *mem); -i40e_status i40e_allocate_virt_mem (struct i40e_hw *hw, -struct i40e_virt_mem *mem, -u32 size); -i40e_status i40e_free_virt_mem (struct i40e_hw *hw, -struct i40e_virt_mem *mem); +int i40e_allocate_dma_mem (struct i40e_hw *hw, +struct i40e_dma_mem *mem, +enum i40e_memory_type type, +u64 size,u32 alignment); +int i40e_free_dma_mem (struct i40e_hw *hw, +struct i40e_dma_mem *mem); +int i40e_allocate_virt_mem (struct i40e_hw *hw, +struct i40e_virt_mem *mem, +u32 size); +int i40e_free_virt_mem (struct i40e_hw *hw, +struct i40e_virt_mem *mem);#endif /* _I40E_ALLOC_H_ */
drivers/net/ethernet/intel/i40e/i40e_client.c +2 -2
@@ -541,7 +541,7 @@ static int i40e_client_virtchnl_send(struct i40e_info *ldev, {struct i40e_pf *pf = ldev->pf;struct i40e_hw *hw = &pf->hw; -i40e_status err; +int err; err =i40e_aq_send_msg_to_vf (hw, vf_id,VIRTCHNL_OP_RDMA ,0 , msg, len,NULL );
@@ -674,7 +674,7 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev,struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];struct i40e_vsi_context ctxt;bool update = true; -i40e_status err; +int err;/* TODO: for now do not allow setting VF's VSI setting */ if (is_vf)
drivers/net/ethernet/intel/i40e/i40e_common.c +451 -439
2,057 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_dcb.c +30 -30
152 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_dcb.h +14 -14
@@ -264,20 +264,20 @@ void i40e_dcb_hw_calculate_pool_sizes(struct i40e_hw *hw,void i40e_dcb_hw_rx_pb_config (struct i40e_hw *hw,struct i40e_rx_pb_config *old_pb_cfg,struct i40e_rx_pb_config *new_pb_cfg); -i40e_status i40e_get_dcbx_status (struct i40e_hw *hw, -u16 *status); -i40e_status i40e_lldp_to_dcb_config (u8 *lldpmib, -struct i40e_dcbx_config *dcbcfg); -i40e_status i40e_aq_get_dcb_config (struct i40e_hw *hw,u8 mib_type, -u8 bridgetype, -struct i40e_dcbx_config *dcbcfg); -i40e_status i40e_get_dcb_config (struct i40e_hw *hw); -i40e_status i40e_init_dcb (struct i40e_hw *hw, -bool enable_mib_change); -enum i40e_status_code +int i40e_get_dcbx_status (struct i40e_hw *hw, +u16 *status); +int i40e_lldp_to_dcb_config (u8 *lldpmib, +struct i40e_dcbx_config *dcbcfg); +int i40e_aq_get_dcb_config (struct i40e_hw *hw,u8 mib_type, +u8 bridgetype, +struct i40e_dcbx_config *dcbcfg); +int i40e_get_dcb_config (struct i40e_hw *hw); +int i40e_init_dcb (struct i40e_hw *hw, +bool enable_mib_change); +int i40e_get_fw_lldp_status (struct i40e_hw *hw,enum i40e_get_fw_lldp_status_resp *lldp_status); -i40e_status i40e_set_dcb_config (struct i40e_hw *hw); -i40e_status i40e_dcb_config_to_lldp (u8 *lldpmib,u16 *miblen, -struct i40e_dcbx_config *dcbcfg); +int i40e_set_dcb_config (struct i40e_hw *hw); +int i40e_dcb_config_to_lldp (u8 *lldpmib,u16 *miblen, +struct i40e_dcbx_config *dcbcfg);#endif /* _I40E_DCB_H_ */
drivers/net/ethernet/intel/i40e/i40e_ddp.c +7 -7
@@ -36,7 +36,7 @@ static int i40e_ddp_does_profile_exist(struct i40e_hw *hw, {struct i40e_ddp_profile_list *profile_list;u8 buff[I40E_PROFILE_LIST_SIZE ]; -i40e_status status; +int status;int i; status = i40e_aq_get_ddp_list(hw, buff, I40E_PROFILE_LIST_SIZE, 0,
@@ -91,7 +91,7 @@ static int i40e_ddp_does_profile_overlap(struct i40e_hw *hw, {struct i40e_ddp_profile_list *profile_list;u8 buff[I40E_PROFILE_LIST_SIZE ]; -i40e_status status; +int status;int i; status = i40e_aq_get_ddp_list(hw, buff, I40E_PROFILE_LIST_SIZE, 0,
@@ -117,14 +117,14 @@ static int i40e_ddp_does_profile_overlap(struct i40e_hw *hw,* * Register a profile to the list of loaded profiles. */ -static enum i40e_status_code +static int i40e_add_pinfo (struct i40e_hw *hw,struct i40e_profile_segment *profile,u8 *profile_info_sec,u32 track_id) {struct i40e_profile_section_header *sec;struct i40e_profile_info *pinfo; -i40e_status status;u32 offset =0 , info =0 ; +int status; sec = (struct i40e_profile_section_header *)profile_info_sec; sec->tbl_size =1 ;
@@ -157,14 +157,14 @@ i40e_add_pinfo(struct i40e_hw *hw, struct i40e_profile_segment *profile,* * Removes DDP profile from the NIC. **/ -static enum i40e_status_code +static int i40e_del_pinfo (struct i40e_hw *hw,struct i40e_profile_segment *profile,u8 *profile_info_sec,u32 track_id) {struct i40e_profile_section_header *sec;struct i40e_profile_info *pinfo; -i40e_status status;u32 offset =0 , info =0 ; +int status; sec = (struct i40e_profile_section_header *)profile_info_sec; sec->tbl_size =1 ;
@@ -270,12 +270,12 @@ int i40e_ddp_load(struct net_device *netdev, const u8 *data, size_t size,struct i40e_profile_segment *profile_hdr;struct i40e_profile_info pinfo;struct i40e_package_header *pkg_hdr; -i40e_status status;struct i40e_netdev_priv *np =netdev_priv (netdev);struct i40e_vsi *vsi = np->vsi;struct i40e_pf *pf = vsi->back;u32 track_id;int istatus; +int status; pkg_hdr = (struct i40e_package_header *)data;if (!i40e_ddp_is_pkg_hdr_valid (netdev, pkg_hdr, size))
drivers/net/ethernet/intel/i40e/i40e_debugfs.c +4 -4
@@ -918,9 +918,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp,dev_info (&pf->pdev->dev,"deleting relay %d\n" , veb_seid);i40e_veb_release (pf->veb[i]); }else if (strncmp (cmd_buf,"add pvid" ,8 ) ==0 ) { -i40e_status ret; -u16 vid;unsigned int v; +int ret; +u16 vid; cnt =sscanf (&cmd_buf[8 ],"%i %u" , &vsi_seid, &v);if (cnt !=2 ) {
@@ -1284,7 +1284,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp, } }else if (strncmp (cmd_buf,"send aq_cmd" ,11 ) ==0 ) {struct i40e_aq_desc *desc; -i40e_status ret; +int ret; desc =kzalloc (sizeof (struct i40e_aq_desc ),GFP_KERNEL );if (!desc)
@@ -1330,9 +1330,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp, desc =NULL ; }else if (strncmp (cmd_buf,"send indirect aq_cmd" ,20 ) ==0 ) {struct i40e_aq_desc *desc; -i40e_status ret;u16 buffer_len;u8 *buff; +int ret; desc =kzalloc (sizeof (struct i40e_aq_desc ),GFP_KERNEL );if (!desc)
drivers/net/ethernet/intel/i40e/i40e_diag.c +6 -6
@@ -10,8 +10,8 @@* @reg: reg to be tested * @mask: bits to be touched **/ -static i40e_status i40e_diag_reg_pattern_test (struct i40e_hw *hw, -u32 reg,u32 mask) +static int i40e_diag_reg_pattern_test (struct i40e_hw *hw, +u32 reg,u32 mask) {static const u32 patterns[] = {0x5A5A5A5A ,0xA5A5A5A5 ,0x00000000 ,0xFFFFFFFF
@@ -74,9 +74,9 @@ struct i40e_diag_reg_test_info i40e_reg_list[] = {* * Perform registers diagnostic test **/ -i40e_status i40e_diag_reg_test (struct i40e_hw *hw) +int i40e_diag_reg_test (struct i40e_hw *hw) { -i40e_status ret_code =0 ; +int ret_code =0 ;u32 reg, mask;u32 i, j;
@@ -114,9 +114,9 @@ i40e_status i40e_diag_reg_test(struct i40e_hw *hw)* * Perform EEPROM diagnostic test **/ -i40e_status i40e_diag_eeprom_test (struct i40e_hw *hw) +int i40e_diag_eeprom_test (struct i40e_hw *hw) { -i40e_status ret_code; +int ret_code;u16 reg_val;/* read NVM control word and if NVM valid, validate EEPROM checksum*/
drivers/net/ethernet/intel/i40e/i40e_diag.h +2 -2
@@ -22,7 +22,7 @@ struct i40e_diag_reg_test_info {extern struct i40e_diag_reg_test_info i40e_reg_list[]; -i40e_status i40e_diag_reg_test (struct i40e_hw *hw); -i40e_status i40e_diag_eeprom_test (struct i40e_hw *hw); +int i40e_diag_reg_test (struct i40e_hw *hw); +int i40e_diag_eeprom_test (struct i40e_hw *hw);#endif /* _I40E_DIAG_H_ */
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +12 -12
@@ -1227,8 +1227,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev,struct i40e_vsi *vsi = np->vsi;struct i40e_hw *hw = &pf->hw;bool autoneg_changed = false; -i40e_status status =0 ;int timeout =50 ; +int status =0 ;int err =0 ;__u32 speed;u8 autoneg;
@@ -1486,7 +1486,7 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg)struct i40e_aq_get_phy_abilities_resp abilities;struct i40e_pf *pf = np->vsi->back;struct i40e_hw *hw = &pf->hw; -i40e_status status =0 ; +int status =0 ;u32 flags =0 ;int err =0 ;
@@ -1548,7 +1548,7 @@ static int i40e_get_fec_param(struct net_device *netdev,struct i40e_aq_get_phy_abilities_resp abilities;struct i40e_pf *pf = np->vsi->back;struct i40e_hw *hw = &pf->hw; -i40e_status status =0 ; +int status =0 ;int err =0 ;u8 fec_cfg;
@@ -1635,7 +1635,7 @@ static int i40e_nway_reset(struct net_device *netdev)struct i40e_pf *pf = np->vsi->back;struct i40e_hw *hw = &pf->hw;bool link_up = hw->phy.link_info.link_info &I40E_AQ_LINK_UP ; -i40e_status ret =0 ; +int ret =0 ; ret =i40e_aq_set_link_restart_an (hw, link_up,NULL );if (ret) {
@@ -1700,9 +1700,9 @@ static int i40e_set_pauseparam(struct net_device *netdev,struct i40e_link_status *hw_link_info = &hw->phy.link_info;struct i40e_dcbx_config *dcbx_cfg = &hw->local_dcbx_config;bool link_up = hw_link_info->link_info &I40E_AQ_LINK_UP ; -i40e_status status;u8 aq_failures;int err =0 ; +int status;u32 is_an;/* Changing the port's flow control is not supported if this isn't the
@@ -2584,8 +2584,8 @@ static u64 i40e_link_test(struct net_device *netdev, u64 *data) {struct i40e_netdev_priv *np =netdev_priv (netdev);struct i40e_pf *pf = np->vsi->back; -i40e_status status;bool link_up = false; +int status;netif_info (pf, hw, netdev,"link test\n" ); status =i40e_get_link_status (&pf->hw, &link_up);
@@ -2808,11 +2808,11 @@ static int i40e_set_phys_id(struct net_device *netdev, enum ethtool_phys_id_state state) {struct i40e_netdev_priv *np =netdev_priv (netdev); -i40e_status ret =0 ;struct i40e_pf *pf = np->vsi->back;struct i40e_hw *hw = &pf->hw;int blink_freq =2 ;u16 temp_status; +int ret =0 ;switch (state) {case ETHTOOL_ID_ACTIVE :
@@ -5248,7 +5248,7 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)struct i40e_vsi *vsi = np->vsi;struct i40e_pf *pf = vsi->back;u32 reset_needed =0 ; -i40e_status status; +int status;u32 i, j; orig_flags =READ_ONCE (pf->flags);
@@ -5487,8 +5487,8 @@ static int i40e_get_module_info(struct net_device *netdev,u32 sff8472_comp =0 ;u32 sff8472_swap =0 ;u32 sff8636_rev =0 ; -i40e_status status;u32 type =0 ; +int status;/* Check if firmware supports reading module EEPROM. */ if (!(hw->flags &I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE )) {
@@ -5592,8 +5592,8 @@ static int i40e_get_module_eeprom(struct net_device *netdev,struct i40e_pf *pf = vsi->back;struct i40e_hw *hw = &pf->hw;bool is_sfp = false; -i40e_status status;u32 value =0 ; +int status;int i;if (!ee || !ee->len || !data)
@@ -5634,10 +5634,10 @@ static int i40e_get_eee(struct net_device *netdev, struct ethtool_eee *edata) {struct i40e_netdev_priv *np =netdev_priv (netdev);struct i40e_aq_get_phy_abilities_resp phy_cfg; -enum i40e_status_code status =0 ;struct i40e_vsi *vsi = np->vsi;struct i40e_pf *pf = vsi->back;struct i40e_hw *hw = &pf->hw; +int status =0 ;/* Get initial PHY capabilities */ status =i40e_aq_get_phy_capabilities (hw, false, true, &phy_cfg,NULL );
@@ -5699,11 +5699,11 @@ static int i40e_set_eee(struct net_device *netdev, struct ethtool_eee *edata) {struct i40e_netdev_priv *np =netdev_priv (netdev);struct i40e_aq_get_phy_abilities_resp abilities; -enum i40e_status_code status =I40E_SUCCESS ;struct i40e_aq_set_phy_config config;struct i40e_vsi *vsi = np->vsi;struct i40e_pf *pf = vsi->back;struct i40e_hw *hw = &pf->hw; +int status =I40E_SUCCESS ;__le16 eee_capability;/* Deny parameters we don't support */
drivers/net/ethernet/intel/i40e/i40e_hmc.c +28 -28
119 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_hmc.h +23 -23
51 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c +47 -47
72 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_lan_hmc.h +17 -17
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/intel/i40e/i40e_main.c +51 -50
101 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_nvm.c +124 -124
248 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_osdep.h +0 -1
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/intel/i40e/i40e_prototype.h +324 -318
642 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +33 -33
66 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.38.1
Part of the diff is not shown here. View the raw message.
Tony Nguyen
maintainerPATCH 5/6 i40e: use ERR_PTR error print in i40e messages
In reply to Tony NguyenFrom: Jan Sokolowski <[email protected]>
In i40e_status removal patches, i40e_status conversion to strings was removed in order to easily refactor the code to use standard errornums. This however made it more difficult for read error logs.
Use %pe formatter to print error messages in human-readable format.
--- drivers/net/ethernet/intel/i40e/i40e_client.c | 8 +- drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | 16 +- .../net/ethernet/intel/i40e/i40e_ethtool.c | 40 +-- drivers/net/ethernet/intel/i40e/i40e_main.c | 299 +++++++++--------- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 4 +- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 28 +- 6 files changed, 198 insertions(+), 197 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_client.c +4 -4
@@ -686,8 +686,8 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev, ctxt.flags =I40E_AQ_VSI_TYPE_PF ;if (err) {dev_info (&pf->pdev->dev, -"couldn't get PF vsi config, err %d aq_err %s\n" , - err, +"couldn't get PF vsi config, err %pe aq_err %s\n" , +ERR_PTR (err),i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));return -ENOENT ;
@@ -714,8 +714,8 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev, err =i40e_aq_update_vsi_params (&vsi->back->hw, &ctxt,NULL );if (err) {dev_info (&pf->pdev->dev, -"update VSI ctxt for PE failed, err %d aq_err %s\n" , - err, +"update VSI ctxt for PE failed, err %pe aq_err %s\n" , +ERR_PTR (err),i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status)); }
drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c +8 -8
@@ -135,8 +135,8 @@ static int i40e_dcbnl_ieee_setets(struct net_device *netdev, ret =i40e_hw_dcb_config (pf, &pf->tmp_cfg);if (ret) {dev_info (&pf->pdev->dev, -"Failed setting DCB ETS configuration err %d aq_err %s\n" , - ret, +"Failed setting DCB ETS configuration err %pe aq_err %s\n" , +ERR_PTR (ret),i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));return -EINVAL ; }
@@ -174,8 +174,8 @@ static int i40e_dcbnl_ieee_setpfc(struct net_device *netdev, ret =i40e_hw_dcb_config (pf, &pf->tmp_cfg);if (ret) {dev_info (&pf->pdev->dev, -"Failed setting DCB PFC configuration err %d aq_err %s\n" , - ret, +"Failed setting DCB PFC configuration err %pe aq_err %s\n" , +ERR_PTR (ret),i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));return -EINVAL ; }
@@ -225,8 +225,8 @@ static int i40e_dcbnl_ieee_setapp(struct net_device *netdev, ret =i40e_hw_dcb_config (pf, &pf->tmp_cfg);if (ret) {dev_info (&pf->pdev->dev, -"Failed setting DCB configuration err %d aq_err %s\n" , - ret, +"Failed setting DCB configuration err %pe aq_err %s\n" , +ERR_PTR (ret),i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));return -EINVAL ; }
@@ -290,8 +290,8 @@ static int i40e_dcbnl_ieee_delapp(struct net_device *netdev, ret =i40e_hw_dcb_config (pf, &pf->tmp_cfg);if (ret) {dev_info (&pf->pdev->dev, -"Failed setting DCB configuration err %d aq_err %s\n" , - ret, +"Failed setting DCB configuration err %pe aq_err %s\n" , +ERR_PTR (ret),i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));return -EINVAL ; }
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +20 -20
@@ -1456,8 +1456,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev, status =i40e_aq_set_phy_config (hw, &config,NULL );if (status) {netdev_info (netdev, -"Set phy config failed, err %d aq_err %s\n" , - status, +"Set phy config failed, err %pe aq_err %s\n" , +ERR_PTR (status),i40e_aq_str (hw, hw->aq.asq_last_status)); err = -EAGAIN ; goto done;
@@ -1466,8 +1466,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev, status =i40e_update_link_info (hw);if (status)netdev_dbg (netdev, -"Updating link info failed with err %d aq_err %s\n" , - status, +"Updating link info failed with err %pe aq_err %s\n" , +ERR_PTR (status),i40e_aq_str (hw, hw->aq.asq_last_status)); }else {
@@ -1518,8 +1518,8 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg) status =i40e_aq_set_phy_config (hw, &config,NULL );if (status) {netdev_info (netdev, -"Set phy config failed, err %d aq_err %s\n" , - status, +"Set phy config failed, err %pe aq_err %s\n" , +ERR_PTR (status),i40e_aq_str (hw, hw->aq.asq_last_status)); err = -EAGAIN ; goto done;
@@ -1532,8 +1532,8 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg)* (e.g. no physical connection etc.) */ netdev_dbg (netdev, -"Updating link info failed with err %d aq_err %s\n" , - status, +"Updating link info failed with err %pe aq_err %s\n" , +ERR_PTR (status),i40e_aq_str (hw, hw->aq.asq_last_status)); }
@@ -1639,8 +1639,8 @@ static int i40e_nway_reset(struct net_device *netdev) ret =i40e_aq_set_link_restart_an (hw, link_up,NULL );if (ret) { -netdev_info (netdev,"link restart failed, err %d aq_err %s\n" , - ret, +netdev_info (netdev,"link restart failed, err %pe aq_err %s\n" , +ERR_PTR (ret),i40e_aq_str (hw, hw->aq.asq_last_status));return -EIO ; }
@@ -1756,20 +1756,20 @@ static int i40e_set_pauseparam(struct net_device *netdev, status =i40e_set_fc (hw, &aq_failures, link_up);if (aq_failures &I40E_SET_FC_AQ_FAIL_GET ) { -netdev_info (netdev,"Set fc failed on the get_phy_capabilities call with err %d aq_err %s\n" , - status, +netdev_info (netdev,"Set fc failed on the get_phy_capabilities call with err %pe aq_err %s\n" , +ERR_PTR (status),i40e_aq_str (hw, hw->aq.asq_last_status)); err = -EAGAIN ; }if (aq_failures &I40E_SET_FC_AQ_FAIL_SET ) { -netdev_info (netdev,"Set fc failed on the set_phy_config call with err %d aq_err %s\n" , - status, +netdev_info (netdev,"Set fc failed on the set_phy_config call with err %pe aq_err %s\n" , +ERR_PTR (status),i40e_aq_str (hw, hw->aq.asq_last_status)); err = -EAGAIN ; }if (aq_failures &I40E_SET_FC_AQ_FAIL_UPDATE ) { -netdev_info (netdev,"Set fc failed on the get_link_info call with err %d aq_err %s\n" , - status, +netdev_info (netdev,"Set fc failed on the get_link_info call with err %pe aq_err %s\n" , +ERR_PTR (status),i40e_aq_str (hw, hw->aq.asq_last_status)); err = -EAGAIN ; }
@@ -5364,8 +5364,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags) 0, NULL);if (ret && pf->hw.aq.asq_last_status !=I40E_AQ_RC_ESRCH ) {dev_info (&pf->pdev->dev, -"couldn't set switch config bits, err %d aq_err %s\n" , - ret, +"couldn't set switch config bits, err %pe aq_err %s\n" , +ERR_PTR (ret),i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));/* not a fatal problem, just keep going */
@@ -5437,8 +5437,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)return -EBUSY ;default :dev_warn (&pf->pdev->dev, -"Starting FW LLDP agent failed: error: %d, %s\n" , - status, +"Starting FW LLDP agent failed: error: %pe, %s\n" , +ERR_PTR (status),i40e_aq_str (&pf->hw, adq_err));return -EINVAL ;
drivers/net/ethernet/intel/i40e/i40e_main.c +150 -149
754 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_nvm.c +2 -2
@@ -1429,8 +1429,8 @@ static int i40e_nvmupd_exec_aq(struct i40e_hw *hw, buff_size, &cmd_details);if (status) {i40e_debug (hw,I40E_DEBUG_NVM , -"%s err %d aq_err %s\n" , - __func__, status, +"%s err %pe aq_err %s\n" , + __func__,ERR_PTR (status),i40e_aq_str (hw, hw->aq.asq_last_status)); *perrno =i40e_aq_rc_to_posix (status, hw->aq.asq_last_status);return status;
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +14 -14
@@ -1323,9 +1323,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,int aq_err = pf->hw.aq.asq_last_status;dev_err (&pf->pdev->dev, -"VF %d failed to set multicast promiscuous mode err %d aq_err %s\n" , +"VF %d failed to set multicast promiscuous mode err %pe aq_err %s\n" , vf->vf_id, - aq_ret, +ERR_PTR (aq_ret),i40e_aq_str (&pf->hw, aq_err));return aq_ret;
@@ -1339,9 +1339,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,int aq_err = pf->hw.aq.asq_last_status;dev_err (&pf->pdev->dev, -"VF %d failed to set unicast promiscuous mode err %d aq_err %s\n" , +"VF %d failed to set unicast promiscuous mode err %pe aq_err %s\n" , vf->vf_id, - aq_ret, +ERR_PTR (aq_ret),i40e_aq_str (&pf->hw, aq_err)); }
@@ -1356,9 +1356,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,int aq_err = pf->hw.aq.asq_last_status;dev_err (&pf->pdev->dev, -"VF %d failed to set multicast promiscuous mode err %d aq_err %s\n" , +"VF %d failed to set multicast promiscuous mode err %pe aq_err %s\n" , vf->vf_id, - aq_ret, +ERR_PTR (aq_ret),i40e_aq_str (&pf->hw, aq_err));if (!aq_tmp)
@@ -1372,9 +1372,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,int aq_err = pf->hw.aq.asq_last_status;dev_err (&pf->pdev->dev, -"VF %d failed to set unicast promiscuous mode err %d aq_err %s\n" , +"VF %d failed to set unicast promiscuous mode err %pe aq_err %s\n" , vf->vf_id, - aq_ret, +ERR_PTR (aq_ret),i40e_aq_str (&pf->hw, aq_err));if (!aq_tmp)
@@ -3676,8 +3676,8 @@ static void i40e_del_all_cloud_filters(struct i40e_vf *vf) ret =i40e_add_del_cloud_filter (vsi, cfilter, false);if (ret)dev_err (&pf->pdev->dev, -"VF %d: Failed to delete cloud filter, err %d aq_err %s\n" , - vf->vf_id, ret, +"VF %d: Failed to delete cloud filter, err %pe aq_err %s\n" , + vf->vf_id,ERR_PTR (ret),i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status));
@@ -3779,8 +3779,8 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg) ret =i40e_add_del_cloud_filter (vsi, &cfilter, false);if (ret) {dev_err (&pf->pdev->dev, -"VF %d: Failed to delete cloud filter, err %d aq_err %s\n" , - vf->vf_id, ret, +"VF %d: Failed to delete cloud filter, err %pe aq_err %s\n" , + vf->vf_id,ERR_PTR (ret),i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status)); goto err; }
@@ -3913,8 +3913,8 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) ret =i40e_add_del_cloud_filter (vsi, cfilter, true);if (ret) {dev_err (&pf->pdev->dev, -"VF %d: Failed to add cloud filter, err %d aq_err %s\n" , - vf->vf_id, ret, +"VF %d: Failed to add cloud filter, err %pe aq_err %s\n" , + vf->vf_id,ERR_PTR (ret),i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status)); goto err_free; }
Signature · 1 line
2.38.1
Tony Nguyen
maintainerPATCH 6/6 net/i40e: Replace 0-length array with flexible array
In reply to Tony NguyenFrom: Kees Cook <[email protected]>
Zero-length arrays are deprecated[1]. Replace struct i40e_lump_tracking's "list" 0-length array with a flexible array. Detected with GCC 13, using -fstrict-flex-arrays=3:
In function 'i40e_put_lump',
inlined from 'i40e_clear_interrupt_scheme' at drivers/net/ethernet/intel/i40e/i40e_main.c:5145:2:
drivers/net/ethernet/intel/i40e/i40e_main.c:278:27: warning: array subscript <unknown> is outside array bounds of 'u16[0]' {aka 'short unsigned int[]'} [-Warray-bounds=]
278 | pile->list[i] = 0;
| ~~~~~~~~~~^~~
drivers/net/ethernet/intel/i40e/i40e.h: In function 'i40e_clear_interrupt_scheme':
drivers/net/ethernet/intel/i40e/i40e.h:179:13: note: while referencing 'list'
179 | u16 list[0];
| ^~~~[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
--- drivers/net/ethernet/intel/i40e/i40e.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e.h +1 -1
@@ -177,7 +177,7 @@ enum i40e_interrupt_policy {struct i40e_lump_tracking {u16 num_entries; -u16 list[0 ]; +u16 list[];#define I40E_PILE_VALID_BIT 0x8000#define I40E_IWARP_IRQ_PILE_ID (I40E_PILE_VALID_BIT - 2) };
Signature · 6 lines
2.38.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan