src/dpdk/drivers/net/netvsc/hn_ethdev.c
static int hn_subchan_configure(struct hn_data *hv,
				uint32_t subchan)
{
	struct vmbus_channel *primary = hn_primary_chan(hv);
	int err;
	unsigned int retry = 0;

	PMD_DRV_LOG(DEBUG,
		    "open %u subchannels", subchan);

	/* Send create sub channels command */
	err = hn_nvs_alloc_subchans(hv, &subchan);
	if (err)
		return  err;

	while (subchan > 0) {
		struct vmbus_channel *new_sc;
		uint16_t chn_index;

		err = rte_vmbus_subchan_open(primary, &new_sc);
		if (err == -ENOENT && ++retry < 1000) {
			/* This can happen if not ready yet */
			rte_delay_ms(10);
			continue;
		}

		if (err) {
			PMD_DRV_LOG(ERR,
				    "open subchannel failed: %d", err);
			return err;
		}

		rte_vmbus_set_latency(hv->vmbus, new_sc, hv->latency);

		retry = 0;
		chn_index = rte_vmbus_sub_channel_index(new_sc);
		if (chn_index == 0 || chn_index > hv->max_queues) {
			PMD_DRV_LOG(ERR,
				    "Invalid subchannel offermsg channel %u",
				    chn_index);
			return -EIO;
		}

		PMD_DRV_LOG(DEBUG, "new sub channel %u", chn_index);
		hv->channels[chn_index] = new_sc;
		--subchan;
	}

	return err;
}
/* Setup shared rx/tx queue data */
Setup shared rx/tx queue data
Setup shared rx / tx queue data
static int hn_subchan_configure(struct hn_data *hv,
				uint32_t subchan)
{
	struct vmbus_channel *primary = hn_primary_chan(hv);
	int err;
	unsigned int retry = 0;
	PMD_DRV_LOG(DEBUG,
		    "open %u subchannels", subchan);
	err = hn_nvs_alloc_subchans(hv, &subchan);
	if (err)
		return  err;
	while (subchan > 0) {
		struct vmbus_channel *new_sc;
		uint16_t chn_index;
		err = rte_vmbus_subchan_open(primary, &new_sc);
		if (err == -ENOENT && ++retry < 1000) {
			rte_delay_ms(10);
			continue;
		}
		if (err) {
			PMD_DRV_LOG(ERR,
				    "open subchannel failed: %d", err);
			return err;
		}
		rte_vmbus_set_latency(hv->vmbus, new_sc, hv->latency);
		retry = 0;
		chn_index = rte_vmbus_sub_channel_index(new_sc);
		if (chn_index == 0 || chn_index > hv->max_queues) {
			PMD_DRV_LOG(ERR,
				    "Invalid subchannel offermsg channel %u",
				    chn_index);
			return -EIO;
		}
		PMD_DRV_LOG(DEBUG, "new sub channel %u", chn_index);
		hv->channels[chn_index] = new_sc;
		--subchan;
	}
	return err;
}
static int hn_subchan_configure ( struct hn_data * hv , uint32_t subchan ) { struct vmbus_channel * primary = hn_primary_chan ( hv ) ; int err ; unsigned int retry = 0 ; PMD_DRV_LOG ( DEBUG , " " , subchan ) ; err = hn_nvs_alloc_subchans ( hv , & subchan ) ; if ( err ) return err ; while ( subchan > 0 ) { struct vmbus_channel * new_sc ; uint16_t chn_index ; err = rte_vmbus_subchan_open ( primary , & new_sc ) ; if ( err == - ENOENT && ++ retry < 1000 ) { rte_delay_ms ( 10 ) ; continue ; } if ( err ) { PMD_DRV_LOG ( ERR , " " , err ) ; return err ; } rte_vmbus_set_latency ( hv -> vmbus , new_sc , hv -> latency ) ; retry = 0 ; chn_index = rte_vmbus_sub_channel_index ( new_sc ) ; if ( chn_index == 0 || chn_index > hv -> max_queues ) { PMD_DRV_LOG ( ERR , " " , chn_index ) ; return - EIO ; } PMD_DRV_LOG ( DEBUG , " " , chn_index ) ; hv -> channels [ chn_index ] = new_sc ; -- subchan ; } return err ; }
Setup shared rx/tx queue data
Setup shared rx / tx queue data
/* Send create sub channels command */ /* This can happen if not ready yet */