Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5663965imm; Tue, 12 Jun 2018 11:12:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLL1GZUg6ol+dBQo7Ej1Kk4lhlhK7aqj2DrEKiT3SC4knzEtotUIjrGHcLBNd5hxyh6vYNl X-Received: by 2002:a63:6ec8:: with SMTP id j191-v6mr1272158pgc.232.1528827147814; Tue, 12 Jun 2018 11:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528827147; cv=none; d=google.com; s=arc-20160816; b=dsccg4UWQ6b4W6mmswYyL5k3HHRe0eLJ8Qhm0HKPcC9tow4vKFzkjM8E9Edmv8W1C0 3fbYievT8jLaNd3uk9qQwDOk1MIon5S5hc9ybycHcJY2ajdWSrDGLER12woNBd4TMaTM vfUNshNnywOXxeOin0yZeT3yM+g2dLhVF83gbwl7fkHhmWhX3JKA0uO2uJdJswU4sTpv l3DceMgndSx/I5vzW8c9C2vf4us5qas+kjWng5zJEHQTkoBuPaPLwYdtgDSDP/qkluse i95hLfmGgqT6Sbu+MRxFer/qCP9S1pEVjRybNhSdPKGXltF5n48U61HEEzw6xQ24zK5s 42UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=9WpHl8Q4wdCTmzJvtyuJJnxHMb0s/WHit2GsXdnN4L8=; b=At1OeEVW3BQqRhO6q0UK7qY/Uw2N6NP3KbwG/4gK97kWLqPGjXutKkrkzaGMBKXa+l JJUKTTM4Jk5ELceTK2C95volKPbdapR4ix+D5NUfdMrRWnPAxZNmWsgXZ29b9E8AGQIH wzq26Ttuyn1PwVtEXiSvYt8f5q7Y05yOmZ+q9mkVt6alY304I1Yn5C4obF+w25qe4+67 MZMJDHw4ClTakrRQ3Vn7InGAWQ0zQ3IrXw5/gMnaIFi+UUuOwR5R3n445yoeGkWYeJQD jcit/zwfdchhj722gKKmeGk0JGIXwd+lQ9xDFnx0Vnk7rYYZmMq2vWZGXK3N6By571un ELyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=HoR9jOhw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3-v6si668150plb.228.2018.06.12.11.12.13; Tue, 12 Jun 2018 11:12:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=HoR9jOhw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933784AbeFLSLn (ORCPT + 99 others); Tue, 12 Jun 2018 14:11:43 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:59850 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754209AbeFLSLm (ORCPT ); Tue, 12 Jun 2018 14:11:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=9WpHl8Q4wdCTmzJvtyuJJnxHMb0s/WHit2GsXdnN4L8=; b=HoR9jOhwBTHLVGUTJJWvrUiz+A3eNKcE4112yL5wDyFFE83lDSYp5A4GSVr82aNje0zecSOJyKCZR2qQHVUunoFeSkPv5ltaOSSQf0ngu17UunUEP0jNxxQF4aZK5Tr7TkJuVeyHodCBuFuWvhrZmXFaer0g34ngRYU7V2L4u28=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1fSnl7-00043d-8k; Tue, 12 Jun 2018 20:11:09 +0200 Date: Tue, 12 Jun 2018 20:11:09 +0200 From: Andrew Lunn To: Tom Lendacky Cc: Don Bollinger , Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, brandon_chuang@edge-core.com, wally_wang@accton.com, roy_lee@edge-core.com, rick_burchett@edge-core.com, quentin.chang@quantatw.com, jeffrey.townsend@bitswitch.com, scotte@cumulusnetworks.com, roopa@cumulusnetworks.com, David Ahern , luke.williams@canonical.com, Guohan Lu , Russell King , "netdev@vger.kernel.org" Subject: Re: [PATCH] optoe: driver to read/write SFP/QSFP EEPROMs Message-ID: <20180612181109.GD12251@lunn.ch> References: <20180611042515.ml6zbcmz6dlvjmrp@thebollingers.org> <496e06b9-9f02-c4ae-4156-ab6221ba23fd@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <496e06b9-9f02-c4ae-4156-ab6221ba23fd@amd.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > There's an SFP driver under drivers/net/phy. Can that driver be extended > to provide this support? Adding Russel King who developed sfp.c, as well > at the netdev mailing list. I agree, the current SFP code should be used. My observations seem to be there are two different ways {Q}SFP are used: 1) The Linux kernel has full control, as assumed by the devlink/SFP frame work. We parse the SFP data to find the capabilities of the SFP and use it to program the MAC to use the correct mode. The MAC can be a NIC, but it can also be a switch. DSA is gaining support for PHYLINK, so SFP modules should just work with most switches which DSA support. And there is no reason a plain switchdev switch can not use PHYLINK. 2) Firmware is in control of the PHY layer, but there is a wish to expose some of the data which is available via i2c from the {Q}SFP to linux. It appears this optoe supports this second case. It does not appear to support any in kernel API to actually make use of the SFP data in the kernel. We should not be duplicating code. We should share the SFP code for both use cases above. There is also a Linux standard API for getting access to this information. ethtool -m/--module-info. Anything which is exporting {Q}SFP data needs to use this API. Andrew