Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2106108rwb; Wed, 30 Nov 2022 02:22:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf7TRyDBKK/YtsnlKf3g0m+W/zFi0lTpnTVjOj+ySKCYucsymSCLhUVpiHq5mgFrgWNYF8Vy X-Received: by 2002:a05:6402:509:b0:466:7500:b5df with SMTP id m9-20020a056402050900b004667500b5dfmr55118239edv.48.1669803736989; Wed, 30 Nov 2022 02:22:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669803736; cv=none; d=google.com; s=arc-20160816; b=HEJ7w0+bB7MtBcvnIu3PIp6BlBp9EA59hE32/p8hlSD6l3TFQiWkN6lUmP9I7RyaAx IyQ4AOR6GpnjA3Gq7RedJCfRkduWjy3yn/0hD/kFKQ2SvBjPGAlO2aycCRD5NT8xA/Pi pGW6ji459cjKh5arI8bDQddYKc4D1B5NalnbOxxmlNSTicE0djoTj9tfq+ZL8KM7u1GU ey2pjrYp1GSRA0l57gdR13lwfgIWJcPFRFmBMJgafMJKhkzRiKuOT+k+fMfN7cSbdWML ujbyHutsR99iqPsTDSCt1hJl8Tgc2oAnEL2/hJHkmIDHK/JRIve4F7O85e+mDfqR9Laf QzqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bn2uOrsFfIFNL3LU6lYkGPf7MkXbePao4Y8SIrD0tZY=; b=z7OEJofcB+uvLPaaBpLS3cZ/AyK5s71GYluuvt5kYbkLEXmsbNcIdrnoeE6g5mQjk9 U62XtlHiSri6DY9snmQmrhwIuwJ6YxnbYScBwiWqZ6iWakUDR+3XU5Z4Soc0ixDb+Xxx as2yhIr8CpKF4pVeYZtJVhUBvZyJxVUn3UNn/MXwJKFv9VlEkilWasoZu1X4Uwz+RFFm s+4Uf353C6GcQL1wwnEGCtbaOwVH2d+shgphutzCgMVAaFRsO5dcBkD/dUxo4LesXWoh yj/3kixWcoUc5/eVTB4TXMUfl6JdWCOV4lz8BpeOSVucWEQsRvZDZ95HFZXkUtimVgCa IZzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=urUMrBqo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn22-20020a17090794d600b0077082e784easi922027ejc.957.2022.11.30.02.21.56; Wed, 30 Nov 2022 02:22:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=urUMrBqo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233641AbiK3Jad (ORCPT + 84 others); Wed, 30 Nov 2022 04:30:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233540AbiK3Jaa (ORCPT ); Wed, 30 Nov 2022 04:30:30 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C31D37231; Wed, 30 Nov 2022 01:30:28 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 30C54B81A9A; Wed, 30 Nov 2022 09:30:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03893C433C1; Wed, 30 Nov 2022 09:30:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669800625; bh=wVvPST3dPXmOrpfixuCqf554y8PUSwdgNopLiRwzssA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=urUMrBqoXpE62yUfKJgP9C5Q3GcKgx4Nri3iMz79ZWB9bVA8HR5tNpp2UEpFtEYck WqJF7JyO5x7G0fCbVc63eH7dcpS6g4lAc42OhMNxPGe92hqUB25fi89x+lMBo4eS8/ 35xlFb5sCeWlYjbJ0Lw9BtrYBMu68kBEzM+Cs5sqZOllI+xXJilYd2n67RwSufGH3N C6/L3PocmzuOYzMB6gUIA66x2T2ROFe5QotrRCr6cK+OcciyJx5RzbDHYw9otf6nUs QSM320LkFEEVFiDEuSkpD5HIU1nqCk6Voc1/Ztyl/RvzGTdqP8oumjPbJbCC48ckIs TYxaxFg/CAp+A== Date: Wed, 30 Nov 2022 11:30:21 +0200 From: Leon Romanovsky To: Veerasenareddy Burru Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lironh@marvell.com, aayarekar@marvell.com, sedara@marvell.com, sburla@marvell.com, linux-doc@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: Re: [PATCH net-next v2 2/9] octeon_ep: poll for control messages Message-ID: References: <20221129130933.25231-1-vburru@marvell.com> <20221129130933.25231-3-vburru@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221129130933.25231-3-vburru@marvell.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 29, 2022 at 05:09:25AM -0800, Veerasenareddy Burru wrote: > Poll for control messages until interrupts are enabled. > All the interrupts are enabled in ndo_open(). So what are you saying if I have your device and didn't enable network device, you will poll forever? > Add ability to listen for notifications from firmware before ndo_open(). > Once interrupts are enabled, this polling is disabled and all the > messages are processed by bottom half of interrupt handler. > > Signed-off-by: Veerasenareddy Burru > Signed-off-by: Abhijit Ayarekar > --- > v1 -> v2: > * removed device status oct->status, as it is not required with the > modified implementation in 0001-xxxx.patch > > .../marvell/octeon_ep/octep_cn9k_pf.c | 49 +++++++++---------- > .../ethernet/marvell/octeon_ep/octep_main.c | 35 +++++++++++++ > .../ethernet/marvell/octeon_ep/octep_main.h | 11 ++++- > .../marvell/octeon_ep/octep_regs_cn9k_pf.h | 4 ++ > 4 files changed, 71 insertions(+), 28 deletions(-) > > diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c b/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c > index 6ad88d0fe43f..ace2dfd1e918 100644 > --- a/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c > +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_cn9k_pf.c > @@ -352,27 +352,36 @@ static void octep_setup_mbox_regs_cn93_pf(struct octep_device *oct, int q_no) > mbox->mbox_read_reg = oct->mmio[0].hw_addr + CN93_SDP_R_MBOX_VF_PF_DATA(q_no); > } > > -/* Mailbox Interrupt handler */ > -static void cn93_handle_pf_mbox_intr(struct octep_device *oct) > +/* Process non-ioq interrupts required to keep pf interface running. > + * OEI_RINT is needed for control mailbox > + */ > +static int octep_poll_non_ioq_interrupts_cn93_pf(struct octep_device *oct) > { > - u64 mbox_int_val = 0ULL, val = 0ULL, qno = 0ULL; > + u64 reg0; > + int handled = 0; Reversed Christmas tree. Thanks