From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 04CE4A0032 for ; Fri, 18 Feb 2022 13:44:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 003AD40141; Fri, 18 Feb 2022 13:44:19 +0100 (CET) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mails.dpdk.org (Postfix) with ESMTP id 7AA6040141 for ; Fri, 18 Feb 2022 13:44:19 +0100 (CET) Received: by mail-wr1-f49.google.com with SMTP id u1so14365187wrg.11 for ; Fri, 18 Feb 2022 04:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fgd58WS2cEJh/vsGGy39nziOemTDdTL+vCO8EZLVXNY=; b=YlcGZqlnKPV1TlCTz4OCxrmaeL6QgsscbK9PmwY2pvNSmJeVRytJ+MxwliZzT9iYQ2 2WQ+Xq5fyvWXrvHizIXyXTFm4XGoSSjYJGNAL+lGUHpKLST19n+F2uFxBp434TpfRWMS 5yyQF+70NQuZl5h1lnvozNdcDUbx7pOtqVVySDOmG1XmDzEZFcRQqBG2ba6HHi+OLG7b lv0rk9RWTlRKTLWKtN5v48xZlYdGzHhgnYpZWJlL5Vd6Xf2RWw+RGjZoeaydnDM9/YwT AiKY//nJbTAQjI4JJAyH7KqPZ+DCha5h5CqeB/H415tP4V8ZKxtEpYo73y7bJP4WDaWv Cb2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fgd58WS2cEJh/vsGGy39nziOemTDdTL+vCO8EZLVXNY=; b=AlMABJHdoP9HHXhvjCxrBvTbVeXEh0zzcnzTkpfgmySOThVhzuaUjNkV4ZPxKFL5Oi S+H3H9bvazIqw50DxvzYe9VQOkUk2TYjZUXF2sZIKJUZNZnptvhMMg8wwq2Er2Nc2zD9 4oz+OBnFsoIlHSl7KJdBPTRHsBaCxuQpNkAuUjiC1cJivH8Vr7YylFkjSuzZv/raII3g 66VjBD7GQ6wh3+rgZl2HhWrb4A1y1nW7MhcB7wFJHwY1w6u5oTNQfpWuZA2/c4yYS4UN Olp7lphiPCQmXnE2vNI01r3okx9O8uOsv9e9Q5mhj5HFfdNCGoO7odYBTUaGqUFP6bI8 /p9A== X-Gm-Message-State: AOAM5309mRqjR854rXZxM0I11BPt8Tel+ThrONJ5nGX7z5TdrQcKIHrO lg3sjZ6KlbljWue2O/jvq2o= X-Google-Smtp-Source: ABdhPJzhaG0uB6Q3kNznnbTmZAWs6oEMtGGf+cNHFaU55FydpTpoc7GEZYpYf6pxp0YSrtT9wtQcOQ== X-Received: by 2002:adf:fc86:0:b0:1e4:a7b6:6ba with SMTP id g6-20020adffc86000000b001e4a7b606bamr5860905wrr.93.1645188259218; Fri, 18 Feb 2022 04:44:19 -0800 (PST) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id b11sm17179546wrd.31.2022.02.18.04.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:44:18 -0800 (PST) From: luca.boccassi@gmail.com To: "Min Hu (Connor)" Cc: Ferruh Yigit , dpdk stable Subject: patch 'app/testpmd: fix bonding mode set' has been queued to stable release 20.11.5 Date: Fri, 18 Feb 2022 12:39:00 +0000 Message-Id: <20220218123931.1749595-91-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/20/22. 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. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/b040eaa3352bd73be25795ff11f9a20897651a96 Thanks. Luca Boccassi --- >From b040eaa3352bd73be25795ff11f9a20897651a96 Mon Sep 17 00:00:00 2001 From: "Min Hu (Connor)" Date: Fri, 28 Jan 2022 10:35:19 +0800 Subject: [PATCH] app/testpmd: fix bonding mode set [ upstream commit 39ddd5d1895e72ba2bc974eddbc12a3135639ed1 ] when start testpmd, and type command like this, it will lead to Segmentation fault, like: testpmd> create bonded device 4 0 testpmd> add bonding slave 0 2 testpmd> add bonding slave 1 2 testpmd> port start 2 testpmd> set bonding mode 0 2 testpmd> quit Stopping port 0... Stopping ports... ... Bye... Segmentation fault The reason to the bug is that rte timer do not be cancelled when quit. That is, in 'bond_ethdev_start', resources are allocated according to different bonding mode. In 'bond_ethdev_stop', resources are free by the corresponding mode. For example, 'bond_ethdev_start' start bond_mode_8023ad_ext_periodic_cb timer for bonding mode 4. and 'bond_ethdev_stop' cancel the timer only when the current bonding mode is 4. If the bonding mode is changed, and directly quit the process, the timer will still on, and freed memory will be accessed, then segmentation fault. 'bonding mode' changed means resources changed, reallocate resources for different mode should be done, that is, device should be restarted. Fixes: 2950a769315e ("bond: testpmd support") Signed-off-by: Min Hu (Connor) Tested-by: Ferruh Yigit --- app/test-pmd/cmdline.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 496f628b27..df6a575002 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -5771,6 +5771,19 @@ static void cmd_set_bonding_mode_parsed(void *parsed_result, { struct cmd_set_bonding_mode_result *res = parsed_result; portid_t port_id = res->port_id; + struct rte_port *port = &ports[port_id]; + + /* + * Bonding mode changed means resources of device changed, like whether + * started rte timer or not. Device should be restarted when resources + * of device changed. + */ + if (port->port_status != RTE_PORT_STOPPED) { + fprintf(stderr, + "\t Error: Can't set bonding mode when port %d is not stopped\n", + port_id); + return; + } /* Set the bonding mode for the relevant port. */ if (0 != rte_eth_bond_mode_set(port_id, res->value)) -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:41.363202195 +0000 +++ 0091-app-testpmd-fix-bonding-mode-set.patch 2022-02-18 12:37:37.810794601 +0000 @@ -1 +1 @@ -From 39ddd5d1895e72ba2bc974eddbc12a3135639ed1 Mon Sep 17 00:00:00 2001 +From b040eaa3352bd73be25795ff11f9a20897651a96 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 39ddd5d1895e72ba2bc974eddbc12a3135639ed1 ] + @@ -36 +37,0 @@ -Cc: stable@dpdk.org @@ -45 +46 @@ -index e626b1c7d9..16ad4be005 100644 +index 496f628b27..df6a575002 100644 @@ -48 +49 @@ -@@ -5915,6 +5915,19 @@ static void cmd_set_bonding_mode_parsed(void *parsed_result, +@@ -5771,6 +5771,19 @@ static void cmd_set_bonding_mode_parsed(void *parsed_result,