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 B02A3459D8; Thu, 19 Sep 2024 21:05:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9EAD4433D6; Thu, 19 Sep 2024 21:05:43 +0200 (CEST) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 4B306433D2 for ; Thu, 19 Sep 2024 21:05:42 +0200 (CEST) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2068a7c9286so13490895ad.1 for ; Thu, 19 Sep 2024 12:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1726772741; x=1727377541; 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=Bx2wV6Bk5CilGNe7OKIeGE3Zj4kMDYxh74uuZhyYBKo=; b=1a/vkWi3m5BHiUT7ukbVHp07RKTv8rfkrzZTt6X88T+RHBwoWGAh+q/EWAMp1ceznC HBGv/WQfIEARD8WsYI8KdLjrnoG5VW5ZsmeJrDBMQ1bo0c/BmbcDAJNWWten3DJKKR7+ 7V003YnjSFF3Xp3vq/d12RUuobuPMMy80W4L6fv3qn2UbbBz83En8Vs3RXN0UTEBJJMC fnv0pO4UdonWvFFW2t9SdqX5WQgjPNIfThf9Ls58NyYmLWGQQxPYylYL3dzO8nle1Amw hwKdZmVpVeAXA0WzdekAWmHccXZzySj40A/EsSNSMEMnMgBeng0ryHP6LqSQ4sc+B1sA 70aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726772741; x=1727377541; 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=Bx2wV6Bk5CilGNe7OKIeGE3Zj4kMDYxh74uuZhyYBKo=; b=QYveTMR6Xi0P8GGwm8GBV3/zQAIHngPo39M7UX2a+YRVbqGdgDU1EwySAtjb5UokYh 0fLsqO9+cJznhlz44Ba1IDPo+KNfWszssxUKZSOpgLu3eiAzf8SDiN10YA6VBhsvrsqd VrIWB89a2v/XOuY1IOHK/Urd4ivu2w2VsEY7VzuyshBigKq1D8dPVnViVRnemukH5ceL e59Ux/qzPZTM/YMPXaYWHeGjd3hgRlmTBu+HG2poB3wAQ3607FNx5GVqPWjnx14T/ISu qqqJWEr01JfoWR+HOwrIuJ3RucG7UMHKnGiYx0C2LQwRFR+nswIEQJ/O6k9t8x4fwu1/ 5C/w== X-Gm-Message-State: AOJu0Yy07ZlymNXREmUxtmj9WOYb0keDXm1/vSupxn1mG2+EtKris1Tp wA107olN6jnfQpy8G5IsykTFp0Kq8b+5P3e1IHcjJGaW9rzgPpA2AJOMpWdmP3o= X-Google-Smtp-Source: AGHT+IEYcBCvn7omtnOfXfHhfF4kLoztSFHBN0qTIS8PlDEBU/tR4sRB4bt4WAdCtw8HOW2jpWpYxQ== X-Received: by 2002:a17:902:c40d:b0:205:82d5:2368 with SMTP id d9443c01a7336-208d8414165mr3868295ad.49.1726772741200; Thu, 19 Sep 2024 12:05:41 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-207945db101sm83491045ad.1.2024.09.19.12.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 12:05:41 -0700 (PDT) Date: Thu, 19 Sep 2024 12:05:39 -0700 From: Stephen Hemminger To: "WanRenyong" Cc: , Subject: Re: [PATCH v3 19/19] net/xsc: add dev basic stats ops Message-ID: <20240919120539.04e41a87@hermes.local> In-Reply-To: <20240918060936.1231758-20-wanry@yunsilicon.com> References: <20240918060936.1231758-20-wanry@yunsilicon.com> 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 Wed, 18 Sep 2024 14:09:36 +0800 "WanRenyong" wrote: > @@ -166,6 +169,7 @@ xsc_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) > /* Fill wqe */ > wqe->va = rte_cpu_to_le_64(rte_pktmbuf_iova(rep)); > rte_pktmbuf_data_len(seg) = len; > + rxq->stats.rx_bytes += rte_pktmbuf_pkt_len(pkt); > > *(pkts++) = pkt; > pkt = NULL; > @@ -200,6 +204,7 @@ xsc_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) > rxq->nb_rx_hold = 0; > } > > + rxq->stats.rx_pkts += nb_pkts; > return nb_pkts; > } You can a small performance boost by keeping a total_bytes counter in rx_burst function and only add it to rx_bytes after the loop.