Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/cxgbei/icl_cxgbei.c
Show First 20 Lines • Show All 363 Lines • ▼ Show 20 Lines | icl_cxgbei_conn_pdu_get_data(struct icl_conn *ic, struct icl_pdu *ip, | ||||
if (icp->icp_flags & ICPF_RX_DDP) | if (icp->icp_flags & ICPF_RX_DDP) | ||||
return; /* data is DDP'ed, no need to copy */ | return; /* data is DDP'ed, no need to copy */ | ||||
m_copydata(ip->ip_data_mbuf, off, len, addr); | m_copydata(ip->ip_data_mbuf, off, len, addr); | ||||
} | } | ||||
void | void | ||||
icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip) | icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct icl_cxgbei_conn *icc = ic_to_icc(ic); | struct icl_cxgbei_conn *icc = ic_to_icc(ic); | ||||
struct icl_cxgbei_pdu *icp = ip_to_icp(ip); | struct icl_cxgbei_pdu *icp = ip_to_icp(ip); | ||||
struct socket *so = ic->ic_socket; | struct socket *so = ic->ic_socket; | ||||
struct toepcb *toep = icc->toep; | struct toepcb *toep = icc->toep; | ||||
struct inpcb *inp; | struct inpcb *inp; | ||||
struct mbuf *m; | struct mbuf *m; | ||||
MPASS(ic == ip->ip_conn); | MPASS(ic == ip->ip_conn); | ||||
Show All 12 Lines | icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip) | ||||
M_ASSERTPKTHDR(m); | M_ASSERTPKTHDR(m); | ||||
MPASS((m->m_pkthdr.len & 3) == 0); | MPASS((m->m_pkthdr.len & 3) == 0); | ||||
/* | /* | ||||
* Do not get inp from toep->inp as the toepcb might have detached | * Do not get inp from toep->inp as the toepcb might have detached | ||||
* already. | * already. | ||||
*/ | */ | ||||
inp = sotoinpcb(so); | inp = sotoinpcb(so); | ||||
CURVNET_SET(toep->vnet); | |||||
NET_EPOCH_ENTER(et); | |||||
INP_WLOCK(inp); | INP_WLOCK(inp); | ||||
if (__predict_false(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) || | if (__predict_false(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) || | ||||
__predict_false((toep->flags & TPF_ATTACHED) == 0)) | __predict_false((toep->flags & TPF_ATTACHED) == 0)) | ||||
m_freem(m); | m_freem(m); | ||||
else { | else { | ||||
mbufq_enqueue(&toep->ulp_pduq, m); | mbufq_enqueue(&toep->ulp_pduq, m); | ||||
t4_push_pdus(icc->sc, toep, 0); | t4_push_pdus(icc->sc, toep, 0); | ||||
} | } | ||||
INP_WUNLOCK(inp); | INP_WUNLOCK(inp); | ||||
NET_EPOCH_EXIT(et); | |||||
CURVNET_RESTORE(); | |||||
} | } | ||||
static struct icl_conn * | static struct icl_conn * | ||||
icl_cxgbei_new_conn(const char *name, struct mtx *lock) | icl_cxgbei_new_conn(const char *name, struct mtx *lock) | ||||
{ | { | ||||
struct icl_cxgbei_conn *icc; | struct icl_cxgbei_conn *icc; | ||||
struct icl_conn *ic; | struct icl_conn *ic; | ||||
▲ Show 20 Lines • Show All 676 Lines • Show Last 20 Lines |