From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753377AbcAQJZA (ORCPT ); Sun, 17 Jan 2016 04:25:00 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34701 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751514AbcAQJY4 (ORCPT ); Sun, 17 Jan 2016 04:24:56 -0500 Subject: Re: [PATCH 07/13] IB: add a proper completion queue abstraction To: Parav Pandit , Christoph Hellwig References: <1449521512-22921-1-git-send-email-hch@lst.de> <1449521512-22921-8-git-send-email-hch@lst.de> Cc: linux-rdma@vger.kernel.org, Bart Van Assche , axboe@fb.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org From: Sagi Grimberg Message-ID: <569B5DE3.1010908@dev.mellanox.co.il> Date: Sun, 17 Jan 2016 11:24:51 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Hi Christoph, Sagi, > > On Tue, Dec 8, 2015 at 2:21 AM, Christoph Hellwig wrote: > >> +static void ib_cq_poll_work(struct work_struct *work) >> +{ >> + struct ib_cq *cq = container_of(work, struct ib_cq, work); >> + int completed; >> + >> + completed = __ib_process_cq(cq, IB_POLL_BUDGET_WORKQUEUE); >> + if (completed >= IB_POLL_BUDGET_WORKQUEUE || >> + ib_req_notify_cq(cq, IB_POLL_FLAGS) > 0) >> + queue_work(ib_comp_wq, &cq->work); >> +} > > In above code, Let says completion is added in a time window where > ib_process_cq is completed (CQ is diarmed in hw at that point) and > ib_req_notify_cq is yet to be called. > Provider vendor driver say mlx4 or mlx5 as specific case always > returns ib_req_notify_cq = 0. > Will it result into a missed notification? (so queue_work is not done). If we have not drained the CQ (consumed budget or more) the second condition (ib_req_notify_cq) will not be invoked. We are only rearming the CQ when we drained it completely. So I don't see how we can end up with missed notifications.