virtchnl: convert to new macros
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Thu, 11 May 2017 18:23:13 +0000 (11:23 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 1 Jun 2017 21:15:21 +0000 (14:15 -0700)
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 <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
include/linux/avf/virtchnl.h

index d7fcc4ffa3932c5d14a6d098d9cd380e684f404f..923026a255c0b8c7f31db19f1f4ddebbbf022df5 100644 (file)
@@ -1481,7 +1481,7 @@ static int i40e_vc_get_version_msg(struct i40e_vf *vf, u8 *msg)
 
        vf->vf_ver = *(struct virtchnl_version_info *)msg;
        /* VFs running the 1.0 API expect to get 1.0 back or they will cry. */
-       if (VF_IS_V10(vf))
+       if (VF_IS_V10(&vf->vf_ver))
                info.minor = VIRTCHNL_VERSION_MINOR_NO_VF_CAPS;
        return i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_VERSION,
                                      I40E_SUCCESS, (u8 *)&info,
@@ -1521,7 +1521,7 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)
                len = 0;
                goto err;
        }
-       if (VF_IS_V11(vf))
+       if (VF_IS_V11(&vf->vf_ver))
                vf->driver_caps = *(u32 *)msg;
        else
                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,
        case VIRTCHNL_OP_RESET_VF:
                break;
        case VIRTCHNL_OP_GET_VF_RESOURCES:
-               if (VF_IS_V11(vf))
+               if (VF_IS_V11(&vf->vf_ver))
                        valid_len = sizeof(u32);
                break;
        case VIRTCHNL_OP_CONFIG_TX_QUEUE:
index b57ffffce1411d6772c87d413738c453b1d216a7..1f4b0c504368f96ff5d6c046aac73b28ebf5cc76 100644 (file)
@@ -40,9 +40,6 @@
 #define I40E_VLAN_MASK                 0xFFF
 #define I40E_PRIORITY_MASK             0x7000
 
-#define VF_IS_V10(_v) (((_v)->vf_ver.major == 1) && ((_v)->vf_ver.minor == 0))
-#define VF_IS_V11(_v) (((_v)->vf_ver.major == 1) && ((_v)->vf_ver.minor == 1))
-
 /* Various queue ctrls */
 enum i40e_queue_ctrl {
        I40E_QUEUE_CTRL_UNKNOWN = 0,
index a8b61612196015aa8ac7e6af2fe96a9ca0d95684..8ffa670c2ffd0024ee7d0c8be2896f6c78120702 100644 (file)
@@ -123,6 +123,9 @@ struct virtchnl_version_info {
        u32 minor;
 };
 
+#define VF_IS_V10(_v) (((_v)->major == 1) && ((_v)->minor == 0))
+#define VF_IS_V11(_ver) (((_ver)->major == 1) && ((_ver)->minor == 1))
+
 /* VIRTCHNL_OP_RESET_VF
  * VF sends this request to PF with no parameters
  * PF does NOT respond! VF driver must delay then poll VFGEN_RSTAT register