Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3039703pxb; Mon, 18 Oct 2021 07:07:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZzIDxfDAEX2vem4HeJHFfN6G0kdzIyy+5LIsdeM/7p/V6KWYXnFCaBw/9bb7R1Y95JRAm X-Received: by 2002:aa7:8bd4:0:b0:44c:f89d:7e72 with SMTP id s20-20020aa78bd4000000b0044cf89d7e72mr28879622pfd.71.1634566020056; Mon, 18 Oct 2021 07:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634566020; cv=none; d=google.com; s=arc-20160816; b=r1/ZbWMZS4Mv68sGkJOS+5HTYq58FCbIjEiQUO/8YouO7VbzORfPtDNg+KMU+Y0q2o oT6G/H76blM1dh3sLf1Nd0SEhEBdFXp0ll6E4xEC2b94Je68447HTfLOSNDBOO+g0HuI aRCwPQsTjEhNj0BVD7CusXB3gNg0Xa+RRGBVsN82ZAtjQURIJBgHczNtTaFqFNeWkGXj E9uPDNiB7xK/xPVyb0qNQoqMO54ogwNgfrMUehWpkqQGWixDfviXXU5EB5l7kfB01OUv o3ANuUPLD3Zi6sEipMSfgsFBx3PP/7tHre0jnnZGwYpbXa6tsbr2arEiKcmvwMICmxgP IAZA== 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=zx6ehjx7N65UpnaaYh8eA+DrFIxr+xmpCPv6dIKaWwY=; b=SAe2peYnPWIX4AQrh0WYB7gDQxZDz/g+6bkYeaGHKiHMfbliMTXRJ6/Y8dbLOWzPfd UcsHxcv7TCFnEDrl8xutikL2K1l5+EEDcQm+bV17SIyAwFef6RbdLG4jxQmHADbcZHZl GIQPjEzzKbKKaqFwXm/oJMNYJmXwlH8XKjM3zY9jUwztG+w9QYMi/vxm4P41wAO85RZP gI1RGvhRn7JYH1e2vv5S3vNjaiTjz9AfK2dL+4dzNO8e7HIpdhwiJPvSLOMscytrSJd4 1V6Yx3UmGVU65l796ZFrka0YIyQh31T9sENDspTwLk2Wcz6XKIolu41stuZkZs7dIAHZ ozfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E0TgnQGW; 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 t4si1480785pfg.56.2021.10.18.07.06.45; Mon, 18 Oct 2021 07:07:00 -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=E0TgnQGW; 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 S234728AbhJROG0 (ORCPT + 99 others); Mon, 18 Oct 2021 10:06:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:39880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234843AbhJROD0 (ORCPT ); Mon, 18 Oct 2021 10:03:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7BEF061529; Mon, 18 Oct 2021 13:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564614; bh=jqL16xTccPc2iQwfJ90ixrkDYzSs3Zd9Cx3u7sMDWFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E0TgnQGWf4lyFvblgiccSzCrvJO82k69/cOrluKtqHpZ5Tq0ZJUNO/zW6yWCmp6Ko X97PTpamSWVssw9P5LMC1eYgS+2q/OQRjUE0pXz3Nr7mzDfn20dEwPD1WcR52hs3cy altjc6vXiM8cYISkWahZ3E0sI77rkEo+sxV4ntN4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Baowen Zheng , Simon Horman , Louis Peens , Jakub Kicinski Subject: [PATCH 5.14 144/151] nfp: flow_offload: move flow_indr_dev_register from app init to app start Date: Mon, 18 Oct 2021 15:25:23 +0200 Message-Id: <20211018132345.347006499@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@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: Baowen Zheng commit 60d950f443a52d950126ad664fbd4a1eb8353dc9 upstream. In commit 74fc4f828769 ("net: Fix offloading indirect devices dependency on qdisc order creation"), it adds a process to trigger the callback to setup the bo callback when the driver regists a callback. In our current implement, we are not ready to run the callback when nfp call the function flow_indr_dev_register, then there will be error message as: kernel: Oops: 0000 [#1] SMP PTI kernel: CPU: 0 PID: 14119 Comm: kworker/0:0 Tainted: G kernel: Workqueue: events work_for_cpu_fn kernel: RIP: 0010:nfp_flower_indr_setup_tc_cb+0x258/0x410 kernel: RSP: 0018:ffffbc1e02c57bf8 EFLAGS: 00010286 kernel: RAX: 0000000000000000 RBX: ffff9c761fabc000 RCX: 0000000000000001 kernel: RDX: 0000000000000001 RSI: fffffffffffffff0 RDI: ffffffffc0be9ef1 kernel: RBP: ffffbc1e02c57c58 R08: ffffffffc08f33aa R09: ffff9c6db7478800 kernel: R10: 0000009c003f6e00 R11: ffffbc1e02800000 R12: ffffbc1e000d9000 kernel: R13: ffffbc1e000db428 R14: ffff9c6db7478800 R15: ffff9c761e884e80 kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 kernel: CR2: fffffffffffffff0 CR3: 00000009e260a004 CR4: 00000000007706f0 kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 kernel: PKRU: 55555554 kernel: Call Trace: kernel: ? flow_indr_dev_register+0xab/0x210 kernel: ? __cond_resched+0x15/0x30 kernel: ? kmem_cache_alloc_trace+0x44/0x4b0 kernel: ? nfp_flower_setup_tc+0x1d0/0x1d0 [nfp] kernel: flow_indr_dev_register+0x158/0x210 kernel: ? tcf_block_unbind+0xe0/0xe0 kernel: nfp_flower_init+0x40b/0x650 [nfp] kernel: nfp_net_pci_probe+0x25f/0x960 [nfp] kernel: ? nfp_rtsym_read_le+0x76/0x130 [nfp] kernel: nfp_pci_probe+0x6a9/0x820 [nfp] kernel: local_pci_probe+0x45/0x80 So we need to call flow_indr_dev_register in app start process instead of init stage. Fixes: 74fc4f828769 ("net: Fix offloading indirect devices dependency on qdisc order creation") Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Signed-off-by: Louis Peens Link: https://lore.kernel.org/r/20211012124850.13025-1-louis.peens@corigine.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/netronome/nfp/flower/main.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) --- a/drivers/net/ethernet/netronome/nfp/flower/main.c +++ b/drivers/net/ethernet/netronome/nfp/flower/main.c @@ -830,10 +830,6 @@ static int nfp_flower_init(struct nfp_ap if (err) goto err_cleanup; - err = flow_indr_dev_register(nfp_flower_indr_setup_tc_cb, app); - if (err) - goto err_cleanup; - if (app_priv->flower_ext_feats & NFP_FL_FEATS_VF_RLIM) nfp_flower_qos_init(app); @@ -942,7 +938,20 @@ static int nfp_flower_start(struct nfp_a return err; } - return nfp_tunnel_config_start(app); + err = flow_indr_dev_register(nfp_flower_indr_setup_tc_cb, app); + if (err) + return err; + + err = nfp_tunnel_config_start(app); + if (err) + goto err_tunnel_config; + + return 0; + +err_tunnel_config: + flow_indr_dev_unregister(nfp_flower_indr_setup_tc_cb, app, + nfp_flower_setup_indr_tc_release); + return err; } static void nfp_flower_stop(struct nfp_app *app)