Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3254626ybh; Mon, 5 Aug 2019 15:03:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4BIIb56jYnFx65tvWA95HG4vcS94fKD4Jwnk8dxSQZCjHlqiIvO/4FFMle+u4DETdyXlq X-Received: by 2002:a63:4185:: with SMTP id o127mr90222pga.82.1565042616112; Mon, 05 Aug 2019 15:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565042616; cv=none; d=google.com; s=arc-20160816; b=MUIlHWik60MYFK5vyRNe+KDdrg74rVqHdY0Y3iI1N/OTH9uG8SM/crCdXeft5aNbeO F0lbb173NrVQXzqBsMpDu/4zeoCT6y+HmmJ+MS1B5g4ECgqVfMtf+iIyzEICj8Gg94Tg e/m+K7xrGnfou9ifnKhLHJyaEGoRb3oj29tZ8BkgmwtOaHOF3Yy0Y0ZUQK2eWRtrNpsM D3WfokqBfUw6Q5NNobisDY0VdrGK6ZDwUvxyrEq9yfR5qnTBLC6dw5d2XjRrG/TcWV2K 3u/r2Ue735QB1XmSkI25Bagwr6HhS9G3z62OsUyLyGlr+LkUxoK460Xvxfph144vmC+R sYrw== 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=1tYFj8fLEfMucFF88WzuLX+YfDkZb2Hei2792mPapEA=; b=WxgEDveCEc+KIEmimz3Ed6hchJNdzL/YwnAyZOS38bzPLbO2+oLKA89RE3h7VkBRtY kzDi3BiZia9CQTX8ZYnp34VRU2nVtKhOW3Petdq254s+yrrrwRc+UUaWeUfE0MIGjm9X i43afYNTKF7DV01lP1T+y46oG2hkFkGyhY3GcqJFl+H3GMlIgMB1/36IHEJ2A1cp2KCM MtGtubHUxA8AEOOyQNVAX20EsHb5AMIqm4iaWheLwkc4/g7T/pPKsmsAoQ/8KQoYrLru 4JYMJmGigV2hV3ysaQ1i4FJYUl7i4CAL3RKnKODMrJuiUEEjZMlwN6uz8RyYNBZNQK1M 2p5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dptrY0t5; 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 x25si45715560pfn.13.2019.08.05.15.03.20; Mon, 05 Aug 2019 15:03:36 -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=dptrY0t5; 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 S1730717AbfHEWCp (ORCPT + 99 others); Mon, 5 Aug 2019 18:02:45 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:42220 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728483AbfHEWCp (ORCPT ); Mon, 5 Aug 2019 18:02:45 -0400 Received: by mail-ot1-f65.google.com with SMTP id l15so87570765otn.9; Mon, 05 Aug 2019 15:02:44 -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=1tYFj8fLEfMucFF88WzuLX+YfDkZb2Hei2792mPapEA=; b=dptrY0t5pMgCYUoU0pESnqQ5UM9jOt5iigO6nTkHPQNcBELPmcM/xsv0wr1xloTm3f FLqo5NSxho98GOZVrMedryjkRaCi9DiSOle1yJrARAgpZ7pX9GMr58QXu3CrFMdtZgxu reEe96SAXlXyL2AxZMrKo68Z3C8W0qtYLPqdCZXjeFuIJTLf+cnsEbwpW2i4TVqFJIok UER3EJXGE6Dpi00oHVWRQNLVhXhZdC9ZP4tv8BbKpZQe964U/rMPv8tEkZbX/mYGXINN TsS7IuJ/g2hcr0t/ZVnrKxZgPd+60GkxcL2t2TOqCyDwcQVJOa6TgRrL2ZC3EwU9HIlG cC4A== 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=1tYFj8fLEfMucFF88WzuLX+YfDkZb2Hei2792mPapEA=; b=g5T4hzw/ifSJsnSVh0WU83MsnxPRzxr6kUcn45Llam475A4LO5RGtb80+3bYo67YOS VvEyJobJmPbUtU7GBHh/WGRISS2VhOjB1S1+nWeMW60Umd11aUUE9V9XEtkkc/b7HRtb b2gCSb6i3V5wduhezBzM9m3i3o3dEfqbTJG6S9vTcuuSXVRlspz3hDfqExvbPb0gBzNL NB8bbooTdivwXhYXF1+Z8QTztL005+RF6p4dvJv2+4EjQfSoM8/TJpqeQsSOLvC8II7e Ye5Aa1Cro2CaatX8Ogcsm1Jco/TdySmXiHcnwfVuffwBxFB12COLDEDQud6lxKC2n4KP 8R/Q== X-Gm-Message-State: APjAAAU8d9JPxbme78rjMYx+PAt1u7rx6qPJIlzFsvk0bhln1uL4RuBF hmPsrx9pPacgSNmA3VZkN8dea0t4dfzVffkXp2CEFh3V X-Received: by 2002:a6b:5106:: with SMTP id f6mr193333iob.15.1565042564192; Mon, 05 Aug 2019 15:02:44 -0700 (PDT) MIME-Version: 1.0 References: <20190802105507.16650-1-hslester96@gmail.com> In-Reply-To: From: Alexander Duyck Date: Mon, 5 Aug 2019 15:02:33 -0700 Message-ID: Subject: Re: [Intel-wired-lan] [PATCH 2/2] ixgbe: Use refcount_t for refcount To: Willem de Bruijn Cc: Chuhong Yuan , Network Development , intel-wired-lan , linux-kernel , "David S . Miller" 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:47 AM Willem de Bruijn wrote: > > 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. So I am pretty sure this patch is badly broken. It doesn't make any sense to be resetting with the refcnt in ixgbe_setup_fcoe_ddp_resources. The value is initialized to zero when the adapter structure was allocated. Consider this a NAK from me.