From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Liang, Cunming" Subject: Re: [PATCH v8 08/11] ethdev: add rx intr enable, disable and ctl functions Date: Fri, 22 May 2015 10:17:21 +0800 Message-ID: <555E91B1.7090005@intel.com> References: <1430804386-28949-1-git-send-email-cunming.liang@intel.com> <1432198563-16334-1-git-send-email-cunming.liang@intel.com> <1432198563-16334-9-git-send-email-cunming.liang@intel.com> <20150521112030.4d31a0e4@urahara> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, liang-min.wang@intel.com To: Stephen Hemminger Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1A20D56B7 for ; Fri, 22 May 2015 04:17:23 +0200 (CEST) In-Reply-To: <20150521112030.4d31a0e4@urahara> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 5/22/2015 2:20 AM, Stephen Hemminger wrote: > On Thu, 21 May 2015 16:56:00 +0800 > Cunming Liang wrote: > >> +int >> +rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, >> + int epfd, int op, void *data) >> +{ >> + uint32_t vec; >> + struct rte_eth_dev *dev; >> + struct rte_intr_handle *intr_handle; >> + int rc; >> + >> + if (!rte_eth_dev_is_valid_port(port_id)) { >> + PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); > Use %u when printing unsigned value Agree. > >> + return -ENODEV; >> + } >> + >> + dev = &rte_eth_devices[port_id]; >> + if (dev == NULL) { >> + PMD_DEBUG_TRACE("Invalid port device\n"); >> + return -ENODEV; >> + } > Another unnecessary conditional check, already done in rte_eth_dev_is_valid_port Yes, it's not necessary anymore. >> + >> + if (queue_id >= dev->data->nb_rx_queues) { >> + PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", rx_queue_id); > This is wrong, won't build with debug enabled, You meant to use queue_id > here and use %u I'm sorry, that's a mistake, thanks. >> + return -EINVAL; >> + } >> + >> + intr_handle = &dev->pci_dev->intr_handle; >> + if (!intr_handle->intr_vec) { >> + PMD_DEBUG_TRACE("RX Intr vector unset\n"); >> + return -EPERM; >> + } >> +