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 054991D670 for ; Fri, 15 Jun 2018 15:28:39 +0200 (CEST) Received: from [192.168.31.186] (unknown [1.202.79.209]) by APP-10 (Coremail) with SMTP id tACowADX39cFvyNbSYZABw--.5237S2; Fri, 15 Jun 2018 21:28:37 +0800 (CST) Content-Type: text/plain; charset=gb2312 Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) From: HePeng In-Reply-To: Date: Fri, 15 Jun 2018 21:28:13 +0800 Cc: Ilya Maximets , dev@dpdk.org, Tiwei Bie , Zhihong Wang Content-Transfer-Encoding: quoted-printable Message-Id: <7B89973D-4D0D-4BF8-B369-D76F9216E7F6@icloud.com> References: <462941BC-FB45-46BD-8FB2-3455887D6BAB@icloud.com> <20180615123208eucas1p1e5d258f95e9621a31c2fcfbf1f494476~4VVxsfFEy3007530075eucas1p1f@eucas1p1.samsung.com> To: Maxime Coquelin X-Mailer: Apple Mail (2.3445.6.18) X-CM-TRANSID: tACowADX39cFvyNbSYZABw--.5237S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Zw1DJF4xKF4kGFy5uw45KFg_yoW8CFykpF WxGFn0yFs7XFy0gF4Svws0ya40vryDGF17ZwsxG3WrAa909r1UtFyIy343uayDArZ7Cw4f Aa1UKFZxWan5CF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUklb7Iv0xC_Zr1lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwV C2z280aVCY1x0267AKxVW8Jr0_Cr1UM2vYz4IE04k24VAvwVAKI4IrM2AIxVAIcxkEcVAq 07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r 18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vI r41l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxV WUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI 7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r 1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4U MIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8XJ55UUUU U== X-Originating-IP: [1.202.79.209] X-CM-SenderInfo: h0qk1iqtsqqxpfor3voofrz/ Subject: Re: [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: Fri, 15 Jun 2018 13:28:41 -0000 Hi, Maxime, My name is Peng He.=20 Thanks.=20 > =D4=DA 2018=C4=EA6=D4=C215=C8=D5=A3=AC=CF=C2=CE=E79:24=A3=ACMaxime = Coquelin =D0=B4=B5=C0=A3=BA >=20 > Hi, >=20 > On 06/15/2018 02:32 PM, Ilya Maximets wrote: >>> Hi, >>>=20 >>>=20 >>> In the latest dpdk master branch, in the function = *vhost_log_cache_page*: >>>=20 >>>=20 >>> static __rte_always_inline void >>> vhost_log_cache_page(struct virtio_net *dev, struct vhost_virtqueue = *vq, >>> uint64_t page) >>> { >>> uint32_t bit_nr =3D page % (sizeof(unsigned long) << 3); >>> uint32_t offset =3D page / (sizeof(unsigned long) << 3); >>> int i; >>>=20 >>> for (i =3D 0; i < vq->log_cache_nb_elem; i++) { >>> struct log_cache_entry *elem =3D vq->log_cache + i; >>>=20 >>> if (elem->offset =3D=3D offset) { >>> elem->val |=3D (1UL << bit_nr); >>> return; >>> } >>> } >>>=20 >>> if (unlikely(i >=3D 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); >>>=20 >>> return; >>> } >>>=20 >>> vq->log_cache[i].offset =3D offset; >>> vq->log_cache[i].val =3D (1UL << bit_nr); >>> } >>>=20 >>> Did it just miss an increment on vq->log_cache_nb_elem ? >> Hi. Thanks for pointing that. >> I looked through the code and I see no updates of = 'vq->log_cache_nb_elem'. >> Looks like it always equal to initial zero value. >> Maxime, I'm afraid that this means that currently pages logging is = not >> performed at all. Could you please check? >> Best regards, Ilya Maximets. >=20 > Thanks Ilya for the heads-up and HePeng for reporting the issue. > It is broken indeed... We didn't noticed corruption when running > our non-reg tests, I guess they have to be improved. >=20 > I will post a patch shortly to fix this. >=20 > HePeng, how does your name spells in the form "$firstname $lastname"? > I would need this info to credit you for reporting the issue. >=20 > Regards, > Maxime