[net-next,11/13] rxrpc: Show consumed and freed packets as non-dropped in dropwatch

Message ID 20230131171227.3912130-12-dhowells@redhat.com
State New
Headers
Series rxrpc: Increasing SACK size and moving away from softirq, part 5 |

Commit Message

David Howells Jan. 31, 2023, 5:12 p.m. UTC
  Set a reason when freeing a packet that has been consumed such that
dropwatch doesn't complain that it has been dropped.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
---
 net/rxrpc/skbuff.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Paolo Abeni Feb. 2, 2023, 10:42 a.m. UTC | #1
On Tue, 2023-01-31 at 17:12 +0000, David Howells wrote:
> Set a reason when freeing a packet that has been consumed such that
> dropwatch doesn't complain that it has been dropped.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Marc Dionne <marc.dionne@auristor.com>
> cc: linux-afs@lists.infradead.org
> ---
>  net/rxrpc/skbuff.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/rxrpc/skbuff.c b/net/rxrpc/skbuff.c
> index ebe0c75e7b07..944320e65ea8 100644
> --- a/net/rxrpc/skbuff.c
> +++ b/net/rxrpc/skbuff.c
> @@ -63,7 +63,7 @@ void rxrpc_free_skb(struct sk_buff *skb, enum rxrpc_skb_trace why)
>  	if (skb) {
>  		int n = atomic_dec_return(select_skb_count(skb));
>  		trace_rxrpc_skb(skb, refcount_read(&skb->users), n, why);
> -		kfree_skb(skb);
> +		kfree_skb_reason(skb, SKB_CONSUMED);

Just for the records, and not intending blocking this series, IMHO:

		consume_skb(skb); 

would probably be more straight-forward/clear.

Cheers,

Paolo
  

Patch

diff --git a/net/rxrpc/skbuff.c b/net/rxrpc/skbuff.c
index ebe0c75e7b07..944320e65ea8 100644
--- a/net/rxrpc/skbuff.c
+++ b/net/rxrpc/skbuff.c
@@ -63,7 +63,7 @@  void rxrpc_free_skb(struct sk_buff *skb, enum rxrpc_skb_trace why)
 	if (skb) {
 		int n = atomic_dec_return(select_skb_count(skb));
 		trace_rxrpc_skb(skb, refcount_read(&skb->users), n, why);
-		kfree_skb(skb);
+		kfree_skb_reason(skb, SKB_CONSUMED);
 	}
 }
 
@@ -78,6 +78,6 @@  void rxrpc_purge_queue(struct sk_buff_head *list)
 		int n = atomic_dec_return(select_skb_count(skb));
 		trace_rxrpc_skb(skb, refcount_read(&skb->users), n,
 				rxrpc_skb_put_purge);
-		kfree_skb(skb);
+		kfree_skb_reason(skb, SKB_CONSUMED);
 	}
 }