public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	Amir Vadai <amirv@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 3.11 19/66] net/mlx4_en: Rename name of mlx4_en_rx_alloc members
Date: Fri,  1 Nov 2013 15:06:55 -0700	[thread overview]
Message-ID: <20131101220640.046002211@linuxfoundation.org> (raw)
In-Reply-To: <20131101220634.605745564@linuxfoundation.org>

3.11-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Amir Vadai <amirv@mellanox.com>

[ Upstream commit 70fbe0794393829d9acd686428d87c27b6f6984b ]

Add page prefix to page related members: @size and @offset into
@page_size and @page_offset

CC: Eric Dumazet <edumazet@google.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/mellanox/mlx4/en_rx.c   |   40 +++++++++++++++------------
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h |    4 +-
 2 files changed, 25 insertions(+), 19 deletions(-)

--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -70,14 +70,15 @@ static int mlx4_alloc_pages(struct mlx4_
 		put_page(page);
 		return -ENOMEM;
 	}
-	page_alloc->size = PAGE_SIZE << order;
+	page_alloc->page_size = PAGE_SIZE << order;
 	page_alloc->page = page;
 	page_alloc->dma = dma;
-	page_alloc->offset = frag_info->frag_align;
+	page_alloc->page_offset = frag_info->frag_align;
 	/* Not doing get_page() for each frag is a big win
 	 * on asymetric workloads.
 	 */
-	atomic_set(&page->_count, page_alloc->size / frag_info->frag_stride);
+	atomic_set(&page->_count,
+		   page_alloc->page_size / frag_info->frag_stride);
 	return 0;
 }
 
@@ -96,16 +97,19 @@ static int mlx4_en_alloc_frags(struct ml
 	for (i = 0; i < priv->num_frags; i++) {
 		frag_info = &priv->frag_info[i];
 		page_alloc[i] = ring_alloc[i];
-		page_alloc[i].offset += frag_info->frag_stride;
-		if (page_alloc[i].offset + frag_info->frag_stride <= ring_alloc[i].size)
+		page_alloc[i].page_offset += frag_info->frag_stride;
+
+		if (page_alloc[i].page_offset + frag_info->frag_stride <=
+		    ring_alloc[i].page_size)
 			continue;
+
 		if (mlx4_alloc_pages(priv, &page_alloc[i], frag_info, gfp))
 			goto out;
 	}
 
 	for (i = 0; i < priv->num_frags; i++) {
 		frags[i] = ring_alloc[i];
-		dma = ring_alloc[i].dma + ring_alloc[i].offset;
+		dma = ring_alloc[i].dma + ring_alloc[i].page_offset;
 		ring_alloc[i] = page_alloc[i];
 		rx_desc->data[i].addr = cpu_to_be64(dma);
 	}
@@ -117,7 +121,7 @@ out:
 		frag_info = &priv->frag_info[i];
 		if (page_alloc[i].page != ring_alloc[i].page) {
 			dma_unmap_page(priv->ddev, page_alloc[i].dma,
-				page_alloc[i].size, PCI_DMA_FROMDEVICE);
+				page_alloc[i].page_size, PCI_DMA_FROMDEVICE);
 			page = page_alloc[i].page;
 			atomic_set(&page->_count, 1);
 			put_page(page);
@@ -132,9 +136,10 @@ static void mlx4_en_free_frag(struct mlx
 {
 	const struct mlx4_en_frag_info *frag_info = &priv->frag_info[i];
 
-	if (frags[i].offset + frag_info->frag_stride > frags[i].size)
-		dma_unmap_page(priv->ddev, frags[i].dma, frags[i].size,
-					 PCI_DMA_FROMDEVICE);
+	if (frags[i].page_offset + frag_info->frag_stride >
+	    frags[i].page_size)
+		dma_unmap_page(priv->ddev, frags[i].dma, frags[i].page_size,
+			       PCI_DMA_FROMDEVICE);
 
 	if (frags[i].page)
 		put_page(frags[i].page);
@@ -161,7 +166,7 @@ out:
 
 		page_alloc = &ring->page_alloc[i];
 		dma_unmap_page(priv->ddev, page_alloc->dma,
-			       page_alloc->size, PCI_DMA_FROMDEVICE);
+			       page_alloc->page_size, PCI_DMA_FROMDEVICE);
 		page = page_alloc->page;
 		atomic_set(&page->_count, 1);
 		put_page(page);
@@ -184,10 +189,11 @@ static void mlx4_en_destroy_allocator(st
 		       i, page_count(page_alloc->page));
 
 		dma_unmap_page(priv->ddev, page_alloc->dma,
-				page_alloc->size, PCI_DMA_FROMDEVICE);
-		while (page_alloc->offset + frag_info->frag_stride < page_alloc->size) {
+				page_alloc->page_size, PCI_DMA_FROMDEVICE);
+		while (page_alloc->page_offset + frag_info->frag_stride <
+		       page_alloc->page_size) {
 			put_page(page_alloc->page);
-			page_alloc->offset += frag_info->frag_stride;
+			page_alloc->page_offset += frag_info->frag_stride;
 		}
 		page_alloc->page = NULL;
 	}
@@ -478,7 +484,7 @@ static int mlx4_en_complete_rx_desc(stru
 		/* Save page reference in skb */
 		__skb_frag_set_page(&skb_frags_rx[nr], frags[nr].page);
 		skb_frag_size_set(&skb_frags_rx[nr], frag_info->frag_size);
-		skb_frags_rx[nr].page_offset = frags[nr].offset;
+		skb_frags_rx[nr].page_offset = frags[nr].page_offset;
 		skb->truesize += frag_info->frag_stride;
 		frags[nr].page = NULL;
 	}
@@ -517,7 +523,7 @@ static struct sk_buff *mlx4_en_rx_skb(st
 
 	/* Get pointer to first fragment so we could copy the headers into the
 	 * (linear part of the) skb */
-	va = page_address(frags[0].page) + frags[0].offset;
+	va = page_address(frags[0].page) + frags[0].page_offset;
 
 	if (length <= SMALL_PACKET_SIZE) {
 		/* We are copying all relevant data to the skb - temporarily
@@ -645,7 +651,7 @@ int mlx4_en_process_rx_cq(struct net_dev
 			dma_sync_single_for_cpu(priv->ddev, dma, sizeof(*ethh),
 						DMA_FROM_DEVICE);
 			ethh = (struct ethhdr *)(page_address(frags[0].page) +
-						 frags[0].offset);
+						 frags[0].page_offset);
 
 			if (is_multicast_ether_addr(ethh->h_dest)) {
 				struct mlx4_mac_entry *entry;
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -237,8 +237,8 @@ struct mlx4_en_tx_desc {
 struct mlx4_en_rx_alloc {
 	struct page	*page;
 	dma_addr_t	dma;
-	u32		offset;
-	u32		size;
+	u32		page_offset;
+	u32		page_size;
 };
 
 struct mlx4_en_tx_ring {



  parent reply	other threads:[~2013-11-01 22:24 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01 22:06 [PATCH 3.11 00/66] 3.11.7-stable review Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 01/66] tcp: TSO packets automatic sizing Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 02/66] tcp: TSQ can use a dynamic limit Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 03/66] tcp: must unclone packets before mangling them Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 04/66] tcp: do not forget FIN in tcp_shifted_skb() Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 05/66] tcp: fix incorrect ca_state in tail loss probe Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 06/66] net: do not call sock_put() on TIMEWAIT sockets Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 07/66] batman-adv: set up network coding packet handlers during module init Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 08/66] l2tp: fix kernel panic when using IPv4-mapped IPv6 addresses Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 09/66] l2tp: Fix build warning with ipv6 disabled Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 10/66] net: mv643xx_eth: update statistics timer from timer context only Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 11/66] net: mv643xx_eth: fix orphaned statistics timer crash Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 12/66] net: heap overflow in __audit_sockaddr() Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 13/66] sit: amend "allow to use rtnl ops on fb tunnel" Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 14/66] proc connector: fix info leaks Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 15/66] ipv4: fix ineffective source address selection Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 16/66] can: dev: fix nlmsg size calculation in can_get_size() Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 17/66] net: secure_seq: Fix warning when CONFIG_IPV6 and CONFIG_INET are not selected Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 18/66] xen-netback: Dont destroy the netdev until the vif is shut down Greg Kroah-Hartman
2013-11-01 22:06 ` Greg Kroah-Hartman [this message]
2013-11-01 22:06 ` [PATCH 3.11 20/66] net/mlx4_en: Fix pages never dma unmapped on rx Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 21/66] net: vlan: fix nlmsg size calculation in vlan_get_size() Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 22/66] bridge: update mdb expiration timer upon reports Greg Kroah-Hartman
2013-11-01 22:06 ` [PATCH 3.11 23/66] Revert "bridge: only expire the mdb entry when query is received" Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 24/66] vti: get rid of nf mark rule in prerouting Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 25/66] l2tp: must disable bh before calling l2tp_xmit_skb() Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 26/66] netem: update backlog after drop Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 27/66] netem: free skbs in tree on reset Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 28/66] farsync: fix info leak in ioctl Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 29/66] unix_diag: fix info leak Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 30/66] connector: use nlmsg_len() to check message length Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 31/66] bnx2x: record rx queue for LRO packets Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 32/66] virtio-net: dont respond to cpu hotplug notifier if were not ready Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 33/66] virtio-net: refill only when device is up during setting queues Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 34/66] bridge: Correctly clamp MAX forward_delay when enabling STP Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 35/66] net: dst: provide accessor function to dst->xfrm Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 36/66] sctp: Use software crc32 checksum when xfrm transform will happen Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 37/66] sctp: Perform software checksum if packet has to be fragmented Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 38/66] wanxl: fix info leak in ioctl Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 39/66] be2net: pass if_id for v1 and V2 versions of TX_CREATE cmd Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 40/66] net: unix: inherit SOCK_PASS{CRED, SEC} flags from socket to fix race Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 41/66] net: fix cipso packet validation when !NETLABEL Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 42/66] inet: fix possible memory corruption with UDP_CORK and UFO Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 43/66] ipv6: always prefer rt6i_gateway if present Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 44/66] ipv6: fill rt6i_gateway with nexthop address Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 45/66] netfilter: nf_conntrack: fix rt6i_gateway checks for H.323 helper Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 46/66] ipv6: probe routes asynchronous in rt6_probe Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 47/66] davinci_emac.c: Fix IFF_ALLMULTI setup Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 48/66] ARM: 7851/1: check for number of arguments in syscall_get/set_arguments() Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 49/66] ARM: integrator: deactivate timer0 on the Integrator/CP Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 50/66] ext[34]: fix double put in tmpfile Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 51/66] gpio/lynxpoint: check if the interrupt is enabled in IRQ handler Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 52/66] dm snapshot: fix data corruption Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 53/66] i2c: ismt: initialize DMA buffer Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 54/66] mm: migration: do not lose soft dirty bit if page is in migration state Greg Kroah-Hartman
2013-11-27 11:38   ` William Dauchy
2013-11-27 11:50     ` Cyrill Gorcunov
2013-11-27 11:52       ` William Dauchy
2013-11-01 22:07 ` [PATCH 3.11 55/66] mm/zswap: bugfix: memory leak when re-swapon Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 56/66] mm: fix BUG in __split_huge_page_pmd Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 57/66] ALSA: us122l: Fix pcm_usb_stream mmapping regression Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 58/66] ALSA: hda - Fix inverted internal mic not indicated on some machines Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 59/66] writeback: fix negative bdi max pause Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 60/66] w1 - call request_module with w1 master mutex unlocked Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 61/66] wireless: radiotap: fix parsing buffer overrun Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 62/66] wireless: cw1200: acquire hwbus lock around cw1200_irq_handler() call Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 63/66] serial: vt8500: add missing braces Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 64/66] USB: serial: ti_usb_3410_5052: add Abbott strip port ID to combined table as well Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 65/66] USB: serial: option: add support for Inovia SEW858 device Greg Kroah-Hartman
2013-11-01 22:07 ` [PATCH 3.11 66/66] usb: serial: option: blacklist Olivetti Olicard200 Greg Kroah-Hartman
2013-11-02  2:31 ` [PATCH 3.11 00/66] 3.11.7-stable review Guenter Roeck
2013-11-02 15:43   ` Greg Kroah-Hartman
2013-11-02 21:30 ` Shuah Khan
2013-11-02 22:10   ` Greg Kroah-Hartman

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=20131101220640.046002211@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.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