Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4044733rwb; Sun, 9 Oct 2022 16:43:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4e7TG7Zi4Pk0XHOhJEz1yCFW0NU3aPX8g24rr1XyhK5wH7CCdXbqP3VLEBxVLrxl6ylyAy X-Received: by 2002:a17:902:8c81:b0:178:a33f:8b8f with SMTP id t1-20020a1709028c8100b00178a33f8b8fmr16862647plo.50.1665358989434; Sun, 09 Oct 2022 16:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665358989; cv=none; d=google.com; s=arc-20160816; b=d9c0Udc8YXR1IphM1bGEbYjctW0jmu1MSNSpmu5OL67XiTChJcolH9wKZL4A4BqS7t +TNWjSN33vqHOxVZff7/Wz+Qc+11QyMGDYoj1cBvMowpe1ll3ky0mzEg6yYqv9xlc2/s /Tos3M/rZ4ygX+FbeKyMNPNe1MOgmMkx6C60e9nVv5swaUsLjeVG1779ykI7QFrLliv7 n/SDOmn31jNZ8px4CoyEwFwiZV6EbOoU/m+uKgF4g8MfvldO4fDeKJYs+6OlytbghG9Q VuZsKN9KOYzZ18JyM3KtUVnW6B9ctaLyf+64Ss0RhVL/z3CZmHOE2ck6IvmQsBnVknuz 3Qkg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=upLYNCXacljai2OhbOt70SA01rjVr9a4nZA4cUWx1uU=; b=vUUuuBbNwjZtW7R4BZsVKa9mLX8YIshQpQ8uATw7ghLi6jRExLVj6TPfWDBb3cYskv JnI+fKi1SUY3CBxW3+SRGrpQ/XAKcJDeuZ+yGQ8PCeud1gTOi0Ckzg5+FUWr9wNnuYdz /TD0rXfbDz9AZP53b6YnHovB1b6x3S0abmjER8ouAvYroPRp/ehBz5on/XCIMwmhw9bw S4baMJLqy2pe7VlPJ9ucjWpsT1moqsmIqU8XJY/3/9N2mAN1YJ1d8affjo/OozoJ8jIg vmFEQ4tILqLTNkYGokwG+VWhsAfc6Vl/SDV/UkspnW+aUE6FweTrNtUEhxLOaktk2gHh 2W/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pGhsKRQP; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p22-20020a631e56000000b0043941763eadsi11557644pgm.835.2022.10.09.16.42.58; Sun, 09 Oct 2022 16:43:09 -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=@kernel.org header.s=k20201202 header.b=pGhsKRQP; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231158AbiJIWJ2 (ORCPT + 99 others); Sun, 9 Oct 2022 18:09:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230250AbiJIWIy (ORCPT ); Sun, 9 Oct 2022 18:08:54 -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 886C12936A; Sun, 9 Oct 2022 15:08:29 -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 9D44460CF1; Sun, 9 Oct 2022 22:08:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE45DC433C1; Sun, 9 Oct 2022 22:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665353304; bh=F91BAdOXkp+xhwYRMD0QHptsZMxc0ARjOGzeltr8YbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pGhsKRQPKjmiZXvXeDAz+YoOJXTqF+iqFhaGySScIv1RVJg3kJZy/8wrI2Nb/WIi/ yc71rQn/TaQNfOoH/FJZVXmE79nbVwDaFAFEYkLw0hVmoAXsOFZS+7eOAdf52kJdxC FS2ttFMO/AyxqAO5lNLDpAObocRCTykU6ffu24RaYsrdGXf8ZpDIHIIF3bYYgFb7qQ j0U6hy//X1h6iZ+AEz6/57nyHaToa+awV6vQsxEugGTSbQLbrolC0Wiq4dEnOfU93c 5ogHVdBiKPKYanKix1fgBXf2YfPo6A4AFMPeIEysXmtJxBXxvk7HYOYVp9DsA088Sp V6zAEriaiSJpw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mike Pattrick , "David S . Miller" , Sasha Levin , pshelar@ovn.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, dev@openvswitch.org Subject: [PATCH AUTOSEL 6.0 10/77] openvswitch: Fix overreporting of drops in dropwatch Date: Sun, 9 Oct 2022 18:06:47 -0400 Message-Id: <20221009220754.1214186-10-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221009220754.1214186-1-sashal@kernel.org> References: <20221009220754.1214186-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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