From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id B20A91D343 for ; Fri, 6 Apr 2018 19:22:23 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1-us4.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id AFD9080065; Fri, 6 Apr 2018 17:22:22 +0000 (UTC) Received: from sfocexch01r.SolarFlarecom.com (10.20.40.34) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Fri, 6 Apr 2018 10:21:27 -0700 Received: from ocex03.SolarFlarecom.com (10.20.40.36) by sfocexch01r.SolarFlarecom.com (10.20.40.34) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Fri, 6 Apr 2018 10:21:25 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25 via Frontend Transport; Fri, 6 Apr 2018 10:21:24 -0700 Received: from uklogin.uk.solarflarecom.com (uklogin.uk.solarflarecom.com [10.17.10.10]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id w36HLN6l005973; Fri, 6 Apr 2018 18:21:23 +0100 Received: from uklogin.uk.solarflarecom.com (localhost.localdomain [127.0.0.1]) by uklogin.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id w36HLNKO024916; Fri, 6 Apr 2018 18:21:23 +0100 From: Andrew Rybchenko To: CC: Ivan Malov Date: Fri, 6 Apr 2018 18:21:18 +0100 Message-ID: <1523035280-24873-6-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1523035280-24873-1-git-send-email-arybchenko@solarflare.com> References: <1523035280-24873-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-MDID: 1523035343-P1GJ-VdpDrI7 Subject: [dpdk-dev] [PATCH 5/7] net/sfc: remove conditional compilation for RSS 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: , X-List-Received-Date: Fri, 06 Apr 2018 17:22:24 -0000 From: Ivan Malov RSS is one of the most valuable features in the driver, and one would hardly need to disable it at build time. This patch withdraws unnecessary conditionals for RSS snippets. Signed-off-by: Ivan Malov Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/sfc.c | 10 ---------- drivers/net/sfc/sfc.h | 4 ---- drivers/net/sfc/sfc_ethdev.c | 6 ------ drivers/net/sfc/sfc_flow.c | 10 ---------- drivers/net/sfc/sfc_flow.h | 4 ---- drivers/net/sfc/sfc_rx.c | 25 ------------------------- drivers/net/sfc/sfc_rx.h | 2 -- 7 files changed, 61 deletions(-) diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c index e456bca..a43b0b4 100644 --- a/drivers/net/sfc/sfc.c +++ b/drivers/net/sfc/sfc.c @@ -563,7 +563,6 @@ sfc_mem_bar_fini(struct sfc_adapter *sa) memset(ebp, 0, sizeof(*ebp)); } -#if EFSYS_OPT_RX_SCALE /* * A fixed RSS key which has a property of being symmetric * (symmetrical flows are distributed to the same CPU) @@ -577,9 +576,7 @@ static const uint8_t default_rss_key[EFX_RSS_KEY_SIZE] = { 0x6d, 0x5a, 0x6d, 0x5a, 0x6d, 0x5a, 0x6d, 0x5a, 0x6d, 0x5a, 0x6d, 0x5a, 0x6d, 0x5a, 0x6d, 0x5a, }; -#endif -#if EFSYS_OPT_RX_SCALE static int sfc_set_rss_defaults(struct sfc_adapter *sa) { @@ -626,13 +623,6 @@ sfc_set_rss_defaults(struct sfc_adapter *sa) fail_intr_init: return rc; } -#else -static int -sfc_set_rss_defaults(__rte_unused struct sfc_adapter *sa) -{ - return 0; -} -#endif int sfc_attach(struct sfc_adapter *sa) diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index 65a4df2..805f211 100644 --- a/drivers/net/sfc/sfc.h +++ b/drivers/net/sfc/sfc.h @@ -27,10 +27,8 @@ extern "C" { #endif -#if EFSYS_OPT_RX_SCALE /** RSS hash offloads mask */ #define SFC_RSS_OFFLOADS (ETH_RSS_IP | ETH_RSS_TCP) -#endif /* * +---------------+ @@ -227,13 +225,11 @@ struct sfc_adapter { unsigned int rss_channels; -#if EFSYS_OPT_RX_SCALE efx_rx_scale_context_type_t rss_support; efx_rx_hash_support_t hash_support; efx_rx_hash_type_t rss_hash_types; unsigned int rss_tbl[EFX_RSS_TBL_SIZE]; uint8_t rss_key[EFX_RSS_KEY_SIZE]; -#endif /* * Shared memory copy of the Rx datapath name to be used by diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 2af898e..4f26f60 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -152,13 +152,11 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) if (~sa->dp_tx->features & SFC_DP_TX_FEAT_REFCNT) dev_info->default_txconf.txq_flags |= ETH_TXQ_FLAGS_NOREFCOUNT; -#if EFSYS_OPT_RX_SCALE if (sa->rss_support != EFX_RX_SCALE_UNAVAILABLE) { dev_info->reta_size = EFX_RSS_TBL_SIZE; dev_info->hash_key_size = EFX_RSS_KEY_SIZE; dev_info->flow_type_rss_offloads = SFC_RSS_OFFLOADS; } -#endif /* Initialize to hardware limits */ dev_info->rx_desc_lim.nb_max = EFX_RXQ_MAXNDESCS; @@ -1347,7 +1345,6 @@ sfc_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, return sfc_dev_udp_tunnel_op(dev, tunnel_udp, SFC_UDP_TUNNEL_DEL_PORT); } -#if EFSYS_OPT_RX_SCALE static int sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf) @@ -1558,7 +1555,6 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev, SFC_ASSERT(rc >= 0); return -rc; } -#endif static int sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type, @@ -1653,12 +1649,10 @@ static const struct eth_dev_ops sfc_eth_dev_ops = { .mac_addr_set = sfc_mac_addr_set, .udp_tunnel_port_add = sfc_dev_udp_tunnel_port_add, .udp_tunnel_port_del = sfc_dev_udp_tunnel_port_del, -#if EFSYS_OPT_RX_SCALE .reta_update = sfc_dev_rss_reta_update, .reta_query = sfc_dev_rss_reta_query, .rss_hash_update = sfc_dev_rss_hash_update, .rss_hash_conf_get = sfc_dev_rss_hash_conf_get, -#endif .filter_ctrl = sfc_dev_filter_ctrl, .set_mc_addr_list = sfc_set_mc_addr_list, .rxq_info_get = sfc_rx_queue_info_get, diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c index b12a472..6f92086 100644 --- a/drivers/net/sfc/sfc_flow.c +++ b/drivers/net/sfc/sfc_flow.c @@ -1258,7 +1258,6 @@ sfc_flow_parse_queue(struct sfc_adapter *sa, return 0; } -#if EFSYS_OPT_RX_SCALE static int sfc_flow_parse_rss(struct sfc_adapter *sa, const struct rte_flow_action_rss *rss, @@ -1329,7 +1328,6 @@ sfc_flow_parse_rss(struct sfc_adapter *sa, return 0; } -#endif /* EFSYS_OPT_RX_SCALE */ static int sfc_flow_spec_flush(struct sfc_adapter *sa, struct sfc_flow_spec *spec, @@ -1379,7 +1377,6 @@ static int sfc_flow_filter_insert(struct sfc_adapter *sa, struct rte_flow *flow) { -#if EFSYS_OPT_RX_SCALE struct sfc_flow_rss *rss = &flow->rss_conf; uint32_t efs_rss_context = EFX_RSS_CONTEXT_DEFAULT; unsigned int i; @@ -1456,9 +1453,6 @@ sfc_flow_filter_insert(struct sfc_adapter *sa, fail_scale_context_alloc: return rc; -#else /* !EFSYS_OPT_RX_SCALE */ - return sfc_flow_spec_insert(sa, &flow->spec); -#endif /* EFSYS_OPT_RX_SCALE */ } static int @@ -1471,7 +1465,6 @@ sfc_flow_filter_remove(struct sfc_adapter *sa, if (rc != 0) return rc; -#if EFSYS_OPT_RX_SCALE if (flow->rss) { /* * All specifications for a given flow rule have the same RSS @@ -1482,7 +1475,6 @@ sfc_flow_filter_remove(struct sfc_adapter *sa, rc = efx_rx_scale_context_free(sa->nic, spec->efs_rss_context); } -#endif /* EFSYS_OPT_RX_SCALE */ return rc; } @@ -1529,7 +1521,6 @@ sfc_flow_parse_actions(struct sfc_adapter *sa, is_specified = B_TRUE; break; -#if EFSYS_OPT_RX_SCALE case RTE_FLOW_ACTION_TYPE_RSS: rc = sfc_flow_parse_rss(sa, actions->conf, flow); if (rc != 0) { @@ -1541,7 +1532,6 @@ sfc_flow_parse_actions(struct sfc_adapter *sa, is_specified = B_TRUE; break; -#endif /* EFSYS_OPT_RX_SCALE */ case RTE_FLOW_ACTION_TYPE_DROP: flow->spec.template.efs_dmaq_id = diff --git a/drivers/net/sfc/sfc_flow.h b/drivers/net/sfc/sfc_flow.h index 69dd683..71ec18c 100644 --- a/drivers/net/sfc/sfc_flow.h +++ b/drivers/net/sfc/sfc_flow.h @@ -26,7 +26,6 @@ extern "C" { */ #define SF_FLOW_SPEC_NB_FILTERS_MAX 8 -#if EFSYS_OPT_RX_SCALE /* RSS configuration storage */ struct sfc_flow_rss { unsigned int rxq_hw_index_min; @@ -35,7 +34,6 @@ struct sfc_flow_rss { uint8_t rss_key[EFX_RSS_KEY_SIZE]; unsigned int rss_tbl[EFX_RSS_TBL_SIZE]; }; -#endif /* EFSYS_OPT_RX_SCALE */ /* Filter specification storage */ struct sfc_flow_spec { @@ -50,10 +48,8 @@ struct sfc_flow_spec { /* PMD-specific definition of the opaque type from rte_flow.h */ struct rte_flow { struct sfc_flow_spec spec; /* flow spec for hardware filter(s) */ -#if EFSYS_OPT_RX_SCALE boolean_t rss; /* RSS toggle */ struct sfc_flow_rss rss_conf; /* RSS configuration */ -#endif /* EFSYS_OPT_RX_SCALE */ TAILQ_ENTRY(rte_flow) entries; /* flow list entries */ }; diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index fca3931..c30f230 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -184,7 +184,6 @@ sfc_efx_supported_ptypes_get(__rte_unused uint32_t tunnel_encaps) return ptypes; } -#if EFSYS_OPT_RX_SCALE static void sfc_efx_rx_set_rss_hash(struct sfc_efx_rxq *rxq, unsigned int flags, struct rte_mbuf *m) @@ -205,14 +204,6 @@ sfc_efx_rx_set_rss_hash(struct sfc_efx_rxq *rxq, unsigned int flags, m->ol_flags |= PKT_RX_RSS_HASH; } } -#else -static void -sfc_efx_rx_set_rss_hash(__rte_unused struct sfc_efx_rxq *rxq, - __rte_unused unsigned int flags, - __rte_unused struct rte_mbuf *m) -{ -} -#endif static uint16_t sfc_efx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) @@ -1068,10 +1059,8 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index, info.batch_max = encp->enc_rx_batch_max; info.prefix_size = encp->enc_rx_prefix_size; -#if EFSYS_OPT_RX_SCALE if (sa->hash_support == EFX_RX_HASH_AVAILABLE && sa->rss_channels > 0) info.flags |= SFC_RXQ_FLAG_RSS_HASH; -#endif info.rxq_entries = rxq_info->entries; info.rxq_hw_ring = rxq->mem.esm_base; @@ -1141,7 +1130,6 @@ sfc_rx_qfini(struct sfc_adapter *sa, unsigned int sw_index) rte_free(rxq); } -#if EFSYS_OPT_RX_SCALE efx_rx_hash_type_t sfc_rte_to_efx_hash_type(uint64_t rss_hf) { @@ -1185,9 +1173,7 @@ sfc_efx_to_rte_hash_type(efx_rx_hash_type_t efx_hash_types) return rss_hf; } -#endif -#if EFSYS_OPT_RX_SCALE static int sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa, struct rte_eth_rss_conf *conf) @@ -1248,13 +1234,6 @@ sfc_rx_rss_config(struct sfc_adapter *sa) finish: return rc; } -#else -static int -sfc_rx_rss_config(__rte_unused struct sfc_adapter *sa) -{ - return 0; -} -#endif int sfc_rx_start(struct sfc_adapter *sa) @@ -1337,14 +1316,12 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode) case ETH_MQ_RX_NONE: /* No special checks are required */ break; -#if EFSYS_OPT_RX_SCALE case ETH_MQ_RX_RSS: if (sa->rss_support == EFX_RX_SCALE_UNAVAILABLE) { sfc_err(sa, "RSS is not available"); rc = EINVAL; } break; -#endif default: sfc_err(sa, "Rx multi-queue mode %u not supported", rxmode->mq_mode); @@ -1446,7 +1423,6 @@ sfc_rx_configure(struct sfc_adapter *sa) sa->rxq_count++; } -#if EFSYS_OPT_RX_SCALE sa->rss_channels = (dev_conf->rxmode.mq_mode == ETH_MQ_RX_RSS) ? MIN(sa->rxq_count, EFX_MAXRSS) : 0; @@ -1462,7 +1438,6 @@ sfc_rx_configure(struct sfc_adapter *sa) if (rc != 0) goto fail_rx_process_adv_conf_rss; } -#endif done: return 0; diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h index 6706ee6..ea911be 100644 --- a/drivers/net/sfc/sfc_rx.h +++ b/drivers/net/sfc/sfc_rx.h @@ -152,10 +152,8 @@ unsigned int sfc_rx_qdesc_npending(struct sfc_adapter *sa, unsigned int sw_index); int sfc_rx_qdesc_done(struct sfc_dp_rxq *dp_rxq, unsigned int offset); -#if EFSYS_OPT_RX_SCALE efx_rx_hash_type_t sfc_rte_to_efx_hash_type(uint64_t rss_hf); uint64_t sfc_efx_to_rte_hash_type(efx_rx_hash_type_t efx_hash_types); -#endif #ifdef __cplusplus } -- 2.7.4