From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8D181A04B1 for ; Mon, 24 Aug 2020 17:50:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E8FA6F72; Mon, 24 Aug 2020 17:50:22 +0200 (CEST) Received: from mail-vk1-f181.google.com (mail-vk1-f181.google.com [209.85.221.181]) by dpdk.org (Postfix) with ESMTP id 1F56CF04 for ; Mon, 24 Aug 2020 17:50:22 +0200 (CEST) Received: by mail-vk1-f181.google.com with SMTP id m12so2095900vko.5 for ; Mon, 24 Aug 2020 08:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=hB6aWySThEhT++kzThZpI2xiXL2qvvNQISoJaYYIWoI=; b=nQj8N39B4m/mFe/v00KkHZ9ZDV3kAupAg9qsP++19EYbkMGhiplEi6WUV43JdEq/9u V3bFLFU1X/P909jDC7DtJ/b8qPfXFgQBYVd8LTob5QqhV4BxS6AUOohCbgvIjZuvFVFv vuJsKE855OmGDJT9/oBGkcVC3CzcPz4scXJIqUyF3gB8p5tVlK1/ySpise4hk9xaK7Lr BPPlL3dqFHl3vEqR59c49nqEzWe0JfjJGAKFn9wJND1ZJ+2F7VJuV/uLLq13DmlJ5+Zg wl0qtl4nccIirNCreC0aGua8X3JZ56nRDrJ7psX7eiH0/heGUuSOaeMfVUPVD1HSxBBL V+fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=hB6aWySThEhT++kzThZpI2xiXL2qvvNQISoJaYYIWoI=; b=bFLJhqUuDwQnOV1gPEgDGKeNSwzwcBVzbprSbMvGYi1mD3Bv6E+uRDupWToK8oPz+B 9ME7MCHok2++TgrdEcp2ZOHkCjQQhw7lUCQj1pGHf/HeWvHm5tjXlC7hxAA1eJIhSSxf EgYC5/hZxwwK12yHD0Kw0cVQ3vU/Byh3NXGjs/qGOQ7uNse9k9uC3ofU+d4iOPIae72U F1dIx4OrSkajPBmhCoQzPqnG1hJkkieNuuuKogFG8fLJWTAtq275U4Wh1U8dIHXEhFLT RKWk7KT685LlO1jPQ5uRzBRIBL3nsyRIHK1N2DZkiePbsNJcE+vpwro+Iec3tV1mOvLP Eggw== X-Gm-Message-State: AOAM533QCISiuRtem2+JvUhbox8fwAq3cJ0mYTRfVCs/hZmX1VAQMLH/ JfyBSCv8zTKxnR5qFd2ZAVpFeKpV5T6SB8GXdXZvzCVcUNA= X-Google-Smtp-Source: ABdhPJw9JHSAAFEq9YfGZYj7dIIflSAUfZD8+wRHQLWD0PcMF6rIVcg6k6dem5rOQfF5Ioj+ThJwEpxtINWMi5Ss7HA= X-Received: by 2002:a1f:f28f:: with SMTP id q137mr3137857vkh.44.1598284221262; Mon, 24 Aug 2020 08:50:21 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?6ams5bCU5pav?= Date: Mon, 24 Aug 2020 23:50:10 +0800 Message-ID: To: users@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] Why is the order of atomic read/write like in queue_update_status in rte_eth_vhost.c? X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" /* Wait until rx/tx_pkt_burst stops accessing vhost device */ for (i = 0; i < dev->data->nb_rx_queues; i++) { vq = dev->data->rx_queues[i]; if (vq == NULL) continue; rte_atomic32_set(&vq->allow_queuing, allow_queuing); while (rte_atomic32_read(&vq->while_queuing)) rte_pause(); } I think we will set the queue's allow_queuing, and the comment above says we would wait while queue is bursting. Why wait after atomic set rather than before aotmic set? Does the rte_pause() loop means wait? Best wishes!