From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 51F89997A for ; Wed, 2 Aug 2017 16:11:04 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id m85so42751925wma.1 for ; Wed, 02 Aug 2017 07:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=zhMN+vIYKYMXJyJ+sbiGCvOfYfrPhRm/TspjndnRY74=; b=vl8ks0oJtaXIblbverLXON8c6Bs6LB7ElbQHH0uiCSWIebQJ5wjhrGhiZk5zE/aIHL ZHmesph/sB7UNc24WqpcD/qssnN3zcYsEHQ8QTDmfjqUbaXIWgZe3/7GMqfdPK8/mqjk 1fmlnlfylcCkkNj36n2mwSRNL9ZZ81citLeKlMcjuHgnb5erWbimWlG/IMhuxNfsmKCW jOYU8HkR7xj537BapMMI5WBOxpWF5LJSmfBdjXIKz1+gJBGN6rHIVBK3ji/v6ng8NUSn yPgQ3FTlzd4WWcgnHogqO4s1lgmd2T1mu3AnI9RNJkzcq8G+no1ojov5+iFcXXfvkCak WjQw== 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:in-reply-to :references:in-reply-to:references; bh=zhMN+vIYKYMXJyJ+sbiGCvOfYfrPhRm/TspjndnRY74=; b=MIvcDPwJmwa1PBg2mrRc0aAkHzaJXCrMF9qfOUkWbeEwkWAfDmniNhv3HTYspupcvp R2kO3f728ZV9LM2/x748KMGgVyjcktVSdd/DmZgveB6uZYgzK7Pdr7rB7XibaXaXfZFF hTJrtSf5q1OhdmAv10GVrBQl/XW8S0Md4bsrO/fzfQxWL5Qro5ZvKh1xGWpr28q4Cf2L Wgzjv32p+3txx2Tpko/SCFw6YVIqgUGgwJu2Lf+/FOizTV1PCt2bJcsQT8ZkGDpa/eJY UCZO8W57t49qOHxguIWkleDU6KPn2zL+h4WpeKT9Em6Ngq3ll5dZVX9bWzcloWdZlLg3 u+OA== X-Gm-Message-State: AIVw1111NKb/7KFBYpp8X3myIDpskqsEwo651bmf1b5Olk7CYrSwG81U EsWKEHOXfWRwcOjv1sEZ8w== X-Received: by 10.28.128.213 with SMTP id b204mr3717126wmd.128.1501683063778; Wed, 02 Aug 2017 07:11:03 -0700 (PDT) Received: from ping.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id d53sm39449552wrd.81.2017.08.02.07.11.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 07:11:03 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: adrien.mazarguil@6wind.com Date: Wed, 2 Aug 2017 16:10:21 +0200 Message-Id: <89fe0014db6dafa828d1ab97ebd9539230d6073d.1501681927.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v1 05/21] net/mlx5: remove redundant started flag 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: , X-List-Received-Date: Wed, 02 Aug 2017 14:11:04 -0000 This flag is already present in the Ethernet device. Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5.h | 1 - drivers/net/mlx5/mlx5_flow.c | 6 +++--- drivers/net/mlx5/mlx5_rxq.c | 2 +- drivers/net/mlx5/mlx5_trigger.c | 12 ------------ drivers/net/mlx5/mlx5_txq.c | 2 +- 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 155dd76..40c3475 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -103,7 +103,6 @@ struct priv { /* Device properties. */ uint16_t mtu; /* Configured MTU. */ uint8_t port; /* Physical port number. */ - unsigned int started:1; /* Device started, flows enabled. */ unsigned int promisc_req:1; /* Promiscuous mode requested. */ unsigned int allmulti_req:1; /* All multicast mode requested. */ unsigned int hw_csum:1; /* Checksum offload is supported. */ diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 77b85a6..996fe31 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1053,7 +1053,7 @@ priv_flow_create_action_queue_drop(struct priv *priv, ++flow->ibv_attr->num_of_specs; flow->offset += sizeof(struct ibv_exp_flow_spec_action_drop); rte_flow->ibv_attr = flow->ibv_attr; - if (!priv->started) + if (!priv->dev->data->dev_started) return rte_flow; rte_flow->qp = priv->flow_drop_queue->qp; rte_flow->ibv_flow = ibv_exp_create_flow(rte_flow->qp, @@ -1161,7 +1161,7 @@ priv_flow_create_action_queue(struct priv *priv, NULL, "cannot allocate QP"); goto error; } - if (!priv->started) + if (!priv->dev->data->dev_started) return rte_flow; rte_flow->ibv_flow = ibv_exp_create_flow(rte_flow->qp, rte_flow->ibv_attr); @@ -1627,7 +1627,7 @@ mlx5_flow_isolate(struct rte_eth_dev *dev, struct priv *priv = dev->data->dev_private; priv_lock(priv); - if (priv->started) { + if (dev->data->dev_started) { rte_flow_error_set(error, EBUSY, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index c09a554..88a024c 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1140,7 +1140,7 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, if (rxq != NULL) { DEBUG("%p: reusing already allocated queue index %u (%p)", (void *)dev, idx, (void *)rxq); - if (priv->started) { + if (dev->data->dev_started) { priv_unlock(priv); return -EEXIST; } diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index 3b17678..a4a0acd 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -61,10 +61,6 @@ mlx5_dev_start(struct rte_eth_dev *dev) return -E_RTE_SECONDARY; priv_lock(priv); - if (priv->started) { - priv_unlock(priv); - return 0; - } /* Update Rx/Tx callback. */ priv_select_tx_function(priv); priv_select_rx_function(priv); @@ -72,8 +68,6 @@ mlx5_dev_start(struct rte_eth_dev *dev) err = priv_create_hash_rxqs(priv); if (!err) err = priv_rehash_flows(priv); - if (!err) - priv->started = 1; else { ERROR("%p: an error occurred while configuring hash RX queues:" " %s", @@ -82,7 +76,6 @@ mlx5_dev_start(struct rte_eth_dev *dev) } err = priv_flow_start(priv); if (err) { - priv->started = 0; ERROR("%p: an error occurred while configuring flows:" " %s", (void *)priv, strerror(err)); @@ -125,10 +118,6 @@ mlx5_dev_stop(struct rte_eth_dev *dev) return; priv_lock(priv); - if (!priv->started) { - priv_unlock(priv); - return; - } DEBUG("%p: cleaning up and destroying hash RX queues", (void *)dev); priv_special_flow_disable_all(priv); priv_mac_addrs_disable(priv); @@ -136,6 +125,5 @@ mlx5_dev_stop(struct rte_eth_dev *dev) priv_flow_stop(priv); priv_rx_intr_vec_disable(priv); priv_dev_interrupt_handler_uninstall(priv, dev); - priv->started = 0; priv_unlock(priv); } diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 5384b51..3f6702a 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -449,7 +449,7 @@ mlx5_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, if (txq != NULL) { DEBUG("%p: reusing already allocated queue index %u (%p)", (void *)dev, idx, (void *)txq); - if (priv->started) { + if (dev->data->dev_started) { priv_unlock(priv); return -EEXIST; } -- 2.1.4