From patchwork Sat Oct 22 07:27:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7597 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1106391wrr; Sat, 22 Oct 2022 01:37:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4f19BYwpsaiOlBw8dBDeFZQANezSwFzkCEK7eIpbTG8olS60c5ua43UZnDru/1DjwNdQph X-Received: by 2002:a05:6402:3592:b0:45c:fb8a:c57d with SMTP id y18-20020a056402359200b0045cfb8ac57dmr21599339edc.290.1666427864626; Sat, 22 Oct 2022 01:37:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427864; cv=none; d=google.com; s=arc-20160816; b=kIuH7lclsMe1tiblyPMPQgS26EvqO061USYz61Z4L7xnlDiWf6MRY25denrqHNnQb/ XOLYEK/Ke0b4xNks0nRA8BaCxVQ+oAwdOFtTsBtFL6TYdpewlZAHlPusdb8pDFs0yn8e hPARBqbOkurYYjZhWaU+3vC7ssYTYtUWRxKKcjtj5DUy91IZqT/HDM94BBfkU/CDjggy BoPInArxlN6tjhbJ2lyiD6dsFCCCHSs9geNhQuk8X3/2Ppl74k2EVFjOflmqhw5I6css c/THTXuL7uRi2T7xFCianZd0TXnWv4jpPjc0gN5/LS6WAywuh+22gNrEUIb3vZ1vhrUy Vvdw== 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=yhoenNPgLeuCPu1C/y2as/HkqiGSEvx2DsZRgcc0wHWliX7VgXvG4CpqEk0mss3B3e V2Y7k+9FREz8y+mdk8Mf1PXV6k9XfpD/j5NvbskZRZiMzuzzhhPTUE0QFUSOcMRzv/9V Hisy29ro+vVkOX1G1lqclNib9G65thzCTK9u5Wdsy4aFlYLSR3QUNIxQv81qwj5ERZrh EdhMwBYZpoyKmpUedcHnketbpYfRO2iF5iPPH9XsJrFVUBdHrtBOkqlDel1rIvAzQ8rW sRopNqy01smmdbC+vScPvTn3VX5flXAJKdXqfipTV5puvzD/mPOw6EDQUqFETyLi1TEc Uapg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VrA7DBdj; 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 oz39-20020a1709077da700b0073d581b0906si25930420ejc.278.2022.10.22.01.37.19; Sat, 22 Oct 2022 01:37:44 -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=VrA7DBdj; 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 S234044AbiJVIc2 (ORCPT + 99 others); Sat, 22 Oct 2022 04:32:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234032AbiJVI3Q (ORCPT ); Sat, 22 Oct 2022 04:29:16 -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 BE7682C1737; Sat, 22 Oct 2022 01:01:57 -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 44DBB60ADC; Sat, 22 Oct 2022 08:01:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09933C43142; Sat, 22 Oct 2022 08:01:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425716; bh=F91BAdOXkp+xhwYRMD0QHptsZMxc0ARjOGzeltr8YbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VrA7DBdj7K79r6sG8jvcO8IyO+OUkxyfZGapubgS0ruEVWyi1J4/xoKvykQQtoWEV JqHjxQOOcd/xLARZwYkZaRyxXxhHm1QaUF2blUAQEQwNLPU8Nbo46At5rG0wL8fQwR FDllUjCEVAhPJphpGMnz74ZpTwdflPIOvOZWx1e0= 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.19 562/717] openvswitch: Fix overreporting of drops in dropwatch Date: Sat, 22 Oct 2022 09:27:21 +0200 Message-Id: <20221022072523.240830899@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376264576481332?= X-GMAIL-MSGID: =?utf-8?q?1747376264576481332?= 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; }