From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 141DFC433F5 for ; Mon, 10 Oct 2022 00:11:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230201AbiJJALb (ORCPT ); Sun, 9 Oct 2022 20:11:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230092AbiJJALD (ORCPT ); Sun, 9 Oct 2022 20:11:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C0E588DE9; Sun, 9 Oct 2022 16:45:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A572CB80DEE; Sun, 9 Oct 2022 22:27:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69FB1C433D6; Sun, 9 Oct 2022 22:27:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665354437; bh=s8XvSJ0CBvwlnj1YP3pu0XkLAMDkv8P0FO3gc3W4WDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dBki8gONEH7amQcah7+A/Gp1KPCIff1PI7APirH6Tj8yhIg9jchw+99nEiwW5Rqe6 lSwPU9K4d18o3utljZqIE8+olTjRSFW5b4XETUwYrQmQVGKkD+TOKIRVkMyuFbsHbh QEbj6Uq0XNjcApaVCfyRTCTlo1JvOskK0QAg3Chx2poDEqJNKRtoJwbsxfS3qziXIv HaCtN+Bi826/bckt17BY0VFL6NIvyeLIoDXjMVFCzXmGvb9pygG6r0qpFpfuOCXoN2 eMXvpDeMW407hYXnmatNSWR8lcC6vB4vFv/BxslSXPIbBOoW1de1ez7DoyEiHPRcTj 8x142O5OoV3tQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mike Pattrick , "David S . Miller" , Sasha Levin , 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 Message-Id: <20221009222713.1220394-2-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221009222713.1220394-1-sashal@kernel.org> References: <20221009222713.1220394-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Pattrick [ 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 Link: https://bugzilla.redhat.com/show_bug.cgi?id=2109957 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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