From patchwork Wed Oct 19 08:32:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5174 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp255185wrs; Wed, 19 Oct 2022 04:01:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4FzJp8w0ELe0LEFr2Elua1ppVpFmA1+5BUKSxSoI4cLOIqzrjgXMXjlrRFjmmE/1OPLs8C X-Received: by 2002:a63:4c17:0:b0:43b:e31c:efd0 with SMTP id z23-20020a634c17000000b0043be31cefd0mr6782973pga.213.1666177281584; Wed, 19 Oct 2022 04:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666177281; cv=none; d=google.com; s=arc-20160816; b=RiU0WZYNzgCELSQQBxxKVPy15Ws7Bw8bqloHBr2sCO3RfsHvGFfLzlPKExgdGy/els gcHbLL+Abl3eUCO+oZNLy6JD04olS8g3w2i4N0HUJW18pFsc9waeWFf5sbpn16jYtwXi TGkQfvxkZGzfqWbx0sCquSqIpZCoFCwoEsslvw3OP3ObW4192OcifmLHs3DTHvysT4wE P+ij+Z9we5jxgFuVedw74e3Hvr5AZIPRz813FP1NjGwZkYr4TVwNqpNd8SnnD5LiEbcB 2dOhi0ZYzyS8vs/LY0SDg8X32ioFHDA2NNElyljmQM+K9Y1s7eJa/LQaYEt/FIm0ZJDF +CBQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u7-20020a170902e80700b001786d7bc2dfsi16984537plg.400.2022.10.19.04.01.07; Wed, 19 Oct 2022 04:01:21 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747113509526560618?= X-GMAIL-MSGID: =?utf-8?q?1747113509526560618?= 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; }