cxgb4vf: 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:
committed by
David S. Miller
parent
cca2822d37
commit
c3136f5540
@@ -1510,7 +1510,8 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp,
|
|||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
const struct cpl_rx_pkt *pkt = (void *)rsp;
|
const struct cpl_rx_pkt *pkt = (void *)rsp;
|
||||||
bool csum_ok = pkt->csum_calc && !pkt->err_vec;
|
bool csum_ok = pkt->csum_calc && !pkt->err_vec &&
|
||||||
|
(rspq->netdev->features & NETIF_F_RXCSUM);
|
||||||
struct sge_eth_rxq *rxq = container_of(rspq, struct sge_eth_rxq, rspq);
|
struct sge_eth_rxq *rxq = container_of(rspq, struct sge_eth_rxq, rspq);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1538,8 +1539,8 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp,
|
|||||||
skb_record_rx_queue(skb, rspq->idx);
|
skb_record_rx_queue(skb, rspq->idx);
|
||||||
rxq->stats.pkts++;
|
rxq->stats.pkts++;
|
||||||
|
|
||||||
if (csum_ok && (rspq->netdev->features & NETIF_F_RXCSUM) &&
|
if (csum_ok && !pkt->err_vec &&
|
||||||
!pkt->err_vec && (be32_to_cpu(pkt->l2info) & (RXF_UDP|RXF_TCP))) {
|
(be32_to_cpu(pkt->l2info) & (RXF_UDP|RXF_TCP))) {
|
||||||
if (!pkt->ip_frag)
|
if (!pkt->ip_frag)
|
||||||
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user