From patchwork Tue Dec 1 06:09:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 1408627 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tkos.co.il Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4ClWst65Q1z9sVj for ; Tue, 1 Dec 2020 17:10:10 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727057AbgLAGKJ (ORCPT ); Tue, 1 Dec 2020 01:10:09 -0500 Received: from guitar.tcltek.co.il ([192.115.133.116]:47263 "EHLO mx.tkos.co.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725859AbgLAGKJ (ORCPT ); Tue, 1 Dec 2020 01:10:09 -0500 Received: from tarshish.tkos.co.il (unknown [10.0.8.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPS id 5DD1A4400C5; Tue, 1 Dec 2020 08:09:26 +0200 (IST) From: Baruch Siach To: Michal Kubecek Cc: netdev@vger.kernel.org, Baruch Siach Subject: [PATCH ethtool] Improve error message when SFP module is missing Date: Tue, 1 Dec 2020 08:09:21 +0200 Message-Id: <4267a91b40ef4dff755c4476757e2b17f48dbf57.1606802961.git.baruch@tkos.co.il> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org ETHTOOL_GMODULEINFO request success indicates that SFP cage is present. Failure of ETHTOOL_GMODULEEEPROM is most likely because SFP module is not plugged in. Add an indication to the user as to what might be the reason for the failure. Signed-off-by: Baruch Siach --- ethtool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ethtool.c b/ethtool.c index 1d9067e774af..6d785f830ffa 100644 --- a/ethtool.c +++ b/ethtool.c @@ -4856,6 +4856,7 @@ static int do_getmodule(struct cmd_context *ctx) err = send_ioctl(ctx, eeprom); if (err < 0) { perror("Cannot get Module EEPROM data"); + fprintf(stderr, "SFP module not in cage?\n"); free(eeprom); return 1; }