Thread (9 messages) 9 messages, 2 authors, 2021-05-26

RE: [Patch bpf v2 7/7] skmsg: increase sk->sk_drops when dropping packets

From: John Fastabend <john.fastabend@gmail.com>
Date: 2021-05-26 04:22:49
Also in: bpf

Cong Wang wrote:
From: Cong Wang <redacted>

It is hard to observe packet drops without increase relevant
drop counters, here we should increase sk->sk_drops which is
a protocol-independent counter. Fortunately psock is always
assocaited with a struct sock, we can just use psock->sk.

Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Cc: Lorenz Bauer <redacted>
Signed-off-by: Cong Wang <redacted>
[...]
quoted hunk ↗ jump to hunk
 static void sk_psock_backlog(struct work_struct *work)
 {
 	struct sk_psock *psock = container_of(work, struct sk_psock, work);
@@ -617,7 +623,7 @@ static void sk_psock_backlog(struct work_struct *work)
 				/* Hard errors break pipe and stop xmit. */
 				sk_psock_report_error(psock, ret ? -ret : EPIPE);
 				sk_psock_clear_state(psock, SK_PSOCK_TX_ENABLED);
-				kfree_skb(skb);
+				sock_drop(psock->sk, skb);
 				goto end;
 			}
 			off += ret;
@@ -625,7 +631,7 @@ static void sk_psock_backlog(struct work_struct *work)
 		} while (len);
 
 		if (!ingress)
-			kfree_skb(skb);
+			sock_drop(psock->sk, skb);
This is not a dropped skb this was sent via skb_send_sock().

The rest LGTM thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help