From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH 1/5] ethdev: check for rxq interrupt support Date: Mon, 18 May 2015 10:40:10 -0700 Message-ID: <1431970814-25951-2-git-send-email-stephen@networkplumber.org> References: <1431970814-25951-1-git-send-email-stephen@networkplumber.org> Cc: dev@dpdk.org To: cumming.lian@intel.com Return-path: Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by dpdk.org (Postfix) with ESMTP id BFABAB38D for ; Mon, 18 May 2015 19:40:12 +0200 (CEST) Received: by pdbnk13 with SMTP id nk13so62666559pdb.1 for ; Mon, 18 May 2015 10:40:12 -0700 (PDT) In-Reply-To: <1431970814-25951-1-git-send-email-stephen@networkplumber.org> 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" Not all devices support rxq interrupt yet. It is better to check for interrupt support in driver at configuration time than waiting for later failures. Signed-off-by: Stephen Hemminger --- lib/librte_ether/rte_ethdev.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index cb586ff..ad15837 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1183,6 +1183,14 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, } /* + * If Receive Queue interrupt is enabled, check that + * the device supports interrupt control. + */ + if (dev_conf->intr_conf.rxq == 1) + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_intr_enable, + -EINVAL); + + /* * If jumbo frames are enabled, check that the maximum RX packet * length is supported by the configured device. */ -- 2.1.4