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 DE01D433A7 for ; Thu, 23 Nov 2023 11:48:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D729842F27; Thu, 23 Nov 2023 11:48:51 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 1F10C42F25 for ; Thu, 23 Nov 2023 11:48:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700736529; 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=xLGRugEjVweeiZhfL2DUCtm/a7WRwX3LzLU0OgPvA6I=; b=OMnTYLo37Zv0ExnpJiE+NCt04k/l+wMFbFa40QLGndEMGDRuetV0xjZOklMZW6gJ/VQqm7 wkGb6xUgasLxKe8F4ZJCrmwUe8kjWWi9MkXUvTjDIu5UZa9/hVJHn1gxHjP973Ge7f0CYK mQNP5JeYr+z89YeNXO30N+Ll6f4kMd8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-632-o4lfUDnuN02SFqESggMstQ-1; Thu, 23 Nov 2023 05:48:48 -0500 X-MC-Unique: o4lfUDnuN02SFqESggMstQ-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-40a36dd4a58so3547115e9.3 for ; Thu, 23 Nov 2023 02:48:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700736527; x=1701341327; 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=xLGRugEjVweeiZhfL2DUCtm/a7WRwX3LzLU0OgPvA6I=; b=Ouy4L22kOU88Bzq+o26eqzrQODAbbqIr6gB8lfbWqplWlcgcewaAyuGefBZp1aCIry vLhG4tupUJ81NzJ+rb7S90hexJ7phERYJzZUr2TshcUIvfWYFSQyOieTjiEooGGMi5sK u5Sp3SGOw70UB5cagRB/m/bE10AJV7Gx/z6IZsl0xqCdlE5asC5FAsfhDmqfSBU35ThE aT+cp+SROV1r0reBaAhVnLoBlI6YWl0WpPid8Oc1ejcEVHD5guv0H5LnkspBaGWuVn7Z Tqe2w0bdn5GGq+rlmBa8iNjLfUg+/ysjJuH+zG2Ch8yzSA9PyuDG0ngaYGvvtUOaVi3f nysg== X-Gm-Message-State: AOJu0YyW7DbDLEwnCUxhVxYzQftaR6fvHk66pC8xFpbsYUm056WsDEZa sQFsS9G8wj14qwQOnt9zw1oEpEfYtZ1f4YlGAXBwnXlWKQpw/nM1M/HT4sEtlWySgYh1nUncchh 1THUOQz0yCHE/PPU= X-Received: by 2002:a05:600c:3ca0:b0:40a:48af:4820 with SMTP id bg32-20020a05600c3ca000b0040a48af4820mr3927950wmb.30.1700736527022; Thu, 23 Nov 2023 02:48:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvtPpVnF0WssqbSBhYOWgXvVCsi4jNlfJqunVuI13Z6t3o7lcAYVO+i/9Fv73RjTrj/DB4Ew== X-Received: by 2002:a05:600c:3ca0:b0:40a:48af:4820 with SMTP id bg32-20020a05600c3ca000b0040a48af4820mr3927940wmb.30.1700736526710; Thu, 23 Nov 2023 02:48:46 -0800 (PST) Received: from [192.168.0.36] ([78.16.130.39]) by smtp.gmail.com with ESMTPSA id l10-20020a7bc44a000000b0040651505684sm1535740wmi.29.2023.11.23.02.48.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Nov 2023 02:48:46 -0800 (PST) Message-ID: Date: Thu, 23 Nov 2023 10:48:45 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 To: Dariusz Sosnowski , stable@dpdk.org Cc: Viacheslav Ovsiienko References: <20231117094831.3607500-1-dsosnowski@nvidia.com> From: Kevin Traynor Subject: Re: [PATCH 21.11] net/mlx5: fix hairpin queue unbind In-Reply-To: <20231117094831.3607500-1-dsosnowski@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 On 17/11/2023 09:48, Dariusz Sosnowski wrote: > [ upstream commit ab2439f80bdf94e2382efe941cf827da6710b5d7 ] > > Let's take an application with the following configuration: > > - It uses 2 ports. > - Each port has 3 Rx queues and 3 Tx queues. > - On each port, Rx queues have a following purposes: > - Rx queue 0 - SW queue, > - Rx queue 1 - hairpin queue, bound to Tx queue on the same port, > - Rx queue 2 - hairpin queue, bound to Tx queue on another port. > - On each port, Tx queues have a following purposes: > - Tx queue 0 - SW queue, > - Tx queue 1 - hairpin queue, bound to Rx queue on the same port, > - Tx queue 2 - hairpin queue, bound to Rx queue on another port. > - Application configured all of the hairpin queues for manual binding. > > After ports are configured and queues are set up, > if the application does the following API call sequence: > > 1. rte_eth_dev_start(port_id=0) > 2. rte_eth_hairpin_bind(tx_port=0, rx_port=0) > 3. rte_eth_hairpin_bind(tx_port=0, rx_port=1) > > mlx5 PMD fails to modify SQ and logs this error: > > mlx5_common: mlx5_devx_cmds.c:2079: mlx5_devx_cmd_modify_sq(): > Failed to modify SQ using DevX > > This error was caused by an incorrect unbind operation taken during > error handling inside call (3). > > (3) fails, because port 1 (Rx side of the hairpin) was not started. > As a result of this failure, PMD goes into error handling, where all > previously bound hairpin queues are unbound. > This is incorrect, since this error handling procedure > in rte_eth_hairpin_bind() implementation assumes that > all hairpin queues are bound to the same rx_port, which is not the case. > The following sequence of function calls appears: > > - rte_eth_hairpin_queue_peer_unbind(rx_port=**1**, rx_queue=1, 0), > - mlx5_hairpin_queue_peer_unbind(dev=**port 0**, tx_queue=1, 1). > > Which violates the hairpin queue destroy flow, by unbinding Tx queue 1 > on port 0, before unbinding Rx queue 1 on port 1. > > This patch fixes that behavior, by filtering Tx queues on which error > handling is done to only affect: > > - hairpin queues (it also reduces unnecessary debug log messages), > - hairpin queues connected to the rx_port which is currently processed. > > Fixes: 37cd4501e873 ("net/mlx5: support two ports hairpin mode") > Cc:stable@dpdk.org > > Signed-off-by: Dariusz Sosnowski > Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_trigger.c | 5 +++++ > 1 file changed, 5 insertions(+) Applied to 21.11 branch. Thanks for backporting.