s390/qeth: pass full IQD header length to fill_buffer()
authorJulian Wiedmann <jwi@linux.vnet.ibm.com>
Fri, 18 Aug 2017 08:19:08 +0000 (10:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Aug 2017 17:21:30 +0000 (10:21 -0700)
This is a prerequisite for unifying the code to build header elements.
The TSO header has a different size, so we can no longer rely on implicitly
adding the size of a normal qeth_hdr.

No functional change.

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c

index 4a5c3028dfb6d46fe342cfbb5951db7a01a3e855..cef9f54d0eb92064b0b2d8fea54f3eff2af68916 100644 (file)
@@ -3981,8 +3981,7 @@ static int qeth_fill_buffer(struct qeth_qdio_out_q *queue,
                is_first_elem = false;
 
                buffer->element[element].addr = hdr;
-               buffer->element[element].length = sizeof(struct qeth_hdr) +
-                                                       hd_len;
+               buffer->element[element].length = hd_len;
                buffer->element[element].eflags = SBAL_EFLAGS_FIRST_FRAG;
                buf->is_header[element] = 1;
                buf->next_element_to_fill++;
index a6233ab562f098acb0bccf1e8142497207a573cf..c85fadf21b389d64952871aff4888dfe7de9c5c4 100644 (file)
@@ -695,7 +695,7 @@ static int qeth_l2_xmit_iqd(struct qeth_card *card, struct sk_buff *skb,
                goto out;
        }
        rc = qeth_do_send_packet_fast(card, queue, skb, hdr, data_offset,
-                                     data_offset);
+                                     sizeof(*hdr) + data_offset);
 out:
        if (rc)
                kmem_cache_free(qeth_core_header_cache, hdr);
index 02400bbcb61001f8c1cfdfc46e4569933929c7f2..ab661a431f7c6405f2e4c2b9d60c9dee287a9618 100644 (file)
@@ -2670,6 +2670,7 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb,
        if (card->info.type == QETH_CARD_TYPE_IQD) {
                new_skb = skb;
                data_offset = ETH_HLEN;
+               hd_len = sizeof(*hdr);
                hdr = kmem_cache_alloc(qeth_core_header_cache, GFP_ATOMIC);
                if (!hdr)
                        goto tx_drop;
@@ -2771,7 +2772,7 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb,
                                         hd_len, elements);
        } else
                rc = qeth_do_send_packet_fast(card, queue, new_skb, hdr,
-                                             data_offset, 0);
+                                             data_offset, hd_len);
 
        if (!rc) {
                card->stats.tx_packets++;