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 78967468E0; Thu, 12 Jun 2025 11:00:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3426440E42; Thu, 12 Jun 2025 10:59:34 +0200 (CEST) Received: from out28-219.mail.aliyun.com (out28-219.mail.aliyun.com [115.124.28.219]) by mails.dpdk.org (Postfix) with ESMTP id 8720340DDA for ; Thu, 12 Jun 2025 10:59:23 +0200 (CEST) Received: from localhost.localdomain(mailfrom:kyo.liu@nebula-matrix.com fp:SMTPD_---.dJxInJx_1749718761 cluster:ay29) by smtp.aliyun-inc.com; Thu, 12 Jun 2025 16:59:21 +0800 From: Kyo Liu To: kyo.liu@nebula-matrix.com, dev@dpdk.org Cc: Dimon Zhao , Leon Yu , Sam Chen Subject: [PATCH v1 12/17] net/nbl: add nbl ethdev configuration Date: Thu, 12 Jun 2025 08:58:33 +0000 Message-ID: <20250612085840.729830-13-kyo.liu@nebula-matrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250612085840.729830-1-kyo.liu@nebula-matrix.com> References: <20250612085840.729830-1-kyo.liu@nebula-matrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 NBL device add ethdev configuration Signed-off-by: Kyo Liu --- drivers/net/nbl/nbl_dev/nbl_dev.c | 33 +++++++++++++++++++++-- drivers/net/nbl/nbl_include/nbl_include.h | 3 ++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/drivers/net/nbl/nbl_dev/nbl_dev.c b/drivers/net/nbl/nbl_dev/nbl_dev.c index f02ed7f94e..4eea07c1ff 100644 --- a/drivers/net/nbl/nbl_dev/nbl_dev.c +++ b/drivers/net/nbl/nbl_dev/nbl_dev.c @@ -4,15 +4,44 @@ #include "nbl_dev.h" -static int nbl_dev_configure(struct rte_eth_dev *eth_dev) +static int nbl_dev_port_configure(struct nbl_adapter *adapter) { - RTE_SET_USED(eth_dev); + adapter->state = NBL_ETHDEV_CONFIGURED; + return 0; } +static int nbl_dev_configure(struct rte_eth_dev *eth_dev) +{ + struct rte_eth_dev_data *dev_data = eth_dev->data; + struct nbl_adapter *adapter = ETH_DEV_TO_NBL_DEV_PF_PRIV(eth_dev); + int ret; + + NBL_LOG(INFO, "Begin to configure the device, state: %d", adapter->state); + + if (dev_data == NULL || adapter == NULL) + return -EINVAL; + + dev_data->dev_conf.intr_conf.lsc = 0; + + switch (adapter->state) { + case NBL_ETHDEV_CONFIGURED: + case NBL_ETHDEV_INITIALIZED: + ret = nbl_dev_port_configure(adapter); + break; + default: + ret = -EINVAL; + break; + } + + NBL_LOG(INFO, "configure the device done %d", ret); + return ret; +} + static int nbl_dev_port_start(struct rte_eth_dev *eth_dev) { RTE_SET_USED(eth_dev); + return 0; } diff --git a/drivers/net/nbl/nbl_include/nbl_include.h b/drivers/net/nbl/nbl_include/nbl_include.h index 55ab7ac8bd..5b77881851 100644 --- a/drivers/net/nbl/nbl_include/nbl_include.h +++ b/drivers/net/nbl/nbl_include/nbl_include.h @@ -140,9 +140,10 @@ struct nbl_common_info { /* curr_network 0 means kernel network, 1 means user network */ u8 curr_network:1; u8 is_vf:1; + u8 pf_start:1; u8 specific_dma:1; u8 dma_set_msb:1; - u8 rsv:3; + u8 rsv:2; struct nbl_board_port_info board_info; }; -- 2.43.0