From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6E145374D for ; Sat, 31 Oct 2015 17:24:38 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 31 Oct 2015 09:24:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,224,1444719600"; d="scan'208";a="823870867" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 31 Oct 2015 09:24:24 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t9VGOMq8022099; Sun, 1 Nov 2015 00:24:22 +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 t9VGOJbE002426; Sun, 1 Nov 2015 00:24:21 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9VGOJd6002422; Sun, 1 Nov 2015 00:24:19 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Sun, 1 Nov 2015 00:24:12 +0800 Message-Id: <1446308653-2378-3-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1446308653-2378-1-git-send-email-jingjing.wu@intel.com> References: <1446021688-17544-1-git-send-email-jingjing.wu@intel.com> <1446308653-2378-1-git-send-email-jingjing.wu@intel.com> Subject: [dpdk-dev] [PATCH v3 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: Sat, 31 Oct 2015 16:24:38 -0000 This patch extends flow director to filtering in VFs. It also corrects to disable interrupt on queues when stop device. Signed-off-by: Jingjing Wu --- doc/guides/rel_notes/release_2_2.rst | 2 ++ drivers/net/i40e/i40e_ethdev.c | 4 ++-- drivers/net/i40e/i40e_fdir.c | 15 ++++++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst index 8ca3872..908be5c 100644 --- a/doc/guides/rel_notes/release_2_2.rst +++ b/doc/guides/rel_notes/release_2_2.rst @@ -22,6 +22,8 @@ New Features * **Added i40e flow control support.** +* **Added i40e flow director support in VF.** + * **Added fm10k TSO support for both PF and VF.** * **New NIC Boulder Rapid support.** diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 016838a..b69c689 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1095,8 +1095,8 @@ i40e_dev_stop(struct rte_eth_dev *dev) } if (pf->fdir.fdir_vsi) { - i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi); - i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi); + i40e_vsi_queues_unbind_intr(pf->fdir.fdir_vsi); + i40e_vsi_disable_queues_intr(pf->fdir.fdir_vsi); } /* Clear all queues and release memory */ i40e_dev_clear_queues(dev); diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index c9ce98f..73a69c9 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