All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Yanling Song <songyl@ramaxel.com>
Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] spraid: initial commit of Ramaxel spraid driver
Date: Sat, 9 Oct 2021 20:52:13 -0700	[thread overview]
Message-ID: <52ee4617-93ba-919f-b990-f04f64a13d4b@acm.org> (raw)
In-Reply-To: <20211009133207.789ad116@songyl>

On 10/9/21 06:32, Yanling Song wrote:
> op_is_write() does not meet our requirement: Both read and write
> commands have to be checked, not just write command.

Right, I should have proposed to compare the operation type with 
REQ_OP_READ / REQ_OP_WRITE. However, that approach only works for SCSI 
commands that come from the block layer and not for SG_IO 
(REQ_OP_DRV_IN/OUT).

>> Please remove all of the above code and use blk_rq_pos(),
>> blk_rq_sectors() and rq->cmd_flags & REQ_FUA instead.
> 
> I did not quite get your point. The above is commonly used in many
> similar use cases. For example: megasas_build_ldio() in
> megaraid_sas_base.c.
> What's the benefit to switch to another way: use
> blk_rq_pos(),blk_rq_sectors()?

I expect that using blk_rq_pos() and blk_rq_sectors() will result in 
faster code. However, these functions only work for SCSI commands that 
come from the block layer and not for SG_IO. If you want a common code 
path for SG_IO and block layer requests, please take a look at how 
get_unaligned_be*() is used in drivers/scsi/scsi_trace.c.

Thanks,

Bart.

  reply	other threads:[~2021-10-10  3:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30  3:47 [PATCH] spraid: initial commit of Ramaxel spraid driver Yanling Song
2021-09-30  5:36 ` Randy Dunlap
2021-10-01  1:03   ` Yanling Song
2021-10-01  4:15 ` Christoph Hellwig
2021-10-08  9:22   ` Yanling Song
2021-10-09  3:58 ` Bart Van Assche
2021-10-09 13:32   ` Yanling Song
2021-10-10  3:52     ` Bart Van Assche [this message]
2021-10-11  8:34       ` Yanling Song
2021-10-11 19:40         ` Bart Van Assche
2021-10-12 11:10           ` Yanling Song
2021-10-11 19:54 ` Bart Van Assche
2021-10-12 14:49   ` Yanling Song
2021-10-12 16:59     ` Bart Van Assche
2021-10-13  6:50       ` Yanling Song
2021-10-13 22:00         ` Bart Van Assche
2021-10-15  5:48           ` Yanling Song
2021-10-20  0:33           ` Yanling Song
2021-10-20  3:24             ` Bart Van Assche
2021-11-03  1:43               ` Yanling Song
2021-11-05 13:02               ` Yanling Song
2021-11-05 16:13                 ` Bart Van Assche
2021-11-06  8:30                   ` Yanling Song

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=52ee4617-93ba-919f-b990-f04f64a13d4b@acm.org \
    --to=bvanassche@acm.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=songyl@ramaxel.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.