All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] bnx2x: Adding restriction on sge_buf_size
@ 2009-03-09 10:52 Eilon Greenstein
  0 siblings, 0 replies; only message in thread
From: Eilon Greenstein @ 2009-03-09 10:52 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Alex Chiang, Bjorn Helgaas, Vladislav Zolotarov

Subject: [PATCH 1/3] bnx2x: Adding restriction on sge_buf_size.

sge_buff_size may not be more than 0xffff.

Reported-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Tested-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/bnx2x_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index d3e7775..48127f1 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -4518,7 +4518,8 @@ static void bnx2x_init_context(struct bnx2x *bp)
 				(USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_TPA |
 				 USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_SGE_RING);
 			context->ustorm_st_context.common.sge_buff_size =
-					(u16)(BCM_PAGE_SIZE*PAGES_PER_SGE);
+				(u16)min((u32)SGE_PAGE_SIZE*PAGES_PER_SGE,
+					 (u32)0xffff);
 			context->ustorm_st_context.common.sge_page_base_hi =
 						U64_HI(fp->rx_sge_mapping);
 			context->ustorm_st_context.common.sge_page_base_lo =
-- 
1.5.6.3





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-09 10:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-09 10:52 [PATCH 1/3] bnx2x: Adding restriction on sge_buf_size Eilon Greenstein

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.