> -----Original Message----- > From: Stephen Hemminger [mailto:stephen at networkplumber.org] > Sent: Wednesday, February 04, 2015 7:43 AM > To: Zhou, Danny > Cc: dev at dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 1/5] ethdev: add rx interrupt > enable/disable functions > > On Tue, 3 Feb 2015 16:18:27 +0800 > Zhou Danny <danny.zhou at intel.com> 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.
Well, for ixgbe and igb, PMD just sets the specific bit on the interrupt mask register without checking if it fails or not. But I agree it should allow return errors. Will provide a fix for both enable and disable functions in v3 patch set.