From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 2EA80E5D; Mon, 23 Apr 2018 00:58:08 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B7CE721B89; Sun, 22 Apr 2018 18:58:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 22 Apr 2018 18:58:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=qdgVoAKmH7eabELlRfcFUM7I/g KgGGM+yt7AJfY7E5Y=; b=clt+SzH/xnBWE4wY6aBukR3zxgXNqyhhn4ZSYHD6QW R2ZV6d3Gn0D+MKrQQUXYfpQoAEFOL92lscu3UskjfYH91kNqlqHdEO091MqPiY+E P6puD5nESmFQO8rON/zyXH+QIYaWs39oGIPiTHmZ7byilOcS5fAiVfiMBrFMJJLl 4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=qdgVoA KmH7eabELlRfcFUM7I/gKgGGM+yt7AJfY7E5Y=; b=f7mKuNSJt7ruhJ1W0ZTL8c DH+vxrFyGLYesW/ntbA+FyJnd5uQ4g1Txq0jIHVxz9LJ/aTLMK2vRChtjauw7D0Y L1N3DIO3KRMfD984sgO0N7Ocu4hjYJ7sEcRbUCcUj53t/MevpMCQaPyalfbccXrZ dHXL1v3KmECxktykgipNZJgjQDrc5vtmSBDKTvL/LOYiL/pPN1T8nbXvsnj2w/vD 5RvRwQ/FLa25x7KX3eYK/uQ/3Y75ISeMevKqTyR6jVV6YdwkSncamVikIbTLFBEt S2yd41+c3JQ+Dm2RdAzlJachjBrWGzkAbp1vGSQ4brLKM2nE9iXZ4Fcwih+HrQCQ == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C7ABBE463E; Sun, 22 Apr 2018 18:58:06 -0400 (EDT) From: Thomas Monjalon To: Wenzhuo Lu , declan.doherty@intel.com Cc: stable@dpdk.org, Matan Azrad , dev@dpdk.org, ferruh.yigit@intel.com Date: Mon, 23 Apr 2018 00:58:05 +0200 Message-ID: <2044227.RGsR745gvM@xps> In-Reply-To: <1522235873-22042-1-git-send-email-matan@mellanox.com> References: <1522235873-22042-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] app/testpmd: fix slave port detection 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: Sun, 22 Apr 2018 22:58:08 -0000 Wenzhuo, Declan, Any comment or ack, please? 28/03/2018 13:17, Matan Azrad: > Testpmd allows to create and control bonding devices by run time > command lines using the bonding PMD API. > > Some bonding device slaves operations(close, stop, etc) should not be > used by the application and must be managed by the bonding PMD. > > Thus, Testpmd manages slave flags to prevent the special operations > calls and when a slave is added to bonding device by a run time command > line, the flag is set. > > There is one more way to define the slaves for a bonding device using > EAL command line and Testpmd doesn't set the slave flag in this case > what causes to the special operations to be called by Testpmd. > > Add one more check to detect bonding slave device. > > Fixes: 41b05095c4d1 ("app/testpmd: fix bonding start") > Fixes: 0e545d3047fe ("app/testpmd: check stopping port is not in bonding") > Cc: stable@dpdk.org > > Signed-off-by: Matan Azrad > --- > app/test-pmd/testpmd.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index 4c0e258..73d9481 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -2251,7 +2251,10 @@ uint8_t port_is_bonding_slave(portid_t slave_pid) > struct rte_port *port; > > port = &ports[slave_pid]; > - return port->slave_flag; > + if ((rte_eth_devices[slave_pid].data->dev_flags & > + RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1)) > + return 1; > + return 0; > } > > const uint16_t vlan_tags[] = { >