diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2014-12-06 04:19:09 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-02-05 22:57:47 -0500 |
commit | 9295edb472dcd85cb27d2f23dc2e6bae054a0228 (patch) | |
tree | bb0a61aa7371dbdf4f2981f488c4515746fc0826 /drivers/net/ethernet/intel/ixgbevf | |
parent | 2dc571aa61d3fe5b20167f16e0390e749cd4bb97 (diff) |
ixgbevf: add RSS support for X550
X550 provides RSS registers for configuring RSS per VF.
This patch introduces ixgbevf_setup_vfmrqc() which uses the VFRETA,
VFRSSRK and VFMRQC registers to configure RSS on X550.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbevf')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 35 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/regs.h | 10 |
2 files changed, 45 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 92154ee87b42..a5735263b1de 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -1584,6 +1584,39 @@ static void ixgbevf_rx_desc_queue_enable(struct ixgbevf_adapter *adapter, | |||
1584 | reg_idx); | 1584 | reg_idx); |
1585 | } | 1585 | } |
1586 | 1586 | ||
1587 | static void ixgbevf_setup_vfmrqc(struct ixgbevf_adapter *adapter) | ||
1588 | { | ||
1589 | struct ixgbe_hw *hw = &adapter->hw; | ||
1590 | u32 vfmrqc = 0, vfreta = 0; | ||
1591 | u32 rss_key[10]; | ||
1592 | u16 rss_i = adapter->num_rx_queues; | ||
1593 | int i, j; | ||
1594 | |||
1595 | /* Fill out hash function seeds */ | ||
1596 | netdev_rss_key_fill(rss_key, sizeof(rss_key)); | ||
1597 | for (i = 0; i < 10; i++) | ||
1598 | IXGBE_WRITE_REG(hw, IXGBE_VFRSSRK(i), rss_key[i]); | ||
1599 | |||
1600 | /* Fill out redirection table */ | ||
1601 | for (i = 0, j = 0; i < 64; i++, j++) { | ||
1602 | if (j == rss_i) | ||
1603 | j = 0; | ||
1604 | vfreta = (vfreta << 8) | (j * 0x1); | ||
1605 | if ((i & 3) == 3) | ||
1606 | IXGBE_WRITE_REG(hw, IXGBE_VFRETA(i >> 2), vfreta); | ||
1607 | } | ||
1608 | |||
1609 | /* Perform hash on these packet types */ | ||
1610 | vfmrqc |= IXGBE_VFMRQC_RSS_FIELD_IPV4 | | ||
1611 | IXGBE_VFMRQC_RSS_FIELD_IPV4_TCP | | ||
1612 | IXGBE_VFMRQC_RSS_FIELD_IPV6 | | ||
1613 | IXGBE_VFMRQC_RSS_FIELD_IPV6_TCP; | ||
1614 | |||
1615 | vfmrqc |= IXGBE_VFMRQC_RSSEN; | ||
1616 | |||
1617 | IXGBE_WRITE_REG(hw, IXGBE_VFMRQC, vfmrqc); | ||
1618 | } | ||
1619 | |||
1587 | static void ixgbevf_configure_rx_ring(struct ixgbevf_adapter *adapter, | 1620 | static void ixgbevf_configure_rx_ring(struct ixgbevf_adapter *adapter, |
1588 | struct ixgbevf_ring *ring) | 1621 | struct ixgbevf_ring *ring) |
1589 | { | 1622 | { |
@@ -1640,6 +1673,8 @@ static void ixgbevf_configure_rx(struct ixgbevf_adapter *adapter) | |||
1640 | struct net_device *netdev = adapter->netdev; | 1673 | struct net_device *netdev = adapter->netdev; |
1641 | 1674 | ||
1642 | ixgbevf_setup_psrtype(adapter); | 1675 | ixgbevf_setup_psrtype(adapter); |
1676 | if (hw->mac.type >= ixgbe_mac_X550_vf) | ||
1677 | ixgbevf_setup_vfmrqc(adapter); | ||
1643 | 1678 | ||
1644 | /* notify the PF of our intent to use this size of frame */ | 1679 | /* notify the PF of our intent to use this size of frame */ |
1645 | ixgbevf_rlpml_set_vf(hw, netdev->mtu + ETH_HLEN + ETH_FCS_LEN); | 1680 | ixgbevf_rlpml_set_vf(hw, netdev->mtu + ETH_HLEN + ETH_FCS_LEN); |
diff --git a/drivers/net/ethernet/intel/ixgbevf/regs.h b/drivers/net/ethernet/intel/ixgbevf/regs.h index 09dd8f698bea..3e712fd6e695 100644 --- a/drivers/net/ethernet/intel/ixgbevf/regs.h +++ b/drivers/net/ethernet/intel/ixgbevf/regs.h | |||
@@ -69,6 +69,16 @@ | |||
69 | #define IXGBE_VFGOTC_LSB 0x02020 | 69 | #define IXGBE_VFGOTC_LSB 0x02020 |
70 | #define IXGBE_VFGOTC_MSB 0x02024 | 70 | #define IXGBE_VFGOTC_MSB 0x02024 |
71 | #define IXGBE_VFMPRC 0x01034 | 71 | #define IXGBE_VFMPRC 0x01034 |
72 | #define IXGBE_VFMRQC 0x3000 | ||
73 | #define IXGBE_VFRSSRK(x) (0x3100 + ((x) * 4)) | ||
74 | #define IXGBE_VFRETA(x) (0x3200 + ((x) * 4)) | ||
75 | |||
76 | /* VFMRQC bits */ | ||
77 | #define IXGBE_VFMRQC_RSSEN 0x00000001 /* RSS Enable */ | ||
78 | #define IXGBE_VFMRQC_RSS_FIELD_IPV4_TCP 0x00010000 | ||
79 | #define IXGBE_VFMRQC_RSS_FIELD_IPV4 0x00020000 | ||
80 | #define IXGBE_VFMRQC_RSS_FIELD_IPV6 0x00100000 | ||
81 | #define IXGBE_VFMRQC_RSS_FIELD_IPV6_TCP 0x00200000 | ||
72 | 82 | ||
73 | #define IXGBE_WRITE_FLUSH(a) (IXGBE_READ_REG(a, IXGBE_VFSTATUS)) | 83 | #define IXGBE_WRITE_FLUSH(a) (IXGBE_READ_REG(a, IXGBE_VFSTATUS)) |
74 | 84 | ||