netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: brking@linux.vnet.ibm.com, santil@linux.vnet.ibm.com
Cc: netdev@vger.kernel.org
Subject: [patch 15/20] ibmveth: Some formatting fixes
Date: Mon, 23 Aug 2010 10:09:45 +1000	[thread overview]
Message-ID: <20100823001239.707974995@samba.org> (raw)
In-Reply-To: 20100823000930.546065833@samba.org

[-- Attachment #1: veth_min_mtu --]
[-- Type: text/plain, Size: 6259 bytes --]

IbmVethNumBufferPools -> IBMVETH_NUM_BUFF_POOLS

Also change IBMVETH_MAX_MTU -> IBMVETH_MIN_MTU, it refers to the minimum
size not the maximum.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: net-next-2.6/drivers/net/ibmveth.c
===================================================================
--- net-next-2.6.orig/drivers/net/ibmveth.c	2010-08-23 08:52:33.000000000 +1000
+++ net-next-2.6/drivers/net/ibmveth.c	2010-08-23 08:53:23.040010330 +1000
@@ -309,7 +309,7 @@ static void ibmveth_replenish_task(struc
 
 	adapter->replenish_task_cycles++;
 
-	for (i = (IbmVethNumBufferPools - 1); i >= 0; i--) {
+	for (i = (IBMVETH_NUM_BUFF_POOLS - 1); i >= 0; i--) {
 		struct ibmveth_buff_pool *pool = &adapter->rx_buff_pool[i];
 
 		if (pool->active &&
@@ -361,7 +361,7 @@ static void ibmveth_remove_buffer_from_p
 	unsigned int free_index;
 	struct sk_buff *skb;
 
-	ibmveth_assert(pool < IbmVethNumBufferPools);
+	ibmveth_assert(pool < IBMVETH_NUM_BUFF_POOLS);
 	ibmveth_assert(index < adapter->rx_buff_pool[pool].size);
 
 	skb = adapter->rx_buff_pool[pool].skbuff[index];
@@ -394,7 +394,7 @@ static inline struct sk_buff *ibmveth_rx
 	unsigned int pool = correlator >> 32;
 	unsigned int index = correlator & 0xffffffffUL;
 
-	ibmveth_assert(pool < IbmVethNumBufferPools);
+	ibmveth_assert(pool < IBMVETH_NUM_BUFF_POOLS);
 	ibmveth_assert(index < adapter->rx_buff_pool[pool].size);
 
 	return adapter->rx_buff_pool[pool].skbuff[index];
@@ -410,7 +410,7 @@ static void ibmveth_rxq_recycle_buffer(s
 	union ibmveth_buf_desc desc;
 	unsigned long lpar_rc;
 
-	ibmveth_assert(pool < IbmVethNumBufferPools);
+	ibmveth_assert(pool < IBMVETH_NUM_BUFF_POOLS);
 	ibmveth_assert(index < adapter->rx_buff_pool[pool].size);
 
 	if(!adapter->rx_buff_pool[pool].active) {
@@ -484,7 +484,7 @@ static void ibmveth_cleanup(struct ibmve
 		adapter->rx_queue.queue_addr = NULL;
 	}
 
-	for(i = 0; i<IbmVethNumBufferPools; i++)
+	for(i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++)
 		if (adapter->rx_buff_pool[i].active)
 			ibmveth_free_buffer_pool(adapter,
 						 &adapter->rx_buff_pool[i]);
@@ -542,7 +542,7 @@ static int ibmveth_open(struct net_devic
 
 	napi_enable(&adapter->napi);
 
-	for(i = 0; i<IbmVethNumBufferPools; i++)
+	for(i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++)
 		rxq_entries += adapter->rx_buff_pool[i].size;
 
 	adapter->buffer_list_addr = kzalloc(4096, GFP_KERNEL);
@@ -618,7 +618,7 @@ static int ibmveth_open(struct net_devic
 		return -ENONET;
 	}
 
-	for(i = 0; i<IbmVethNumBufferPools; i++) {
+	for(i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++) {
 		if(!adapter->rx_buff_pool[i].active)
 			continue;
 		if (ibmveth_alloc_buffer_pool(&adapter->rx_buff_pool[i])) {
@@ -1211,14 +1211,14 @@ static int ibmveth_change_mtu(struct net
 	int i, rc;
 	int need_restart = 0;
 
-	if (new_mtu < IBMVETH_MAX_MTU)
+	if (new_mtu < IBMVETH_MIN_MTU)
 		return -EINVAL;
 
-	for (i = 0; i < IbmVethNumBufferPools; i++)
+	for (i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++)
 		if (new_mtu_oh < adapter->rx_buff_pool[i].buff_size)
 			break;
 
-	if (i == IbmVethNumBufferPools)
+	if (i == IBMVETH_NUM_BUFF_POOLS)
 		return -EINVAL;
 
 	/* Deactivate all the buffer pools so that the next loop can activate
@@ -1231,7 +1231,7 @@ static int ibmveth_change_mtu(struct net
 	}
 
 	/* Look for an active buffer pool that can hold the new MTU */
-	for(i = 0; i<IbmVethNumBufferPools; i++) {
+	for(i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++) {
 		adapter->rx_buff_pool[i].active = 1;
 
 		if (new_mtu_oh < adapter->rx_buff_pool[i].buff_size) {
@@ -1285,7 +1285,7 @@ static unsigned long ibmveth_get_desired
 	ret = IBMVETH_BUFF_LIST_SIZE + IBMVETH_FILT_LIST_SIZE;
 	ret += IOMMU_PAGE_ALIGN(netdev->mtu);
 
-	for (i = 0; i < IbmVethNumBufferPools; i++) {
+	for (i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++) {
 		/* add the size of the active receive buffers */
 		if (adapter->rx_buff_pool[i].active)
 			ret +=
@@ -1381,7 +1381,7 @@ static int __devinit ibmveth_probe(struc
 
 	memcpy(netdev->dev_addr, &adapter->mac_addr, netdev->addr_len);
 
-	for(i = 0; i<IbmVethNumBufferPools; i++) {
+	for(i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++) {
 		struct kobject *kobj = &adapter->rx_buff_pool[i].kobj;
 		int error;
 
@@ -1437,7 +1437,7 @@ static int __devexit ibmveth_remove(stru
 	struct ibmveth_adapter *adapter = netdev_priv(netdev);
 	int i;
 
-	for(i = 0; i<IbmVethNumBufferPools; i++)
+	for(i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++)
 		kobject_put(&adapter->rx_buff_pool[i].kobj);
 
 	unregister_netdev(netdev);
@@ -1501,7 +1501,7 @@ const char * buf, size_t count)
 			int i;
 			/* Make sure there is a buffer pool with buffers that
 			   can hold a packet of the size of the MTU */
-			for (i = 0; i < IbmVethNumBufferPools; i++) {
+			for (i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++) {
 				if (pool == &adapter->rx_buff_pool[i])
 					continue;
 				if (!adapter->rx_buff_pool[i].active)
@@ -1510,7 +1510,7 @@ const char * buf, size_t count)
 					break;
 			}
 
-			if (i == IbmVethNumBufferPools) {
+			if (i == IBMVETH_NUM_BUFF_POOLS) {
 				netdev_err(netdev, "no active pool >= MTU\n");
 				return -EPERM;
 			}
Index: net-next-2.6/drivers/net/ibmveth.h
===================================================================
--- net-next-2.6.orig/drivers/net/ibmveth.h	2010-08-23 08:52:28.000000000 +1000
+++ net-next-2.6/drivers/net/ibmveth.h	2010-08-23 08:52:52.492178650 +1000
@@ -92,10 +92,10 @@ static inline long h_illan_attributes(un
 #define h_change_logical_lan_mac(ua, mac) \
   plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac)
 
-#define IbmVethNumBufferPools 5
+#define IBMVETH_NUM_BUFF_POOLS 5
 #define IBMVETH_IO_ENTITLEMENT_DEFAULT 4243456 /* MTU of 1500 needs 4.2Mb */
 #define IBMVETH_BUFF_OH 22 /* Overhead: 14 ethernet header + 8 opaque handle */
-#define IBMVETH_MAX_MTU 68
+#define IBMVETH_MIN_MTU 68
 #define IBMVETH_MAX_POOL_COUNT 4096
 #define IBMVETH_BUFF_LIST_SIZE 4096
 #define IBMVETH_FILT_LIST_SIZE 4096
@@ -142,7 +142,7 @@ struct ibmveth_adapter {
     void * filter_list_addr;
     dma_addr_t buffer_list_dma;
     dma_addr_t filter_list_dma;
-    struct ibmveth_buff_pool rx_buff_pool[IbmVethNumBufferPools];
+    struct ibmveth_buff_pool rx_buff_pool[IBMVETH_NUM_BUFF_POOLS];
     struct ibmveth_rx_q rx_queue;
     int pool_config;
     int rx_csum;



  parent reply	other threads:[~2010-08-23  0:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23  0:09 [patch 00/20] ibmveth update Anton Blanchard
2010-08-23  0:09 ` [patch 01/20] ibmveth: Remove integer divide caused by modulus Anton Blanchard
2010-08-23  0:09 ` [patch 02/20] ibmveth: batch rx buffer replacement Anton Blanchard
2010-08-23  0:09 ` [patch 03/20] ibmveth: Remove LLTX Anton Blanchard
2010-08-23  0:09 ` [patch 04/20] ibmveth: Add tx_copybreak Anton Blanchard
2010-08-23  0:09 ` [patch 05/20] ibmveth: Add rx_copybreak Anton Blanchard
2010-08-23  0:09 ` [patch 06/20] ibmveth: Use lighter weight read memory barrier in ibmveth_poll Anton Blanchard
2010-08-23  0:09 ` [patch 07/20] ibmveth: Add scatter-gather support Anton Blanchard
2010-08-23  0:09 ` [patch 08/20] ibmveth: Dont overallocate buffers Anton Blanchard
2010-08-23 20:49   ` Robert Jennings
2010-08-25 13:44     ` Brian King
2010-08-23  0:09 ` [patch 09/20] ibmveth: Add optional flush of rx buffer Anton Blanchard
2010-08-23  0:09 ` [patch 10/20] ibmveth: remove procfs code Anton Blanchard
2010-08-23  0:09 ` [patch 11/20] ibmveth: Convert to netdev_alloc_skb Anton Blanchard
2010-08-23  0:09 ` [patch 12/20] ibmveth: Remove redundant function prototypes Anton Blanchard
2010-08-23  0:09 ` [patch 13/20] ibmveth: Convert driver specific debug to netdev_dbg Anton Blanchard
2010-08-23  0:09 ` [patch 14/20] ibmveth: Convert driver specific error functions to netdev_err Anton Blanchard
2010-08-23  0:09 ` Anton Blanchard [this message]
2010-08-23  0:09 ` [patch 16/20] ibmveth: Coding style fixes Anton Blanchard
2010-08-23  0:09 ` [patch 17/20] ibmveth: Return -EINVAL on all ->probe errors Anton Blanchard
2010-08-23  0:09 ` [patch 18/20] ibmveth: Convert driver specific assert to BUG_ON Anton Blanchard
2010-08-23  0:09 ` [patch 19/20] ibmveth: Remove some unnecessary include files Anton Blanchard
2010-08-23  0:09 ` [patch 20/20] ibmveth: Update module information and version Anton Blanchard
2010-08-23  1:57 ` [patch 00/20] ibmveth update David Miller
2010-08-23  2:07   ` Anton Blanchard
2010-08-23  2:15     ` David Miller

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=20100823001239.707974995@samba.org \
    --to=anton@samba.org \
    --cc=brking@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=santil@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).