From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 21 May 2015 19:17:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,473,1427785200"; d="scan'208";a="714004512" Received: from shwdeisgchi017.ccr.corp.intel.com (HELO [10.239.66.47]) ([10.239.66.47]) by fmsmga001.fm.intel.com with ESMTP; 21 May 2015 19:17:22 -0700 Message-ID: <555E91B1.7090005@intel.com> Date: Fri, 22 May 2015 10:17:21 +0800 From: "Liang, Cunming" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Stephen Hemminger 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> In-Reply-To: <20150521112030.4d31a0e4@urahara> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, liang-min.wang@intel.com Subject: Re: [dpdk-dev] [PATCH v8 08/11] ethdev: add rx intr enable, disable and ctl 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: Fri, 22 May 2015 02:17:24 -0000 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; >> + } >> +