Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2630328rdb; Wed, 15 Nov 2023 06:26:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXHEV5eOPRwJTLL1GnRdWc+mHnGnKqCgRZTRvF5GN7CxuS8nXx8rRMWUmUOxcCXfXqclbL X-Received: by 2002:a17:903:234b:b0:1cc:9781:4782 with SMTP id c11-20020a170903234b00b001cc97814782mr6958555plh.62.1700058394566; Wed, 15 Nov 2023 06:26:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700058394; cv=none; d=google.com; s=arc-20160816; b=iCluAN7AP5c9PINyh4ovNILuQKNfk3CFIzm2NKB/kHN4rWkMxu1QKtYS4GA7cnOwcU uhNbRX690og4jzPlBml2FQKdycRA0UUaqL7Xk0Ggc30L7dkimfs5vy5sT+RbZAX4w0Rv l9rWqXunhQWFmaWo5lYeo8bEJadsq2HtmfL8+Y0TJjchgMlfJaI0T9gq07BpTgFSiyyA KhwKd7BMxx7+1YgzpBev9+1D2oA7tGREuYtTOitIaZi8s0dprEV4I8VhhWNO4Wk7Bsy+ bNK1cXTL5DGG5Zv/BKx9fe7ct754/5GLoKRxDooB4HmUqvw0Qqsi6tI8mCNb7SXMDTBI kkxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mcvpdzDtk5jzuN4pmY/JYRyuEOrAgHfLi5/D9T7kiAY=; fh=DQ4iYRSMLAEi5vZHJLJxXHYGayqB3vG83MXII+z0OHs=; b=DAR9oma93uXH1BDXjN/lq1+8VoXjCRjleD4IJLxFdG40uKIXnVZAXW66vJ3HSrRmut 1IUmHYxUUJPdG805HMfhViTt5nee3OhFSBb9vdou+LUvLO9AecxdyLDmkrpp2RpVl6EO DPqAeXhPuCIae0kvjml63QGYGWOhASlNJ3YorCQ7oj+5OG3342POxDFXRo9+9IQWfqrQ C2EtEqlDJE8YT5DGFfXedfU9IhjxMXLjrE2/A80Ms2Cavujs/iTEqsrwXYK54KFe2N4H llg4JSMxUyDqCeVCHiQzOXtGN/RhTOM348OE/0FMSx7yCLX53RLyVoljrVYsdcmMQJZH JRNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K03ScaPQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id y9-20020a170902864900b001b8c824e826si10104801plt.533.2023.11.15.06.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 06:26:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K03ScaPQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E6251802AFD7; Wed, 15 Nov 2023 06:26:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344193AbjKOO0W (ORCPT + 99 others); Wed, 15 Nov 2023 09:26:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344185AbjKOO0V (ORCPT ); Wed, 15 Nov 2023 09:26:21 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12ACCE7; Wed, 15 Nov 2023 06:26:18 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18E9BC433C7; Wed, 15 Nov 2023 14:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700058377; bh=i+fNJ/Tm8f6CULGHTu6mifl+Pse6PCwH1Lncgf+r01E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K03ScaPQTlBNPfR4SG8Sm3QxReki9UYIIGvktDSa/PZYwu8CgAeyUAiE9J4MOmisL eaxdG6Z8xZ2pdt786M5/wKLSx8UhKomJ04oScNHjo1xuWdBY1RIFWAP1pq47A1Gcx+ Qvtid6EJRXDXJuSDrl+xfWbkMR0zdmNKNQwrb1UA9lCKHRlgCpAum/l7bcy8FqavD5 YS05LNTH1fWkb6rHcx2+u2PX5uNejd/PjgK4iSSRik+wXf1hxHsxSLlfAoMVsVe/JR HC13u0quLTDV2qeiJnfs+2gFTvtyLpIxD+U4l+s24A6oi7LZGroxP+5CJkCDfs78PC pMGgW/6GtvN6w== Date: Wed, 15 Nov 2023 16:26:13 +0200 From: Leon Romanovsky To: Junxian Huang Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org, linuxarm@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH for-next 3/3] RDMA/hns: Support SW stats with debugfs Message-ID: <20231115142613.GD51912@unreal> References: <20231114123449.1106162-1-huangjunxian6@hisilicon.com> <20231114123449.1106162-4-huangjunxian6@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231114123449.1106162-4-huangjunxian6@hisilicon.com> X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 15 Nov 2023 06:26:32 -0800 (PST) On Tue, Nov 14, 2023 at 08:34:49PM +0800, Junxian Huang wrote: > Support SW stats with debugfs. > > Query output: > $ cat /sys/kernel/debug/hns_roce/hns_0/sw_stat/sw_stat > aeqe --- 3341 > ceqe --- 0 > cmds --- 6764 > cmds_err --- 0 > posted_mbx --- 3344 > polled_mbx --- 3 > mbx_event --- 3341 > qp_create_err --- 0 > qp_modify_err --- 0 > cq_create_err --- 0 > cq_modify_err --- 0 > srq_create_err --- 0 > srq_modify_err --- 0 > xrcd_alloc_err --- 0 > mr_reg_err --- 0 > mr_rereg_err --- 0 > ah_create_err --- 0 > mmap_err --- 0 > uctx_alloc_err --- 0 From one side, Everything will be much easier if you use one file == one value. It will remove the need in seq_* calls. Your "cat ../sw_stat" is not atomic and doesn't present snapshot anyway. From another, It is debugfs and it is upto you. Let's wait a couple of days more and if no one complains, I'll apply it as is. Thanks