DPDK patches and discussions
 help / color / mirror / Atom feed
From: Liming Sun <lsun@ezchip.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH v2 3/3] driver/net/mpipe: fix a mpipe link initialization ordering issue
Date: Fri, 8 Jan 2016 09:30:38 -0500	[thread overview]
Message-ID: <1452263438-21634-3-git-send-email-lsun@ezchip.com> (raw)
In-Reply-To: <1452263438-21634-1-git-send-email-lsun@ezchip.com>

Mpipe link structure is initialized in function mpipe_link_init().
Currently it's only called from the eth_dev_ops.dev_start, which
caused crashes when link mgmt APIs (like promiscuous_enable)
was called before eth_dev_ops.dev_start(). This submit fixed it
by calling mpipe_link_init() in rte_pmd_mpipe_devinit().

Signed-off-by: Liming Sun <lsun@ezchip.com>
Acked-by: Zhigang Lu <zlu@ezchip.com>
---
 drivers/net/mpipe/mpipe_tilegx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mpipe/mpipe_tilegx.c b/drivers/net/mpipe/mpipe_tilegx.c
index be7b6f2..5845511 100644
--- a/drivers/net/mpipe/mpipe_tilegx.c
+++ b/drivers/net/mpipe/mpipe_tilegx.c
@@ -752,13 +752,6 @@ mpipe_init(struct mpipe_dev_priv *priv)
 	if (priv->initialized)
 		return 0;
 
-	rc = mpipe_link_init(priv);
-	if (rc < 0) {
-		RTE_LOG(ERR, PMD, "%s: Failed to init link.\n",
-			mpipe_name(priv));
-		return rc;
-	}
-
 	rc = mpipe_recv_init(priv);
 	if (rc < 0) {
 		RTE_LOG(ERR, PMD, "%s: Failed to init rx.\n",
@@ -1633,6 +1626,13 @@ rte_pmd_mpipe_devinit(const char *ifname,
 	eth_dev->rx_pkt_burst = &mpipe_recv_pkts;
 	eth_dev->tx_pkt_burst = &mpipe_xmit_pkts;
 
+	rc = mpipe_link_init(priv);
+	if (rc < 0) {
+		RTE_LOG(ERR, PMD, "%s: Failed to init link.\n",
+			mpipe_name(priv));
+		return rc;
+	}
+
 	return 0;
 }
 
-- 
1.8.3.1

  parent reply	other threads:[~2016-01-08 14:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 15:37 [dpdk-dev] [PATCH 0/3] Some misc fixes and optimization for the mpipe driver Liming Sun
2015-12-15 15:37 ` [dpdk-dev] [PATCH 1/3] driver/net/mpipe: support native build on tilegx platform Liming Sun
2016-01-08  2:59   ` Tony Lu
2015-12-15 15:37 ` [dpdk-dev] [PATCH 2/3] driver/net/mpipe: optimize mpipe buffer return mechanism Liming Sun
2016-01-08  3:04   ` Tony Lu
2015-12-15 15:37 ` [dpdk-dev] [PATCH 3/3] driver/net/mpipe: fix a mpipe link initialization ordering issue Liming Sun
2016-01-08  3:08   ` Tony Lu
2016-01-08 14:30   ` [dpdk-dev] [PATCH v2 1/3] driver/net/mpipe: support native build on tilegx platform Liming Sun
2016-01-08 14:30     ` [dpdk-dev] [PATCH v2 2/3] driver/net/mpipe: optimize mpipe buffer return mechanism Liming Sun
2016-01-08 14:30     ` Liming Sun [this message]
2016-02-09 15:49     ` [dpdk-dev] [PATCH v2 1/3] driver/net/mpipe: support native build on tilegx platform Bruce Richardson
2016-02-09 16:16     ` Thomas Monjalon
2016-02-09 18:37       ` Liming Sun
2016-02-09 20:33         ` Thomas Monjalon
2016-02-09 21:15           ` Liming Sun
2016-02-09 22:47             ` Thomas Monjalon
2016-02-10  9:49               ` Bruce Richardson
2016-02-10 10:00                 ` Thomas Monjalon
2016-03-08 19:48           ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452263438-21634-3-git-send-email-lsun@ezchip.com \
    --to=lsun@ezchip.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).