From patchwork Tue May 10 20:27:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 12845481 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E1EDC433F5 for ; Tue, 10 May 2022 20:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232429AbiEJU1u (ORCPT ); Tue, 10 May 2022 16:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231903AbiEJU1s (ORCPT ); Tue, 10 May 2022 16:27:48 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F3F71A830; Tue, 10 May 2022 13:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YZxChS9o5Wo4/jqgk+/OkB7b4K/AQ5LajGIkh2b6wG0=; b=TUqErr/SLHfftPF8xuuZ41edGc sv5aoLny7nmEg5bGgqeEjNPe/c5sG29/o1OXhJNVb2gMLlYICbK1oiFOtDPxdN7JjJFTELK94aARr +NiCqwCRYdPsZ93j/szkbyjdnL/6rFextUVQ3yhcGwY0qQTUeBdHFxrxO0yEp8i6mk6o=; Received: from p200300daa70ef200adfdb724d8b39c56.dip0.t-ipconnect.de ([2003:da:a70e:f200:adfd:b724:d8b3:9c56] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1noWSO-00067p-5j; Tue, 10 May 2022 22:27:44 +0200 From: Felix Fietkau To: netfilter-devel@vger.kernel.org Cc: netdev@vger.kernel.org, pablo@netfilter.org, Jo-Philipp Wich Subject: [RFC] netfilter: nf_tables: ignore errors on flowtable device hw offload setup Date: Tue, 10 May 2022 22:27:39 +0200 Message-Id: <20220510202739.67068-1-nbd@nbd.name> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC In many cases, it's not easily possible for user space to know, which devices properly support hardware offload. Even if a device supports hardware flow offload, it is not guaranteed that it will actually be able to handle the flows for which hardware offload is requested. Ignoring errors on the FLOW_BLOCK_BIND makes it a lot easier to set up configurations that use hardware offload where possible and gracefully fall back to software offload for everything else. Cc: Jo-Philipp Wich Signed-off-by: Felix Fietkau --- net/netfilter/nf_tables_api.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 16c3a39689f4..9d4528f0aa12 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -7323,11 +7323,9 @@ static int nft_register_flowtable_net_hooks(struct net *net, } } - err = flowtable->data.type->setup(&flowtable->data, - hook->ops.dev, - FLOW_BLOCK_BIND); - if (err < 0) - goto err_unregister_net_hooks; + flowtable->data.type->setup(&flowtable->data, + hook->ops.dev, + FLOW_BLOCK_BIND); err = nf_register_net_hook(net, &hook->ops); if (err < 0) {