[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <60adcd0ec9aa_3b75f208f0@john-XPS-13-9370.notmuch>
Date: Tue, 25 May 2021 21:22:38 -0700
From: John Fastabend <john.fastabend@...il.com>
To: Cong Wang <xiyou.wangcong@...il.com>, netdev@...r.kernel.org
Cc: bpf@...r.kernel.org, Cong Wang <cong.wang@...edance.com>,
John Fastabend <john.fastabend@...il.com>,
Daniel Borkmann <daniel@...earbox.net>,
Jakub Sitnicki <jakub@...udflare.com>,
Lorenz Bauer <lmb@...udflare.com>
Subject: RE: [Patch bpf v2 7/7] skmsg: increase sk->sk_drops when dropping
packets
Cong Wang wrote:
> From: Cong Wang <cong.wang@...edance.com>
>
> 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@...il.com>
> Cc: Daniel Borkmann <daniel@...earbox.net>
> Cc: Jakub Sitnicki <jakub@...udflare.com>
> Cc: Lorenz Bauer <lmb@...udflare.com>
> Signed-off-by: Cong Wang <cong.wang@...edance.com>
[...]
> 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.
Powered by blists - more mailing lists