From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 880E7A04FC; Tue, 17 Dec 2019 12:14:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 507BC1BF73; Tue, 17 Dec 2019 12:14:26 +0100 (CET) Received: from mail-il1-f196.google.com (mail-il1-f196.google.com [209.85.166.196]) by dpdk.org (Postfix) with ESMTP id AA6FA1BF30 for ; Tue, 17 Dec 2019 12:14:24 +0100 (CET) Received: by mail-il1-f196.google.com with SMTP id f10so8069776ils.8 for ; Tue, 17 Dec 2019 03:14:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=khgZEW6oxX9xXYlLNOupFh3adPwAlB/+r3wGOtSDAG0=; b=eISbFElbT5p3fe/SWZEI1y+01tw1EDWa8YEK9ixNhogteUfqUpNGFKGOVJ8+K7SyyX JO7vP1h9842yn7Jimk9Ys8IKhSNqiOlXO9NBIGMd2dNJTVM5rbYtfZgDumOsl4dTbnKm cQhGDCrG9mlNuzRLWMVR0cFGdn0YJ50X31KZiCthsU2gS4wIKhiQjoUQj1xXMFr/R8BD N2wIRldxocaGUdbhNu4EBb7L4w1ofhwf+uUgKzY1KaM33eyut7zUUWVwU3VdSUmLKwZM PVum67X7TzhdaSWk88AqNNlXiEMmJEYEwmFoexATRdlXSv0/WaXqJlUFpcBvDJt/ve4n kLrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=khgZEW6oxX9xXYlLNOupFh3adPwAlB/+r3wGOtSDAG0=; b=Ph7dKdiBhDiBeVK7ihMVqJG3b773eBm+mZZJRyUWzfUpQWPkh1Ie5qKQuDIdcDdgmk XIZrEt9U+3Kcz20oICNjBBlcqJlmZ2C+k6qgXtQcpJQCZLDoi4BOTEkdIeWJEfLlEw1H kYpdT83NBa1ZPEKrp4OJoXzoeDmtRnP3VVbaxmqCTnywNQ+LAzerKjIebbCeh2OBRXYf 5YvjCZdmdgAO9MsWEp2ZqpJVvT+p7mD6fl0Y/ud4/SKJkQD0kZIyeY9+QOOfYGEd9cw6 6lYHpYOKdRgtFyH39d93TKv8fxhFDnXo1yMdSDoui4q6gNwLSZ9Ciy/tABpwPcm8CF5o t9Iw== X-Gm-Message-State: APjAAAWRi7eJvesGlecI9LTOerRO7d3Wk3MAqJ00uwJDTk2iU0OY4nZE FLEhNXbHgf3R6yaWwFwSZRweretbwrDBzTxp23w= X-Google-Smtp-Source: APXvYqwzCawnZC0im1yd02705F/ckUwFi5g3yd8lHqVQ+2qSMEMwaehdxNNsok+6Bq6gtM4qDtnwXk/wYm5n8t4zLvI= X-Received: by 2002:a92:481d:: with SMTP id v29mr16448746ila.271.1576581263854; Tue, 17 Dec 2019 03:14:23 -0800 (PST) MIME-Version: 1.0 References: <20191127102222.31940-1-skori@marvell.com> <20191216103948.22976-1-skori@marvell.com> <20191216103948.22976-2-skori@marvell.com> In-Reply-To: From: Jerin Jacob Date: Tue, 17 Dec 2019 16:44:07 +0530 Message-ID: To: "Gavin Hu (Arm Technology China)" Cc: Sunil Kumar Kori , "jerinj@marvell.com" , Nithin Dabilpuram , Vamsi Attunuru , "dev@dpdk.org" , Harman Kalra , Honnappa Nagarahalli , nd Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3 2/2] common/octeontx2: add polling based response mbox message 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > +mbox_poll(struct otx2_mbox *mbox, uint32_t wait) > > +{ > > + uint32_t timeout = 0, sleep = 1; > > + uint64_t rsp_reg = 0; > > + uintptr_t reg_addr; > > + > > + reg_addr = mbox->reg_base + mbox->intr_offset; > > + while (!rsp_reg) { > The first iteration of (!rsp_reg) always evaluate to 'true'. > Why not use do .. while to save one iteration? > > + rte_rmb(); > Rte_rmb is overkill, how is reg_addr mapped(what is the memory attribute? WC? cacheable? ) > If it is a PCI mmaped region, then rte_io_barrier is okay, I am proposing to relax the io barrier for aarch64 as a compiler barrier. > http://patches.dpdk.org/patch/61662/ It is the device memory and Linux kernel(_CPU_ not IO) is updating the memory on the other side. I think, we would need rte_smp_rmb() here. Since it was slow-path code, added the full barrier here. I think it is OK to change rte_smp_rmb() not to rte_io_* version. Correct?