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 660F3C433E1 for ; Tue, 9 Jun 2020 18:01:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38A9F20734 for ; Tue, 9 Jun 2020 18:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591725698; bh=ArYRBpuJodeEIGm6WlIhSRxpcfAXCQI3/0XRtuztKYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Goq5t+h5ZMSfNepyYF9D3XM2rEY77gJnmZP88cNJJzmy8o6poiV2khiF5vM0bV9gw Bah4lrzNu4X62RCJnBD0n47z+6frJapDcZafm+zWsAjSrG+otGXmk49Zq5kGTIQ4ey w5rfCPplhzUxAamjBPCQixPJcAGb4SCOSpcW83PA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387813AbgFISBf (ORCPT ); Tue, 9 Jun 2020 14:01:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:45422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731682AbgFIRyD (ORCPT ); Tue, 9 Jun 2020 13:54:03 -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 34E2D207ED; Tue, 9 Jun 2020 17:54:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591725241; bh=ArYRBpuJodeEIGm6WlIhSRxpcfAXCQI3/0XRtuztKYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rKp9kcTidBUsUbRc2jjJMF5ZCJvQJhVLkkEVYdExeuHH918tgPnJ8CXG+avgGx8po SEI9ECGDhgpyMi5HVSEVjBOxHYbGYgfAKH/YvQ9SxtKlGGKMAyXLzDE4x5XpyCu7qG 2VX+v46V9ddj5oCKIcgpS6VY0HsZNLOK35Ow+trU= 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.6 09/41] nfp: flower: fix used time of merge flow statistics Date: Tue, 9 Jun 2020 19:45:11 +0200 Message-Id: <20200609174113.004985779@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200609174112.129412236@linuxfoundation.org> References: <20200609174112.129412236@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -1440,7 +1440,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); } }