From patchwork Mon Jan 29 15:21:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chas Williams <3chas3@gmail.com> X-Patchwork-Id: 34658 X-Patchwork-Delegate: helin.zhang@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 44F441B7AE; Mon, 29 Jan 2018 16:21:24 +0100 (CET) Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by dpdk.org (Postfix) with ESMTP id 423231B7AD for ; Mon, 29 Jan 2018 16:21:22 +0100 (CET) Received: by mail-qt0-f193.google.com with SMTP id o35so13057489qtj.13 for ; Mon, 29 Jan 2018 07:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6svBZjCOO8IAq/gJhSeiO5ELDjpOBBwgy3MctGUHgeM=; b=sijBJTiGsPV3748tXzz6O2Xa/ggO7gcvJR7Vh5r25HZrQh04AGWL3VOjsSn/bzihFG QcsmQ1VKQtWI/JtQFbLDYJyDyloMgeSfVdpwzRSH04jXMWuvYA/5uysW2pOdOnKQgy/W Xs3XdLbpwB5xLroWqsbv1Awjby17F9Vh+VUtgYduSI1/RUaSMA53U0jAQlbOb+Is0ekV wBR6VstqN9oNFDzuHeIzFgKBy5OPPaiulKYZceY7ZYSV/EjzNh0RQ663a+0ICUL8xErK 84L07Qmd+F0k+VHz6JDJuuZgOLXw986dQcLxct+/KQR43TI57z55/n9bgeDLZ02Kusge TUvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6svBZjCOO8IAq/gJhSeiO5ELDjpOBBwgy3MctGUHgeM=; b=MRLsU9YVRpdxn1WPGeERfvo/bRyyyrVkvZOl9EGh8CPSHoRRr4fncnt/V1aWIJHjGM NPkTLnKaBWyV+YgdgD7Jc2tArjGC+sh8aFrinQXHS+5jqXt9gO8TxHuQ5WBAHxV1+3h+ r+IWdAMnzvuaG31WyQEraMB2MNVnU1X5BeROfwjC78jtHm2XYT4/MSDAzb7C4OFysYde ij+oIQ6Gc9O3vguevTrx/WvVHm0e4WKAwCIE4Xs9+qlHnJf7XXD6UD3+dPOXLHJ/6bVu 6HsHP6R94NxdvC09ZSCOUvTq5qGJvruHUXshGjNd+znxcpjxpFMxvxHh5lFMlaOkZeeM BGSg== X-Gm-Message-State: AKwxytfN+K2kObMr2REivMNfmsccntxlkxY++PEE+F5rBqaLBF/0NnVm CTzkb5xe4PvmPvCyB5mDQKpLfQ== X-Google-Smtp-Source: AH8x227pCEaXWf3/RY7TX4OXKuHIdgT+pIMimXFMkJHKcGeltLOqwBRiwXML8WJN2R+evPZk7++4dw== X-Received: by 10.200.52.70 with SMTP id v6mr38055452qtb.63.1517239281282; Mon, 29 Jan 2018 07:21:21 -0800 (PST) Received: from monolith.home (pool-173-79-224-159.washdc.fios.verizon.net. [173.79.224.159]) by smtp.gmail.com with ESMTPSA id o12sm7782100qki.96.2018.01.29.07.21.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jan 2018 07:21:20 -0800 (PST) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, "Charles (Chas) Williams" Date: Mon, 29 Jan 2018 10:21:15 -0500 Message-Id: <20180129152115.26359-1-3chas3@gmail.com> X-Mailer: git-send-email 2.9.5 Subject: [dpdk-dev] [PATCH] net/ixgbe: fix reconfiguration of rx queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: "Charles (Chas) Williams" .dev_configure() may be called again after RX queues have been setup. This has the effect of clearing whatever setting the RX queues made for rx_bulk_alloc_allowed or rx_vec_allowed. Only reset this configuration is there aren't any currently allocated queues. Fixes: 01fa1d6215fa ("ixgbe: unify Rx setup") Signed-off-by: Chas Williams --- drivers/net/ixgbe/ixgbe_ethdev.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 37eb668..b39249a 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2348,6 +2348,7 @@ ixgbe_dev_configure(struct rte_eth_dev *dev) struct ixgbe_adapter *adapter = (struct ixgbe_adapter *)dev->data->dev_private; int ret; + uint16_t i; PMD_INIT_FUNC_TRACE(); /* multipe queue mode checking */ @@ -2363,11 +2364,17 @@ ixgbe_dev_configure(struct rte_eth_dev *dev) /* * Initialize to TRUE. If any of Rx queues doesn't meet the bulk - * allocation or vector Rx preconditions we will reset it. + * allocation or vector Rx preconditions we will reset it. We + * can only do this is there aren't any existing RX queues. */ + for (i = 0; i < dev->data->nb_rx_queues; i++) { + if (dev->data->rx_queues[i]) + goto out; + } adapter->rx_bulk_alloc_allowed = true; adapter->rx_vec_allowed = true; +out: return 0; } @@ -4959,6 +4966,7 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev) struct rte_eth_conf *conf = &dev->data->dev_conf; struct ixgbe_adapter *adapter = (struct ixgbe_adapter *)dev->data->dev_private; + uint16_t i; PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d", dev->data->port_id); @@ -4981,11 +4989,17 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev) /* * Initialize to TRUE. If any of Rx queues doesn't meet the bulk - * allocation or vector Rx preconditions we will reset it. + * allocation or vector Rx preconditions we will reset it. We + * can only do this is there aren't any existing RX queues. */ + for (i = 0; i < dev->data->nb_rx_queues; i++) { + if (dev->data->rx_queues[i]) + goto out; + } adapter->rx_bulk_alloc_allowed = true; adapter->rx_vec_allowed = true; +out: return 0; }