From owner-freebsd-arch@FreeBSD.ORG Thu Feb 19 16:28:35 2015 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B96627F; Thu, 19 Feb 2015 16:28:35 +0000 (UTC) Received: from mail-ig0-x22a.google.com (mail-ig0-x22a.google.com [IPv6:2607:f8b0:4001:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60216C50; Thu, 19 Feb 2015 16:28:35 +0000 (UTC) Received: by mail-ig0-f170.google.com with SMTP id l13so1369820iga.1; Thu, 19 Feb 2015 08:28:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=+rCjaHYEXyfoAR+PXxeIYGb1r7P/1vGA7PfDkRjsOCI=; b=V5FLyD6hKn2BECpKNrjf/08HDgczpuEFoLKpjYHllRAyBHouYNe2L7tfq/v+L75eqT 62oFP5jJaXQB6rM5k8CfgSah3cknPliQxuTNVLqIuHwt6lA28HvBO0yxgTOgCuJMyARE l5wwmOtSTCFIdGppX9zjC/TsRIMBOy0+GV2HQSi4lCgpug0rs51WYE2CnXP+dbhp6LTt OaLE9/XbKHXU4IVM7hSorS8/CBRvXltabn2b4/dnrRhBY9mXIk6AQMvbm061gkWiKPiN CAG6+rqQyibhu/VKP5rLSUbpwZ/Nf+13cQAP9rLqg7r04ghKX+73HRdeEFDaCmGzXKxP sWeQ== MIME-Version: 1.0 X-Received: by 10.50.107.7 with SMTP id gy7mr8284025igb.49.1424363314662; Thu, 19 Feb 2015 08:28:34 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.66 with HTTP; Thu, 19 Feb 2015 08:28:34 -0800 (PST) In-Reply-To: <6147240.5Rne9DUXyM@ralph.baldwin.cx> References: <1848011.eGOHhpCEMm@ralph.baldwin.cx> <6147240.5Rne9DUXyM@ralph.baldwin.cx> Date: Thu, 19 Feb 2015 08:28:34 -0800 X-Google-Sender-Auth: uMlfsLBtbGcvrgmq0H1cqjX-qMI Message-ID: Subject: Re: RFC: bus_get_cpus(9) From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-arch@freebsd.org" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2015 16:28:35 -0000 On 19 February 2015 at 07:37, John Baldwin wrote: > There's nothing preventing the RSS code from calling bus_get_cpus() internally > to populate the info it returns in its APIs. > > That is, I imagine something like: > > #ifdef RSS > queue_info = fetch_rss_info(dev); > for (queue in queue_info) { > create queue for CPU queue->cpu > } > #else > /* Use bus_get_cpus directly and do 1:1 */ > #endif > > That is, I think RSS should provide a layer on top of new-bus, not be a > bus_foo API. At some point all drivers might only have the #ifdef RSS case > and not use bus_get_cpus() directly at all, but it doesn't seem like the RSS > API is quite there yet. I wasn't suggesting we have RSS as a newbus method, just that drivers don't necessarily need to call the bus method and iterate themselves. I was suggesting that we do what i've done for rss, but as a generic "how should devices create queues and map them to cpusets / interrupt locality" and that calls the bus method(s) to discover topology and query local-interrupt and local-memory sets to do things appropriately. Then RSS is just a flavour of that API call - network drivers could either be RSS aware and call it to get the mapping, or call some higher level bus API call to do the "generic" hints or whatever based mapping. -adrian