lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070716132627.GT5195@kernel.dk>
Date:	Mon, 16 Jul 2007 15:26:28 +0200
From:	Jens Axboe <jens.axboe@...cle.com>
To:	FUJITA Tomonori <tomof@....org>
Cc:	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
	rolandd@...co.com, fujita.tomonori@....ntt.co.jp
Subject: Re: [PATCH 29/33] infiniband: sg chaining support

On Mon, Jul 16 2007, FUJITA Tomonori wrote:
> From: Jens Axboe <jens.axboe@...cle.com>
> Subject: [PATCH 29/33] infiniband: sg chaining support
> Date: Mon, 16 Jul 2007 11:47:43 +0200
> 
> > @@ -226,7 +228,8 @@ static int iser_sg_to_page_vec(struct iser_data_buf *data,
> >  			       struct iser_page_vec *page_vec,
> >  			       struct ib_device *ibdev)
> >  {
> > -	struct scatterlist *sg = (struct scatterlist *)data->buf;
> > +	struct scatterlist *sgl = (struct scatterlist *)data->buf;
> > +	struct scatterlist *sg;
> >  	u64 first_addr, last_addr, page;
> >  	int end_aligned;
> >  	unsigned int cur_page = 0;
> > @@ -234,14 +237,14 @@ static int iser_sg_to_page_vec(struct iser_data_buf *data,
> >  	int i;
> >  
> >  	/* compute the offset of first element */
> > -	page_vec->offset = (u64) sg[0].offset & ~MASK_4K;
> > +	page_vec->offset = (u64) sgl[0].offset & ~MASK_4K;
> >  
> > -	for (i = 0; i < data->dma_nents; i++) {
> > -		unsigned int dma_len = ib_sg_dma_len(ibdev, &sg[i]);
> > +	for_each_sg(sgl, sg, data->dma_nents, i) {
> > +		unsigned int dma_len = ib_sg_dma_len(ibdev, sg);
> >  
> >  		total_sz += dma_len;
> >  
> > -		first_addr = ib_sg_dma_address(ibdev, &sg[i]);
> > +		first_addr = ib_sg_dma_address(ibdev, sg);
> >  		last_addr  = first_addr + dma_len;
> >  
> >  		end_aligned   = !(last_addr  & ~MASK_4K);
> > @@ -249,9 +252,9 @@ static int iser_sg_to_page_vec(struct iser_data_buf *data,
> >  		/* continue to collect page fragments till aligned or SG ends */
> >  		while (!end_aligned && (i + 1 < data->dma_nents)) {
> >  			i++;
> 
> Do we need to replace i++ with sg = sg_next(sg) here?

We do, updating the patch. Thanks for your review!

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ