From patchwork Thu Dec 22 00:13:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mogilappagari, Sudheer" X-Patchwork-Id: 13079324 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D77B3C4332F for ; Thu, 22 Dec 2022 00:18:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234804AbiLVAR6 (ORCPT ); Wed, 21 Dec 2022 19:17:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234763AbiLVARr (ORCPT ); Wed, 21 Dec 2022 19:17:47 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B29751A062 for ; Wed, 21 Dec 2022 16:17:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671668265; x=1703204265; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ColUiWyjDeRbGXK6Lc3R59xYKeILVxg5xEy46g5hmAI=; b=mXfN/AErYO768PkwQwr3Zfn+bxPW4S5SRwgDpC1XunCdAHuqAe9MPsCk Lq+katb/YAvklbJzIQA8C7XnoSG+GobvwAD420a2PMG6Ffz7TGcSbVkFL dUNkrePvCPfln7jaP3CcT/gIe3Dk3nU7l7W2WHNX+N7Kla6SnYBLvTOWE hvah5kGyOzxaqv6DRqwaQCbqi6sW6sdPlqKTQxy8SpqtQZQMl4fYvmJvh UWCOdXe6x5eAv3Ikam//4GfwDjwPfZB0PVc5ONrQE6SiIAE20n9e+obHl j8Kg/wl9qZcHIoUNMemHp7QvUE46p9kkM/qbH7gmhvqDCwivYXv3gN5V7 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10568"; a="318701441" X-IronPort-AV: E=Sophos;i="5.96,263,1665471600"; d="scan'208";a="318701441" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2022 16:17:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10568"; a="720117627" X-IronPort-AV: E=Sophos;i="5.96,263,1665471600"; d="scan'208";a="720117627" Received: from msu-dell.jf.intel.com ([10.166.233.5]) by fmsmga004.fm.intel.com with ESMTP; 21 Dec 2022 16:17:42 -0800 From: Sudheer Mogilappagari To: netdev@vger.kernel.org Cc: kuba@kernel.org, mkubecek@suse.cz, andrew@lunn.ch, corbet@lwn.net, sridhar.samudrala@intel.com, anthony.l.nguyen@intel.com Subject: [PATCH ethtool-next v2 0/2] add netlink support for rss get Date: Wed, 21 Dec 2022 16:13:41 -0800 Message-Id: <20221222001343.1220090-1-sudheer.mogilappagari@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz These patches add netlink based handler to fetch RSS information using "ethtool -x [context %d]" command. Output without --json option $ethtool -x eno2 RX flow hash indirection table for eno2 with 8 RX ring(s): 0: 0 0 0 0 0 0 0 0 8: 0 0 0 0 0 0 0 0 16: 1 1 1 1 1 1 1 1 ...skip similar lines... 120: 7 7 7 7 7 7 7 7 RSS hash key: be:c3:13:a6:59:9a:c3:c5:d8:60:75:2b:4c:b2:12:cc:5c:4e:34: 8a:f9:ab:16:c7:19:5d:ab:1d:b5:c1:c7:57:c7:a2:e1:2b:e3:ea: 02:60:88:8e:96:ef:2d:64:d2:de:2c:16:72:b6 RSS hash function: toeplitz: on xor: off crc32: off Output with --json option $ethtool --json -x eno2 [ { "ifname": "eno2", "RSS indirection table": [ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2 ...skip similar lines... 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 ], "RSS hash Key": "be:c3:13:a6:59:9a:c3:c5:d8:60:75:2b:4c: b2:12:cc:5c:4e:34:8a:f9:ab:16:c7:19:5d:ab:1d:b5:c1:c7:57: c7:a2:e1:2b:e3:ea:02:60:88:8e:96:ef:2d:64:d2:de:2c:16:72:b6", "RSS hash function": { "toeplitz": "on", "xor": "off", "crc32": "off" } } ] Signed-off-by: Sudheer Mogilappagari --- v2: -Added json support --- Sudheer Mogilappagari (2): Move code that print rss info into common file netlink: add netlink handler for get rss (-x) Makefile.am | 2 +- common.c | 43 +++++++ common.h | 7 ++ ethtool.c | 46 +------ netlink/desc-ethtool.c | 11 ++ netlink/extapi.h | 2 + netlink/rss.c | 272 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 342 insertions(+), 41 deletions(-) create mode 100644 netlink/rss.c