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 E3E1DA0093 for ; Tue, 19 May 2020 14:59:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C654B1D62C; Tue, 19 May 2020 14:59:17 +0200 (CEST) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id E49A31D619 for ; Tue, 19 May 2020 14:59:16 +0200 (CEST) Received: by mail-wm1-f66.google.com with SMTP id n5so3472813wmd.0 for ; Tue, 19 May 2020 05:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DstAwcYZxu0z+gh3XQzvpoEiT9wfy3u4QcA6QXqxXG0=; b=CrKxAwjxHMUVO1ujOvG0g/gB7NqPPFpaAhygCFAmTfMtzhHPzirBuKtCTwrvVvV7Yp qKafKYLyV/q1bgPPqEaYW9sbeq6hDY4q/ZGRuXckktVBdq5poLLEuajrNT2SepZi3kWn NFdaxhIM5ofYVE0T0K51Uzxao1BwW7a7PlcarhKXvOim6azUYHu/ScCBU/MsPqGvwM15 NIqGaJViSK/jMS0mExiCnxck/A/9JEcXE+Z31KtmDaHRmqgolAk8mZhouGBT4fltvqrF qdCF2GQ6Csa9a6O9G6U4GCTJK7KhOjVjKX5xd288gISw/BP0l9FKAzBb6gKKkSnGXnUO gUzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DstAwcYZxu0z+gh3XQzvpoEiT9wfy3u4QcA6QXqxXG0=; b=CL+eFqxWAao10fpNG79sMYwM/n39hC5QUKvOYxOMOJ2vR2yMyefjqHunbX5R4mEW95 V7M++1qTxscqSfcq+dDVs5obCa4tfsRvvFxRpcgU38/lQ5DBEUPXtt957dRqkj+ZAo8y FFXgsDj6BPPEhfvrd4COKxF44lr09h52EDhD8qw0NnMojmcXStQVsf+uJI/OFTvXmAFc fhRoQcMKyzGGx3h0bJmzmEzVp7kp2jJiRpkiH3LzrZJnywaiLK1uRXLQprENczdZP0Oi UWGDVVi+kj4JOdXpEbq2AVBacIviftBnUS6T3A38GDsVgUmbSluL/EVUDAlnU/0MBmac 37qw== X-Gm-Message-State: AOAM531VK9pEeDkiHmEnMci5GmN1tTvgCryj3d1KEbmRFf/BFDgsgtfW UsqIzcpTmxdvEeN9bdq/uw1ADqiyaof9ROhV X-Google-Smtp-Source: ABdhPJyp9m4+58ZX+648x0b/T5ICPibIweyWbzAZUsf2R4Bj9NpumQWx2vTyn9yRqWNQF3Mq5m9CHw== X-Received: by 2002:a1c:1d4d:: with SMTP id d74mr307545wmd.48.1589893156642; Tue, 19 May 2020 05:59:16 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id b2sm23842974wrm.30.2020.05.19.05.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 05:59:16 -0700 (PDT) From: luca.boccassi@gmail.com To: Qi Zhang Cc: Xiaolong Ye , dpdk stable Date: Tue, 19 May 2020 13:53:40 +0100 Message-Id: <20200519125804.104349-30-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519125804.104349-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ice: remove bulk alloc option' has been queued to stable release 19.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 7ce629f7f203343d19ba88fec8baa84c50394748 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Wed, 4 Mar 2020 19:40:38 +0800 Subject: [PATCH] net/ice: remove bulk alloc option [ upstream commit af3f83032b457771e3268a3d310f4890672ab442 ] Remove CONFIG_RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC with below consideration: 1. A default Rx path can always be selected by setting a proper rx_free_thresh value at runtime, see ice_check_rx_burst_bulk_alloc_preconditions. 2. Its not a big deal to always reserve more space for desc ring. "ring_size = (uint16_t)(rxq->nb_rx_desc + ICE_RX_MAX_BURST);" 3. Fixes a potential invalid memory access in ice_reset_rx_queue. If CONFIG_RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC is turned on while ice_check_rx_burst_bulk_alloc_preconditions return fail. Below code will have problem. for (i = 0; i < ICE_RX_MAX_BURST; ++i) rxq->sw_ring[rxq->nb_rx_desc + i].mbuf = &rxq->fake_mbuf; Fixes: 50370662b727 ("net/ice: support device and queue ops") Signed-off-by: Qi Zhang Acked-by: Xiaolong Ye --- config/common_base | 1 - doc/guides/nics/ice.rst | 4 --- drivers/net/ice/ice_rxtx.c | 59 ++++++-------------------------------- 3 files changed, 9 insertions(+), 55 deletions(-) diff --git a/config/common_base b/config/common_base index 2e0c725988..861f7d1a0b 100644 --- a/config/common_base +++ b/config/common_base @@ -328,7 +328,6 @@ CONFIG_RTE_LIBRTE_ICE_PMD=y CONFIG_RTE_LIBRTE_ICE_DEBUG_RX=n CONFIG_RTE_LIBRTE_ICE_DEBUG_TX=n CONFIG_RTE_LIBRTE_ICE_DEBUG_TX_FREE=n -CONFIG_RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC=y CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC=n # Compile burst-oriented IAVF PMD driver diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst index 9b90b389ec..58eb023983 100644 --- a/doc/guides/nics/ice.rst +++ b/doc/guides/nics/ice.rst @@ -54,10 +54,6 @@ Please note that enabling debugging options may affect system performance. Toggle display of generic debugging messages. -- ``CONFIG_RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC`` (default ``y``) - - Toggle bulk allocation for RX. - - ``CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC`` (default ``n``) Toggle to use a 16-byte RX descriptor, by default the RX descriptor is 32 byte. diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 37e792b05b..110b38646d 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -236,17 +236,12 @@ _ice_rx_queue_release_mbufs(struct ice_rx_queue *rxq) rxq->sw_ring[i].mbuf = NULL; } } -#ifdef RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC - if (rxq->rx_nb_avail == 0) - return; - for (i = 0; i < rxq->rx_nb_avail; i++) { - struct rte_mbuf *mbuf; + if (rxq->rx_nb_avail == 0) + return; + for (i = 0; i < rxq->rx_nb_avail; i++) + rte_pktmbuf_free_seg(rxq->rx_stage[rxq->rx_next_avail + i]); - mbuf = rxq->rx_stage[rxq->rx_next_avail + i]; - rte_pktmbuf_free_seg(mbuf); - } - rxq->rx_nb_avail = 0; -#endif /* RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC */ + rxq->rx_nb_avail = 0; } static void @@ -309,16 +304,10 @@ ice_switch_rx_queue(struct ice_hw *hw, uint16_t q_idx, bool on) } static inline int -#ifdef RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC ice_check_rx_burst_bulk_alloc_preconditions(struct ice_rx_queue *rxq) -#else -ice_check_rx_burst_bulk_alloc_preconditions - (__rte_unused struct ice_rx_queue *rxq) -#endif { int ret = 0; -#ifdef RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC if (!(rxq->rx_free_thresh >= ICE_RX_MAX_BURST)) { PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions: " "rxq->rx_free_thresh=%d, " @@ -338,9 +327,6 @@ ice_check_rx_burst_bulk_alloc_preconditions rxq->nb_rx_desc, rxq->rx_free_thresh); ret = -EINVAL; } -#else - ret = -EINVAL; -#endif return ret; } @@ -357,17 +343,11 @@ ice_reset_rx_queue(struct ice_rx_queue *rxq) return; } -#ifdef RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC - if (ice_check_rx_burst_bulk_alloc_preconditions(rxq) == 0) - len = (uint16_t)(rxq->nb_rx_desc + ICE_RX_MAX_BURST); - else -#endif /* RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC */ - len = rxq->nb_rx_desc; + len = (uint16_t)(rxq->nb_rx_desc + ICE_RX_MAX_BURST); for (i = 0; i < len * sizeof(union ice_rx_flex_desc); i++) ((volatile char *)rxq->rx_ring)[i] = 0; -#ifdef RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC memset(&rxq->fake_mbuf, 0x0, sizeof(rxq->fake_mbuf)); for (i = 0; i < ICE_RX_MAX_BURST; ++i) rxq->sw_ring[rxq->nb_rx_desc + i].mbuf = &rxq->fake_mbuf; @@ -375,7 +355,6 @@ ice_reset_rx_queue(struct ice_rx_queue *rxq) rxq->rx_nb_avail = 0; rxq->rx_next_avail = 0; rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_thresh - 1); -#endif /* RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC */ rxq->rx_tail = 0; rxq->nb_rx_hold = 0; @@ -926,13 +905,11 @@ ice_rx_queue_setup(struct rte_eth_dev *dev, /* Allocate the maximun number of RX ring hardware descriptor. */ len = ICE_MAX_RING_DESC; -#ifdef RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC /** * Allocating a little more memory because vectorized/bulk_alloc Rx * functions doesn't check boundaries each time. */ len += ICE_RX_MAX_BURST; -#endif /* Allocate the maximum number of RX ring hardware descriptor. */ ring_size = sizeof(union ice_rx_flex_desc) * len; @@ -952,11 +929,8 @@ ice_rx_queue_setup(struct rte_eth_dev *dev, rxq->rx_ring_dma = rz->iova; rxq->rx_ring = rz->addr; -#ifdef RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC + /* always reserve more for bulk alloc */ len = (uint16_t)(nb_desc + ICE_RX_MAX_BURST); -#else - len = nb_desc; -#endif /* Allocate the software ring. */ rxq->sw_ring = rte_zmalloc_socket(NULL, @@ -977,17 +951,14 @@ ice_rx_queue_setup(struct rte_eth_dev *dev, use_def_burst_func = ice_check_rx_burst_bulk_alloc_preconditions(rxq); if (!use_def_burst_func) { -#ifdef RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are " "satisfied. Rx Burst Bulk Alloc function will be " "used on port=%d, queue=%d.", rxq->port_id, rxq->queue_id); -#endif /* RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC */ } else { PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are " - "not satisfied, Scattered Rx is requested, " - "or RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC is " - "not enabled on port=%d, queue=%d.", + "not satisfied, Scattered Rx is requested. " + "on port=%d, queue=%d.", rxq->port_id, rxq->queue_id); ad->rx_bulk_alloc_allowed = false; } @@ -1399,7 +1370,6 @@ ice_rxd_to_pkt_fields(struct rte_mbuf *mb, #endif } -#ifdef RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC #define ICE_LOOK_AHEAD 8 #if (ICE_LOOK_AHEAD != 8) #error "PMD ICE: ICE_LOOK_AHEAD must be 8\n" @@ -1620,15 +1590,6 @@ ice_recv_pkts_bulk_alloc(void *rx_queue, return nb_rx; } -#else -static uint16_t -ice_recv_pkts_bulk_alloc(void __rte_unused *rx_queue, - struct rte_mbuf __rte_unused **rx_pkts, - uint16_t __rte_unused nb_pkts) -{ - return 0; -} -#endif /* RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC */ static uint16_t ice_recv_scattered_pkts(void *rx_queue, @@ -1872,9 +1833,7 @@ ice_dev_supported_ptypes_get(struct rte_eth_dev *dev) ptypes = ptypes_os; if (dev->rx_pkt_burst == ice_recv_pkts || -#ifdef RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC dev->rx_pkt_burst == ice_recv_pkts_bulk_alloc || -#endif dev->rx_pkt_burst == ice_recv_scattered_pkts) return ptypes; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 13:56:20.038529750 +0100 +++ 0030-net-ice-remove-bulk-alloc-option.patch 2020-05-19 13:56:18.219501819 +0100 @@ -1,8 +1,10 @@ -From af3f83032b457771e3268a3d310f4890672ab442 Mon Sep 17 00:00:00 2001 +From 7ce629f7f203343d19ba88fec8baa84c50394748 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Wed, 4 Mar 2020 19:40:38 +0800 Subject: [PATCH] net/ice: remove bulk alloc option +[ upstream commit af3f83032b457771e3268a3d310f4890672ab442 ] + Remove CONFIG_RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC with below consideration: @@ -22,7 +24,6 @@ rxq->sw_ring[rxq->nb_rx_desc + i].mbuf = &rxq->fake_mbuf; Fixes: 50370662b727 ("net/ice: support device and queue ops") -Cc: stable@dpdk.org Signed-off-by: Qi Zhang Acked-by: Xiaolong Ye @@ -33,10 +34,10 @@ 3 files changed, 9 insertions(+), 55 deletions(-) diff --git a/config/common_base b/config/common_base -index 7ca2f28b19..c31175f9d6 100644 +index 2e0c725988..861f7d1a0b 100644 --- a/config/common_base +++ b/config/common_base -@@ -337,7 +337,6 @@ CONFIG_RTE_LIBRTE_ICE_PMD=y +@@ -328,7 +328,6 @@ CONFIG_RTE_LIBRTE_ICE_PMD=y CONFIG_RTE_LIBRTE_ICE_DEBUG_RX=n CONFIG_RTE_LIBRTE_ICE_DEBUG_TX=n CONFIG_RTE_LIBRTE_ICE_DEBUG_TX_FREE=n @@ -45,7 +46,7 @@ # Compile burst-oriented IAVF PMD driver diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst -index cde3fd620a..8af32dabf6 100644 +index 9b90b389ec..58eb023983 100644 --- a/doc/guides/nics/ice.rst +++ b/doc/guides/nics/ice.rst @@ -54,10 +54,6 @@ Please note that enabling debugging options may affect system performance. @@ -60,7 +61,7 @@ Toggle to use a 16-byte RX descriptor, by default the RX descriptor is 32 byte. diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c -index 60c411bfad..3c3f61eb94 100644 +index 37e792b05b..110b38646d 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -236,17 +236,12 @@ _ice_rx_queue_release_mbufs(struct ice_rx_queue *rxq)