From patchwork Tue Aug 1 16:53:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Mazarguil X-Patchwork-Id: 27316 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 329D79B9B; Tue, 1 Aug 2017 18:55:04 +0200 (CEST) Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by dpdk.org (Postfix) with ESMTP id F2FAF9165 for ; Tue, 1 Aug 2017 18:54:55 +0200 (CEST) Received: by mail-wr0-f179.google.com with SMTP id f21so9172866wrf.5 for ; Tue, 01 Aug 2017 09:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=31NcU470NdXJVVOfwh00kNPNFpsfD2VkK95CtYQKDhY=; b=cdTyIZiL4IOf0rWXJuNt55B0XxzroV3XZX3wQWLLL5hNNG4fW4/DXFQxrOsR0SQjHJ jp1nvF4TwIe8FNCScdVnCKjfxblL8JP+q8qLxiEhOBuNAgzeUoMDcbN8iBj5pQeSPyLB x5Esur1zKl32NSIAjVIwLQ/mzDW3HGtoGx1FhF0E3rxaQZeIryuBOGnDelcPLkoG+5td +y5BYfoq9U4VgzG4hoGLkVk0sl+xWomvvHsctPICdpFY0cydTfclHLIN+VL33riCoMu9 iz9NFXEBJ29IC653nL7uVXFvVxcgbVFaCnlka9C2y1GcPUnsQB83MvyNCtSXmsAFH64b KTtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=31NcU470NdXJVVOfwh00kNPNFpsfD2VkK95CtYQKDhY=; b=BmZpLMA6dgdaywGIj7oQmCfGY3cmAXN5B76sMfZQni0RqSf2F7cnAMfMCebr0v4j8a CKkS6+lEBBG2s3otd+TAvehjCfYgoWdyaxFXaMUsGYM46j3Hb/51o52sIE7tgz6gW86b fc3LvVFN2L1idQ9/k2gdiRZD0kC0FJyu2LFQGB0ASsXaEzfwNzA3kaBtfW681SAOtNHH sJvQyWlgRPVhMqBKefzhthmWNHBZJo67T5Ba931xr0jlIvXLsCNvlEaOwMgdQlosc6ts PQbFfzwnQjNeZ5x5kpAPmKFWKIOq7p26psHjWKxwzNkz15Ca/e5lK4A1oMmDFmw2ICfR gIfA== X-Gm-Message-State: AIVw111zcfnqY6/1bqq2dj7PE9aFCYEMZWGt4hiTCDouiAHuQcPeSXZ0 5HBSuq76DJz4LtSU20k= X-Received: by 10.223.162.217 with SMTP id t25mr15792599wra.68.1501606495180; Tue, 01 Aug 2017 09:54:55 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id l1sm1724559wmb.20.2017.08.01.09.54.54 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 01 Aug 2017 09:54:54 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Tue, 1 Aug 2017 18:53:51 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v1 04/48] net/mlx4: remove useless compilation checks 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" Verbs support for RSS, inline receive and extended device query calls has not been optional for a while. Their absence is untested and is therefore unsupported. Remove the related compilation checks and assume Mellanox OFED is up to date, as described in the documentation. Use this opportunity to remove a few useless data path debugging messages behind compilation checks on never defined macros. Signed-off-by: Adrien Mazarguil --- drivers/net/mlx4/Makefile | 12 ------------ drivers/net/mlx4/mlx4.c | 35 ----------------------------------- drivers/net/mlx4/mlx4.h | 2 -- drivers/net/mlx4/mlx4_flow.c | 3 --- 4 files changed, 52 deletions(-) diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile index ce4b244..ab2a867 100644 --- a/drivers/net/mlx4/Makefile +++ b/drivers/net/mlx4/Makefile @@ -100,18 +100,6 @@ mlx4_autoconf.h.new: FORCE mlx4_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh $Q $(RM) -f -- '$@' $Q sh -- '$<' '$@' \ - RSS_SUPPORT \ - infiniband/verbs.h \ - enum IBV_EXP_DEVICE_UD_RSS $(AUTOCONF_OUTPUT) - $Q sh -- '$<' '$@' \ - INLINE_RECV \ - infiniband/verbs.h \ - enum IBV_EXP_DEVICE_ATTR_INLINE_RECV_SZ $(AUTOCONF_OUTPUT) - $Q sh -- '$<' '$@' \ - HAVE_EXP_QUERY_DEVICE \ - infiniband/verbs.h \ - type 'struct ibv_exp_device_attr' $(AUTOCONF_OUTPUT) - $Q sh -- '$<' '$@' \ HAVE_EXP_QP_BURST_CREATE_DISABLE_ETH_LOOPBACK \ infiniband/verbs.h \ enum IBV_EXP_QP_BURST_CREATE_DISABLE_ETH_LOOPBACK \ diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index e28928c..e6fc204 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -1103,10 +1103,6 @@ txq_complete(struct txq *txq) if (unlikely(elts_comp == 0)) return 0; -#ifdef DEBUG_SEND - DEBUG("%p: processing %u work requests completions", - (void *)txq, elts_comp); -#endif wcs_n = txq->if_cq->poll_cnt(txq->cq, elts_comp); if (unlikely(wcs_n == 0)) return 0; @@ -3155,9 +3151,6 @@ mlx4_rx_burst_sp(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) return 0; *next = NULL; /* Repost WRs. */ -#ifdef DEBUG_RECV - DEBUG("%p: reposting %d WRs", (void *)rxq, i); -#endif ret = ibv_post_recv(rxq->qp, head.next, &bad_wr); if (unlikely(ret)) { /* Inability to repost WRs is fatal. */ @@ -3318,9 +3311,6 @@ mlx4_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) if (unlikely(i == 0)) return 0; /* Repost WRs. */ -#ifdef DEBUG_RECV - DEBUG("%p: reposting %u WRs", (void *)rxq, i); -#endif ret = rxq->if_qp->recv_burst(rxq->qp, sges, i); if (unlikely(ret)) { /* Inability to repost WRs is fatal. */ @@ -3418,15 +3408,11 @@ rxq_setup_qp(struct priv *priv, struct ibv_cq *cq, uint16_t desc, .res_domain = rd, }; -#ifdef INLINE_RECV attr.max_inl_recv = priv->inl_recv_size; attr.comp_mask |= IBV_EXP_QP_INIT_ATTR_INL_RECV; -#endif return ibv_exp_create_qp(priv->ctx, &attr); } -#ifdef RSS_SUPPORT - /** * Allocate a RSS Queue Pair. * Optionally setup inline receive if supported. @@ -3474,10 +3460,8 @@ rxq_setup_qp_rss(struct priv *priv, struct ibv_cq *cq, uint16_t desc, .res_domain = rd, }; -#ifdef INLINE_RECV attr.max_inl_recv = priv->inl_recv_size, attr.comp_mask |= IBV_EXP_QP_INIT_ATTR_INL_RECV; -#endif if (children_n > 0) { attr.qpg.qpg_type = IBV_EXP_QPG_PARENT; /* TSS isn't necessary. */ @@ -3493,8 +3477,6 @@ rxq_setup_qp_rss(struct priv *priv, struct ibv_cq *cq, uint16_t desc, return ibv_exp_create_qp(priv->ctx, &attr); } -#endif /* RSS_SUPPORT */ - /** * Reconfigure a RX queue with new parameters. * @@ -3728,13 +3710,11 @@ rxq_create_qp(struct rxq *rxq, int parent = (children_n > 0); struct priv *priv = rxq->priv; -#ifdef RSS_SUPPORT if (priv->rss && !inactive && (rxq_parent || parent)) rxq->qp = rxq_setup_qp_rss(priv, rxq->cq, desc, children_n, rxq->rd, rxq_parent); else -#endif /* RSS_SUPPORT */ rxq->qp = rxq_setup_qp(priv, rxq->cq, desc, rxq->rd); if (rxq->qp == NULL) { ret = (errno ? errno : EINVAL); @@ -3750,9 +3730,7 @@ rxq_create_qp(struct rxq *rxq, }; ret = ibv_exp_modify_qp(rxq->qp, &mod, (IBV_EXP_QP_STATE | -#ifdef RSS_SUPPORT (parent ? IBV_EXP_QP_GROUP_RSS : 0) | -#endif /* RSS_SUPPORT */ IBV_EXP_QP_PORT)); if (ret) { ERROR("QP state to IBV_QPS_INIT failed: %s", @@ -6109,20 +6087,14 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) struct ibv_pd *pd = NULL; struct priv *priv = NULL; struct rte_eth_dev *eth_dev = NULL; -#ifdef HAVE_EXP_QUERY_DEVICE struct ibv_exp_device_attr exp_device_attr; -#endif /* HAVE_EXP_QUERY_DEVICE */ struct ether_addr mac; /* If port is not enabled, skip. */ if (!(conf.ports.enabled & (1 << i))) continue; -#ifdef HAVE_EXP_QUERY_DEVICE exp_device_attr.comp_mask = IBV_EXP_DEVICE_ATTR_EXP_CAP_FLAGS; -#ifdef RSS_SUPPORT exp_device_attr.comp_mask |= IBV_EXP_DEVICE_ATTR_RSS_TBL_SZ; -#endif /* RSS_SUPPORT */ -#endif /* HAVE_EXP_QUERY_DEVICE */ DEBUG("using port %u", port); @@ -6175,13 +6147,11 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) priv->port = port; priv->pd = pd; priv->mtu = ETHER_MTU; -#ifdef HAVE_EXP_QUERY_DEVICE if (ibv_exp_query_device(ctx, &exp_device_attr)) { ERROR("ibv_exp_query_device() failed"); err = ENODEV; goto port_error; } -#ifdef RSS_SUPPORT if ((exp_device_attr.exp_device_cap_flags & IBV_EXP_DEVICE_QPG) && (exp_device_attr.exp_device_cap_flags & @@ -6206,7 +6176,6 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) if (priv->hw_rss) DEBUG("maximum RSS indirection table size: %u", exp_device_attr.max_rss_tbl_sz); -#endif /* RSS_SUPPORT */ priv->hw_csum = ((exp_device_attr.exp_device_cap_flags & @@ -6221,7 +6190,6 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) DEBUG("L2 tunnel checksum offloads are %ssupported", (priv->hw_csum_l2tun ? "" : "not ")); -#ifdef INLINE_RECV priv->inl_recv_size = mlx4_getenv_int("MLX4_INLINE_RECV_SIZE"); if (priv->inl_recv_size) { @@ -6245,10 +6213,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) INFO("Set inline receive size to %u", priv->inl_recv_size); } -#endif /* INLINE_RECV */ -#endif /* HAVE_EXP_QUERY_DEVICE */ - (void)mlx4_getenv_int; priv->vf = vf; /* Configure the first MAC address by default. */ if (priv_get_mac(priv, &mac.addr_bytes)) { diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index 25a7212..557b94d 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h @@ -338,9 +338,7 @@ struct priv { unsigned int vf:1; /* This is a VF device. */ unsigned int pending_alarm:1; /* An alarm is pending. */ unsigned int isolated:1; /* Toggle isolated mode. */ -#ifdef INLINE_RECV unsigned int inl_recv_size; /* Inline recv size */ -#endif unsigned int max_rss_tbl_sz; /* Maximum number of RSS queues. */ /* RX/TX queues. */ unsigned int rxqs_n; /* RX queues array size. */ diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index ab37e7d..f5c015e 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -37,9 +37,6 @@ #include #include -/* Generated configuration header. */ -#include "mlx4_autoconf.h" - /* PMD headers. */ #include "mlx4.h" #include "mlx4_flow.h"