diff options
author | Alex Elder <elder@linaro.org> | 2022-05-12 17:10:31 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-05-13 13:01:42 +0200 |
commit | 30b338ff7998b6ed7a90815870cd5db725f87168 (patch) | |
tree | 1baeda68e490d3041294b03b4464a765e8fb5bbd /drivers/net/ipa | |
parent | Merge tag 'net-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff) | |
download | linux-30b338ff7998b6ed7a90815870cd5db725f87168.tar.xz linux-30b338ff7998b6ed7a90815870cd5db725f87168.zip |
net: ipa: certain dropped packets aren't accounted for
If an RX endpoint receives packets containing status headers, and a
packet in the buffer is not dropped, ipa_endpoint_skb_copy() is
responsible for wrapping the packet data in an SKB and forwarding it
to ipa_modem_skb_rx() for further processing.
If ipa_endpoint_skb_copy() gets a null pointer from build_skb(), it
just returns early. But in the process it doesn't record that as a
dropped packet in the network device statistics.
Instead, call ipa_modem_skb_rx() whether or not the SKB pointer is
NULL; that function ensures the statistics are properly updated.
Fixes: 1b65bbcc9a710 ("net: ipa: skip SKB copy if no netdev")
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa')
-rw-r--r-- | drivers/net/ipa/ipa_endpoint.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 888e94278a84..cea7b2e2ce96 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1150,13 +1150,12 @@ static void ipa_endpoint_skb_copy(struct ipa_endpoint *endpoint, return; skb = __dev_alloc_skb(len, GFP_ATOMIC); - if (!skb) - return; - - /* Copy the data into the socket buffer and receive it */ - skb_put(skb, len); - memcpy(skb->data, data, len); - skb->truesize += extra; + if (skb) { + /* Copy the data into the socket buffer and receive it */ + skb_put(skb, len); + memcpy(skb->data, data, len); + skb->truesize += extra; + } ipa_modem_skb_rx(endpoint->netdev, skb); } |