Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1317014rwb; Sun, 6 Nov 2022 23:33:32 -0800 (PST) X-Google-Smtp-Source: AMsMyM5xkowsB+UQuGYe7XvstrtkCaiVxRvMwlFE4xoiamZUBt8S6eYjnxLFVg3HdYBcFElqFIhp X-Received: by 2002:aa7:d499:0:b0:463:c002:9650 with SMTP id b25-20020aa7d499000000b00463c0029650mr31653280edr.87.1667806411864; Sun, 06 Nov 2022 23:33:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667806411; cv=none; d=google.com; s=arc-20160816; b=bddDEH5gnd7PFU2HerQQdR6WiR0QCL6nSi9qGMsGB/tVSJ8EaPyg/c1QojToy/zFgj IRLsLm1/yNBo6tTWZrZEzn/ITxvM86VH62se9DUA3rp5ApMyD1Az5I00gnkleSXN78bD 4KnKyw+2ZRR2qkL89Nc2nHPzLv5l3pTdL/LMlMv1o+4mLG64zRr7mWvaxUBOzM7LHnTC 37cFvKEwPhs0DtgcJIzHo9/hCsZXKC9AnM0BwgebPCXxJ8KcicVtbuJHJaq3SqMWBRFL gp5yFMyqBKbKXlGGNivbZSG/VsUwaZdbuM5QUEB20rnowYzp1Dw+gmERneUyXG0amtwM ksXg== 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=1MYnuzMUF8cHbMwVjzRzmVwMCW9EmcTbS1yoOWcg5L4=; b=ItgF8HxQW/NVHOlU1TdVFd8/V/uVS3eKWAmMVqEdsNWd5k9PF9lbXi6sJAnS11G/1H g0ROhVUgJmyCaWmjcT3QyOqmjm36mbfP8WOkU83YkwO5m22dfvbQddJ/5YUG5blv9ihY 4PERplvdPbNzogLpjp2gtHBqJavABNUz/rb6+Oxuqsg6Erj70T9MuDLXsXLT2rm+I/75 HLxMDfUNm4gR9F8sL6/dkS5v6kgeMm+141yDnbHrN6VZrx77+vpHv52T9r6Uxr4hSaad m9vvbnYvzfXmNsweqsEGAICs1PZbVCUZDO8B/oMgTVts2VyAXezOmxETbXGCq1iMaMcd HJNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=HTOm6vti; 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 sb36-20020a1709076da400b007ae0e8f697fsi8975583ejc.652.2022.11.06.23.33.08; Sun, 06 Nov 2022 23:33:31 -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=@marvell.com header.s=pfpt0220 header.b=HTOm6vti; 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 S231552AbiKGH1Q (ORCPT + 95 others); Mon, 7 Nov 2022 02:27:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231448AbiKGH0s (ORCPT ); Mon, 7 Nov 2022 02:26:48 -0500 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89D0A38B4; Sun, 6 Nov 2022 23:26:47 -0800 (PST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2A76X0xG004392; Sun, 6 Nov 2022 23:26:40 -0800 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=1MYnuzMUF8cHbMwVjzRzmVwMCW9EmcTbS1yoOWcg5L4=; b=HTOm6vtiyKijFMh3yFHI9+pTalclYbKNc2KNydDnxuL68zPjiMGWhgBzZzc15+OSlaDw /lddabM3JFZgxYjQbhcgdWaEDRGSpWK7ExqBU+Abf2a6bfXqi6H+SR76BViXz4g7qQ+A czvBkCVyAHh/HOZKa0QrJCm7UATlhVRBwvWQYsLa0cMft0DNzQr/sBxpvuR8BuCmqPhB k6DGuwHkW8ymFUNUtF4AkEd9Y3lduWoa288mi5psj+hpVtF6r0BifAsE0BfvwysgWvrq 9DAk98T3YMByyEQIBqrQ2jOM2+ggqnDHx1dwGissPkM9JNfw1JtWIzbVbmPBknhIUrz8 pA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3kpvuk85b9-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 06 Nov 2022 23:26:40 -0800 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.18; Sun, 6 Nov 2022 23:26:37 -0800 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.2 via Frontend Transport; Sun, 6 Nov 2022 23:26:37 -0800 Received: from sburla-PowerEdge-T630.caveonetworks.com (unknown [10.106.27.217]) by maili.marvell.com (Postfix) with ESMTP id 44AB83F7050; Sun, 6 Nov 2022 23:26:37 -0800 (PST) From: Veerasenareddy Burru To: , , , , , CC: , Veerasenareddy Burru , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: [PATCH net-next 5/9] octeon_ep: support asynchronous notifications Date: Sun, 6 Nov 2022 23:25:19 -0800 Message-ID: <20221107072524.9485-6-vburru@marvell.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20221107072524.9485-1-vburru@marvell.com> References: <20221107072524.9485-1-vburru@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: NKRfXI1CQwsCOLWhcrwgR8q1pbXPbo9C X-Proofpoint-ORIG-GUID: NKRfXI1CQwsCOLWhcrwgR8q1pbXPbo9C X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-06_16,2022-11-03_01,2022-06-22_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE 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 Add asynchronous notification support to the control mailbox. Signed-off-by: Veerasenareddy Burru Signed-off-by: Abhijit Ayarekar --- .../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 715af1891d0d..80bcd6cd4732 100644 --- a/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_net.c +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_net.c @@ -279,6 +279,33 @@ static int process_mbox_resp(struct octep_device *oct, return 0; } +static int process_mbox_notify(struct octep_device *oct, + struct octep_ctrl_mbox_msg *msg) +{ + struct octep_ctrl_net_f2h_req *req; + struct net_device *netdev = oct->netdev; + + 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; +} + int octep_ctrl_net_recv_fw_messages(struct octep_device *oct) { static u16 msg_sz = sizeof(union octep_ctrl_net_max_data); @@ -303,6 +330,8 @@ int octep_ctrl_net_recv_fw_messages(struct octep_device *oct) process_mbox_req(oct, &msg); else 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); } return 0; -- 2.36.0