From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-5.cisco.com (rcdn-iport-5.cisco.com [173.37.86.76]) by dpdk.org (Postfix) with ESMTP id 7B4AA7D05 for ; Thu, 24 Aug 2017 16:16:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2932; q=dns/txt; s=iport; t=1503584216; x=1504793816; h=subject:to:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding; bh=pqHZSUUMJ9hjOJZEtFfckk6JUESuIwx/C9HEQbHq9OY=; b=dPjz/QZGIXLNTOQ2ucX0fTznEzWJjFlUFi8QcYwyHzsVJYogq+Lhjs+l swswyOz73g3OYSvLAVGoggg8eUoumjak79zNAckbKEYxVe024+tBTmlEn HvSjgSfdVnI0q0EbaVVN1cY9WKn4+xiwvnlr6bR67uR367bDiHrjIq380 Q=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AUBQAO355Z/5FdJa1dGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBg1pkgRUBnimBTiKWJQ6CBC6FGQKESkEWAQIBAQEBAQEBayiFGQEFJws?= =?us-ascii?q?BBVELGC5XBgEMBgIBAReKFhCxJTqLXgEBAQEBAQEBAQEBAQEBAQEigyqBMVGBT?= =?us-ascii?q?Gh7KwuCcYRTAQEGRIVIAQSJfpZbh1aDVoNVhUSCEhuFSINZhxZIg2iNP4RBJgI?= =?us-ascii?q?vgQpTJBWFYBwZgWokNgGIfYIyAQEB?= X-IronPort-AV: E=Sophos;i="5.41,421,1498521600"; d="scan'208";a="68880279" Received: from rcdn-core-9.cisco.com ([173.37.93.145]) by rcdn-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Aug 2017 14:16:55 +0000 Received: from [10.150.214.153] ([10.150.214.153]) by rcdn-core-9.cisco.com (8.14.5/8.14.5) with ESMTP id v7OEGsaU024336; Thu, 24 Aug 2017 14:16:55 GMT To: Olivier Matz , zhang.xinghua1@zte.com.cn, dev@dpdk.org References: <57230D3D.6070209@6wind.com> From: Roger B Melton Message-ID: Date: Thu, 24 Aug 2017 10:16:47 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <57230D3D.6070209@6wind.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [dpdk-dev] Byte order of vlan_tci of rte_mbuf is different on different source 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: Thu, 24 Aug 2017 14:16:56 -0000 Hi folks, Resurrecting this old thread.  I ran across this issue recently in DPDK 17.05, and it's also present in17.08.  It appears no fix was committed.  I'm working on a solution, but if anyone has a fix in flight please let me know. Regards, Roger On 4/29/16 3:29 AM, Olivier Matz wrote: > Hi, > > On 04/25/2016 04:35 AM, zhang.xinghua1@zte.com.cn wrote: >> When using I350 working on SR-IOV mode, we got confused that byte order >> of vlan_tci in the VF received packet descriptor is different when the >> packet source is different. >> >> 1) Packets from VF to VF, the byte order is big-endian. (e.g. 0xF00) >> 2) Packets from PC to VF, the byte order is little-endian. (e.g. 0xF) >> >> Below is the testing net-work: >> VM0 VM1 PC >> VF0 VF1 | >> | | | >> +------+------+ | >> | | >> PF | >> hypervisor | >> SR-IOV NIC | >> | | >> | VLAN 15 | >> +---------switch-------+ >> >> >> We make a breakpoint at the following line of eth_igb_recv_pkts, the >> vlan_tci >> we observed that everytime. >> >> uint16_t >> eth_igb_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, >> uint16_t nb_pkts) >> >> /* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */ >> rxm->vlan_tci = rte_le_to_cpu_16(rxd.wb.upper.vlan); > In rte_mbuf.h, it is specified that these values (vlan_tci and > vlan_tci_outer) must be stored in CPU order. > > It's probably a driver or hardware issue. Note that in linux there is > something that looks similar to your issue: > > http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/igb/igb_main.c#L1278 > > /* On i350, i354, i210, and i211, loopback VLAN packets > * have the tag byte-swapped. > */ > if (adapter->hw.mac.type >= e1000_i350) > set_bit(IGB_RING_FLAG_RX_LB_VLAN_BSWAP, &ring->flags); > > I think you could check if the same thing is done in the > dpdk driver. > > >> -------------------------------------------------------- >> ZTE Information Security Notice: The information contained in this mail (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s). If you are not an intended recipient, any disclosure, reproduction, distribution or other dissemination or use of the information contained is strictly prohibited. If you have received this mail in error, please delete it and notify us immediately. >> > This notice should be removed in public emails. > > Regards, > Olivier > . >