| 635 | } |
| 636 | |
| 637 | static int |
| 638 | ixgbe_get_vf_queues(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) |
| 639 | { |
| 640 | struct ixgbe_vf_info *vfinfo = |
| 641 | *IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private); |
| 642 | uint32_t default_q = vf * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool; |
| 643 | struct rte_eth_conf *eth_conf; |
| 644 | struct rte_eth_vmdq_dcb_tx_conf *vmdq_dcb_tx_conf; |
| 645 | u8 num_tcs; |
| 646 | struct ixgbe_hw *hw; |
| 647 | u32 vmvir; |
| 648 | #define IXGBE_VMVIR_VLANA_MASK 0xC0000000 |
| 649 | #define IXGBE_VMVIR_VLAN_VID_MASK 0x00000FFF |
| 650 | #define IXGBE_VMVIR_VLAN_UP_MASK 0x0000E000 |
| 651 | #define VLAN_PRIO_SHIFT 13 |
| 652 | u32 vlana; |
| 653 | u32 vid; |
| 654 | u32 user_priority; |
| 655 | |
| 656 | /* Verify if the PF supports the mbox APIs version or not */ |
| 657 | switch (vfinfo[vf].api_version) { |
| 658 | case ixgbe_mbox_api_20: |
| 659 | case ixgbe_mbox_api_11: |
| 660 | case ixgbe_mbox_api_12: |
| 661 | case ixgbe_mbox_api_13: |
| 662 | break; |
| 663 | default: |
| 664 | return -1; |
| 665 | } |
| 666 | |
| 667 | /* Notify VF of Rx and Tx queue number */ |
| 668 | msgbuf[IXGBE_VF_RX_QUEUES] = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool; |
| 669 | msgbuf[IXGBE_VF_TX_QUEUES] = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool; |
| 670 | |
| 671 | /* Notify VF of default queue */ |
| 672 | msgbuf[IXGBE_VF_DEF_QUEUE] = default_q; |
| 673 | |
| 674 | /* Notify VF of number of DCB traffic classes */ |
| 675 | eth_conf = &dev->data->dev_conf; |
| 676 | switch (eth_conf->txmode.mq_mode) { |
| 677 | case RTE_ETH_MQ_TX_NONE: |
| 678 | case RTE_ETH_MQ_TX_DCB: |
| 679 | PMD_DRV_LOG(ERR, "PF must work with virtualization for VF %u" |
| 680 | ", but its tx mode = %d", vf, |
| 681 | eth_conf->txmode.mq_mode); |
| 682 | return -1; |
| 683 | |
| 684 | case RTE_ETH_MQ_TX_VMDQ_DCB: |
| 685 | vmdq_dcb_tx_conf = ð_conf->tx_adv_conf.vmdq_dcb_tx_conf; |
| 686 | switch (vmdq_dcb_tx_conf->nb_queue_pools) { |
| 687 | case RTE_ETH_16_POOLS: |
| 688 | num_tcs = RTE_ETH_8_TCS; |
| 689 | break; |
| 690 | case RTE_ETH_32_POOLS: |
| 691 | num_tcs = RTE_ETH_4_TCS; |
| 692 | break; |
| 693 | default: |
| 694 | return -1; |
no outgoing calls
no test coverage detected