Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933508AbcCIRIW (ORCPT ); Wed, 9 Mar 2016 12:08:22 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:58741 "EHLO e06smtp15.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbcCIRIN (ORCPT ); Wed, 9 Mar 2016 12:08:13 -0500 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: fbarrat@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] cxl: Add mechanism for delivering AFU driver specific events To: Vaibhav Jain , Ian Munsie , Michael Ellerman , linux-kernel , Matt Ochs , Manoj Kumar References: <1457401715-26435-1-git-send-email-imunsie@au.ibm.com> <87a8m7iunv.fsf@vajain21.in.ibm.com> Cc: linuxppc-dev , Michael Neuling From: Frederic Barrat Message-ID: <56E05876.6090006@linux.vnet.ibm.com> Date: Wed, 9 Mar 2016 18:08:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <87a8m7iunv.fsf@vajain21.in.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16030917-0021-0000-0000-000020870A1C Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 948 Lines: 28 Hi Vaibhav, Le 09/03/2016 15:37, Vaibhav Jain a écrit : > I would propose these two apis. > > /* > * fetches an event from the driver event queue. NULL means that queue > * is empty. Can sleep if needed. The memory for cxl_event is allocated > * by module being called. Hence it can be potentially be larger then > * sizeof(struct cxl_event). Multiple calls to this should return same > * pointer untill ack_event is called. > */ > struct cxl_event * fetch_event(struct cxl_context * ctx); > > /* > * Returns and acknowledge the struct cxl_event * back to the driver > * which can then free it or maybe put it back in a kmem_cache. This > * should be called once we have completely returned the current > * struct cxl_event from the readcall > */ > void ack_event(struct cxl_context * ctx, struct cxl_event *); How would you implement polling on those APIs? How would you implement afu_read? There are several sources of events. Fred