From: Julian Wiedmann <jwi@linux.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-s390@vger.kernel.org>,
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 10/12] s390/qeth: consolidate skb RX processing in L3 driver
Date: Thu, 27 Jun 2019 17:01:31 +0200 [thread overview]
Message-ID: <20190627150133.58746-11-jwi@linux.ibm.com> (raw)
In-Reply-To: <20190627150133.58746-1-jwi@linux.ibm.com>
Use napi_gro_receive() to pass up all types of packets that a L3 device
may receive.
1) For proper L2 packets received by the IQD sniffer, this is the
obvious thing to do.
2) For af_iucv (which doesn't provide a GRO assist), the GRO code will
transparently fall back to netif_receive_skb(). So there's no need to
special-case this traffic in our code.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
drivers/s390/net/qeth_l3_main.c | 30 ++++++++++++------------------
1 file changed, 12 insertions(+), 18 deletions(-)
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 44a602aa12ec..15351922b209 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1312,6 +1312,15 @@ static int qeth_l3_vlan_rx_kill_vid(struct net_device *dev,
static void qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
struct qeth_hdr *hdr)
{
+ struct af_iucv_trans_hdr *iucv = (struct af_iucv_trans_hdr *) skb->data;
+ struct net_device *dev = skb->dev;
+
+ if (IS_IQD(card) && iucv->magic == ETH_P_AF_IUCV) {
+ dev_hard_header(skb, dev, ETH_P_AF_IUCV, dev->dev_addr,
+ "FAKELL", skb->len);
+ return;
+ }
+
if (!(hdr->hdr.l3.flags & QETH_HDR_PASSTHRU)) {
u16 prot = (hdr->hdr.l3.flags & QETH_HDR_IPV6) ? ETH_P_IPV6 :
ETH_P_IP;
@@ -1345,8 +1354,6 @@ static void qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
tg_addr, "FAKELL", skb->len);
}
- skb->protocol = eth_type_trans(skb, card->dev);
-
/* copy VLAN tag from hdr into skb */
if (!card->options.sniffer &&
(hdr->hdr.l3.ext_flags & (QETH_HDR_EXT_VLAN_FRAME |
@@ -1363,12 +1370,10 @@ static void qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
int budget, int *done)
{
- struct net_device *dev = card->dev;
int work_done = 0;
struct sk_buff *skb;
struct qeth_hdr *hdr;
unsigned int len;
- __u16 magic;
*done = 0;
WARN_ON_ONCE(!budget);
@@ -1382,23 +1387,12 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
}
switch (hdr->hdr.l3.id) {
case QETH_HEADER_TYPE_LAYER3:
- magic = *(__u16 *)skb->data;
- if (IS_IQD(card) && magic == ETH_P_AF_IUCV) {
- len = skb->len;
- dev_hard_header(skb, dev, ETH_P_AF_IUCV,
- dev->dev_addr, "FAKELL", len);
- skb->protocol = eth_type_trans(skb, dev);
- netif_receive_skb(skb);
- } else {
- qeth_l3_rebuild_skb(card, skb, hdr);
- len = skb->len;
- napi_gro_receive(&card->napi, skb);
- }
- break;
+ qeth_l3_rebuild_skb(card, skb, hdr);
+ /* fall through */
case QETH_HEADER_TYPE_LAYER2: /* for HiperSockets sniffer */
skb->protocol = eth_type_trans(skb, skb->dev);
len = skb->len;
- netif_receive_skb(skb);
+ napi_gro_receive(&card->napi, skb);
break;
default:
dev_kfree_skb_any(skb);
--
2.17.1
next prev parent reply other threads:[~2019-06-27 15:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 15:01 [PATCH net-next 00/12] s390/qeth: updates 2019-06-27 Julian Wiedmann
2019-06-27 15:01 ` [PATCH net-next 01/12] s390/qeth: dynamically allocate simple IPA cmds Julian Wiedmann
2019-06-27 15:01 ` [PATCH net-next 02/12] s390/qeth: clarify parameter for simple assist cmds Julian Wiedmann
2019-06-27 15:01 ` [PATCH net-next 03/12] s390/qeth: dynamically allocate various cmds with sub-types Julian Wiedmann
2019-06-27 15:01 ` [PATCH net-next 04/12] s390/qeth: dynamically allocate diag cmds Julian Wiedmann
2019-06-27 15:01 ` [PATCH net-next 05/12] s390/qeth: dynamically allocate vnicc cmds Julian Wiedmann
2019-06-27 15:01 ` [PATCH net-next 06/12] s390/qeth: dynamically allocate MPC cmds Julian Wiedmann
2019-06-27 15:01 ` [PATCH net-next 07/12] s390/qeth: remove static cmd buffer infrastructure Julian Wiedmann
2019-06-27 15:01 ` [PATCH net-next 08/12] s390/qeth: streamline SNMP cmd code Julian Wiedmann
2019-06-27 15:01 ` [PATCH net-next 09/12] s390/qeth: consolidate pm code Julian Wiedmann
2019-06-27 15:01 ` Julian Wiedmann [this message]
2019-06-27 15:01 ` [PATCH net-next 11/12] s390/qeth: extract helper for route validation Julian Wiedmann
2019-06-27 15:01 ` [PATCH net-next 12/12] s390/qeth: move cast type selection into fill_header() Julian Wiedmann
2019-06-27 17:18 ` [PATCH net-next 00/12] s390/qeth: updates 2019-06-27 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=20190627150133.58746-11-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=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).