From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5D17345BB3; Wed, 23 Oct 2024 17:02:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4890842D2B; Wed, 23 Oct 2024 17:01:59 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 7335042D0C for ; Wed, 23 Oct 2024 17:01:57 +0200 (CEST) Received: from pps.filterd (m0431383.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49N9NFSg028031 for ; Wed, 23 Oct 2024 08:01:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=j wV0eYEdWBJLKZEZm+6AlQB16JvUDFEyxD6zhm8mJdU=; b=H2UHpUCE8PXaSzoIk wEo+TsBuMZmE2hbfPJh9pQis9l21m4bDaXHgEoerL/QbztwsZEeLWliqr1WqRh+e eP+wzNHttIaFry+jTbUF4PmqUsRfgB1xzvkFzJEaGuYi9vjnnV2oEDIjhW5GEyVP fyrRsWrihyy/vzHfYmXy1H55eNEKeESAgB7AFrhq4G76hXyl1psne8II1YlDdm5T GEZY3LL0zJZS0VYx6XFPB/iOhp0PbHfssLTpqZIySXx0AOUsCHQmhQUhGz6Yt96m 8nrAmEEwQGP84o7MKeGAjtWjq/bGn0n2YwNLR31RIObD3FnkXLiMe5dXrNLyTcw8 T+qRw== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 42exf6grdn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 Oct 2024 08:01:56 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 23 Oct 2024 08:01:55 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 23 Oct 2024 08:01:55 -0700 Received: from localhost.localdomain (unknown [10.29.52.211]) by maili.marvell.com (Postfix) with ESMTP id E686D3F7069; Wed, 23 Oct 2024 08:01:52 -0700 (PDT) From: Harman Kalra To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra CC: , Ankur Dwivedi Subject: [PATCH 2/8] net/cnxk: common mbox for representor events Date: Wed, 23 Oct 2024 20:31:36 +0530 Message-ID: <20241023150143.113877-2-hkalra@marvell.com> X-Mailer: git-send-email 2.46.0.469.g4590f2e941 In-Reply-To: <20241023150143.113877-1-hkalra@marvell.com> References: <20241023150143.113877-1-hkalra@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: _1q3x8dIHXjpwD-waVOXRSKUA6geAQda X-Proofpoint-GUID: _1q3x8dIHXjpwD-waVOXRSKUA6geAQda X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Ankur Dwivedi Under a common mbox, multiple events can be received. These events are processed by net driver based on event IDs. Signed-off-by: Ankur Dwivedi --- drivers/net/cnxk/cnxk_rep.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/drivers/net/cnxk/cnxk_rep.c b/drivers/net/cnxk/cnxk_rep.c index 652d419ad8..ddc688fdc2 100644 --- a/drivers/net/cnxk/cnxk_rep.c +++ b/drivers/net/cnxk/cnxk_rep.c @@ -253,12 +253,30 @@ cnxk_representee_state_msg_process(struct cnxk_eswitch_dev *eswitch_dev, uint16_ static int cnxk_representee_mtu_msg_process(struct cnxk_eswitch_dev *eswitch_dev, uint16_t hw_func, - uint16_t rep_id, uint16_t mtu) + uint16_t mtu) { + struct cnxk_eswitch_devargs *esw_da; struct cnxk_rep_dev *rep_dev = NULL; struct rte_eth_dev *rep_eth_dev; + uint16_t rep_id = UINT16_MAX; int rc = 0; - int i; + int i, j; + + /* Traversing the initialized represented list */ + for (i = 0; i < eswitch_dev->nb_esw_da; i++) { + esw_da = &eswitch_dev->esw_da[i]; + for (j = 0; j < esw_da->nb_repr_ports; j++) { + if (esw_da->repr_hw_info[j].hw_func == hw_func) { + rep_id = esw_da->repr_hw_info[j].rep_id; + break; + } + } + if (rep_id != UINT16_MAX) + break; + } + /* No action on PF func for which representor has not been created */ + if (rep_id == UINT16_MAX) + goto done; for (i = 0; i < eswitch_dev->repr_cnt.nb_repr_probed; i++) { rep_eth_dev = eswitch_dev->rep_info[i].rep_eth_dev; @@ -289,17 +307,20 @@ cnxk_representee_msg_process(struct cnxk_eswitch_dev *eswitch_dev, switch (notify_msg->type) { case ROC_ESWITCH_REPTE_STATE: - plt_rep_dbg(" type %d: hw_func %x action %s", notify_msg->type, - notify_msg->state.hw_func, + plt_rep_dbg(" REPTE STATE: hw_func %x action %s", notify_msg->state.hw_func, notify_msg->state.enable ? "enable" : "disable"); rc = cnxk_representee_state_msg_process(eswitch_dev, notify_msg->state.hw_func, notify_msg->state.enable); break; + case ROC_ESWITCH_LINK_STATE: + plt_rep_dbg(" LINK STATE: hw_func %x action %s", notify_msg->link.hw_func, + notify_msg->link.enable ? "enable" : "disable"); + break; case ROC_ESWITCH_REPTE_MTU: - plt_rep_dbg(" type %d: hw_func %x rep_id %d mtu %d", notify_msg->type, - notify_msg->mtu.hw_func, notify_msg->mtu.rep_id, notify_msg->mtu.mtu); + plt_rep_dbg(" REPTE MTU: hw_func %x rep_id %d mtu %d", notify_msg->mtu.hw_func, + notify_msg->mtu.rep_id, notify_msg->mtu.mtu); rc = cnxk_representee_mtu_msg_process(eswitch_dev, notify_msg->mtu.hw_func, - notify_msg->mtu.rep_id, notify_msg->mtu.mtu); + notify_msg->mtu.mtu); break; default: plt_err("Invalid notification msg received %d", notify_msg->type); -- 2.46.0.469.g4590f2e941