Commit 2d3986d1 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: fix up protocol headers early

When qeth_add_hw_header() falls back to the HW header cache, it also
copies over the necessary protocol headers. Thus any manipulation to
the protocol headers needs to happen before adding the HW header.

For current usage this doesn't matter, but it becomes relevant when
moving TSO transmission over to the faster code path.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f231dc9d
...@@ -2056,10 +2056,8 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, ...@@ -2056,10 +2056,8 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
if (!skb_is_gso(skb) && skb->ip_summed == CHECKSUM_PARTIAL) { if (!skb_is_gso(skb) && skb->ip_summed == CHECKSUM_PARTIAL) {
qeth_tx_csum(skb, &hdr->hdr.l3.ext_flags, ipv); qeth_tx_csum(skb, &hdr->hdr.l3.ext_flags, ipv);
/* some HW requires combined L3+L4 csum offload: */ /* some HW requires combined L3+L4 csum offload: */
if (ipv == 4) { if (ipv == 4)
hdr->hdr.l3.ext_flags |= QETH_HDR_EXT_CSUM_HDR_REQ; hdr->hdr.l3.ext_flags |= QETH_HDR_EXT_CSUM_HDR_REQ;
ip_hdr(skb)->check = 0;
}
if (card->options.performance_stats) if (card->options.performance_stats)
card->perf_stats.tx_csum++; card->perf_stats.tx_csum++;
} }
...@@ -2168,6 +2166,15 @@ static int qeth_l3_get_elements_no_tso(struct qeth_card *card, ...@@ -2168,6 +2166,15 @@ static int qeth_l3_get_elements_no_tso(struct qeth_card *card,
return elements; return elements;
} }
static void qeth_l3_fixup_headers(struct sk_buff *skb)
{
struct iphdr *iph = ip_hdr(skb);
/* this is safe, IPv6 traffic takes a different path */
if (skb->ip_summed == CHECKSUM_PARTIAL)
iph->check = 0;
}
static int qeth_l3_xmit_offload(struct qeth_card *card, struct sk_buff *skb, static int qeth_l3_xmit_offload(struct qeth_card *card, struct sk_buff *skb,
struct qeth_qdio_out_q *queue, int ipv, struct qeth_qdio_out_q *queue, int ipv,
int cast_type) int cast_type)
...@@ -2188,6 +2195,7 @@ static int qeth_l3_xmit_offload(struct qeth_card *card, struct sk_buff *skb, ...@@ -2188,6 +2195,7 @@ static int qeth_l3_xmit_offload(struct qeth_card *card, struct sk_buff *skb,
skb_pull(skb, ETH_HLEN); skb_pull(skb, ETH_HLEN);
frame_len = skb->len; frame_len = skb->len;
qeth_l3_fixup_headers(skb);
push_len = qeth_add_hw_header(card, skb, &hdr, hw_hdr_len, 0, push_len = qeth_add_hw_header(card, skb, &hdr, hw_hdr_len, 0,
&elements); &elements);
if (push_len < 0) if (push_len < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment