From patchwork Tue Sep 14 11:27:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12492785 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5110EC433F5 for ; Tue, 14 Sep 2021 11:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34869610E6 for ; Tue, 14 Sep 2021 11:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232050AbhINL3U (ORCPT ); Tue, 14 Sep 2021 07:29:20 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:55817 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232056AbhINL3R (ORCPT ); Tue, 14 Sep 2021 07:29:17 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 22E465803A6; Tue, 14 Sep 2021 07:27:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 14 Sep 2021 07:27:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=SDiMyj QUvv7Q6DVKEVSY2ENb+ITtLR4xL6jSv3EDzgA=; b=oWbxQ8tbdBp0VGXbu9LzWX O9LEoFPqYym/pomSnZ8J0r0dPfRNNsvCKfnUnXg4n9inf1jT6ZhUW0z5TBTA5Xrm ciyKWL1V5Wk/eHoCBCWTk3AVh/Za4brdPk2/Fyrna7tcPDOMX+5r5Nj7pyW3VjEN HZ+AL76fPkMW7QMzG8AfHM428lcgE4+TW2CsMO1xgh/TUrboN93IdvagZBFECx2e g2l5BO7ZzK6cmpzGsxQ3qD9Zb/QZsiPVlliXoqGVcnDReACuS9mWraQRj1Gh0Iuh LKvtcbGKtoc0eOE7UBdCy5mGN50SrcKJUCVYJ2KsSGo7j3m1wxXjr6XZ/s2GoWng == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudegledgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofggtgfgsehtkeertd ertdejnecuhfhrohhmpefkughoucfutghhihhmmhgvlhcuoehiughoshgthhesihguohhs tghhrdhorhhgqeenucggtffrrghtthgvrhhnpeetffegheejueehkeehffeugedtffejte efgfejheeuhfevfeeggedugeekgfdvgfenucffohhmrghinhepghhithhhuhgsrdgtohhm necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihguoh hstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Sep 2021 07:27:55 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, kuba@kernel.org, andrew@lunn.ch, f.fainelli@gmail.com, vadimp@nvidia.com, mlxsw@nvidia.com, vladyslavt@nvidia.com, moshe@nvidia.com, popadrian1996@gmail.com, Ido Schimmel Subject: [PATCH ethtool 0/5] ethtool: Module EEPROM fixes Date: Tue, 14 Sep 2021 14:27:33 +0300 Message-Id: <20210914112738.358627-1-idosch@idosch.org> 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 From: Ido Schimmel This patchset contains fixes for various issues I noticed while working on the module EEPROM parsing code. In addition to these fixes, I have the following submissions ready for the next branch [1]: * Trivial coding style / documentation changes * Reworking the EEPROM parsing code to use a memory map with pointers to individual pages as the current state is sub-optimal. In the IOCTL path, one large buffer is passed to parsers (e.g., SFF-8636, CMIS). In the netlink path, individual pages are passed, some of which might not be valid. With the proposed changes, the IOCTL and netlink paths only differ in the way they initialize the memory map. The parsing code is completely shared * Extending the CMIS parser to request and parse diagnostic information (already present in SFF-8636) from optional / banked pages [1] https://github.com/idosch/ethtool/commits/submit/cmis_dump_v1 Ido Schimmel (5): sff-8636: Fix parsing of Page 03h in IOCTL path cmis: Fix invalid memory access in IOCTL path netlink: eeprom: Fallback to IOCTL when a complete hex/raw dump is requested ethtool: Fix compilation warning when pretty dump is disabled netlink: eeprom: Fix compilation when pretty dump is disabled cmis.c | 2 +- ethtool.c | 13 ++++++++----- netlink/module-eeprom.c | 14 ++++++++++++++ qsfp.c | 2 +- 4 files changed, 24 insertions(+), 7 deletions(-)