linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: "Ravich, Leonid" <Leonid.Ravich@dell.com>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>
Cc: "lravich@gmail.com" <lravich@gmail.com>,
	Vinod Koul <vkoul@kernel.org>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Zavras, Alexios" <alexios.zavras@intel.com>,
	"Barabash, Alexander" <Alexander.Barabash@dell.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	Jilayne Lovejoy <opensource@jilayne.com>,
	Logan Gunthorpe <logang@deltatee.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] dmaengine: ioat: fixing chunk sizing macros dependency
Date: Thu, 2 Apr 2020 09:49:19 -0700	[thread overview]
Message-ID: <dd2ab4e9-2451-06fc-39c2-acd2daf52d1a@intel.com> (raw)
In-Reply-To: <DM6PR19MB26827AA2885E8240370A4B1098C60@DM6PR19MB2682.namprd19.prod.outlook.com>



On 4/2/2020 9:46 AM, Ravich, Leonid wrote:
> Sorry Dave ,
> sure was tested on Intel Sky Lake-E CBDMA

Thanks Leonid. Acked.

> 
> -----Original Message-----
> From: Dave Jiang <dave.jiang@intel.com>
> Sent: Thursday, April 2, 2020 7:43 PM
> To: Ravich, Leonid; dmaengine@vger.kernel.org
> Cc: lravich@gmail.com; Vinod Koul; Williams, Dan J; Greg Kroah-Hartman; Zavras, Alexios; Barabash, Alexander; Thomas Gleixner; Kate Stewart; Jilayne Lovejoy; Logan Gunthorpe; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v2 1/2] dmaengine: ioat: fixing chunk sizing macros dependency
> 
> 
> [EXTERNAL EMAIL]
> 
> 
> 
> On 4/2/2020 9:33 AM, leonid.ravich@dell.com wrote:
>> From: Leonid Ravich <Leonid.Ravich@emc.com>
>>
>> prepare for changing alloc size.
>>
>> Acked-by: Dave Jiang <dave.jiang@intel.com>
>> Signed-off-by: Leonid Ravich <Leonid.Ravich@emc.com>
> 
> Hi Leonid, I haven't actually acked this patch yet, pending your answer on if this has been tested on hardware. Thanks.
> 
>> ---
>>    drivers/dma/ioat/dma.c  | 14 ++++++++------
>>    drivers/dma/ioat/dma.h  | 10 ++++++----
>>    drivers/dma/ioat/init.c |  2 +-
>>    3 files changed, 15 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c index
>> 18c011e..1e0e6c1 100644
>> --- a/drivers/dma/ioat/dma.c
>> +++ b/drivers/dma/ioat/dma.c
>> @@ -332,8 +332,8 @@ static dma_cookie_t ioat_tx_submit_unlock(struct dma_async_tx_descriptor *tx)
>>    	u8 *pos;
>>    	off_t offs;
>>    
>> -	chunk = idx / IOAT_DESCS_PER_2M;
>> -	idx &= (IOAT_DESCS_PER_2M - 1);
>> +	chunk = idx / IOAT_DESCS_PER_CHUNK;
>> +	idx &= (IOAT_DESCS_PER_CHUNK - 1);
>>    	offs = idx * IOAT_DESC_SZ;
>>    	pos = (u8 *)ioat_chan->descs[chunk].virt + offs;
>>    	phys = ioat_chan->descs[chunk].hw + offs; @@ -370,7 +370,8 @@
>> struct ioat_ring_ent **
>>    	if (!ring)
>>    		return NULL;
>>    
>> -	ioat_chan->desc_chunks = chunks = (total_descs * IOAT_DESC_SZ) / SZ_2M;
>> +	chunks = (total_descs * IOAT_DESC_SZ) / IOAT_CHUNK_SIZE;
>> +	ioat_chan->desc_chunks = chunks;
>>    
>>    	for (i = 0; i < chunks; i++) {
>>    		struct ioat_descs *descs = &ioat_chan->descs[i]; @@ -382,8 +383,9
>> @@ struct ioat_ring_ent **
>>    
>>    			for (idx = 0; idx < i; idx++) {
>>    				descs = &ioat_chan->descs[idx];
>> -				dma_free_coherent(to_dev(ioat_chan), SZ_2M,
>> -						  descs->virt, descs->hw);
>> +				dma_free_coherent(to_dev(ioat_chan),
>> +						IOAT_CHUNK_SIZE,
>> +						descs->virt, descs->hw);
>>    				descs->virt = NULL;
>>    				descs->hw = 0;
>>    			}
>> @@ -404,7 +406,7 @@ struct ioat_ring_ent **
>>    
>>    			for (idx = 0; idx < ioat_chan->desc_chunks; idx++) {
>>    				dma_free_coherent(to_dev(ioat_chan),
>> -						  SZ_2M,
>> +						  IOAT_CHUNK_SIZE,
>>    						  ioat_chan->descs[idx].virt,
>>    						  ioat_chan->descs[idx].hw);
>>    				ioat_chan->descs[idx].virt = NULL; diff --git
>> a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h index
>> b8e8e0b..5216c6b 100644
>> --- a/drivers/dma/ioat/dma.h
>> +++ b/drivers/dma/ioat/dma.h
>> @@ -81,6 +81,11 @@ struct ioatdma_device {
>>    	u32 msixpba;
>>    };
>>    
>> +#define IOAT_MAX_ORDER 16
>> +#define IOAT_MAX_DESCS (1 << IOAT_MAX_ORDER) #define IOAT_CHUNK_SIZE
>> +(SZ_2M) #define IOAT_DESCS_PER_CHUNK (IOAT_CHUNK_SIZE / IOAT_DESC_SZ)
>> +
>>    struct ioat_descs {
>>    	void *virt;
>>    	dma_addr_t hw;
>> @@ -128,7 +133,7 @@ struct ioatdma_chan {
>>    	u16 produce;
>>    	struct ioat_ring_ent **ring;
>>    	spinlock_t prep_lock;
>> -	struct ioat_descs descs[2];
>> +	struct ioat_descs descs[IOAT_MAX_DESCS / IOAT_DESCS_PER_CHUNK];
>>    	int desc_chunks;
>>    	int intr_coalesce;
>>    	int prev_intr_coalesce;
>> @@ -301,9 +306,6 @@ static inline bool is_ioat_bug(unsigned long err)
>>    	return !!err;
>>    }
>>    
>> -#define IOAT_MAX_ORDER 16
>> -#define IOAT_MAX_DESCS 65536
>> -#define IOAT_DESCS_PER_2M 32768
>>    
>>    static inline u32 ioat_ring_size(struct ioatdma_chan *ioat_chan)
>>    {
>> diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c index
>> 60e9afb..58d1356 100644
>> --- a/drivers/dma/ioat/init.c
>> +++ b/drivers/dma/ioat/init.c
>> @@ -651,7 +651,7 @@ static void ioat_free_chan_resources(struct dma_chan *c)
>>    	}
>>    
>>    	for (i = 0; i < ioat_chan->desc_chunks; i++) {
>> -		dma_free_coherent(to_dev(ioat_chan), SZ_2M,
>> +		dma_free_coherent(to_dev(ioat_chan), IOAT_CHUNK_SIZE,
>>    				  ioat_chan->descs[i].virt,
>>    				  ioat_chan->descs[i].hw);
>>    		ioat_chan->descs[i].virt = NULL;
>>

  reply	other threads:[~2020-04-02 16:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02  9:27 [PATCH 1/2] dmaengine: ioat: fixing chunk sizing macros dependency leonid.ravich
2020-04-02  9:27 ` [PATCH 2/2] dmaengine: ioat: Decreasing allocation chunk size 2M -> 512K leonid.ravich
2020-04-02 15:06   ` Dave Jiang
2020-04-02 16:33   ` [PATCH v2 1/2] dmaengine: ioat: fixing chunk sizing macros dependency leonid.ravich
2020-04-02 16:33     ` [PATCH v2 2/2] dmaengine: ioat: Decreasing allocation chunk size 2M -> 512K leonid.ravich
2020-04-15 15:53       ` Vinod Koul
2020-04-16 17:06       ` [PATCH v3 1/2] dmaengine: ioat: fixing chunk sizing macros dependency leonid.ravich
2020-04-16 17:06         ` [PATCH v3 2/2] dmaengine: ioat: Decreasing allocation chunk size 2M->512K leonid.ravich
2020-04-22 19:25           ` [PATCH v2 1/3] dmaengine: ioat: removing duplicate code from timeout handler leonid.ravich
2020-04-22 19:25             ` [PATCH v2 2/3] dmaengine: ioat: remove unnesesery double complition timer modification leonid.ravich
2020-04-22 19:25             ` [PATCH v2 3/3] dmaengine: ioat: adding missed issue_pending to timeout handler leonid.ravich
2020-04-22 19:58               ` Dave Jiang
2020-04-22 21:09               ` [PATCH v3 1/3] dmaengine: ioat: removing duplicate code from " leonid.ravich
2020-04-22 21:09                 ` [PATCH v3 2/3] dmaengine: ioat: remove unnesesery double complition timer modification leonid.ravich
2020-04-22 21:09                 ` [PATCH v3 3/3] dmaengine: ioat: adding missed issue_pending to timeout handler leonid.ravich
2020-04-23  7:21                 ` [PATCH v3 1/3] dmaengine: ioat: removing duplicate code from " Vinod Koul
2020-04-17 11:58         ` [PATCH v3 1/2] dmaengine: ioat: fixing chunk sizing macros dependency Vinod Koul
2020-04-02 16:42     ` [PATCH v2 " Dave Jiang
2020-04-02 16:46       ` Ravich, Leonid
2020-04-02 16:49         ` Dave Jiang [this message]
2020-04-15 15:52     ` Vinod Koul
2020-04-02 15:04 ` [PATCH " Dave Jiang

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=dd2ab4e9-2451-06fc-39c2-acd2daf52d1a@intel.com \
    --to=dave.jiang@intel.com \
    --cc=Alexander.Barabash@dell.com \
    --cc=Leonid.Ravich@dell.com \
    --cc=alexios.zavras@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=lravich@gmail.com \
    --cc=opensource@jilayne.com \
    --cc=tglx@linutronix.de \
    --cc=vkoul@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).