Skip to content

Commit e44f479

Browse files
mfijalkoborkmann
authored andcommitted
ice: Inline eop check
This might be in future used by ZC driver and might potentially yield a minor performance boost. While at it, constify arguments that ice_is_non_eop() takes, since they are pointers and this will help compiler while generating asm. Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com> Link: https://lore.kernel.org/bpf/20230131204506.219292-6-maciej.fijalkowski@intel.com
1 parent d7956d8 commit e44f479

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

drivers/net/ethernet/intel/ice/ice_txrx.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,27 +1065,6 @@ ice_put_rx_buf(struct ice_rx_ring *rx_ring, struct ice_rx_buf *rx_buf)
10651065
rx_buf->page = NULL;
10661066
}
10671067

1068-
/**
1069-
* ice_is_non_eop - process handling of non-EOP buffers
1070-
* @rx_ring: Rx ring being processed
1071-
* @rx_desc: Rx descriptor for current buffer
1072-
*
1073-
* If the buffer is an EOP buffer, this function exits returning false,
1074-
* otherwise return true indicating that this is in fact a non-EOP buffer.
1075-
*/
1076-
static bool
1077-
ice_is_non_eop(struct ice_rx_ring *rx_ring, union ice_32b_rx_flex_desc *rx_desc)
1078-
{
1079-
/* if we are the last buffer then there is nothing else to do */
1080-
#define ICE_RXD_EOF BIT(ICE_RX_FLEX_DESC_STATUS0_EOF_S)
1081-
if (likely(ice_test_staterr(rx_desc->wb.status_error0, ICE_RXD_EOF)))
1082-
return false;
1083-
1084-
rx_ring->ring_stats->rx_stats.non_eop_descs++;
1085-
1086-
return true;
1087-
}
1088-
10891068
/**
10901069
* ice_clean_rx_irq - Clean completed descriptors from Rx ring - bounce buf
10911070
* @rx_ring: Rx descriptor ring to transact packets on

drivers/net/ethernet/intel/ice/ice_txrx_lib.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,28 @@ ice_test_staterr(__le16 status_err_n, const u16 stat_err_bits)
2121
return !!(status_err_n & cpu_to_le16(stat_err_bits));
2222
}
2323

24+
/**
25+
* ice_is_non_eop - process handling of non-EOP buffers
26+
* @rx_ring: Rx ring being processed
27+
* @rx_desc: Rx descriptor for current buffer
28+
*
29+
* If the buffer is an EOP buffer, this function exits returning false,
30+
* otherwise return true indicating that this is in fact a non-EOP buffer.
31+
*/
32+
static inline bool
33+
ice_is_non_eop(const struct ice_rx_ring *rx_ring,
34+
const union ice_32b_rx_flex_desc *rx_desc)
35+
{
36+
/* if we are the last buffer then there is nothing else to do */
37+
#define ICE_RXD_EOF BIT(ICE_RX_FLEX_DESC_STATUS0_EOF_S)
38+
if (likely(ice_test_staterr(rx_desc->wb.status_error0, ICE_RXD_EOF)))
39+
return false;
40+
41+
rx_ring->ring_stats->rx_stats.non_eop_descs++;
42+
43+
return true;
44+
}
45+
2446
static inline __le64
2547
ice_build_ctob(u64 td_cmd, u64 td_offset, unsigned int size, u64 td_tag)
2648
{

0 commit comments

Comments
 (0)