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 ECD69A04C0; Tue, 29 Sep 2020 10:11:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CCC5D1D945; Tue, 29 Sep 2020 10:10:30 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 1C4011D938 for ; Tue, 29 Sep 2020 10:10:26 +0200 (CEST) IronPort-SDR: YjtQHu5NfaxPPTYFqVn+acCFSqargwmJZoWna4iy+k0OwEoV9Dj3tbrQ3npdnUpxLQKyCNsyRO MMecj5DTMqfA== X-IronPort-AV: E=McAfee;i="6000,8403,9758"; a="159516221" X-IronPort-AV: E=Sophos;i="5.77,317,1596524400"; d="scan'208";a="159516221" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2020 01:10:23 -0700 IronPort-SDR: NsU0IVqiPyvg2IceZ9MvH5UVCpqyGYKbIvNnh3yf+FmY/v0QTkfs0MLA1If+2Mc1iBg00xMAZz /4rmuT8zaBhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,317,1596524400"; d="scan'208";a="345186740" Received: from unknown (HELO localhost.localdomain) ([10.239.255.61]) by fmsmga002.fm.intel.com with ESMTP; 29 Sep 2020 01:10:20 -0700 From: Chenxu Di To: dev@dpdk.org Cc: junyux.jiang@intel.com, shougangx.wang@intel.com, Wenzhuo Lu , Beilei Xing , Chenxu Di Date: Tue, 29 Sep 2020 07:53:30 +0000 Message-Id: <20200929075330.40201-1-chenxux.di@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [RFC 5/5] app/testpmd: add support for ixgbe FDIR configuration 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" As annouced in deprecation.rst, the "rte_eth_conf.fdir_conf" field will be removed, but IXGBE generic flow still needs to depend on these configurations. This patch adds setting FDIR configuration for IXGBE PMD by calling private API. Signed-off-by: Chenxu Di --- app/test-pmd/parameters.c | 63 ++++++++++++++++++++++++++++++++++++++- app/test-pmd/testpmd.c | 28 +++++++++++++++++ app/test-pmd/testpmd.h | 3 ++ 3 files changed, 93 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 8c2aa13dd..f9547a4d2 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -42,6 +42,9 @@ #ifdef RTE_LIBRTE_PMD_BOND #include #endif +#ifdef RTE_LIBRTE_IXGBE_PMD +#include +#endif #include #include "testpmd.h" @@ -935,6 +938,29 @@ launch_args_parse(int argc, char** argv) "none, signature, perfect, perfect-mac-vlan" " or perfect-tunnel\n", optarg); +#ifdef RTE_LIBRTE_IXGBE_PMD + if (!strcmp(optarg, "signature")) + ixgbe_fdir_conf.mode = + RTE_PMD_IXGBE_FDIR_MODE_SIGNATURE; + else if (!strcmp(optarg, "perfect")) + ixgbe_fdir_conf.mode = + RTE_PMD_IXGBE_FDIR_MODE_PERFECT; + else if (!strcmp(optarg, "perfect-mac-vlan")) + ixgbe_fdir_conf.mode = + RTE_PMD_IXGBE_FDIR_MODE_PERFECT_MAC_VLAN; + else if (!strcmp(optarg, "perfect-tunnel")) + ixgbe_fdir_conf.mode = + RTE_PMD_IXGBE_FDIR_MODE_PERFECT_TUNNEL; + else if (!strcmp(optarg, "none")) + ixgbe_fdir_conf.mode = + RTE_PMD_IXGBE_FDIR_MODE_NONE; + else + rte_exit(EXIT_FAILURE, + "pkt-mode-invalid %s invalid - must be: " + "none, signature, perfect, perfect-mac-vlan" + " or perfect-tunnel\n", + optarg); +#endif } if (!strcmp(lgopts[opt_idx].name, "pkt-filter-report-hash")) { @@ -952,6 +978,22 @@ launch_args_parse(int argc, char** argv) "pkt-filter-report-hash %s invalid " "- must be: none or match or always\n", optarg); +#ifdef RTE_LIBRTE_IXGBE_PMD + if (!strcmp(optarg, "none")) + ixgbe_fdir_conf.status = + RTE_PMD_IXGBE_FDIR_NO_REPORT_STATUS; + else if (!strcmp(optarg, "match")) + ixgbe_fdir_conf.status = + RTE_PMD_IXGBE_FDIR_REPORT_STATUS; + else if (!strcmp(optarg, "always")) + ixgbe_fdir_conf.status = + RTE_PMD_IXGBE_FDIR_REPORT_STATUS_ALWAYS; + else + rte_exit(EXIT_FAILURE, + "pkt-filter-report-hash %s invalid " + "- must be: none or match or always\n", + optarg); +#endif } if (!strcmp(lgopts[opt_idx].name, "pkt-filter-size")) { if (!strcmp(optarg, "64K")) @@ -967,12 +1009,31 @@ launch_args_parse(int argc, char** argv) rte_exit(EXIT_FAILURE, "pkt-filter-size %s invalid -" " must be: 64K or 128K or 256K\n", optarg); +#ifdef RTE_LIBRTE_IXGBE_PMD + if (!strcmp(optarg, "64K")) + ixgbe_fdir_conf.pballoc = + RTE_PMD_IXGBE_FDIR_PBALLOC_64K; + else if (!strcmp(optarg, "128K")) + ixgbe_fdir_conf.pballoc = + RTE_PMD_IXGBE_FDIR_PBALLOC_128K; + else if (!strcmp(optarg, "256K")) + ixgbe_fdir_conf.pballoc = + RTE_PMD_IXGBE_FDIR_PBALLOC_256K; + else + rte_exit(EXIT_FAILURE, "pkt-filter-size %s invalid -" + " must be: 64K or 128K or 256K\n", + optarg); +#endif } if (!strcmp(lgopts[opt_idx].name, "pkt-filter-drop-queue")) { n = atoi(optarg); - if (n >= 0) + if (n >= 0) { fdir_conf.drop_queue = (uint8_t) n; +#ifdef RTE_LIBRTE_IXGBE_PMD + ixgbe_fdir_conf.drop_queue = (uint8_t) n; +#endif + } else rte_exit(EXIT_FAILURE, "drop queue %d invalid - must" diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index ee3dd27d8..155063dbc 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -459,6 +459,31 @@ struct rte_fdir_conf fdir_conf = { .drop_queue = 127, }; +#ifdef RTE_LIBRTE_IXGBE_PMD +struct rte_pmd_ixgbe_fdir_conf ixgbe_fdir_conf = { + .mode = RTE_PMD_IXGBE_FDIR_MODE_NONE, + .pballoc = RTE_PMD_IXGBE_FDIR_PBALLOC_64K, + .status = RTE_PMD_IXGBE_FDIR_REPORT_STATUS, + .mask = { + .vlan_tci_mask = 0xFFEF, + .ipv4_mask = { + .src_ip = 0xFFFFFFFF, + .dst_ip = 0xFFFFFFFF, + }, + .ipv6_mask = { + .src_ip = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}, + .dst_ip = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}, + }, + .src_port_mask = 0xFFFF, + .dst_port_mask = 0xFFFF, + .mac_addr_byte_mask = 0xFF, + .tunnel_type_mask = 1, + .tunnel_id_mask = 0xFFFFFFFF, + }, + .drop_queue = 127, +}; +#endif + volatile int test_done = 1; /* stop packet forwarding when set to 1. */ struct queue_stats_mappings tx_queue_stats_mappings_array[MAX_TX_QUEUE_STATS_MAPPINGS]; @@ -3342,6 +3367,9 @@ init_port_config(void) RTE_ETH_FOREACH_DEV(pid) { port = &ports[pid]; port->dev_conf.fdir_conf = fdir_conf; +#ifdef RTE_LIBRTE_IXGBE_PMD + rte_pmd_ixgbe_update_fdir_conf(pid, ixgbe_fdir_conf); +#endif ret = eth_dev_info_get_print_err(pid, &port->dev_info); if (ret != 0) diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index f139fe7a0..8adb31b4f 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -409,6 +409,9 @@ extern uint8_t bitrate_enabled; #endif extern struct rte_fdir_conf fdir_conf; +#ifdef RTE_LIBRTE_IXGBE_PMD +extern struct rte_pmd_ixgbe_fdir_conf ixgbe_fdir_conf; +#endif /* * Configuration of packet segments used by the "txonly" processing engine. -- 2.17.1