From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id D0A8D5A36 for ; Mon, 23 May 2016 11:40:45 +0200 (CEST) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1b4mNu-0005Ku-2z; Mon, 23 May 2016 11:42:50 +0200 To: "Ananyev, Konstantin" , "dev@dpdk.org" References: <1462897493-6567-1-git-send-email-olivier.matz@6wind.com> <1463993205-5623-1-git-send-email-olivier.matz@6wind.com> <2601191342CEEE43887BDE71AB97725836B5CAB4@irsmsx105.ger.corp.intel.com> Cc: "johndale@cisco.com" , "Zhang, Helin" , "adrien.mazarguil@6wind.com" , "rahul.lakkireddy@chelsio.com" , "alejandro.lucero@netronome.com" , "sony.chacko@qlogic.com" From: Olivier Matz Message-ID: <5742D012.6020501@6wind.com> Date: Mon, 23 May 2016 11:40:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <2601191342CEEE43887BDE71AB97725836B5CAB4@irsmsx105.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] mbuf: new flag when Vlan is stripped X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2016 09:40:45 -0000 >> static inline uint64_t >> -rx_desc_status_to_pkt_flags(uint32_t rx_status) >> +rx_desc_status_to_pkt_flags(uint32_t rx_status, uint8_t vlan_strip) >> { >> uint64_t pkt_flags; >> + uint64_t vlan_flags; >> + >> + /* if vlan is stripped, set the proper flag */ >> + if (vlan_strip) >> + vlan_flags = PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED; >> + else >> + vlan_flags = PKT_RX_VLAN_PKT; >> >> /* >> * Check if VLAN present only. >> * Do not check whether L3/L4 rx checksum done by NIC or not, >> * That can be found from rte_eth_rxmode.hw_ip_checksum flag >> */ >> - pkt_flags = (rx_status & IXGBE_RXD_STAT_VP) ? PKT_RX_VLAN_PKT : 0; >> + pkt_flags = (rx_status & IXGBE_RXD_STAT_VP) ? vlan_flags : 0; > > > Instead of storing in rxq (and passing as a parameter) a bool value for vlan_strip (=on/off), > you probably can store in rxq and pass as a parameter here uint64_t vlan_flags; > Then it will be: > > rx_desc_status_to_pkt_flags(uint32_t rx_status, uint64_t vlan_flags) > { > ... > pkt_flags = (rx_status & IXGBE_RXD_STAT_VP) ? vlan_flags : 0; > ... > } > > ... > pkt_flags = rx_desc_status_to_pkt_flags(s[j], rxq->vlan_flags); > > Might help to save few cycles here. Yep, will do in v2. Olivier