struct ecore_dev *edev = &qdev->edev;
struct qede_tx_queue *txq;
int rc;
+ size_t sw_tx_ring_size;
txq = rte_zmalloc_socket("qede_tx_queue", sizeof(struct qede_tx_queue),
RTE_CACHE_LINE_SIZE, socket_id);
}
/* Allocate software ring */
+ sw_tx_ring_size = sizeof(txq->sw_tx_ring) * txq->nb_tx_desc;
txq->sw_tx_ring = rte_zmalloc_socket("txq->sw_tx_ring",
- (sizeof(struct qede_tx_entry) *
- txq->nb_tx_desc),
+ sw_tx_ring_size,
RTE_CACHE_LINE_SIZE, socket_id);
if (!txq->sw_tx_ring) {
if (txq->sw_tx_ring) {
for (i = 0; i < txq->nb_tx_desc; i++) {
- if (txq->sw_tx_ring[i].mbuf) {
- rte_pktmbuf_free(txq->sw_tx_ring[i].mbuf);
- txq->sw_tx_ring[i].mbuf = NULL;
+ if (txq->sw_tx_ring[i]) {
+ rte_pktmbuf_free(txq->sw_tx_ring[i]);
+ txq->sw_tx_ring[i] = NULL;
}
}
}
uint16_t idx;
idx = TX_CONS(txq);
- mbuf = txq->sw_tx_ring[idx].mbuf;
+ mbuf = txq->sw_tx_ring[idx];
if (mbuf) {
nb_segs = mbuf->nb_segs;
PMD_TX_LOG(DEBUG, txq, "nb_segs to free %u\n", nb_segs);
+
while (nb_segs) {
/* It's like consuming rxbuf in recv() */
ecore_chain_consume(&txq->tx_pbl);
nb_segs--;
}
rte_pktmbuf_free(mbuf);
- txq->sw_tx_ring[idx].mbuf = NULL;
+ txq->sw_tx_ring[idx] = NULL;
txq->sw_tx_cons++;
PMD_TX_LOG(DEBUG, txq, "Freed tx packet\n");
} else {
struct eth_tx_3rd_bd *bd3;
struct rte_mbuf *m_seg = NULL;
struct rte_mbuf *mbuf;
- struct qede_tx_entry *sw_tx_ring;
+ struct rte_mbuf **sw_tx_ring;
uint16_t nb_tx_pkts;
uint16_t bd_prod;
uint16_t idx;
/* Fill the entry in the SW ring and the BDs in the FW ring */
idx = TX_PROD(txq);
- sw_tx_ring[idx].mbuf = mbuf;
+ sw_tx_ring[idx] = mbuf;
/* BD1 */
bd1 = (struct eth_tx_1st_bd *)ecore_chain_produce(&txq->tx_pbl);
/* Fill the entry in the SW ring and the BDs in the FW ring */
idx = TX_PROD(txq);
- txq->sw_tx_ring[idx].mbuf = mbuf;
+ txq->sw_tx_ring[idx] = mbuf;
/* BD1 */
bd1 = (struct eth_tx_1st_bd *)ecore_chain_produce(&txq->tx_pbl);