From: Jingjing Wu Date: Wed, 4 Nov 2015 03:29:10 +0000 (+0800) Subject: i40e: extend flow director to support VF X-Git-Tag: spdx-start~8134 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=88ebc2b7f976;p=dpdk.git i40e: extend flow director to support VF This patch extends flow director to filtering in VFs. Signed-off-by: Jingjing Wu --- diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst index 76a1640355..0c7abe995a 100644 --- a/doc/guides/rel_notes/release_2_2.rst +++ b/doc/guides/rel_notes/release_2_2.rst @@ -55,6 +55,8 @@ New Features * **Added different GRE key length for input set on Intel X710/XL710.** +* **Added flow director support in i40e VF.** + * **Added fm10k vector RX/TX.** * **Added fm10k TSO support for both PF and VF.** diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index ba18c9d77c..0b45bd90fb 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -1022,6 +1022,11 @@ i40e_add_del_fdir_filter(struct rte_eth_dev *dev, PMD_DRV_LOG(ERR, "Invalid queue ID"); return -EINVAL; } + if (filter->input.flow_ext.is_vf && + filter->input.flow_ext.dst_id >= pf->vf_num) { + PMD_DRV_LOG(ERR, "Invalid VF ID"); + return -EINVAL; + } memset(pkt, 0, I40E_FDIR_PKT_LEN); @@ -1061,7 +1066,7 @@ i40e_fdir_filter_programming(struct i40e_pf *pf, volatile struct i40e_tx_desc *txdp; volatile struct i40e_filter_program_desc *fdirdp; uint32_t td_cmd; - uint16_t i; + uint16_t vsi_id, i; uint8_t dest; PMD_DRV_LOG(INFO, "filling filter programming descriptor."); @@ -1083,9 +1088,13 @@ i40e_fdir_filter_programming(struct i40e_pf *pf, I40E_TXD_FLTR_QW0_PCTYPE_SHIFT) & I40E_TXD_FLTR_QW0_PCTYPE_MASK); - /* Use LAN VSI Id by default */ + if (filter->input.flow_ext.is_vf) + vsi_id = pf->vfs[filter->input.flow_ext.dst_id].vsi->vsi_id; + else + /* Use LAN VSI Id by default */ + vsi_id = pf->main_vsi->vsi_id; fdirdp->qindex_flex_ptype_vsi |= - rte_cpu_to_le_32((pf->main_vsi->vsi_id << + rte_cpu_to_le_32((vsi_id << I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT) & I40E_TXD_FLTR_QW0_DEST_VSI_MASK);