On 1/22/2021 9:47 AM, Jiawen Wu wrote:
Implement VF device init and uninit function with hardware operations,
and negotiate with PF in mailbox.

Signed-off-by: Jiawen Wu <jiawe...@trustnetic.com>

<...>

+int txgbevf_get_queues(struct txgbe_hw *hw, unsigned int *num_tcs,
+                      unsigned int *default_tc)
+{
+       int err, i;
+       u32 msg[5];
+
+       /* do nothing if API doesn't support txgbevf_get_queues */
+       switch (hw->api_version) {
+       case txgbe_mbox_api_11:
+       case txgbe_mbox_api_12:
+       case txgbe_mbox_api_13:
+               break;
+       default:
+               return 0;
+       }
+
+       /* Fetch queue configuration from the PF */
+       msg[0] = TXGBE_VF_GET_QUEUES;
+       for (i = 1; i < 5; i++)
+               msg[i] = 0;
+
+       err = txgbevf_write_msg_read_ack(hw, msg, msg, 5);
+       if (!err) {
+               msg[0] &= ~TXGBE_VT_MSGTYPE_CTS;
+
+               /*
+                * if we we didn't get an ACK there must have been

typo on 'we', it is dublicated.

Reply via email to