Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
Show First 20 Lines • Show All 456 Lines • ▼ Show 20 Lines | for (i = 0; i < budget; i++) { | ||||
bus_dmamap_sync(rq->dma_tag, | bus_dmamap_sync(rq->dma_tag, | ||||
rq->mbuf[wqe_counter].dma_map, | rq->mbuf[wqe_counter].dma_map, | ||||
BUS_DMASYNC_POSTREAD); | BUS_DMASYNC_POSTREAD); | ||||
if (unlikely((cqe->op_own >> 4) != MLX5_CQE_RESP_SEND)) { | if (unlikely((cqe->op_own >> 4) != MLX5_CQE_RESP_SEND)) { | ||||
rq->stats.wqe_err++; | rq->stats.wqe_err++; | ||||
goto wq_ll_pop; | goto wq_ll_pop; | ||||
} | } | ||||
if (PFIL_HOOKED_IN(rq->channel->priv->pfil)) { | |||||
int rv; | |||||
kib: Style, no declarations not at the start of a function. | |||||
rv = pfil_run_hooks(rq->channel->priv->pfil, | |||||
rq->mbuf[wqe_counter].data, rq->ifp, | |||||
byte_cnt | PFIL_MEMPTR | PFIL_IN, NULL); | |||||
KASSERT(rv != PFIL_REALLOCED, | |||||
("Filter did something we don't support yet")); | |||||
kibUnsubmitted Not Done Inline ActionsIs this condition something that user controls ? Or, is it impossible to get PFIL_REALLOCATED in whatever configuration accessible to a user ? kib: Is this condition something that user controls ? Or, is it impossible to get PFIL_REALLOCATED… | |||||
gallatinAuthorUnsubmitted Done Inline ActionsThese are return values from the filter, and are determined by the enum pfil_return_t. I was going to wait until we had an easy way to test PFIL_REALLOCED, but I decided to just go ahead and hack up a test case so that I could handle all cases immediately. gallatin: These are return values from the filter, and are determined by the enum pfil_return_t.
I was… | |||||
if (rv != PFIL_PASS) { | |||||
rq->stats.packets++; | |||||
goto wq_ll_pop; | |||||
} | |||||
} | |||||
if ((MHLEN - MLX5E_NET_IP_ALIGN) >= byte_cnt && | if ((MHLEN - MLX5E_NET_IP_ALIGN) >= byte_cnt && | ||||
(mb = m_gethdr(M_NOWAIT, MT_DATA)) != NULL) { | (mb = m_gethdr(M_NOWAIT, MT_DATA)) != NULL) { | ||||
Done Inline ActionsThe breaks after goto are not needed. Can you remove them? hselasky: The breaks after goto are not needed. Can you remove them? | |||||
#if (MLX5E_MAX_RX_SEGS != 1) | #if (MLX5E_MAX_RX_SEGS != 1) | ||||
/* set maximum mbuf length */ | /* set maximum mbuf length */ | ||||
mb->m_len = MHLEN - MLX5E_NET_IP_ALIGN; | mb->m_len = MHLEN - MLX5E_NET_IP_ALIGN; | ||||
#endif | #endif | ||||
/* get IP header aligned */ | /* get IP header aligned */ | ||||
mb->m_data += MLX5E_NET_IP_ALIGN; | mb->m_data += MLX5E_NET_IP_ALIGN; | ||||
Done Inline ActionsNote that the data pointer may not be aligned for pointer reads. Typically it is + 2 bytes for the sake if IP-packet alignment. May break on some arm platforms. Can this pointer be returned w/o this hack? hselasky: Note that the data pointer may not be aligned for pointer reads. Typically it is + 2 bytes for… | |||||
Not Done Inline Actionsmb = *(struct mbuf * __packed *) ??? hselasky: mb = *(struct mbuf * __packed *) ??? | |||||
bcopy(rq->mbuf[wqe_counter].data, mtod(mb, caddr_t), | bcopy(rq->mbuf[wqe_counter].data, mtod(mb, caddr_t), | ||||
byte_cnt); | byte_cnt); | ||||
} else { | } else { | ||||
mb = rq->mbuf[wqe_counter].mbuf; | mb = rq->mbuf[wqe_counter].mbuf; | ||||
rq->mbuf[wqe_counter].mbuf = NULL; /* safety clear */ | rq->mbuf[wqe_counter].mbuf = NULL; /* safety clear */ | ||||
bus_dmamap_unload(rq->dma_tag, | bus_dmamap_unload(rq->dma_tag, | ||||
rq->mbuf[wqe_counter].dma_map); | rq->mbuf[wqe_counter].dma_map); | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |
Style, no declarations not at the start of a function.