From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9388D42EDB for ; Fri, 21 Jul 2023 16:01:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 706E740E2D; Fri, 21 Jul 2023 16:01:12 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 1317B40DDC for ; Fri, 21 Jul 2023 16:01:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689948070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7aYm7IIOHt+QnMw4TiWqxkYfq+AnhS2RMak6Q18EJAU=; b=iYcYjEUpi11vOnE+pIPzhu1lCC4XXD5xoFlyUeRAH6UoY09IMuyrExKm9ow2AbP99glsMX N9UEdUGPE66X1t9OEXHECtg0GB3OY9WY/BtmALj3OBGjFEo/bYwnHwZPk3ZYqvXcUHINcY Qzic0tf9ZC9PAyAUa1GsUMYbuLV4WjU= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-251-tEuszLmVMo6qTQ-51mizUw-1; Fri, 21 Jul 2023 10:01:09 -0400 X-MC-Unique: tEuszLmVMo6qTQ-51mizUw-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3fc07d4c2f4so11865435e9.1 for ; Fri, 21 Jul 2023 07:01:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689948068; x=1690552868; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7aYm7IIOHt+QnMw4TiWqxkYfq+AnhS2RMak6Q18EJAU=; b=K/Wte9I+5UJw/6pwNJhZRtq7RTyJ3CRTLnXvwI0h7+ABAGS4pajvo/NmIwslPHedUz ZbMb7q3QzgV6q34yTRMyTdJ0RSNyI6YMFJkNM6lyrLLx/WxExsY2V0XIUj2y1Y/m4d2K ZObwAaC4lZUycrrTHfaG/oTHUFqUjD/Bz/gyzO1T8BJCMBbrBXFM5gvhHaBLvoEPsIly CZ8ckaIuKgb55LEch3NoTuMgcMotcrfvMdD1Ik4jZoDimdpmlfrT5Jwh4ooLFhTY+7oF l+CKi5CW58OjDyAKuRgkwio2npD7my8dWlwEqKweD2Olsmni5wWgyY2t9V9VZZRjgVRA Im6Q== X-Gm-Message-State: ABy/qLareLHRNkZIsyIJSIwbf0b3BuD42LBj9YTXpaDou/Pjk77HpO7X kG5SkZNAuKZC1YeFTJBFbwaWcLcfdzdYkuZpC+zXW+Bg8PrgBB3xxVBCdSnhWGzVXorH72YLlY1 E8Nuxd7w= X-Received: by 2002:a05:600c:152:b0:3fb:e200:b2b3 with SMTP id w18-20020a05600c015200b003fbe200b2b3mr1586230wmm.37.1689948067880; Fri, 21 Jul 2023 07:01:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlGeog6Vvm7JjsptBNMP+BLjqUc4PQ92buJkKJb7/rJLwfRWJhayt8Qolvhj+egyiwDjEx4LtA== X-Received: by 2002:a05:600c:152:b0:3fb:e200:b2b3 with SMTP id w18-20020a05600c015200b003fbe200b2b3mr1586209wmm.37.1689948067557; Fri, 21 Jul 2023 07:01:07 -0700 (PDT) Received: from [192.168.0.36] ([78.17.184.75]) by smtp.gmail.com with ESMTPSA id l16-20020a1c7910000000b003fba137857esm3446495wme.14.2023.07.21.07.01.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Jul 2023 07:01:06 -0700 (PDT) Message-ID: <18b2d822-a398-aa3a-80c1-17da41ba4320@redhat.com> Date: Fri, 21 Jul 2023 15:01:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 To: Alexander Kozyrev , stable@dpdk.org Cc: viacheslavo@nvidia.com, luca.boccassi@gmail.com, "Xueming(Steven) Li" References: <20230720132153.4127717-1-akozyrev@nvidia.com> From: Kevin Traynor Subject: Re: [PATCH 20.11] net/mlx5: fix MPRQ stride size to accommodate the headroom In-Reply-To: <20230720132153.4127717-1-akozyrev@nvidia.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi Alexander, On 20/07/2023 14:21, Alexander Kozyrev wrote: > [ upstream commit 562944444959948e22516d3891afc026bcac03c0 ] > This commit ^^^ is not on dpdk main branch? Shouldn't this be: [ upstream commit e6479f009fbd9c8e873807cc928dcf91a151aba9 ] > The space for the headroom is reserved at the end of every MPRQ stride > for the next packet. The Rx burst logic is to copy any overlapping > packet data if there is an overlap with this reserved headroom space. > But it is not possible if the headroom size is bigger than the whole > stride. Adjust the stride size to make sure the stride size is greater > than the headroom size. > > Fixes: b6b775f223 ("net/mlx5: fix MPRQ stride devargs adjustment") > This ^^^ is the 20.11 branch commit id. As this series of fixes are backported from dpdk main it is better to use dpdk main commit ids for 'Fixes:' so that we can trace history of fixes easier. The only exception is if there was something committed to 20.11 but not dpdk main which is very rare. Probably Luca can update when he is merging. For 21.11 branch, neither the dpdk main or 20.11 patches apply. If you could send a backport for 21.11 that would be great. Not sure if it's needed for 22.11, Xueming will let you know. Thanks. > Signed-off-by: Alexander Kozyrev > Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/linux/mlx5_os.c | 1 + > drivers/net/mlx5/mlx5_rxq.c | 41 ++++++++++++++++++++++---------- > 2 files changed, 29 insertions(+), 13 deletions(-) > > diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c > index e79b1a275c..ab69ee21ad 100644 > --- a/drivers/net/mlx5/linux/mlx5_os.c > +++ b/drivers/net/mlx5/linux/mlx5_os.c > @@ -1202,6 +1202,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, > config->mprq.log_min_stride_wqe_size = > MLX5_MPRQ_LOG_MIN_STRIDE_WQE_SIZE; > config->mprq.log_stride_num = MLX5_MPRQ_DEFAULT_LOG_STRIDE_NUM; > + config->mprq.log_stride_size = MLX5_MPRQ_DEFAULT_LOG_STRIDE_SIZE; > if (config->devx) { > config->mprq.log_min_stride_wqe_size = > config->hca_attr.log_min_stride_wqe_sz; > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index 47db585042..4a8fc8721d 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -1446,23 +1446,38 @@ mlx5_mprq_prepare(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, > } else { > *actual_log_stride_num = config->mprq.log_stride_num; > } > - if (config->mprq.log_stride_size) { > - /* Checks if chosen size of stride is in supported range. */ > - if (config->mprq.log_stride_size > log_max_stride_size || > - config->mprq.log_stride_size < log_min_stride_size) { > - *actual_log_stride_size = log_def_stride_size; > + /* Checks if chosen size of stride is in supported range. */ > + if (config->mprq.log_stride_size > log_max_stride_size || > + config->mprq.log_stride_size < log_min_stride_size) { > + *actual_log_stride_size = log_def_stride_size; > + DRV_LOG(WARNING, > + "Port %u Rx queue %u size of a stride for Multi-Packet RQ is out of range, setting default value (%u)", > + dev->data->port_id, idx, > + RTE_BIT32(log_def_stride_size)); > + } else { > + *actual_log_stride_size = config->mprq.log_stride_size; > + } > + /* Make the stride fit the mbuf size by default. */ > + if (*actual_log_stride_size == MLX5_MPRQ_DEFAULT_LOG_STRIDE_SIZE) { > + if (min_mbuf_size <= RTE_BIT32(log_max_stride_size)) { > DRV_LOG(WARNING, > - "Port %u Rx queue %u size of a stride for Multi-Packet RQ is out of range, setting default value (%u)", > - dev->data->port_id, idx, > - RTE_BIT32(log_def_stride_size)); > + "Port %u Rx queue %u size of a stride for Multi-Packet RQ is adjusted to match the mbuf size (%u)", > + dev->data->port_id, idx, min_mbuf_size); > + *actual_log_stride_size = log2above(min_mbuf_size); > } else { > - *actual_log_stride_size = config->mprq.log_stride_size; > + goto unsupport; > } > - } else { > - if (min_mbuf_size <= RTE_BIT32(log_max_stride_size)) > - *actual_log_stride_size = log2above(min_mbuf_size); > - else > + } > + /* Make sure the stride size is greater than the headroom. */ > + if (RTE_BIT32(*actual_log_stride_size) < RTE_PKTMBUF_HEADROOM) { > + if (RTE_BIT32(log_max_stride_size) > RTE_PKTMBUF_HEADROOM) { > + DRV_LOG(WARNING, > + "Port %u Rx queue %u size of a stride for Multi-Packet RQ is adjusted to accommodate the headroom (%u)", > + dev->data->port_id, idx, RTE_PKTMBUF_HEADROOM); > + *actual_log_stride_size = log2above(RTE_PKTMBUF_HEADROOM); > + } else { > goto unsupport; > + } > } > log_stride_wqe_size = *actual_log_stride_num + *actual_log_stride_size; > /* Check if WQE buffer size is supported by hardware. */