All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Muli Ben-Yehuda <muli@il.ibm.com>, Boaz Harrosh <bharrosh@panasas.com>
Cc: Jens Axboe <jens.axboe@oracle.com>,
	Christoph Hellwig <hch@infradead.org>,
	Mike Christie <michaelc@cs.wisc.edu>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	open-iscsi@googlegroups.com, Daniel.E.Messinger@seagate.com,
	Liran Schour <LIRANS@il.ibm.com>
Subject: Re: [RFC 1/6] bidi support: request dma_data_direction
Date: Tue, 23 Jan 2007 15:45:00 +0200	[thread overview]
Message-ID: <45B6115C.2010601@panasas.com> (raw)
In-Reply-To: <20070122052938.GJ3531@rhun.ibm.com>

Muli Ben-Yehuda wrote:
> On Mon, Jan 22, 2007 at 01:21:28AM +0200, Boaz Harrosh wrote:
> 
>> - Introduce a new enum dma_data_direction data_dir member in struct request.
>>   and remove the RW bit from request->cmd_flag
> 
> Some architecture use 'enum dma_data_direction' and some 'int
> dma_data_direction'. The consensus was to move to int over
> time. Please use 'int dma_data_direction'.

That should be fine (although I'm not sure what made you go this way :)
Please see my reply to Douglas, proposing an enum req_io_direction
at the block layer and up which will provide a better enumeration
for our use.

>>
>> +static inline int dma_write_dir(enum dma_data_direction dir)
>> +{
>> +	return (dir == DMA_TO_DEVICE) || (dir == DMA_BIDIRECTIONAL);
>> +}
> 
> "write" can mean "write to device" or "write to memory", depending on
> context. Not exactly something which should be a generic
> helper. Rename to 'dma_to_device(int dir)'?

much better. thanks!

> 
>> +static inline int dma_uni_dir(enum dma_data_direction dir)
>> +{
>> +	return (dir == DMA_TO_DEVICE) || (dir == DMA_FROM_DEVICE) ||
>> +	       (dir == DMA_NONE);
>> +}
> 
> While this doesn't look very useful. Why is "DMA_NONE" a uni-dir? I
> suggest replacing this with an open coded (dir != DMA_BIDIRECTIONAL).

The idea was to be resilient to invalid values. (dir != DMA_BIDIRECTIONAL)
is fine of course, but I'd add a BUG_ON such as (dir < 0 || dir > DMA_BIDIRECTIONAL)

Benny

  reply	other threads:[~2007-01-23 13:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-21 23:21 [RFC 1/6] bidi support: request dma_data_direction Boaz Harrosh
2007-01-22  0:24 ` Douglas Gilbert
2007-01-22  6:06   ` Benny Halevy
2007-01-22 15:05     ` Douglas Gilbert
2007-01-22 15:31       ` James Bottomley
2007-01-23 13:37       ` Benny Halevy
2007-01-22 21:53     ` William Studenmund
2007-01-22  5:29 ` Muli Ben-Yehuda
2007-01-23 13:45   ` Benny Halevy [this message]
2007-01-23 14:37     ` Muli Ben-Yehuda
2007-01-23 15:17       ` Benny Halevy

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=45B6115C.2010601@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=Daniel.E.Messinger@seagate.com \
    --cc=LIRANS@il.ibm.com \
    --cc=bharrosh@panasas.com \
    --cc=hch@infradead.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=muli@il.ibm.com \
    --cc=open-iscsi@googlegroups.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.