From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 69E871B3B7 for ; Wed, 26 Sep 2018 16:49:10 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id o16so14019950wrx.2 for ; Wed, 26 Sep 2018 07:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=1P30Xj9VNib0LvDRLqmTc856/UsB78FZbOVM/u1pU80=; b=Cjplq3eeZgzVWwNykLWzdHl7qmY3ad8x12xM4gwp98i18pGngTNzVEcFx1w+2arRSp Oiwu6m7vcFVD2+cBsztW3XDS+SXApedOPVuq2APZ2cRnvGSj5pETmUjLxv1ARnVJjfIN xENKtAOpZu7XpqWYMxQMtJZ2+hb43ToC8clC7yvylzl/Pwg0RQpaOxiNZGO67FSN4Y9W hAH7eixgpnEMzmDc/kv2cjxYAXxE8T1wcqoNnQBeEFBtQUWP0Q3y4tkwIIY04wZX7UDg BPaW23ujdeDZM+eHpKSlHWMJTL8XGW8MEaI3jtdOEECZm6sDJx7gvuYFDzhXYv54+Ycz Ofkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=1P30Xj9VNib0LvDRLqmTc856/UsB78FZbOVM/u1pU80=; b=R1x1nERnL6z6w0uxpMGPrjpJ8Rsv9L/4xI9YvkIPkFD05/Azn22qq+NfLMRhimZd8h 7Ug6T0jvgx6gNeVdbEDzqZfMML2OnR8RIfiYuPR6fpjXVsH+AOEoXpVDbBcrvaUAPHKo KXy8WtbEHbFGP/M2pdspFWXWMqWOT58YAQbxo+hQu6p9rZCDbY1eQGXSXXzPA0TYqeMp pRdYqHV9yG9lc8emCgUrRMoWr4qS2cecN3giFi9CzY/Pn+hEyP9QpfO/NAIP0IQGT/F6 IxFC2bfoBh4vQmIqCKPvu2p2Nn2zvSOZtfnu9UQ1PDCP1NM0VyxP66IrDlVpPkWdzU9y kJMA== X-Gm-Message-State: ABuFfojeoIseXoe/MwejZwriWb3idOFE036iNaUDGD0cBzSTZ40xlEV8 23V9Ov8QU4wi/AR9jPS+4ffNRY5RQit89IFf7Yo= X-Google-Smtp-Source: ACcGV62Moq3xXxUHr4Que271gGofWA2x4LV3A1HBka104la1i+WTffOp7GinbK8u/BB/Fylx1RK+h5CjaH6lAeSmdxA= X-Received: by 2002:adf:cf0a:: with SMTP id o10-v6mr5116512wrj.112.1537973349789; Wed, 26 Sep 2018 07:49:09 -0700 (PDT) MIME-Version: 1.0 Sender: dan.gora@gmail.com Received: by 2002:adf:fbc1:0:0:0:0:0 with HTTP; Wed, 26 Sep 2018 07:48:29 -0700 (PDT) In-Reply-To: References: <20180911232906.18352-1-dg@adax.com> <20180919195549.5585-1-dg@adax.com> <20180919195549.5585-6-dg@adax.com> From: Dan Gora Date: Wed, 26 Sep 2018 11:48:29 -0300 X-Google-Sender-Auth: _Z7hRXBpIgqCBJDf4DgyRPAEySY Message-ID: To: Ferruh Yigit Cc: dev@dpdk.org, Igor Ryzhov , Stephen Hemminger Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 5/5] examples/kni: improve zeroing statistics 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, 26 Sep 2018 14:49:10 -0000 On Wed, Sep 26, 2018 at 11:01 AM, Ferruh Yigit wrote: > On 9/19/2018 8:55 PM, Dan Gora wrote: >> The worker threads incrementing the rx/tx_packets race with the signal >> handler from the main thread zeroing the entire statistics structure. >> This can cause the statistics to fail to be zeroed, even when there >> is no traffic on those interfaces. >> >> Improve zeroing the statistics by only incrementing rx/tx_packets >> in worker threads by a non-zero amount. This limits the race to the >> periods in which traffic is actually being received or transmitted. > > Not sure about introducing an extra check to datapath for possible error on > stats zero. I am for dropping this patch, what do you think? This is literally adding one instruction to the datapath. Not even an atomic instruction. There is no effect on the performance caused by this change. Is that not better than the user (like me who experienced this) wondering why they cannot zero the counters even when there is no traffic? -d