Hi Stephen, Although it is original code logic, But we can move vq_update_avail_idx(rxvq) into if block to resolve it. What do you think of it?
Thanks Changchun -----Original Message----- From: Xie, Huawei Sent: Tuesday, January 27, 2015 3:57 PM To: Ouyang, Changchun; dev at dpdk.org Cc: Stephen Hemminger (stephen at networkplumber.org) Subject: RE: [dpdk-dev] [PATCH v2 02/24] virtio: Use weaker barriers >-------if (likely(nb_enqueued)) { >------->-------virtio_wmb(); >------->-------if (unlikely(virtqueue_kick_prepare(rxvq))) { >------->------->-------virtqueue_notify(rxvq); >------->------->-------PMD_RX_LOG(DEBUG, "Notified\n"); >------->-------} >-------} >-------vq_update_avail_idx(rxvq); Two confuses for the modification here: 1. why notify host without updating avail idx? Will this cause potential deadlock? 2. Why update avail index even no packets are enqueued?