Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp876052rwi; Wed, 19 Oct 2022 04:11:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WjTjC0XHM1a95f6gZWZazd8LQj616pmgy9CER1K4UaypmJPz4BCuCYpiSO+smVRDUzj6D X-Received: by 2002:a17:903:1cc:b0:185:45e8:221d with SMTP id e12-20020a17090301cc00b0018545e8221dmr7771303plh.17.1666177910233; Wed, 19 Oct 2022 04:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666177910; cv=none; d=google.com; s=arc-20160816; b=v9hJceLfRfxHwCoXj1hepjoCuHMGhF4EkEcKqnLXdeBjLcabFeauVLpKnUTK74cViW Hb99pL5A84LK+RZikKptX+ol6oytvMr6fxWRTdZlNhiCPAYy5IIdiex3Ze05F2XoK8LL 9CS4MiP83g0YohBhG7s1P0P3gjFUh5TvEoKm+My1OD0alImaOdi6NJyLoHIewLQ3/3B3 24C/wy+qqc06enPLL6WG0qbpyDnIIV7M2b1YHIi4EGpifXDs1sGfIBNIeV9AZnjnjoO2 Ec2wAU/bdLWAmFxP36X+W9sVWbgGfuTXINmSKBTk7wyZeq8nBWx3iNKMcODXfSUx4oqn 1N2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=upLYNCXacljai2OhbOt70SA01rjVr9a4nZA4cUWx1uU=; b=oxAfK2NOaRJVWafehRlDRXoFnQu32mi2FZZLR0yaSvikmuBGydLqQkwNaDhm+ZHJ/9 KPE5XaWMp/ytyV8fbK1eEC+RVffo0uHgPCL1BSMaB9b4b5Pq++hINfRutyPmqx01sHV/ wwGUUJF+erlrXwm7wRgEfFV8t71mB0ieMpccnQsi5WiupyTx01oGCi3priXgL8a3hIly 8GSkGt0kO/7S2tHYi28klevdk/3xXKpeFFOOX4Ayh+4KXwImjZFEf6aOfJV234r4s9mb wPuOZJH5gt4Nysy4Z3nx4Go6cD8vHhyJE3AAz/hubRFT3MkK59x9KtVWJlKWzhIvQtpx XwZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ORSPEH+l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w7-20020a63d747000000b004308011fd84si17469675pgi.426.2022.10.19.04.11.31; Wed, 19 Oct 2022 04:11:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ORSPEH+l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234736AbiJSLAL (ORCPT + 99 others); Wed, 19 Oct 2022 07:00:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234864AbiJSK7B (ORCPT ); Wed, 19 Oct 2022 06:59:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 618B7169CC1; Wed, 19 Oct 2022 03:28:49 -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 166E0B824A6; Wed, 19 Oct 2022 09:08:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C767C433D6; Wed, 19 Oct 2022 09:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170517; bh=F91BAdOXkp+xhwYRMD0QHptsZMxc0ARjOGzeltr8YbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ORSPEH+lKHqonU4LO7/hZG2t52IKRnBr8Dy2BGItcLwQQCmT3RLhJ43BAf01or4XA 0c20p5pP3OPUL2LTguWZ81aOGV620iC1QdkAIbDWbQcwxZlgk2EUPemuY81io8VLKs 4s9PxUjBbir8tXK/kwZXMAaRtL2SwoGXLWcl509Y= 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 6.0 686/862] openvswitch: Fix overreporting of drops in dropwatch Date: Wed, 19 Oct 2022 10:32:53 +0200 Message-Id: <20221019083320.298823380@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 b68ba3c72519..93c596e3b22b 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -558,8 +558,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