From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2 1/5] ethdev: add rx interrupt enable/disable functions Date: Tue, 3 Feb 2015 15:42:36 -0800 Message-ID: <20150203154236.4af58a57@urahara> 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-VfR2kkLFssw@public.gmane.org To: Zhou Danny Return-path: In-Reply-To: <1422951511-28143-2-git-send-email-danny.zhou-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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.