Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1462376rwl; Fri, 24 Mar 2023 10:49:04 -0700 (PDT) X-Google-Smtp-Source: AKy350Yt4W8INfd3NYszmX1OY5qiQq+mo8JNjJDaBeH/kcT6pHqo02mqYSNXzvdguLtbFOoXeczL X-Received: by 2002:a17:903:1108:b0:1a1:e867:f2a7 with SMTP id n8-20020a170903110800b001a1e867f2a7mr4468690plh.22.1679680144169; Fri, 24 Mar 2023 10:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679680144; cv=none; d=google.com; s=arc-20160816; b=V5JJrYkwYxftVfLq1Eko3JUmDh0dxfYU0a/tlhS32OfnYA1pULXxp45yBiSSJ/JcTW n1FOKEaGY+kATmunvMB/QzVclnp3nX0x0XAXdKz19XzeJjgTSEtK7jWyuFlNbg9sn+Mk tk4KK17PDr9CVF+SDWyRllx0JGsyO9Mo+Wdmk1N+RO/4wPFMCmwP81AOjC/CkA6AkwYK RRiSnVNccvbLptqmU+MbSEBQiWM70sEhgrJKD7ImZk3HAyG9rpgr1OeyJFmYovzH/Lqc parn/7G8DdZ5PRFQbTfbtEsJeXotTNxkfP5UrVNVJM4qcWaQ6Bi8ZhGHXlPV4Ng3AR10 LGPg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pwu8nKOgZfG0gRZ/hteADACC/gSz1pqVQhGE43XUkAU=; b=qf/aeR2C76OkUBY7HST2zv0Ner/hGgyunCQhn670KoKzKUZcT9UxLUDHsqhr+LLUQk siZSTxSVN0MzepYp4L6l+ySDgJT/G7GPfZmU4FFxArdNSRfWscshEvFEcHl9P9Lix8GX b9w5tdYd38lUDCYgnEKLYPwoIO81JWt+C5BrWGIa4jT62Og012Siy7iGOu04UuULTIRc cphwcrTb9MaEJdsFaEVybEd3AW8aIufphiMMAgf3qw32xJG3NGh/1lVaQTjTXc/DgqvE UoTEllFsfBbXhxOXa5DX2P1v2w+L6pKzTlcWQQ+hpOyhxU3FRfZbULlUj1HjvC7PhwY6 70ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=AIC5FZtn; 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=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020a170902708100b001a20c983d21si3462294plk.51.2023.03.24.10.48.50; Fri, 24 Mar 2023 10:49:04 -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=@marvell.com header.s=pfpt0220 header.b=AIC5FZtn; 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=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231978AbjCXRrq (ORCPT + 99 others); Fri, 24 Mar 2023 13:47:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbjCXRr3 (ORCPT ); Fri, 24 Mar 2023 13:47:29 -0400 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63C1E199E3; Fri, 24 Mar 2023 10:47:28 -0700 (PDT) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32OHVwQn018470; Fri, 24 Mar 2023 10:47:18 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=pwu8nKOgZfG0gRZ/hteADACC/gSz1pqVQhGE43XUkAU=; b=AIC5FZtngcIT7SKOhVL2JmR5kzAV240hpPAc+t2o9M8wJUhk0SAM7V+cedqcAm0Nb4du fNyoo/4oTDd/jIJz55IeDeDHM7yNIG5IeW9v+052hLhyaAhfPVlf/3DJIZ6VHADpZpIh LdH3w+HaOdAIjO+TQyM/pueN0cDIycjwmsXY59Vijv0OdR3AriW845aDDQv4iOy38IT9 CyuXHcAv+lhxjTDSPqmkBfrFYVGhKzHZxFK0oyt7MGTlldTrEvgakjmG/WHr0bb2j5XT uxoCvdfHHibZVeBExEFgql6gseOda4iIt/w+FhjNGswTrXrt5nqtM0VXP0XMD1gkOwVj GA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3ph6q3td8t-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 24 Mar 2023 10:47:17 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 24 Mar 2023 10:47:15 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Fri, 24 Mar 2023 10:47:15 -0700 Received: from sburla-PowerEdge-T630.sclab.marvell.com (unknown [10.106.27.217]) by maili.marvell.com (Postfix) with ESMTP id 64C813F7051; Fri, 24 Mar 2023 10:47:15 -0700 (PDT) From: Veerasenareddy Burru To: , , , , CC: , Veerasenareddy Burru , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: [PATCH net-next v5 6/8] octeon_ep: support asynchronous notifications Date: Fri, 24 Mar 2023 10:47:01 -0700 Message-ID: <20230324174704.9752-7-vburru@marvell.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230324174704.9752-1-vburru@marvell.com> References: <20230324174704.9752-1-vburru@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: TYDqBa9O_r3n-hh1S3vvmQs6GMuuFpgx X-Proofpoint-ORIG-GUID: TYDqBa9O_r3n-hh1S3vvmQs6GMuuFpgx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-24_01,2023-02-09_01 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE 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 Add asynchronous notification support to the control mailbox. Signed-off-by: Veerasenareddy Burru Signed-off-by: Abhijit Ayarekar --- v4 -> v5: * no change 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); + } + } + break; + default: + pr_info("Unknown mbox req : %u\n", req->hdr.s.cmd); + break; + } + + return 0; +} + void octep_ctrl_net_recv_fw_messages(struct octep_device *oct) { static u16 msg_sz = sizeof(union octep_ctrl_net_max_data); @@ -291,6 +318,8 @@ void octep_ctrl_net_recv_fw_messages(struct octep_device *oct) if (msg.hdr.s.flags & OCTEP_CTRL_MBOX_MSG_HDR_FLAG_RESP) process_mbox_resp(oct, &msg); + else if (msg.hdr.s.flags & OCTEP_CTRL_MBOX_MSG_HDR_FLAG_NOTIFY) + process_mbox_notify(oct, &msg); } } -- 2.36.0