From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id BE7B091A0 for ; Wed, 4 Nov 2015 04:29:32 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 03 Nov 2015 19:29:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,241,1444719600"; d="scan'208";a="842078775" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 03 Nov 2015 19:29:22 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id tA43TKll003502; Wed, 4 Nov 2015 11:29:20 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tA43THHd011242; Wed, 4 Nov 2015 11:29:19 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id tA43THGN011238; Wed, 4 Nov 2015 11:29:17 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Wed, 4 Nov 2015 11:29:10 +0800 Message-Id: <1446607751-11194-3-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1446607751-11194-1-git-send-email-jingjing.wu@intel.com> References: <1446308653-2378-1-git-send-email-jingjing.wu@intel.com> <1446607751-11194-1-git-send-email-jingjing.wu@intel.com> Subject: [dpdk-dev] [PATCH v4 2/3] i40e: extend flow diretcor to support filtering in VFs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2015 03:29:33 -0000 This patch extends flow director to filtering in VFs. Signed-off-by: Jingjing Wu --- doc/guides/rel_notes/release_2_2.rst | 2 ++ drivers/net/i40e/i40e_fdir.c | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst index 7d2c2bb..69b3d9a 100644 --- a/doc/guides/rel_notes/release_2_2.rst +++ b/doc/guides/rel_notes/release_2_2.rst @@ -57,6 +57,8 @@ New Features * **Added fm10k vector RX/TX.** +* **Added i40e flow director support in VF.** + * **Added fm10k TSO support for both PF and VF.** * **Added fm10k VMDQ support.** diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index ba18c9d..0b45bd9 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); -- 2.4.0