Commit 5e9756a6 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Jakub Kicinski

s390/qeth: simplify qeth_receive_skb()

Now that the OSN code is gone, we don't need the second switch statement
in the RX path. And getting rid of its (unreachable) default case is a
nice simplification.

Also don't pass in the full HW header, all we still need is a flag to
indicate whether the skb can use CSO. This we can already obtain during
the first peek at the HW header.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
Reviewed-by: default avatarWenjia Zhang <wenjia@linux.ibm.com>
Signed-off-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c0e084e3
...@@ -5575,29 +5575,9 @@ static void qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb, ...@@ -5575,29 +5575,9 @@ static void qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
#endif #endif
static void qeth_receive_skb(struct qeth_card *card, struct sk_buff *skb, static void qeth_receive_skb(struct qeth_card *card, struct sk_buff *skb,
struct qeth_hdr *hdr, bool uses_frags) bool uses_frags, bool is_cso)
{ {
struct napi_struct *napi = &card->napi; struct napi_struct *napi = &card->napi;
bool is_cso;
switch (hdr->hdr.l2.id) {
#if IS_ENABLED(CONFIG_QETH_L3)
case QETH_HEADER_TYPE_LAYER3:
qeth_l3_rebuild_skb(card, skb, hdr);
is_cso = hdr->hdr.l3.ext_flags & QETH_HDR_EXT_CSUM_TRANSP_REQ;
break;
#endif
case QETH_HEADER_TYPE_LAYER2:
is_cso = hdr->hdr.l2.flags[1] & QETH_HDR_EXT_CSUM_TRANSP_REQ;
break;
default:
/* never happens */
if (uses_frags)
napi_free_frags(napi);
else
kfree_skb(skb);
return;
}
if (is_cso && (card->dev->features & NETIF_F_RXCSUM)) { if (is_cso && (card->dev->features & NETIF_F_RXCSUM)) {
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
...@@ -5654,6 +5634,7 @@ static int qeth_extract_skb(struct qeth_card *card, ...@@ -5654,6 +5634,7 @@ static int qeth_extract_skb(struct qeth_card *card,
struct qeth_hdr *hdr; struct qeth_hdr *hdr;
struct sk_buff *skb; struct sk_buff *skb;
int skb_len = 0; int skb_len = 0;
bool is_cso;
element = &buffer->element[*element_no]; element = &buffer->element[*element_no];
...@@ -5673,11 +5654,15 @@ static int qeth_extract_skb(struct qeth_card *card, ...@@ -5673,11 +5654,15 @@ static int qeth_extract_skb(struct qeth_card *card,
switch (hdr->hdr.l2.id) { switch (hdr->hdr.l2.id) {
case QETH_HEADER_TYPE_LAYER2: case QETH_HEADER_TYPE_LAYER2:
skb_len = hdr->hdr.l2.pkt_length; skb_len = hdr->hdr.l2.pkt_length;
is_cso = hdr->hdr.l2.flags[1] & QETH_HDR_EXT_CSUM_TRANSP_REQ;
linear_len = ETH_HLEN; linear_len = ETH_HLEN;
headroom = 0; headroom = 0;
break; break;
case QETH_HEADER_TYPE_LAYER3: case QETH_HEADER_TYPE_LAYER3:
skb_len = hdr->hdr.l3.length; skb_len = hdr->hdr.l3.length;
is_cso = hdr->hdr.l3.ext_flags & QETH_HDR_EXT_CSUM_TRANSP_REQ;
if (!IS_LAYER3(card)) { if (!IS_LAYER3(card)) {
QETH_CARD_STAT_INC(card, rx_dropped_notsupp); QETH_CARD_STAT_INC(card, rx_dropped_notsupp);
goto walk_packet; goto walk_packet;
...@@ -5804,7 +5789,12 @@ static int qeth_extract_skb(struct qeth_card *card, ...@@ -5804,7 +5789,12 @@ static int qeth_extract_skb(struct qeth_card *card,
*element_no = element - &buffer->element[0]; *element_no = element - &buffer->element[0];
*__offset = offset; *__offset = offset;
qeth_receive_skb(card, skb, hdr, uses_frags); #if IS_ENABLED(CONFIG_QETH_L3)
if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER3)
qeth_l3_rebuild_skb(card, skb, hdr);
#endif
qeth_receive_skb(card, skb, uses_frags, is_cso);
return 0; return 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