From: "dimon.zhao" <dimon.zhao@nebula-matrix.com>
To: dimon.zhao@nebula-matrix.com, kyo.liu@nebula-matrix.com, dev@dpdk.org
Cc: Leon Yu <leon.yu@nebula-matrix.com>,
Sam Chen <sam.chen@nebula-matrix.com>
Subject: [PATCH v2 11/16] net/nbl: add nbl ethdev configuration
Date: Mon, 16 Jun 2025 20:23:48 -0700 [thread overview]
Message-ID: <20250617032353.3036379-12-dimon.zhao@nebula-matrix.com> (raw)
In-Reply-To: <20250617032353.3036379-1-dimon.zhao@nebula-matrix.com>
NBL device add ethdev configuration
Signed-off-by: dimon.zhao <dimon.zhao@nebula-matrix.com>
---
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 2f5e426c91..33b2c25684 100644
--- a/drivers/net/nbl/nbl_include/nbl_include.h
+++ b/drivers/net/nbl/nbl_include/nbl_include.h
@@ -131,9 +131,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.34.1
next prev parent reply other threads:[~2025-06-17 3:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 3:23 [PATCH v2 00/16] NBL PMD for Nebulamatrix NICs dimon.zhao
2025-06-17 3:23 ` [PATCH v2 01/16] net/nbl: add doc and minimum nbl build framework dimon.zhao
2025-06-17 3:23 ` [PATCH v2 02/16] net/nbl: add simple probe/remove and log module dimon.zhao
2025-06-17 3:23 ` [PATCH v2 03/16] net/nbl: add PHY layer definitions and implementation dimon.zhao
2025-06-17 3:23 ` [PATCH v2 04/16] net/nbl: add Channel " dimon.zhao
2025-06-17 3:23 ` [PATCH v2 05/16] net/nbl: add Resource " dimon.zhao
2025-06-17 3:23 ` [PATCH v2 06/16] net/nbl: add Dispatch " dimon.zhao
2025-06-17 3:23 ` [PATCH v2 07/16] net/nbl: add Dev " dimon.zhao
2025-06-17 3:23 ` [PATCH v2 08/16] net/nbl: add complete device init and uninit functionality dimon.zhao
2025-06-17 3:23 ` [PATCH v2 09/16] net/nbl: add UIO and VFIO mode for nbl dimon.zhao
2025-06-17 3:23 ` [PATCH v2 10/16] net/nbl: add nbl coexistence " dimon.zhao
2025-06-17 3:23 ` dimon.zhao [this message]
2025-06-17 3:23 ` [PATCH v2 12/16] net/nbl: add nbl device rxtx queue setup and release ops dimon.zhao
2025-06-17 3:23 ` [PATCH v2 13/16] net/nbl: add nbl device start and stop ops dimon.zhao
2025-06-17 3:23 ` [PATCH v2 14/16] net/nbl: add nbl device Tx and Rx burst dimon.zhao
2025-06-17 3:23 ` [PATCH v2 15/16] net/nbl: add nbl device xstats and stats dimon.zhao
2025-06-17 3:23 ` [PATCH v2 16/16] net/nbl: nbl device support set MTU and promisc dimon.zhao
2025-06-17 13:46 ` [PATCH v2 00/16] NBL PMD for Nebulamatrix NICs Stephen Hemminger
2025-06-17 6:11 dimon.zhao
2025-06-17 6:11 ` [PATCH v2 11/16] net/nbl: add nbl ethdev configuration dimon.zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250617032353.3036379-12-dimon.zhao@nebula-matrix.com \
--to=dimon.zhao@nebula-matrix.com \
--cc=dev@dpdk.org \
--cc=kyo.liu@nebula-matrix.com \
--cc=leon.yu@nebula-matrix.com \
--cc=sam.chen@nebula-matrix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).