From patchwork Fri Aug 19 13:26:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 1080322 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7JEBf78023756 for ; Fri, 19 Aug 2011 14:11:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754167Ab1HSNsk (ORCPT ); Fri, 19 Aug 2011 09:48:40 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:27676 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252Ab1HSN2L (ORCPT ); Fri, 19 Aug 2011 09:28:11 -0400 X-IronPort-AV: E=Sophos;i="4.68,251,1312171200"; d="scan'208";a="159732210" Received: from ftlpmailmx01.citrite.net ([10.13.107.65]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5; 19 Aug 2011 09:28:09 -0400 Received: from smtp01.ad.xensource.com (10.219.128.104) by smtprelay.citrix.com (10.13.107.65) with Microsoft SMTP Server id 8.3.137.0; Fri, 19 Aug 2011 09:28:09 -0400 Received: from cosworth.uk.xensource.com (cosworth.uk.xensource.com [10.80.16.52]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id p7JDRlLP003424; Fri, 19 Aug 2011 06:28:06 -0700 From: Ian Campbell To: netdev@vger.kernel.org CC: linux-kernel@vger.kernel.org, Ian Campbell , Roland Dreier , Sean Hefty , Hal Rosenstock , "David S. Miller" , Or Gerlitz , Joe Perches , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Christoph Lameter , linux-rdma@vger.kernel.org Subject: [PATCH 09/75] IPoIB: convert to SKB paged frag API. Date: Fri, 19 Aug 2011 14:26:41 +0100 Message-ID: <1313760467-8598-9-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1313760393.5010.356.camel@zakaz.uk.xensource.com> References: <1313760393.5010.356.camel@zakaz.uk.xensource.com> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 19 Aug 2011 14:11:41 +0000 (UTC) Signed-off-by: Ian Campbell Cc: Roland Dreier Cc: Sean Hefty Cc: Hal Rosenstock Cc: "David S. Miller" Cc: Or Gerlitz Cc: Joe Perches Cc: "Micha? Miros?aw" Cc: Christoph Lameter Cc: linux-rdma@vger.kernel.org --- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 5 +++-- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 39913a0..67a477b 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -169,7 +169,7 @@ static struct sk_buff *ipoib_cm_alloc_rx_skb(struct net_device *dev, goto partial_error; skb_fill_page_desc(skb, i, page, 0, PAGE_SIZE); - mapping[i + 1] = ib_dma_map_page(priv->ca, skb_shinfo(skb)->frags[i].page, + mapping[i + 1] = ib_dma_map_page(priv->ca, page, 0, PAGE_SIZE, DMA_FROM_DEVICE); if (unlikely(ib_dma_mapping_error(priv->ca, mapping[i + 1]))) goto partial_error; @@ -537,7 +537,8 @@ static void skb_put_frags(struct sk_buff *skb, unsigned int hdr_space, if (length == 0) { /* don't need this page */ - skb_fill_page_desc(toskb, i, frag->page, 0, PAGE_SIZE); + skb_fill_page_desc(toskb, i, skb_frag_page(frag), + 0, PAGE_SIZE); --skb_shinfo(skb)->nr_frags; } else { size = min(length, (unsigned) PAGE_SIZE); diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 81ae61d..00435be 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -182,7 +182,7 @@ static struct sk_buff *ipoib_alloc_rx_skb(struct net_device *dev, int id) goto partial_error; skb_fill_page_desc(skb, 0, page, 0, PAGE_SIZE); mapping[1] = - ib_dma_map_page(priv->ca, skb_shinfo(skb)->frags[0].page, + ib_dma_map_page(priv->ca, page, 0, PAGE_SIZE, DMA_FROM_DEVICE); if (unlikely(ib_dma_mapping_error(priv->ca, mapping[1]))) goto partial_error; @@ -323,7 +323,8 @@ static int ipoib_dma_map_tx(struct ib_device *ca, for (i = 0; i < skb_shinfo(skb)->nr_frags; ++i) { skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; - mapping[i + off] = ib_dma_map_page(ca, frag->page, + mapping[i + off] = ib_dma_map_page(ca, + skb_frag_page(frag), frag->page_offset, frag->size, DMA_TO_DEVICE); if (unlikely(ib_dma_mapping_error(ca, mapping[i + off])))