diff options
author | Kittipon Meesompop <kmeesomp@linux.vnet.ibm.com> | 2018-04-26 09:42:22 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-27 13:38:49 -0400 |
commit | 571f9dd8026b44fe52d9ca9ed6a68c53aad1f3ba (patch) | |
tree | f416457ad6ff96730b6ba225d86ed121945b1ae0 /drivers/s390/net/qeth_core.h | |
parent | s390/qeth: extend Checksum Offload Assists for IPv6 (diff) | |
download | linux-dev-571f9dd8026b44fe52d9ca9ed6a68c53aad1f3ba.tar.xz linux-dev-571f9dd8026b44fe52d9ca9ed6a68c53aad1f3ba.zip |
s390/qeth: add IPv6 TX checksum offload support
Check if a qeth device supports IPv6 TX checksum offload, and advertise
NETIF_F_IPV6_CSUM accordingly. Add support for setting the relevant bits
in IPv6 packet descriptors.
Currently this has only limited use (ie. UDP, or Jumbo Frames). For any
TCP traffic with a standard MSS, the TCP checksum gets calculated
as part of the linear GSO segmentation.
Signed-off-by: Kittipon Meesompop <kmeesomp@linux.vnet.ibm.com>
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_core.h')
-rw-r--r-- | drivers/s390/net/qeth_core.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index 7cbc9bf5d6b0..2a5fec55bf60 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -878,14 +878,17 @@ static inline void qeth_rx_csum(struct qeth_card *card, struct sk_buff *skb, } } -static inline void qeth_tx_csum(struct sk_buff *skb, u8 *flags) +static inline void qeth_tx_csum(struct sk_buff *skb, u8 *flags, int ipv) { *flags |= QETH_HDR_EXT_CSUM_TRANSP_REQ; - if (ip_hdr(skb)->protocol == IPPROTO_UDP) + if ((ipv == 4 && ip_hdr(skb)->protocol == IPPROTO_UDP) || + (ipv == 6 && ipv6_hdr(skb)->nexthdr == IPPROTO_UDP)) *flags |= QETH_HDR_EXT_UDP; - /* some HW requires combined L3+L4 csum offload: */ - *flags |= QETH_HDR_EXT_CSUM_HDR_REQ; - ip_hdr(skb)->check = 0; + if (ipv == 4) { + /* some HW requires combined L3+L4 csum offload: */ + *flags |= QETH_HDR_EXT_CSUM_HDR_REQ; + ip_hdr(skb)->check = 0; + } } static inline void qeth_put_buffer_pool_entry(struct qeth_card *card, |