All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Quinn Tran <quinn.tran@qlogic.com>,
	Himanshu Madhani <himanshu.madhani@qlogic.com>,
	"target-devel@vger.kernel.org" <target-devel@vger.kernel.org>,
	"nab@linux-iscsi.org" <nab@linux-iscsi.org>
Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 4/4] qla2xxx: Add DebugFS node to show irq vector's cpuid
Date: Fri, 5 Feb 2016 11:42:24 -0800	[thread overview]
Message-ID: <56B4FB20.9080302@sandisk.com> (raw)
In-Reply-To: <883FB6FF-C20D-4352-AA6E-CCA5332F6379@qlogic.com>

On 02/05/2016 10:49 AM, Quinn Tran wrote:
> On 2/4/16, 10:20 AM, "Bart Van Assche" <bart.vanassche@sandisk.com> wrote:
>> On 02/04/2016 08:45 AM, Himanshu Madhani wrote:
>>> From: Quinn Tran <quinn.tran@qlogic.com>
>>>
>>>> cat /sys/kernel/debug/qla2xxx/*/irq_cpuid
>>> qla2xxx_81
>>>               IRQ Name  Vector  CPUID
>>>      qla2xxx (default)  150     9
>>>        qla2xxx (rsp_q)  151     9
>>>       qla2xxx (atio_q)  152     9
>>
>> Hello Quinn and Himanshu,
>>
>> Do you think it would be possible to generate this information via a
>> user-space script from /proc/interrupts and /proc/irq/<n>/smp_affinity?
>>
>> Thanks,
>>
>> Bart.
>
> Bart,
> 
> Currently, the data from the 2 mentioned “/proc” entry points were not able to give us the host_id/port & the vector information.
> 
> The 2 alternatives are i) change the driver code to register host id along with the vector and add script to combine the infos,  ii) 1 code change that gives us the summary.
> 
> We choose path 2 for the ease of usage.

Hello Quinn,

Please have another look at /proc/interrupts and
/proc/irq/<n>/smp_affinity. The information that is exported through
this patch is already available there. This is why I think this patch
should be dropped. All you need is something like the shell script below.

Sample output (nn = NUMA node; num = IRQ vector):

==== IRQs
nn cpu num count name
0  6   105  1753 PCI-MSI-edge      qla2xxx (rsp_q)                 
1  1   104  8781 PCI-MSI-edge      qla2xxx (default)               
1  1   107  1629 PCI-MSI-edge      qla2xxx (rsp_q)                 

The shell script that produced the above output:

ppi() {
    { echo "$(<"/sys/devices/system/cpu/cpu$1/topology/physical_package_id")" || echo '?'; } 2>/dev/null
}

echo "==== IRQs"
printf "%-2s %-3s %-3s %12s %-50s\n" nn cpu num count name
cat /proc/interrupts |
  while read line; do
    num="$(echo "$line" | sed -n 's/^[[:blank:]]*\([0-9]*\):\([0-9[:blank:]]*\)\(.*\)/\1/p')"
    [ -z "$num" ] && continue
    count=0
    for c in $(echo "$line" | sed -n 's/^[[:blank:]]*\([0-9]*\):\([0-9[:blank:]]*\)\(.*\)/\2/p'); do
	count=$((count+c))
    done
    name="$(echo "$line" | sed -n 's/^[[:blank:]]*\([0-9]*\):\([0-9[:blank:]]*\)\(.*\)/\3/p')"
    if [ -r "/proc/irq/$num/smp_affinity_list" ]; then
	al="$(<"/proc/irq/$num/smp_affinity_list")"
	cpu="${al/-*}" 
	cpu="${cpu/,*}"
	ppi="$(ppi "$cpu")"
    else
	cpu="?"
	ppi="?"
    fi
    printf "%-2s %-3d %-3d %12d %-50s\n" "$ppi" "$cpu" "$num" "$count" "$name"
  done |
  sort -n -k1,3

Thanks,

Bart.

  reply	other threads:[~2016-02-05 19:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04 16:45 [PATCH 0/4] qla2xxx: Patches for target-pending branch Himanshu Madhani
2016-02-04 16:45 ` [PATCH 1/4] qla2xxx: Fix stale pointer access Himanshu Madhani
2016-02-04 16:45 ` [PATCH 2/4] qla2xxx: Use ATIO type to send correct tmr response Himanshu Madhani
2016-02-04 16:45 ` [PATCH 3/4] qla2xxx: Add DebugFS node for target sess list Himanshu Madhani
2016-02-04 18:16   ` Bart Van Assche
2016-02-05 17:26     ` Himanshu Madhani
2016-02-05 20:00       ` Bart Van Assche
2016-02-05 20:17         ` Giridhar Malavali
2016-02-07  4:44     ` Nicholas A. Bellinger
2016-02-07  4:40   ` Nicholas A. Bellinger
2016-02-07  5:00     ` Nicholas A. Bellinger
2016-02-09 18:01       ` Himanshu Madhani
2016-02-08 17:43     ` Himanshu Madhani
2016-02-09  5:49       ` Nicholas A. Bellinger
2016-02-09 21:30         ` Himanshu Madhani
2016-02-04 16:45 ` [PATCH 4/4] qla2xxx: Add DebugFS node to show irq vector's cpuid Himanshu Madhani
2016-02-04 18:20   ` Bart Van Assche
2016-02-05 18:49     ` Quinn Tran
2016-02-05 19:42       ` Bart Van Assche [this message]
2016-02-05 21:52         ` Quinn Tran
2016-02-07  4:31 ` [PATCH 0/4] qla2xxx: Patches for target-pending branch Nicholas A. Bellinger

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=56B4FB20.9080302@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=giridhar.malavali@qlogic.com \
    --cc=himanshu.madhani@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=quinn.tran@qlogic.com \
    --cc=target-devel@vger.kernel.org \
    /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.