From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by dpdk.org (Postfix) with ESMTP id 159BE4C8B for ; Tue, 25 Sep 2018 09:05:13 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id t22-v6so9229385lfb.7 for ; Tue, 25 Sep 2018 00:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=04MIB0RMGEgyR6V2a5m70OBggA0qbXRCSaUSjiTriFo=; b=df3PTN1AXP826ogZQejFmzEy6VqM5gC0i5DUUcT30TfnvLcc+ZKMErMk4aJ+1YDTgr ZwijSnVr/HFYOMxZzZJcbVRVjdsGIlP2+aczUyIwUmiaJF/2EtxUL5cdKAcLr+wuqfsF uHMrBTS26aHVXcgK8BVvWyZ2yuXxKvrbkgJWVaAQXtoDYv5nbLYfaTZG70dnP62WCcZq itl7iz3W5GkFKzOFSS0Qe61XiPEk3wxIoRspQdLmwKzAaRdEwDmyvN0IcLeWbkwKbioy Hw27clucpIcCc0kuN3OyODB6LLXy/X+txYC4amBKZ+4vPA+eW2SBMtJr+MebBqtPe7I4 bGzA== 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; bh=04MIB0RMGEgyR6V2a5m70OBggA0qbXRCSaUSjiTriFo=; b=ZxyKVw+C9D5+VtRj+tr4u0DUoWVADjLM1C+bVruQCxn4afvotFMTp11O873HG3U3zT dSwOfNFRVpNZY7C4P4TQPUTYyL3xUp2anj/vb9TaVruyP4zYbQ9uzdharVcpk2XR9Rwi YFt2vCwxLcQUVt8WjXeXcVnznitwZVtUUda36btKQYn75jbRfIfNg1vkTPovrUZ3zWCn BvNFtqtsqoDgTqTMx42ipQknujlmVwMP++jkF/GDKtK+51r2LzbxPaJxczUlkbztYFyD ajV5oJzOzXLB/oEicO1YYAIEycg+6rkKb0KNdWyxSBJKuWj5h0cnZsvN0c865xZfLJxw 7jYQ== X-Gm-Message-State: ABuFfoiwchdeGlE8OtRvxGQRYqG8z6JRfPZXcMGGQdf1izVy+0PxWBps eeqmAtxd6Ukhl2T/eOmITQK0q3F86itN0Q== X-Google-Smtp-Source: ACcGV61DxCvJynbGZnZ7BjY8/sb2uPyVpWnGWMxCHS4pM/Ls/nsxnYxo21rQ70Ri2ssbyTOXQFrFGA== X-Received: by 2002:a19:1346:: with SMTP id j67-v6mr1534649lfi.93.1537859112413; Tue, 25 Sep 2018 00:05:12 -0700 (PDT) Received: from amok.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id 24-v6sm238306ljb.76.2018.09.25.00.05.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Sep 2018 00:05:11 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: mw@semihalf.com, nadavh@marvell.com, Natalie Samsonov Date: Tue, 25 Sep 2018 09:04:57 +0200 Message-Id: <1537859109-25659-2-git-send-email-amo@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537859109-25659-1-git-send-email-amo@semihalf.com> References: <1536068953-9352-1-git-send-email-tdu@semihalf.com> <1537859109-25659-1-git-send-email-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v3 01/13] net/mvpp2: initialize ppio only once 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: Tue, 25 Sep 2018 07:05:13 -0000 From: Natalie Samsonov This changes stop/start/configure behavior due to issue in MUSDK library itself. From now on, ppio can be reconfigured only after interface is closed. Signed-off-by: Natalie Samsonov Reviewed-by: Yuval Caduri --- drivers/net/mvpp2/mrvl_ethdev.c | 53 +++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index fa4af49..dca3ccc 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -303,6 +303,11 @@ mrvl_dev_configure(struct rte_eth_dev *dev) struct mrvl_priv *priv = dev->data->dev_private; int ret; + if (priv->ppio) { + MRVL_LOG(INFO, "Device reconfiguration is not supported"); + return -EINVAL; + } + if (dev->data->dev_conf.rxmode.mq_mode != ETH_MQ_RX_NONE && dev->data->dev_conf.rxmode.mq_mode != ETH_MQ_RX_RSS) { MRVL_LOG(INFO, "Unsupported rx multi queue mode %d", @@ -516,6 +521,9 @@ mrvl_dev_start(struct rte_eth_dev *dev) char match[MRVL_MATCH_LEN]; int ret = 0, i, def_init_size; + if (priv->ppio) + return mrvl_dev_set_link_up(dev); + snprintf(match, sizeof(match), "ppio-%d:%d", priv->pp_id, priv->ppio_id); priv->ppio_params.match = match; @@ -740,28 +748,7 @@ mrvl_flush_bpool(struct rte_eth_dev *dev) static void mrvl_dev_stop(struct rte_eth_dev *dev) { - struct mrvl_priv *priv = dev->data->dev_private; - mrvl_dev_set_link_down(dev); - mrvl_flush_rx_queues(dev); - mrvl_flush_tx_shadow_queues(dev); - if (priv->cls_tbl) { - pp2_cls_tbl_deinit(priv->cls_tbl); - priv->cls_tbl = NULL; - } - if (priv->qos_tbl) { - pp2_cls_qos_tbl_deinit(priv->qos_tbl); - priv->qos_tbl = NULL; - } - if (priv->ppio) - pp2_ppio_deinit(priv->ppio); - priv->ppio = NULL; - - /* policer must be released after ppio deinitialization */ - if (priv->policer) { - pp2_cls_plcr_deinit(priv->policer); - priv->policer = NULL; - } } /** @@ -776,6 +763,9 @@ mrvl_dev_close(struct rte_eth_dev *dev) struct mrvl_priv *priv = dev->data->dev_private; size_t i; + mrvl_flush_rx_queues(dev); + mrvl_flush_tx_shadow_queues(dev); + for (i = 0; i < priv->ppio_params.inqs_params.num_tcs; ++i) { struct pp2_ppio_tc_params *tc_params = &priv->ppio_params.inqs_params.tcs_params[i]; @@ -786,7 +776,28 @@ mrvl_dev_close(struct rte_eth_dev *dev) } } + if (priv->cls_tbl) { + pp2_cls_tbl_deinit(priv->cls_tbl); + priv->cls_tbl = NULL; + } + + if (priv->qos_tbl) { + pp2_cls_qos_tbl_deinit(priv->qos_tbl); + priv->qos_tbl = NULL; + } + mrvl_flush_bpool(dev); + + if (priv->ppio) { + pp2_ppio_deinit(priv->ppio); + priv->ppio = NULL; + } + + /* policer must be released after ppio deinitialization */ + if (priv->policer) { + pp2_cls_plcr_deinit(priv->policer); + priv->policer = NULL; + } } /** -- 2.7.4