From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB589A0542 for ; Fri, 7 Feb 2020 16:13:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A2FA21C127; Fri, 7 Feb 2020 16:13:45 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id A6CEB1C137 for ; Fri, 7 Feb 2020 16:13:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581088423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nTG0feLVUrq4Au5joMLtlvixM4wBVVG2gkMzSlh/gns=; b=PKZiV1rcgwWoy06achOT857v879TpIS6RHM1oBg9I3YHSZ4meBMVD7gmOxauFdFjjdPGvd h09Hp+nYrvPpWo5Tkl+ceNmu2ExwhgvADebFTqZ06FBVUud6NAaRuco/Fqy5M2Un6DfQRc wEOZQ4keve2LnuvPGsU3wKbm3KgRQRY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-215-P6Z4bB1dOaSAOAO_-J1giQ-1; Fri, 07 Feb 2020 10:13:34 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5FC42802704; Fri, 7 Feb 2020 15:13:31 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7012810016DA; Fri, 7 Feb 2020 15:13:30 +0000 (UTC) From: Kevin Traynor To: Ciara Power Cc: Ferruh Yigit , dpdk stable Date: Fri, 7 Feb 2020 15:12:25 +0000 Message-Id: <20200207151248.29804-13-ktraynor@redhat.com> In-Reply-To: <20200207151248.29804-1-ktraynor@redhat.com> References: <20200207151248.29804-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: P6Z4bB1dOaSAOAO_-J1giQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'app/testpmd: fix device mcast list error handling' has been queued to LTS release 18.11.7 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.7 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/13/20. 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 rebasi= ng (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/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/b89ae651fb3122b2fe= f06fde2771902b2638cdbc Thanks. Kevin. --- >From b89ae651fb3122b2fef06fde2771902b2638cdbc Mon Sep 17 00:00:00 2001 From: Ciara Power Date: Wed, 4 Dec 2019 16:38:15 +0000 Subject: [PATCH] app/testpmd: fix device mcast list error handling [ upstream commit c11562a1215aaff6651f9c59ef91ad0a53292571 ] The multicast set list function now has a return value, which is checked by the calling functions. A rollback occurs on detection of failure, to realign local config with the device config. The error print statement in the function had included the port_id and mc_addr_nb values in the wrong order, these are now swapped. Fixes: 8fff667578a7 ("app/testpmd: new command to add/remove multicast MAC = addresses") Signed-off-by: Ciara Power Reviewed-by: Ferruh Yigit --- app/test-pmd/config.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 6798f76974..6e9a2042c2 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3490,4 +3490,12 @@ mcast_addr_pool_extend(struct rte_port *port) } =20 +static void +mcast_addr_pool_append(struct rte_port *port, struct ether_addr *mc_addr) +{ +=09if (mcast_addr_pool_extend(port) !=3D 0) +=09=09return; +=09ether_addr_copy(mc_addr, &port->mc_addr_pool[port->mc_addr_nb - 1]); +} + static void mcast_addr_pool_remove(struct rte_port *port, uint32_t addr_idx) @@ -3508,5 +3516,5 @@ mcast_addr_pool_remove(struct rte_port *port, uint32_= t addr_idx) } =20 -static void +static int eth_port_multicast_addr_list_set(portid_t port_id) { @@ -3517,8 +3525,9 @@ eth_port_multicast_addr_list_set(portid_t port_id) =09diag =3D rte_eth_dev_set_mc_addr_list(port_id, port->mc_addr_pool, =09=09=09=09=09 port->mc_addr_nb); -=09if (diag =3D=3D 0) -=09=09return; -=09printf("rte_eth_dev_set_mc_addr_list(port=3D%d, nb=3D%u) failed. diag= =3D%d\n", -=09 port->mc_addr_nb, port_id, -diag); +=09if (diag < 0) +=09=09printf("rte_eth_dev_set_mc_addr_list(port=3D%d, nb=3D%u) failed. dia= g=3D%d\n", +=09=09=09port_id, port->mc_addr_nb, diag); + +=09return diag; } =20 @@ -3545,8 +3554,8 @@ mcast_addr_add(portid_t port_id, struct ether_addr *m= c_addr) =09} =20 -=09if (mcast_addr_pool_extend(port) !=3D 0) -=09=09return; -=09ether_addr_copy(mc_addr, &port->mc_addr_pool[i]); -=09eth_port_multicast_addr_list_set(port_id); +=09mcast_addr_pool_append(port, mc_addr); +=09if (eth_port_multicast_addr_list_set(port_id) < 0) +=09=09/* Rollback on failure, remove the address from the pool */ +=09=09mcast_addr_pool_remove(port, i); } =20 @@ -3575,5 +3584,7 @@ mcast_addr_remove(portid_t port_id, struct ether_addr= *mc_addr) =20 =09mcast_addr_pool_remove(port, i); -=09eth_port_multicast_addr_list_set(port_id); +=09if (eth_port_multicast_addr_list_set(port_id) < 0) +=09=09/* Rollback on failure, add the address back into the pool */ +=09=09mcast_addr_pool_append(port, mc_addr); } =20 --=20 2.21.1 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092020-02-07 15:08:18.203164255 +0000 +++ 0013-app-testpmd-fix-device-mcast-list-error-handling.patch=092020-02-0= 7 15:08:17.501063122 +0000 @@ -1 +1 @@ -From c11562a1215aaff6651f9c59ef91ad0a53292571 Mon Sep 17 00:00:00 2001 +From b89ae651fb3122b2fef06fde2771902b2638cdbc Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit c11562a1215aaff6651f9c59ef91ad0a53292571 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 4e1c3cab59..9da1ffb034 100644 +index 6798f76974..6e9a2042c2 100644 @@ -26 +27 @@ -@@ -3708,4 +3708,12 @@ mcast_addr_pool_extend(struct rte_port *port) +@@ -3490,4 +3490,12 @@ mcast_addr_pool_extend(struct rte_port *port) @@ -30 +31 @@ -+mcast_addr_pool_append(struct rte_port *port, struct rte_ether_addr *mc_a= ddr) ++mcast_addr_pool_append(struct rte_port *port, struct ether_addr *mc_addr) @@ -34 +35 @@ -+=09rte_ether_addr_copy(mc_addr, &port->mc_addr_pool[port->mc_addr_nb - 1]= ); ++=09ether_addr_copy(mc_addr, &port->mc_addr_pool[port->mc_addr_nb - 1]); @@ -39 +40 @@ -@@ -3726,5 +3734,5 @@ mcast_addr_pool_remove(struct rte_port *port, uint32= _t addr_idx) +@@ -3508,5 +3516,5 @@ mcast_addr_pool_remove(struct rte_port *port, uint32= _t addr_idx) @@ -46 +47 @@ -@@ -3735,8 +3743,9 @@ eth_port_multicast_addr_list_set(portid_t port_id) +@@ -3517,8 +3525,9 @@ eth_port_multicast_addr_list_set(portid_t port_id) @@ -60 +61 @@ -@@ -3763,8 +3772,8 @@ mcast_addr_add(portid_t port_id, struct rte_ether_ad= dr *mc_addr) +@@ -3545,8 +3554,8 @@ mcast_addr_add(portid_t port_id, struct ether_addr *= mc_addr) @@ -65 +66 @@ --=09rte_ether_addr_copy(mc_addr, &port->mc_addr_pool[i]); +-=09ether_addr_copy(mc_addr, &port->mc_addr_pool[i]); @@ -73 +74 @@ -@@ -3793,5 +3802,7 @@ mcast_addr_remove(portid_t port_id, struct rte_ether= _addr *mc_addr) +@@ -3575,5 +3584,7 @@ mcast_addr_remove(portid_t port_id, struct ether_add= r *mc_addr)