public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
To: Mike Marciniszyn
	<mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Christoph Raisch <raisch-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>,
	Hoang-Nam Nguyen
	<hnguyen-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>,
	Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
Subject: Re: [PATCH v2 2/4] IB/ipath: remove ib_sg_dma_address() and ib_sg_dma_len() overloads
Date: Fri, 28 Mar 2014 19:09:51 +0100	[thread overview]
Message-ID: <1396030191.3297.81.camel@localhost.localdomain> (raw)
In-Reply-To: <20140328172647.23646.58499.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>

Le vendredi 28 mars 2014 à 13:26 -0400, Mike Marciniszyn a écrit :
> The lack of these methods is compensated for by code changes
> to .map_sg to insure that the vanilla sg_dma_address() and
> sg_dma_len() will do the same thing as the equivalent
> former ib_sg_dma_address() and ib_sg_dma_len() calls
> into the drivers.
> 

And struct ipath_dma_mapping_ops was converted to C99 initializer.

> Suggested-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
> Cc: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
> Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/infiniband/hw/ipath/ipath_dma.c |   43 +++++++++++--------------------
>  1 file changed, 15 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/ipath/ipath_dma.c b/drivers/infiniband/hw/ipath/ipath_dma.c
> index 644c2c7..123a8c0 100644
> --- a/drivers/infiniband/hw/ipath/ipath_dma.c
> +++ b/drivers/infiniband/hw/ipath/ipath_dma.c
> @@ -115,6 +115,10 @@ static int ipath_map_sg(struct ib_device *dev, struct scatterlist *sgl,
>  			ret = 0;
>  			break;
>  		}
> +		sg->dma_address = addr + sg->offset;
> +#ifdef CONFIG_NEED_SG_DMA_LENGTH
> +		sg->dma_length = sg->length;
> +#endif
>  	}
>  	return ret;
>  }
> @@ -126,21 +130,6 @@ static void ipath_unmap_sg(struct ib_device *dev,
>  	BUG_ON(!valid_dma_direction(direction));
>  }
>  
> -static u64 ipath_sg_dma_address(struct ib_device *dev, struct scatterlist *sg)
> -{
> -	u64 addr = (u64) page_address(sg_page(sg));
> -
> -	if (addr)
> -		addr += sg->offset;
> -	return addr;
> -}
> -
> -static unsigned int ipath_sg_dma_len(struct ib_device *dev,
> -				     struct scatterlist *sg)
> -{
> -	return sg->length;
> -}
> -
>  static void ipath_sync_single_for_cpu(struct ib_device *dev,
>  				      u64 addr,
>  				      size_t size,
> @@ -176,17 +165,15 @@ static void ipath_dma_free_coherent(struct ib_device *dev, size_t size,
>  }
>  
>  struct ib_dma_mapping_ops ipath_dma_mapping_ops = {
> -	ipath_mapping_error,
> -	ipath_dma_map_single,
> -	ipath_dma_unmap_single,
> -	ipath_dma_map_page,
> -	ipath_dma_unmap_page,
> -	ipath_map_sg,
> -	ipath_unmap_sg,
> -	ipath_sg_dma_address,
> -	ipath_sg_dma_len,
> -	ipath_sync_single_for_cpu,
> -	ipath_sync_single_for_device,
> -	ipath_dma_alloc_coherent,
> -	ipath_dma_free_coherent
> +	.mapping_error = ipath_mapping_error,
> +	.map_single = ipath_dma_map_single,
> +	.unmap_single = ipath_dma_unmap_single,
> +	.map_page = ipath_dma_map_page,
> +	.unmap_page = ipath_dma_unmap_page,
> +	.map_sg = ipath_map_sg,
> +	.unmap_sg = ipath_unmap_sg,
> +	.sync_single_for_cpu = ipath_sync_single_for_cpu,
> +	.sync_single_for_device = ipath_sync_single_for_device,
> +	.alloc_coherent = ipath_dma_alloc_coherent,
> +	.free_coherent = ipath_dma_free_coherent
>  };
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-03-28 18:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 17:26 [PATCH v2 0/4] Series short description Mike Marciniszyn
     [not found] ` <20140328172606.23646.35980.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2014-03-28 17:26   ` [PATCH v2 1/4] IB/qib: remove ib_sg_dma_address() and ib_sg_dma_len() overloads Mike Marciniszyn
2014-03-28 17:26   ` [PATCH v2 2/4] IB/ipath: " Mike Marciniszyn
     [not found]     ` <20140328172647.23646.58499.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2014-03-28 18:09       ` Yann Droneaud [this message]
     [not found]         ` <1396030191.3297.81.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2014-03-28 19:07           ` Marciniszyn, Mike
2014-03-28 17:26   ` [PATCH v2 3/4] IB/ehca: " Mike Marciniszyn
2014-03-28 17:26   ` [PATCH v2 4/4] IB/core: Remove overload in ib_sg_dma* Mike Marciniszyn
2014-03-28 18:10   ` [PATCH v2 0/4] Series short description Yann Droneaud

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=1396030191.3297.81.camel@localhost.localdomain \
    --to=ydroneaud-rly5vtjfyj3qt0dzr+alfa@public.gmane.org \
    --cc=bvanassche-HInyCGIudOg@public.gmane.org \
    --cc=hnguyen-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=raisch-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
    --cc=roland-BHEL68pLQRGGvPXPguhicg@public.gmane.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