mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-09 14:14:00 +08:00
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>
This commit is contained in:
parent
3e00a50935
commit
cca2822d37
@ -1697,7 +1697,8 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
|
||||
return handle_trace_pkt(q->adap, si);
|
||||
|
||||
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)) &&
|
||||
(q->netdev->features & NETIF_F_GRO) && csum_ok && !pkt->ip_frag) {
|
||||
do_gro(rxq, si, pkt);
|
||||
@ -1720,8 +1721,7 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
|
||||
|
||||
rxq->stats.pkts++;
|
||||
|
||||
if (csum_ok && (q->netdev->features & NETIF_F_RXCSUM) &&
|
||||
(pkt->l2info & htonl(RXF_UDP | RXF_TCP))) {
|
||||
if (csum_ok && (pkt->l2info & htonl(RXF_UDP | RXF_TCP))) {
|
||||
if (!pkt->ip_frag) {
|
||||
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
||||
rxq->stats.rx_cso++;
|
||||
|
Loading…
Reference in New Issue
Block a user