From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by dpdk.org (Postfix) with ESMTP id B7D44568F for ; Thu, 19 Mar 2015 16:31:59 +0100 (CET) Received: by pacwe9 with SMTP id we9so78788718pac.1 for ; Thu, 19 Mar 2015 08:31:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=lh+bK5Q2CGUP/eNbcPI9NPIc6PplhzkbxvB7w42alas=; b=BB6rIVCcXYdc7rpPqg1PwnnoXxJxlNs3XdKN218qDjyGNRpp+4AEtQdHcK5BR1PO4J an0L19J9gg9Afi3M9nkVPgc4ELEecNCctCpetcHICRMaqGkJCdSYBEtCFNqAovrz4J3G eFpZmlIlNWe5VF1m/ZJFRUNeUuS5PmNx1lN9N2Jak5L3zsaM5weGTmOF0M6K82qpO2ax A9ZyqzScekbisxN1ql3+g38wzP8nDRNji+7BbNHtoOWwEILA4tdQRdiRdU3eI/2QR2kz fzA9AyBwDGIfx29GYJlPPV5jeVu5wdU5xgGyovdeEre3Db60hiDD3ZmEaIoAe/lGxRHn nslg== X-Gm-Message-State: ALoCoQmUWzRkzDTuczqI/YDHDvMDkUYJwAglAz1ljma7+dd2lnzwwORSn3Qx5SyNSmNuycAo1pTj X-Received: by 10.70.41.175 with SMTP id g15mr64541758pdl.27.1426779118906; Thu, 19 Mar 2015 08:31:58 -0700 (PDT) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id 1sm3617180pdi.38.2015.03.19.08.31.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 08:31:58 -0700 (PDT) Date: Thu, 19 Mar 2015 08:31:58 -0700 From: Stephen Hemminger To: Pablo de Lara Message-ID: <20150319083158.7c96f645@urahara> In-Reply-To: <1426767878-25468-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1426767878-25468-1-git-send-email-pablo.de.lara.guarch@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix compilation issue when RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC is disabled 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: Thu, 19 Mar 2015 15:32:00 -0000 On Thu, 19 Mar 2015 12:24:38 +0000 Pablo de Lara wrote: > If RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC is disabled in the config file, > RTE_PMD_IXGBE_RX_MAX_BURST macro and ixgbe_recv_pkts_bulk_alloc function are not declared, > and some parts of the ixgbe code were still trying to use them. > > This patch fixes the problem by including previous conditionals > that were removed in 01fa1d6 ("ixgbe: unify Rx setup"). > > Signed-off-by: Pablo de Lara > --- > lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 15 ++++++++++++--- > 1 files changed, 12 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c > index 8bede22..011e97c 100644 > --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c > +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c > @@ -2075,7 +2075,7 @@ check_rx_burst_bulk_alloc_preconditions(__rte_unused struct ixgbe_rx_queue *rxq) > > /* Reset dynamic ixgbe_rx_queue fields back to defaults */ > static void > -ixgbe_reset_rx_queue(struct ixgbe_hw *hw, struct ixgbe_rx_queue *rxq) > +ixgbe_reset_rx_queue(struct ixgbe_hw *hw __rte_unused, struct ixgbe_rx_queue *rxq) > { > static const union ixgbe_adv_rx_desc zeroed_desc = { .read = { > .pkt_addr = 0}}; > @@ -2092,9 +2092,11 @@ ixgbe_reset_rx_queue(struct ixgbe_hw *hw, struct ixgbe_rx_queue *rxq) > * constraints here to see if we need to zero out memory after the end > * of the H/W descriptor ring. > */ > +#ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC > if (hw->rx_bulk_alloc_allowed) > /* zero out extra memory */ > len += RTE_PMD_IXGBE_RX_MAX_BURST; > +#endif > > /* > * Zero out HW ring memory. Zero out extra memory at the end of > @@ -2238,8 +2240,10 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, > * function does not access an invalid memory region. > */ > len = nb_desc; > +#ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC > if (hw->rx_bulk_alloc_allowed) > len += RTE_PMD_IXGBE_RX_MAX_BURST; > +#endif > > rxq->sw_ring = rte_zmalloc_socket("rxq->sw_ring", > sizeof(struct ixgbe_rx_entry) * len, > @@ -3544,14 +3548,19 @@ void ixgbe_set_rx_function(struct rte_eth_dev *dev) > "burst size no less than 32."); > > dev->rx_pkt_burst = ixgbe_recv_pkts_vec; > - } else if (hw->rx_bulk_alloc_allowed) { > + > + } > +#ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC > + else if (hw->rx_bulk_alloc_allowed) { > PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are " > "satisfied. Rx Burst Bulk Alloc function " > "will be used on port=%d.", > dev->data->port_id); > > dev->rx_pkt_burst = ixgbe_recv_pkts_bulk_alloc; > - } else { > + } > +#endif > + else { > PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are not " > "satisfied, or Scattered Rx is requested, " > "or RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC " This code needs some 'de-ifdef' work. It is hard to maintain as is. I prefer having one inline function, and getting rid of all the #ifdef's and just let the compiler eliminate dead code.