vf.c 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206
  1. // SPDX-License-Identifier: GPL-2.0
  2. /* Copyright(c) 1999 - 2024 Intel Corporation. */
  3. #include "vf.h"
  4. #include "ixgbevf.h"
  5. /* On Hyper-V, to reset, we need to read from this offset
  6. * from the PCI config space. This is the mechanism used on
  7. * Hyper-V to support PF/VF communication.
  8. */
  9. #define IXGBE_HV_RESET_OFFSET 0x201
  10. static inline s32 ixgbevf_write_msg_read_ack(struct ixgbe_hw *hw, u32 *msg,
  11. u32 *retmsg, u16 size)
  12. {
  13. s32 retval = ixgbevf_write_mbx(hw, msg, size);
  14. if (retval)
  15. return retval;
  16. return ixgbevf_poll_mbx(hw, retmsg, size);
  17. }
  18. /**
  19. * ixgbevf_start_hw_vf - Prepare hardware for Tx/Rx
  20. * @hw: pointer to hardware structure
  21. *
  22. * Starts the hardware by filling the bus info structure and media type, clears
  23. * all on chip counters, initializes receive address registers, multicast
  24. * table, VLAN filter table, calls routine to set up link and flow control
  25. * settings, and leaves transmit and receive units disabled and uninitialized
  26. **/
  27. static s32 ixgbevf_start_hw_vf(struct ixgbe_hw *hw)
  28. {
  29. /* Clear adapter stopped flag */
  30. hw->adapter_stopped = false;
  31. return 0;
  32. }
  33. /**
  34. * ixgbevf_init_hw_vf - virtual function hardware initialization
  35. * @hw: pointer to hardware structure
  36. *
  37. * Initialize the hardware by resetting the hardware and then starting
  38. * the hardware
  39. **/
  40. static s32 ixgbevf_init_hw_vf(struct ixgbe_hw *hw)
  41. {
  42. s32 status = hw->mac.ops.start_hw(hw);
  43. hw->mac.ops.get_mac_addr(hw, hw->mac.addr);
  44. return status;
  45. }
  46. /**
  47. * ixgbevf_reset_hw_vf - Performs hardware reset
  48. * @hw: pointer to hardware structure
  49. *
  50. * Resets the hardware by resetting the transmit and receive units, masks and
  51. * clears all interrupts.
  52. **/
  53. static s32 ixgbevf_reset_hw_vf(struct ixgbe_hw *hw)
  54. {
  55. struct ixgbe_mbx_info *mbx = &hw->mbx;
  56. u32 timeout = IXGBE_VF_INIT_TIMEOUT;
  57. u32 msgbuf[IXGBE_VF_PERMADDR_MSG_LEN];
  58. u8 *addr = (u8 *)(&msgbuf[1]);
  59. s32 ret_val;
  60. /* Call adapter stop to disable tx/rx and clear interrupts */
  61. hw->mac.ops.stop_adapter(hw);
  62. /* reset the api version */
  63. hw->api_version = ixgbe_mbox_api_10;
  64. hw->mbx.ops.init_params(hw);
  65. memcpy(&hw->mbx.ops, &ixgbevf_mbx_ops_legacy,
  66. sizeof(struct ixgbe_mbx_operations));
  67. IXGBE_WRITE_REG(hw, IXGBE_VFCTRL, IXGBE_CTRL_RST);
  68. IXGBE_WRITE_FLUSH(hw);
  69. /* we cannot reset while the RSTI / RSTD bits are asserted */
  70. while (!mbx->ops.check_for_rst(hw) && timeout) {
  71. timeout--;
  72. udelay(5);
  73. }
  74. if (!timeout)
  75. return IXGBE_ERR_RESET_FAILED;
  76. /* mailbox timeout can now become active */
  77. mbx->timeout = IXGBE_VF_MBX_INIT_TIMEOUT;
  78. msgbuf[0] = IXGBE_VF_RESET;
  79. ixgbevf_write_mbx(hw, msgbuf, 1);
  80. mdelay(10);
  81. /* set our "perm_addr" based on info provided by PF
  82. * also set up the mc_filter_type which is piggy backed
  83. * on the mac address in word 3
  84. */
  85. ret_val = ixgbevf_poll_mbx(hw, msgbuf, IXGBE_VF_PERMADDR_MSG_LEN);
  86. if (ret_val)
  87. return ret_val;
  88. /* New versions of the PF may NACK the reset return message
  89. * to indicate that no MAC address has yet been assigned for
  90. * the VF.
  91. */
  92. if (msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_SUCCESS) &&
  93. msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_FAILURE))
  94. return IXGBE_ERR_INVALID_MAC_ADDR;
  95. if (msgbuf[0] == (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_SUCCESS))
  96. ether_addr_copy(hw->mac.perm_addr, addr);
  97. hw->mac.mc_filter_type = msgbuf[IXGBE_VF_MC_TYPE_WORD];
  98. return 0;
  99. }
  100. /**
  101. * ixgbevf_hv_reset_hw_vf - reset via Hyper-V
  102. * @hw: pointer to private hardware struct
  103. *
  104. * Hyper-V variant; the VF/PF communication is through the PCI
  105. * config space.
  106. */
  107. static s32 ixgbevf_hv_reset_hw_vf(struct ixgbe_hw *hw)
  108. {
  109. #if IS_ENABLED(CONFIG_PCI_MMCONFIG)
  110. struct ixgbevf_adapter *adapter = hw->back;
  111. int i;
  112. for (i = 0; i < 6; i++)
  113. pci_read_config_byte(adapter->pdev,
  114. (i + IXGBE_HV_RESET_OFFSET),
  115. &hw->mac.perm_addr[i]);
  116. return 0;
  117. #else
  118. pr_err("PCI_MMCONFIG needs to be enabled for Hyper-V\n");
  119. return -EOPNOTSUPP;
  120. #endif
  121. }
  122. /**
  123. * ixgbevf_stop_hw_vf - Generic stop Tx/Rx units
  124. * @hw: pointer to hardware structure
  125. *
  126. * Sets the adapter_stopped flag within ixgbe_hw struct. Clears interrupts,
  127. * disables transmit and receive units. The adapter_stopped flag is used by
  128. * the shared code and drivers to determine if the adapter is in a stopped
  129. * state and should not touch the hardware.
  130. **/
  131. static s32 ixgbevf_stop_hw_vf(struct ixgbe_hw *hw)
  132. {
  133. u32 number_of_queues;
  134. u32 reg_val;
  135. u16 i;
  136. /* Set the adapter_stopped flag so other driver functions stop touching
  137. * the hardware
  138. */
  139. hw->adapter_stopped = true;
  140. /* Disable the receive unit by stopped each queue */
  141. number_of_queues = hw->mac.max_rx_queues;
  142. for (i = 0; i < number_of_queues; i++) {
  143. reg_val = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i));
  144. if (reg_val & IXGBE_RXDCTL_ENABLE) {
  145. reg_val &= ~IXGBE_RXDCTL_ENABLE;
  146. IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), reg_val);
  147. }
  148. }
  149. IXGBE_WRITE_FLUSH(hw);
  150. /* Clear interrupt mask to stop from interrupts being generated */
  151. IXGBE_WRITE_REG(hw, IXGBE_VTEIMC, IXGBE_VF_IRQ_CLEAR_MASK);
  152. /* Clear any pending interrupts */
  153. IXGBE_READ_REG(hw, IXGBE_VTEICR);
  154. /* Disable the transmit unit. Each queue must be disabled. */
  155. number_of_queues = hw->mac.max_tx_queues;
  156. for (i = 0; i < number_of_queues; i++) {
  157. reg_val = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(i));
  158. if (reg_val & IXGBE_TXDCTL_ENABLE) {
  159. reg_val &= ~IXGBE_TXDCTL_ENABLE;
  160. IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(i), reg_val);
  161. }
  162. }
  163. return 0;
  164. }
  165. /**
  166. * ixgbevf_mta_vector - Determines bit-vector in multicast table to set
  167. * @hw: pointer to hardware structure
  168. * @mc_addr: the multicast address
  169. *
  170. * Extracts the 12 bits, from a multicast address, to determine which
  171. * bit-vector to set in the multicast table. The hardware uses 12 bits, from
  172. * incoming Rx multicast addresses, to determine the bit-vector to check in
  173. * the MTA. Which of the 4 combination, of 12-bits, the hardware uses is set
  174. * by the MO field of the MCSTCTRL. The MO field is set during initialization
  175. * to mc_filter_type.
  176. **/
  177. static s32 ixgbevf_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr)
  178. {
  179. u32 vector = 0;
  180. switch (hw->mac.mc_filter_type) {
  181. case 0: /* use bits [47:36] of the address */
  182. vector = ((mc_addr[4] >> 4) | (((u16)mc_addr[5]) << 4));
  183. break;
  184. case 1: /* use bits [46:35] of the address */
  185. vector = ((mc_addr[4] >> 3) | (((u16)mc_addr[5]) << 5));
  186. break;
  187. case 2: /* use bits [45:34] of the address */
  188. vector = ((mc_addr[4] >> 2) | (((u16)mc_addr[5]) << 6));
  189. break;
  190. case 3: /* use bits [43:32] of the address */
  191. vector = ((mc_addr[4]) | (((u16)mc_addr[5]) << 8));
  192. break;
  193. default: /* Invalid mc_filter_type */
  194. break;
  195. }
  196. /* vector can only be 12-bits or boundary will be exceeded */
  197. vector &= 0xFFF;
  198. return vector;
  199. }
  200. /**
  201. * ixgbevf_get_mac_addr_vf - Read device MAC address
  202. * @hw: pointer to the HW structure
  203. * @mac_addr: pointer to storage for retrieved MAC address
  204. **/
  205. static s32 ixgbevf_get_mac_addr_vf(struct ixgbe_hw *hw, u8 *mac_addr)
  206. {
  207. ether_addr_copy(mac_addr, hw->mac.perm_addr);
  208. return 0;
  209. }
  210. static s32 ixgbevf_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr)
  211. {
  212. u32 msgbuf[3], msgbuf_chk;
  213. u8 *msg_addr = (u8 *)(&msgbuf[1]);
  214. s32 ret_val;
  215. memset(msgbuf, 0, sizeof(msgbuf));
  216. /* If index is one then this is the start of a new list and needs
  217. * indication to the PF so it can do it's own list management.
  218. * If it is zero then that tells the PF to just clear all of
  219. * this VF's macvlans and there is no new list.
  220. */
  221. msgbuf[0] |= index << IXGBE_VT_MSGINFO_SHIFT;
  222. msgbuf[0] |= IXGBE_VF_SET_MACVLAN;
  223. msgbuf_chk = msgbuf[0];
  224. if (addr)
  225. ether_addr_copy(msg_addr, addr);
  226. ret_val = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf,
  227. ARRAY_SIZE(msgbuf));
  228. if (!ret_val) {
  229. msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS;
  230. if (msgbuf[0] == (msgbuf_chk | IXGBE_VT_MSGTYPE_FAILURE))
  231. return -ENOMEM;
  232. }
  233. return ret_val;
  234. }
  235. static s32 ixgbevf_hv_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr)
  236. {
  237. return -EOPNOTSUPP;
  238. }
  239. /**
  240. * ixgbevf_get_reta_locked - get the RSS redirection table (RETA) contents.
  241. * @hw: pointer to hardware structure
  242. * @reta: buffer to fill with RETA contents.
  243. * @num_rx_queues: Number of Rx queues configured for this port
  244. *
  245. * The "reta" buffer should be big enough to contain 32 registers.
  246. *
  247. * Returns: 0 on success.
  248. * if API doesn't support this operation - (-EOPNOTSUPP).
  249. */
  250. int ixgbevf_get_reta_locked(struct ixgbe_hw *hw, u32 *reta, int num_rx_queues)
  251. {
  252. int err, i, j;
  253. u32 msgbuf[IXGBE_VFMAILBOX_SIZE];
  254. u32 *hw_reta = &msgbuf[1];
  255. u32 mask = 0;
  256. /* We have to use a mailbox for 82599 and x540 devices only.
  257. * For these devices RETA has 128 entries.
  258. * Also these VFs support up to 4 RSS queues. Therefore PF will compress
  259. * 16 RETA entries in each DWORD giving 2 bits to each entry.
  260. */
  261. int dwords = IXGBEVF_82599_RETA_SIZE / 16;
  262. /* We support the RSS querying for 82599 and x540 devices only.
  263. * Thus return an error if API doesn't support RETA querying or querying
  264. * is not supported for this device type.
  265. */
  266. switch (hw->api_version) {
  267. case ixgbe_mbox_api_17:
  268. case ixgbe_mbox_api_16:
  269. case ixgbe_mbox_api_15:
  270. case ixgbe_mbox_api_14:
  271. case ixgbe_mbox_api_13:
  272. case ixgbe_mbox_api_12:
  273. if (hw->mac.type < ixgbe_mac_X550_vf)
  274. break;
  275. fallthrough;
  276. default:
  277. return -EOPNOTSUPP;
  278. }
  279. msgbuf[0] = IXGBE_VF_GET_RETA;
  280. err = ixgbevf_write_mbx(hw, msgbuf, 1);
  281. if (err)
  282. return err;
  283. err = ixgbevf_poll_mbx(hw, msgbuf, dwords + 1);
  284. if (err)
  285. return err;
  286. msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS;
  287. /* If the operation has been refused by a PF return -EPERM */
  288. if (msgbuf[0] == (IXGBE_VF_GET_RETA | IXGBE_VT_MSGTYPE_FAILURE))
  289. return -EPERM;
  290. /* If we didn't get an ACK there must have been
  291. * some sort of mailbox error so we should treat it
  292. * as such.
  293. */
  294. if (msgbuf[0] != (IXGBE_VF_GET_RETA | IXGBE_VT_MSGTYPE_SUCCESS))
  295. return IXGBE_ERR_MBX;
  296. /* ixgbevf doesn't support more than 2 queues at the moment */
  297. if (num_rx_queues > 1)
  298. mask = 0x1;
  299. for (i = 0; i < dwords; i++)
  300. for (j = 0; j < 16; j++)
  301. reta[i * 16 + j] = (hw_reta[i] >> (2 * j)) & mask;
  302. return 0;
  303. }
  304. /**
  305. * ixgbevf_get_rss_key_locked - get the RSS Random Key
  306. * @hw: pointer to the HW structure
  307. * @rss_key: buffer to fill with RSS Hash Key contents.
  308. *
  309. * The "rss_key" buffer should be big enough to contain 10 registers.
  310. *
  311. * Returns: 0 on success.
  312. * if API doesn't support this operation - (-EOPNOTSUPP).
  313. */
  314. int ixgbevf_get_rss_key_locked(struct ixgbe_hw *hw, u8 *rss_key)
  315. {
  316. int err;
  317. u32 msgbuf[IXGBE_VFMAILBOX_SIZE];
  318. /* We currently support the RSS Random Key retrieval for 82599 and x540
  319. * devices only.
  320. *
  321. * Thus return an error if API doesn't support RSS Random Key retrieval
  322. * or if the operation is not supported for this device type.
  323. */
  324. switch (hw->api_version) {
  325. case ixgbe_mbox_api_17:
  326. case ixgbe_mbox_api_16:
  327. case ixgbe_mbox_api_15:
  328. case ixgbe_mbox_api_14:
  329. case ixgbe_mbox_api_13:
  330. case ixgbe_mbox_api_12:
  331. if (hw->mac.type < ixgbe_mac_X550_vf)
  332. break;
  333. fallthrough;
  334. default:
  335. return -EOPNOTSUPP;
  336. }
  337. msgbuf[0] = IXGBE_VF_GET_RSS_KEY;
  338. err = ixgbevf_write_mbx(hw, msgbuf, 1);
  339. if (err)
  340. return err;
  341. err = ixgbevf_poll_mbx(hw, msgbuf, 11);
  342. if (err)
  343. return err;
  344. msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS;
  345. /* If the operation has been refused by a PF return -EPERM */
  346. if (msgbuf[0] == (IXGBE_VF_GET_RSS_KEY | IXGBE_VT_MSGTYPE_FAILURE))
  347. return -EPERM;
  348. /* If we didn't get an ACK there must have been
  349. * some sort of mailbox error so we should treat it
  350. * as such.
  351. */
  352. if (msgbuf[0] != (IXGBE_VF_GET_RSS_KEY | IXGBE_VT_MSGTYPE_SUCCESS))
  353. return IXGBE_ERR_MBX;
  354. memcpy(rss_key, msgbuf + 1, IXGBEVF_RSS_HASH_KEY_SIZE);
  355. return 0;
  356. }
  357. /**
  358. * ixgbevf_set_rar_vf - set device MAC address
  359. * @hw: pointer to hardware structure
  360. * @index: Receive address register to write
  361. * @addr: Address to put into receive address register
  362. * @vmdq: Unused in this implementation
  363. **/
  364. static s32 ixgbevf_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr,
  365. u32 vmdq)
  366. {
  367. u32 msgbuf[3];
  368. u8 *msg_addr = (u8 *)(&msgbuf[1]);
  369. s32 ret_val;
  370. memset(msgbuf, 0, sizeof(msgbuf));
  371. msgbuf[0] = IXGBE_VF_SET_MAC_ADDR;
  372. ether_addr_copy(msg_addr, addr);
  373. ret_val = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf,
  374. ARRAY_SIZE(msgbuf));
  375. msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS;
  376. /* if nacked the address was rejected, use "perm_addr" */
  377. if (!ret_val &&
  378. (msgbuf[0] == (IXGBE_VF_SET_MAC_ADDR | IXGBE_VT_MSGTYPE_FAILURE))) {
  379. ixgbevf_get_mac_addr_vf(hw, hw->mac.addr);
  380. return IXGBE_ERR_MBX;
  381. }
  382. return ret_val;
  383. }
  384. /**
  385. * ixgbevf_hv_set_rar_vf - set device MAC address Hyper-V variant
  386. * @hw: pointer to hardware structure
  387. * @index: Receive address register to write
  388. * @addr: Address to put into receive address register
  389. * @vmdq: Unused in this implementation
  390. *
  391. * We don't really allow setting the device MAC address. However,
  392. * if the address being set is the permanent MAC address we will
  393. * permit that.
  394. **/
  395. static s32 ixgbevf_hv_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr,
  396. u32 vmdq)
  397. {
  398. if (ether_addr_equal(addr, hw->mac.perm_addr))
  399. return 0;
  400. return -EOPNOTSUPP;
  401. }
  402. /**
  403. * ixgbevf_update_mc_addr_list_vf - Update Multicast addresses
  404. * @hw: pointer to the HW structure
  405. * @netdev: pointer to net device structure
  406. *
  407. * Updates the Multicast Table Array.
  408. **/
  409. static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw,
  410. struct net_device *netdev)
  411. {
  412. struct netdev_hw_addr *ha;
  413. u32 msgbuf[IXGBE_VFMAILBOX_SIZE];
  414. u16 *vector_list = (u16 *)&msgbuf[1];
  415. u32 cnt, i;
  416. /* Each entry in the list uses 1 16 bit word. We have 30
  417. * 16 bit words available in our HW msg buffer (minus 1 for the
  418. * msg type). That's 30 hash values if we pack 'em right. If
  419. * there are more than 30 MC addresses to add then punt the
  420. * extras for now and then add code to handle more than 30 later.
  421. * It would be unusual for a server to request that many multi-cast
  422. * addresses except for in large enterprise network environments.
  423. */
  424. cnt = netdev_mc_count(netdev);
  425. if (cnt > 30)
  426. cnt = 30;
  427. msgbuf[0] = IXGBE_VF_SET_MULTICAST;
  428. msgbuf[0] |= cnt << IXGBE_VT_MSGINFO_SHIFT;
  429. i = 0;
  430. netdev_for_each_mc_addr(ha, netdev) {
  431. if (i == cnt)
  432. break;
  433. if (is_link_local_ether_addr(ha->addr))
  434. continue;
  435. vector_list[i++] = ixgbevf_mta_vector(hw, ha->addr);
  436. }
  437. return ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf,
  438. IXGBE_VFMAILBOX_SIZE);
  439. }
  440. /**
  441. * ixgbevf_hv_update_mc_addr_list_vf - stub
  442. * @hw: unused
  443. * @netdev: unused
  444. *
  445. * Hyper-V variant - just a stub.
  446. */
  447. static s32 ixgbevf_hv_update_mc_addr_list_vf(struct ixgbe_hw *hw,
  448. struct net_device *netdev)
  449. {
  450. return -EOPNOTSUPP;
  451. }
  452. /**
  453. * ixgbevf_update_xcast_mode - Update Multicast mode
  454. * @hw: pointer to the HW structure
  455. * @xcast_mode: new multicast mode
  456. *
  457. * Updates the Multicast Mode of VF.
  458. **/
  459. static s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode)
  460. {
  461. u32 msgbuf[2];
  462. s32 err;
  463. switch (hw->api_version) {
  464. case ixgbe_mbox_api_12:
  465. /* promisc introduced in 1.3 version */
  466. if (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC)
  467. return -EOPNOTSUPP;
  468. fallthrough;
  469. case ixgbe_mbox_api_13:
  470. case ixgbe_mbox_api_14:
  471. case ixgbe_mbox_api_15:
  472. case ixgbe_mbox_api_16:
  473. case ixgbe_mbox_api_17:
  474. break;
  475. default:
  476. return -EOPNOTSUPP;
  477. }
  478. msgbuf[0] = IXGBE_VF_UPDATE_XCAST_MODE;
  479. msgbuf[1] = xcast_mode;
  480. err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf,
  481. ARRAY_SIZE(msgbuf));
  482. if (err)
  483. return err;
  484. msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS;
  485. if (msgbuf[0] == (IXGBE_VF_UPDATE_XCAST_MODE | IXGBE_VT_MSGTYPE_FAILURE))
  486. return -EPERM;
  487. return 0;
  488. }
  489. /**
  490. * ixgbevf_hv_update_xcast_mode - stub
  491. * @hw: unused
  492. * @xcast_mode: unused
  493. *
  494. * Hyper-V variant - just a stub.
  495. */
  496. static s32 ixgbevf_hv_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode)
  497. {
  498. return -EOPNOTSUPP;
  499. }
  500. /**
  501. * ixgbevf_get_link_state_vf - Get VF link state from PF
  502. * @hw: pointer to the HW structure
  503. * @link_state: link state storage
  504. *
  505. * Returns state of the operation error or success.
  506. */
  507. static s32 ixgbevf_get_link_state_vf(struct ixgbe_hw *hw, bool *link_state)
  508. {
  509. u32 msgbuf[2];
  510. s32 ret_val;
  511. s32 err;
  512. msgbuf[0] = IXGBE_VF_GET_LINK_STATE;
  513. msgbuf[1] = 0x0;
  514. err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 2);
  515. if (err || (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE)) {
  516. ret_val = IXGBE_ERR_MBX;
  517. } else {
  518. ret_val = 0;
  519. *link_state = msgbuf[1];
  520. }
  521. return ret_val;
  522. }
  523. /**
  524. * ixgbevf_hv_get_link_state_vf - * Hyper-V variant - just a stub.
  525. * @hw: unused
  526. * @link_state: unused
  527. *
  528. * Hyper-V variant; there is no mailbox communication.
  529. */
  530. static s32 ixgbevf_hv_get_link_state_vf(struct ixgbe_hw *hw, bool *link_state)
  531. {
  532. return -EOPNOTSUPP;
  533. }
  534. /**
  535. * ixgbevf_get_pf_link_state - Get PF's link status
  536. * @hw: pointer to the HW structure
  537. * @speed: link speed
  538. * @link_up: indicate if link is up/down
  539. *
  540. * Ask PF to provide link_up state and speed of the link.
  541. *
  542. * Return: IXGBE_ERR_MBX in the case of mailbox error,
  543. * -EOPNOTSUPP if the op is not supported or 0 on success.
  544. */
  545. static int ixgbevf_get_pf_link_state(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
  546. bool *link_up)
  547. {
  548. u32 msgbuf[3] = {};
  549. int err;
  550. switch (hw->api_version) {
  551. case ixgbe_mbox_api_16:
  552. case ixgbe_mbox_api_17:
  553. break;
  554. default:
  555. return -EOPNOTSUPP;
  556. }
  557. msgbuf[0] = IXGBE_VF_GET_PF_LINK_STATE;
  558. err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf,
  559. ARRAY_SIZE(msgbuf));
  560. if (err || (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE)) {
  561. err = IXGBE_ERR_MBX;
  562. *speed = IXGBE_LINK_SPEED_UNKNOWN;
  563. /* No need to set @link_up to false as it will be done by
  564. * ixgbe_check_mac_link_vf().
  565. */
  566. } else {
  567. *speed = msgbuf[1];
  568. *link_up = msgbuf[2];
  569. }
  570. return err;
  571. }
  572. /**
  573. * ixgbevf_negotiate_features_vf - negotiate supported features with PF driver
  574. * @hw: pointer to the HW structure
  575. * @pf_features: bitmask of features supported by PF
  576. *
  577. * Return: IXGBE_ERR_MBX in the case of mailbox error,
  578. * -EOPNOTSUPP if the op is not supported or 0 on success.
  579. */
  580. static int ixgbevf_negotiate_features_vf(struct ixgbe_hw *hw, u32 *pf_features)
  581. {
  582. u32 msgbuf[2] = {};
  583. int err;
  584. switch (hw->api_version) {
  585. case ixgbe_mbox_api_17:
  586. break;
  587. default:
  588. return -EOPNOTSUPP;
  589. }
  590. msgbuf[0] = IXGBE_VF_FEATURES_NEGOTIATE;
  591. msgbuf[1] = IXGBEVF_SUPPORTED_FEATURES;
  592. err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf,
  593. ARRAY_SIZE(msgbuf));
  594. if (err || (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE)) {
  595. err = IXGBE_ERR_MBX;
  596. *pf_features = 0x0;
  597. } else {
  598. *pf_features = msgbuf[1];
  599. }
  600. return err;
  601. }
  602. /**
  603. * ixgbevf_set_vfta_vf - Set/Unset VLAN filter table address
  604. * @hw: pointer to the HW structure
  605. * @vlan: 12 bit VLAN ID
  606. * @vind: unused by VF drivers
  607. * @vlan_on: if true then set bit, else clear bit
  608. **/
  609. static s32 ixgbevf_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind,
  610. bool vlan_on)
  611. {
  612. u32 msgbuf[2];
  613. s32 err;
  614. msgbuf[0] = IXGBE_VF_SET_VLAN;
  615. msgbuf[1] = vlan;
  616. /* Setting the 8 bit field MSG INFO to TRUE indicates "add" */
  617. msgbuf[0] |= vlan_on << IXGBE_VT_MSGINFO_SHIFT;
  618. err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf,
  619. ARRAY_SIZE(msgbuf));
  620. if (err)
  621. goto mbx_err;
  622. /* remove extra bits from the message */
  623. msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS;
  624. msgbuf[0] &= ~(0xFF << IXGBE_VT_MSGINFO_SHIFT);
  625. if (msgbuf[0] != (IXGBE_VF_SET_VLAN | IXGBE_VT_MSGTYPE_SUCCESS))
  626. err = IXGBE_ERR_INVALID_ARGUMENT;
  627. mbx_err:
  628. return err;
  629. }
  630. /**
  631. * ixgbe_read_vflinks - Read VFLINKS register
  632. * @hw: pointer to the HW structure
  633. * @speed: link speed
  634. * @link_up: indicate if link is up/down
  635. *
  636. * Get linkup status and link speed from the VFLINKS register.
  637. */
  638. static void ixgbe_read_vflinks(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
  639. bool *link_up)
  640. {
  641. u32 vflinks = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
  642. /* if link status is down no point in checking to see if PF is up */
  643. if (!(vflinks & IXGBE_LINKS_UP)) {
  644. *link_up = false;
  645. return;
  646. }
  647. /* for SFP+ modules and DA cables on 82599 it can take up to 500usecs
  648. * before the link status is correct
  649. */
  650. if (hw->mac.type == ixgbe_mac_82599_vf) {
  651. for (int i = 0; i < 5; i++) {
  652. udelay(100);
  653. vflinks = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
  654. if (!(vflinks & IXGBE_LINKS_UP)) {
  655. *link_up = false;
  656. return;
  657. }
  658. }
  659. }
  660. /* We reached this point so there's link */
  661. *link_up = true;
  662. switch (vflinks & IXGBE_LINKS_SPEED_82599) {
  663. case IXGBE_LINKS_SPEED_10G_82599:
  664. *speed = IXGBE_LINK_SPEED_10GB_FULL;
  665. break;
  666. case IXGBE_LINKS_SPEED_1G_82599:
  667. *speed = IXGBE_LINK_SPEED_1GB_FULL;
  668. break;
  669. case IXGBE_LINKS_SPEED_100_82599:
  670. *speed = IXGBE_LINK_SPEED_100_FULL;
  671. break;
  672. default:
  673. *speed = IXGBE_LINK_SPEED_UNKNOWN;
  674. }
  675. }
  676. /**
  677. * ixgbevf_hv_set_vfta_vf - * Hyper-V variant - just a stub.
  678. * @hw: unused
  679. * @vlan: unused
  680. * @vind: unused
  681. * @vlan_on: unused
  682. */
  683. static s32 ixgbevf_hv_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind,
  684. bool vlan_on)
  685. {
  686. return -EOPNOTSUPP;
  687. }
  688. /**
  689. * ixgbevf_setup_mac_link_vf - Setup MAC link settings
  690. * @hw: pointer to hardware structure
  691. * @speed: Unused in this implementation
  692. * @autoneg: Unused in this implementation
  693. * @autoneg_wait_to_complete: Unused in this implementation
  694. *
  695. * Do nothing and return success. VF drivers are not allowed to change
  696. * global settings. Maintained for driver compatibility.
  697. **/
  698. static s32 ixgbevf_setup_mac_link_vf(struct ixgbe_hw *hw,
  699. ixgbe_link_speed speed, bool autoneg,
  700. bool autoneg_wait_to_complete)
  701. {
  702. return 0;
  703. }
  704. /**
  705. * ixgbevf_check_mac_link_vf - Get link/speed status
  706. * @hw: pointer to hardware structure
  707. * @speed: pointer to link speed
  708. * @link_up: true is link is up, false otherwise
  709. * @autoneg_wait_to_complete: unused
  710. *
  711. * Reads the links register to determine if link is up and the current speed
  712. **/
  713. static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
  714. ixgbe_link_speed *speed,
  715. bool *link_up,
  716. bool autoneg_wait_to_complete)
  717. {
  718. struct ixgbevf_adapter *adapter = hw->back;
  719. struct ixgbe_mbx_info *mbx = &hw->mbx;
  720. struct ixgbe_mac_info *mac = &hw->mac;
  721. s32 ret_val = 0;
  722. u32 in_msg = 0;
  723. /* If we were hit with a reset drop the link */
  724. if (!mbx->ops.check_for_rst(hw) || !mbx->timeout)
  725. mac->get_link_status = true;
  726. if (!mac->get_link_status)
  727. goto out;
  728. if (hw->mac.type == ixgbe_mac_e610_vf) {
  729. ret_val = ixgbevf_get_pf_link_state(hw, speed, link_up);
  730. if (ret_val)
  731. goto out;
  732. } else {
  733. ixgbe_read_vflinks(hw, speed, link_up);
  734. if (*link_up == false)
  735. goto out;
  736. }
  737. /* if the read failed it could just be a mailbox collision, best wait
  738. * until we are called again and don't report an error
  739. */
  740. if (mbx->ops.read(hw, &in_msg, 1)) {
  741. if (adapter->pf_features & IXGBEVF_PF_SUP_ESX_MBX)
  742. mac->get_link_status = false;
  743. goto out;
  744. }
  745. if (!(in_msg & IXGBE_VT_MSGTYPE_CTS)) {
  746. /* msg is not CTS and is NACK we must have lost CTS status */
  747. if (in_msg & IXGBE_VT_MSGTYPE_FAILURE)
  748. ret_val = -1;
  749. goto out;
  750. }
  751. /* the pf is talking, if we timed out in the past we reinit */
  752. if (!mbx->timeout) {
  753. ret_val = -1;
  754. goto out;
  755. }
  756. /* if we passed all the tests above then the link is up and we no
  757. * longer need to check for link
  758. */
  759. mac->get_link_status = false;
  760. out:
  761. *link_up = !mac->get_link_status;
  762. return ret_val;
  763. }
  764. /**
  765. * ixgbevf_hv_check_mac_link_vf - check link
  766. * @hw: pointer to private hardware struct
  767. * @speed: pointer to link speed
  768. * @link_up: true is link is up, false otherwise
  769. * @autoneg_wait_to_complete: unused
  770. *
  771. * Hyper-V variant; there is no mailbox communication.
  772. */
  773. static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw,
  774. ixgbe_link_speed *speed,
  775. bool *link_up,
  776. bool autoneg_wait_to_complete)
  777. {
  778. struct ixgbe_mbx_info *mbx = &hw->mbx;
  779. struct ixgbe_mac_info *mac = &hw->mac;
  780. u32 links_reg;
  781. /* If we were hit with a reset drop the link */
  782. if (!mbx->ops.check_for_rst(hw) || !mbx->timeout)
  783. mac->get_link_status = true;
  784. if (!mac->get_link_status)
  785. goto out;
  786. /* if link status is down no point in checking to see if pf is up */
  787. links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
  788. if (!(links_reg & IXGBE_LINKS_UP))
  789. goto out;
  790. /* for SFP+ modules and DA cables on 82599 it can take up to 500usecs
  791. * before the link status is correct
  792. */
  793. if (mac->type == ixgbe_mac_82599_vf) {
  794. int i;
  795. for (i = 0; i < 5; i++) {
  796. udelay(100);
  797. links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
  798. if (!(links_reg & IXGBE_LINKS_UP))
  799. goto out;
  800. }
  801. }
  802. switch (links_reg & IXGBE_LINKS_SPEED_82599) {
  803. case IXGBE_LINKS_SPEED_10G_82599:
  804. *speed = IXGBE_LINK_SPEED_10GB_FULL;
  805. break;
  806. case IXGBE_LINKS_SPEED_1G_82599:
  807. *speed = IXGBE_LINK_SPEED_1GB_FULL;
  808. break;
  809. case IXGBE_LINKS_SPEED_100_82599:
  810. *speed = IXGBE_LINK_SPEED_100_FULL;
  811. break;
  812. }
  813. /* if we passed all the tests above then the link is up and we no
  814. * longer need to check for link
  815. */
  816. mac->get_link_status = false;
  817. out:
  818. *link_up = !mac->get_link_status;
  819. return 0;
  820. }
  821. /**
  822. * ixgbevf_set_rlpml_vf - Set the maximum receive packet length
  823. * @hw: pointer to the HW structure
  824. * @max_size: value to assign to max frame size
  825. **/
  826. static s32 ixgbevf_set_rlpml_vf(struct ixgbe_hw *hw, u16 max_size)
  827. {
  828. u32 msgbuf[2];
  829. s32 ret_val;
  830. msgbuf[0] = IXGBE_VF_SET_LPE;
  831. msgbuf[1] = max_size;
  832. ret_val = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf,
  833. ARRAY_SIZE(msgbuf));
  834. if (ret_val)
  835. return ret_val;
  836. if ((msgbuf[0] & IXGBE_VF_SET_LPE) &&
  837. (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE))
  838. return IXGBE_ERR_MBX;
  839. return 0;
  840. }
  841. /**
  842. * ixgbevf_hv_set_rlpml_vf - Set the maximum receive packet length
  843. * @hw: pointer to the HW structure
  844. * @max_size: value to assign to max frame size
  845. * Hyper-V variant.
  846. **/
  847. static s32 ixgbevf_hv_set_rlpml_vf(struct ixgbe_hw *hw, u16 max_size)
  848. {
  849. u32 reg;
  850. /* If we are on Hyper-V, we implement this functionality
  851. * differently.
  852. */
  853. reg = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(0));
  854. /* CRC == 4 */
  855. reg |= ((max_size + 4) | IXGBE_RXDCTL_RLPML_EN);
  856. IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(0), reg);
  857. return 0;
  858. }
  859. /**
  860. * ixgbevf_negotiate_api_version_vf - Negotiate supported API version
  861. * @hw: pointer to the HW structure
  862. * @api: integer containing requested API version
  863. **/
  864. static int ixgbevf_negotiate_api_version_vf(struct ixgbe_hw *hw, int api)
  865. {
  866. int err;
  867. u32 msg[3];
  868. /* Negotiate the mailbox API version */
  869. msg[0] = IXGBE_VF_API_NEGOTIATE;
  870. msg[1] = api;
  871. msg[2] = 0;
  872. err = ixgbevf_write_msg_read_ack(hw, msg, msg, ARRAY_SIZE(msg));
  873. if (!err) {
  874. msg[0] &= ~IXGBE_VT_MSGTYPE_CTS;
  875. /* Store value and return 0 on success */
  876. if (msg[0] == (IXGBE_VF_API_NEGOTIATE |
  877. IXGBE_VT_MSGTYPE_SUCCESS)) {
  878. hw->api_version = api;
  879. return 0;
  880. }
  881. err = IXGBE_ERR_INVALID_ARGUMENT;
  882. }
  883. return err;
  884. }
  885. /**
  886. * ixgbevf_hv_negotiate_api_version_vf - Negotiate supported API version
  887. * @hw: pointer to the HW structure
  888. * @api: integer containing requested API version
  889. * Hyper-V version - only ixgbe_mbox_api_10 supported.
  890. **/
  891. static int ixgbevf_hv_negotiate_api_version_vf(struct ixgbe_hw *hw, int api)
  892. {
  893. /* Hyper-V only supports api version ixgbe_mbox_api_10 */
  894. if (api != ixgbe_mbox_api_10)
  895. return IXGBE_ERR_INVALID_ARGUMENT;
  896. return 0;
  897. }
  898. int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,
  899. unsigned int *default_tc)
  900. {
  901. int err;
  902. u32 msg[5];
  903. /* do nothing if API doesn't support ixgbevf_get_queues */
  904. switch (hw->api_version) {
  905. case ixgbe_mbox_api_11:
  906. case ixgbe_mbox_api_12:
  907. case ixgbe_mbox_api_13:
  908. case ixgbe_mbox_api_14:
  909. case ixgbe_mbox_api_15:
  910. case ixgbe_mbox_api_16:
  911. case ixgbe_mbox_api_17:
  912. break;
  913. default:
  914. return 0;
  915. }
  916. /* Fetch queue configuration from the PF */
  917. msg[0] = IXGBE_VF_GET_QUEUE;
  918. msg[1] = msg[2] = msg[3] = msg[4] = 0;
  919. err = ixgbevf_write_msg_read_ack(hw, msg, msg, ARRAY_SIZE(msg));
  920. if (!err) {
  921. msg[0] &= ~IXGBE_VT_MSGTYPE_CTS;
  922. /* if we didn't get an ACK there must have been
  923. * some sort of mailbox error so we should treat it
  924. * as such
  925. */
  926. if (msg[0] != (IXGBE_VF_GET_QUEUE | IXGBE_VT_MSGTYPE_SUCCESS))
  927. return IXGBE_ERR_MBX;
  928. /* record and validate values from message */
  929. hw->mac.max_tx_queues = msg[IXGBE_VF_TX_QUEUES];
  930. if (hw->mac.max_tx_queues == 0 ||
  931. hw->mac.max_tx_queues > IXGBE_VF_MAX_TX_QUEUES)
  932. hw->mac.max_tx_queues = IXGBE_VF_MAX_TX_QUEUES;
  933. hw->mac.max_rx_queues = msg[IXGBE_VF_RX_QUEUES];
  934. if (hw->mac.max_rx_queues == 0 ||
  935. hw->mac.max_rx_queues > IXGBE_VF_MAX_RX_QUEUES)
  936. hw->mac.max_rx_queues = IXGBE_VF_MAX_RX_QUEUES;
  937. *num_tcs = msg[IXGBE_VF_TRANS_VLAN];
  938. /* in case of unknown state assume we cannot tag frames */
  939. if (*num_tcs > hw->mac.max_rx_queues)
  940. *num_tcs = 1;
  941. *default_tc = msg[IXGBE_VF_DEF_QUEUE];
  942. /* default to queue 0 on out-of-bounds queue number */
  943. if (*default_tc >= hw->mac.max_tx_queues)
  944. *default_tc = 0;
  945. }
  946. return err;
  947. }
  948. static const struct ixgbe_mac_operations ixgbevf_mac_ops = {
  949. .init_hw = ixgbevf_init_hw_vf,
  950. .reset_hw = ixgbevf_reset_hw_vf,
  951. .start_hw = ixgbevf_start_hw_vf,
  952. .get_mac_addr = ixgbevf_get_mac_addr_vf,
  953. .stop_adapter = ixgbevf_stop_hw_vf,
  954. .setup_link = ixgbevf_setup_mac_link_vf,
  955. .check_link = ixgbevf_check_mac_link_vf,
  956. .negotiate_api_version = ixgbevf_negotiate_api_version_vf,
  957. .negotiate_features = ixgbevf_negotiate_features_vf,
  958. .set_rar = ixgbevf_set_rar_vf,
  959. .update_mc_addr_list = ixgbevf_update_mc_addr_list_vf,
  960. .update_xcast_mode = ixgbevf_update_xcast_mode,
  961. .get_link_state = ixgbevf_get_link_state_vf,
  962. .set_uc_addr = ixgbevf_set_uc_addr_vf,
  963. .set_vfta = ixgbevf_set_vfta_vf,
  964. .set_rlpml = ixgbevf_set_rlpml_vf,
  965. };
  966. static const struct ixgbe_mac_operations ixgbevf_hv_mac_ops = {
  967. .init_hw = ixgbevf_init_hw_vf,
  968. .reset_hw = ixgbevf_hv_reset_hw_vf,
  969. .start_hw = ixgbevf_start_hw_vf,
  970. .get_mac_addr = ixgbevf_get_mac_addr_vf,
  971. .stop_adapter = ixgbevf_stop_hw_vf,
  972. .setup_link = ixgbevf_setup_mac_link_vf,
  973. .check_link = ixgbevf_hv_check_mac_link_vf,
  974. .negotiate_api_version = ixgbevf_hv_negotiate_api_version_vf,
  975. .set_rar = ixgbevf_hv_set_rar_vf,
  976. .update_mc_addr_list = ixgbevf_hv_update_mc_addr_list_vf,
  977. .update_xcast_mode = ixgbevf_hv_update_xcast_mode,
  978. .get_link_state = ixgbevf_hv_get_link_state_vf,
  979. .set_uc_addr = ixgbevf_hv_set_uc_addr_vf,
  980. .set_vfta = ixgbevf_hv_set_vfta_vf,
  981. .set_rlpml = ixgbevf_hv_set_rlpml_vf,
  982. };
  983. const struct ixgbevf_info ixgbevf_82599_vf_info = {
  984. .mac = ixgbe_mac_82599_vf,
  985. .mac_ops = &ixgbevf_mac_ops,
  986. };
  987. const struct ixgbevf_info ixgbevf_82599_vf_hv_info = {
  988. .mac = ixgbe_mac_82599_vf,
  989. .mac_ops = &ixgbevf_hv_mac_ops,
  990. };
  991. const struct ixgbevf_info ixgbevf_X540_vf_info = {
  992. .mac = ixgbe_mac_X540_vf,
  993. .mac_ops = &ixgbevf_mac_ops,
  994. };
  995. const struct ixgbevf_info ixgbevf_X540_vf_hv_info = {
  996. .mac = ixgbe_mac_X540_vf,
  997. .mac_ops = &ixgbevf_hv_mac_ops,
  998. };
  999. const struct ixgbevf_info ixgbevf_X550_vf_info = {
  1000. .mac = ixgbe_mac_X550_vf,
  1001. .mac_ops = &ixgbevf_mac_ops,
  1002. };
  1003. const struct ixgbevf_info ixgbevf_X550_vf_hv_info = {
  1004. .mac = ixgbe_mac_X550_vf,
  1005. .mac_ops = &ixgbevf_hv_mac_ops,
  1006. };
  1007. const struct ixgbevf_info ixgbevf_X550EM_x_vf_info = {
  1008. .mac = ixgbe_mac_X550EM_x_vf,
  1009. .mac_ops = &ixgbevf_mac_ops,
  1010. };
  1011. const struct ixgbevf_info ixgbevf_X550EM_x_vf_hv_info = {
  1012. .mac = ixgbe_mac_X550EM_x_vf,
  1013. .mac_ops = &ixgbevf_hv_mac_ops,
  1014. };
  1015. const struct ixgbevf_info ixgbevf_x550em_a_vf_info = {
  1016. .mac = ixgbe_mac_x550em_a_vf,
  1017. .mac_ops = &ixgbevf_mac_ops,
  1018. };
  1019. const struct ixgbevf_info ixgbevf_e610_vf_info = {
  1020. .mac = ixgbe_mac_e610_vf,
  1021. .mac_ops = &ixgbevf_mac_ops,
  1022. };
  1023. const struct ixgbevf_info ixgbevf_e610_vf_hv_info = {
  1024. .mac = ixgbe_mac_e610_vf,
  1025. .mac_ops = &ixgbevf_hv_mac_ops,
  1026. };