summaryrefslogtreecommitdiff
path: root/drivers/net/i40e/i40e_pf.c
diff options
context:
space:
mode:
authorZhe Tao <zhe.tao@intel.com>2016-06-29 21:06:02 +0800
committerBruce Richardson <bruce.richardson@intel.com>2016-06-29 17:28:21 +0200
commit440499cf53764eb1703c6becd180a907e73121ac (patch)
tree5b4a50acc7bc1a6fe832aa79fcf48e4ff17f7f20 /drivers/net/i40e/i40e_pf.c
parent16dba07133bd354adc9e99223595dffbbe8f1649 (diff)
downloaddpdk-440499cf53764eb1703c6becd180a907e73121ac.zip
dpdk-440499cf53764eb1703c6becd180a907e73121ac.tar.gz
dpdk-440499cf53764eb1703c6becd180a907e73121ac.tar.xz
net/i40e: support floating VEB
The standard Virtual Ethernet Bridge(VEB) definition in 1Qbg is a bridge which has an uplink port to the outside world (maybe another bridge), but a "floating" VEB is a special VEB without an uplink port to the outside. Instead, traffic can be sent from one VF to another using the floating VEB - even when the physical link on the NIC port is down. VFs VSIs connect either to the standard VEB/VEPA or to the floating VEB, they cannot connect to both of them. The PF, VMDQ and FD VSIs still connect to the normal VEB/VEPA. Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Diffstat (limited to 'drivers/net/i40e/i40e_pf.c')
-rw-r--r--drivers/net/i40e/i40e_pf.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index af94674..d5b2d45 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -124,6 +124,7 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset)
{
uint32_t val, i;
struct i40e_hw *hw;
+ struct i40e_pf *pf;
uint16_t vf_id, abs_vf_id, vf_msix_num;
int ret;
struct i40e_virtchnl_queue_select qsel;
@@ -131,6 +132,7 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset)
if (vf == NULL)
return -EINVAL;
+ pf = vf->pf;
hw = I40E_PF_TO_HW(vf->pf);
vf_id = vf->vf_idx;
abs_vf_id = vf_id + hw->func_caps.vf_base_id;
@@ -225,8 +227,14 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset)
I40E_WRITE_FLUSH(hw);
/* Allocate resource again */
- vf->vsi = i40e_vsi_setup(vf->pf, I40E_VSI_SRIOV,
- vf->pf->main_vsi, vf->vf_idx);
+ if (pf->floating_veb && pf->floating_veb_list[vf_id]) {
+ vf->vsi = i40e_vsi_setup(vf->pf, I40E_VSI_SRIOV,
+ NULL, vf->vf_idx);
+ } else {
+ vf->vsi = i40e_vsi_setup(vf->pf, I40E_VSI_SRIOV,
+ vf->pf->main_vsi, vf->vf_idx);
+ }
+
if (vf->vsi == NULL) {
PMD_DRV_LOG(ERR, "Add vsi failed");
return -EFAULT;