From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f194.google.com (mail-io0-f194.google.com [209.85.223.194]) by dpdk.org (Postfix) with ESMTP id B01662C60 for ; Wed, 25 Jul 2018 11:02:24 +0200 (CEST) Received: by mail-io0-f194.google.com with SMTP id i18-v6so5702069ioj.13 for ; Wed, 25 Jul 2018 02:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jGtXG5MO9o2Xci+TMTeT9IKbBTgb6l57wqOlPsWDbLo=; b=UNRgMQ1SXcu55R2o0hOOIM8e1WROIAgqq9KqKOPB8k0wJA0mSI+MR0SRf1paqgk5s3 GBllT6MejjGdjfo23SG3G7nX8n2X6HnlATfYUKVITOrpeOtp+HxDyW9/0R7AB0b5d7FQ o6NOFf6icKtXEdiEVhdqpFv7ZuVSt1QJpAIc9qk+A2GdKlDAc11QOeZO/JrId00gf4IJ we+gXPrLshqWZBVVWSyTtHQ222j+Cl6g6PpfsxjeiPFV14unUXbGzbV6Y8jg22rmEOPh wqbtTyeogxP/MalxhNhxg2QNipvVTjGlr3rzs07py+s62i1GaipZhBZkwKYHpK4LOGS2 8Dtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jGtXG5MO9o2Xci+TMTeT9IKbBTgb6l57wqOlPsWDbLo=; b=YFWY7sqOZZzMvkLib2D4inZ6tX5CkZ4PppHHdjVXoYF9DBzdaLFBU8v/no3+Z5DhgV uz+wiTh1UWV3UrA333bpL2i8eHbikQYgARrRayxIxv5guzGKAAGdQLEdUfrOyYrYGJT9 l0GieZ3rlKT+1cHwLd258IQT3KYtakySwjG5QseOp6a+a8ZGNqQPX/9MJvoba6laS5ap GqvLFGsKanfYe0UJYSavREBVQpBcB+XpnAOlbpTKHs6ydR+YgQqemH+t8VLNOotXNUky WU/JMa/V5kZFxy5NclYoCGXNPARhQ18euCA+bCtvsHwhDeSgfemElwYu6njh65kyzb2C 90Pw== X-Gm-Message-State: AOUpUlEOUvM18N5Z+TZUc/xaGa4/a5gUD/y9X599P+kcnKi7Z2LMAjxI 3VZxMNZBgiFRVCEJfaLppVVFW1LYRQ1+DB/k8Q== X-Google-Smtp-Source: AAOMgpf3q6iV2njdddqVY96nnJ09zsQefKPxLK6dOxnoqhuJk6pwGTGkYdiHXauMjTK4adPiPDJlem1ChfCL+HUNAXM= X-Received: by 2002:a6b:2614:: with SMTP id m20-v6mr15781433iom.211.1532509344143; Wed, 25 Jul 2018 02:02:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac0:a793:0:0:0:0:0 with HTTP; Wed, 25 Jul 2018 02:02:23 -0700 (PDT) In-Reply-To: <20180723095252.4a93ea91@xeon-e3> References: <1531925499-938-1-git-send-email-alan.dewar@att.com> <20180723095252.4a93ea91@xeon-e3> From: Alan Dewar Date: Wed, 25 Jul 2018 10:02:23 +0100 Message-ID: To: Stephen Hemminger Cc: cristian.dumitrescu@intel.com, dev@dpdk.org, Alan Dewar Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] sched: add 64-bit counter retrieval API 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, 25 Jul 2018 09:02:24 -0000 Hi Stephen, Sorry about the delay in responding to your comment. Maybe I'm missing something but I don't consider 64-bit counter rollover to be a problem. The DPDK QoS stats are just 32-bits wide and are zeroed when read. So if we read them frequently enough the 32-bit counters won't wrap. This new API is just a convenient way to read the 32-bit counters into variables that are 64-bit wide which allows Vyatta to have a common API slightly above the DPDK. I'd hope that at some point in time the DPDK will move to 64-bit counters, but there may be technical reasons why this can't happen that I'm not aware of (support for 32-bit CPUs??) Regards Alan On Mon, Jul 23, 2018 at 5:52 PM, Stephen Hemminger wrote: > On Wed, 18 Jul 2018 15:51:39 +0100 > alangordondewar@gmail.com wrote: > >> From: Alan Dewar >> >> Add new APIs to retrieve counters in 64-bit wide fields. >> >> Signed-off-by: Alan Dewar > > Do you want to consider 64 bit counter roll over on 32 bit platform? > The problem is that incrementing an 64 bit value is not atomic on > 32 bit cpu. The carry operation can race with reading. > > The kernel has special case code to do restartable sequence for > accessing 64 bit counter on 32 bit CPU. These functions become > nop's on 64bit.