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 19F9D45C89; Tue, 5 Nov 2024 18:30:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE3B84027E; Tue, 5 Nov 2024 18:30:39 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2051.outbound.protection.outlook.com [40.107.243.51]) by mails.dpdk.org (Postfix) with ESMTP id D9CC340156 for ; Tue, 5 Nov 2024 18:30:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Tyx12B/YtZD7aihfXrnwoCOrgK6m3FqJMYZT9ETZxLrBssgatt/qYdt2EbDjvTS3pe/WVhIuaxr7/eFlK/TLvxYeANjeqR6lndCl0jvriS7J4gLWQ0BCOfYRWpfyPuZCdPmldzU2ZLrRvau7ZMRYjVKSNPeKWQXo4js/b3Q9atAXwJWlol7F6xHLsK1T1dH2d4Tu9bxyJWenPlve2hOdufd7LOLR++Ry0zZzEpkzjk9fCaGnDWWVnezoUeslBD8O9wtKJwFwb5sj0eEHGTiGu9/ybCAP2c5ZlNI7FlQe3WthWcT1KKYKPaVV43YHVhMHiYuo04SW9unTdXny2RMt2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9z2V8sYd+xp4FCq6MMDy8UHyyJvruNZ8U9KqTcXYadY=; b=Zu/HzJk2n4r4+EyKUT3LROKa/j2yLsdXaxU2CFjmYCrQgXWmOqAh2VQlKzN4nlzsWG+WBi/iHZ/JsyzuJ2u56id0S2zoiuIVR+YSURPmGdTFpKiCGORj2yaXITTVWwrIEJQ27alOT0wWj5bAs8hY8TmHdvePbu9NaiOQR82k9Ad3VNgk0DiXTDSQVCXaNbXgpt7ATOJFnvDuopmLTYCHN1IIiPCqdvdH6FnsHP+spGX6SOdOHm7aunqKZcZaXsqjs0JosjmOVsX4FlZw+giddLfMFWAHMzo1ORGdzwaz434UM+xc7Dmm8PtfeIXZidBHwiror951DUNS64qXQKdBGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9z2V8sYd+xp4FCq6MMDy8UHyyJvruNZ8U9KqTcXYadY=; b=In0lu6NAa9b8TeCevqURXQhodOSPEZO2dGbrfu0wlPhP4aw7AaEGwp5RrXIgCAvm6YkwBkLH+fKsGLmH6g5V56O2oZj8ul+OCpM0IMPXwkSYgkiXz5/ZAyHIC/eV7e2rhGqy+rlmXqIS6X1+AW0whcaCQW0KZCpnV0mAgubNUfA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) by DS0PR12MB7803.namprd12.prod.outlook.com (2603:10b6:8:144::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Tue, 5 Nov 2024 17:30:35 +0000 Received: from SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055]) by SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055%3]) with mapi id 15.20.8114.031; Tue, 5 Nov 2024 17:30:35 +0000 Message-ID: <9ed874f4-4c59-4471-9b5e-49726c21c14d@amd.com> Date: Tue, 5 Nov 2024 17:30:28 +0000 User-Agent: Mozilla Thunderbird Subject: =?UTF-8?B?UmU6IOetlOWkjTogW1BBVENIIHY1IDAxLzE4XSBuZXQvcjgxNjk6IGFk?= =?UTF-8?Q?d_PMD_driver_skeleton?= To: Howard Wang , dev@dpdk.org References: <20241028073112.107535-1-howard_wang@realsil.com.cn> <20241028073112.107535-2-howard_wang@realsil.com.cn> <642924db828848e9b9fbe3848927a292@realsil.com.cn> Content-Language: en-US From: Ferruh Yigit Cc: "pro_nic_dpdk@realtek.com" In-Reply-To: <642924db828848e9b9fbe3848927a292@realsil.com.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0516.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:272::9) To SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8830:EE_|DS0PR12MB7803:EE_ X-MS-Office365-Filtering-Correlation-Id: 731b2f15-bfbd-4ded-dbbd-08dcfdbf8e57 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?Yjkyc04xZVBMTHRxczNoNW5Uc0JvWHkxY05JQmhzdGE0bFEvVHFFcWdlKy9a?= =?utf-8?B?OXUyTldkMWt3R01TTXdOaVY0bkZiWlQreWFrWEh3aXhLZEo3azllTlhjSG12?= =?utf-8?B?eDBSZklIMmE0N1o5dGU2UHcrWEJrSFg4cUFJdVd4VzdhdjVYUEJ1YUdvelht?= =?utf-8?B?NzJTY3E0VlZvWExTamkrUmhkckpSWm5JL3pmY0R4cXBNYTdoMnFwdFNpTml2?= =?utf-8?B?alBtNVVCNE5DWmM3RUVJeGVJWGV5ZVpSWEs4ajlYRi91NTJUa2ZpNEZ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adE83?= =?utf-8?B?WmtFQUJ4S3B2S0h5NkNQbDJSV3o1N1BJYUJ5dElnZUtvYkpkenZUV0JFZzA2?= =?utf-8?B?VTJraTM3ZERBMnM3QnF0andNcDdQZEVmeFJsOGdHQlVmUGpwa3VSeEdZSXBx?= =?utf-8?B?NVd2cFYxZlpTV05BK1VCaFpwSXRqVGMxWWhlMTJaQytOY2dIWWFwTHlSN2N2?= =?utf-8?B?cmV0dU1YM0ZYc0E0VUY1R2txRmNoeEEyeVJaMDRETnFaR0g2WXVldUV4WmQr?= =?utf-8?B?WUNPN1ZtcC9PWm1YL2xjeHovNiswaHZJTXpwMGhFY0kwM09SMkQ3Q2hmNmwv?= =?utf-8?B?ZjV2WEZtVXdWUTlOb200SldRMFFuUk9EOXRTTU9hUHBiZVJOMm9PSXlxRFBS?= =?utf-8?B?MEp3ZXpLTVJ5dmh1VHpzVUdmb2Jzc04vUTVRYUdHYUZrdnRtMDRSMGlLZ05M?= =?utf-8?B?c3N6SFlNL0Z6cmQxeCt2WFlOSlJ3ZXNRTiswbXQrdyt5UTBXM1FhdFRZeEw3?= =?utf-8?B?UFVFQmVVVXdia09MOTFPMHcwU3ZneHdVMFNCZmd3UHpEeFp2ZG1Xd1psVkJw?= =?utf-8?Q?3KQ7wyuKRreZhmegLUCMXiBsy3DWkm6QoiqB0Sp?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR12MB8830.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?R1lsdnRGakp2c0dRcStYR3lrRjI1MDk0cisrblFiSHBwZFZMQUNnVUU5NC82?= =?utf-8?B?OVR2SzJYTkFSbm0vckQzS3BuV0N2UzFNUjAwdFRyMTAvaDFxLzBEM1J6T3B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FFVbUJWZ1RjcVBvbTNvc0RVdFl2Zm9kcVNUVVRHOVpF?= =?utf-8?B?cmlCREVYVnFrTzk1M3FXeVo1QVlSVnlkZ2hTMHNzenkvdG9OL21jT0c0aXd1?= =?utf-8?B?aTNIZXA5Vm9ISml0VWg5YjJNb3VXWnh2cnpEMVYxaThaTXFQdHMyN2FaMHpz?= =?utf-8?B?Z0ZuTWFIUGpHZENta1BwelorUktsK29BaVVVbnlZVWdCVHZhTHFVRTBBdVlx?= =?utf-8?Q?/LX/9SnSJoL0/Ofe/tbykguIu?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 731b2f15-bfbd-4ded-dbbd-08dcfdbf8e57 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8830.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 17:30:35.1109 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Q1BynNZIwA8f4LUzmi/XBroWSQS8Sln1tvqFKxJs0YNcuLz+MvciwzO9JAe3Q+HJ X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7803 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 On 11/4/2024 9:43 AM, 王颢 wrote: > Dear Ferruh, > > I am currently making the changes you mentioned. I would like to clarify a few questions with you. > >> +F: drivers/net/r8169 >> + >> > > Please sort alphabetically for 'Realtek' > > ===> As I can see in the MAINTAINERS file, each PMD in the Networking Drivers section is not sorted alphabetically. For example, Marvell appears in several places and is not grouped together. As a result, I am unsure where to place Realtek. > Please put just before 'Solarflare'. You are right, there are some inconsistencies, some Marvell ones are because company acquisitions, company name changed but order of the file not changed etc.. But there are others too. > > Can you also add driver documentation and update release notes in this patch? > > ===> Do you mean that the 18th patch [PATCH v5 18/18] doc/guides/nics: add documents for r8169 pmd should be merged into the overall patch? Additionally, I don’t quite understand the “update release notes” part. Do you mean that a new release note file needs to be added in drivers/net/r8169 and updated with each patch? Or perhaps you mean that the r8169.ini and r8169.rst files should be created starting from the first patch and gradually improved as the patches are submitted? Second one please, create documentation in this patch and improve it gradually. And same for the release notes (doc/guides/rel_notes/release_24_11.rst), this patch may have the initial update announcing the new driver, if you want to announce more updates in release notes, they can be added in relevant patch in the series. > > Best Regards, > Howard Wang > > -----邮件原件----- > 发件人: Ferruh Yigit > 发送时间: 2024年11月3日 10:17 > 收件人: 王颢 ; dev@dpdk.org > 抄送: pro_nic_dpdk@realtek.com > 主题: Re: [PATCH v5 01/18] net/r8169: add PMD driver skeleton > > > External mail. > > > > On 10/28/2024 7:30 AM, Howard Wang wrote: >> Meson build infrastructure, r8169_ethdev minimal skeleton, header with >> Realtek NIC device and vendor IDs. >> >> Signed-off-by: Howard Wang >> --- >> MAINTAINERS | 7 ++ >> drivers/net/meson.build | 1 + >> drivers/net/r8169/meson.build | 6 ++ >> drivers/net/r8169/r8169_base.h | 15 +++ >> drivers/net/r8169/r8169_ethdev.c | 178 >> +++++++++++++++++++++++++++++++ drivers/net/r8169/r8169_ethdev.h | >> 40 +++++++ >> 6 files changed, 247 insertions(+) >> create mode 100644 drivers/net/r8169/meson.build create mode 100644 >> drivers/net/r8169/r8169_base.h create mode 100644 >> drivers/net/r8169/r8169_ethdev.c create mode 100644 >> drivers/net/r8169/r8169_ethdev.h >> >> diff --git a/MAINTAINERS b/MAINTAINERS index c5a703b5c0..5f9eccc43f >> 100644 >> --- a/MAINTAINERS >> +++ b/MAINTAINERS >> @@ -1076,6 +1076,13 @@ F: drivers/net/memif/ >> F: doc/guides/nics/memif.rst >> F: doc/guides/nics/features/memif.ini >> >> +Realtek r8169 >> +M: Howard Wang >> +M: ChunHao Lin >> +M: Xing Wang >> +M: Realtek NIC SW >> > > We prefer authors as maintainer, instead of group/alias, and as you already provide names, can this be removed? > > >> +F: drivers/net/r8169 >> + >> > > Please sort alphabetically for 'Realtek' > > Can you also add driver documentation and update release notes in this patch? > > >> >> Crypto Drivers >> -------------- >> diff --git a/drivers/net/meson.build b/drivers/net/meson.build index >> fb6d34b782..fddcf39655 100644 >> --- a/drivers/net/meson.build >> +++ b/drivers/net/meson.build >> @@ -53,6 +53,7 @@ drivers = [ >> 'pfe', >> 'qede', >> 'ring', >> + 'r8169', >> 'sfc', >> 'softnic', >> 'tap', >> diff --git a/drivers/net/r8169/meson.build >> b/drivers/net/r8169/meson.build new file mode 100644 index >> 0000000000..f14d4ae8fb >> --- /dev/null >> +++ b/drivers/net/r8169/meson.build >> @@ -0,0 +1,6 @@ >> +# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2024 Realtek >> +Corporation. All rights reserved >> + >> +sources = files( >> + 'r8169_ethdev.c', >> +) >> diff --git a/drivers/net/r8169/r8169_base.h >> b/drivers/net/r8169/r8169_base.h new file mode 100644 index >> 0000000000..6fc84592a6 >> --- /dev/null >> +++ b/drivers/net/r8169/r8169_base.h >> @@ -0,0 +1,15 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2024 Realtek Corporation. All rights reserved */ >> + >> +#ifndef _R8169_BASE_H_ >> +#define _R8169_BASE_H_ >> + >> +typedef uint8_t u8; >> +typedef uint16_t u16; >> +typedef uint32_t u32; >> +typedef uint64_t u64; >> > > most of the drivers has 'compat.h' or '_compat.h' > (r8169_compat.h) as compatibility layer for DPDK and define above like structures there. > If there is no specific reason to have this file name, you can create a compat.h for compatibility. > >> + >> +#define PCI_VENDOR_ID_REALTEK 0x10EC >> + >> +#endif >> diff --git a/drivers/net/r8169/r8169_ethdev.c >> b/drivers/net/r8169/r8169_ethdev.c >> new file mode 100644 >> index 0000000000..1f90a142c5 >> --- /dev/null >> +++ b/drivers/net/r8169/r8169_ethdev.c >> @@ -0,0 +1,178 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2024 Realtek Corporation. All rights reserved */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> > > Do you really need all these headers here? > Please only include necessary ones and add them when you need them. > > >> + >> +#include "r8169_ethdev.h" >> +#include "r8169_base.h" >> + >> +static int rtl_dev_configure(struct rte_eth_dev *dev __rte_unused); >> > > No need to have '__rte_unused' attribute for function decleration. > >> +static int rtl_dev_start(struct rte_eth_dev *dev); static int >> +rtl_dev_stop(struct rte_eth_dev *dev); static int >> +rtl_dev_reset(struct rte_eth_dev *dev); static int >> +rtl_dev_close(struct rte_eth_dev *dev); >> + >> +/* >> + * The set of PCI devices this driver supports */ static const >> +struct rte_pci_id pci_id_r8169_map[] = { >> + { RTE_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8125) }, >> + { RTE_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8162) }, >> + { RTE_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8126) }, >> + { RTE_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x5000) }, >> + {.vendor_id = 0, /* sentinel */ }, }; >> + >> +static const struct eth_dev_ops rtl_eth_dev_ops = { >> + .dev_configure = rtl_dev_configure, >> + .dev_start = rtl_dev_start, >> + .dev_stop = rtl_dev_stop, >> + .dev_close = rtl_dev_close, >> + .dev_reset = rtl_dev_reset, >> +}; >> + >> +static int >> +rtl_dev_configure(struct rte_eth_dev *dev __rte_unused) { >> + return 0; >> +} >> + >> +/* >> + * Configure device link speed and setup link. >> + * It returns 0 on success. >> + */ >> +static int >> +rtl_dev_start(struct rte_eth_dev *dev) { >> + struct rtl_adapter *adapter = RTL_DEV_PRIVATE(dev); >> + struct rtl_hw *hw = &adapter->hw; >> + >> + hw->adapter_stopped = 0; >> + >> + return 0; >> +} >> + >> +/* >> + * Stop device: disable RX and TX functions to allow for reconfiguring. >> + */ >> +static int >> +rtl_dev_stop(struct rte_eth_dev *dev) { >> + struct rtl_adapter *adapter = RTL_DEV_PRIVATE(dev); >> + struct rtl_hw *hw = &adapter->hw; >> + >> + if (hw->adapter_stopped) >> + return 0; >> > > There is 'dev->data->dev_started' variable for exact same reason, and it is checked in 'rte_eth_dev_stop()' level, do you need this driver version of same flag? > >> + >> + hw->adapter_stopped = 1; >> + dev->data->dev_started = 0; >> > > This flag is set in ethdev layer level, no need to set it here. > >> + >> + return 0; >> +} >> + >> +/* >> + * Reset and stop device. >> + */ >> +static int >> +rtl_dev_close(struct rte_eth_dev *dev) { >> + int ret_stp; >> + >> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) >> + return 0; >> + >> + ret_stp = rtl_dev_stop(dev); >> + >> + return ret_stp; >> +} >> + >> +static int >> +rtl_dev_init(struct rte_eth_dev *dev) { >> + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); >> + struct rte_intr_handle *intr_handle = pci_dev->intr_handle; >> > > 'intr_handle' not used yet, please add it when used. > >> + struct rtl_adapter *adapter = RTL_DEV_PRIVATE(dev); >> + struct rtl_hw *hw = &adapter->hw; >> + >> + dev->dev_ops = &rtl_eth_dev_ops; >> + >> + /* For secondary processes, the primary process has done all the work */ >> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) >> + return 0; >> + >> + rte_eth_copy_pci_info(dev, pci_dev); >> > > This is already done as part of 'rte_eth_dev_pci_generic_probe()', > shouldn't need to do here. Can you please double check? > >> + >> + return 0; >> +} >> + >> +static int >> +rtl_dev_uninit(struct rte_eth_dev *dev) { >> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) >> + return -EPERM; >> + >> + rtl_dev_close(dev); >> + >> + return 0; >> +} >> + >> +static int >> +rtl_dev_reset(struct rte_eth_dev *dev) { >> + int ret; >> + >> + ret = rtl_dev_uninit(dev); >> + if (ret) >> + return ret; >> + >> + ret = rtl_dev_init(dev); >> + >> + return ret; >> +} >> + >> +static int >> +rtl_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, >> + struct rte_pci_device *pci_dev) { >> + return rte_eth_dev_pci_generic_probe(pci_dev, sizeof(struct rtl_adapter), >> + rtl_dev_init); } >> + >> +static int >> +rtl_pci_remove(struct rte_pci_device *pci_dev) { >> + return rte_eth_dev_pci_generic_remove(pci_dev, rtl_dev_uninit); >> +} >> + >> +static struct rte_pci_driver rte_r8169_pmd = { >> + .id_table = pci_id_r8169_map, >> + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, >> + .probe = rtl_pci_probe, >> + .remove = rtl_pci_remove, >> +}; >> + >> +RTE_PMD_REGISTER_PCI(net_r8169, rte_r8169_pmd); >> +RTE_PMD_REGISTER_PCI_TABLE(net_r8169, pci_id_r8169_map); >> +RTE_PMD_REGISTER_KMOD_DEP(net_r8169, "* igb_uio | uio_pci_generic | >> +vfio-pci"); >> diff --git a/drivers/net/r8169/r8169_ethdev.h >> b/drivers/net/r8169/r8169_ethdev.h >> new file mode 100644 >> index 0000000000..e37f05c153 >> --- /dev/null >> +++ b/drivers/net/r8169/r8169_ethdev.h >> @@ -0,0 +1,40 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2024 Realtek Corporation. All rights reserved */ >> + >> +#ifndef _R8169_ETHDEV_H_ >> +#define _R8169_ETHDEV_H_ >> + >> +#include >> +#include >> + >> +#include >> +#include >> + >> +#include "r8169_base.h" >> + >> +struct rtl_hw { >> + u8 adapter_stopped; >> +}; >> + >> +struct rtl_sw_stats { >> + u64 tx_packets; >> + u64 tx_bytes; >> + u64 tx_errors; >> + u64 rx_packets; >> + u64 rx_bytes; >> + u64 rx_errors; >> +}; >> + >> +struct rtl_adapter { >> + struct rtl_hw hw; >> + struct rtl_sw_stats sw_stats; >> +}; >> + >> +#define RTL_DEV_PRIVATE(eth_dev) \ >> + ((struct rtl_adapter *)((eth_dev)->data->dev_private)) >> + >> +uint16_t rtl_xmit_pkts(void *txq, struct rte_mbuf **tx_pkts, uint16_t >> +nb_pkts); uint16_t rtl_recv_pkts(void *rxq, struct rte_mbuf >> +**rx_pkts, uint16_t nb_pkts); >> > > These functions don't exists yet, please add the declarations when functions added. > >> + >> +#endif >