netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Mike Pattrick <mkp@redhat.com>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	pshelar@ovn.org, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org, dev@openvswitch.org
Subject: [PATCH AUTOSEL 4.9 02/16] openvswitch: Fix overreporting of drops in dropwatch
Date: Sun,  9 Oct 2022 18:26:58 -0400	[thread overview]
Message-ID: <20221009222713.1220394-2-sashal@kernel.org> (raw)
In-Reply-To: <20221009222713.1220394-1-sashal@kernel.org>

From: Mike Pattrick <mkp@redhat.com>

[ Upstream commit c21ab2afa2c64896a7f0e3cbc6845ec63dcfad2e ]

Currently queue_userspace_packet will call kfree_skb for all frames,
whether or not an error occurred. This can result in a single dropped
frame being reported as multiple drops in dropwatch. This functions
caller may also call kfree_skb in case of an error. This patch will
consume the skbs instead and allow caller's to use kfree_skb.

Signed-off-by: Mike Pattrick <mkp@redhat.com>
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2109957
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/openvswitch/datapath.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index ab318844a19b..10423757e781 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -555,8 +555,9 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
 out:
 	if (err)
 		skb_tx_error(skb);
-	kfree_skb(user_skb);
-	kfree_skb(nskb);
+	consume_skb(user_skb);
+	consume_skb(nskb);
+
 	return err;
 }
 
-- 
2.35.1


  reply	other threads:[~2022-10-10  0:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-09 22:26 [PATCH AUTOSEL 4.9 01/16] openvswitch: Fix double reporting of drops in dropwatch Sasha Levin
2022-10-09 22:26 ` Sasha Levin [this message]
2022-10-09 22:26 ` [PATCH AUTOSEL 4.9 03/16] tcp: annotate data-race around tcp_md5sig_pool_populated Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 04/16] xfrm: Update ipcomp_scratches with NULL when freed Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 05/16] net: xscale: Fix return type for implementation of ndo_start_xmit Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 06/16] net: lantiq_etop: " Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 07/16] net: ftmac100: fix endianness-related issues from 'sparse' Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 08/16] Bluetooth: L2CAP: initialize delayed works at l2cap_chan_create() Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 09/16] net: davicom: Fix return type of dm9000_start_xmit Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 10/16] net: ethernet: ti: davinci_emac: Fix return type of emac_dev_xmit Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 11/16] net: korina: Fix return type of korina_send_packet Sasha Levin
2022-10-17 10:25   ` Pavel Machek
2022-10-17 12:50     ` Pavel Machek
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 12/16] Bluetooth: hci_sysfs: Fix attempting to call device_add multiple times Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 13/16] can: bcm: check the result of can_send() in bcm_can_tx() Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 14/16] wifi: rt2x00: don't run Rt5592 IQ calibration on MT7620 Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 15/16] Bluetooth: L2CAP: Fix user-after-free Sasha Levin
2022-10-09 22:27 ` [PATCH AUTOSEL 4.9 16/16] r8152: Rate limit overflow messages Sasha Levin

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=20221009222713.1220394-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkp@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pshelar@ovn.org \
    --cc=stable@vger.kernel.org \
    /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).