static void
igb_reset_tx_queue(struct igb_tx_queue *txq, struct rte_eth_dev *dev)
{
+ static const union e1000_adv_tx_desc zeroed_desc;
struct igb_tx_entry *txe = txq->sw_ring;
- uint32_t size;
uint16_t i, prev;
struct e1000_hw *hw;
hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- size = sizeof(union e1000_adv_tx_desc) * txq->nb_tx_desc;
/* Zero out HW ring memory */
- for (i = 0; i < size; i++) {
- ((volatile char *)txq->tx_ring)[i] = 0;
+ for (i = 0; i < txq->nb_tx_desc; i++) {
+ txq->tx_ring[i] = zeroed_desc;
}
/* Initialize ring entries */
static void
igb_reset_rx_queue(struct igb_rx_queue *rxq)
{
- unsigned size;
+ static const union e1000_adv_rx_desc zeroed_desc;
unsigned i;
/* Zero out HW ring memory */
- size = sizeof(union e1000_adv_rx_desc) * rxq->nb_rx_desc;
- for (i = 0; i < size; i++) {
- ((volatile char *)rxq->rx_ring)[i] = 0;
+ for (i = 0; i < rxq->nb_rx_desc; i++) {
+ rxq->rx_ring[i] = zeroed_desc;
}
rxq->rx_tail = 0;
static void
ixgbe_reset_tx_queue(struct igb_tx_queue *txq)
{
+ static const union ixgbe_adv_tx_desc zeroed_desc;
struct igb_tx_entry *txe = txq->sw_ring;
- uint16_t prev;
- uint32_t i;
+ uint16_t prev, i;
/* Zero out HW ring memory */
- for (i = 0; i < sizeof(union ixgbe_adv_tx_desc) * txq->nb_tx_desc; i++) {
- ((volatile char *)txq->tx_ring)[i] = 0;
+ for (i = 0; i < txq->nb_tx_desc; i++) {
+ txq->tx_ring[i] = zeroed_desc;
}
/* Initialize SW ring entries */
volatile union ixgbe_adv_tx_desc *txd = &txq->tx_ring[i];
txd->wb.status = IXGBE_TXD_STAT_DD;
txe[i].mbuf = NULL;
- txe[i].last_id = (uint16_t)i;
- txe[prev].next_id = (uint16_t)i;
- prev = (uint16_t)i;
+ txe[i].last_id = i;
+ txe[prev].next_id = i;
+ prev = i;
}
txq->tx_next_dd = (uint16_t)(txq->tx_rs_thresh - 1);
static void
ixgbe_reset_rx_queue(struct igb_rx_queue *rxq)
{
+ static const union ixgbe_adv_rx_desc zeroed_desc;
unsigned i;
uint16_t len;
* the H/W ring so look-ahead logic in Rx Burst bulk alloc function
* reads extra memory as zeros.
*/
- for (i = 0; i < len * sizeof(union ixgbe_adv_rx_desc); i++) {
- ((volatile char *)rxq->rx_ring)[i] = 0;
+ for (i = 0; i < len; i++) {
+ rxq->rx_ring[i] = zeroed_desc;
}
#ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC