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 F20D6A0561 for ; Fri, 28 Feb 2020 20:48:38 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BBAA223D; Fri, 28 Feb 2020 20:48:38 +0100 (CET) Received: from us-smtp-delivery-181.mimecast.com (us-smtp-delivery-181.mimecast.com [216.205.24.181]) by dpdk.org (Postfix) with ESMTP id 04AA723D for ; Fri, 28 Feb 2020 20:48:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rbbn.com; s=mimecast20180816; t=1582919317; 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: in-reply-to:in-reply-to:references:references; bh=KyDRz5yRdFSFtfiT2y+yoNI55t8x/DS50DWbraivvJU=; b=E1DVIzBEXspzUaorTKO0wt4y0fXFtF4ezcYF1RxizXI+ceuaF9lZBP5Me+1w9GNBAlAKe3 9NeANOLLPuL3CuLbJ0uPYF3eV/IXn1Tvwwm9nnp1VCIiMf6S42/mTyGmo+HqsD/KxXvkz5 pU5U+0xNMwxqDU55VXoyIqVIbouGSs8= Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-493-R5vc2O1zPaOA4whDt3D0ew-1; Fri, 28 Feb 2020 14:48:35 -0500 X-MC-Unique: R5vc2O1zPaOA4whDt3D0ew-1 Received: from MN2PR03MB4781.namprd03.prod.outlook.com (2603:10b6:208:ae::23) by MN2PR03MB5261.namprd03.prod.outlook.com (2603:10b6:208:19e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.15; Fri, 28 Feb 2020 19:48:34 +0000 Received: from MN2PR03MB4781.namprd03.prod.outlook.com ([fe80::347a:449f:f327:3a89]) by MN2PR03MB4781.namprd03.prod.outlook.com ([fe80::347a:449f:f327:3a89%7]) with mapi id 15.20.2750.024; Fri, 28 Feb 2020 19:48:34 +0000 From: "Dey, Souvik" To: rmody@marvell.com, shshaikh@marvell.com, jerinj@marvell.com, ferruh.yigit@intel.com, thomas@monjalon.net Cc: dev@dpdk.org, stable@dpdk.org, "Dey, Souvik" Date: Fri, 28 Feb 2020 14:48:23 -0500 Message-Id: <20200228194823.14992-1-sodey@rbbn.com> X-Mailer: git-send-email 2.9.3.windows.1 In-Reply-To: <20200226163635.18252-1-sodey@rbbn.com> References: <20200226163635.18252-1-sodey@rbbn.com> X-ClientProxiedBy: MN2PR16CA0055.namprd16.prod.outlook.com (2603:10b6:208:234::24) To MN2PR03MB4781.namprd03.prod.outlook.com (2603:10b6:208:ae::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from SODEY-LMA.sonusnet.com (208.45.178.4) by MN2PR16CA0055.namprd16.prod.outlook.com (2603:10b6:208:234::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2772.15 via Frontend Transport; Fri, 28 Feb 2020 19:48:33 +0000 X-Mailer: git-send-email 2.9.3.windows.1 X-Originating-IP: [208.45.178.4] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d25bf71b-0d5f-4255-98e4-08d7bc8731b9 X-MS-TrafficTypeDiagnostic: MN2PR03MB5261: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0327618309 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(39850400004)(366004)(396003)(346002)(376002)(199004)(189003)(86362001)(66556008)(26005)(36756003)(6506007)(52116002)(107886003)(478600001)(186003)(66476007)(316002)(956004)(6512007)(2616005)(6486002)(16526019)(1076003)(8676002)(5660300002)(81156014)(6666004)(8936002)(66946007)(2906002)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR03MB5261; H:MN2PR03MB4781.namprd03.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VfLusrVDF1vyIHuU7LNcdJsLrZ5Ztp8ayXq8wZhvIMWzQzcyh9tPS+RA73X2P14ucJB3EakFY3D1np/ON6vsdUQYJPvnp/rElkgUNA5glju8asN88zIXRiBTjkKbz3Fe0T4Y1vl0V3AHo1XPLPNtQp+V4zGa+bLL1cnck/wAiAJjEStAKRmZwAekGzI2ga96OVDz/wsbUjX6DYmkzrFEtYw+dthkKc2z4nb7PTxFrklwQky5LfN6+dougyvdc56Fm0jP9sJopfT+TGRKp+FQ/+VRd9VEHumVADrk96ZR7WPAI0Ek2vjcOY9R2poSAk0sAlUGoHRe161tgLrcUjO8DC4CVAIKzdcZp2n7dmcIhTBInE/rrMjvdWL7083pgYm9sxlLbe6nOfp3uJFKOWypKc97YCt6S0mFv81VDW27DR8y0D8KBPnouMFPgN/a/yee X-MS-Exchange-AntiSpam-MessageData: /JDNHKMaxEj+GNnl6GlTj3gMdZA80aJDoeMa98pq8FMBWFIz/+egCZj43DN6GUkQDvvEAhl6DYrSwKJZXB7m7WJW4yTJnQjBD5qSgsKrb5OmOmBuR/wAB8cVI9cduyJI5GkAoK0dcaTxcVciIhxknw== X-OriginatorOrg: rbbn.com X-MS-Exchange-CrossTenant-Network-Message-Id: d25bf71b-0d5f-4255-98e4-08d7bc8731b9 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2020 19:48:33.9147 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 29a671dc-ed7e-4a54-b1e5-8da1eb495dc3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: A36tpkFRqcqOboOQ65g4UlRokY2x7X0XzZtH5l5wd1CDIfdXfRW/BaZ0ta6WhCol X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5261 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: rbbn.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-stable] [PATCH v2] bnx2x: handle guest vlan for SR-IOV case 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" In case of bnx2xvf pmd, tx packets can support vland id in 2 ways : 1. setting the mbuf ol_flags=3DPKT_TX_VLAN_PKT and passing the vlanid in mbuf->vlan_tci. 2. the tx packet itself has the vlan id included in the packet. The first case is working as expected but the second case where the vlan id is included in thetx packets itself was found not working as expected. To handle that we need to properly set the start_bd bitfield and the vlan_or_ethertype instead of setting it to just the ethertype in case of VF. Signed-off-by: "Dey, Souvik" --- v2: * Fix compilation issues. ether_type to rte_ether_type/ ETHER_TYPE_VLAN to RTE_ETHER_TYPE_VLAN/ vlan_hdr to rte_vlan_hdr/ * Kept the Subject still same for refernce. drivers/net/bnx2x/bnx2x.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 0b4030e..6113d7c 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -2216,11 +2216,23 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, stru= ct rte_mbuf *m0) =09=09=09tx_start_bd->vlan_or_ethertype =3D =09=09=09 rte_cpu_to_le_16(pkt_prod); =09=09else { +=09=09=09/* when transmitting in a vf, start bd must hold the ethertype +=09=09=09 * for fw to enforce it +=09=09=09 */ =09=09=09struct rte_ether_hdr *eh =3D =09=09=09 rte_pktmbuf_mtod(m0, struct rte_ether_hdr *); - -=09=09=09tx_start_bd->vlan_or_ethertype =3D -=09=09=09 rte_cpu_to_le_16(rte_be_to_cpu_16(eh->ether_type)); +=09=09=09/* Still need to consider inband vlan for enforced */ +=09=09=09if (eh->ether_type =3D=3D rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN)) = { +=09=09=09=09struct rte_vlan_hdr *vh =3D (struct vlan_hdr *)(eh + 1); +=09=09=09=09tx_start_bd->bd_flags.as_bitfield |=3D +=09=09=09=09=09(X_ETH_INBAND_VLAN << +=09=09=09=09=09=09ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT); +=09=09=09=09tx_start_bd->vlan_or_ethertype =3D +=09=09=09=09=09rte_cpu_to_le_16(ntohs(vh->vlan_tci)); +=09=09=09} esle { +=09=09=09=09tx_start_bd->vlan_or_ethertype =3D (rte_cpu_to_le_16 +=09=09=09=09=09(rte_be_to_cpu_16(eh->ether_type))); +=09=09=09} =09=09} =09} =20 --=20 2.9.3 ---------------------------------------------------------------------------= -------------------------------------------- Notice: This e-mail together with any attachments may contain information o= f Ribbon Communications Inc. that is confidential and/or proprietary for the sole use of the intended recipie= nt. Any review, disclosure, reliance or distribution by others or forwarding without express permission is strictly= prohibited. If you are not the intended recipient, please notify the sender immediately and then delete all copies,= including any attachments. ---------------------------------------------------------------------------= --------------------------------------------