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 693A245481; Tue, 18 Jun 2024 01:57:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 43325402B0; Tue, 18 Jun 2024 01:57:02 +0200 (CEST) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mails.dpdk.org (Postfix) with ESMTP id A54034027B for ; Tue, 18 Jun 2024 01:57:01 +0200 (CEST) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-705bf368037so4372026b3a.0 for ; Mon, 17 Jun 2024 16:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1718668621; x=1719273421; 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=nXEPLsBvVqKAE+ACZGiRdHhAQI2eg1ApGiIvI1NKpXw=; b=Jaikp7zeL4/dxbpPEn5n1EF7YatBEj44z3D8NuaUNN4Nco/cJT0mUUZVDLHXaltOKi 9I2SHol6YlO0BcF3qUUiNFYweMFNwawT7bb6os3udWuWbEAYLCsXAlbPHdxVVkWNpaNb y0mx+h+YpQ8BjS7R969iTRnfY6/owg/24U9z6jd6TIGo2SGEe//4vYbVzYusdnVJ7KuZ xBElGJWaUy32leZVyGIglrDhxZ9z1bZVVLT/EfZvoxtguy5CYuW0dHZQVElXcIiFBZZY XXqADL/+RPlSsyABdCEVXwSkHYK+PjPbbLIt3QIOra9u3VcsOleDSo4iEEMwn/BLYwOu pRdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718668621; x=1719273421; 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=nXEPLsBvVqKAE+ACZGiRdHhAQI2eg1ApGiIvI1NKpXw=; b=JRdIOQ+TL3kxwEVL02aBvOP6g3AQpxSGvPlskUrhJsYT4VyHNQQWDlu5Z+KPGbzcUk WRJiebJhq1CQfKW6pwDqYweqedD3gQRHT3xlCQjXO+4PmEqqb4U25XgV7F3sl9ONsdY1 WnEL6a4MMgorjVzlMPlwQCglDJ40Ker9C7IeGzcPAIwQTOJmINF27VVjQi20yjOqL8fu SjJl/sercZYhCYVOwHLdkwbcAWaI3K3UbZYWlU22AFqnrUusAh72C6TdCCx14EcyIqdQ hLtfGReqSgGYJkxz0yjKdnWbm3GVn7AIxAVSwFUcb6T+Gg+XOtlsaLVNjMXGYKRDoO/6 G9iA== X-Gm-Message-State: AOJu0YzT+WEEoTJzab9ob1BuATivk4I8N0tvIHJ58UurVokmVCJB4iNW ko4KbIB310HfBFqKSS8bFwPzodeU0P8HL8bu1LHUAviVXiljaSHLs/pr7Gr4b1E= X-Google-Smtp-Source: AGHT+IHQ+vczN4JE1A+VJCQxzxqJOI3LA0GTru3vv3HQ4ySpNY+5dIfO6EUSE97Cjvunc5faSBSt3Q== X-Received: by 2002:a05:6a20:3949:b0:1b6:4151:6158 with SMTP id adf61e73a8af0-1bae802b510mr13676298637.47.1718668620727; Mon, 17 Jun 2024 16:57:00 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705ccb3d1f8sm7917343b3a.113.2024.06.17.16.57.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 16:57:00 -0700 (PDT) Date: Mon, 17 Jun 2024 16:56:58 -0700 From: Stephen Hemminger To: Howard Wang Cc: , Subject: Re: [PATCH v2] r8126: add r8126 ethernet poll mode driver Message-ID: <20240617165658.2fdaf742@hermes.local> In-Reply-To: <20240613033929.5643-1-howard_wang@realsil.com.cn> References: <20240527061347.10013-1-howard_wang@realsil.com.cn> <20240613033929.5643-1-howard_wang@realsil.com.cn> 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 Thu, 13 Jun 2024 11:39:29 +0800 Howard Wang wrote: > +static void > +rtl8126_sw_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats) > +{ > + struct rtl8126_adapter *adapter = RTL8126_DEV_PRIVATE(dev); > + struct rtl8126_sw_stats *sw_stats = &adapter->sw_stats; > + > + rte_stats->ibytes = sw_stats->rx_bytes; > + rte_stats->obytes = sw_stats->tx_bytes; > +} > + There is ongoing discussion about how to handle thread safety for sw stats in other drivers. Without using atomic or volatile there is no guarantee that on weakly ordered platforms that the stats will get reset properly. > +static int > +rtl8126_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats) > +{ > + struct rtl8126_adapter *adapter = RTL8126_DEV_PRIVATE(dev); > + struct rtl8126_hw *hw = &adapter->hw; > + > + if (rte_stats == NULL) > + return -EINVAL; This is already checked and logged in rte_ethdev.c Quite limiting that the device only support single rx and tx queue. Does the device support primary/secondary process.