2019-08-02 21:17:29

by Chuhong Yuan

[permalink] [raw]
Subject: [PATCH 1/2] ixgbe: Explicitly initialize reference count to 0

The driver does not explicitly call atomic_set to initialize
refcount to 0.
Add the call so that it will be more straight forward to
convert refcount from atomic_t to refcount_t.

Signed-off-by: Chuhong Yuan <[email protected]>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index ccd852ad62a4..00710f43cfd2 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -773,6 +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);

/* allocate pci pool for each cpu */
for_each_possible_cpu(cpu) {
--
2.20.1


2019-08-05 21:43:29

by Bowers, AndrewX

[permalink] [raw]
Subject: RE: [Intel-wired-lan] [PATCH 1/2] ixgbe: Explicitly initialize reference count to 0

> -----Original Message-----
> From: Intel-wired-lan [mailto:[email protected]] On
> Behalf Of Chuhong Yuan
> Sent: Friday, August 2, 2019 3:55 AM
> Cc: [email protected]; Chuhong Yuan <[email protected]>; linux-
> [email protected]; [email protected]; David S . Miller
> <[email protected]>
> Subject: [Intel-wired-lan] [PATCH 1/2] ixgbe: Explicitly initialize reference
> count to 0
>
> The driver does not explicitly call atomic_set to initialize refcount to 0.
> Add the call so that it will be more straight forward to convert refcount from
> atomic_t to refcount_t.
>
> Signed-off-by: Chuhong Yuan <[email protected]>
> ---
> drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 1 +
> 1 file changed, 1 insertion(+)

Tested-by: Andrew Bowers <[email protected]>


2019-08-05 22:06:14

by Alexander Duyck

[permalink] [raw]
Subject: Re: [Intel-wired-lan] [PATCH 1/2] ixgbe: Explicitly initialize reference count to 0

On Mon, Aug 5, 2019 at 2:42 PM Bowers, AndrewX <[email protected]> wrote:
>
> > -----Original Message-----
> > From: Intel-wired-lan [mailto:[email protected]] On
> > Behalf Of Chuhong Yuan
> > Sent: Friday, August 2, 2019 3:55 AM
> > Cc: [email protected]; Chuhong Yuan <[email protected]>; linux-
> > [email protected]; [email protected]; David S . Miller
> > <[email protected]>
> > Subject: [Intel-wired-lan] [PATCH 1/2] ixgbe: Explicitly initialize reference
> > count to 0
> >
> > The driver does not explicitly call atomic_set to initialize refcount to 0.
> > Add the call so that it will be more straight forward to convert refcount from
> > atomic_t to refcount_t.
> >
> > Signed-off-by: Chuhong Yuan <[email protected]>
> > ---
> > drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 1 +
> > 1 file changed, 1 insertion(+)
>
> Tested-by: Andrew Bowers <[email protected]>

NAK. This patch is badly broken. We should not be resetting the fcoe
refcnt in ixgbe_setup_fcoe_ddp_resources.