Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cca2822d authored by Hariprasad Shenai's avatar Hariprasad Shenai Committed by David S. Miller
Browse files

cxgb4: Check if rx checksum offload is enabled, while reading hardware calculated checksum

parent 3e00a509
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -1697,7 +1697,8 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
		return handle_trace_pkt(q->adap, si);
		return handle_trace_pkt(q->adap, si);


	pkt = (const struct cpl_rx_pkt *)rsp;
	pkt = (const struct cpl_rx_pkt *)rsp;
	csum_ok = pkt->csum_calc && !pkt->err_vec;
	csum_ok = pkt->csum_calc && !pkt->err_vec &&
		  (q->netdev->features & NETIF_F_RXCSUM);
	if ((pkt->l2info & htonl(RXF_TCP)) &&
	if ((pkt->l2info & htonl(RXF_TCP)) &&
	    (q->netdev->features & NETIF_F_GRO) && csum_ok && !pkt->ip_frag) {
	    (q->netdev->features & NETIF_F_GRO) && csum_ok && !pkt->ip_frag) {
		do_gro(rxq, si, pkt);
		do_gro(rxq, si, pkt);
@@ -1720,8 +1721,7 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,


	rxq->stats.pkts++;
	rxq->stats.pkts++;


	if (csum_ok && (q->netdev->features & NETIF_F_RXCSUM) &&
	if (csum_ok && (pkt->l2info & htonl(RXF_UDP | RXF_TCP))) {
	    (pkt->l2info & htonl(RXF_UDP | RXF_TCP))) {
		if (!pkt->ip_frag) {
		if (!pkt->ip_frag) {
			skb->ip_summed = CHECKSUM_UNNECESSARY;
			skb->ip_summed = CHECKSUM_UNNECESSARY;
			rxq->stats.rx_cso++;
			rxq->stats.rx_cso++;