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 E932FA055A; Wed, 26 Feb 2020 17:37:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BEB281BFAB; Wed, 26 Feb 2020 17:37:07 +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 1B2782C02 for ; Wed, 26 Feb 2020 17:37:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rbbn.com; s=mimecast20180816; t=1582735025; 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; bh=jA2TCIC/i9FfKaIiPCiLVzModyaXO/qeMbN9MWIuPa8=; b=WE40OBPk4p6OTrCNXlxg47yHONxKOuz3MweWYUWBkLe/VdsKmSMXxSXwoNaSGW4YNy4dET x1GLcCakm31/76ek1HAsRE6KfSgUv9ncGWbsEW9//trv4+aGO2UWjmE1/U1kS7ULTIEzLo mI8ScVGNABvzxs5aYc30k2VyuoDrzPI= Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-99-o_1yd5ioPj6Gmo5avfV2Ag-1; Wed, 26 Feb 2020 11:37:03 -0500 X-MC-Unique: o_1yd5ioPj6Gmo5avfV2Ag-1 Received: from DM6PR03MB4777.namprd03.prod.outlook.com (2603:10b6:5:18b::26) by DM6PR03MB4523.namprd03.prod.outlook.com (2603:10b6:5:109::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.21; Wed, 26 Feb 2020 16:37:00 +0000 Received: from DM6PR03MB4777.namprd03.prod.outlook.com ([fe80::8a1:2fec:6da4:5789]) by DM6PR03MB4777.namprd03.prod.outlook.com ([fe80::8a1:2fec:6da4:5789%5]) with mapi id 15.20.2750.021; Wed, 26 Feb 2020 16:36:59 +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, "Dey, Souvik" Date: Wed, 26 Feb 2020 11:36:35 -0500 Message-Id: <20200226163635.18252-1-sodey@rbbn.com> X-Mailer: git-send-email 2.9.3.windows.1 X-ClientProxiedBy: BN8PR15CA0018.namprd15.prod.outlook.com (2603:10b6:408:c0::31) To DM6PR03MB4777.namprd03.prod.outlook.com (2603:10b6:5:18b::26) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from SODEY-LMA.sonusnet.com (208.45.178.4) by BN8PR15CA0018.namprd15.prod.outlook.com (2603:10b6:408:c0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2750.18 via Frontend Transport; Wed, 26 Feb 2020 16:36:59 +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: 8a2e3750-95b1-41fd-114a-08d7bada19ea X-MS-TrafficTypeDiagnostic: DM6PR03MB4523: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0325F6C77B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(366004)(346002)(376002)(39850400004)(189003)(199004)(4326008)(107886003)(81166006)(956004)(52116002)(16526019)(6486002)(81156014)(1076003)(6506007)(186003)(8676002)(8936002)(2616005)(86362001)(26005)(6666004)(66476007)(36756003)(5660300002)(2906002)(6512007)(66556008)(66946007)(478600001)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR03MB4523; H:DM6PR03MB4777.namprd03.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: komG5Ey2wNmPfMz0Mi3Y6ZDd3Abn4pWsH8toHO9SVk+aGhgMFC5PxkfgEz7SXYWCknyrfBcA13xdp+jZ3bNzdB6YpglRvmdNH7Ok0XMZI5yT/S3kUh5GfTxErcf5oohEKGibsN17wbHBdUXfAFh3ZvoYsuiPUW9KC355k+agwfpmcpXQNhf3gMmpgm0c4IfXvanWWcu9NrNXKXoqIvzTXJc3/tkJLFSdppO/ERTcQb4RBNcZ1Ol9+vORfHaI8ffA21xapWnHO4ikiOW2of2FijNDXD2SUtIb8+xcyHq1laRXNd81+WCRnww6pI6TDgPDXRMayKyWTb4ecRo5EOv0+2ZDCzVwVecpWimrZxY/KXMNlOU6OrpbtRv7wdpbSDen7VAfGlfABxZCNBmTzRnn+W9DKjmDHqtP3XB7e3MZ4gqC3/g6GaS3iikVVzQ7GtFQ X-MS-Exchange-AntiSpam-MessageData: ycb1O93Tkub/PBjQBAgcg3ZTduGwz5p2lIjhd7e1hWj27zzvGV+pvNqibOyU6h60CGoJm2GTB/Mq5FLqFje3joVuECPKVsAO1UFHVHv9IkjeQ2SmbRstgdJT6fBC31tcxQusDA+AABFu6AFxTdQrvQ== X-OriginatorOrg: rbbn.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a2e3750-95b1-41fd-114a-08d7bada19ea X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2020 16:36:59.8030 (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: sOSQDBNYTtNRobz0kHSRNWylS9SPqvxNWPGeJExztW+mcGk4e84zSVNk6S+nFvRa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4523 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-dev] [PATCH] bnx2x: handle guest vlan for SR-IOV case X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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" --- drivers/net/bnx2x/bnx2x.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 0b4030e..f7cca21 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=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/* 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 ether_hdr *eh =3D +=09=09=09 rte_pktmbuf_mtod(m0, struct ether_hdr *); +=09=09=09/* Still need to consider inband vlan for enforced */ +=09=09=09if (eh->ether_type =3D=3D rte_cpu_to_be_16(ETHER_TYPE_VLAN)) { +=09=09=09=09struct 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} else { +=09=09=09=09tx_start_bd->vlan_or_ethertype =3D +=09=09=09=09=09rte_cpu_to_le_16(rte_be_to_cpu_16(eh->ether_type)); +=09=09=09} =09=09} =09} =20 --=20 2.9.3.windows.1 ---------------------------------------------------------------------------= -------------------------------------------- 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. ---------------------------------------------------------------------------= --------------------------------------------