From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id 27D5EAD89 for ; Wed, 4 Feb 2015 00:42:56 +0100 (CET) Received: by mail-pa0-f43.google.com with SMTP id eu11so102366239pac.2 for ; Tue, 03 Feb 2015 15:42:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=5Dj/EgSkP49VrdmQO7rV/t23+h0UcwoyT71cJB6ZWFo=; b=Zn1sjQExvxL1pgJyf4gzD/3V+v65frsaOdIBLj/2C6Tif2RitVb5q7nGPp2WBSAgFd wHZRZHTq9kJ9OmRxLUoWDnqYNrfcZulQZsaeDYsLFOvC0aGWTXMISyYHfAU0B3NSSN1d xa8/UAILjNIkOqZc6fc6iEufxCUx+R192ny8cFARYnEcBNatedckVcQcdk0cOYjYsStZ lBj8nIuDD4B1mx4yMO2tI2OSsxtDm/uTDL3uAsmeac3BS9sHmPav4SpXrSVkrjHWP50c BJlL1DSh85yeaecwkDeAt0mtySulM20U+Q/AooKhpUtYJaL98ZOTdBcc5p/3YD753/Vj 4HlA== X-Gm-Message-State: ALoCoQkOwkllZp4kfCaXQh3LqRol6XK93zALWMZS+Zw302SZ482V99tZ69hyT2jYsJ7UAfjMLqpN X-Received: by 10.68.94.69 with SMTP id da5mr41163865pbb.99.1423006960494; Tue, 03 Feb 2015 15:42:40 -0800 (PST) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id qo10sm30590pbc.18.2015.02.03.15.42.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Feb 2015 15:42:39 -0800 (PST) Date: Tue, 3 Feb 2015 15:42:36 -0800 From: Stephen Hemminger To: Zhou Danny Message-ID: <20150203154236.4af58a57@urahara> In-Reply-To: <1422951511-28143-2-git-send-email-danny.zhou@intel.com> References: <1422951511-28143-1-git-send-email-danny.zhou@intel.com> <1422951511-28143-2-git-send-email-danny.zhou@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2 1/5] ethdev: add rx interrupt enable/disable functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2015 23:42:56 -0000 On Tue, 3 Feb 2015 16:18:27 +0800 Zhou Danny wrote: > + > +int > +rte_eth_dev_rx_queue_intr_enable(uint8_t port_id, > + uint16_t queue_id) > +{ > + struct rte_eth_dev *dev; > + > + if (port_id >= nb_ports) { > + PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); > + return (-ENODEV); > + } > + > + dev = &rte_eth_devices[port_id]; > + if (dev == NULL) { > + PMD_DEBUG_TRACE("Invalid port device\n"); > + return (-ENODEV); > + } > + > + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_intr_enable, -ENOTSUP); > + (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id); > + return 0; The interrupt setup might fail for device specific reasons. You should give the device specific function a chance to return error as well.