From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 7A058594B for ; Wed, 2 Dec 2015 02:05:24 +0100 (CET) Received: by wmuu63 with SMTP id u63so195540323wmu.0 for ; Tue, 01 Dec 2015 17:05:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding :content-type; bh=Q5P6fHeLehOy+Ev2Tn1yrVPR9krPgGwKjxMYB0d7xaI=; b=n3ZBaSxO/W4x/JLPxMj6a7q21UsoALbsWrhSkiARAFmM/AjZd0OT4SiGpB4tqL3Lea hhU3wEMUd+7c+Obid488HxfHYlABZSeqhcG3Z0S3LOPMG3LuS9W2dkhvmbwp4tPDS+H7 fpHcW9JkhM7uycAqqn26exn3QKmUcoBvmB8zerSdZb6EPoNXX2dK00lSrxAW7QVFKquz UCZVXtsJYDoh/PStYG/JTTJBO0kDajGDf1eHi3wce7Sq6WE83qfuJ4PzM3ZKIj3/7yJ5 NCmWUiHhl2eo/XHgslwYTIPxAGMlppjA1jrJhTjbu7iYMlAswspJp0BQsIOUNFvZi472 rmsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=Q5P6fHeLehOy+Ev2Tn1yrVPR9krPgGwKjxMYB0d7xaI=; b=kvzEAVKi3iVv/GHvWIZyYdugW4ZURJovqwerpQjEzz4GMi/m29LCbqJMMlT2SYlhsD zjPZPupWCBoESx/VioFrnwBtWBCkTBOrzmxd4x5sLf2KQatmjoPbDcfF5Q+9nX8va2VA szLn/a8BWkxiZUYGL7d2JAaWgeckMbXQ2SQ0i86kMX0rFV9XVTCfPOB8TAMBHLvQFl82 LHNePfcy4DJFB6xvWH87sshDdSeUchWndlfXThTOR7a+6TN6jTL+46BS3TS8el3o+ICL z9jjOgbAmhblKBClIzyqNhC+5JFj4uyLQoT5ZecZJS8V5Edc0UIABkhutmbEM2dtGtxH K4+Q== X-Gm-Message-State: ALoCoQmOBxgDjuLtdZzPbfw1eIj33lBNcmEcRjOkHXQd2GICxrQbe8DFLsUwnTdCOHXYiflVWVjT X-Received: by 10.194.88.200 with SMTP id bi8mr708535wjb.178.1449018324015; Tue, 01 Dec 2015 17:05:24 -0800 (PST) Received: from xps13.localnet ([93.158.53.139]) by smtp.gmail.com with ESMTPSA id gl10sm356023wjb.30.2015.12.01.17.05.23 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Dec 2015 17:05:23 -0800 (PST) From: Thomas Monjalon To: "Charles (Chas) Williams" <3chas3@gmail.com> Date: Wed, 02 Dec 2015 02:04:14 +0100 Message-ID: <1462827.BQfOhHUEb5@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1449014294.2645.42.camel@gmail.com> References: <1446571576-28399-1-git-send-email-3chas3@gmail.com> <3362628.iLARgdqr6m@xps13> <1449014294.2645.42.camel@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] bnx2x: tx_start_bd->vlan_or_ethertype is le16 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: Wed, 02 Dec 2015 01:05:24 -0000 2015-12-01 18:58, Charles Williams: > On Wed, 2015-12-02 at 00:34 +0100, Thomas Monjalon wrote: > > 2015-12-01 14:37, Stephen Hemminger: > > > Harish Patil wrote: > > > > >2015-11-03 12:26, Chas Williams: > > > > >> --- a/drivers/net/bnx2x/bnx2x.c > > > > >> +++ b/drivers/net/bnx2x/bnx2x.c > > > > >> - tx_start_bd->vlan_or_ethertype = eh->ether_type; > > > > >> + tx_start_bd->vlan_or_ethertype > > > > >> + = rte_cpu_to_le_16(rte_be_to_cpu_16(eh->ether_type)); > > > > > > > > Minor question - any specific reason to use rte_be_to_cpu_16() on > > > > ether_type alone before converting from native order to le16? > > > > > > ether_type is in network byte order (big endian) > > > and hardware wants little endian. On x86 the second step is a nop. > > > > Doesn't it deserve a macro rte_ntole16()? > > It may be in lib/librte_eal/common/include/generic/rte_byteorder.h. > > I looked I didn't see anything. This value, according to the linux > driver, wants to be little endian regardless of the host endian. Yes, that's why I suggest to create some macros to do this kind of conversion. Example: rte_ntole16 means "network to little endian 16-bit". Do you think it would be clearer to use?