From patchwork Sun Jun 30 17:27:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Merillat X-Patchwork-Id: 13717259 X-Patchwork-Delegate: mkubecek+ethtool@suse.cz Received: from penfold.furryhost.com (penfold.furryhost.com [199.168.187.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 887305B1E0 for ; Sun, 30 Jun 2024 17:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.168.187.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719769076; cv=none; b=Y9H9sfXtAZILrg6MvF30LnW6TlMLPJ5wM+JJBLzeMMwbcGEKjm+RN5rLXugx6YtnXkys0pY5s5cactde4/g5yANhcwAJNiIk0jVbh0qGtXRmCQxLQufM9F2nlE2QDlNeKebNCP/wqDjL/Z98v43RiCt1VSj+StuyStkiSy+ZHXI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719769076; c=relaxed/simple; bh=Wq5+2r3S6wIRgrDCKKfUxRTZlp1TNI+6xhU1nm2+Km8=; h=Content-Type:Message-ID:Date:MIME-Version:From:To:Subject; b=rqKgpura1SCsWVAVQ1Bj5FGGm6uqq/nKWwVlaBzw6591ZMVTKXGs/MkXGBsG1eptP+56yZ3kdLxguYDKeyTa7YQhEMbR8w9D9AEKYNTdRWjpP0SjcbrdfqEHebDIbdlgHAbIzq/gYjGOObLhB4X3Ay7ZxKjdHUPO9wuMnkpA21w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dan.merillat.org; spf=pass smtp.mailfrom=dan.merillat.org; dkim=pass (1024-bit key) header.d=dan.merillat.org header.i=@dan.merillat.org header.b=GlJ4S8Pq; arc=none smtp.client-ip=199.168.187.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dan.merillat.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dan.merillat.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=dan.merillat.org header.i=@dan.merillat.org header.b="GlJ4S8Pq" Received: from [192.168.0.10] (syn-050-088-096-145.res.spectrum.com [50.88.96.145]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dan@merillat.org) by penfold.furryhost.com (Postfix) with ESMTPSA id DEC0D217F0; Sun, 30 Jun 2024 13:27:08 -0400 (EDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at penfold DKIM-Filter: OpenDKIM Filter v2.11.0 penfold.furryhost.com DEC0D217F0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dan.merillat.org; s=default; t=1719768429; bh=3hImxf1OXVu61h6TqD95o5EnOy7CuotWHcdZdkfVrV8=; h=Date:From:To:Subject:From; b=GlJ4S8Pq80NNOu2oz/F2hKGTz1DeVF2jl1mKtXSZZdjD2Fm80paIVLDIqel2ZQom6 kvFbTg2I4C5MseEGEQx9bMvXofJolskVtQjLh6oeyX7KYA/0yPPkGmQfnFpGqkLaYj wJ8N+RC5S8DsgRV/pIub+6fvFlSz3BpduQ27kQvo= Message-ID: <54b537c6-aca4-45be-9df0-53c80a046930@dan.merillat.org> Date: Sun, 30 Jun 2024 13:27:07 -0400 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Dan Merillat To: Michal Kubecek , netdev Subject: ethtool fails to read some QSFP+ modules. I was testing an older Kaiam XQX2502 40G-LR4 and ethtool -m failed with netlink error. It's treating a failure to read the optional page3 data as a hard failure. This patch allows ethtool to read qsfp modules that don't implement the voltage/temperature alarm data. From 3144fbfc08fbfb90ecda4848fc9356bde8933d4a Mon Sep 17 00:00:00 2001 From: Dan Merillat Date: Sun, 30 Jun 2024 13:11:51 -0400 Subject: [PATCH] Some qsfp modules do not support page 3 Tested on an older Kaiam XQX2502 40G-LR4 module. ethtool -m aborts with netlink error due to page 3 not existing on the module. Ignore the error and leave map->page_03h NULL. --- qsfp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qsfp.c b/qsfp.c index a2921fb..0a16b42 100644 --- a/qsfp.c +++ b/qsfp.c @@ -1037,9 +1037,15 @@ sff8636_memory_map_init_pages(struct cmd_context *ctx, return 0; sff8636_request_init(&request, 0x3, SFF8636_PAGE_SIZE); + + /* Some modules are paged but do not have page 03h. This + * is a non-fatal error, and sff8636_dom_parse() handles this + * correctly. + */ ret = nl_get_eeprom_page(ctx, &request); if (ret < 0) - return ret; + return 0; + map->page_03h = request.data - SFF8636_PAGE_SIZE; return 0; -- 2.45.1