diff options
author | Dimitris Michailidis <dm@chelsio.com> | 2010-04-27 19:22:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-27 19:22:42 -0400 |
commit | 87b6cf51acb4999fff7e6841986874b108679cb4 (patch) | |
tree | 304fe476f4d3acd192ba7991d28b888845114586 /drivers/net/cxgb4/sge.c | |
parent | 8cd9b13207f9a38e4da2d69bba51eb8dcbe1ead9 (diff) |
cxgb4: set skb->rxhash
Implement the ->set_flags ethtool method to control NETIF_F_RXHASH and
set skb->rxhash to the HW calculated hash accordingly.
Follow Eric Dumazet's suggestion and use the hash value raw.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb4/sge.c')
-rw-r--r-- | drivers/net/cxgb4/sge.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c index 65d91c4ec9f5..d1f8f225e45a 100644 --- a/drivers/net/cxgb4/sge.c +++ b/drivers/net/cxgb4/sge.c | |||
@@ -1524,6 +1524,8 @@ static void do_gro(struct sge_eth_rxq *rxq, const struct pkt_gl *gl, | |||
1524 | skb->truesize += skb->data_len; | 1524 | skb->truesize += skb->data_len; |
1525 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1525 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1526 | skb_record_rx_queue(skb, rxq->rspq.idx); | 1526 | skb_record_rx_queue(skb, rxq->rspq.idx); |
1527 | if (rxq->rspq.netdev->features & NETIF_F_RXHASH) | ||
1528 | skb->rxhash = (__force u32)pkt->rsshdr.hash_val; | ||
1527 | 1529 | ||
1528 | if (unlikely(pkt->vlan_ex)) { | 1530 | if (unlikely(pkt->vlan_ex)) { |
1529 | struct port_info *pi = netdev_priv(rxq->rspq.netdev); | 1531 | struct port_info *pi = netdev_priv(rxq->rspq.netdev); |
@@ -1565,7 +1567,7 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp, | |||
1565 | if (unlikely(*(u8 *)rsp == CPL_TRACE_PKT)) | 1567 | if (unlikely(*(u8 *)rsp == CPL_TRACE_PKT)) |
1566 | return handle_trace_pkt(q->adap, si); | 1568 | return handle_trace_pkt(q->adap, si); |
1567 | 1569 | ||
1568 | pkt = (void *)&rsp[1]; | 1570 | pkt = (const struct cpl_rx_pkt *)rsp; |
1569 | csum_ok = pkt->csum_calc && !pkt->err_vec; | 1571 | csum_ok = pkt->csum_calc && !pkt->err_vec; |
1570 | if ((pkt->l2info & htonl(RXF_TCP)) && | 1572 | if ((pkt->l2info & htonl(RXF_TCP)) && |
1571 | (q->netdev->features & NETIF_F_GRO) && csum_ok && !pkt->ip_frag) { | 1573 | (q->netdev->features & NETIF_F_GRO) && csum_ok && !pkt->ip_frag) { |
@@ -1583,6 +1585,9 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp, | |||
1583 | __skb_pull(skb, RX_PKT_PAD); /* remove ethernet header padding */ | 1585 | __skb_pull(skb, RX_PKT_PAD); /* remove ethernet header padding */ |
1584 | skb->protocol = eth_type_trans(skb, q->netdev); | 1586 | skb->protocol = eth_type_trans(skb, q->netdev); |
1585 | skb_record_rx_queue(skb, q->idx); | 1587 | skb_record_rx_queue(skb, q->idx); |
1588 | if (skb->dev->features & NETIF_F_RXHASH) | ||
1589 | skb->rxhash = (__force u32)pkt->rsshdr.hash_val; | ||
1590 | |||
1586 | pi = netdev_priv(skb->dev); | 1591 | pi = netdev_priv(skb->dev); |
1587 | rxq->stats.pkts++; | 1592 | rxq->stats.pkts++; |
1588 | 1593 | ||