Lines Matching refs:e
68 struct smt_entry *e, *end; in find_or_alloc_smte() local
70 for (e = &s->smtab[0], end = &s->smtab[s->smt_size]; e != end; ++e) { in find_or_alloc_smte()
71 if (e->refcnt == 0) { in find_or_alloc_smte()
73 first_free = e; in find_or_alloc_smte()
75 if (e->state == SMT_STATE_SWITCHING) { in find_or_alloc_smte()
79 if (memcmp(e->src_mac, smac, ETH_ALEN) == 0) in find_or_alloc_smte()
86 e = first_free; in find_or_alloc_smte()
92 e->state = SMT_STATE_UNUSED; in find_or_alloc_smte()
95 return e; in find_or_alloc_smte()
98 static void t4_smte_free(struct smt_entry *e) in t4_smte_free() argument
100 if (e->refcnt == 0) { /* hasn't been recycled */ in t4_smte_free()
101 e->state = SMT_STATE_UNUSED; in t4_smte_free()
111 void cxgb4_smt_release(struct smt_entry *e) in cxgb4_smt_release() argument
113 spin_lock_bh(&e->lock); in cxgb4_smt_release()
114 if ((--e->refcnt) == 0) in cxgb4_smt_release()
115 t4_smte_free(e); in cxgb4_smt_release()
116 spin_unlock_bh(&e->lock); in cxgb4_smt_release()
126 struct smt_entry *e = &s->smtab[smtidx]; in do_smt_write_rpl() local
131 spin_lock(&e->lock); in do_smt_write_rpl()
132 e->state = SMT_STATE_ERROR; in do_smt_write_rpl()
133 spin_unlock(&e->lock); in do_smt_write_rpl()
138 static int write_smt_entry(struct adapter *adapter, struct smt_entry *e) in write_smt_entry() argument
161 row = (e->idx >> 1); in write_smt_entry()
162 if (e->idx & 1) { in write_smt_entry()
164 memcpy(req->src_mac1, e->src_mac, ETH_ALEN); in write_smt_entry()
170 memcpy(req->src_mac0, s->smtab[e->idx - 1].src_mac, in write_smt_entry()
174 memcpy(req->src_mac0, e->src_mac, ETH_ALEN); in write_smt_entry()
180 memcpy(req->src_mac1, s->smtab[e->idx + 1].src_mac, in write_smt_entry()
195 memcpy(req->src_mac0, s->smtab[e->idx].src_mac, ETH_ALEN); in write_smt_entry()
196 row = e->idx; in write_smt_entry()
200 htonl(MK_OPCODE_TID(CPL_SMT_WRITE_REQ, e->idx | in write_smt_entry()
213 struct smt_entry *e; in t4_smt_alloc_switching() local
216 e = find_or_alloc_smte(s, smac); in t4_smt_alloc_switching()
217 if (e) { in t4_smt_alloc_switching()
218 spin_lock(&e->lock); in t4_smt_alloc_switching()
219 if (!e->refcnt) { in t4_smt_alloc_switching()
220 e->refcnt = 1; in t4_smt_alloc_switching()
221 e->state = SMT_STATE_SWITCHING; in t4_smt_alloc_switching()
222 e->pfvf = pfvf; in t4_smt_alloc_switching()
223 memcpy(e->src_mac, smac, ETH_ALEN); in t4_smt_alloc_switching()
224 write_smt_entry(adap, e); in t4_smt_alloc_switching()
226 ++e->refcnt; in t4_smt_alloc_switching()
228 spin_unlock(&e->lock); in t4_smt_alloc_switching()
231 return e; in t4_smt_alloc_switching()