From: Douglas Gilbert <dgilbert@interlog.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-scsi@vger.kernel.org, martin.petersen@oracle.com,
jejb@linux.vnet.ibm.com, hare@suse.de, bvanassche@acm.org
Subject: Re: [PATCH v2 0/6] scsi: fix scsi_cmd::cmd_len
Date: Mon, 11 Apr 2022 11:06:17 -0400 [thread overview]
Message-ID: <aa2a08cc-ba98-b538-2448-d528e8eef917@interlog.com> (raw)
In-Reply-To: <20220411050325.GA13927@lst.de>
On 2022-04-11 01:03, Christoph Hellwig wrote:
> This still misses any good explanation of why we want all this.
Advantages:
- undoes regression in ce70fd9a551af, that is:
- cdb_len > 32 no longer allowed (visible to the user space), undone
- but we still have this one:
- prior to lk5.18 sizeof(scsi_cmnd::cmnd) is that of a
pointer but >= lk5.18 sizeof(scsi_cmnd::cmnd) is 32 (or 16)
- makes all scsi_cmnd objects 16 bytes smaller
- hides the poorly named dtor for scsi_cmnd objects (blk_mq_free_request)
within a more intuitively named inline: scsi_free_cmnd
- scsi_free_cmnd() allows other cleanups to be hooked, like the one
proposed to free the long CDB heap, if used
- supplies three access functions for manipulating CDBs.
scsi_cmnd_set_cdb() removes the need for memset()s and cdb[n]=0 code,
and setting scsi_cmnd::cmd_len when ULDs and LLDs are building CDBs
- allows scsi_cmnd::cmnd to be renamed scsi_cmnd::__cdb in the future
to encourage the use of those access functions
- patches to code accessing scsi_cmnd::cmnd change the name of a SCSI
CDB (a byte array) to 'cdb' rather than the confusing terms: 'cmnd'
or 'cmd'
Disadvantages:
- burdens each access to a CDB with (scsi_cmnd::flags & SCMD_LONG_CDB)
check
- LLDs that want to fetch 32 byte CDBs (or longer) need to use the
scsi_cmnd_get_cdb() access function. For CDB lengths <= 16 bytes
they can continue to access scsi_cmnd::cmnd directly
next prev parent reply other threads:[~2022-04-11 15:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-10 17:36 [PATCH v2 0/6] scsi: fix scsi_cmd::cmd_len Douglas Gilbert
2022-04-10 17:36 ` [PATCH v2 1/6] scsi_cmnd: reinstate support for cmd_len > 32 Douglas Gilbert
2022-04-10 17:36 ` [PATCH v2 2/6] sd, sd_zbc: use scsi_cmnd cdb access functions Douglas Gilbert
2022-04-10 17:36 ` [PATCH v2 3/6] sg: reinstate cmd_len > 32 Douglas Gilbert
2022-04-10 17:36 ` [PATCH v2 4/6] bsg: allow " Douglas Gilbert
2022-04-10 17:36 ` [PATCH v2 5/6] scsi_debug: reinstate " Douglas Gilbert
2022-04-10 17:36 ` [PATCH v2 6/6] st,sr,stex: use scsi_cmnd cdb access functions Douglas Gilbert
2022-04-11 5:03 ` [PATCH v2 0/6] scsi: fix scsi_cmd::cmd_len Christoph Hellwig
2022-04-11 15:06 ` Douglas Gilbert [this message]
2022-04-11 15:52 ` Christoph Hellwig
2022-04-12 3:05 ` Douglas Gilbert
2022-04-19 3:26 ` Martin K. Petersen
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=aa2a08cc-ba98-b538-2448-d528e8eef917@interlog.com \
--to=dgilbert@interlog.com \
--cc=bvanassche@acm.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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.