ixgbe: add rxhash support
feed RSS hash into skb->rxhash Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Evan Swanson <evan.swanson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
committed by
Jeff Kirsher
parent
936db3559f
commit
67a74ee2a2
@@ -2253,8 +2253,13 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data)
|
|||||||
need_reset = (data & ETH_FLAG_RXVLAN) !=
|
need_reset = (data & ETH_FLAG_RXVLAN) !=
|
||||||
(netdev->features & NETIF_F_HW_VLAN_RX);
|
(netdev->features & NETIF_F_HW_VLAN_RX);
|
||||||
|
|
||||||
|
if ((data & ETH_FLAG_RXHASH) &&
|
||||||
|
!(adapter->flags & IXGBE_FLAG_RSS_ENABLED))
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
rc = ethtool_op_set_flags(netdev, data, ETH_FLAG_LRO | ETH_FLAG_NTUPLE |
|
rc = ethtool_op_set_flags(netdev, data, ETH_FLAG_LRO | ETH_FLAG_NTUPLE |
|
||||||
ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN);
|
ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN |
|
||||||
|
ETH_FLAG_RXHASH);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@@ -1063,8 +1063,14 @@ static int __ixgbe_notify_dca(struct device *dev, void *data)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_IXGBE_DCA */
|
#endif /* CONFIG_IXGBE_DCA */
|
||||||
|
|
||||||
|
static inline void ixgbe_rx_hash(union ixgbe_adv_rx_desc *rx_desc,
|
||||||
|
struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
skb->rxhash = le32_to_cpu(rx_desc->wb.lower.hi_dword.rss);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ixgbe_receive_skb - Send a completed packet up the stack
|
* ixgbe_receive_skb - Send a completed packet up the stack
|
||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
@@ -1456,6 +1462,8 @@ static void ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ixgbe_rx_checksum(adapter, rx_desc, skb);
|
ixgbe_rx_checksum(adapter, rx_desc, skb);
|
||||||
|
if (adapter->netdev->features & NETIF_F_RXHASH)
|
||||||
|
ixgbe_rx_hash(rx_desc, skb);
|
||||||
|
|
||||||
/* probably a little skewed due to removing CRC */
|
/* probably a little skewed due to removing CRC */
|
||||||
total_rx_bytes += skb->len;
|
total_rx_bytes += skb->len;
|
||||||
@@ -7361,6 +7369,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
|
|||||||
netdev->features |= NETIF_F_TSO;
|
netdev->features |= NETIF_F_TSO;
|
||||||
netdev->features |= NETIF_F_TSO6;
|
netdev->features |= NETIF_F_TSO6;
|
||||||
netdev->features |= NETIF_F_GRO;
|
netdev->features |= NETIF_F_GRO;
|
||||||
|
netdev->features |= NETIF_F_RXHASH;
|
||||||
|
|
||||||
switch (adapter->hw.mac.type) {
|
switch (adapter->hw.mac.type) {
|
||||||
case ixgbe_mac_82599EB:
|
case ixgbe_mac_82599EB:
|
||||||
@@ -7441,6 +7450,9 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
|
|||||||
if (err)
|
if (err)
|
||||||
goto err_sw_init;
|
goto err_sw_init;
|
||||||
|
|
||||||
|
if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED))
|
||||||
|
netdev->features &= ~NETIF_F_RXHASH;
|
||||||
|
|
||||||
switch (pdev->device) {
|
switch (pdev->device) {
|
||||||
case IXGBE_DEV_ID_82599_SFP:
|
case IXGBE_DEV_ID_82599_SFP:
|
||||||
/* Only this subdevice supports WOL */
|
/* Only this subdevice supports WOL */
|
||||||
|
Reference in New Issue
Block a user