From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0058.outbound.protection.outlook.com [104.47.34.58]) by dpdk.org (Postfix) with ESMTP id 7DF252BAE for ; Fri, 13 Jul 2018 16:16:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MHRR8OqeDcDa2UUD/B/yWv94zbnc22g3xBRv1VF8rEI=; b=PCLvcDGgThL9R1iLqEToOdG15zbFt/S7skNTswTwVG0eMuDIFX1Miuz4L14nfc2qImNKJTAGRm+vwXemzBwdBDxqOTMWHMKCel21INwR8w+eU7P+wNpWUtE8/m1uraN+og9sURxgFPr1k9yJ94KgWEcMEFdFH90LJ0kcKtUw0Mk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Rakesh.Kudurumalla@cavium.com; Received: from localhost.localdomain (115.113.156.2) by BY2PR07MB662.namprd07.prod.outlook.com (2a01:111:e400:2c50::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.18; Fri, 13 Jul 2018 14:16:20 +0000 To: Ferruh Yigit , Pavan Nikhilesh , jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com Cc: dev@dpdk.org, "Kudurumalla, Rakesh" , Shahaf Shuler , Andrew Rybchenko , Olivier MATZ References: <20180701164637.978-1-pbhagavatula@caviumnetworks.com> <63fa281f-e777-dc35-fa39-33e5dbcb0d42@intel.com> From: rkudurumalla Message-ID: Date: Fri, 13 Jul 2018 19:46:00 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <63fa281f-e777-dc35-fa39-33e5dbcb0d42@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BM1PR0101CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::14) To BY2PR07MB662.namprd07.prod.outlook.com (2a01:111:e400:2c50::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0febc29a-425f-4a06-5679-08d5e8cb36e2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:BY2PR07MB662; X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB662; 3:t1JNRpbnwpukkdr7ngfrQ4Wjauu+tHBq4jAvxykiwKRol6EKyDZ3J3oCbuG4beYzFB73iwzqQ4GINHUkC3Yp4AM6ZxsSZIEr//5rJy1XF8dB5rc/kWrzttIvjSykjUF1Q1PujcY0lNueYY+dxUqyJfFzR99p+xQg6SKJwzarc+Z+9pa+rHGs9O79glNylqzmPYMA2XDht3qVvqozR0tOxW5w46nEcXM8Wc/vCgz5yi0ZlmRmfdGFeWyZ8NQpslvq; 25:JrnN6j2t12SKS70f82ccPDUQgGMN03ITveje8xOzVLoQXONRoFefdvAhAk1U47nKeIQfGHzHoewgBab9pK9f8LQfAySg1vz+hZtoh9whtzpLtcH/VS/Zce8Zt5y6+5JQVA1UOJVQjDCxVLfEIU8C438m2m2Ptm3CDh9Msns6QyIt3gydX7o3TRXprDR3ewVRkvjDjHfxBHw4EDpYDc4kvfNL55eiYiwpMkL1SxjZ0yCBAcW3vKigT3qZLY8YRWjlx3wbC4vAbol8VdolHWuQvPnDi+Y4hfLaahg/J/8vElYkei8PGNXvR4KV1J3zAKN53LTskOeYWD0UzjKLX3gDwg==; 31:QlcecqnupxWlOfbKNxhTwq3JR7r3TFMh3xQKcs/XUoZMGv+NXa2BmyWYe5dX05/fWM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0tQFDJ8OHiivcbn2KyPnkIrJPYkKTmG3zRIkdAMpm+WE13h58g2t14T1m7fmg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3002001)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:BY2PR07MB662; BCL:0; PCL:0; RULEID:; SRVR:BY2PR07MB662; X-Forefront-PRVS: 07326CFBC4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(39860400002)(376002)(136003)(346002)(366004)(199004)(189003)(57704003)(86152003)(25786009)(26005)(105586002)(42882007)(7736002)(8936002)(446003)(305945005)(81166006)(81156014)(8676002)(106356001)(476003)(2616005)(58126008)(110136005)(186003)(16526019)(11346002)(6512007)(486006)(956004)(31686004)(36756003)(14444005)(4326008)(54906003)(6246003)(97736004)(64126003)(65806001)(2906002)(65826007)(6636002)(6666003)(68736007)(66066001)(316002)(6116002)(47776003)(3846002)(5660300001)(230700001)(52116002)(386003)(31696002)(76176011)(2486003)(6506007)(23676004)(72206003)(55236004)(6486002)(52146003)(478600001)(53936002)(65956001)(53546011)(50466002)(229853002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR07MB662; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjA3TUI2NjI7MjM6YjRHVlNiRTU5RElUNWV1cWN1VkdlMnUzVEkv?= =?utf-8?B?V2tKa2tuT2RmMllKdEEwYVl3TTJpVGZwY01iY1VQdmJOUHJ3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Kvlw5X5LAhEbx8d2LKtrBRAiO+jss2m8fwSdbjW+0swonC8XnaCXWGVDHfjGIrClM7q/k1h3zmqaBGxBU84hzAwolqjK9Pw8pV8ogRqx9be8w==; 5:buFhvM4Bs4ns+hSvbdMduE9GPEDQ7C2/BVSrZ+vCEwztVYx11ptiGwidaY2qlwlFteQme3oib+NVNyWivls1FD+0Nz8dBHpM8qIWBART3fFgKJ8nL1briw8OwrmESeY69bmsR4Fh4ZgBsuiyZ9SVSmkoqLy1mL1i/eNbtLk+f0Y=; 24:yyFTyp7ti82v7+31WRo5mTbM4sdnrYBlONbGic56ZCI7CpL5an0FXTTKGBGGN6JDikvrFqTgPKSm0U17jaK7IJOf0r1XoY5AalC2qS4xGVc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR07MB662; 7:6CwYoC4N7kafFneaxFwyrRIlpyHnX7zEHQTKt5Un79Ets7/pVievx37TtL+mWs5xdgOg27Syz2q1oar5NoSQ6+NAuUBfSJndVEzBtxmScTiJGB9E5hefjhch1isr23dUAtuu8ZZUEX8ccMbVHPT1xQviePbnH5tPkpv4MHJaEvgCymz21204YNjISiiw3xZQCVYM3qUnUnKi68KEd0FDWf2e43PmvoTGc6nYoPfv7lCIjJEfEgNkN6sFM049pMLx X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2018 14:16:20.8821 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0febc29a-425f-4a06-5679-08d5e8cb36e2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB662 Subject: Re: [dpdk-dev] [PATCH] net/thunderx: add support for Rx VLAN offload 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: , X-List-Received-Date: Fri, 13 Jul 2018 14:16:27 -0000 On 07/04/2018 11:06 PM, Ferruh Yigit wrote: > External Email > > On 7/1/2018 5:46 PM, Pavan Nikhilesh wrote: >> From: "Kudurumalla, Rakesh" >> >> This feature is used to offload stripping of vlan header from recevied >> packets and update vlan_tci field in mbuf when >> DEV_RX_OFFLOAD_VLAN_STRIP & ETH_VLAN_STRIP_MASK flag is set. >> >> Signed-off-by: Rakesh Kudurumalla >> Signed-off-by: Pavan Nikhilesh >> --- >> drivers/net/thunderx/base/nicvf_hw.c | 1 + >> drivers/net/thunderx/nicvf_ethdev.c | 59 +++++++++++++++++------ >> drivers/net/thunderx/nicvf_rxtx.c | 70 ++++++++++++++++++++++++---- >> drivers/net/thunderx/nicvf_rxtx.h | 15 ++++-- >> drivers/net/thunderx/nicvf_struct.h | 1 + > > In thunderx.ini, "VLAN offload" already marked as P(Partially) is it still > partially? Why? > > It is still partial because Tx VLAN offload(insertion of vlan header > for tx packets) is yet to be Implemented > > <...> > >> @@ -1590,9 +1595,9 @@ nicvf_vf_start(struct rte_eth_dev *dev, struct nicvf *nic, uint32_t rbdrsz) >> nic->rbdr->tail, nb_rbdr_desc, nic->vf_id); >> >> /* Configure VLAN Strip */ >> - vlan_strip = !!(dev->data->dev_conf.rxmode.offloads & >> - DEV_RX_OFFLOAD_VLAN_STRIP); >> - nicvf_vlan_hw_strip(nic, vlan_strip); >> + mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK | >> + ETH_VLAN_EXTEND_MASK; > > You don't need anything more than ETH_VLAN_STRIP_MASK but agreed no issue add > more if you prefer. > >> + ret = nicvf_vlan_offload_config(dev, mask); >> >> /* Based on the packet type(IPv4 or IPv6), the nicvf HW aligns L3 data >> * to the 64bit memory address. >> @@ -1983,6 +1988,7 @@ static const struct eth_dev_ops nicvf_eth_dev_ops = { >> .dev_infos_get = nicvf_dev_info_get, >> .dev_supported_ptypes_get = nicvf_dev_supported_ptypes_get, >> .mtu_set = nicvf_dev_set_mtu, >> + .vlan_offload_set = nicvf_vlan_offload_set, > > Not related to this patch but I believe this name 'vlan_offload_set' is > confusing, it enable/disable VLAN related config: > - vlan strip offload > - vlan filtering package (drop/accept specific vlans) > - double vlan feature (not offload if I am not missing anything) > We can think about a more proper name later... > > Also rte_eth_dev_set_vlan_offload() API may have a defect, it seems not taking > capability flags into account, cc'ed Shahaf and Andrew for information. > > And I have a question about DEV_TX_OFFLOAD_VLAN_INSERT, perhaps goes to Olivier, > if DEV_TX_OFFLOAD_VLAN_INSERT enabled what is the correct way to provide > vlan_tci to insert? > And do we need something like PKT_RX_VLAN_INSERT and use mbuf->vlan_tci value to > have the ability to insert VLAN to some packets? > > <...> > >> +static int >> +nicvf_vlan_offload_set(struct rte_eth_dev *dev, int mask) >> +{ >> + nicvf_vlan_offload_config(dev, mask); > > Don't you need to change rx_pkt_burst function according request here. > > Like if driver was using nicvf_recv_pkts_vlan_strip() and application disabled > vlan_strip, what will happen? > if application disables vlan_strip under this condition, hardware doesn't strip vlan header from the packets and hence cqe_rx_w0.vlan_stripped field is zero and pkt->ol_flags is update with zero > > <...> > >> +uint16_t __hot >> +nicvf_recv_pkts_vlan_strip(void *rx_queue, struct rte_mbuf **rx_pkts, >> + uint16_t nb_pkts) >> +{ >> + return nicvf_recv_pkts(rx_queue, rx_pkts, nb_pkts, >> + NICVF_RX_OFFLOAD_NONE | NICVF_RX_OFFLOAD_VLAN_STRIP); > > Why do you OR NICVF_RX_OFFLOAD_NONE, this cause zeroing the pkt->ol_flags which > will be overriten because of NICVF_RX_OFFLOAD_VLAN_STRIP alread> > After enabling vlan strip , if we receive plain packets pkt->ol_flags is updated with zero value.