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

s390/qeth: pass full data length to l3_fill_header()

The TSO and IQD paths already need to fix-up the current values, and
OSA will require more flexibility in the future as well. So just let
the caller specify the data length.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 910a0a8f
...@@ -2405,11 +2405,12 @@ static u8 qeth_l3_cast_type_to_flag(int cast_type) ...@@ -2405,11 +2405,12 @@ static u8 qeth_l3_cast_type_to_flag(int cast_type)
} }
static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
struct sk_buff *skb, int ipv, int cast_type) struct sk_buff *skb, int ipv, int cast_type,
unsigned int data_len)
{ {
memset(hdr, 0, sizeof(struct qeth_hdr)); memset(hdr, 0, sizeof(struct qeth_hdr));
hdr->hdr.l3.id = QETH_HEADER_TYPE_LAYER3; hdr->hdr.l3.id = QETH_HEADER_TYPE_LAYER3;
hdr->hdr.l3.length = skb->len - sizeof(struct qeth_hdr); hdr->hdr.l3.length = data_len;
/* /*
* before we're going to overwrite this location with next hop ip. * before we're going to overwrite this location with next hop ip.
...@@ -2488,7 +2489,6 @@ static void qeth_tso_fill_header(struct qeth_card *card, ...@@ -2488,7 +2489,6 @@ static void qeth_tso_fill_header(struct qeth_card *card,
/*fix header to TSO values ...*/ /*fix header to TSO values ...*/
hdr->hdr.hdr.l3.id = QETH_HEADER_TYPE_TSO; hdr->hdr.hdr.l3.id = QETH_HEADER_TYPE_TSO;
hdr->hdr.hdr.l3.length = skb->len - sizeof(struct qeth_hdr_tso);
/*set values which are fix for the first approach ...*/ /*set values which are fix for the first approach ...*/
hdr->ext.hdr_tot_len = (__u16) sizeof(struct qeth_hdr_ext_tso); hdr->ext.hdr_tot_len = (__u16) sizeof(struct qeth_hdr_ext_tso);
hdr->ext.imb_hdr_no = 1; hdr->ext.imb_hdr_no = 1;
...@@ -2649,21 +2649,23 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb, ...@@ -2649,21 +2649,23 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb,
if (use_tso) { if (use_tso) {
hdr = skb_push(new_skb, sizeof(struct qeth_hdr_tso)); hdr = skb_push(new_skb, sizeof(struct qeth_hdr_tso));
memset(hdr, 0, sizeof(struct qeth_hdr_tso)); memset(hdr, 0, sizeof(struct qeth_hdr_tso));
qeth_l3_fill_header(card, hdr, new_skb, ipv, cast_type); qeth_l3_fill_header(card, hdr, new_skb, ipv, cast_type,
new_skb->len - sizeof(struct qeth_hdr_tso));
qeth_tso_fill_header(card, hdr, new_skb); qeth_tso_fill_header(card, hdr, new_skb);
hdr_elements++; hdr_elements++;
} else { } else {
if (data_offset < 0) { if (data_offset < 0) {
hdr = skb_push(new_skb, sizeof(struct qeth_hdr)); hdr = skb_push(new_skb, sizeof(struct qeth_hdr));
qeth_l3_fill_header(card, hdr, new_skb, ipv, qeth_l3_fill_header(card, hdr, new_skb, ipv, cast_type,
cast_type); new_skb->len -
sizeof(struct qeth_hdr));
} else { } else {
if (be16_to_cpu(new_skb->protocol) == ETH_P_AF_IUCV) if (be16_to_cpu(new_skb->protocol) == ETH_P_AF_IUCV)
qeth_l3_fill_af_iucv_hdr(card, hdr, new_skb); qeth_l3_fill_af_iucv_hdr(card, hdr, new_skb);
else { else {
qeth_l3_fill_header(card, hdr, new_skb, ipv, qeth_l3_fill_header(card, hdr, new_skb, ipv,
cast_type); cast_type,
hdr->hdr.l3.length = new_skb->len - data_offset; new_skb->len - data_offset);
} }
} }
......
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