net/sfc: discard packets with bad CRC on EF10 ESSB Rx
Fixes: 390f9b8d82
("net/sfc: support equal stride super-buffer Rx mode")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
This commit is contained in:
parent
53bf484034
commit
aeeb5571ee
@ -322,6 +322,12 @@ sfc_ef10_essb_rx_get_pending(struct sfc_ef10_essb_rxq *rxq,
|
||||
const efx_qword_t *qwordp;
|
||||
uint16_t pkt_len;
|
||||
|
||||
/* Buffers to be discarded have 0 in packet type */
|
||||
if (unlikely(m->packet_type == 0)) {
|
||||
rte_mempool_put(rxq->refill_mb_pool, m);
|
||||
goto next_buf;
|
||||
}
|
||||
|
||||
rx_pkts[n_rx_pkts++] = m;
|
||||
|
||||
/* Parse pseudo-header */
|
||||
@ -357,6 +363,7 @@ sfc_ef10_essb_rx_get_pending(struct sfc_ef10_essb_rxq *rxq,
|
||||
EFX_QWORD_FIELD(*qwordp,
|
||||
ES_EZ_ESSB_RX_PREFIX_MARK);
|
||||
|
||||
next_buf:
|
||||
m = sfc_ef10_essb_next_mbuf(rxq, m);
|
||||
} while (todo_bufs-- > 0);
|
||||
}
|
||||
|
@ -37,8 +37,10 @@ sfc_ef10_rx_ev_to_offloads(const efx_qword_t rx_ev, struct rte_mbuf *m,
|
||||
if (unlikely(rx_ev.eq_u64[0] &
|
||||
rte_cpu_to_le_64((1ull << ESF_DZ_RX_ECC_ERR_LBN) |
|
||||
(1ull << ESF_DZ_RX_ECRC_ERR_LBN) |
|
||||
(1ull << ESF_DZ_RX_PARSE_INCOMPLETE_LBN))))
|
||||
(1ull << ESF_DZ_RX_PARSE_INCOMPLETE_LBN)))) {
|
||||
/* Zero packet type is used as a marker to dicard bad packets */
|
||||
goto done;
|
||||
}
|
||||
|
||||
#if SFC_EF10_RX_EV_ENCAP_SUPPORT
|
||||
switch (EFX_QWORD_FIELD(rx_ev, ESF_EZ_RX_ENCAP_HDR)) {
|
||||
@ -157,6 +159,8 @@ sfc_ef10_rx_ev_to_offloads(const efx_qword_t rx_ev, struct rte_mbuf *m,
|
||||
SFC_ASSERT(false);
|
||||
}
|
||||
|
||||
SFC_ASSERT(l2_ptype != 0);
|
||||
|
||||
done:
|
||||
m->ol_flags = ol_flags & ol_mask;
|
||||
m->packet_type = tun_ptype | l2_ptype | l3_ptype | l4_ptype;
|
||||
|
Loading…
Reference in New Issue
Block a user