Skip to content

Commit 823be08

Browse files
jjagielskkuba-moo
authored andcommitted
ixgbe: handle IXGBE_VF_FEATURES_NEGOTIATE mbox cmd
Send to VF information about features supported by the PF driver. Increase API version to 1.7. Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com> Tested-by: Rafal Romanowski <rafal.romanowski@intel.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20251009-jk-iwl-net-2025-10-01-v3-5-ef32a425b92a@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent a7075f5 commit 823be08

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ enum ixgbe_pfvf_api_rev {
5252
ixgbe_mbox_api_14, /* API version 1.4, linux/freebsd VF driver */
5353
ixgbe_mbox_api_15, /* API version 1.5, linux/freebsd VF driver */
5454
ixgbe_mbox_api_16, /* API version 1.6, linux/freebsd VF driver */
55+
ixgbe_mbox_api_17, /* API version 1.7, linux/freebsd VF driver */
5556
/* This value should always be last */
5657
ixgbe_mbox_api_unknown, /* indicates that API version is not known */
5758
};
@@ -91,6 +92,9 @@ enum ixgbe_pfvf_api_rev {
9192
/* mailbox API, version 1.6 VF requests */
9293
#define IXGBE_VF_GET_PF_LINK_STATE 0x11 /* request PF to send link info */
9394

95+
/* mailbox API, version 1.7 VF requests */
96+
#define IXGBE_VF_FEATURES_NEGOTIATE 0x12 /* get features supported by PF */
97+
9498
/* length of permanent address message returned from PF */
9599
#define IXGBE_VF_PERMADDR_MSG_LEN 4
96100
/* word in permanent address message with the current multicast type */
@@ -101,6 +105,12 @@ enum ixgbe_pfvf_api_rev {
101105
#define IXGBE_VF_MBX_INIT_TIMEOUT 2000 /* number of retries on mailbox */
102106
#define IXGBE_VF_MBX_INIT_DELAY 500 /* microseconds between retries */
103107

108+
/* features negotiated between PF/VF */
109+
#define IXGBEVF_PF_SUP_IPSEC BIT(0)
110+
#define IXGBEVF_PF_SUP_ESX_MBX BIT(1)
111+
112+
#define IXGBE_SUPPORTED_FEATURES IXGBEVF_PF_SUP_IPSEC
113+
104114
struct ixgbe_hw;
105115

106116
int ixgbe_read_mbx(struct ixgbe_hw *, u32 *, u16, u16);

drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ static int ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 max_frame, u32 vf
511511
case ixgbe_mbox_api_13:
512512
case ixgbe_mbox_api_14:
513513
case ixgbe_mbox_api_16:
514+
case ixgbe_mbox_api_17:
514515
/* Version 1.1 supports jumbo frames on VFs if PF has
515516
* jumbo frames enabled which means legacy VFs are
516517
* disabled
@@ -1048,6 +1049,7 @@ static int ixgbe_negotiate_vf_api(struct ixgbe_adapter *adapter,
10481049
case ixgbe_mbox_api_13:
10491050
case ixgbe_mbox_api_14:
10501051
case ixgbe_mbox_api_16:
1052+
case ixgbe_mbox_api_17:
10511053
adapter->vfinfo[vf].vf_api = api;
10521054
return 0;
10531055
default:
@@ -1075,6 +1077,7 @@ static int ixgbe_get_vf_queues(struct ixgbe_adapter *adapter,
10751077
case ixgbe_mbox_api_13:
10761078
case ixgbe_mbox_api_14:
10771079
case ixgbe_mbox_api_16:
1080+
case ixgbe_mbox_api_17:
10781081
break;
10791082
default:
10801083
return -1;
@@ -1115,6 +1118,7 @@ static int ixgbe_get_vf_reta(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
11151118

11161119
/* verify the PF is supporting the correct API */
11171120
switch (adapter->vfinfo[vf].vf_api) {
1121+
case ixgbe_mbox_api_17:
11181122
case ixgbe_mbox_api_16:
11191123
case ixgbe_mbox_api_14:
11201124
case ixgbe_mbox_api_13:
@@ -1149,6 +1153,7 @@ static int ixgbe_get_vf_rss_key(struct ixgbe_adapter *adapter,
11491153

11501154
/* verify the PF is supporting the correct API */
11511155
switch (adapter->vfinfo[vf].vf_api) {
1156+
case ixgbe_mbox_api_17:
11521157
case ixgbe_mbox_api_16:
11531158
case ixgbe_mbox_api_14:
11541159
case ixgbe_mbox_api_13:
@@ -1180,6 +1185,7 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter,
11801185
case ixgbe_mbox_api_13:
11811186
case ixgbe_mbox_api_14:
11821187
case ixgbe_mbox_api_16:
1188+
case ixgbe_mbox_api_17:
11831189
break;
11841190
default:
11851191
return -EOPNOTSUPP;
@@ -1251,6 +1257,7 @@ static int ixgbe_get_vf_link_state(struct ixgbe_adapter *adapter,
12511257
case ixgbe_mbox_api_13:
12521258
case ixgbe_mbox_api_14:
12531259
case ixgbe_mbox_api_16:
1260+
case ixgbe_mbox_api_17:
12541261
break;
12551262
default:
12561263
return -EOPNOTSUPP;
@@ -1278,6 +1285,7 @@ static int ixgbe_send_vf_link_status(struct ixgbe_adapter *adapter,
12781285

12791286
switch (adapter->vfinfo[vf].vf_api) {
12801287
case ixgbe_mbox_api_16:
1288+
case ixgbe_mbox_api_17:
12811289
if (hw->mac.type != ixgbe_mac_e610)
12821290
return -EOPNOTSUPP;
12831291
break;
@@ -1293,6 +1301,32 @@ static int ixgbe_send_vf_link_status(struct ixgbe_adapter *adapter,
12931301
return 0;
12941302
}
12951303

1304+
/**
1305+
* ixgbe_negotiate_vf_features - negotiate supported features with VF driver
1306+
* @adapter: pointer to adapter struct
1307+
* @msgbuf: pointer to message buffers
1308+
* @vf: VF identifier
1309+
*
1310+
* Return: 0 on success or -EOPNOTSUPP when operation is not supported.
1311+
*/
1312+
static int ixgbe_negotiate_vf_features(struct ixgbe_adapter *adapter,
1313+
u32 *msgbuf, u32 vf)
1314+
{
1315+
u32 features = msgbuf[1];
1316+
1317+
switch (adapter->vfinfo[vf].vf_api) {
1318+
case ixgbe_mbox_api_17:
1319+
break;
1320+
default:
1321+
return -EOPNOTSUPP;
1322+
}
1323+
1324+
features &= IXGBE_SUPPORTED_FEATURES;
1325+
msgbuf[1] = features;
1326+
1327+
return 0;
1328+
}
1329+
12961330
static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
12971331
{
12981332
u32 mbx_size = IXGBE_VFMAILBOX_SIZE;
@@ -1370,6 +1404,9 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
13701404
case IXGBE_VF_GET_PF_LINK_STATE:
13711405
retval = ixgbe_send_vf_link_status(adapter, msgbuf, vf);
13721406
break;
1407+
case IXGBE_VF_FEATURES_NEGOTIATE:
1408+
retval = ixgbe_negotiate_vf_features(adapter, msgbuf, vf);
1409+
break;
13731410
default:
13741411
e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]);
13751412
retval = -EIO;

0 commit comments

Comments
 (0)