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 CE59B41DB5; Thu, 2 Mar 2023 10:26:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74AE040E09; Thu, 2 Mar 2023 10:26:30 +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 EA87E40DFB for ; Thu, 2 Mar 2023 10:26:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677749188; 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=X/s/6HwPmqxZH/Yx/Q+UVt7N+fqGrocGvMikywU5hx8=; b=DNPJWxXSogyex/ZzK9VH7zXOBn75ySHl3f7D7EFHDKho6pqaNCx1Ns5IRf3uXmureVd7Ey NsoNgx3k7arSZtXfehJTvb6qC7BGZm0tPxG8KvH0eRFKwPw+66wHykO1gVZ8Gqtw0BaT5d NUQAzYHwDDbSQ/h5djhnU0RBUvaYDbA= Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-583-r2A6Zs7yNIiYgcQxzHr3Nw-1; Thu, 02 Mar 2023 04:26:27 -0500 X-MC-Unique: r2A6Zs7yNIiYgcQxzHr3Nw-1 Received: by mail-pg1-f198.google.com with SMTP id 10-20020a63030a000000b004fb64e929f2so5353783pgd.7 for ; Thu, 02 Mar 2023 01:26:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677749186; 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=X/s/6HwPmqxZH/Yx/Q+UVt7N+fqGrocGvMikywU5hx8=; b=5+0iDW9Ryjf1z3yvMSCuqEmW2xCRSMM4k3Hlul98dfWNF1L8LlO4eQuIVSLqmaVco6 jEtd3QwrENWiu1w9OvgsYZCole+oFr2hfhIIFckl4odCIVUpdT+PGx7QZdlwjyVtpTDg ZX0JtxyzmQo3ZQsy8PuIdHeUa8PvA9VOZOpMZN04as7yyHoH2jaXFSmExW/DLGjoMqtm AaEaJwEtquSzPWhT8v4ZgdpbQr3FBGnzjtaHus01pBGmr2jhOP51pXvcoJVRnIivMrgL xqIS9BFMT3ZzxD/F1o6SsesirgyeA/se+78AD+T/cl/QtEfxQaRcTxpgNLm1KhA/S96J 4wlw== X-Gm-Message-State: AO0yUKV99B4uNCL/whgqqfFd0+5dHhX8RMC0nsdcHIaiVociRP3HgQ7q rzY83E/WJcxPi7tjtPeNCXAmnTBi6yyrL+wmJHz81+32UXA71KQu4MuS8bsDQUKEzV2IVO9DtaK kj/RptpoeurIYkOnmODY= X-Received: by 2002:a05:6a00:1d9f:b0:5a8:aaa1:6c05 with SMTP id z31-20020a056a001d9f00b005a8aaa16c05mr663027pfw.2.1677749186327; Thu, 02 Mar 2023 01:26:26 -0800 (PST) X-Google-Smtp-Source: AK7set+mfSaeneZOan63i97JTHP2lzEHoVLsgbMqybrR4lv1nCVuz6AyJn9FE+TWqlGsp3jnI9rjhVkGrZz6hYMw6Jg= X-Received: by 2002:a05:6a00:1d9f:b0:5a8:aaa1:6c05 with SMTP id z31-20020a056a001d9f00b005a8aaa16c05mr663023pfw.2.1677749186014; Thu, 02 Mar 2023 01:26:26 -0800 (PST) MIME-Version: 1.0 References: <20230224081642.2566619-1-david.marchand@redhat.com> <20230224151143.3274897-1-david.marchand@redhat.com> <20230224151143.3274897-12-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Thu, 2 Mar 2023 10:26:14 +0100 Message-ID: Subject: Re: [PATCH v2 11/20] net/virtio: annotate lock for guest announce To: Maxime Coquelin , "Xia, Chenbo" Cc: "dev@dpdk.org" , "thomas@monjalon.net" 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 On Mon, Feb 27, 2023 at 5:28 PM Maxime Coquelin wrote: > As discussed with David off-list, I think we could simplify and inline > virtio_dev_pause()/virtio_dev_resume() into virtio_notify_peers() since > there are no other users of these functions (see below). I was looking at doing this and, as we discussed offlist, realised what the "inject" code was doing. I don't like the idea of keeping virtio_inject_pkts as a helper. This is tightly linked to the hw->started + usleep() trick, and this code has no check about its requirement on hw->started == 0. I'd rather "inline" and remove this helper too. As a second step, I wrote a fix using an additional lock per txq to remove this usleep() thing. Though I think it is too late to consider merging this new change in the release. WDYT? -- David Marchand