From: Wang Xiao W Date: Mon, 28 Mar 2016 00:39:56 +0000 (+0800) Subject: ixgbe: fail if too many queues for interrupt X-Git-Tag: spdx-start~7145 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5bcd7b5d2fb0c9043a8567c637ab128de772c9c1;p=dpdk.git ixgbe: fail if too many queues for interrupt The lower 16 bits of EICR register are used for queue interrupts, dpdk framework take over the first bit for other interrupts like LSC, so there're only 15 bits left for queue interrupts mapping. This patch adds a check for the num of interrupt queues at dev_start. Signed-off-by: Wang Xiao W Acked-by: Wenzhuo Lu --- diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 5812d1072b..8961454aba 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2131,6 +2131,11 @@ ixgbe_dev_start(struct rte_eth_dev *dev) !RTE_ETH_DEV_SRIOV(dev).active) && dev->data->dev_conf.intr_conf.rxq != 0) { intr_vector = dev->data->nb_rx_queues; + if (intr_vector > IXGBE_MAX_INTR_QUEUE_NUM) { + PMD_INIT_LOG(ERR, "At most %d intr queues supported", + IXGBE_MAX_INTR_QUEUE_NUM); + return -ENOTSUP; + } if (rte_intr_efd_enable(intr_handle, intr_vector)) return -1; } diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h index a7b1eb51f9..4ff6338e9d 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.h +++ b/drivers/net/ixgbe/ixgbe_ethdev.h @@ -59,6 +59,7 @@ #define IXGBE_VFTA_SIZE 128 #define IXGBE_VLAN_TAG_SIZE 4 #define IXGBE_MAX_RX_QUEUE_NUM 128 +#define IXGBE_MAX_INTR_QUEUE_NUM 15 #define IXGBE_VMDQ_DCB_NB_QUEUES IXGBE_MAX_RX_QUEUE_NUM #define IXGBE_DCB_NB_QUEUES IXGBE_MAX_RX_QUEUE_NUM #define IXGBE_NONE_MODE_TX_NB_QUEUES 64