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 6B2E4A0564; Fri, 28 Feb 2020 19:29:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1C1041BFCE; Fri, 28 Feb 2020 19:29:19 +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 A363E1BFC7 for ; Fri, 28 Feb 2020 19:29:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rbbn.com; s=mimecast20180816; t=1582914557; 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=dFNw+c4lb1YPsaxCNn+c0JlSNuVJzEDA+NsqTKC7aBQ=; b=ZO7GNC9LXt6v88r01w1icaPcfkPWf8KLqQFAEkwRQTyEXB/NMeFMAxtQkGbYREN1WtwWG3 d/8Zq8kHhTQR1ErVqA0uYOFVl8cHg6+L5//stQDeHEC332eiH3zgXy1rwLg9WU9J0ygXLk y3l6jIYX3LzLE7UO7Yek+PAkYHRR+0A= Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-13-xaKmQBPRM0Kwcp8KlZBzkQ-1; Fri, 28 Feb 2020 13:29:14 -0500 X-MC-Unique: xaKmQBPRM0Kwcp8KlZBzkQ-1 Received: from MN2PR03MB4781.namprd03.prod.outlook.com (2603:10b6:208:ae::23) by MN2SPR01MB0055.namprd03.prod.outlook.com (2603:10b6:208:1d1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.14; Fri, 28 Feb 2020 18:29:08 +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 18:29:08 +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 13:28:43 -0500 Message-Id: <20200228182843.14568-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: MN2PR20CA0028.namprd20.prod.outlook.com (2603:10b6:208:e8::41) 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 MN2PR20CA0028.namprd20.prod.outlook.com (2603:10b6:208:e8::41) 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 18:29:07 +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: 8e8ed0b4-6654-4c43-bad2-08d7bc7c1914 X-MS-TrafficTypeDiagnostic: MN2SPR01MB0055: 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)(396003)(366004)(346002)(376002)(199004)(189003)(5660300002)(66476007)(66556008)(2616005)(956004)(2906002)(26005)(16526019)(66946007)(186003)(6506007)(86362001)(81166006)(6512007)(8936002)(6666004)(81156014)(36756003)(6486002)(107886003)(8676002)(52116002)(478600001)(1076003)(4326008)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2SPR01MB0055; 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: uhPAYDdjyp87kpGM+jyAf2wDJENeRRiNP0vRWnFN4nMCjQlHMJECLr+onzyjgk7+53AnCaWdUrc5fbYHsPrbhsVWKZxpR6n1W1HZ+jHLYOHKqisOxnKDF+SbiS3NHJ09RhgjmFnytPJTutEg38zMM6ZF76eXxHF7D/Y3AN6XAJ/eG977UPBy2lADm6Iuw2ZmqRzVgo/bsWa8YcwGQxKf7ma6WvLjA4dkGNkRRG67wjyU1XJX/U8NegiDgB3qfOyKKGmx/MVCn86kAhsu+Uq9JOveLRip82UOhnbvA3WsmbrcQa+8sxMQi5cki6ISgA0Vi8c96qe1Jhdpa/18SOK3qlJBafH2a3DGXiFKL6PfNQzlwiGoM4DqRcSYQyQJBiPYVSY91C2/dVgd1i+S4qBUxl2kwEgeogqKIUsxQUapNb+p2XQhazhWVqo1HI+T1fMh X-MS-Exchange-AntiSpam-MessageData: OiSTGycFt/Z7GlaASE2374hAa8uDB3mhQZ3Hj2+KStPEVVUNBh1382efzVF9S7C8kUxZrDlUiufGxsFYc2KxRCzuq5+UcFSleEea/54PFec7b0tocpfH4Coboy7a+QjIviU1phdprRXn5ViL9aIuqQ== X-OriginatorOrg: rbbn.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e8ed0b4-6654-4c43-bad2-08d7bc7c1914 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2020 18:29:08.1498 (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: Q2zAk0YM5LyE+nAK3ErrZgGnyX5yZ9wlbzoA/RMV0WDSWn0YnfDbvMR/tirZgeDo X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2SPR01MB0055 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 v2] net/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" --- v2: * Fixed complitaion issues=20 ether_type to rte_ether_type/ ETHER_TYPE_VLAN to RTE_ETHER_TYPE_VLAN/ vlan_hdr to rte_vlan_hdr/ * Changed the subject line from bnx2x to net/bnx2x. drivers/net/bnx2x/bnx2x.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index f7cca21..a96e8c2 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -2219,11 +2219,11 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, stru= ct rte_mbuf *m0) =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=09struct rte_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=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); @@ -2231,7 +2231,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct= rte_mbuf *m0) =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(rte_cpu_to_le_16( +=09=09=09=09=09=09rte_be_to_cpu_16(eh->ether_type))); =09=09=09} =09=09} =09} --=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. ---------------------------------------------------------------------------= --------------------------------------------