All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurence Oberman <loberman@redhat.com>
To: dgilbert@interlog.com, Linux SCSI List <linux-scsi@vger.kernel.org>
Subject: sg driver, sg_io and sg tablesize
Date: Wed, 1 Mar 2017 10:44:32 -0500 (EST)	[thread overview]
Message-ID: <791707934.40662785.1488383072891.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <178924924.40657267.1488382475137.JavaMail.zimbra@redhat.com>

Hi Doug
I have a quick question here regarding the sg tablesize and retrieval of the supported size via a userspace ioctl.

lpfc defaults to 
lpfc_sg_seg_cnt:Max Scatter Gather Segment Count (uint) = 64

For sg_io sent from qemu if we exceed 512K I/O we fail, qlogic allows 128 by default.

7:0:2:13 /dev/sdbb 67:80   /dev/sg55           Emulex lpfc LUN

[root@dhcp40-131 ~]# sg_dd if=/dev/zero of=/dev/sdbb bpt=0x400 count=0x400 blk_sgio=1
Assume default 'bs' (block size) of 512 bytes
writing (SG_IO) on sg device, error: Invalid argument
sg_write failed, seek=0
Some error occurred,  remaining block count=1024
1024+0 records in
0+0 records out

9:0:1:13 /dev/sdcm 71:240  /dev/sg92         Qlogic qla2xxx LUN

[root@dhcp40-131 ~]# sg_dd if=/dev/zero of=/dev/sdcm bpt=0x400 count=0x400 blk_sgio=1
Assume default 'bs' (block size) of 512 bytes
1024+0 records in
1024+0 records out

Using ioctl(sg_fd, BLKSECTGET, &max_sectors) from userspace correctly returns
the /sys/block/sdcm/queue/max_sectors_kb 

How can we query the sg tablesize using a userspace ioctl for the sg driver.

Figured I would ask you first.

Thanks
Laurence

       reply	other threads:[~2017-03-01 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <178924924.40657267.1488382475137.JavaMail.zimbra@redhat.com>
2017-03-01 15:44 ` Laurence Oberman [this message]
2017-03-01 22:11   ` sg driver, sg_io and sg tablesize Laurence Oberman
2017-03-02 11:41     ` Fam Zheng

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=791707934.40662785.1488383072891.JavaMail.zimbra@redhat.com \
    --to=loberman@redhat.com \
    --cc=dgilbert@interlog.com \
    --cc=linux-scsi@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.