src/dpdk/drivers/net/netvsc/hn_rxtx.c
static int hn_flush_txagg(struct hn_tx_queue *txq, bool *need_sig)

{
	struct hn_txdesc *txd = txq->agg_txd;
	struct hn_nvs_rndis rndis;
	int ret;

	if (!txd)
		return 0;

	rndis = (struct hn_nvs_rndis) {
		.type = NVS_TYPE_RNDIS,
		.rndis_mtype = NVS_RNDIS_MTYPE_DATA,
		.chim_idx = txd->chim_index,
		.chim_sz = txd->chim_size,
	};

	PMD_TX_LOG(DEBUG, "port %u:%u tx %u size %u",
		   txq->port_id, txq->queue_id, txd->chim_index, txd->chim_size);

	ret = hn_nvs_send(txq->chan, VMBUS_CHANPKT_FLAG_RC,
			  &rndis, sizeof(rndis), (uintptr_t)txd, need_sig);

	if (likely(ret == 0))
		hn_reset_txagg(txq);
	else if (ret == -EAGAIN) {
		PMD_TX_LOG(DEBUG, "port %u:%u channel full",
			   txq->port_id, txq->queue_id);
		++txq->stats.channel_full;
	} else {
		++txq->stats.errors;

		PMD_DRV_LOG(NOTICE, "port %u:%u send failed: %d",
			   txq->port_id, txq->queue_id, ret);
	}
	return ret;
}
/*
 * Send pending aggregated data in chimney buffer (if any).
 * Returns error if send was unsuccessful because channel ring buffer
 * was full.
 */
Send pending aggregated data in chimney buffer (if any).
Returns error if send was unsuccessful because channel ring buffer
was full.
Send pending aggregated data in chimney buffer ( if any ) . Returns error if send was unsuccessful because channel ring buffer was full .
static int hn_flush_txagg(struct hn_tx_queue *txq, bool *need_sig)
{
	struct hn_txdesc *txd = txq->agg_txd;
	struct hn_nvs_rndis rndis;
	int ret;
	if (!txd)
		return 0;
	rndis = (struct hn_nvs_rndis) {
		.type = NVS_TYPE_RNDIS,
		.rndis_mtype = NVS_RNDIS_MTYPE_DATA,
		.chim_idx = txd->chim_index,
		.chim_sz = txd->chim_size,
	};
	PMD_TX_LOG(DEBUG, "port %u:%u tx %u size %u",
		   txq->port_id, txq->queue_id, txd->chim_index, txd->chim_size);
	ret = hn_nvs_send(txq->chan, VMBUS_CHANPKT_FLAG_RC,
			  &rndis, sizeof(rndis), (uintptr_t)txd, need_sig);
	if (likely(ret == 0))
		hn_reset_txagg(txq);
	else if (ret == -EAGAIN) {
		PMD_TX_LOG(DEBUG, "port %u:%u channel full",
			   txq->port_id, txq->queue_id);
		++txq->stats.channel_full;
	} else {
		++txq->stats.errors;
		PMD_DRV_LOG(NOTICE, "port %u:%u send failed: %d",
			   txq->port_id, txq->queue_id, ret);
	}
	return ret;
}
static int hn_flush_txagg ( struct hn_tx_queue * txq , bool * need_sig ) { struct hn_txdesc * txd = txq -> agg_txd ; struct hn_nvs_rndis rndis ; int ret ; if ( ! txd ) return 0 ; rndis = ( struct hn_nvs_rndis ) { . type = NVS_TYPE_RNDIS , . rndis_mtype = NVS_RNDIS_MTYPE_DATA , . chim_idx = txd -> chim_index , . chim_sz = txd -> chim_size , } ; PMD_TX_LOG ( DEBUG , " " , txq -> port_id , txq -> queue_id , txd -> chim_index , txd -> chim_size ) ; ret = hn_nvs_send ( txq -> chan , VMBUS_CHANPKT_FLAG_RC , & rndis , sizeof ( rndis ) , ( uintptr_t ) txd , need_sig ) ; if ( likely ( ret == 0 ) ) hn_reset_txagg ( txq ) ; else if ( ret == - EAGAIN ) { PMD_TX_LOG ( DEBUG , " " , txq -> port_id , txq -> queue_id ) ; ++ txq -> stats . channel_full ; } else { ++ txq -> stats . errors ; PMD_DRV_LOG ( NOTICE , " " , txq -> port_id , txq -> queue_id , ret ) ; } return ret ; }
Send pending aggregated data in chimney buffer (if any).
Send pending aggregated data in chimney buffer ( if any ) .