From nobody Fri Dec 19 15:44:53 2025 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 8FE3EECAAA1 for ; Mon, 24 Oct 2022 14:12:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232926AbiJXOMk (ORCPT ); Mon, 24 Oct 2022 10:12:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236202AbiJXOJd (ORCPT ); Mon, 24 Oct 2022 10:09:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C68FCC5124; Mon, 24 Oct 2022 05:51:26 -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 dfw.source.kernel.org (Postfix) with ESMTPS id DF33B61331; Mon, 24 Oct 2022 12:51:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEC8EC433D7; Mon, 24 Oct 2022 12:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615885; bh=uk/uq2MRrmO+B59iIrc1Ry7He0L4UKElnCduIvl+tGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TdgzNRSPSND1XEoaCV+39Ux/Gn4CDV8M9r3VOztgh6AVddivSr9qNYkszpRb0dsVS g6dWBLRy1cDVTv/3+VTnR1CyVj0VwWfj0odWuX7qFoUYewMXpcD2X5oC0sovzH+0FM FFI+I6xhvwkq6Z5RLu+0w7UYSjYKVZdFK+pBJl+A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Pattrick , "David S. Miller" , Sasha Levin Subject: [PATCH 5.15 420/530] openvswitch: Fix overreporting of drops in dropwatch Date: Mon, 24 Oct 2022 13:32:44 +0200 Message-Id: <20221024113104.101613497@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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=3D2109957 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 f4b088d418fb..46ef1525b2e5 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -557,8 +557,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; } =20 --=20 2.35.1