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 99A2DA04B5 for ; Tue, 3 Dec 2019 19:28:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8EAA537AF; Tue, 3 Dec 2019 19:28:05 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 0411D1BE80 for ; Tue, 3 Dec 2019 19:28:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575397683; 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=Vz4sfakTHGMsJkIemwHlglA2VLqEKn/LSQSUdq40Zys=; b=iRSY81uTXjLjAbjVts6lcmL+BKZLL7YaBX/SdjEocFjsdvGaQSrYPYzO8zXcR4aHP3ezoe YjzXdqIjEY/f8z5aaXdDnu3NG8NRaxkf2byYK57z6uUd2/xx3Ve4ig1WLhs3AHkrE+J8vS NBItd74fe1Ggsc/XuWe8ikcpkus3EEI= 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-325-02iUoMOsPZqxpjX0g5G4rQ-1; Tue, 03 Dec 2019 13:28:01 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF9CF8017CC; Tue, 3 Dec 2019 18:28:00 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-10.ams2.redhat.com [10.36.117.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED0405C240; Tue, 3 Dec 2019 18:27:59 +0000 (UTC) From: Kevin Traynor To: Rahul Lakkireddy Cc: dpdk stable Date: Tue, 3 Dec 2019 18:26:26 +0000 Message-Id: <20191203182714.17297-17-ktraynor@redhat.com> In-Reply-To: <20191203182714.17297-1-ktraynor@redhat.com> References: <20191203182714.17297-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: 02iUoMOsPZqxpjX0g5G4rQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/cxgbe: fix parsing VLAN ID rewrite action' has been queued to LTS release 18.11.6 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.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/10/19. 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/0367aa0d7b11a240c9= 2a0cb4fcd3184a63d57533 Thanks. Kevin. --- >From 0367aa0d7b11a240c92a0cb4fcd3184a63d57533 Mon Sep 17 00:00:00 2001 From: Rahul Lakkireddy Date: Sat, 28 Sep 2019 02:00:04 +0530 Subject: [PATCH] net/cxgbe: fix parsing VLAN ID rewrite action [ upstream commit 46a687dbfa4d51e31515e08cae045a691144c8b5 ] Set VLAN action mode to VLAN_REWRITE only if VLAN_INSERT has not been set yet. Otherwise, the resulting VLAN packets will have their VLAN header rewritten, instead of pushing a new outer VLAN header. Also fix the VLAN ID extraction logic and endianness issues. Fixes: 1decc62b1cbe ("net/cxgbe: add flow operations to offload VLAN action= s") Signed-off-by: Rahul Lakkireddy --- drivers/net/cxgbe/cxgbe_flow.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.= c index f8f3d0a22..f130c7eb4 100644 --- a/drivers/net/cxgbe/cxgbe_flow.c +++ b/drivers/net/cxgbe/cxgbe_flow.c @@ -447,4 +447,5 @@ ch_rte_parse_atype_switch(const struct rte_flow_action = *a, =09const struct rte_flow_action_phy_port *port; =09int item_index; +=09u16 tmp_vlan; =20 =09switch (a->type) { @@ -452,11 +453,19 @@ ch_rte_parse_atype_switch(const struct rte_flow_actio= n *a, =09=09vlanid =3D (const struct rte_flow_action_of_set_vlan_vid *) =09=09=09 a->conf; -=09=09fs->newvlan =3D VLAN_REWRITE; -=09=09fs->vlan =3D vlanid->vlan_vid; +=09=09/* If explicitly asked to push a new VLAN header, +=09=09 * then don't set rewrite mode. Otherwise, the +=09=09 * incoming VLAN packets will get their VLAN fields +=09=09 * rewritten, instead of adding an additional outer +=09=09 * VLAN header. +=09=09 */ +=09=09if (fs->newvlan !=3D VLAN_INSERT) +=09=09=09fs->newvlan =3D VLAN_REWRITE; +=09=09tmp_vlan =3D fs->vlan & 0xe000; +=09=09fs->vlan =3D (be16_to_cpu(vlanid->vlan_vid) & 0xfff) | tmp_vlan; =09=09break; =09case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN: =09=09pushvlan =3D (const struct rte_flow_action_of_push_vlan *) =09=09=09 a->conf; -=09=09if (pushvlan->ethertype !=3D ETHER_TYPE_VLAN) +=09=09if (be16_to_cpu(pushvlan->ethertype) !=3D ETHER_TYPE_VLAN) =09=09=09return rte_flow_error_set(e, EINVAL, =09=09=09=09=09=09 RTE_FLOW_ERROR_TYPE_ACTION, a, --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-03 17:29:52.813236008 +0000 +++ 0017-net-cxgbe-fix-parsing-VLAN-ID-rewrite-action.patch=092019-12-03 17= :29:51.716750661 +0000 @@ -1 +1 @@ -From 46a687dbfa4d51e31515e08cae045a691144c8b5 Mon Sep 17 00:00:00 2001 +From 0367aa0d7b11a240c92a0cb4fcd3184a63d57533 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 46a687dbfa4d51e31515e08cae045a691144c8b5 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 8a5d06ff3..4c8553039 100644 +index f8f3d0a22..f130c7eb4 100644 @@ -49,2 +50,2 @@ --=09=09if (pushvlan->ethertype !=3D RTE_ETHER_TYPE_VLAN) -+=09=09if (be16_to_cpu(pushvlan->ethertype) !=3D RTE_ETHER_TYPE_VLAN) +-=09=09if (pushvlan->ethertype !=3D ETHER_TYPE_VLAN) ++=09=09if (be16_to_cpu(pushvlan->ethertype) !=3D ETHER_TYPE_VLAN)