提交 94c5e532 编写于 作者: P Peng Li 提交者: David S. Miller

net: hns3: add l4_type check for both ipv4 and ipv6

HW supports UDP, TCP and SCTP packets checksum for both ipv4 and
ipv6,  but do not support other type packets checksum for ipv4 or
ipv6.
Signed-off-by: NPeng Li <lipeng321@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 36cbbdf6
...@@ -2103,11 +2103,11 @@ static void hns3_rx_checksum(struct hns3_enet_ring *ring, struct sk_buff *skb, ...@@ -2103,11 +2103,11 @@ static void hns3_rx_checksum(struct hns3_enet_ring *ring, struct sk_buff *skb,
skb->csum_level = 1; skb->csum_level = 1;
case HNS3_OL4_TYPE_NO_TUN: case HNS3_OL4_TYPE_NO_TUN:
/* Can checksum ipv4 or ipv6 + UDP/TCP/SCTP packets */ /* Can checksum ipv4 or ipv6 + UDP/TCP/SCTP packets */
if (l3_type == HNS3_L3_TYPE_IPV4 || if ((l3_type == HNS3_L3_TYPE_IPV4 ||
(l3_type == HNS3_L3_TYPE_IPV6 && l3_type == HNS3_L3_TYPE_IPV6) &&
(l4_type == HNS3_L4_TYPE_UDP || (l4_type == HNS3_L4_TYPE_UDP ||
l4_type == HNS3_L4_TYPE_TCP || l4_type == HNS3_L4_TYPE_TCP ||
l4_type == HNS3_L4_TYPE_SCTP))) l4_type == HNS3_L4_TYPE_SCTP))
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册