From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0B37C19759 for ; Sun, 4 Aug 2019 12:48:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 970312070D for ; Sun, 4 Aug 2019 12:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564922907; bh=yj87rjALkZsmUet+qLbuZVt6WubONCVEKfTPdchgLhE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=HMhV+xFLP4SHx68Z9cKCZu/UkGcjt4jiJMkPyPXvexkSwQYyuZxCVN3MgGLlJPzWK Rgk1Ho9Os/SfUbmXlQe+GFPFxULvlQkyhO2p3OatxNROuW0B+9uaVNOeAUG/fxM/Xc 5hn++XW/NyQ/k/YJhmpU0O7/5oT5x1hQ40P8Kc3w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726197AbfHDMsZ (ORCPT ); Sun, 4 Aug 2019 08:48:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:39926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbfHDMsZ (ORCPT ); Sun, 4 Aug 2019 08:48:25 -0400 Received: from localhost (unknown [193.47.165.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 29D262070D; Sun, 4 Aug 2019 12:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564922903; bh=yj87rjALkZsmUet+qLbuZVt6WubONCVEKfTPdchgLhE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NFs8EhQd7fZZqMybyc5Pl8gMTlCvdXe+005j54lsecueU3CN88bIy16/ibaZpxiZJ BK5KPJtVBJ6evdaHN3J2zf/ZPTFkGNTf3SUbVBvM3393pYKZhbiF5M0803FUzFgD1E 0anLtYtkw58/wPznPh52dqiVppTA55zTZEWH1eUQ= Date: Sun, 4 Aug 2019 15:48:20 +0300 From: Leon Romanovsky To: Chuhong Yuan Cc: Saeed Mahameed , "David S . Miller" , Doug Ledford , Jason Gunthorpe , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/3] Use refcount_t for refcount Message-ID: <20190804124820.GH4832@mtr-leonro.mtl.com> References: <20190802121035.1315-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190802121035.1315-1-hslester96@gmail.com> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Aug 02, 2019 at 08:10:35PM +0800, Chuhong Yuan wrote: > Reference counters are preferred to use refcount_t instead of > atomic_t. > This is because the implementation of refcount_t can prevent > overflows and detect possible use-after-free. > > First convert the refcount field to refcount_t in mlx5/driver.h. > Then convert the uses to refcount_() APIs. You can't do it, because you need to ensure that driver compiles and works between patches. By converting driver.h alone to refcount_t, you simply broke mlx5 driver. NAK, to be clear. And please don't sent series of patches as standalone patches. Thanks,