From patchwork Thu Aug 25 08:28:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 1095622 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 p7P8SQih011450 for ; Thu, 25 Aug 2011 08:28:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752518Ab1HYI20 (ORCPT ); Thu, 25 Aug 2011 04:28:26 -0400 Received: from smtp.citrix.com ([66.165.176.89]:37967 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752473Ab1HYI2X (ORCPT ); Thu, 25 Aug 2011 04:28:23 -0400 X-IronPort-AV: E=Sophos;i="4.68,280,1312171200"; d="scan'208";a="16458990" Received: from ftlpmailmx01.citrite.net ([10.13.107.65]) by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5; 25 Aug 2011 04:28:22 -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; Thu, 25 Aug 2011 04:28:22 -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 p7P8SFo0030615; Thu, 25 Aug 2011 01:28:20 -0700 From: Ian Campbell To: netdev@vger.kernel.org CC: Ian Campbell , Faisal Latif , Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org Subject: [PATCH 3/9] IB: nes: convert to SKB paged frag API. Date: Thu, 25 Aug 2011 09:28:09 +0100 Message-ID: <1314260895-15936-3-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1314260881.10283.48.camel@zakaz.uk.xensource.com> References: <1314260881.10283.48.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]); Thu, 25 Aug 2011 08:28:27 +0000 (UTC) Signed-off-by: Ian Campbell Reviewed-by: Konrad Rzeszutek Wilk Cc: Faisal Latif Cc: Roland Dreier Cc: Sean Hefty Cc: Hal Rosenstock Cc: linux-rdma@vger.kernel.org Cc: netdev@vger.kernel.org Acked-by: Faisal Latif --- drivers/infiniband/hw/nes/nes_nic.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c index 66e1229..96cb35a 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c @@ -441,11 +441,11 @@ static int nes_nic_send(struct sk_buff *skb, struct net_device *netdev) nesnic->tx_skb[nesnic->sq_head] = skb; for (skb_fragment_index = 0; skb_fragment_index < skb_shinfo(skb)->nr_frags; skb_fragment_index++) { - bus_address = pci_map_page( nesdev->pcidev, - skb_shinfo(skb)->frags[skb_fragment_index].page, - skb_shinfo(skb)->frags[skb_fragment_index].page_offset, - skb_shinfo(skb)->frags[skb_fragment_index].size, - PCI_DMA_TODEVICE); + skb_frag_t *frag = + &skb_shinfo(skb)->frags[skb_fragment_index]; + bus_address = skb_frag_dma_map(&nesdev->pcidev->dev, + frag, 0, frag->size, + PCI_DMA_TODEVICE); wqe_fragment_length[wqe_fragment_index] = cpu_to_le16(skb_shinfo(skb)->frags[skb_fragment_index].size); set_wqe_64bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_FRAG0_LOW_IDX+(2*wqe_fragment_index), @@ -561,11 +561,12 @@ tso_sq_no_longer_full: /* Map all the buffers */ for (tso_frag_count=0; tso_frag_count < skb_shinfo(skb)->nr_frags; tso_frag_count++) { - tso_bus_address[tso_frag_count] = pci_map_page( nesdev->pcidev, - skb_shinfo(skb)->frags[tso_frag_count].page, - skb_shinfo(skb)->frags[tso_frag_count].page_offset, - skb_shinfo(skb)->frags[tso_frag_count].size, - PCI_DMA_TODEVICE); + skb_frag_t *frag = + &skb_shinfo(skb)->frags[tso_frag_count]; + tso_bus_address[tso_frag_count] = + skb_frag_dma_map(&nesdev->pcidev->dev, + frag, 0, frag->size, + PCI_DMA_TODEVICE); } tso_frag_index = 0;