Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753906AbdF0WkB (ORCPT ); Tue, 27 Jun 2017 18:40:01 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:33856 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751900AbdF0Wjz (ORCPT ); Tue, 27 Jun 2017 18:39:55 -0400 Date: Tue, 27 Jun 2017 15:39:50 -0700 From: Jakub Kicinski To: "Luis R. Rodriguez" Cc: Bjorn Andersson , Arend Van Spriel , Tom Gundersen , Daniel Wagner , Ming Lei , yi1.li@linux.intel.com, takahiro.akashi@linaro.org, nbroeking@me.com, Greg Kroah-Hartman , mfuzzey@parkeon.com, ebiederm@xmission.com, dmitry.torokhov@gmail.com, dwmw2@infradead.org, jewalt@lgsinnovations.com, rafal@milecki.pl, rjw@rjwysocki.net, atull@kernel.org, moritz.fischer@ettus.com, pmladek@suse.com, johannes.berg@intel.com, emmanuel.grumbach@intel.com, luciano.coelho@intel.com, luto@kernel.org, torvalds@linux-foundation.org, keescook@chromium.org, dhowells@redhat.com, pjones@redhat.com, hdegoede@redhat.com, alan@linux.intel.com, tytso@mit.edu, paul.gortmaker@windriver.com, mtosatti@redhat.com, mawilcox@microsoft.com, stephen.boyd@linaro.org, markivx@codeaurora.org, linux-kernel@vger.kernel.org, oss-drivers@netronome.com Subject: Re: [PATCH] firmware: wake all waiters Message-ID: <20170627153950.0911cc2a@cakuba.netronome.com> In-Reply-To: <20170627222419.GY21846@wotan.suse.de> References: <20170623233702.20564-1-jakub.kicinski@netronome.com> <20170626212036.GE21846@wotan.suse.de> <20170626191009.0c11eed0@cakuba.netronome.com> <20170627163942.GQ21846@wotan.suse.de> <20170627142553.0fe417b3@cakuba.netronome.com> <20170627222419.GY21846@wotan.suse.de> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1839 Lines: 34 On Wed, 28 Jun 2017 00:24:19 +0200, Luis R. Rodriguez wrote: > On Tue, Jun 27, 2017 at 02:25:53PM -0700, Jakub Kicinski wrote: > > On Tue, 27 Jun 2017 18:39:42 +0200, Luis R. Rodriguez wrote: > > > > > > > The problem is that advanced NICs are quite programmable [1] and > > > > depending on use case one may want to load different firmware files. > > > > > > Right, so in the 802.11 world some devices might use different firmware for > > > different modes of operation, STA, AP, Mesh, but this is all very protocol > > > specific, so userspace could tickle the kernel about a mode. > > > > > > Do your use cases have protocol definitions which can be exposed in userspace? > > > Or are these just fw variants with different bells and whistles? How man > > > different use cases are we talking about? > > > > Right now we have three modes that come from Netronome itself, a "basic > > NIC" one, and two advanced for TC flower/Open vSwitch acceleration and > > for eBPF offload. I was hoping some enumeration scheme could work here, > > but I really can't come up with one. > > How about just supporting 3 firmware names, with the first two being optional, > but if found one of those two is found it would use that one. Then only if > both of these are not present would a default be looked for and used? > > In terms of interface, a simple symlink / renaming scheme would suffice to > support this. No custom hooks at all. That's what we do today as a stop-gap solution :) (BTW mkinitrd doesn't seem to like symlinks so I use hard links.) The issue is if you have two identical cards, how to load different FW on them? We would have to encode the serial number into the firmware name or the pci_name() at least. The nice thing about this solution is that it requires almost zero code on the kernel size... hm...