From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73]) by dpdk.org (Postfix) with ESMTP id 5FBE9199A9 for ; Wed, 11 Oct 2017 16:34:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=8081; q=dns/txt; s=iport; t=1507732474; x=1508942074; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to; bh=Ih6wXEadmYzkxPU8QdIKcaqsxmjejEtjVU36Za5I+8A=; b=gimZqg2jirulpxNSJVbu5NErJqIu+Eb6V70jOoTNh9o5QclM56JEG3Nd JvqTlvDiaL7j6Omp0pk9jYhipdv/hBLRgrsSemue1e8HdClu9zS8klrSO M3CaFltTvpxS6K/t0e17fDZXJX3v2Qo4kSudFRx6wRH/L7NYDOer/YbMX w=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0C6AAAnK95Z/4MNJK1eGQEBAQEBAQEBA?= =?us-ascii?q?QEBBwEBAQEBg1uBUieDeoofjy2BdpBwhT+CEgqFOwKEXz8YAQIBAQEBAQEBayi?= =?us-ascii?q?FHQEBAQEDIwRSDAQLEQQBAQEnAwICRgkIBg0GAgEBiiCqAYFtOieLDAEBAQEBA?= =?us-ascii?q?QEBAQEBAQEBAQEBAQEBAR2DLYIHgVGCFYJ/iBiCYQWhPQKUZ4thhy6VY4E5Hzi?= =?us-ascii?q?BDngViAIkNopLAQEB?= X-IronPort-AV: E=Sophos;i="5.43,361,1503360000"; d="scan'208,217";a="309482373" Received: from alln-core-1.cisco.com ([173.36.13.131]) by rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Oct 2017 14:34:32 +0000 Received: from [10.150.214.134] ([10.150.214.134]) by alln-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id v9BEYWBQ014481; Wed, 11 Oct 2017 14:34:32 GMT To: "Lu, Wenzhuo" Cc: "dev@dpdk.org" References: <20171006233355.9378-1-rmelton@cisco.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B6C2328@shsmsx102.ccr.corp.intel.com> From: "Roger B. Melton" Message-ID: <41d21748-3a59-41d0-d7c1-3d8d87bc6c73@cisco.com> Date: Wed, 11 Oct 2017 10:34:20 -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: <6A0DE07E22DDAD4C9103DF62FEBC09093B6C2328@shsmsx102.ccr.corp.intel.com> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] net/e1000: i350 VLAN tags in loopback packets are big endian 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: Wed, 11 Oct 2017 14:34:34 -0000 Hi Wenzhou, On 10/10/17 9:32 PM, Lu, Wenzhuo wrote: > Hi Roger, > >> -----Original Message----- >> From: Roger B Melton [mailto:rmelton@cisco.com] >> Sent: Saturday, October 7, 2017 7:34 AM >> To: Lu, Wenzhuo >> Cc: dev@dpdk.org; Roger B Melton >> Subject: [PATCH] net/e1000: i350 VLAN tags in loopback packets are big >> endian >> >> When copying VLAN tags from the RX descriptor to the vlan_tci field in the >> mbuf header, igb_rxtx.c:eth_igb_recv_pkts() and >> eth_igb_recv_scattered_pkts() both assume that the VLAN tag is always little >> endian. While i350 VLAN non-loopback packets are stored little endian, >> VLAN tags for i350 VLAN loopback packets are big endian. >> >> For i350 VLAN loopback packets, swap the tag when copying from the RX >> descriptor to the mbuf header. This will ensure that the mbuf vlan_tci is >> always little endian. >> >> Signed-off-by: Roger B Melton >> --- >> drivers/net/e1000/igb_rxtx.c | 56 >> ++++++++++++++++++++++++++++++++++++++++---- >> 1 file changed, 51 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index >> 1c80a2a..8432d8b 100644 >> --- a/drivers/net/e1000/igb_rxtx.c >> +++ b/drivers/net/e1000/igb_rxtx.c > >> @@ -2278,6 +2300,18 @@ eth_igb_rx_init(struct rte_eth_dev *dev) >> >> rxq = dev->data->rx_queues[i]; >> >> + rxq->flags = 0; >> + /* >> + * The i210, i211, i350, i354 and i350VF LB vlan packets >> + * have vlan tags byte swapped. >> + */ >> + if (hw->mac.type >= e1000_i350) { > Many thanks for the patch. > I think we need to check i350 and i354 here as LB bit is only meaningful on these NICs. Agreed, I'll change this to: if ((hw->mac.type == e1000_i350) || (hw->mac.type == e1000_i354)) {... > >> + rxq->flags |= IGB_RXQ_FLAG_LB_BSWAP_VLAN; >> + PMD_INIT_LOG(DEBUG, "IGB rx vlan bswap >> required"); >> + } else { >> + PMD_INIT_LOG(DEBUG, "IGB rx vlan bswap not >> required"); >> + } >> + >> /* Allocate buffers for descriptor rings and set up queue */ >> ret = igb_alloc_rx_queue_mbufs(rxq); >> if (ret) >> @@ -2557,6 +2591,18 @@ eth_igbvf_rx_init(struct rte_eth_dev *dev) >> >> rxq = dev->data->rx_queues[i]; >> >> + rxq->flags = 0; >> + /* >> + * The i210, i211, i350, i354 and i350VF LB vlan packets >> + * have vlan tags byte swapped. >> + */ >> + if (hw->mac.type >= e1000_i350) { > We need to check e1000_vfadapt_i350 here to exclude e1000_vfadapt. Agreed, I'll change this to: if (hw->mac.type == e1000_vfadapt_i350) {... I'll make these changes and submit an updated patch. > >> + rxq->flags |= IGB_RXQ_FLAG_LB_BSWAP_VLAN; >> + PMD_INIT_LOG(DEBUG, "IGB rx vlan bswap >> required"); >> + } else { >> + PMD_INIT_LOG(DEBUG, "IGB rx vlan bswap not >> required"); >> + } >> + >> /* Allocate buffers for descriptor rings and set up queue */ >> ret = igb_alloc_rx_queue_mbufs(rxq); >> if (ret) >> -- >> 2.10.3.dirty > . >