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

cxgb4: Differentiate between stids between server and filter region

For T4 adapter, offloaded servers tid for IPv4 connections are
allocated from filter region. So add a new field for server filter tid if
server tid is allocated from filter region.
Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9a1bb9f6
...@@ -1548,7 +1548,7 @@ int cxgb4_alloc_sftid(struct tid_info *t, int family, void *data) ...@@ -1548,7 +1548,7 @@ int cxgb4_alloc_sftid(struct tid_info *t, int family, void *data)
t->stid_tab[stid].data = data; t->stid_tab[stid].data = data;
stid -= t->nstids; stid -= t->nstids;
stid += t->sftid_base; stid += t->sftid_base;
t->stids_in_use++; t->sftids_in_use++;
} }
spin_unlock_bh(&t->stid_lock); spin_unlock_bh(&t->stid_lock);
return stid; return stid;
...@@ -1573,10 +1573,14 @@ void cxgb4_free_stid(struct tid_info *t, unsigned int stid, int family) ...@@ -1573,10 +1573,14 @@ void cxgb4_free_stid(struct tid_info *t, unsigned int stid, int family)
else else
bitmap_release_region(t->stid_bmap, stid, 2); bitmap_release_region(t->stid_bmap, stid, 2);
t->stid_tab[stid].data = NULL; t->stid_tab[stid].data = NULL;
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 -= 4;
} else {
t->sftids_in_use--;
}
spin_unlock_bh(&t->stid_lock); spin_unlock_bh(&t->stid_lock);
} }
EXPORT_SYMBOL(cxgb4_free_stid); EXPORT_SYMBOL(cxgb4_free_stid);
...@@ -1707,6 +1711,7 @@ static int tid_init(struct tid_info *t) ...@@ -1707,6 +1711,7 @@ static int tid_init(struct tid_info *t)
spin_lock_init(&t->atid_lock); spin_lock_init(&t->atid_lock);
t->stids_in_use = 0; t->stids_in_use = 0;
t->sftids_in_use = 0;
t->afree = NULL; t->afree = NULL;
t->atids_in_use = 0; t->atids_in_use = 0;
atomic_set(&t->tids_in_use, 0); atomic_set(&t->tids_in_use, 0);
......
...@@ -117,6 +117,7 @@ struct tid_info { ...@@ -117,6 +117,7 @@ struct tid_info {
spinlock_t stid_lock; spinlock_t stid_lock;
unsigned int stids_in_use; unsigned int stids_in_use;
unsigned int sftids_in_use;
/* TIDs in the TCAM */ /* TIDs in the TCAM */
atomic_t tids_in_use; atomic_t tids_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