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 E785F45F31; Tue, 24 Dec 2024 21:30:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B0F584029D; Tue, 24 Dec 2024 21:30:29 +0100 (CET) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) by mails.dpdk.org (Postfix) with ESMTP id 0981D40263 for ; Tue, 24 Dec 2024 21:30:27 +0100 (CET) Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3eba559611aso1490600b6e.0 for ; Tue, 24 Dec 2024 12:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1735072227; x=1735677027; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=k+nz+wdRIjhL9+vRqMRx+JEjQDQDgtNRlF5R/39mhqc=; b=N4JlkMngMxW8fHFcfT4Ny8ZviDG/grWo2NqFmDSArkajtlur/qimQCVx/M110LZ/Qj fbC7lnUErYIjnnyGFJ4JUe/e9xUb+1LW390tz1aXf7ojG0+4GAOSVq7nhSPWPl/qMCoC ylfQXzoAxk1iIaYQR5+6Eq8R50ys5WxU0QDVGRs9FBU9/FRgbiFBvH+DYmCfQB2B+dBQ P0bjTAUhN38kpD62ImQhx45aIGG9ys8uQiIbzW9GSTbqXYfkbOACY/HGCY2fy9iyUhPp qUKEYZ9xxiE+qtAAsu7MNwbINgM/IqqlWFnWmZxA+HhSH+hXGWIna1Oph2g9Q1ZJShNP 69Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735072227; x=1735677027; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k+nz+wdRIjhL9+vRqMRx+JEjQDQDgtNRlF5R/39mhqc=; b=AddzhNHOc3j25e1KUb0Wt6ucYhb9+qvBNQGrgPpSqG6j5wTf4fP9XZINW67qccCvvr 6WDnSUyZ35XOVh5Fuwvo6qUIf4Qg9Q/LMlpzmxGDgcSUStK2KS9UWlCsDbHrO3s1MtHW iq/8jq+xG//utgQC5vLJLUxh3mm8L/EIAGhhB7iZjGOi4yOgh8YtkHpWJj1KYkVDvpuq 5IT9grN+pw7/dXO4mxGigg9qxUzJT5d+TtihA4jxpj8gzGQsfNanjRDhQ33HsJhZau3s RqqBGyxctllLLCy7J5hW1JlvR9FbR32YOP2TrozQBbv+P6XuC+geSBSnSsXdlRpkKbhU io9A== X-Gm-Message-State: AOJu0Yzqs/xGCwSIv2iwhqitGza22IIM+pEWwdW4Zs+/sxGFcL6p2Obb MTUTBi43XBmoFtZVR30I8YDOHWWnwVfolCxxA6IHoWaCEq8dLIFvEYKltYGWkCnlon6Bd52e7mv r X-Gm-Gg: ASbGncuhifIjcoALOEYYxX6DZyASDxktjFneFNMNiArPrhXeVKMCjydV+oaZjnZA3wD BcHuH3itzinfwcCDbwA7Q17NlYp2iB3qFyigIE5DONDESGRPhQazv9eFh4OSGA91983ed2zLlWu EqhPiKqYEvnB3LOQ64DXUBznzN2DedlFHDAEPXWMNsodbzcfCnIwtHmKSijS+Nr6XmvHkVLOPHC Bgjk2ziUaRuVnSGetmh+9Jp8zWtgNODq7SSEV6EooK5Nu/P0dJkFGOE4v/2yWoNbPQ8mIEUSOCM ls/AChs4/q6E X-Google-Smtp-Source: AGHT+IEdpfFQExDXoaMWK1kmIoD8D+h4MCmmBci091hlIeH36nmNwY4FVolJw8DErpKyAGZjJER9hg== X-Received: by 2002:a05:6808:1908:b0:3e7:b956:976f with SMTP id 5614622812f47-3ed88f3ec03mr10853526b6e.11.1735072227017; Tue, 24 Dec 2024 12:30:27 -0800 (PST) Received: from fedora (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71fc998ef5fsm3072709a34.45.2024.12.24.12.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:30:26 -0800 (PST) Date: Tue, 24 Dec 2024 12:30:23 -0800 From: Stephen Hemminger To: Junlong Wang Cc: dev@dpdk.org Subject: Re: [PATCH v5 00/15] net/zxdh: updated net zxdh driver Message-ID: <20241224123023.276ec8dc@fedora> In-Reply-To: <20241223110249.1483277-1-wang.junlong1@zte.com.cn> References: <20241210055333.782901-2-wang.junlong1@zte.com.cn> <20241223110249.1483277-1-wang.junlong1@zte.com.cn> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Mon, 23 Dec 2024 19:02:34 +0800 Junlong Wang wrote: > V5: > - Simplify the notify_data part in the zxdh_notify_queue function. > - Replace rte_zmalloc with rte_calloc in the rss_reta_update function. > - Remove unnecessary check in mtu_set function. > > V4: > - resolved ci compile issues. > > V3: > - use rte_zmalloc and rte_calloc to avoid memset. > - remove unnecessary initialization, which first usage will set. > - adjust some function which is always return 0, changed to void > and skip the ASSERTION later. > - resolved some WARNING:MACRO_ARG_UNUSED issues. > - resolved some other issues. > > V2: > - resolve code style and github-robot build issue. > > V1: > - updated net zxdh driver > provided insert/delete/get table code funcs. > provided link/mac/vlan/promiscuous/rss/mtu ops. > > Junlong Wang (15): > net/zxdh: zxdh np init implementation > net/zxdh: zxdh np uninit implementation > net/zxdh: port tables init implementations > net/zxdh: port tables unint implementations > net/zxdh: rx/tx queue setup and intr enable > net/zxdh: dev start/stop ops implementations > net/zxdh: provided dev simple tx implementations > net/zxdh: provided dev simple rx implementations > net/zxdh: link info update, set link up/down > net/zxdh: mac set/add/remove ops implementations > net/zxdh: promisc/allmulti ops implementations > net/zxdh: vlan filter/ offload ops implementations > net/zxdh: rss hash config/update, reta update/get > net/zxdh: basic stats ops implementations > net/zxdh: mtu update ops implementations > > doc/guides/nics/features/zxdh.ini | 18 + > doc/guides/nics/zxdh.rst | 17 + > drivers/net/zxdh/meson.build | 4 + > drivers/net/zxdh/zxdh_common.c | 24 + > drivers/net/zxdh/zxdh_common.h | 1 + > drivers/net/zxdh/zxdh_ethdev.c | 595 +++++++- > drivers/net/zxdh/zxdh_ethdev.h | 40 + > drivers/net/zxdh/zxdh_ethdev_ops.c | 1573 +++++++++++++++++++++ > drivers/net/zxdh/zxdh_ethdev_ops.h | 80 ++ > drivers/net/zxdh/zxdh_msg.c | 169 +++ > drivers/net/zxdh/zxdh_msg.h | 232 ++++ > drivers/net/zxdh/zxdh_np.c | 2060 ++++++++++++++++++++++++++++ > drivers/net/zxdh/zxdh_np.h | 579 ++++++++ > drivers/net/zxdh/zxdh_pci.c | 23 +- > drivers/net/zxdh/zxdh_pci.h | 9 +- > drivers/net/zxdh/zxdh_queue.c | 242 +++- > drivers/net/zxdh/zxdh_queue.h | 144 +- > drivers/net/zxdh/zxdh_rxtx.c | 804 +++++++++++ > drivers/net/zxdh/zxdh_rxtx.h | 20 +- > drivers/net/zxdh/zxdh_tables.c | 794 +++++++++++ > drivers/net/zxdh/zxdh_tables.h | 231 ++++ > 21 files changed, 7613 insertions(+), 46 deletions(-) > create mode 100644 drivers/net/zxdh/zxdh_ethdev_ops.c > create mode 100644 drivers/net/zxdh/zxdh_ethdev_ops.h > create mode 100644 drivers/net/zxdh/zxdh_np.c > create mode 100644 drivers/net/zxdh/zxdh_np.h > create mode 100644 drivers/net/zxdh/zxdh_rxtx.c > create mode 100644 drivers/net/zxdh/zxdh_tables.c > create mode 100644 drivers/net/zxdh/zxdh_tables.h > This looks good, I saw a couple things that could be addressed later. First, the log messages are a little inconsistent. Some have blanks before or after message, others not. And some end with period but most don't. Easy to fix later. The other minor thing is still some calls to free functions checking for null, I can add this follow on patch after merging to address this. diff --git a/drivers/net/zxdh/zxdh_ethdev.c b/drivers/net/zxdh/zxdh_ethdev.c index e992c3f6cf..942435d318 100644 --- a/drivers/net/zxdh/zxdh_ethdev.c +++ b/drivers/net/zxdh/zxdh_ethdev.c @@ -944,19 +944,15 @@ zxdh_np_dtb_data_res_free(struct zxdh_hw *hw) if (ret) PMD_DRV_LOG(ERR, "%s dpp_np_online_uninstall failed", dev->data->name); - if (g_dtb_data.dtb_table_conf_mz) - rte_memzone_free(g_dtb_data.dtb_table_conf_mz); + rte_memzone_free(g_dtb_data.dtb_table_conf_mz); + g_dtb_data.dtb_table_conf_mz = NULL; - if (g_dtb_data.dtb_table_dump_mz) { - rte_memzone_free(g_dtb_data.dtb_table_dump_mz); - g_dtb_data.dtb_table_dump_mz = NULL; - } + rte_memzone_free(g_dtb_data.dtb_table_dump_mz); + g_dtb_data.dtb_table_dump_mz = NULL; for (i = 0; i < ZXDH_MAX_BASE_DTB_TABLE_COUNT; i++) { - if (g_dtb_data.dtb_table_bulk_dump_mz[i]) { - rte_memzone_free(g_dtb_data.dtb_table_bulk_dump_mz[i]); - g_dtb_data.dtb_table_bulk_dump_mz[i] = NULL; - } + rte_memzone_free(g_dtb_data.dtb_table_bulk_dump_mz[i]); + g_dtb_data.dtb_table_bulk_dump_mz[i] = NULL; } g_dtb_data.init_done = 0; g_dtb_data.bind_device = NULL; @@ -1053,10 +1049,8 @@ zxdh_dev_close(struct rte_eth_dev *dev) zxdh_bar_msg_chan_exit(); - if (dev->data->mac_addrs != NULL) { - rte_free(dev->data->mac_addrs); - dev->data->mac_addrs = NULL; - } + rte_free(dev->data->mac_addrs); + dev->data->mac_addrs = NULL; return ret; } diff --git a/drivers/net/zxdh/zxdh_np.c b/drivers/net/zxdh/zxdh_np.c index 42679635f4..11ad92e78f 100644 --- a/drivers/net/zxdh/zxdh_np.c +++ b/drivers/net/zxdh/zxdh_np.c @@ -873,8 +873,7 @@ zxdh_np_sdt_mgr_destroy(uint32_t dev_id) p_sdt_tbl_temp = ZXDH_SDT_SOFT_TBL_GET(dev_id); p_sdt_mgr = ZXDH_SDT_MGR_PTR_GET(); - if (p_sdt_tbl_temp != NULL) - free(p_sdt_tbl_temp); + free(p_sdt_tbl_temp); ZXDH_SDT_SOFT_TBL_GET(dev_id) = NULL;