#include "base/hinic_pmd_hwif.h"
#include "base/hinic_pmd_wq.h"
#include "base/hinic_pmd_nicio.h"
+#include "base/hinic_pmd_niccfg.h"
#include "hinic_pmd_ethdev.h"
#include "hinic_pmd_tx.h"
i = 0;
for (sge_idx = sges; (u64)sge_idx <= txq->sq_bot_sge_addr;
sge_idx++) {
+ if (unlikely(mbuf == NULL)) {
+ txq->txq_stats.mbuf_null++;
+ return false;
+ }
+
dma_addr = rte_mbuf_data_iova(mbuf);
+ if (unlikely(mbuf->data_len == 0)) {
+ txq->txq_stats.sge_len0++;
+ return false;
+ }
hinic_set_sge((struct hinic_sge *)sge_idx, dma_addr,
mbuf->data_len);
mbuf = mbuf->next;
sge_idx = (struct hinic_sq_bufdesc *)
((void *)txq->sq_head_addr);
for (; i < nb_segs; i++) {
+ if (unlikely(mbuf == NULL)) {
+ txq->txq_stats.mbuf_null++;
+ return false;
+ }
+
dma_addr = rte_mbuf_data_iova(mbuf);
+ if (unlikely(mbuf->data_len == 0)) {
+ txq->txq_stats.sge_len0++;
+ return false;
+ }
hinic_set_sge((struct hinic_sge *)sge_idx, dma_addr,
mbuf->data_len);
mbuf = mbuf->next;
} else {
/* wqe is in continuous space */
for (i = 0; i < nb_segs; i++) {
+ if (unlikely(mbuf == NULL)) {
+ txq->txq_stats.mbuf_null++;
+ return false;
+ }
+
dma_addr = rte_mbuf_data_iova(mbuf);
+ if (unlikely(mbuf->data_len == 0)) {
+ txq->txq_stats.sge_len0++;
+ return false;
+ }
hinic_set_sge((struct hinic_sge *)sge_idx, dma_addr,
mbuf->data_len);
mbuf = mbuf->next;
/* deal with the last mbuf */
dma_addr = rte_mbuf_data_iova(mbuf);
+ if (unlikely(mbuf->data_len == 0)) {
+ txq->txq_stats.sge_len0++;
+ return false;
+ }
hinic_set_sge((struct hinic_sge *)sge_idx, dma_addr,
mbuf->data_len);
if (unlikely(sqe_info->around))
HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
for (q_id = 0; q_id < nic_dev->num_sq; q_id++) {
- eth_dev->data->tx_queues[q_id] = NULL;
+ if (eth_dev->data->tx_queues != NULL)
+ eth_dev->data->tx_queues[q_id] = NULL;
if (nic_dev->txqs[q_id] == NULL)
continue;