diff options
author | Divy Le Ray <divy@chelsio.com> | 2007-03-31 03:23:13 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-03 22:31:09 -0400 |
commit | 9f238486f5438b2e44f760b11fa3a08714c1ddb6 (patch) | |
tree | 4db457aaedba5c4af8f6b397ef34dcc46462bf7b /drivers/net/cxgb3/cxgb3_offload.c | |
parent | 59117d3f4e3f5a7980353d2f476e516c758ce921 (diff) |
cxgb3 - Safeguard TCAM size usage
Ensure that the TCAM active region size is at least 16.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_offload.c')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_offload.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c index f6ed033efb56..eed7a48e3111 100644 --- a/drivers/net/cxgb3/cxgb3_offload.c +++ b/drivers/net/cxgb3/cxgb3_offload.c | |||
@@ -553,7 +553,9 @@ int cxgb3_alloc_atid(struct t3cdev *tdev, struct cxgb3_client *client, | |||
553 | struct tid_info *t = &(T3C_DATA(tdev))->tid_maps; | 553 | struct tid_info *t = &(T3C_DATA(tdev))->tid_maps; |
554 | 554 | ||
555 | spin_lock_bh(&t->atid_lock); | 555 | spin_lock_bh(&t->atid_lock); |
556 | if (t->afree) { | 556 | if (t->afree && |
557 | t->atids_in_use + atomic_read(&t->tids_in_use) + MC5_MIN_TIDS <= | ||
558 | t->ntids) { | ||
557 | union active_open_entry *p = t->afree; | 559 | union active_open_entry *p = t->afree; |
558 | 560 | ||
559 | atid = (p - t->atid_tab) + t->atid_base; | 561 | atid = (p - t->atid_tab) + t->atid_base; |