From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by dpdk.org (Postfix) with ESMTP id C70902BE5; Fri, 9 Nov 2018 22:40:57 +0100 (CET) Received: by mail-qk1-f196.google.com with SMTP id o89so4261015qko.0; Fri, 09 Nov 2018 13:40:57 -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=58IDkl1QObOI0dUH/4ReLtfryJBhxh2kS9F1ABOkTf4=; b=Cl4XWOOrtcJY/wze9cxahcVC9YQ4CsEYBo0ztoUULoGh9l+v5mhugsyDDOmAlESPEP etpVjuta30Z4fiQR3i2+m507H49Cer81TqfwXNf0PSdzJh7VEfKnLlo5Ar+NKOwRwy0d Sj7/D86ZkzNtQVmhKQnW87h0p3x88UrjirZe05ACj4YBrIlFnSHtj38QwKxRP353LbT3 SwnC5Az+R3WUE7t8h263D8TQygokTDvb/sH7ov72+gA2hyPRBWH3ncTqlcW0d7rDgnmy elvgnRrSv7BuOkUpjgMUpCuAKFQ3+5zT7dPpHSnjCN0peRI7IGW/KdJwS3QwoAetQFCv TgBg== 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=58IDkl1QObOI0dUH/4ReLtfryJBhxh2kS9F1ABOkTf4=; b=WMbPkCDVOB0kHBjfJBubkjqvCj9ei5xOUjX92lAlYjoDo7BnE9r6lt18Iz8VA30lHv iFOIks7Nd7VxiH/LXqUr7yJvJIym9+a9Oji6mQVWaBCYHsNrBik/V+dzoi7CJ/2qe05h wCvbv0sZtQSSDOl2xlkMHSOBQIcj1KtKMwjHDbsuZanKxsok6dwn6Ml1X7lqfCBSHwM6 90FRDAObn3NjudF0mGvG5qVabUp+6MVIpfucd8E7nvQEt39IQLP0Q6lgvenvTQKk3tm+ tNZfdSsGbKR+wJtE7a1kzBnGOp50mxtZ4hTbD4cSgxmU5avXZRP011AnIjgltRcVFrAc UpvA== X-Gm-Message-State: AGRZ1gKqh+98MJ2B1cG7CHfT5Cjq0wfWRT3zShqtMGRnucWpcStffkn9 QvG5fwlm/3amPEHawHJ0eHuO5yBF X-Google-Smtp-Source: AJdET5ehCzu/4DT1V1KwXddi0h/cAoXqNB4S2jWJ0ZYB2Y01CKcON806ZG14kif7mzL9DPsQnFqdUg== X-Received: by 2002:ac8:7353:: with SMTP id q19mr10070917qtp.265.1541799656778; Fri, 09 Nov 2018 13:40:56 -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 s9sm5018028qta.35.2018.11.09.13.40.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 13:40:56 -0800 (PST) To: Radu Nicolau , dev@dpdk.org Cc: declan.doherty@intel.com, chas3@att.com, stable@dpdk.org References: <1541690802-16121-1-git-send-email-radu.nicolau@intel.com> From: Chas Williams <3chas3@gmail.com> Message-ID: Date: Fri, 9 Nov 2018 16:40:55 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1541690802-16121-1-git-send-email-radu.nicolau@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/bonding: fix crash when stopping mode 4 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: Fri, 09 Nov 2018 21:40:58 -0000 On 11/08/2018 10:26 AM, Radu Nicolau wrote: > When stopping a bonded port all slaves are deactivated. Attempting > to deactivate a slave that was never activated will result in a segfault > when mode 4 is used. > > Fixes: 7486331308f6 ("net/bonding: stop and deactivate slaves on stop") > Cc: stable@dpdk.org > > Signed-off-by: Radu Nicolau Acked-by: Chas Williams > --- > drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index 1a6d8e4..2661620 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -2181,9 +2181,14 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) > > internals->link_status_polling_enabled = 0; > for (i = 0; i < internals->slave_count; i++) { > - internals->slaves[i].last_link_status = 0; > - rte_eth_dev_stop(internals->slaves[i].port_id); > - deactivate_slave(eth_dev, internals->slaves[i].port_id); > + uint16_t slave_id = internals->slaves[i].port_id; > + if (find_slave_by_id(internals->active_slaves, > + internals->active_slave_count, slave_id) != > + internals->active_slave_count) { > + internals->slaves[i].last_link_status = 0; > + rte_eth_dev_stop(slave_id); > + deactivate_slave(eth_dev, slave_id); Just some commentary. I believe that when this is stopping the bonding driver is still watching for link status changes. You can't know when the LSC thread was scheduled to run so something could still activate a slave after this has deactivated the slaves. > + } > } > } > >