From: Simon Horman <horms@kernel.org>
To: Yunjian Wang <wangyunjian@huawei.com>
Cc: willemdebruijn.kernel@gmail.com, jasowang@redhat.com,
kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, xudingke@huawei.com
Subject: Re: [PATCH net v2] tun: add missing rx stats accounting in tun_xdp_act
Date: Tue, 16 Jan 2024 19:27:57 +0000 [thread overview]
Message-ID: <20240116192757.GC588419@kernel.org> (raw)
In-Reply-To: <1705409818-28292-1-git-send-email-wangyunjian@huawei.com>
On Tue, Jan 16, 2024 at 08:56:58PM +0800, Yunjian Wang wrote:
> There are few places on the receive path where packet receives and packet
> drops were not accounted for. This patch fixes that issue.
>
> Fixes: 8ae1aff0b331 ("tuntap: split out XDP logic")
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
> v2: add Fixes tag
> ---
> drivers/net/tun.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index afa5497f7c35..232e5319ac77 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -1626,17 +1626,14 @@ static int tun_xdp_act(struct tun_struct *tun, struct bpf_prog *xdp_prog,
> struct xdp_buff *xdp, u32 act)
> {
> int err;
> + unsigned int datasize = xdp->data_end - xdp->data;
nit: if you post a v3 for some other reason then, as this is Networking
code, please consider arranging local variables in reverse xmas tree
order - longest line to shortest.
unsigned int datasize = xdp->data_end - xdp->data;
int err;
...
prev parent reply other threads:[~2024-01-16 19:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-16 12:56 [PATCH net v2] tun: add missing rx stats accounting in tun_xdp_act Yunjian Wang
2024-01-16 15:04 ` Willem de Bruijn
2024-01-16 19:27 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240116192757.GC588419@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wangyunjian@huawei.com \
--cc=willemdebruijn.kernel@gmail.com \
--cc=xudingke@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.