aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2012-07-20 04:09:32 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-10-23 00:14:54 -0400
commitf591cd9def96f5219078594699bf691a6282f6b2 (patch)
tree84b9a6e7edb72441067a7017507c519ee4d3d0b6 /drivers/net/ethernet/intel
parent107d3018abd9d15df24e8f2d52366fa7f983beda (diff)
ixgbe: Add support for GET_QUEUES message to get DCB configuration
This patch addresses several issues in regards to the combination of DCB and SR-IOV. Specifically it allows us to send information to the VF on which queues it should be using. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h10
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c42
2 files changed, 52 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h
index d4c842e1db66..42dd65e6ac97 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h
@@ -71,6 +71,7 @@
71enum ixgbe_pfvf_api_rev { 71enum ixgbe_pfvf_api_rev {
72 ixgbe_mbox_api_10, /* API version 1.0, linux/freebsd VF driver */ 72 ixgbe_mbox_api_10, /* API version 1.0, linux/freebsd VF driver */
73 ixgbe_mbox_api_20, /* API version 2.0, solaris Phase1 VF driver */ 73 ixgbe_mbox_api_20, /* API version 2.0, solaris Phase1 VF driver */
74 ixgbe_mbox_api_11, /* API version 1.1, linux/freebsd VF driver */
74 /* This value should always be last */ 75 /* This value should always be last */
75 ixgbe_mbox_api_unknown, /* indicates that API version is not known */ 76 ixgbe_mbox_api_unknown, /* indicates that API version is not known */
76}; 77};
@@ -86,6 +87,15 @@ enum ixgbe_pfvf_api_rev {
86#define IXGBE_VF_SET_MACVLAN 0x06 /* VF requests PF for unicast filter */ 87#define IXGBE_VF_SET_MACVLAN 0x06 /* VF requests PF for unicast filter */
87#define IXGBE_VF_API_NEGOTIATE 0x08 /* negotiate API version */ 88#define IXGBE_VF_API_NEGOTIATE 0x08 /* negotiate API version */
88 89
90/* mailbox API, version 1.1 VF requests */
91#define IXGBE_VF_GET_QUEUES 0x09 /* get queue configuration */
92
93/* GET_QUEUES return data indices within the mailbox */
94#define IXGBE_VF_TX_QUEUES 1 /* number of Tx queues supported */
95#define IXGBE_VF_RX_QUEUES 2 /* number of Rx queues supported */
96#define IXGBE_VF_TRANS_VLAN 3 /* Indication of port vlan */
97#define IXGBE_VF_DEF_QUEUE 4 /* Default queue offset */
98
89/* length of permanent address message returned from PF */ 99/* length of permanent address message returned from PF */
90#define IXGBE_VF_PERMADDR_MSG_LEN 4 100#define IXGBE_VF_PERMADDR_MSG_LEN 4
91/* word in permanent address message with the current multicast type */ 101/* word in permanent address message with the current multicast type */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index b330a1c6c4c6..8bf467b94d12 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -751,6 +751,45 @@ static int ixgbe_negotiate_vf_api(struct ixgbe_adapter *adapter,
751 return -1; 751 return -1;
752} 752}
753 753
754static int ixgbe_get_vf_queues(struct ixgbe_adapter *adapter,
755 u32 *msgbuf, u32 vf)
756{
757 struct net_device *dev = adapter->netdev;
758 struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ];
759 unsigned int default_tc = 0;
760 u8 num_tcs = netdev_get_num_tc(dev);
761
762 /* verify the PF is supporting the correct APIs */
763 switch (adapter->vfinfo[vf].vf_api) {
764 case ixgbe_mbox_api_20:
765 case ixgbe_mbox_api_11:
766 break;
767 default:
768 return -1;
769 }
770
771 /* only allow 1 Tx queue for bandwidth limiting */
772 msgbuf[IXGBE_VF_TX_QUEUES] = __ALIGN_MASK(1, ~vmdq->mask);
773 msgbuf[IXGBE_VF_RX_QUEUES] = __ALIGN_MASK(1, ~vmdq->mask);
774
775 /* if TCs > 1 determine which TC belongs to default user priority */
776 if (num_tcs > 1)
777 default_tc = netdev_get_prio_tc_map(dev, adapter->default_up);
778
779 /* notify VF of need for VLAN tag stripping, and correct queue */
780 if (num_tcs)
781 msgbuf[IXGBE_VF_TRANS_VLAN] = num_tcs;
782 else if (adapter->vfinfo[vf].pf_vlan || adapter->vfinfo[vf].pf_qos)
783 msgbuf[IXGBE_VF_TRANS_VLAN] = 1;
784 else
785 msgbuf[IXGBE_VF_TRANS_VLAN] = 0;
786
787 /* notify VF of default queue */
788 msgbuf[IXGBE_VF_DEF_QUEUE] = default_tc;
789
790 return 0;
791}
792
754static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf) 793static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
755{ 794{
756 u32 mbx_size = IXGBE_VFMAILBOX_SIZE; 795 u32 mbx_size = IXGBE_VFMAILBOX_SIZE;
@@ -804,6 +843,9 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
804 case IXGBE_VF_API_NEGOTIATE: 843 case IXGBE_VF_API_NEGOTIATE:
805 retval = ixgbe_negotiate_vf_api(adapter, msgbuf, vf); 844 retval = ixgbe_negotiate_vf_api(adapter, msgbuf, vf);
806 break; 845 break;
846 case IXGBE_VF_GET_QUEUES:
847 retval = ixgbe_get_vf_queues(adapter, msgbuf, vf);
848 break;
807 default: 849 default:
808 e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]); 850 e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]);
809 retval = IXGBE_ERR_MBX; 851 retval = IXGBE_ERR_MBX;