From patchwork Mon Oct 24 11:31:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp528643wru; Mon, 24 Oct 2022 09:02:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6KwyfKP3i+Vf3BmlRigRzcXhaJFcepiQcINdLN8uCTmJ9kPrnRcJXSRMNCjvmhZbwF53et X-Received: by 2002:a17:907:a072:b0:7ab:23e9:bc1 with SMTP id ia18-20020a170907a07200b007ab23e90bc1mr1234060ejc.72.1666627347329; Mon, 24 Oct 2022 09:02:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627347; cv=none; d=google.com; s=arc-20160816; b=cr4Yisp9gwnLp7kztHuwH3mwcgkvoU/hSxr736/+CApD6//QJTP5mJdz/ej480YQQu hLMEQRPcPBJ66tqv0MgsCQ9o2XRFnqsK2Q9m+o9JNVeb5hB7t5fdhozU0WRii9OGK9RX aUVCS4lfNFqQj8mlqKOkP7h6cZ67xp1mjbE7SiG/3MX3oxBaYwZ4JKK9tNadKc3smc4I TAQDCzw7/lVHG/ZqOF6TOCzcUW3UMAeJ+yi00HPXly6/PRq+mDb6WNa70Hg2c1j6g9Lm I5qe68YJmhM0mAhxGRIMNKt2ErJxQoR7lTa272qGfKuluD8pSAAf7RAbIU/HwBs0jFcI 4Ngg== 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=Io64MeL0+Xb5ZjqSwo1cspbW4lBwooTpVOjLX7RihVc=; b=TLs0A1/radTI3OP52HHemFvXpTskVjJlOP37+JIDzBdFT3LxLcxVLt4qqZ2HLZtdEs yRCaaCedmj+E4QYd/M/yUuWNSTvlQTACUheq1Pn2DQdZH1MfXnd2+fN2wY3vA+Yj9iAK vRuFyfBSVOlotzz+NAOYMU54YyWWgkBGJMj8S9N2ohcxvW0zMxOlCCD4aDE1g66OqpKL 0V3uBaNkOweUI1V/QX/3bittY5UKIAlpFWBcPDTEpbbmTKL1l4e6O6uMcyzDhN5ugR40 XEDKC3MicIeIbFi2+9nAd5J/p2smObLrqVtipEAkI136FLRm13QoUSwt34HiM9TyZtV7 6kCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=as3enCYU; 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 h9-20020aa7c949000000b0045fd458991fsi101066edt.428.2022.10.24.09.02.00; Mon, 24 Oct 2022 09:02:27 -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=as3enCYU; 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 S231901AbiJXQAX (ORCPT + 99 others); Mon, 24 Oct 2022 12:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232320AbiJXP66 (ORCPT ); Mon, 24 Oct 2022 11:58:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0122D9D507; Mon, 24 Oct 2022 07:54:06 -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 E8743B810F5; Mon, 24 Oct 2022 12:29:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46F56C433C1; Mon, 24 Oct 2022 12:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614562; bh=+/eBksvJ6ANRQNCMZf75gc4o8p99cJ/gFuvAAZ+Tmzg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=as3enCYU+KdrIlKMQRvQvqP+U9Uh9WzHFjepZhL5pap1d0v6yNGQs1ugFvvCE42nk E6gSauiya24kporiXiv3+jSbDR25g1AgcPPqz+WQKu8OP1p7xUlBVRR8broMpJX1Ry 3j2oBBC41qAepg5ryv5jib+V3BbRl28R4CqLy/Vk= 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.10 308/390] openvswitch: Fix overreporting of drops in dropwatch Date: Mon, 24 Oct 2022 13:31:45 +0200 Message-Id: <20221024113036.103797063@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747585437288412279?= X-GMAIL-MSGID: =?utf-8?q?1747585437288412279?= 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 4d2d91d6f990..6b5c0abf7f1b 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -544,8 +544,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; }