From: Julian Wiedmann <jwi@linux.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-s390@vger.kernel.org>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Stefan Raspl <raspl@linux.ibm.com>,
Ursula Braun <ubraun@linux.ibm.com>,
Julian Wiedmann <jwi@linux.ibm.com>
Subject: [PATCH net-next 8/8] s390/qeth: trust non-IP cast type in qeth_l3_fill_header()
Date: Thu, 25 Apr 2019 18:26:01 +0200 [thread overview]
Message-ID: <20190425162601.91997-9-jwi@linux.ibm.com> (raw)
In-Reply-To: <20190425162601.91997-1-jwi@linux.ibm.com>
When building the L3 HW header for non-IP packets, trust the cast type
that was passed as parameter. qeth_l3_get_cast_type() has most likely
also used h_dest to determine the cast type, so we get the same
result, and can remove that duplicated code.
In the unlikely case that we would get a _different_ cast type, then
that's based off a route lookup and should be considered authoritative.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
drivers/s390/net/qeth_l3_main.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index b5d76ebb488a..0271833da6a2 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1976,19 +1976,14 @@ static void qeth_l3_fill_header(struct qeth_qdio_out_q *queue,
hdr->hdr.l3.vlan_id = ntohs(veth->h_vlan_TCI);
}
+ l3_hdr->flags = qeth_l3_cast_type_to_flag(cast_type);
+
/* OSA only: */
if (!ipv) {
- hdr->hdr.l3.flags = QETH_HDR_PASSTHRU;
- if (ether_addr_equal_64bits(eth_hdr(skb)->h_dest,
- skb->dev->broadcast))
- hdr->hdr.l3.flags |= QETH_CAST_BROADCAST;
- else
- hdr->hdr.l3.flags |= (cast_type == RTN_MULTICAST) ?
- QETH_CAST_MULTICAST : QETH_CAST_UNICAST;
+ l3_hdr->flags |= QETH_HDR_PASSTHRU;
return;
}
- hdr->hdr.l3.flags = qeth_l3_cast_type_to_flag(cast_type);
rcu_read_lock();
if (ipv == 4) {
struct rtable *rt = skb_rtable(skb);
--
2.16.4
next prev parent reply other threads:[~2019-04-25 16:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-25 16:25 [PATCH net-next 0/8] s390/qeth: updates 2019-04-25 Julian Wiedmann
2019-04-25 16:25 ` [PATCH net-next 1/8] s390: qeth: address type mismatch warning Julian Wiedmann
2019-04-25 16:25 ` [PATCH net-next 2/8] s390/qeth: remove RX seqno in skb->cb Julian Wiedmann
2019-04-25 16:25 ` [PATCH net-next 3/8] s390/qeth: clean up stale buffer state documentation Julian Wiedmann
2019-04-25 16:25 ` [PATCH net-next 4/8] s390/qeth: use IS_* helpers for checking device type Julian Wiedmann
2019-04-25 16:25 ` [PATCH net-next 5/8] s390/qeth: don't clear Output buffers on every queue init Julian Wiedmann
2019-04-25 16:25 ` [PATCH net-next 6/8] s390/qeth: cache max number of available buffer elements Julian Wiedmann
2019-04-25 16:26 ` [PATCH net-next 7/8] s390/qeth: extract helper to determine L2 cast type Julian Wiedmann
2019-04-25 16:26 ` Julian Wiedmann [this message]
2019-04-26 15:14 ` [PATCH net-next 0/8] s390/qeth: updates 2019-04-25 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190425162601.91997-9-jwi@linux.ibm.com \
--to=jwi@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raspl@linux.ibm.com \
--cc=schwidefsky@de.ibm.com \
--cc=ubraun@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).