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 D4FD1423C3; Fri, 13 Jan 2023 14:35:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBB6642D53; Fri, 13 Jan 2023 14:35:48 +0100 (CET) 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 CFECE40E03 for ; Fri, 13 Jan 2023 14:35:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673616946; 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: in-reply-to:in-reply-to:references:references; bh=qMRsQrjcDOO539R/H05nagJjjwO6AK11+fdKZt/ga8c=; b=J9k5hZkc7y9GKTM+oA06sfxCbV+lhR6xFYO+184SCmmGd6R4CvkLqyR/ZNFQkw+XHlfU+p f0EhqwpWIQitWWmdoBJNP9t761fAFzCUOJQpKD0MBZVu151y9PTeow+FgaZ1rLEp/F7AkJ B6JTnIranGSg1VvFo5YF0OU6B0WbLaU= Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-623-tdAR24z1NTCcs6_vfeFS8A-1; Fri, 13 Jan 2023 08:35:42 -0500 X-MC-Unique: tdAR24z1NTCcs6_vfeFS8A-1 Received: by mail-pf1-f198.google.com with SMTP id b196-20020a621bcd000000b0058a63dc105eso6366255pfb.6 for ; Fri, 13 Jan 2023 05:35:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qMRsQrjcDOO539R/H05nagJjjwO6AK11+fdKZt/ga8c=; b=U+jglAXZIgn3vgmzT/FfDPV4Cee7Tt42xxdSW+sIyS26GXfxKPzXKavVjRofD3f6Uo X3Mb3TlcJcBCijUnv7POGyO3ZxR0oZh1bEeJoLKLRxTRma70EOcZQMsbo2ajZMDuukrT 0Jm7DObaq9yBfN1taFqCe/UuUdnEnMHBlsTqQ7Eh+RgDpQ3BaUkHXnTVr8kXrFbeHmDz lANWTQvrDUTiuOog52rm1nkdegIndqeWqjLFKqshhyu6Pnl+bQ18EJJ/w45wh1XZqNl9 Zioph3JHGzoVNd1n01EuxdKICg3yt1HSAQ6efX5fu1hDa//hF9He5BIrcfwdeqeyYII4 HVkA== X-Gm-Message-State: AFqh2ko8yYtaQDJeFLNeYe02/7cUPKnVLpi9EAO0o3W6ddwgZvAPZAUs uNZw4zEXOif0BZZHXFuYqCwrRzwXUIp4odIl+hUUJsnUGUS2SEYp32g1KIUnXI94GMyRJV/X5+f OIjCJmKwdxVLV14lTaTE= X-Received: by 2002:a17:903:328f:b0:193:8c1:50d0 with SMTP id jh15-20020a170903328f00b0019308c150d0mr2935602plb.132.1673616941142; Fri, 13 Jan 2023 05:35:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXsbCOj/4yMDrMhuLDBU5IOV5eZRCUhlbJV7a2qUdxd8BmGgygnOWvg34+SWi1mFolDmrk3jQu1+rhA+C70oXeI= X-Received: by 2002:a17:903:328f:b0:193:8c1:50d0 with SMTP id jh15-20020a170903328f00b0019308c150d0mr2935596plb.132.1673616940848; Fri, 13 Jan 2023 05:35:40 -0800 (PST) MIME-Version: 1.0 References: <20221220155414.266309-1-mkp@redhat.com> <20221228230025.1430743-1-mkp@redhat.com> In-Reply-To: <20221228230025.1430743-1-mkp@redhat.com> From: David Marchand Date: Fri, 13 Jan 2023 14:35:29 +0100 Message-ID: Subject: Re: [PATCH v4] net/iavf: add lock for vf commands To: Jingjing Wu , Beilei Xing Cc: dev@dpdk.org, qi.z.zhang@intel.com, thomas@monjalon.net, yidingx.zhou@intel.com, ktraynor@redhat.com, stable@dpdk.org, Mike Pattrick , "Mcnamara, John" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Hi iavf maintainers, On Thu, Dec 29, 2022 at 12:00 AM Mike Pattrick wrote: > > iavf admin queue commands aren't thread-safe. Bugs surrounding this > issue can manifest in a variety of ways but frequently pend_cmd is > over written. Simultaneously executing commands can result in a > misconfigured device or DPDK sleeping in a thread for 2 second. > > Despite this limitation, vf commands may be executed from both > iavf_dev_alarm_handler() in a control thread and the applications main > thread. This is trivial to simulate in the testpmd application by > creating a bond of vf's in active backup mode, and then turning the > bond off and then on again repeatedly. > > Previously [1] was proposed as a potential solution, but this commit did > not resolve all potential issues concerning the admin queue and has been > reverted from the stable branch. I propose adding locks until a more > complete solution is available. > > [1] commit cb5c1b91f76f ("net/iavf: add thread for event callbacks") > > Fixes: 48de41ca11f0 ("net/avf: enable link status update") > Fixes: 84108425054a ("net/iavf: support asynchronous virtual channel message") > Cc: stable@dpdk.org > > Signed-off-by: Mike Pattrick Review please. -- David Marchand