From: Vasu Dev <vasu.dev@linux.intel.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Robert Love <robert.w.love@intel.com>,
james.bottomley@hansenpartnership.com,
linux-scsi@vger.kernel.org, jgarzik@redhat.com,
davem@davemloft.net, james.smart@emulex.com,
michaelc@cs.wisc.edu, jeykholt@cisco.com,
jeffrey.t.kirsher@intel.com
Subject: Re: [PATCH 2/3] libfc: A modular Fibre Channel library
Date: Wed, 10 Dec 2008 10:42:28 -0800 [thread overview]
Message-ID: <49400D94.5050301@linux.intel.com> (raw)
In-Reply-To: <20081210000333.GC23556@one.firstfloor.org>
Andi Kleen wrote:
> On Tue, Dec 09, 2008 at 03:10:17PM -0800, Robert Love wrote:
>
>> libFC is composed of 4 blocks supported by an exchange manager
>> and a framing library. The upper 4 layers are fc_lport, fc_disc,
>> fc_rport and fc_fcp. A LLD that uses libfc could choose to
>> either use libfc's block, or using the transport template
>> defined in libfc.h, override one or more blocks with its own
>> implementation.
>>
>
> Just some more stuff I noticed while looking briefly at libfcoe.c
> Not a complete review again.
>
> 230 #ifdef CONFIG_SMP
> 231 /*
> 232 * The exchange ID are ANDed with num of online CPUs,
> 233 * so that will have the least lock contention in
> 234 * handling the exchange. if there is no thread
> 235 * for a given idx then use first online cpu.
> 236 */
> 237 cpu_idx = oxid & (num_online_cpus() >> 1);
> 238 if (fcoe_percpu[cpu_idx] == NULL)
> 239 cpu_idx = first_cpu(cpu_online_map);
> 240 #endif
>
> What is this supposed to do? It looks quite dubious.
>
It had load balancing issue but now it is fixed, related latest
submitted code with its updated comment is:-
/*
* The incoming frame exchange id(oxid) is ANDed with num of online
* cpu bits to get cpu_idx and then this cpu_idx is used for selecting
* a per cpu kernel thread from fcoe_percpu. In case the cpu is
* offline or no kernel thread for derived cpu_idx then cpu_idx is
* initialize to first online cpu index.
*/
cpu_idx = oxid & (num_online_cpus() - 1);
if (!fcoe_percpu[cpu_idx] || !cpu_online(cpu_idx))
cpu_idx = first_cpu(cpu_online_map);
The incoming FC frame is distributed across all fcoe_percpu_receive_thread for better load balancing, these per CPU threads are created by fcoe module during fcoe_init. This should help in performance but not sure how much since performance tuning is yet to be done.
> Shouldn't this use the current CPU number?
>
>
The current cpu could be used here with some other ingress FC frames
distribution/hashing across all cpus instead this hash logic "oxid &
(num_online_cpus() - 1)", possibly ingress FC frame distribution at soft
irq level by oxid and then passing up to current cpu's kernel thread
fcoe_percpu_receive_thread.
next prev parent reply other threads:[~2008-12-10 18:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-09 23:10 [PATCH 0/3] Open-FCoE Submission (round 2) Robert Love
2008-12-09 23:10 ` [PATCH 1/3] FC protocol definition header files Robert Love
2008-12-09 23:10 ` [PATCH 2/3] libfc: A modular Fibre Channel library Robert Love
2008-12-10 0:03 ` Andi Kleen
2008-12-10 18:42 ` Vasu Dev [this message]
2008-12-10 19:42 ` Andi Kleen
2008-12-12 1:55 ` Vasu Dev
2008-12-12 2:19 ` Joe Eykholt
2008-12-11 0:44 ` Chris Leech
2008-12-11 0:49 ` Chris Leech
2008-12-11 20:32 ` Zou, Yi
2008-12-11 23:33 ` Andi Kleen
2008-12-09 23:10 ` [PATCH 3/3] fcoe: Fibre Channel over Ethernet Robert Love
2009-02-05 2:24 ` Andrew Morton
2009-02-06 19:05 ` Robert Love
2009-02-06 19:13 ` Andrew Morton
2009-02-06 19:26 ` [PATCH] kernel-doc: preferred ending marker and examples Randy Dunlap
-- strict thread matches above, loose matches on Subject: below --
2008-11-18 22:20 [PATCH 0/3] Open-FCoE Submission Robert Love
2008-11-18 22:21 ` [PATCH 2/3] libfc: A modular Fibre Channel library Robert Love
2008-11-24 10:13 ` Andi Kleen
2008-11-25 20:47 ` Love, Robert W
2008-12-02 23:36 ` Love, Robert W
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49400D94.5050301@linux.intel.com \
--to=vasu.dev@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=davem@davemloft.net \
--cc=james.bottomley@hansenpartnership.com \
--cc=james.smart@emulex.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jeykholt@cisco.com \
--cc=jgarzik@redhat.com \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
--cc=robert.w.love@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.