Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp598503pxf; Wed, 17 Mar 2021 11:17:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEjc3sm0TDGbGxoW0XV5oa3BLzfD5PMolmMsbnL1jmOzRMiPUoLrSE/1HknsoaPHnSkvGX X-Received: by 2002:a17:906:3ac3:: with SMTP id z3mr37482533ejd.106.1616005058652; Wed, 17 Mar 2021 11:17:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616005058; cv=none; d=google.com; s=arc-20160816; b=WB6WZ9+6EElKvEmnPg2wlajbepJmCdq8fVd/2jKYgAteCHopzafTkGIdNiulzU3Luh Nll+DP6A6nhRD4soIDYHHJOeK7V86Bg0TXZpJTDQEKxkJFkifDk40cNRfbz9jQ/k2pXK eClUIRYZuoJDRbPDJHa0vNJ74Cq994u0KNoMIWbqwaUzzX+epx2HxZEIHso/1GBVJ4KS U2AGMffa5mGzquYNsE1R3YniPnTumk+0F4AfRHBb5uCdVI28r+SrN9x387IW4kuH84d4 P3qk3JRAZ1PZgoIhdGcT91Ja/jCgE0QG4gSzhCUPwy1rWVtCOfq/1KETYuMeLOqU5/58 osHA== 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=v3TiIOpDKbDXKbcWYdaMyKD2e0LuxP0KsPtSvvmE8KA=; b=ArUJBfdn/EdInyv1DoreRSCn++8B+8zqne6nytmacJ3Qe/aSW54Vq4CFd2DZEIuO8Z ZjhpE0m/TYAhjYE7iJ89vQIP3DyznA1jfgrbjO5KjVhCoSKapUR+hWat9qZTcNFesO20 tMLtToosTA2+Ru/gqsF9uGfZgLsSGTi5bCj0zToNDtaWd6OK3z/6mBAm0Ye0mCS30aP7 ihgOt9Jdn1drJxPXNggERkI8TBlNDwtoMwm+1BX6kBvrMyHFLaq+kW/f+bsWFDgsX3I5 dZUtbWmzGvVV806KBOPdgs0Fz0YQdi6emSxdV33f6hRqOPInPaqldEeAHE3hy480KHXz bppg== 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 v24si17203282eja.84.2021.03.17.11.17.14; Wed, 17 Mar 2021 11:17:38 -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; 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 S232860AbhCQSQB (ORCPT + 99 others); Wed, 17 Mar 2021 14:16:01 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:33262 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233090AbhCQSPc (ORCPT ); Wed, 17 Mar 2021 14:15:32 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lMahT-00BVJR-Ql; Wed, 17 Mar 2021 19:15:19 +0100 Date: Wed, 17 Mar 2021 19:15:19 +0100 From: Andrew Lunn To: Don Bollinger Cc: 'Jakub Kicinski' , 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: <003901d711f2$be2f55d0$3a8e0170$@thebollingers.org> <20210305145518.57a765bc@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <005e01d71230$ad203be0$0760b3a0$@thebollingers.org> <018701d71772$7b0ba3f0$7122ebd0$@thebollingers.org> <01ae01d71850$db4f5a20$91ee0e60$@thebollingers.org> <20210315103950.65fedf2c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <001201d719c6$6ac826c0$40587440$@thebollingers.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001201d719c6$6ac826c0$40587440$@thebollingers.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I have offered, in every response, to collaborate with the simple > integration to use optoe as the default upstream driver to access the module > EEPROMs. optoe would be superior to the existing default routines in sfp.c Actually, i'm not sure they would be. Since the KAPI issues are pretty much a NACK on their own, i didn't bother raising other issues. Both Russell King and I has issues with quirks and hotplug. Our experience is that a number of SFPs are broken, they don't follow the standard. Some you cannot perform more than 16 bytes reads without them locking up. Others will perform a 16 byte read, but only give you one useful byte of data. So you have to read enough of the EEPROM a byte at a time to get the vendor and product strings in order to determine what quirks need to be applied. optoe has nothing like this. Either you don't care and only support well behaved SFPs, or you have the quirk handling in user space, in the various vendor code blobs, repeated again and again. To make optoe generically usable, you are going to have to push the quirk handling into optoe. The brokenness should be hidden from userspace. And then you repeat all the quirk handling sfp.c has. That does not scale, we don't want the same quirks in two different places. However, because SFPs are hot pluggable, you need to re-evaluate the quirks whenever there is a hot-plug event. optoe has no idea if there has been a hotplug event, since it does not have access to the GPIOs. Your user space vendor code might know, it has access to the GPIOs. So maybe you could add an IOCTL call or something, to let optoe know the module has changed and it needs to update its quirks. Or for every user space read, you actually re-read the vendor IDs and refresh the quirks before performing the read the user actually wants. That all seems ugly and is missing from the current patch. I fully agree with Jakub NACK. Andrew