From: Jakub Kicinski <kuba@kernel.org>
To: Mike Pattrick <mkp@redhat.com>
Cc: netdev@vger.kernel.org, pvalerio@redhat.com,
Pravin B Shelar <pshelar@ovn.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
dev@openvswitch.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] openvswitch: Fix double reporting of drops in dropwatch
Date: Fri, 29 Jul 2022 20:31:51 -0700 [thread overview]
Message-ID: <20220729203151.3e849337@kernel.org> (raw)
In-Reply-To: <20220728161259.1088662-1-mkp@redhat.com>
On Thu, 28 Jul 2022 12:12:58 -0400 Mike Pattrick wrote:
> Frames sent to userspace can be reported as dropped in
> ovs_dp_process_packet, however, if they are dropped in the netlink code
> then netlink_attachskb will report the same frame as dropped.
>
> This patch checks for error codes which indicate that the frame has
> already been freed.
>
> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2109946
Please remove the Bugzilla link, it doesn't seem to be public.
If it is then it should be a Link: tag, not a custom tag for bz.
> Signed-off-by: Mike Pattrick <mkp@redhat.com>
> ---
> net/openvswitch/datapath.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
> index 7e8a39a35627..029f9c3e1c28 100644
> --- a/net/openvswitch/datapath.c
> +++ b/net/openvswitch/datapath.c
> @@ -252,10 +252,20 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
>
> upcall.mru = OVS_CB(skb)->mru;
> error = ovs_dp_upcall(dp, skb, key, &upcall, 0);
> - if (unlikely(error))
> - kfree_skb(skb);
> - else
> + switch (error) {
> + case 0:
> + fallthrough;
> + case -EAGAIN:
> + fallthrough;
> + case -ERESTARTSYS:
> + fallthrough;
No need to add the fallthrough;s between two case statements.
> + case -EINTR:
> consume_skb(skb);
> + break;
> + default:
> + kfree_skb(skb);
> + break;
> + }
> stats_counter = &stats->n_missed;
> goto out;
> }
prev parent reply other threads:[~2022-07-30 3:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-28 16:12 [PATCH net-next 1/2] openvswitch: Fix double reporting of drops in dropwatch Mike Pattrick
2022-07-28 16:12 ` [PATCH net-next 2/2] openvswitch: Fix overreporting " Mike Pattrick
2022-07-30 3:31 ` Jakub Kicinski [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=20220729203151.3e849337@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=dev@openvswitch.org \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mkp@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pshelar@ovn.org \
--cc=pvalerio@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).