|
@@ -2986,7 +2986,14 @@ int cxgb4_alloc_stid(struct tid_info *t, int family, void *data)
|
|
|
if (stid >= 0) {
|
|
|
t->stid_tab[stid].data = data;
|
|
|
stid += t->stid_base;
|
|
|
- t->stids_in_use++;
|
|
|
+ /* IPv6 requires max of 520 bits or 16 cells in TCAM
|
|
|
+ * This is equivalent to 4 TIDs. With CLIP enabled it
|
|
|
+ * needs 2 TIDs.
|
|
|
+ */
|
|
|
+ if (family == PF_INET)
|
|
|
+ t->stids_in_use++;
|
|
|
+ else
|
|
|
+ t->stids_in_use += 4;
|
|
|
}
|
|
|
spin_unlock_bh(&t->stid_lock);
|
|
|
return stid;
|
|
@@ -3039,7 +3046,10 @@ void cxgb4_free_stid(struct tid_info *t, unsigned int stid, int family)
|
|
|
else
|
|
|
bitmap_release_region(t->stid_bmap, stid, 2);
|
|
|
t->stid_tab[stid].data = NULL;
|
|
|
- t->stids_in_use--;
|
|
|
+ if (family == PF_INET)
|
|
|
+ t->stids_in_use--;
|
|
|
+ else
|
|
|
+ t->stids_in_use -= 4;
|
|
|
spin_unlock_bh(&t->stid_lock);
|
|
|
}
|
|
|
EXPORT_SYMBOL(cxgb4_free_stid);
|