diff options
author | Kumar Sanghvi <kumaras@chelsio.com> | 2013-12-18 06:08:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-22 18:09:07 -0500 |
commit | b6f8eaece6d5f0247931b6dac140e6cf876f48de (patch) | |
tree | adc96c07143e74b153a33dfe65420531af4380bf | |
parent | 6eb3c2822e2c5ef8f1a215c44ac451653aec0c09 (diff) |
cxgb4: Reserve stid 0 for T4/T5 adapters
When creating offload server entries, an IPv6 passive connection request
can trigger a reply with a null STID, whereas the driver would expect
the reply 'STID to match the value used for the request.
This happens due to h/w limitation on T4 and T5.
This patch ensures that STID 0 is never used if the stid range starts
from zero.
Based on original work by Santosh Rastapur <santosh@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index d6b12e035a7d..f36f8e1a101c 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
@@ -3134,6 +3134,7 @@ static int tid_init(struct tid_info *t) | |||
3134 | size_t size; | 3134 | size_t size; |
3135 | unsigned int stid_bmap_size; | 3135 | unsigned int stid_bmap_size; |
3136 | unsigned int natids = t->natids; | 3136 | unsigned int natids = t->natids; |
3137 | struct adapter *adap = container_of(t, struct adapter, tids); | ||
3137 | 3138 | ||
3138 | stid_bmap_size = BITS_TO_LONGS(t->nstids + t->nsftids); | 3139 | stid_bmap_size = BITS_TO_LONGS(t->nstids + t->nsftids); |
3139 | size = t->ntids * sizeof(*t->tid_tab) + | 3140 | size = t->ntids * sizeof(*t->tid_tab) + |
@@ -3167,6 +3168,11 @@ static int tid_init(struct tid_info *t) | |||
3167 | t->afree = t->atid_tab; | 3168 | t->afree = t->atid_tab; |
3168 | } | 3169 | } |
3169 | bitmap_zero(t->stid_bmap, t->nstids + t->nsftids); | 3170 | bitmap_zero(t->stid_bmap, t->nstids + t->nsftids); |
3171 | /* Reserve stid 0 for T4/T5 adapters */ | ||
3172 | if (!t->stid_base && | ||
3173 | (is_t4(adap->params.chip) || is_t5(adap->params.chip))) | ||
3174 | __set_bit(0, t->stid_bmap); | ||
3175 | |||
3170 | return 0; | 3176 | return 0; |
3171 | } | 3177 | } |
3172 | 3178 | ||