aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio
diff options
context:
space:
mode:
authorHariprasad Shenai <hariprasad@chelsio.com>2014-05-07 08:31:03 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-12 12:47:46 -0400
commitcca2822d37f419280b8cca27a4a6220e47afb77f (patch)
treeabe7cde66fc81f2027a724fd5fa5b0b7892cddb3 /drivers/net/ethernet/chelsio
parent3e00a5093561ac14a73e1dcfbaf0d9f26db65141 (diff)
cxgb4: Check if rx checksum offload is enabled, while reading hardware calculated checksum
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/sge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index ca95cf2954eb..cced1a3d5181 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -1697,7 +1697,8 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
1697 return handle_trace_pkt(q->adap, si); 1697 return handle_trace_pkt(q->adap, si);
1698 1698
1699 pkt = (const struct cpl_rx_pkt *)rsp; 1699 pkt = (const struct cpl_rx_pkt *)rsp;
1700 csum_ok = pkt->csum_calc && !pkt->err_vec; 1700 csum_ok = pkt->csum_calc && !pkt->err_vec &&
1701 (q->netdev->features & NETIF_F_RXCSUM);
1701 if ((pkt->l2info & htonl(RXF_TCP)) && 1702 if ((pkt->l2info & htonl(RXF_TCP)) &&
1702 (q->netdev->features & NETIF_F_GRO) && csum_ok && !pkt->ip_frag) { 1703 (q->netdev->features & NETIF_F_GRO) && csum_ok && !pkt->ip_frag) {
1703 do_gro(rxq, si, pkt); 1704 do_gro(rxq, si, pkt);
@@ -1720,8 +1721,7 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
1720 1721
1721 rxq->stats.pkts++; 1722 rxq->stats.pkts++;
1722 1723
1723 if (csum_ok && (q->netdev->features & NETIF_F_RXCSUM) && 1724 if (csum_ok && (pkt->l2info & htonl(RXF_UDP | RXF_TCP))) {
1724 (pkt->l2info & htonl(RXF_UDP | RXF_TCP))) {
1725 if (!pkt->ip_frag) { 1725 if (!pkt->ip_frag) {
1726 skb->ip_summed = CHECKSUM_UNNECESSARY; 1726 skb->ip_summed = CHECKSUM_UNNECESSARY;
1727 rxq->stats.rx_cso++; 1727 rxq->stats.rx_cso++;