Skip to content

Commit eedcfef

Browse files
jbrandebJeff Kirsher
authored andcommitted
virtchnl: convert to new macros
As part of the conversion, change the arguments to VF_IS_V1[01] macros and move them to virtchnl.h Signed-off-by: Jesse Brandeburg <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 260e938 commit eedcfef

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ static int i40e_vc_get_version_msg(struct i40e_vf *vf, u8 *msg)
14811481

14821482
vf->vf_ver = *(struct virtchnl_version_info *)msg;
14831483
/* VFs running the 1.0 API expect to get 1.0 back or they will cry. */
1484-
if (VF_IS_V10(vf))
1484+
if (VF_IS_V10(&vf->vf_ver))
14851485
info.minor = VIRTCHNL_VERSION_MINOR_NO_VF_CAPS;
14861486
return i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_VERSION,
14871487
I40E_SUCCESS, (u8 *)&info,
@@ -1521,7 +1521,7 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)
15211521
len = 0;
15221522
goto err;
15231523
}
1524-
if (VF_IS_V11(vf))
1524+
if (VF_IS_V11(&vf->vf_ver))
15251525
vf->driver_caps = *(u32 *)msg;
15261526
else
15271527
vf->driver_caps = VIRTCHNL_VF_OFFLOAD_L2 |
@@ -2557,7 +2557,7 @@ static int i40e_vc_validate_vf_msg(struct i40e_vf *vf, u32 v_opcode,
25572557
case VIRTCHNL_OP_RESET_VF:
25582558
break;
25592559
case VIRTCHNL_OP_GET_VF_RESOURCES:
2560-
if (VF_IS_V11(vf))
2560+
if (VF_IS_V11(&vf->vf_ver))
25612561
valid_len = sizeof(u32);
25622562
break;
25632563
case VIRTCHNL_OP_CONFIG_TX_QUEUE:

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
#define I40E_VLAN_MASK 0xFFF
4141
#define I40E_PRIORITY_MASK 0x7000
4242

43-
#define VF_IS_V10(_v) (((_v)->vf_ver.major == 1) && ((_v)->vf_ver.minor == 0))
44-
#define VF_IS_V11(_v) (((_v)->vf_ver.major == 1) && ((_v)->vf_ver.minor == 1))
45-
4643
/* Various queue ctrls */
4744
enum i40e_queue_ctrl {
4845
I40E_QUEUE_CTRL_UNKNOWN = 0,

include/linux/avf/virtchnl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ struct virtchnl_version_info {
123123
u32 minor;
124124
};
125125

126+
#define VF_IS_V10(_v) (((_v)->major == 1) && ((_v)->minor == 0))
127+
#define VF_IS_V11(_ver) (((_ver)->major == 1) && ((_ver)->minor == 1))
128+
126129
/* VIRTCHNL_OP_RESET_VF
127130
* VF sends this request to PF with no parameters
128131
* PF does NOT respond! VF driver must delay then poll VFGEN_RSTAT register

0 commit comments

Comments
 (0)