Skip to contentSkip to conversation

ixgbe: Explicitly initialize reference count to 0

PATCH In review Chuhong Yuan 3 participants 3 messages Aug 2, 2019 – Aug 5, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +1 -0
index ccd852ad62a4..00710f43cfd2 100644
@@ -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) {
Signature · 1 line
2.20.1
Tested-by on v1 1/2
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Chuhong Yuan
Sent: Friday, August 2, 2019 3:55 AM
Cc: netdev at vger.kernel.org; Chuhong Yuan <[email protected]>; linux- kernel at vger.kernel.org; intel-wired-lan at lists.osuosl.org; David S . Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH 1/2] ixgbe: Explicitly initialize reference count to 0

Quoted 8 lines

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.

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 1 +
 1 file changed, 1 insertion(+)
#2 lore raw
Quoted 15 lines · AndrewX
Quoted 15 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Chuhong Yuan
Sent: Friday, August 2, 2019 3:55 AM
Cc: netdev at vger.kernel.org; Chuhong Yuan <[email protected]>; linux- kernel at vger.kernel.org; intel-wired-lan at lists.osuosl.org; 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.

Quoted 6 lines
Quoted 4 lines
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 1 +
 1 file changed, 1 insertion(+)

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