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 AB54A43FEF; Fri, 10 May 2024 21:30:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 29B0C402C4; Fri, 10 May 2024 21:30:58 +0200 (CEST) Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) by mails.dpdk.org (Postfix) with ESMTP id A9818402BB for ; Fri, 10 May 2024 21:30:55 +0200 (CEST) Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-5b290669b0fso436119eaf.2 for ; Fri, 10 May 2024 12:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1715369455; x=1715974255; 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=Ips4OOeMdpc7gEy9dmOsfkEfqJ4eRK6R4nentMV4irY=; b=Ln8G/WGbOPkhh9ve9qvU7X3JRA1LIvQxLQd7zMlylhtftyiBNdbnqOCB/+yj7Qigxm /vj/RDU3Hqsm+UEEOhpgEUPLxGcfJlCTPR3Yb5/abh4gjdVr4B5vKOSskLfqfAPrJDM8 aB17s6F7h7HJNJvF3QipUIH2bQPQ0s+76mRU9572fbDX0F7G1yauN+/wvL3bJbpOT1yT b0rJVCzIk9anySl/mFFWL5gz1+7D6SnFSajnaL1FfVEQ6hEwbXKKSTcMA6J/nsd0QCvM Mdt1txyus9PK1Dr7JDGci56YyfH4qdUEzirSAQ5MfAsLD3XaIDIZQcz73cTmIT6WVzkb RNXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715369455; x=1715974255; 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=Ips4OOeMdpc7gEy9dmOsfkEfqJ4eRK6R4nentMV4irY=; b=SENYe7WGW6Gcm7XUnJ17k2oiUtKN+QkMx7EhRtL5qaEaddPvAsN1a6Y9WARwKkBDGb b4EDl98by9FTp/11I+Jvesmbjo5d9qDOhtXYf9RwalYcFL0nmGb7wfJOzYaHWstE7bZT UEBpe9iEsgmTVDgtUQv/O3Jc9j/BLwD6ej7jU5eoWotiU2KEHzwDnZ7eV0rfZBgR0wi0 fLf++jmkuYcjNgGW4UgdX4GIFaJ8aQIVtPzrdymmNI7kShXfozGcNsJBYnzXhq4AgHzM LSyfEPy9csNwjyvzpapNl1nvi7Jvj6oJtaZAg3IiPL0qs3BrkK8e+xbEZQq63Ueb1Nvv cdEw== X-Gm-Message-State: AOJu0YwDualkzOcjZZqDf8mRczheiXMT16DSYSRnVGowa962Ja0aw+gQ I/X/3N0QgJ0D2E3QQEuXtyuOR+O7UthbFQQ6JYZ0ijke0i/+u3fIfQgpvOmU0GWAa1bUmKYmqwD K+pM= X-Google-Smtp-Source: AGHT+IEETziFU+rlXO9mB45gqVrG1MOrhxGAhXeXrMCL1SU7TShvYrcwswxNzzALuh4EhUyh6JeK2w== X-Received: by 2002:a05:6358:52d2:b0:18f:9dda:502d with SMTP id e5c5f4694b2df-193bcfda60bmr427398655d.22.1715369454618; Fri, 10 May 2024 12:30:54 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-63411346d96sm2984993a12.81.2024.05.10.12.30.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 12:30:54 -0700 (PDT) Date: Fri, 10 May 2024 12:30:52 -0700 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: Subject: Re: [RFC 0/3] generic sw counters Message-ID: <20240510123052.0e8a04ef@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F437@smartserver.smartshare.dk> References: <20240425174617.2126159-1-ferruh.yigit@amd.com> <20240510050507.14381-1-stephen@networkplumber.org> <98CBD80474FA8B44BF855DF32C47DC35E9F437@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Fri, 10 May 2024 19:29:48 +0200 Morten Br=C3=B8rup wrote: > ad, common functions are good. >=20 > I'm somewhat skeptical about putting the stats structure first in the rte= _eth_dev_data's tx_queues and rx_queues. > These are void* because their types are private to the PMD. Putting the s= tats structure first is somewhat a hack, partially removing that privacy. > Perhaps we can make it look less like a hack. After all, it is still a pr= ivate structure type, only the first part is public and must be the same ac= ross drivers using the SW stats counters. Overlapping certain parts of a pr= ivate structure with a public structure is a common design pattern; I've se= en it used elsewhere in DPDK too. > If we get used to it for SW ethdev drivers, we might not consider it a ha= ck anymore. ;-) The tradeoff here, is putting them first allows for writing generic version= of eth_stats_get and eth_stats_reset. Other option is having generic code take offset for tx/rx to find the stats. C doesn't have RTI like C++ so this was best I could think of.