aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/myri10ge/myri10ge.c
diff options
context:
space:
mode:
authorBrice Goglin <brice@myri.com>2010-02-24 07:11:19 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-26 07:18:34 -0500
commit2a3f279034b46204b50408aa2c25ee0882120147 (patch)
tree83775e790a8c4a94ed8bc298cb9d6f4d65e4b8b7 /drivers/net/myri10ge/myri10ge.c
parent45bb00609022ecf1d97e083666c68c74d237b799 (diff)
myri10ge: optimize 4k-boundary check when stocking rx pages
Small optimization to the code which checks to see if we'd cross a 4K boundary when stocking RX ring. Signed-off-by: Brice Goglin <brice@myri.com> Signed-off-by: Andrew Gallatin <gallatin@myri.com> Signed-off-by: Guillaume Morin <guillaume@morinfr.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/myri10ge/myri10ge.c')
-rw-r--r--drivers/net/myri10ge/myri10ge.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index aae2ddb5d827..676c513e12fc 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -77,7 +77,7 @@
77#include "myri10ge_mcp.h" 77#include "myri10ge_mcp.h"
78#include "myri10ge_mcp_gen_header.h" 78#include "myri10ge_mcp_gen_header.h"
79 79
80#define MYRI10GE_VERSION_STR "1.5.1-1.453" 80#define MYRI10GE_VERSION_STR "1.5.2-1.459"
81 81
82MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); 82MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
83MODULE_AUTHOR("Maintainer: help@myri.com"); 83MODULE_AUTHOR("Maintainer: help@myri.com");
@@ -1200,6 +1200,9 @@ myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
1200{ 1200{
1201 struct page *page; 1201 struct page *page;
1202 int idx; 1202 int idx;
1203#if MYRI10GE_ALLOC_SIZE > 4096
1204 int end_offset;
1205#endif
1203 1206
1204 if (unlikely(rx->watchdog_needed && !watchdog)) 1207 if (unlikely(rx->watchdog_needed && !watchdog))
1205 return; 1208 return;
@@ -1241,9 +1244,9 @@ myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
1241 1244
1242#if MYRI10GE_ALLOC_SIZE > 4096 1245#if MYRI10GE_ALLOC_SIZE > 4096
1243 /* don't cross a 4KB boundary */ 1246 /* don't cross a 4KB boundary */
1244 if ((rx->page_offset >> 12) != 1247 end_offset = rx->page_offset + bytes - 1;
1245 ((rx->page_offset + bytes - 1) >> 12)) 1248 if ((unsigned)(rx->page_offset ^ end_offset) > 4095)
1246 rx->page_offset = (rx->page_offset + 4096) & ~4095; 1249 rx->page_offset = end_offset & ~4095;
1247#endif 1250#endif
1248 rx->fill_cnt++; 1251 rx->fill_cnt++;
1249 1252