Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp830413ybh; Sat, 3 Aug 2019 10:43:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvhOGt5vdcugn4CuzW6mNh3KoSXW8Vc9wMfa0gQImp1giWHtkvOci0ppTOhqVdzOq7QiuO X-Received: by 2002:a62:6044:: with SMTP id u65mr64234706pfb.15.1564854223389; Sat, 03 Aug 2019 10:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564854223; cv=none; d=google.com; s=arc-20160816; b=BL1384NSTZvK+js4c3wvpxjU3krK9muqfEFuUm21LGNHzhogXDtiCYH4GndD6UdIn4 DhLTUrQNiWmCe4xsZNnTK9xjSQCAbuZwXUTY8bTBb4kd/OzN4cIYkkh6/p/CW7XffCic 9kN1C0wLQiOGITH1qybl5hMx15I9Z2LOVgTH/oJ5853eoyIB5yUjvW3YNYIeL4NHRJjU yTzDSYICcH+rD0AbDEzxlqfDp7SGkLXwNbQOfFqInaZ351AqNthTuV6slJfsVRDjUvBh 7GnUjzqNwqa/Eyxv0qcLL6frWHqZSL6mX6LSxz4PTmtDR5UlUHovr3lhd13CPIp8OEko GDYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=87nWth1qwkhZ1eXAHRwTJ+WjegXhw+N8PNzvPKErqiI=; b=UGwT8R2MCouEQCnaeQMAbA3mInopx611NWx/NQq2Y4NFOq0akDebbiObLDO+Paduju eAKM6y0wppZALJpFL8y0xCt+bFzI/GpBlMN45me8aQqlJwDgfvmgYGppMLUDL+uBrBvi 2/EfQtRGpejgXZ3WWupsnKMcyrb5PNpC9uJ3fu0DfkQPGj2Ut6GLMerknc4G8dMMMzVF Lwm53S2QOm/H/1S1Tg6J2zMg2ltbrjQadhZ6GOZBMPJHgbLi/gTbL+FS3qAsV3ICmOpT ZaHSjpc0Mez+A391mBqjey7E5ftToLqjKjYzaua1crR4ATCh8p2K1reLXbprUn/mYRk8 SWMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mCk6lApF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si38417114plq.403.2019.08.03.10.43.28; Sat, 03 Aug 2019 10:43:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mCk6lApF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436535AbfHBNq4 (ORCPT + 99 others); Fri, 2 Aug 2019 09:46:56 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:34452 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732669AbfHBNq4 (ORCPT ); Fri, 2 Aug 2019 09:46:56 -0400 Received: by mail-yw1-f66.google.com with SMTP id q128so27291236ywc.1 for ; Fri, 02 Aug 2019 06:46:55 -0700 (PDT) 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=87nWth1qwkhZ1eXAHRwTJ+WjegXhw+N8PNzvPKErqiI=; b=mCk6lApFIOYFCE3bZlJdfRIULk2LdKeUPxWmUybHzo0Yaxeyj+CpyB+J/wuFoVrWSF gzGYdcnNrMDeTW8ONpOP30VbBDbMbNXAPePMk1DVPPjNrHDPGHEfKSpba6h/3gFnh7gm B3C390NPInuszW/nW11OokHsjQwZRedE4pDrAUS7uJbLdEHqwn4S7jYgeuUrH0l7SV5K elRfwudymEVNzdFUD6Kh6NUXNbC37Hs1QM67ptqkbvATaEUz4MHpZ+pE7GCu+MoJgFrU qGQVBNSIaEi1LCi+GpoQ5uIrukfNuDGhy0bILWVeYFDvnUXTGr5Ar4u0xt9avya5677U qaXA== 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=87nWth1qwkhZ1eXAHRwTJ+WjegXhw+N8PNzvPKErqiI=; b=JAx4k6wWSdEso4MmFy3L+6vnfO1Oj90vD8hsvXrmgiQlqYhb/yjb/RZeB3u7Edh0lz V7vaQzNtjxXgWetjqgerUJ4SHujV7taBsK5mMo4wRk7no4jMOPIUvBtLxS6l91MLLosQ byj+x3+1Hx5GHWEe5fJX5suCFlzaito1wSQV/hT9NcxpEk+fArTwBZ+UQ25592uFjwIN GODBwssgObeCBI/ybXwz25UPA9GpQtEvsmwFWp3LmRoOr8UoI8lL8jequZK6NnhshlxY bkiDTpA9Hb8+k7eoAK4E5p9a9Wj6N+Tf8GG/a9KMFPn4OzfJbyI+9aNBvs4QZ/Aezi4W EgIw== X-Gm-Message-State: APjAAAU9Hkx6kvKaJ0lKhjUo65HIfLW+ttlBpbzOg2KxjZ4CqKOU5b7g 6QmKbrVU/vpJsJQ2H5qu3QdOd4mv X-Received: by 2002:a81:a343:: with SMTP id a64mr79656520ywh.142.1564753614452; Fri, 02 Aug 2019 06:46:54 -0700 (PDT) Received: from mail-yw1-f46.google.com (mail-yw1-f46.google.com. [209.85.161.46]) by smtp.gmail.com with ESMTPSA id n38sm2046837ywh.11.2019.08.02.06.46.53 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 02 Aug 2019 06:46:53 -0700 (PDT) Received: by mail-yw1-f46.google.com with SMTP id u141so27273321ywe.4 for ; Fri, 02 Aug 2019 06:46:53 -0700 (PDT) X-Received: by 2002:a81:4d86:: with SMTP id a128mr79663944ywb.291.1564753613185; Fri, 02 Aug 2019 06:46:53 -0700 (PDT) MIME-Version: 1.0 References: <20190802105507.16650-1-hslester96@gmail.com> In-Reply-To: <20190802105507.16650-1-hslester96@gmail.com> From: Willem de Bruijn Date: Fri, 2 Aug 2019 09:46:17 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] ixgbe: Use refcount_t for refcount To: Chuhong Yuan Cc: Jeff Kirsher , "David S . Miller" , intel-wired-lan@lists.osuosl.org, Network Development , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 2, 2019 at 6:55 AM Chuhong Yuan wrote: > > refcount_t is better for reference counters since its > implementation can prevent overflows. > So convert atomic_t ref counters to refcount_t. > > Also convert refcount from 0-based to 1-based. > > This patch depends on PATCH 1/2. > > Signed-off-by: Chuhong Yuan > --- > drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 6 +++--- > drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c > index 00710f43cfd2..d313d00065cd 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c > @@ -773,7 +773,7 @@ int ixgbe_setup_fcoe_ddp_resources(struct ixgbe_adapter *adapter) > > fcoe->extra_ddp_buffer = buffer; > fcoe->extra_ddp_buffer_dma = dma; > - atomic_set(&fcoe->refcnt, 0); > + refcount_set(&fcoe->refcnt, 1); Same point as in the cxgb4 driver patch: how can you just change the initial value without modifying the condition for release? This is not a suggestion to resubmit all these changes again with a change to the release condition.