From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: Re: [PATCH] mbuf: new flag when Vlan is stripped Date: Mon, 23 May 2016 11:40:34 +0200 Message-ID: <5742D012.6020501@6wind.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: "johndale@cisco.com" , "Zhang, Helin" , "adrien.mazarguil@6wind.com" , "rahul.lakkireddy@chelsio.com" , "alejandro.lucero@netronome.com" , "sony.chacko@qlogic.com" To: "Ananyev, Konstantin" , "dev@dpdk.org" 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) In-Reply-To: <2601191342CEEE43887BDE71AB97725836B5CAB4@irsmsx105.ger.corp.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >> 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