src/dpdk/drivers/net/cxgbe/cxgbevf_main.c
static void size_nports_qsets(struct adapter *adapter)
{
	struct vf_resources *vfres = &adapter->params.vfres;
	unsigned int pmask_nports;

	/*
	 * The number of "ports" which we support is equal to the number of
	 * Virtual Interfaces with which we've been provisioned.
	 */
	adapter->params.nports = vfres->nvi;
	if (adapter->params.nports > MAX_NPORTS) {
		dev_warn(adapter->pdev_dev, "only using %d of %d maximum"
			 " allowed virtual interfaces\n", MAX_NPORTS,
			 adapter->params.nports);
		adapter->params.nports = MAX_NPORTS;
	}

	/*
	 * We may have been provisioned with more VIs than the number of
	 * ports we're allowed to access (our Port Access Rights Mask).
	 * This is obviously a configuration conflict but we don't want to
	 * do anything silly just because of that.
	 */
	pmask_nports = hweight32(adapter->params.vfres.pmask);
	if (pmask_nports < adapter->params.nports) {
		dev_warn(adapter->pdev_dev, "only using %d of %d provissioned"
			 " virtual interfaces; limited by Port Access Rights"
			 " mask %#x\n", pmask_nports, adapter->params.nports,
			 adapter->params.vfres.pmask);
		adapter->params.nports = pmask_nports;
	}

	cxgbe_configure_max_ethqsets(adapter);
	if (adapter->sge.max_ethqsets < adapter->params.nports) {
		dev_warn(adapter->pdev_dev, "only using %d of %d available"
			 " virtual interfaces (too few Queue Sets)\n",
			 adapter->sge.max_ethqsets, adapter->params.nports);
		adapter->params.nports = adapter->sge.max_ethqsets;
	}
}
/*
 * Figure out how many Ports and Queue Sets we can support.  This depends on
 * knowing our Virtual Function Resources and may be called a second time if
 * we fall back from MSI-X to MSI Interrupt Mode.
 */
Figure out how many Ports and Queue Sets we can support.  This depends on
knowing our Virtual Function Resources and may be called a second time if
we fall back from MSI-X to MSI Interrupt Mode.
Figure out how many Ports and Queue Sets we can support . This depends on knowing our Virtual Function Resources and may be called a second time if we fall back from MSI - X to MSI Interrupt Mode .
static void size_nports_qsets(struct adapter *adapter)
{
	struct vf_resources *vfres = &adapter->params.vfres;
	unsigned int pmask_nports;
	adapter->params.nports = vfres->nvi;
	if (adapter->params.nports > MAX_NPORTS) {
		dev_warn(adapter->pdev_dev, "only using %d of %d maximum"
			 " allowed virtual interfaces\n", MAX_NPORTS,
			 adapter->params.nports);
		adapter->params.nports = MAX_NPORTS;
	}
	pmask_nports = hweight32(adapter->params.vfres.pmask);
	if (pmask_nports < adapter->params.nports) {
		dev_warn(adapter->pdev_dev, "only using %d of %d provissioned"
			 " virtual interfaces; limited by Port Access Rights"
			 " mask %#x\n", pmask_nports, adapter->params.nports,
			 adapter->params.vfres.pmask);
		adapter->params.nports = pmask_nports;
	}
	cxgbe_configure_max_ethqsets(adapter);
	if (adapter->sge.max_ethqsets < adapter->params.nports) {
		dev_warn(adapter->pdev_dev, "only using %d of %d available"
			 " virtual interfaces (too few Queue Sets)\n",
			 adapter->sge.max_ethqsets, adapter->params.nports);
		adapter->params.nports = adapter->sge.max_ethqsets;
	}
}
static void size_nports_qsets ( struct adapter * adapter ) { struct vf_resources * vfres = & adapter -> params . vfres ; unsigned int pmask_nports ; adapter -> params . nports = vfres -> nvi ; if ( adapter -> params . nports > MAX_NPORTS ) { dev_warn ( adapter -> pdev_dev , " " " \n " , MAX_NPORTS , adapter -> params . nports ) ; adapter -> params . nports = MAX_NPORTS ; } pmask_nports = hweight32 ( adapter -> params . vfres . pmask ) ; if ( pmask_nports < adapter -> params . nports ) { dev_warn ( adapter -> pdev_dev , " " " " " \n " , pmask_nports , adapter -> params . nports , adapter -> params . vfres . pmask ) ; adapter -> params . nports = pmask_nports ; } cxgbe_configure_max_ethqsets ( adapter ) ; if ( adapter -> sge . max_ethqsets < adapter -> params . nports ) { dev_warn ( adapter -> pdev_dev , " " " \n " , adapter -> sge . max_ethqsets , adapter -> params . nports ) ; adapter -> params . nports = adapter -> sge . max_ethqsets ; } }
Figure out how many Ports and Queue Sets we can support.
Figure out how many Ports and Queue Sets we can support .
/*
	 * The number of "ports" which we support is equal to the number of
	 * Virtual Interfaces with which we've been provisioned.
	 */ /*
	 * We may have been provisioned with more VIs than the number of
	 * ports we're allowed to access (our Port Access Rights Mask).
	 * This is obviously a configuration conflict but we don't want to
	 * do anything silly just because of that.
	 */