From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0D1FAA0562; Tue, 31 Mar 2020 10:16:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A6ED91C0CF; Tue, 31 Mar 2020 10:16:15 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 4AD691C0CC for ; Tue, 31 Mar 2020 10:16:09 +0200 (CEST) IronPort-SDR: M4RLDCzmzw0GNkPEEry9LJR4N+Ta+iX4Hp49rqT5NayCzQOT1rYjXgAyQ4hOCheClme2D4Uxba XEj388SdBL2A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2020 01:16:08 -0700 IronPort-SDR: +d6SWSQxm9fuKi2by/3dJYF+89H1XXjzCIPjBYyCluxrhuiX123DWljoY16PN1BwBRx/cQv4tD nnApzWsu+h+w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="450083040" Received: from dpdk-lrong-srv-04.sh.intel.com ([10.67.119.221]) by fmsmga006.fm.intel.com with ESMTP; 31 Mar 2020 01:16:06 -0700 From: Leyi Rong To: jingjing.wu@intel.com, qi.z.zhang@intel.com, beilei.xing@intel.com, xiaolong.ye@intel.com Cc: dev@dpdk.org, Leyi Rong Date: Tue, 31 Mar 2020 16:02:28 +0800 Message-Id: <20200331080233.17154-8-leyi.rong@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200331080233.17154-1-leyi.rong@intel.com> References: <20200316074603.10998-1-leyi.rong@intel.com> <20200331080233.17154-1-leyi.rong@intel.com> Subject: [dpdk-dev] [PATCH v2 07/12] net/iavf: add flow director enabled switch value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The commit adds fdir_enabled flag into iavf_adapter structure to identify if fdir id is active. Rx data path can be benefit if fdir id parsing is not needed, especially in vector path. Signed-off-by: Leyi Rong --- drivers/net/iavf/iavf.h | 1 + drivers/net/iavf/iavf_rxtx.h | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index 4fe15237a..1918a67f1 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h @@ -142,6 +142,7 @@ struct iavf_adapter { bool tx_vec_allowed; const uint32_t *ptype_tbl; bool stopped; + uint8_t fdir_enabled; }; /* IAVF_DEV_PRIVATE_TO */ diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h index 290dd68c1..b4f4c5131 100644 --- a/drivers/net/iavf/iavf_rxtx.h +++ b/drivers/net/iavf/iavf_rxtx.h @@ -490,6 +490,32 @@ void iavf_dump_tx_descriptor(const struct iavf_tx_queue *txq, tx_desc->cmd_type_offset_bsz); } +/* Enable/disable flow director Rx processing in data path. */ +static inline +void iavf_fdir_rx_proc_enable(struct iavf_adapter *ad, bool on) +{ + static uint32_t ref_cnt; + + if (on) { + /* enable flow director processing */ + if (ref_cnt++ == 0) { + ad->fdir_enabled = on; + PMD_DRV_LOG(DEBUG, + "FDIR processing on RX set to %d", on); + } + } else { + if (ref_cnt >= 1) { + ref_cnt--; + + if (ref_cnt == 0) { + ad->fdir_enabled = on; + PMD_DRV_LOG(DEBUG, + "FDIR processing on RX set to %d", on); + } + } + } +} + #ifdef RTE_LIBRTE_IAVF_DEBUG_DUMP_DESC #define IAVF_DUMP_RX_DESC(rxq, desc, rx_id) \ iavf_dump_rx_descriptor(rxq, desc, rx_id) -- 2.17.1