sfc: Define and set RX buffer flag for packets parsed as TCP
This will be useful for shortcutting some software packet parsing. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
This commit is contained in:
parent
3ea84c5492
commit
d07df8ec08
|
@ -243,6 +243,7 @@ struct efx_rx_buffer {
|
||||||
#define EFX_RX_BUF_LAST_IN_PAGE 0x0001
|
#define EFX_RX_BUF_LAST_IN_PAGE 0x0001
|
||||||
#define EFX_RX_PKT_CSUMMED 0x0002
|
#define EFX_RX_PKT_CSUMMED 0x0002
|
||||||
#define EFX_RX_PKT_DISCARD 0x0004
|
#define EFX_RX_PKT_DISCARD 0x0004
|
||||||
|
#define EFX_RX_PKT_TCP 0x0040
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct efx_rx_page_state - Page-based rx buffer state
|
* struct efx_rx_page_state - Page-based rx buffer state
|
||||||
|
|
|
@ -1080,12 +1080,21 @@ efx_handle_rx_event(struct efx_channel *channel, const efx_qword_t *event)
|
||||||
rx_ev_hdr_type = EFX_QWORD_FIELD(*event, FSF_AZ_RX_EV_HDR_TYPE);
|
rx_ev_hdr_type = EFX_QWORD_FIELD(*event, FSF_AZ_RX_EV_HDR_TYPE);
|
||||||
|
|
||||||
if (likely(rx_ev_pkt_ok)) {
|
if (likely(rx_ev_pkt_ok)) {
|
||||||
/* If packet is marked as OK and packet type is TCP/IP or
|
/* If packet is marked as OK then we can rely on the
|
||||||
* UDP/IP, then we can rely on the hardware checksum.
|
* hardware checksum and classification.
|
||||||
*/
|
*/
|
||||||
flags = (rx_ev_hdr_type == FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_TCP ||
|
flags = 0;
|
||||||
rx_ev_hdr_type == FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_UDP) ?
|
switch (rx_ev_hdr_type) {
|
||||||
EFX_RX_PKT_CSUMMED : 0;
|
case FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_TCP:
|
||||||
|
flags |= EFX_RX_PKT_TCP;
|
||||||
|
/* fall through */
|
||||||
|
case FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_UDP:
|
||||||
|
flags |= EFX_RX_PKT_CSUMMED;
|
||||||
|
/* fall through */
|
||||||
|
case FSE_CZ_RX_EV_HDR_TYPE_IPV4V6_OTHER:
|
||||||
|
case FSE_AZ_RX_EV_HDR_TYPE_OTHER:
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
flags = efx_handle_rx_not_ok(rx_queue, event);
|
flags = efx_handle_rx_not_ok(rx_queue, event);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue