From patchwork Mon Oct 24 11:31:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8983 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp438862wru; Mon, 24 Oct 2022 06:01:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+XOSWQtxWp+uWdEdpBLkTBvHpBhzmGUxt5iqh9fmTlooh8fEPjrVtX/MI1L+BqXXlr4gV X-Received: by 2002:a65:42c7:0:b0:462:7158:c863 with SMTP id l7-20020a6542c7000000b004627158c863mr28711447pgp.590.1666616513819; Mon, 24 Oct 2022 06:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666616513; cv=none; d=google.com; s=arc-20160816; b=bhmXBfT7HQGeDVlyKajtmzjFwoJ2jmbjBRAN4ODqSeoHgICAhwngZntNNjGpC7zOPQ 1WUrtOqI3okeM7rWO5DVj3QwGXSEEGNuwk3pW9uN3/YiIQ7lbPHqf4Nq5KJJ++umUIOY 3sEzRVoxsezxvxQWzjxyDWLP4ydyOJXXf/ec4wqFn+0EgZlHmUcLbcIFcvXh/YeI5i9N upVQYhYRJsgT/lHoieXr8oVT94J6OkdSG3qXs+O0zk07I5+P/YNN6VUCu80W71knPxWd 9koGUwpRoC2eXGZip7uwAVtwQQKC56zmctsC2P5N1KRU+aaMj1Lx3/m3Z/OQAZRjSBv+ mC/g== 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=JKVAtaPx6MvbX4+NsRQpoPgTkqL9Rb/lTwW0ikrVIlU=; b=VH1zuB7iFWy1zxrzZfuXwWKEV9pAd4rY66EyY6sBqv7xeZWMEhpv1zsVW7BHqHzviJ T8ulYoXp4v8HNALNfMDr3etseukQ/yW3hOM7ZLsFiiI3cAan7QvbEK2O7HiT4fhvrwlY y7iyd59hZnM+Alg9biAvvp+4RYZFISE4Jt6dGPxwdanB1vYXUKs/a4Izm5NYqweNnX7s cTUJiE/MecAD53flmGbgHlMW6w/ivuymGcG42/emdSMiVTT9uO1CfLwjKn1YAp1UiUmh 96Zyzw5eZra7lRidGLslXXOUJMF5Fwyl6tDem8E67miSfQVW3L48QuxqbJf//Ho4uNJx bSHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="XtLn2jT/"; 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 m10-20020a056a00080a00b0056bc1d790ebsi4968587pfk.57.2022.10.24.06.01.19; Mon, 24 Oct 2022 06:01:53 -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="XtLn2jT/"; 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 S234959AbiJXNAr (ORCPT + 99 others); Mon, 24 Oct 2022 09:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234872AbiJXM6j (ORCPT ); Mon, 24 Oct 2022 08:58:39 -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 C217F97D55; Mon, 24 Oct 2022 05:17:20 -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 CBBA26131B; Mon, 24 Oct 2022 12:14:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D99A1C433C1; Mon, 24 Oct 2022 12:14:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613669; bh=9XVHi6LjLIEvFxinmzDv+KRBll8JSc+JVj9D8ceuSkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XtLn2jT/SCxL9A3hh+Q4DmnH6S12CLdeQlmklTEoDQHJH3W+Kb3WvMcQrE+JSmHYZ y4w+tbJCGY0j3vCTH+gdcEpzdARpjvTD6SbTlMoBZNIZYo8jkCJ8cFGLqqNg3D9g+0 6eBkBz6aEsLLl74OeTCE/AJ6O57Mt3ZJw/B8iAGo= 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.4 194/255] openvswitch: Fix overreporting of drops in dropwatch Date: Mon, 24 Oct 2022 13:31:44 +0200 Message-Id: <20221024113009.435496843@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747574077819903939?= X-GMAIL-MSGID: =?utf-8?q?1747574077819903939?= 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 63f36d6cd3f6..41035ce0d23c 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -532,8 +532,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; }