From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id 090322E89 for ; Thu, 6 Nov 2014 18:52:22 +0100 (CET) Received: by mail-wi0-f177.google.com with SMTP id ex7so2289165wid.16 for ; Thu, 06 Nov 2014 10:01:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=z0+x4gGSdpURS1ooQnOfZ7Ug327Pq6HLVmkkU4/1jRA=; b=d9eraxUzat4f86HCWTyd8unMTfYdz8x9GP5xkPP47I9HBbsJbMNG65cRESnxl4M2Sy /ydcK7ZEkbj4Ty8wnbV1VTUcLidOD4qzySiTXB10Hw6H4WoiNGYuiUoNiUwKxdKniQ3d Uhdr7TVz6sZrUFlugEQ6EGFr0PzDlOS0jrogpq9iJ57kJSZ8ifXt/qKPTUII9vTZFh1F wTABWaHFjJYCuV7+Z5/iB4GS2ozLXveGjQ+Ywj2Mcasd0ZUtZywSrA+wiihPALRqQ7tQ dnmzB1R7FOcz0TWnBu/zVO0DXZihpAfspTrLvp/HzfMs9ryuhPjC+6vsSJY/K4Y3JnJL tDlg== MIME-Version: 1.0 X-Received: by 10.194.63.79 with SMTP id e15mr8170319wjs.79.1415296908909; Thu, 06 Nov 2014 10:01:48 -0800 (PST) Received: by 10.27.86.144 with HTTP; Thu, 6 Nov 2014 10:01:48 -0800 (PST) In-Reply-To: <20141106135951.GB7252@bricha3-MOBL3> References: <1415194237-1219-1-git-send-email-jigsaw@gmail.com> <20141106092228.GA3056@bricha3-MOBL3> <9190772.1rnKUO3oNV@xps13> <545b6b74.a96db40a.26af.ffffe7fb@mx.google.com> <20141106135951.GB7252@bricha3-MOBL3> Date: Thu, 6 Nov 2014 20:01:48 +0200 Message-ID: From: jigsaw To: Bruce Richardson Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] =?utf-8?b?562U5aSNOiAgW1BBVENIXSBBZGQgdXNlciBkZWZpbmVk?= =?utf-8?q?_tag_calculation_callback_tolibrte=5Fdistributor=2E?= 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: Thu, 06 Nov 2014 17:52:22 -0000 Hi Bruce, In my use case, unfortunately the tag is not hash. And the tag can be on either low or high bits, depending on configuration. I wonder if it is possible to let the user to decide which bit to mask, i.e. to add another param to rte_distributor_create to define the mask. thx & rgds, -qinglai On Thu, Nov 6, 2014 at 3:59 PM, Bruce Richardson wrote: > On Thu, Nov 06, 2014 at 02:36:09PM +0200, Qinglai Xiao wrote: > > Hi Bruce, > > > > There is a subtle case in which tag values are 2 and 3, respectively. > Then these two tags cannot be distinguished. There should be a better way > so as to handle this situation. > > It's not just in that, case, it's in any case where a pair of tags differ > by > only a single bit. I've been assuming that the tag is likely to be a hash > value in most cases - given that it's only 32-bit - in which case it just > doesn't > matter which bit we chose to permanently set to 1, but if there are > scenarios > where it's likely that the low bits are used but the high ones not so, we > can > look to change which bit is set to 1. Either way, the distributor just > uses a > 31-bit tag rather than a 32-bit one. > > /Bruce > > > > > thx & > > rgds > > -qinglai > > > > -----=E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6----- > > =E5=8F=91=E4=BB=B6=E4=BA=BA: "Thomas Monjalon" > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: =E2=80=8E2014/=E2=80=8E11/=E2=80= =8E6 12:36 > > =E6=94=B6=E4=BB=B6=E4=BA=BA: "Bruce Richardson" > > =E6=8A=84=E9=80=81: "dev@dpdk.org" ; "jigsaw" > > =E4=B8=BB=E9=A2=98: Re: [dpdk-dev] [PATCH] Add user defined tag calcula= tion callback > tolibrte_distributor. > > > > 2014-11-06 09:22, Bruce Richardson: > > > On Wed, Nov 05, 2014 at 07:24:13PM +0200, jigsaw wrote: > > > > > http://dpdk.org/browse/dpdk/tree/lib/librte_distributor/rte_distributor.c= #n285 > > > > > > > > new_tag =3D (next_mb->hash.rss | 1); > > > > > > > > Why the logical OR is needed? > > > > > > That's needed to ensure that we never track a tag with an actual valu= e > of zero. > > > We instead always force the low bit to be 1, so that we can use zero > as an > > > "empty" value. > > > > Bruce, could you check how this code may be better commented please? > > This discussion shows that the distributor library probably needs more > > explanations in the code or doxygen. > > > > Thanks > > -- > > Thomas >