Skip to content

Commit 17a65a7

Browse files
mawilli1Jeff Kirsher
authored andcommitted
i40e/i40evf: add macros for virtual channel API version and device capability
Now that we've rolled the virtual channel API version to 1.1, add some macros to test what version is being used by our partner in crime. For the VF, add some macros to determine what our device capabilities are. Change-ID: I79f6683d4c23bd76a8ad9fd492776fcc1208e1dc Signed-off-by: Mitch Williams <[email protected]> Tested-by: Jim Young <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 1b53c2f commit 17a65a7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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

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

45+
#define VF_IS_V10(_v) (((_v)->vf_ver.major == 1) && ((_v)->vf_ver.minor == 0))
46+
#define VF_IS_V11(_v) (((_v)->vf_ver.major == 1) && ((_v)->vf_ver.minor == 1))
47+
4548
/* Various queue ctrls */
4649
enum i40e_queue_ctrl {
4750
I40E_QUEUE_CTRL_UNKNOWN = 0,

drivers/net/ethernet/intel/i40evf/i40evf.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,17 @@ struct i40evf_adapter {
249249
bool netdev_registered;
250250
bool link_up;
251251
enum i40e_virtchnl_ops current_op;
252+
#define CLIENT_ENABLED(_a) ((_a)->vf_res->vf_offload_flags & \
253+
I40E_VIRTCHNL_VF_OFFLOAD_IWARP)
254+
#define RSS_AQ(_a) ((_a)->vf_res->vf_offload_flags & \
255+
I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ)
256+
#define VLAN_ALLOWED(_a) ((_a)->vf_res->vf_offload_flags & \
257+
I40E_VIRTCHNL_VF_OFFLOAD_VLAN)
252258
struct i40e_virtchnl_vf_resource *vf_res; /* incl. all VSIs */
253259
struct i40e_virtchnl_vsi_resource *vsi_res; /* our LAN VSI */
260+
struct i40e_virtchnl_version_info pf_version;
261+
#define PF_IS_V11(_a) (((_a)->pf_version.major == 1) && \
262+
((_a)->pf_version.minor == 1))
254263
u16 msg_enable;
255264
struct i40e_eth_stats current_stats;
256265
struct i40e_vsi vsi;

0 commit comments

Comments
 (0)