Commit a99c683e authored by Hariprasad Shenai's avatar Hariprasad Shenai Committed by David S. Miller

cxgb4: Get TID calculation right for IPv6 mode

CLIP is always enabled and hardware uses 2 TID entries instead of 4 for
IPv6 in CLIP mode.
Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6a29a42b
...@@ -1506,7 +1506,7 @@ int cxgb4_alloc_stid(struct tid_info *t, int family, void *data) ...@@ -1506,7 +1506,7 @@ int cxgb4_alloc_stid(struct tid_info *t, int family, void *data)
else else
stid = -1; stid = -1;
} else { } else {
stid = bitmap_find_free_region(t->stid_bmap, t->nstids, 2); stid = bitmap_find_free_region(t->stid_bmap, t->nstids, 1);
if (stid < 0) if (stid < 0)
stid = -1; stid = -1;
} }
...@@ -1520,7 +1520,7 @@ int cxgb4_alloc_stid(struct tid_info *t, int family, void *data) ...@@ -1520,7 +1520,7 @@ int cxgb4_alloc_stid(struct tid_info *t, int family, void *data)
if (family == PF_INET) if (family == PF_INET)
t->stids_in_use++; t->stids_in_use++;
else else
t->stids_in_use += 4; t->stids_in_use += 2;
} }
spin_unlock_bh(&t->stid_lock); spin_unlock_bh(&t->stid_lock);
return stid; return stid;
...@@ -1571,13 +1571,13 @@ void cxgb4_free_stid(struct tid_info *t, unsigned int stid, int family) ...@@ -1571,13 +1571,13 @@ void cxgb4_free_stid(struct tid_info *t, unsigned int stid, int family)
if (family == PF_INET) if (family == PF_INET)
__clear_bit(stid, t->stid_bmap); __clear_bit(stid, t->stid_bmap);
else else
bitmap_release_region(t->stid_bmap, stid, 2); bitmap_release_region(t->stid_bmap, stid, 1);
t->stid_tab[stid].data = NULL; t->stid_tab[stid].data = NULL;
if (stid < t->nstids) { if (stid < t->nstids) {
if (family == PF_INET) if (family == PF_INET)
t->stids_in_use--; t->stids_in_use--;
else else
t->stids_in_use -= 4; t->stids_in_use -= 2;
} else { } else {
t->sftids_in_use--; t->sftids_in_use--;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment