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 4271941D79; Mon, 13 Mar 2023 11:32:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1CA941144; Mon, 13 Mar 2023 11:32:21 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2089.outbound.protection.outlook.com [40.107.93.89]) by mails.dpdk.org (Postfix) with ESMTP id 0E74C40151; Mon, 13 Mar 2023 11:32:20 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QDf0j0n8/5PDd6hMGvSjUVCZ0wUVoaAys57cLeDo0ftA0IHQwEpcrH/S55X8So4PKRUpL9w1eBqI04w0i4XkOXt3ogOc+uMZsPvs5y6R9K/hGuAJ7jmwDyzvX+ERocRUVcvcwNNW95kJAXyjZCruZCnKqtGALWyxI4VFNdVdtb1w3Dy+KRPaOTP4nhO30E+ivwCOADYc2WJW0FmKn8jmXoOuOagyYftKqiGwDZSXpsFPfPcm/I0HWIR5xiVBNJT4OStF0zF40laxMMIKTvhfQeA8lzDBINd6l7DXAiNZtKLPhUBPtvkka9rFGjAAtTdJ/kqM1sLb2Ntm2HrjgrgWiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+yGhS2pW8cQGPeJK9SublcTv54R1v2VLpyr/GeZ1JUc=; b=jQeEQY81heMSpM4ejVPvvl0DTUrC1ttcw5X0c1vPr6r2M6oEz0XmwIViylMbI/ixigKEmr3fVHkX/uy6CG/HhrgnHtW3v1AhXJY9rVV7dUl+1o2hF1+SHqdiLmOXFEKS6GkNCSl0tq9UK+3emk9T5paVKKDOKRUe1kQDZnti57rKwIAdmgHIaHfU3W96g0uWRzJxc4Jrnyam9XvF0+UujlWMs1tQcDX91L2MTcC5E/XDxHWtq4OJ6AkLCYUSAlkqePf3dEe8TZIGgyvBlsH7XrUqVx84oO6NCfnPyWEWS32R8x1TctOnNcpGYTBeHuEe1TStLWfRaf1wLBP4N1wHjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+yGhS2pW8cQGPeJK9SublcTv54R1v2VLpyr/GeZ1JUc=; b=2rt/jy3LwO6118jNkEGYlWTg265SPv7ManFfqkNlm4rVaF9mBCtWOlIQd6NRoFzZlG2OKDB+7xen2cxy6gOGX/V9FXs+YtMN4ggaFLoo+7WQ5cfjU3C2jHBsQlBmUMsmF3yEMIkrUcTduO8wVPvVN9ef4VyM8Z+w0+Jng2jHStM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DM6PR12MB4089.namprd12.prod.outlook.com (2603:10b6:5:213::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 10:32:18 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640%6]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 10:32:18 +0000 Message-ID: <13c5d1a7-948d-6fec-e402-59d32344359d@amd.com> Date: Mon, 13 Mar 2023 10:32:12 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] net/sfc: invalidate switch port entry on representor unplug Content-Language: en-US To: Andrew Rybchenko , Ivan Malov Cc: stable@dpdk.org, Andy Moreton , dev@dpdk.org References: <20230310170717.7352-1-ivan.malov@arknetworks.am> <9e7ba4dd-c8b7-879b-fc2d-7b7a601277e1@oktetlabs.ru> From: Ferruh Yigit In-Reply-To: <9e7ba4dd-c8b7-879b-fc2d-7b7a601277e1@oktetlabs.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0466.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::21) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM6PR12MB4089:EE_ X-MS-Office365-Filtering-Correlation-Id: 28b216f4-3aa2-455b-9b47-08db23ae384c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dduSWsOYDPLW0De5FL/FotB+JdDDqHAL+45Sc8tTQiy8o+u8P1v2QGFk1Uw2DeCOIp4C2rReFPCaTpknWkkxQCh4impUiOJSTilPa/tpi+n635vD0E1Od5shHPlAM8NOF0U+oSxpHQg7bY5gP3wci710zlmC3h37rBvC0GDcRWjsUw5UxTb48N8wORAtl7kW8fizAPxPnqYCD+GJM/KQMwbQ8EfgGUuZv3u+Tl4XpS4YlDDB/L9eIJzmQEdehg0abQ4L/wCqP+5jqIPCa9oOFf4UEryyH0HKYaCeEOtqXKEUnTSuXfnY+xaQ+mF14NNp/T63Q6LBcXC5NbZT3O8xjz3KhHDSarHIBk14a2406iLg5xmaK3/Ra1ru6hBVYxTAT/G9DVesA7DCIoifmOM3RCPuVqjY1AFE6I75BNbKtq5JCDySX2osl8SfLEYNPXCPDPqWSvftIovd8Pm7Pzu3/btB94svMCUR91TlWeSObMHNYYTUtiOxy6SA9scdygNBkxMqp3qQOyRR58Pw+YUW9WA0pbShmDu5/MHXSUZd9OsXGTwOch0Q17597ixsypgih/Dn+smH3MPxNgv0COeF+egY31Ngs/xc3rFDJeqjM8cBWpz6eHuoqwkI+NuPGe6aS+uhd29FvqEsA2fW4KxtjL7R8QKZB3B/kNmdUgc7T8p1+F1kEheFbqxUozRVcxSm/oW/Z3bnSykvobUQ4McgAL3SQ+RaD7a0WVILNINkwpQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(136003)(396003)(346002)(366004)(376002)(451199018)(6666004)(83380400001)(110136005)(316002)(38100700002)(478600001)(6512007)(8936002)(186003)(8676002)(6506007)(36756003)(26005)(5660300002)(53546011)(4326008)(66556008)(66476007)(66946007)(41300700001)(31696002)(86362001)(44832011)(2616005)(6486002)(2906002)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QjRvSWhROVNiQ2dkQy9pRk81QStieEduZlBhWjZRRm9XejhNdmhwbFBacldZ?= =?utf-8?B?THZuU2dIZys4amxIaUlCVnFaTGU1MlVTSFZxeFBRallvclhPRXo4Zlo4cHNZ?= =?utf-8?B?OUtrbFlOMFAzalJxVDhZSlBVYlg4ZXZNekRPLzBDcGVKYUxsNnJCRExkZlJI?= =?utf-8?B?Y3JqV0lud0p5WWJjVzllTksvUXQwcjFVaElET0UvYXhEcHR2VnFDN0tGWHpY?= =?utf-8?B?NVJMQzQ1OXdYZ01iS1NLWmw1VW9GcHk1Rmx3Q0VmNWpT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LzczbGVT?= =?utf-8?B?K1B5QTFidFBxaEc3Q2dnTkUwUFhsMFFpazVMWHBiUlBUR2kwOFFiOUxheWor?= =?utf-8?Q?ciavz02I5f+OmbfWCqxKn++s0?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28b216f4-3aa2-455b-9b47-08db23ae384c X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 10:32:18.1226 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5RHXiNlgurEeQw5IRVJG2BhLlHPCAANFc9U6yN7iIFPU5hjPizFyjbW70zB6Kx1X X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4089 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 3/12/2023 7:28 AM, Andrew Rybchenko wrote: > On 3/10/23 20:07, Ivan Malov wrote: >> Once allocated, a switch port list entry always stays there, >> even after unplugging the ethdev that created it. Currently, >> the entry's ethdev ID is not cleared on unplug. Referencing >> the ethdev ID of a detached representor from a flow rule is >> going to succeed, which is a bug. Also, if the user unplugs >> endpoint "A" representor and plugs one for "B" instead, the >> latter will pick the same ethdev ID as the gone representor, >> but it will have a new port list entry added for it. If the >> user tries to reference the ethdev ID from a flow rule, the >> code will fetch the wrong entry ("A" rather than "B") since >> it sits closer to the list head. That is a serious bug, too. >> >> Make the driver invalidate ethdev ID field on ethdev unplug. >> >> Fixes: 1fb65e4dae8a ("net/sfc: support flow action port ID in transfer >> rules") >> Fixes: a62ec90522a6 ("net/sfc: add port representors infrastructure") >> Cc: stable@dpdk.org >> >> Signed-off-by: Ivan Malov >> Reviewed-by: Andy Moreton > > Acked-by: Andrew Rybchenko > > Applied to dpdk-next-net/main, thanks.