Skip to content

Commit bb58fd7

Browse files
mawilli1Jeff Kirsher
authored andcommitted
i40e: Update status codes
Add a few new status code which will be used by the ice driver, and rename a few to make them more consistent. Error code are mapped to similar values as in i40e_status.h, so as to be compatible with older VF drivers not using this status enum. Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 48e01e0 commit bb58fd7

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3674,7 +3674,7 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, s16 vf_id, u32 v_opcode,
36743674
dev_err(&pf->pdev->dev, "Invalid message from VF %d, opcode %d, len %d\n",
36753675
local_vf_id, v_opcode, msglen);
36763676
switch (ret) {
3677-
case VIRTCHNL_ERR_PARAM:
3677+
case VIRTCHNL_STATUS_ERR_PARAM:
36783678
return -EPERM;
36793679
default:
36803680
return -EINVAL;

‎include/linux/avf/virtchnl.h‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,19 @@
6262
/* Error Codes */
6363
enum virtchnl_status_code {
6464
VIRTCHNL_STATUS_SUCCESS = 0,
65-
VIRTCHNL_ERR_PARAM = -5,
65+
VIRTCHNL_STATUS_ERR_PARAM = -5,
66+
VIRTCHNL_STATUS_ERR_NO_MEMORY = -18,
6667
VIRTCHNL_STATUS_ERR_OPCODE_MISMATCH = -38,
6768
VIRTCHNL_STATUS_ERR_CQP_COMPL_ERROR = -39,
6869
VIRTCHNL_STATUS_ERR_INVALID_VF_ID = -40,
69-
VIRTCHNL_STATUS_NOT_SUPPORTED = -64,
70+
VIRTCHNL_STATUS_ERR_ADMIN_QUEUE_ERROR = -53,
71+
VIRTCHNL_STATUS_ERR_NOT_SUPPORTED = -64,
7072
};
7173

74+
/* Backward compatibility */
75+
#define VIRTCHNL_ERR_PARAM VIRTCHNL_STATUS_ERR_PARAM
76+
#define VIRTCHNL_STATUS_NOT_SUPPORTED VIRTCHNL_STATUS_ERR_NOT_SUPPORTED
77+
7278
#define VIRTCHNL_LINK_SPEED_100MB_SHIFT 0x1
7379
#define VIRTCHNL_LINK_SPEED_1000MB_SHIFT 0x2
7480
#define VIRTCHNL_LINK_SPEED_10GB_SHIFT 0x3
@@ -831,7 +837,7 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,
831837
case VIRTCHNL_OP_EVENT:
832838
case VIRTCHNL_OP_UNKNOWN:
833839
default:
834-
return VIRTCHNL_ERR_PARAM;
840+
return VIRTCHNL_STATUS_ERR_PARAM;
835841
}
836842
/* few more checks */
837843
if (err_msg_format || valid_len != msglen)

0 commit comments

Comments
 (0)