s390/qeth: drop unwanted packets earlier in RX path
Packets with an unexpected HW format are currently first extracted from the RX buffer, passed upwards to the layer-specific driver and only then finally dropped. Enhance the RX path so that we can drop such packets before even allocating an skb. For this, add some additional logic so that when a packet is meant to be dropped, we can still walk along the packet's data chunks in the RX buffer. This allows us to extract the following packet(s) from the buffer. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
5fd3fcbb8a
commit
7d4faee7c6
@@ -315,30 +315,19 @@ static int qeth_l2_process_inbound_buffer(struct qeth_card *card,
|
||||
*done = 1;
|
||||
break;
|
||||
}
|
||||
switch (hdr->hdr.l2.id) {
|
||||
case QETH_HEADER_TYPE_LAYER2:
|
||||
|
||||
if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) {
|
||||
skb->protocol = eth_type_trans(skb, skb->dev);
|
||||
qeth_rx_csum(card, skb, hdr->hdr.l2.flags[1]);
|
||||
len = skb->len;
|
||||
napi_gro_receive(&card->napi, skb);
|
||||
break;
|
||||
case QETH_HEADER_TYPE_OSN:
|
||||
if (IS_OSN(card)) {
|
||||
skb_push(skb, sizeof(struct qeth_hdr));
|
||||
skb_copy_to_linear_data(skb, hdr,
|
||||
sizeof(struct qeth_hdr));
|
||||
len = skb->len;
|
||||
card->osn_info.data_cb(skb);
|
||||
break;
|
||||
}
|
||||
/* Else, fall through */
|
||||
default:
|
||||
dev_kfree_skb_any(skb);
|
||||
QETH_CARD_TEXT(card, 3, "inbunkno");
|
||||
QETH_DBF_HEX(CTRL, 3, hdr, sizeof(*hdr));
|
||||
QETH_CARD_STAT_INC(card, rx_dropped_notsupp);
|
||||
continue;
|
||||
} else {
|
||||
skb_push(skb, sizeof(*hdr));
|
||||
skb_copy_to_linear_data(skb, hdr, sizeof(*hdr));
|
||||
len = skb->len;
|
||||
card->osn_info.data_cb(skb);
|
||||
}
|
||||
|
||||
work_done++;
|
||||
budget--;
|
||||
QETH_CARD_STAT_INC(card, rx_packets);
|
||||
|
Reference in New Issue
Block a user