net: ipa: three bug fixes
cover net: ipa: three bug fixes
This series contains three somewhat unrelated minor bug fixes.
-Alex
Alex Elder (3):
net: ipa: certain dropped packets aren't accounted for
net: ipa: record proper RX transaction count
net: ipa: get rid of a duplicate initialization
drivers/net/ipa/gsi.c | 6 ++++-- drivers/net/ipa/ipa_endpoint.c | 13 ++++++------- drivers/net/ipa/ipa_qmi.c | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-)
Signature · 1 line
2.32.0
PATCH 1/3 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.
--- drivers/net/ipa/ipa_endpoint.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/net/ipa/ipa_endpoint.c +6 -7
@@ -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); }
Signature · 1 line
2.32.0
PATCH 2/3 net: ipa: record proper RX transaction count
In reply to Alex ElderEach time we are notified that some number of transactions on an RX channel has completed, we record the number of bytes that have been transferred since the previous notification. We also track the number of transactions completed, but that is not currently being calculated correctly; we're currently counting the number of such notifications, but each notification can represent many transaction completions. Fix this.
--- drivers/net/ipa/gsi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ipa/gsi.c +4 -2
@@ -1367,9 +1367,10 @@ static void gsi_evt_ring_rx_update(struct gsi_evt_ring *evt_ring, u32 index)struct gsi_event *event_done;struct gsi_event *event;struct gsi_trans *trans; +u32 trans_count =0 ;u32 byte_count =0 ; -u32 old_index;u32 event_avail; +u32 old_index; trans_info = &channel->trans_info;
@@ -1390,6 +1391,7 @@ static void gsi_evt_ring_rx_update(struct gsi_evt_ring *evt_ring, u32 index) do { trans->len = __le16_to_cpu(event->len); byte_count += trans->len; + trans_count++; /* Move on to the next event and transaction */ if (--event_avail)
@@ -1401,7 +1403,7 @@ static void gsi_evt_ring_rx_update(struct gsi_evt_ring *evt_ring, u32 index)/* We record RX bytes when they are received */ channel->byte_count += byte_count; - channel->trans_count++; + channel->trans_count += trans_count; }/* Initialize a ring, including allocating DMA memory for its entries */
Signature · 1 line
2.32.0
PATCH 3/3 net: ipa: get rid of a duplicate initialization
In reply to Alex ElderIn ipa_qmi_ready(), the "ipa" local variable is set when initialized, but then set again just before it's first used. One or the other is enough, so get rid of the first one.
References: https://lore.kernel.org/lkml/[email protected]/
--- drivers/net/ipa/ipa_qmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ipa/ipa_qmi.c +1 -1
@@ -125,7 +125,7 @@ static void ipa_qmi_indication(struct ipa_qmi *ipa_qmi)*/ static void ipa_qmi_ready (struct ipa_qmi *ipa_qmi) { - struct ipa *ipa = container_of(ipa_qmi, struct ipa, qmi); +struct ipa *ipa;int ret;/* We aren't ready until the modem and microcontroller are */
Signature · 1 line
2.32.0
This series was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Quoted 10 lines · On Thu, 12 May 2022 10:10:30 -0500 you wrote:
This series contains three somewhat unrelated minor bug fixes.
-Alex
Alex Elder (3):
net: ipa: certain dropped packets aren't accounted for
net: ipa: record proper RX transaction count
net: ipa: get rid of a duplicate initialization[...]
Here is the summary with links:
- [net,1/3] net: ipa: certain dropped packets aren't accounted for
https://git.kernel.org/netdev/net/c/30b338ff7998 - [net,2/3] net: ipa: record proper RX transaction count https://git.kernel.org/netdev/net/c/d8290cbe1111 - [net,3/3] net: ipa: get rid of a duplicate initialization https://git.kernel.org/netdev/net/c/8d017efb1eaa
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html