Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4470448ybz; Tue, 28 Apr 2020 11:50:51 -0700 (PDT) X-Google-Smtp-Source: APiQypI9W+8SLVY+6RRuVpa2OsHMRPgJYYAiVMZz9QDaIxMwEtEDBvOsDlP4f4SOm1Jfje1MZH6D X-Received: by 2002:a50:c051:: with SMTP id u17mr3381124edd.63.1588099851402; Tue, 28 Apr 2020 11:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588099851; cv=none; d=google.com; s=arc-20160816; b=aLHNPebbAGKLTy6s5LvTXF4Sg2waPnqX91ekEum+LZCEg3xa65xUeyAIXQ6pqlp9fJ cdXNUAHN3wOMBhGro7aYSqdUgtwK0u7e2cCRF+766+yO/LBMfrq3itgnW1JPgHa7RdRf u+LXDZveM2od5oRblUiDryKUphaPeXKCpoQKptqoFqKF51y4yVCtVO4ikiVdqzgCg7D7 I+0RWXzt2rkdFPhIUSHcSSvQt+AinYRfv0Mb3up0e4ZcU45iWs4opyElaign1PsQKU// PqUENe81KmkKSZwuWXo7EUUU7WJBbwKtpRLnNW3eQua9oo0WGJZxn/+UvQC7V8y4DANV v3bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=FJdn5bRaOt867xk9OmL6AT5kkzMHhkfsMIEh+qQAvgU=; b=f1tlXAIUNGDGGCAFLnW32vxLIR7YMUdFIzZqFZ3ZR6ilsOA5KaD3w6tr+kmOxGuejP PP1ajL5RZRf4glOXrPkoyeHVB8WpHPgFNE7RRSa8r2YNjY4+IfFJqVc+DETX6JKePR8X SgiNAkmxBnj7dEElsB/38ZiY5Q17a79+hHlGSAPUGkugg+rKpD9I/X3v5QNquDeTswZo /HiW4t7cn6h5UFf9F9lpMWgNnWEzfQE+nOEAWl1s7ISJwf4xHn059jn9Aq3kOrHxPS87 8h9vGPpHP13aMji9iHdp+LIcvllOWeJZHfLcKL7FA8SobmsArnHVReETEE4EiTXkmg3/ hZZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="X/Cbla9b"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z1si2166811edp.481.2020.04.28.11.50.27; Tue, 28 Apr 2020 11:50:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="X/Cbla9b"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728593AbgD1StO (ORCPT + 99 others); Tue, 28 Apr 2020 14:49:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:42176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730911AbgD1StM (ORCPT ); Tue, 28 Apr 2020 14:49:12 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A80BA206A1; Tue, 28 Apr 2020 18:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588099752; bh=7JNHiBIIBF6nBVtNd2tj4B4ihq3wa/COFTfVnM8d+bI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=X/Cbla9bkQeX3pAWWk2Bj/CFct7MIUbQJeJJPqwzVKzUyG2pSSDjjEwpX23QTlJ4w Wy14pBDSCpFw8puGMPF+pXn2LF/7q8lUxFWlueBnuMq3MiwcwfowT1igM8CyvsGcX/ VKnU3ThtVRL2Nj5Owzdg6FCz39YUaDTD57wLcCJE= Date: Tue, 28 Apr 2020 11:49:10 -0700 From: Jakub Kicinski To: Huazhong Tan Cc: , , , , , , Yonglong Liu Subject: Re: [PATCH net-next] net: hns3: adds support for reading module eeprom info Message-ID: <20200428114910.7cc5182e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <1588075105-52158-1-git-send-email-tanhuazhong@huawei.com> References: <1588075105-52158-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Apr 2020 19:58:25 +0800 Huazhong Tan wrote: > From: Yonglong Liu > > This patch adds support for reading the optical module eeprom > info via "ethtool -m". > > Signed-off-by: Yonglong Liu > Signed-off-by: Huazhong Tan > diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c > index 4d9c85f..8364e1b 100644 > --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c > +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c > @@ -12,6 +12,16 @@ struct hns3_stats { > int stats_offset; > }; > > +#define HNS3_MODULE_TYPE_QSFP 0x0C > +#define HNS3_MODULE_TYPE_QSFP_P 0x0D > +#define HNS3_MODULE_TYPE_QSFP_28 0x11 > +#define HNS3_MODULE_TYPE_SFP 0x03 Could you use the SFF8024_ID_* defines from sfp.h here as well? Otherwise looks good to me!