From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by dpdk.org (Postfix) with ESMTP id A45CD1B546; Sat, 9 Feb 2019 14:16:54 +0100 (CET) Received: by mail-qt1-f194.google.com with SMTP id p48so5654291qtk.2; Sat, 09 Feb 2019 05:16:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=J8jk/A/1SQs2KaLZuG0Gt8Z27wwyxkrrdKspapM7ZuU=; b=RyxTkJ/Dg3Wik9U1/oVXaqoxPrHTmTMDJ/0FPqHjcTYOQ/Y/W7eylWT7Jjdqp93uMB bzsz4mfoB9ecCiGVxy/DHSWDhS5Q/7CxJFqdv6x+qABf9yp5uufrX8/0KoBnRh7ni0xc /e5GuffEX8866QkKCr4Z5BbA7gXrX4sSqHK8DqTjGL0Kmy3NLSpaJ/yqvmfjEacVBWO4 jA7hhdu8lrtB/h3UlFMygYrTYgONJ0qEtIwTveChe3k7SN2x4dcVztD50ezsKT9EuY9P KPnRUEbxersibrsT7r2iO1KGrH7IqSufFpmSmlJDQpFsT50K2F2t3skrJNmVhqXlatzS KW2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=J8jk/A/1SQs2KaLZuG0Gt8Z27wwyxkrrdKspapM7ZuU=; b=jxRxwVOVLvH/bZF2iHn+W6biasF7U5OgghC1D70ozwemtOu0YslAHOfUdwQye7mbZt S2FIF4vhgudkPV34lvpaYPJ/2uklkhPGZvfoNIdt5X0Cx9oUIBUAQiPQFUc4zhKmnac2 L86MDNp6Y9gl/YZb33TERlWQ0SYrFDwx+JmDGf653NmMZjQF6XmgTZVyYhDUqfKWOzVX nNb+QtRXAF8j0G79ynJOZNEJtFJ4JiHzUPIQvx+KOqfavO3LQhsMBA3ZVPIIswzob7/B N4qz3O7JxYirwoGG7gqsOlQCmI0qT/YT1uMWdHAWhTDHn8YuPLTDmSmflh+slrhsBxyY NTvw== X-Gm-Message-State: AHQUAuYsDRHbJ4ZVU2r3C6/8aGissCVb6JjI04R31Zd1UbOvQ84Z/iyK 9Gml2GFnxB0IRfKCgWKoutD2cOXZ X-Google-Smtp-Source: AHgI3Ia9QHKUiz1Hn8DadLHmVcdq1c7+I3AAKQAU3KvzWLax31L/mWfv96+XrD0IhI8fQoR+7yz0NQ== X-Received: by 2002:aed:3964:: with SMTP id l91mr6016887qte.33.1549718213679; Sat, 09 Feb 2019 05:16:53 -0800 (PST) Received: from [192.168.1.10] (pool-96-255-82-34.washdc.fios.verizon.net. [96.255.82.34]) by smtp.gmail.com with ESMTPSA id t38sm1816051qtc.12.2019.02.09.05.16.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Feb 2019 05:16:52 -0800 (PST) To: Hyong Youb Kim , Ferruh Yigit , Declan Doherty , Chas Williams Cc: dev@dpdk.org, stable@dpdk.org References: <20190110102235.1238-1-hyonkim@cisco.com> <20190110102235.1238-2-hyonkim@cisco.com> From: Chas Williams <3chas3@gmail.com> Message-ID: Date: Sat, 9 Feb 2019 08:16:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190110102235.1238-2-hyonkim@cisco.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/2] net/bonding: do not set promisc on non-existent primary port 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: Sat, 09 Feb 2019 13:16:54 -0000 On 1/10/19 5:22 AM, Hyong Youb Kim wrote: > For active-backup, tlb, and alb mode, > bond_ethdev_promiscuous_{enable,disable} tries to set promisc mode on > the primary port, even when there are no slaves. It is harmless, as > rte_eth_promiscuous_{enable,disable} does nothing if the port number > is invalid. But, it does print a warning message. Here is an example > from testpmd. > > testpmd> create bonded device 5 0 > Created new bonded device net_bonding_testpmd_0 on (port 4). > Invalid port_id=33 > testpmd> set promisc 4 off > Invalid port_id=33 > > 33 in this case is RTE_MAX_ETHPORTS + 1, the invalid primary port > number used within the bonding driver. This warning message is > harmless but can be confusing to the user. So do not try to set > promisc on a primary port when we know it does not exist (i.e. no > slaves). > > Fixes: 2efb58cbab6e ("bond: new link bonding library") > Cc: stable@dpdk.org > > Signed-off-by: Hyong Youb Kim Acked-by: Chas Williams > --- > drivers/net/bonding/rte_eth_bond_pmd.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index 44deaf119..daf2440cd 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -2593,6 +2593,9 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev) > case BONDING_MODE_TLB: > case BONDING_MODE_ALB: > default: > + /* Do not touch promisc when there cannot be primary ports */ > + if (internals->slave_count == 0) > + break; > rte_eth_promiscuous_enable(internals->current_primary_port); > } > } > @@ -2621,6 +2624,9 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev) > case BONDING_MODE_TLB: > case BONDING_MODE_ALB: > default: > + /* Do not touch promisc when there cannot be primary ports */ > + if (internals->slave_count == 0) > + break; > rte_eth_promiscuous_disable(internals->current_primary_port); > } > } >