From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D03CC25B50 for ; Tue, 24 Jan 2023 19:55:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GZjwsE68EoGy3iAOKvv6Auf7KD+1Pm8D4Rw4gAdH6mc=; b=TZ+9ujyzIENV4YIxajrKHE95io RwqsoSvwU1bWNeSxJayPr0GF2LNvZL2FWPrcGljexm6y63Whr1kxn52nTF+p6WRna09pY2A+bTzbj sh6fXS+77Br24dUiI9Jo7lv1JrN72TDmfonFroxAz/4PnT6apxn1HFkjLl9lynYWBTWfYygJh8rGE NnfwhGtFfmilzDfafrultUAdwPJwBafMDjrjIiMKnxiMvSSCzk09UXmq/7RzWEUfBJh1AVD2Asgb5 euwsWuKuJC8iMsIypiXpk/4G/zgDU9xEOSlsQUVqKUsOCA4i7WT1D374Zc/MxGJh4iwSCWARHv8uw UwlxLA8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKPOS-0057TG-Sj; Tue, 24 Jan 2023 19:55:44 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKPOQ-0057SN-HM for linux-nvme@lists.infradead.org; Tue, 24 Jan 2023 19:55:43 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 19C866132A; Tue, 24 Jan 2023 19:55:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A5FCC4339B; Tue, 24 Jan 2023 19:55:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674590139; bh=dL0wPOOHKT8RcdklBV6JyrPollRkqdjcgKjRe8mmkeE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PHFQJBO6AwQpGd8EvWs2iNF9mKrYZ1ii5dG/HL8G3HnJDPQUlJbeUS2xQeCqQaCr2 VgirbbKXzdL2nZ2dSRhnBDWRI53sNad/WeNiPqHCuds+2J7B8qyfjF/8t28fnWE3gG 0+zKN/AeY5SK337kDuJiI0kizrpnOn5l9UZwb4A3UvD5nkW5wX/M3wfsg0H0w6C4C0 XxZ5KKtLOBIlfhjDu+4JZI9YdwTGobkAc9LXwFSUGnVPeKi8QtupNWl+fQx0W7BVi3 kVWBnkuXYhQAqC2u+8EgJAzB1hPL2+VHaEAQy5l/ZiHqEWBBiwHQELFW8kn+wScKf4 mMGaB3KDH2zDA== Date: Tue, 24 Jan 2023 11:55:38 -0800 From: Jakub Kicinski To: Aurelien Aptel Cc: linux-nvme@lists.infradead.org, netdev@vger.kernel.org, sagi@grimberg.me, hch@lst.de, kbusch@kernel.org, axboe@fb.com, chaitanyak@nvidia.com, davem@davemloft.net, aurelien.aptel@gmail.com, smalin@nvidia.com, malin1024@gmail.com, ogerlitz@nvidia.com, yorayz@nvidia.com, borisp@nvidia.com Subject: Re: [PATCH v9 03/25] net/ethtool: add ULP_DDP_{GET,SET} operations for caps and stats Message-ID: <20230124115538.698f2712@kernel.org> In-Reply-To: <253o7qouoen.fsf@mtr-vdi-124.i-did-not-set--mail-host-address--so-tickle-me> References: <20230117153535.1945554-1-aaptel@nvidia.com> <20230117153535.1945554-4-aaptel@nvidia.com> <20230119184147.161a8ff4@kernel.org> <253o7qprtcq.fsf@mtr-vdi-124.i-did-not-set--mail-host-address--so-tickle-me> <20230123143830.60f436ef@kernel.org> <253o7qouoen.fsf@mtr-vdi-124.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230124_115542_651580_A5288566 X-CRM114-Status: GOOD ( 19.43 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On Tue, 24 Jan 2023 14:07:12 +0200 Aurelien Aptel wrote: > Jakub Kicinski writes: > > But this is not how they should be carried. > > > > The string set is retrieved by a separate command, then you request > > a string based on the attribute ID (global_stringset() + get_string() > > in ethtool CLI code). > > > > That way long running code or code dumping muliple interfaces can load > > strings once and dumps are kept smaller. > > As far as I understand, this is what our code is doing, it is aligned > with the feature bits implementation and its usage of bitsets. > > Features use netlink bitsets which have a verbose (include literal > strings) and compact form (use stringset ID). > > Similarly our stats have a verbose (literal strings) and compact > form (use implicit stringset ID). > > In the compact form, since we always return the complete stats list the > string id is implicit: the first stat is string id 0, next one string id > 1, and so on. We just return the complete stat array as a blob under > "COMPACT_VALUES". > > In ethtool CLI we are using the compact form and calling > global_stringset() + get_string() as you suggested: > > stat_names = global_stringset(ETH_SS_ULP_DDP_STATS, > nlctx->ethnl2_socket); > > Then later: > > for (i = 0; i < results.stat_count; i++) { > const char *name = get_string(stat_names, i); > printf("%s: %lu\n", name, results.stats[i]); > } > > See > https://github.com/aaptel/ethtool/blob/ulp-ddp-v9/netlink/ulp_ddp.c#L186-L189 > https://github.com/aaptel/ethtool/blob/ulp-ddp-v9/netlink/ulp_ddp.c#L154-L157 > > Should we remove the verbose form? Yes, it just complicates the kernel code to no significant gain, IMO.