From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id DD6634F9A for ; Mon, 19 Nov 2018 13:26:00 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id p4so22675825wrt.7 for ; Mon, 19 Nov 2018 04:26:00 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=bYfIpDjgDmynZlqmGNZH3r26YPE2i0qrAFr8MF26KxY=; b=MigVNTXrMFOMp2acsnB2qS06NCELVpel1vXdTi0tC7/XP+52Rlez/BmpJZXQ5FvQQZ CX5Q+SjOT3LLTxLs+/w1RnAjnAJXAdi6LLsxNNZRSC+0pyU3PkCBzujn+RdYZiL2KvvG oLet3o/SEcnQFOP7QG2VZXLB9yQSWh2kb7U6iZgyqKuRAmcDCQJUjlHXQZPOQ6Wn9AT3 lah0qUMpIifz+TmWKB9qAbzgWYkZs7sZJcOlPTZZw1oP3sMB1cTzcLjeUeiPdX+4O0Nu xnU9+miVB+tORgjnnz21IbAW3undDtZVJ5LizAldaTX2L4dV+XcTsAGQvxVeEWwS5XMp G43A== X-Gm-Message-State: AA+aEWZctNQj9uszpG1UXQr8sZspj1+LkgqI2TQKMUDvqxizRnr14/N0 8ZSIdUMSOpaVWEUqlFQeYIEwEFkM X-Google-Smtp-Source: AFSGD/VxlkP8rJZJ+ilBwFs0jRqYNGfBE3dTBN7uxUQVPdGaSZV0imll1Ui6PdO1Mg1NNZnVLHIfuQ== X-Received: by 2002:a5d:4dc8:: with SMTP id f8mr1380827wru.45.1542630360490; Mon, 19 Nov 2018 04:26:00 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id q7-v6sm28902023wmg.27.2018.11.19.04.25.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 04:25:59 -0800 (PST) From: Luca Boccassi To: Radu Nicolau Cc: Chas Williams , dpdk stable Date: Mon, 19 Nov 2018 12:25:28 +0000 Message-Id: <20181119122538.14207-11-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119122538.14207-1-bluca@debian.org> References: <20181108180111.25873-1-bluca@debian.org> <20181119122538.14207-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bonding: fix crash when stopping mode 4 port' has been queued to LTS release 16.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 12:26:01 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/21/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Luca Boccassi --- >>From 9d89b51cf490e720c58538f47aa9beb356fc009b Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Thu, 8 Nov 2018 15:26:42 +0000 Subject: [PATCH] net/bonding: fix crash when stopping mode 4 port [ upstream commit 0911d4ec01839c9149a0df5758d00d9d57a47cea ] 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") 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 ebde93259..103f55856 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1674,9 +1674,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); + } } } -- 2.19.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-19 12:15:18.338022695 +0000 +++ 0011-net-bonding-fix-crash-when-stopping-mode-4-port.patch 2018-11-19 12:15:18.099611432 +0000 @@ -1,14 +1,15 @@ -From 0911d4ec01839c9149a0df5758d00d9d57a47cea Mon Sep 17 00:00:00 2001 +From 9d89b51cf490e720c58538f47aa9beb356fc009b Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Thu, 8 Nov 2018 15:26:42 +0000 Subject: [PATCH] net/bonding: fix crash when stopping mode 4 port +[ upstream commit 0911d4ec01839c9149a0df5758d00d9d57a47cea ] + 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 @@ -17,10 +18,10 @@ 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 1a6d8e4df..2661620ab 100644 +index ebde93259..103f55856 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) +@@ -1674,9 +1674,14 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) internals->link_status_polling_enabled = 0; for (i = 0; i < internals->slave_count; i++) {