Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7387587rwl; Thu, 23 Mar 2023 03:45:36 -0700 (PDT) X-Google-Smtp-Source: AK7set+kg8+dsattdYPJtajop6C9YitLuOnAGRRDuayqRb7tZNN1s1EeAtWciUIoJDww9TxLj6Wn X-Received: by 2002:a17:906:a098:b0:933:12d1:d168 with SMTP id q24-20020a170906a09800b0093312d1d168mr10985159ejy.10.1679568336394; Thu, 23 Mar 2023 03:45:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679568336; cv=none; d=google.com; s=arc-20160816; b=y+baBpo6G/OzsRfD/s58XEL1GlNXf+7WS58Dyah7hMbyEWr+y2rMHQ26HZfhrMKdXG D1cWI5A9ZX+Fof6yfNqw7bBlBwl4f59zRagm53gdGbAmAg4SvQ0w+wzOGkb0pqiGU1tb qDWHCFvifrOhe9aHZYvT9I9/yDPTwjOx42kAVJHEW/fv3lFgg/qVFjVkne9IOftyPxTz uBVKYkbuYZYrELm7OGcvqAZuQqepAHMR76+njPibPLXbCO9W2Uqwv7jD48HqgxNDBMwF KWlBRtYTeRER2ZlbL6Gg9AposowD75h2sZMVLF4ScZQMNhsdMRdlLkyCFs6o5Y2iP1RS /vwg== 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=SUI2gv0Ri7JLNvBcIDGS5szgqPzxxvKU7xkGUdBcKiE=; b=KD/o/CSqX/OtPcdYandBrdZ22sHLZmnAR8pjTn0tnA29iny6CGcRy1cDplb1j8KKsU chSbx0rGQvqPp+bcPV8+HjpRJZFgi50VK/7ScE84XUlfVkBtzoMm6cZ4LhjUG7ddipTZ b9T6SRGrgn3NRT37IQvu/fi912WIorPwqKtOTwG0GtTyCxka23tO9IbgR096bd2+Qs24 j6ocMQ1nLlK7zitonsly7cpLxii1IVoGbzPs4awGM6V37ZP576LLhQt7My5yMFTHmm9I 1/IOF4v+KsOwfRrwrF2pWDTpGIfp1etvrlHV4JKJt2ud+42T6bMvb45iRQTDMaxqPJC/ ch0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Dw9j5FgI; 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 cw5-20020a170906478500b009338f516161si12277987ejc.707.2023.03.23.03.45.12; Thu, 23 Mar 2023 03:45:36 -0700 (PDT) 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=Dw9j5FgI; 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 S231500AbjCWKmQ (ORCPT + 99 others); Thu, 23 Mar 2023 06:42:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231189AbjCWKl6 (ORCPT ); Thu, 23 Mar 2023 06:41:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1DB23BC72; Thu, 23 Mar 2023 03:39:07 -0700 (PDT) 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 AA6D6B8206F; Thu, 23 Mar 2023 10:39:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D12AFC433EF; Thu, 23 Mar 2023 10:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679567944; bh=Hia61pLbuUoI5LRjq1+nG/PnCT/SHMq+QsnWE3WPoMo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Dw9j5FgIHYK47PycP9ezQt0DOUaPG9RuoP63/PDtccK2TIdKNFUxulKT5hjdepsF3 QYj/sVZ0SDAdhgPzhLLtpSScTZWUr/IoegdBHUimFdbexKArpRtnc5bDxr2MNAlOVL pIybU5VU7jfd9/bj3t3widP3qvlhXHxepEXLyecfRIv1CWJehGoLrhZ8F/2ckH/Jtj xX67aK/jCMtUHKkCoWO9YDQzGL03lXIXOS6gb6WZ3+VGus6Pr+UJ22XIjWrixod/2X gUFoSh+DWm15J6TCj+P9VdSFrEYQ/npSEibxDUktQyqCb6B+32YNkfv7d6e6dK68LD 7qfJGUvt3UZbg== Date: Thu, 23 Mar 2023 12:39:00 +0200 From: Leon Romanovsky To: Veerasenareddy Burru Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 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 v4 6/8] octeon_ep: support asynchronous notifications Message-ID: <20230323103900.GC36557@unreal> References: <20230322091958.13103-1-vburru@marvell.com> <20230322091958.13103-7-vburru@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230322091958.13103-7-vburru@marvell.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 Wed, Mar 22, 2023 at 02:19:55AM -0700, Veerasenareddy Burru wrote: > Add asynchronous notification support to the control mailbox. > > Signed-off-by: Veerasenareddy Burru > Signed-off-by: Abhijit Ayarekar > --- > v3 -> v4: > * 0005-xxx.patch in v3 is 0006-xxx.patch in v4. > * addressed review comments > https://lore.kernel.org/all/Y+0J94sowllCe5Gs@boxer/ > - fixed rct violation. > - process_mbox_notify() now returns void. > > v2 -> v3: > * no change > > v1 -> v2: > * no change > > .../marvell/octeon_ep/octep_ctrl_net.c | 29 +++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_net.c b/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_net.c > index cef4bc3b1ec0..465eef2824e3 100644 > --- a/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_net.c > +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_net.c > @@ -271,6 +271,33 @@ static void process_mbox_resp(struct octep_device *oct, > } > } > > +static int process_mbox_notify(struct octep_device *oct, > + struct octep_ctrl_mbox_msg *msg) > +{ > + struct net_device *netdev = oct->netdev; > + struct octep_ctrl_net_f2h_req *req; > + > + req = (struct octep_ctrl_net_f2h_req *)msg->sg_list[0].msg; > + switch (req->hdr.s.cmd) { > + case OCTEP_CTRL_NET_F2H_CMD_LINK_STATUS: > + if (netif_running(netdev)) { > + if (req->link.state) { > + dev_info(&oct->pdev->dev, "netif_carrier_on\n"); > + netif_carrier_on(netdev); > + } else { > + dev_info(&oct->pdev->dev, "netif_carrier_off\n"); > + netif_carrier_off(netdev); > + } Shouldn't netdev changes be protected by some lock? Is is safe to get event from FW and process it as is? Thanks