From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by dpdk.org (Postfix) with ESMTP id 727E42B92 for ; Tue, 4 Sep 2018 09:10:33 +0200 (CEST) Received: by mail-pl1-f195.google.com with SMTP id f6-v6so1197696plo.1 for ; Tue, 04 Sep 2018 00:10:33 -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=y8U6gYDQP9+l7c5h3ZcJ0DaVjlhx9ObAKd++8V34sQU=; b=YaumliVrDs29UOniOzM8VEhunldBjFsSVzYihKA8EYZCiXTHsUbKFyI+qI5gjq3f9b QyUALTIo4JioMjnuOzpvRnH4pJi6OcamJ40AX5ig27Kl2eYSt4nplPE01/A/rOI9o65w HxN/e47Wr106xpRfHYjGdZgczc8fCJ9s3MWTa0y9bIdAyKPON+hWgicvTZCAozOna594 QBA67JV06AXnUVKQGlXO0rNoLV10zfotaiHeymdQd3v9dSBWIgNLznsaRLN1M0wVIqrE dGDccVaBZhpt4rF5hISa8a7ilreLED1n1iFXCaNRPCwIHkZuYY1WLmYxcXBsSS71W/Kv otXw== 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=y8U6gYDQP9+l7c5h3ZcJ0DaVjlhx9ObAKd++8V34sQU=; b=d/pSpf/GMP/0TQbjhgV6GqDMdTHK4VYdWJUZ+sEiYB8s2MTwUcS0Ockgn0faAfv1R+ 5q2x6ImiQc97wjta10rUB5fOOGPqwP7DXrgjjES24trMJK/X1f/qpnaZxY37iFPp30pL EHUhBF+rdteEUzO2iZCdgIain6MR0CCKPkFLwU/UplhwHvliT8U3oNKCXf03S8m1E45o KHMAS6uv4y1nBdTYt8j0/9GthNouNlOsBjdsJMeHRfIAAs4Uon8tnLRyBkAW5I76MvU/ AbOCIEmm7XTyWcY2u9zbfah5wxgfjX6DitV5ysFgkqBYOHBGUqJH8+TrzdcuvViNVBNO CFbw== X-Gm-Message-State: APzg51D57KoTBSg94SKpJCODp7WB+eQNvmGnlR2rmb6xsH3l10sXEGIa t3lEjpz15BiirisfyEnkpiXfgVDmzvkX0g== X-Google-Smtp-Source: ANB0VdaSOV5sE8oedz7AXfmfdMC6a7Bt4btYlDbNcnTQJ4ZN9yxK2BLZ4Gl2eg5pm3FuYPJJPvY1cg== X-Received: by 2002:a17:902:8bc4:: with SMTP id r4-v6mr31261181plo.124.1536045032200; Tue, 04 Sep 2018 00:10:32 -0700 (PDT) Received: from sh.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id l79-v6sm31229451pfb.111.2018.09.04.00.10.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 00:10:31 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com Date: Tue, 4 Sep 2018 09:10:09 +0200 Message-Id: <1536045016-32008-2-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536045016-32008-1-git-send-email-tdu@semihalf.com> References: <1536045016-32008-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH 1/8] 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, 04 Sep 2018 07:10:34 -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 6824445..f022cad 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -304,6 +304,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", @@ -525,6 +530,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; @@ -749,28 +757,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; - } } /** @@ -785,6 +772,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]; @@ -795,7 +785,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