From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cstnet.cn (smtp20.cstnet.cn [159.226.251.20]) by dpdk.org (Postfix) with ESMTP id 578C11DF95 for ; Thu, 14 Jun 2018 14:44:54 +0200 (CEST) Received: from macbook-pro-4.kingsoft.cn (unknown [114.255.44.139]) by APP-10 (Coremail) with SMTP id tACowADX3dVDYyJbRq_4Bg--.30977S2; Thu, 14 Jun 2018 20:44:51 +0800 (CST) From: HePeng Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Message-Id: <462941BC-FB45-46BD-8FB2-3455887D6BAB@icloud.com> Date: Thu, 14 Jun 2018 20:44:51 +0800 Cc: dev@dpdk.org To: maxime.coquelin@redhat.com X-Mailer: Apple Mail (2.3445.6.18) X-CM-TRANSID: tACowADX3dVDYyJbRq_4Bg--.30977S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtw43ArWxZr4UtFWUGFyfJFb_yoWfJwc_uF 48Zw1UGa15Cr4rCFW5G342qrWUXw18u3WxK3WktrW29Fn7Jr1jvFnIvF9aqw4UWwn2kF1I kr1kCF1rAa4IkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbFxYjsxI4VWDJwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVWUJVW8JwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I 8E87Iv6xkF7I0E14v26r4UJVWxJr1lnxkEFVAIw20F6cxK64vIFxWle2I262IYc4CY6c8I j28IcVAaY2xG8wAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx 8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI48JMxC20s02 6xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_JrI_JrWlx2IqxVCjr7xvwVAFwI0_Jr I_JrWlx4CE17CEb7AF67AKxVWUXVWUAwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v2 6r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj4 0_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j 6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j8fHUUUUUU= X-Originating-IP: [114.255.44.139] X-CM-SenderInfo: h0qk1iqtsqqxpfor3voofrz/ Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] Missing an increment on vq->log_cache_nb_elem ? X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 12:44:55 -0000 Hi, In the latest dpdk master branch, in the function *vhost_log_cache_page*: static __rte_always_inline void vhost_log_cache_page(struct virtio_net *dev, struct vhost_virtqueue *vq, uint64_t page) { uint32_t bit_nr = page % (sizeof(unsigned long) << 3); uint32_t offset = page / (sizeof(unsigned long) << 3); int i; for (i = 0; i < vq->log_cache_nb_elem; i++) { struct log_cache_entry *elem = vq->log_cache + i; if (elem->offset == offset) { elem->val |= (1UL << bit_nr); return; } } if (unlikely(i >= VHOST_LOG_CACHE_NR)) { /* * No more room for a new log cache entry, * so write the dirty log map directly. */ rte_smp_wmb(); vhost_log_page((uint8_t *)(uintptr_t)dev->log_base, page); return; } vq->log_cache[i].offset = offset; vq->log_cache[i].val = (1UL << bit_nr); } Did it just miss an increment on vq->log_cache_nb_elem ?