Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2661196pxj; Mon, 31 May 2021 07:40:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqseExCr2mTWOi/aF343OfvcfYEO9FFtUAdmR0uOKllktv3YrzcKFVho1ysdBI9WfOTu1S X-Received: by 2002:a92:c987:: with SMTP id y7mr18604067iln.173.1622472006052; Mon, 31 May 2021 07:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622472006; cv=none; d=google.com; s=arc-20160816; b=SjaQTLG0YmB5Ai0oWTPG61eEMnsjhZJmTGmXvLSm+AaORgDwnz2yV+WBvm4NvPucFk Y+aLuyWjs49FX14YBC99zbMLrTElacP7z4eDsA6jrPtT4OYCW5DJhNq0wAIgx7M8GIPL 6dGoSlDK0vxdG6m39hwGiVjzeiend8EJ0C6ya65AJh3hzjjmxRJmqJlNoFcrynhQjG+S S0Xnr2js6uB2ntv0uMr3WghB0qvx54AVLs1iVVizqHAQNw6MFIeWtKlAL0Zmwnb35UOC HZmrfWHBddhxZg0YQ9GEJcQK3IYQGY+VUnXq+00xMeBzydp4EVjgzH5RDe50VT9tyT7k eocA== 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=3Q0hHduRdkWUFZxiJprLvQhb5G3O3tREkW8xI/JwtZg=; b=quO6csWDKUx+9qBml/UnjdIGsW16nJpimg8w4ku85W/2E5Ns1D//u9ZQQ+eDK7hJkH tifvAZhkA9dRkEr4UhfUZtRVZZN35oBwlc0wYYgVF13ymwdHpMB1sODU93wmu1eSIibV rhlNUDmGLY/hwqx8ppYPxF+qIvbhBfIgGiRl+YQjifrgWRxwFpknp/BItUBmlWjjNnMq 7zdVXjbdtLO+VuypEJAlXOvaQ+VWhmEn26kn/Fkzx8w3Zith36jn1LhvR4PN9GhxRx5J M1mWgQ+CaWpB0hs9rQC8RwXbk6J9czJlxv3nM69nP6hwyNRCAq8WluOFSAvHTyEKIoAz YhhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=maVZi8Tt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si14510875ioh.90.2021.05.31.07.39.53; Mon, 31 May 2021 07:40:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=maVZi8Tt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233681AbhEaOjL (ORCPT + 99 others); Mon, 31 May 2021 10:39:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:32910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232759AbhEaN4v (ORCPT ); Mon, 31 May 2021 09:56:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 35A5A61928; Mon, 31 May 2021 13:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468089; bh=mJZZESu7onxs+AFyKz9Fe58/Ot8yvuZfmrntJunAZyo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=maVZi8Tt+8O8AvLNtLVClu2+Pg3UebHrCBjouvgiauzGz2LhVgzdOjJqMuBL/PP0l ZI0uIf4kqGAo3YO4R1wV0fURX7NQ94DWJCtJMu2M47xi9eBOeOxdZuNP5BpQ7TUnWL rVA7HDHMl2NeOkfNYw1Tky3mIgvsbEEEENp5/T0s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roi Dayan , Pablo Neira Ayuso Subject: [PATCH 5.10 111/252] netfilter: flowtable: Remove redundant hw refresh bit Date: Mon, 31 May 2021 15:12:56 +0200 Message-Id: <20210531130701.748140646@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roi Dayan commit c07531c01d8284aedaf95708ea90e76d11af0e21 upstream. Offloading conns could fail for multiple reasons and a hw refresh bit is set to try to reoffload it in next sw packet. But it could be in some cases and future points that the hw refresh bit is not set but a refresh could succeed. Remove the hw refresh bit and do offload refresh if requested. There won't be a new work entry if a work is already pending anyway as there is the hw pending bit. Fixes: 8b3646d6e0c4 ("net/sched: act_ct: Support refreshing the flow table entries") Signed-off-by: Roi Dayan Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- include/net/netfilter/nf_flow_table.h | 1 - net/netfilter/nf_flow_table_core.c | 3 +-- net/netfilter/nf_flow_table_offload.c | 7 ++++--- 3 files changed, 5 insertions(+), 6 deletions(-) --- a/include/net/netfilter/nf_flow_table.h +++ b/include/net/netfilter/nf_flow_table.h @@ -126,7 +126,6 @@ enum nf_flow_flags { NF_FLOW_HW, NF_FLOW_HW_DYING, NF_FLOW_HW_DEAD, - NF_FLOW_HW_REFRESH, NF_FLOW_HW_PENDING, }; --- a/net/netfilter/nf_flow_table_core.c +++ b/net/netfilter/nf_flow_table_core.c @@ -259,8 +259,7 @@ void flow_offload_refresh(struct nf_flow { flow->timeout = nf_flowtable_time_stamp + NF_FLOW_TIMEOUT; - if (likely(!nf_flowtable_hw_offload(flow_table) || - !test_and_clear_bit(NF_FLOW_HW_REFRESH, &flow->flags))) + if (likely(!nf_flowtable_hw_offload(flow_table))) return; nf_flow_offload_add(flow_table, flow); --- a/net/netfilter/nf_flow_table_offload.c +++ b/net/netfilter/nf_flow_table_offload.c @@ -753,10 +753,11 @@ static void flow_offload_work_add(struct err = flow_offload_rule_add(offload, flow_rule); if (err < 0) - set_bit(NF_FLOW_HW_REFRESH, &offload->flow->flags); - else - set_bit(IPS_HW_OFFLOAD_BIT, &offload->flow->ct->status); + goto out; + set_bit(IPS_HW_OFFLOAD_BIT, &offload->flow->ct->status); + +out: nf_flow_offload_destroy(flow_rule); }