Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp927402pxb; Wed, 3 Mar 2021 21:21:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7OxuNuZwif8FUYyPj3xDml60pG2Ou7pX1rdcxLN0s+ZF07elw8vlWRad2lEHXLVPS3i/P X-Received: by 2002:a17:907:9e6:: with SMTP id ce6mr2259258ejc.207.1614835262770; Wed, 03 Mar 2021 21:21:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614835262; cv=none; d=google.com; s=arc-20160816; b=LjnfcbyQ4ehoU/ptm3Zv6priDcjui4EZKvLgRLsLvKKofkTPJCx1ue7iEQ3wb28W4S V7AeeSoIuuqD6YBJittPdJ9w8my77i8LVyd31btw5XnQRc3GUU0PbLwFjpCyDmd8iRY0 QELGiJnLBsBURn4Kip9b825tpk5tLQVmJCrXhwXEBS5ZMBi2CkLqeJsb4lOOXmfurLaI PVxCcjgse2YRbFQ+OVC/luzPro8jIANZ1+nuf6etUv9zKJ0lH4rARaCdgL+6CwqLenp3 XtwoqGzTMm83P+pmGdJRC2jQkKJY2AthzDgoncY9uYo6QJBvXvKbPqkez8Zh1N2YjZtU gqBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=vpHOAntzI4Jembftpywt6A/+jIu4J8doKhd6xH4kO3U=; b=1HKXtcKB+WPgwtAMslYJTGlohLenxz+yyx8CGrplpxAuBw/g8DJzufMpgTgvPMVrgh TTAKLNcwDqWvjj/alGwdgmS3aR5eIlzPsedhb3bmlNP89UJSXq6zE/9FDzEZUeZ54t9k 912EeQ8iW6vHjOV+baT1+nTtRdYVgVLDCzSBG1KwKmFwwsjWbs8dcZ5g7b0RkKx5vMkr MlC4C46cuRq+hWRUjp2ygmgPQsSsJwxQiuq4HX2ctf3cMGNH1mQp7XQfNZanbODe+nzQ YqDBhGEzxf5Z9W4P0jciUeXhEdsC2f9yMIvxUoYum5iVotNNJsz8wjFDeHhIcbTXuwL4 PImQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si2678968edy.392.2021.03.03.21.20.40; Wed, 03 Mar 2021 21:21:02 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241738AbhCBDnI (ORCPT + 99 others); Mon, 1 Mar 2021 22:43:08 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:35214 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240983AbhCAUqf (ORCPT ); Mon, 1 Mar 2021 15:46:35 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lGpQ9-008zyD-9S; Mon, 01 Mar 2021 21:45:37 +0100 Date: Mon, 1 Mar 2021 21:45:37 +0100 From: Andrew Lunn To: Don Bollinger Cc: arndb@arndb.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, brandon_chuang@edge-core.com, wally_wang@accton.com, aken_liu@edge-core.com, gulv@microsoft.com, jolevequ@microsoft.com, xinxliu@microsoft.com, 'netdev' , 'Moshe Shemesh' Subject: Re: [PATCH v2] eeprom/optoe: driver to read/write SFP/QSFP/CMIS EEPROMS Message-ID: References: <20210215193821.3345-1-don@thebollingers.org> <000901d70cb2$b2848420$178d8c60$@thebollingers.org> <004f01d70ed5$8bb64480$a322cd80$@thebollingers.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <004f01d70ed5$8bb64480$a322cd80$@thebollingers.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > To be more specific, optoe is only replacing the functionality of > drivers/net/phy/sfp.c, the functions of sfp_i2c_read() and sfp_i2c_write(). > These are the routines at the very bottom of the ethtool stack that actually > execute the i2c calls to get the data. The existing routines are very > limited, in that they don't handle pages at all. Hence they can only reach > 256 bytes of QSFP EEPROM data and 512 bytes of SFP EEPROM data. I can > propose a shorter cleaner replacement for each of those routines which will > provide access to the rest of the data on those devices. drivers/net/phy/sfp.c is not the only code making use of this KAPI. Any MAC driver can implement the ethtool op calls for reading SFP memory. The MAC driver can either directly reply because it has the SFP hidden behind firmware, or it can call into the sfp.c code, because Linux is driving the SFP. Moshe is working on the Mellonox MAC drivers. As you say, the current sfp.c code is very limited. But once Moshe code is merged, i will do the work needed to extend sfp.c to fully support the KAPI. It will then work for many more MAC drivers, those using phylink. For me, the KAPI is the important thing, and less so how the implementation underneath works. Ideally, we want one KAPI for accessing SFP EEPROMs. Up until now, that KAPI is the ethtool IOCTL. But that KAPI is now showing its age, and it causing us problems. So we need to replace that KAPI. ethtool has recently moved to using netlink messages. So any replacement should be based on netlink. The whole network stack is pretty much controlled via netlink. So you will find it very difficult to argue for any other form of KAPI within the netdev community. Since optoe's KAPI is not netlink based, it is very unlikely to be accepted. But netlink is much more flexible than the older IOCTL interface. Please work with us to ensure this new KAPI can work with your use cases. Andrew