From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 234CDC433E1 for ; Tue, 9 Jun 2020 17:52:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA34A207F9 for ; Tue, 9 Jun 2020 17:52:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591725153; bh=8YhENcGm/KsO1RO/b6JPjuxL+YBUf0Nsx3uSX/EKGHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XtHWQfx1nEK2fXyf/Or4EtMZe7O2iOCELy6NGxN4W6RuFP7JXtluMJb5LN/wTcvx7 4uHxkX30UxS33G7sVmBwj/L43UqgMA50UGLU/mQFNEFeQxkbjDss9zGDpb61fLigOe PTTboLHELeBei7AT4UOP9vdfZI0wEvCqJZ/UU9do= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732893AbgFIRwb (ORCPT ); Tue, 9 Jun 2020 13:52:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:42826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732896AbgFIRwa (ORCPT ); Tue, 9 Jun 2020 13:52:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3616520774; Tue, 9 Jun 2020 17:52:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591725149; bh=8YhENcGm/KsO1RO/b6JPjuxL+YBUf0Nsx3uSX/EKGHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H4JzjI7+x3+bKhnwCYLss/0ZUUsFynVUeyUw23WMwyS/CXt4JaLEV0rki/ioGQZ2W E4qT6GdUY+EKZyzOBpBFzf1AGFw17+FnfhU4aAesvNW+mERjQx/lXOZT/eUwuJ0+aL o0CsTjQ7tyhyh20ZiTfX8b0p30t7z4H3RkyC472M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heinrich Kuhn , Simon Horman , "David S. Miller" Subject: [PATCH 5.4 08/34] nfp: flower: fix used time of merge flow statistics Date: Tue, 9 Jun 2020 19:45:04 +0200 Message-Id: <20200609174053.651825953@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200609174052.628006868@linuxfoundation.org> References: <20200609174052.628006868@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Heinrich Kuhn [ Upstream commit 5b186cd60f033110960a3db424ffbd6de4cee528 ] Prior to this change the correct value for the used counter is calculated but not stored nor, therefore, propagated to user-space. In use-cases such as OVS use-case at least this results in active flows being removed from the hardware datapath. Which results in both unnecessary flow tear-down and setup, and packet processing on the host. This patch addresses the problem by saving the calculated used value which allows the value to propagate to user-space. Found by inspection. Fixes: aa6ce2ea0c93 ("nfp: flower: support stats update for merge flows") Signed-off-by: Heinrich Kuhn Signed-off-by: Simon Horman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/netronome/nfp/flower/offload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c @@ -1368,7 +1368,8 @@ __nfp_flower_update_merge_stats(struct n ctx_id = be32_to_cpu(sub_flow->meta.host_ctx_id); priv->stats[ctx_id].pkts += pkts; priv->stats[ctx_id].bytes += bytes; - max_t(u64, priv->stats[ctx_id].used, used); + priv->stats[ctx_id].used = max_t(u64, used, + priv->stats[ctx_id].used); } }