From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 05F79A0613 for ; Mon, 23 Sep 2019 05:30:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C189C5B32; Mon, 23 Sep 2019 05:30:33 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 45BFE37A2 for ; Mon, 23 Sep 2019 05:30:32 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2019 20:30:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,538,1559545200"; d="scan'208";a="190533338" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 22 Sep 2019 20:30:30 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 22 Sep 2019 20:30:30 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.140]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.89]) with mapi id 14.03.0439.000; Mon, 23 Sep 2019 11:30:28 +0800 From: "Wu, Jingjing" To: "Li, Xiaoyun" , "Wiles, Keith" , "Maslekar, Omkar" , "Liang, Cunming" CC: "dev@dpdk.org" Thread-Topic: [PATCH v4 2/4] raw/ntb: add xstats support Thread-Index: AQHVZr6cCeopW07hHkqEl8Miicy+86c4sCsw Date: Mon, 23 Sep 2019 03:30:27 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F81151CB30@SHSMSX103.ccr.corp.intel.com> References: <20190906075402.114177-1-xiaoyun.li@intel.com> <20190909032730.29718-1-xiaoyun.li@intel.com> <20190909032730.29718-3-xiaoyun.li@intel.com> In-Reply-To: <20190909032730.29718-3-xiaoyun.li@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmY2YmNiNDktOWM3Yi00OGRkLWFiN2QtMjI1MmQ1MWUyODhjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiK29JK1dZNTRHb2MwSmUyOEVcL2lxcDJISEFmMDgxMDBiWlIwMW95STVMcWlWWkJTVHlWMzhxY2g4Zk5DTm13Y24ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 2/4] raw/ntb: add xstats support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > static int > -ntb_xstats_reset(struct rte_rawdev *dev __rte_unused, > - const uint32_t ids[] __rte_unused, > - uint32_t nb_ids __rte_unused) > +ntb_xstats_reset(struct rte_rawdev *dev, > + const uint32_t ids[], > + uint32_t nb_ids) > { > - return 0; > -} > + struct ntb_hw *hw =3D dev->dev_private; > + uint32_t i, xstats_num; >=20 > + xstats_num =3D NTB_XSTATS_NUM * (hw->queue_pairs + 1); > + for (i =3D 0; i < nb_ids && ids[i] < xstats_num; i++) > + hw->ntb_xstats[ids[i]] =3D 0; > + As there is no lock for the xstats, the enqueue and dequeuer thread are upd= ating the value. It will cause competition. Suggest to save the ntx_xstats, and update the value when enqueue and deque= uer are updating. Thanks Jingjing