/** * ice_test_staterr - tests bits in Rx descriptor status and error fields * @status_err_n: Rx descriptor status_error0 or status_error1 bits * @stat_err_bits: value to mask * * This function does some fast chicanery in order to return the * value of the mask which is really only used for boolean tests. * The status_error_len doesn't need to be shifted because it begins * at offset zero.
*/ staticinlinebool
ice_test_staterr(__le16 status_err_n, const u16 stat_err_bits)
{ return !!(status_err_n & cpu_to_le16(stat_err_bits));
}
/** * ice_is_non_eop - process handling of non-EOP buffers * @rx_ring: Rx ring being processed * @rx_desc: Rx descriptor for current buffer * * If the buffer is an EOP buffer, this function exits returning false, * otherwise return true indicating that this is in fact a non-EOP buffer.
*/ staticinlinebool
ice_is_non_eop(conststruct ice_rx_ring *rx_ring, constunion ice_32b_rx_flex_desc *rx_desc)
{ /* if we are the last buffer then there is nothing else to do */ #define ICE_RXD_EOF BIT(ICE_RX_FLEX_DESC_STATUS0_EOF_S) if (likely(ice_test_staterr(rx_desc->wb.status_error0, ICE_RXD_EOF))) returnfalse;
/** * ice_get_vlan_tci - get VLAN TCI from Rx flex descriptor * @rx_desc: Rx 32b flex descriptor with RXDID=2 * * The OS and current PF implementation only support stripping a single VLAN tag * at a time, so there should only ever be 0 or 1 tags in the l2tag* fields. If * one is found return the tag, else return 0 to mean no VLAN tag was found.
*/ staticinline u16
ice_get_vlan_tci(constunion ice_32b_rx_flex_desc *rx_desc)
{
u16 stat_err_bits;
stat_err_bits = BIT(ICE_RX_FLEX_DESC_STATUS0_L2TAG1P_S); if (ice_test_staterr(rx_desc->wb.status_error0, stat_err_bits)) return le16_to_cpu(rx_desc->wb.l2tag1);
stat_err_bits = BIT(ICE_RX_FLEX_DESC_STATUS1_L2TAG2P_S); if (ice_test_staterr(rx_desc->wb.status_error1, stat_err_bits)) return le16_to_cpu(rx_desc->wb.l2tag2_2nd);
return 0;
}
/** * ice_xdp_ring_update_tail - Updates the XDP Tx ring tail register * @xdp_ring: XDP Tx ring * * This function updates the XDP Tx ring tail register.
*/ staticinlinevoid ice_xdp_ring_update_tail(struct ice_tx_ring *xdp_ring)
{ /* Force memory writes to complete before letting h/w * know there are new descriptors to fetch.
*/
wmb();
writel_relaxed(xdp_ring->next_to_use, xdp_ring->tail);
}
/** * ice_set_rs_bit - set RS bit on last produced descriptor (one behind current NTU) * @xdp_ring: XDP ring to produce the HW Tx descriptors on * * returns index of descriptor that had RS bit produced on
*/ staticinline u32 ice_set_rs_bit(conststruct ice_tx_ring *xdp_ring)
{
u32 rs_idx = xdp_ring->next_to_use ? xdp_ring->next_to_use - 1 : xdp_ring->count - 1; struct ice_tx_desc *tx_desc;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.