Skip to contentSkip to conversation

bnx2: Update MODULE_DESCRIPTION to include the 5716

PATCH Applied Benjamin Li 3 participants 12 messages Sep 18, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

cover Minor bnx2 patches

Thanks for the comments Simon. I have integrated the changes that you have suggested. I have reposted the entire patch set in numbered form so that it could be merged in easier.

Thanks again.

-Ben

Quoted 8 lines
(quoted diff) +0 -0
@@ -7514,7 +7514,6 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
Quoted 5 lines
      bp->stats_ticks = USEC_PER_SEC & BNX2_HC_STATS_TICKS_HC_STAT_TICKS;
-     bp->timer_interval =  HZ;
      bp->current_interval =  HZ;

Would it make sense to set current_interval to BNX2_TIMER_INTERVAL?

Changed.

Quoted 7 lines
Quoted 7 lines
drivers/net/bnx2.h +0 -0
index cb47c98..e534c1d 100644
@@ -6701,7 +6701,7 @@ struct bnx2 {
 
Quoted 8 lines

drivers/net/bnx2.h struct bnx2 { · line 6704

Quoted 4 lines
drivers/net/bnx2.h +1 -1
      /* End of fields used in the performance code paths. */
 
-     int                     timer_interval;
+#define BNX2_TIMER_INTERVAL                  HZ

Perhaps its just me, but would it be nicer to define BNX2_TIMER_INTERVAL somewhere other than in the middle of this structure?

Moved outside of the bnx2 structure.

--------------------

Benjamin Li (4):
bnx2: In bnx2_set_mac_link() return void rather then int
bnx2: Update MODULE_DESCRIPTION to include the 5716
bnx2: Remove name field from bnx2 structure
bnx2: Remove timer_interval field from the bnx2 structure

 drivers/net/bnx2.c |   22 +++++++++-------------
 drivers/net/bnx2.h |    5 ++---
 2 files changed, 11 insertions(+), 16 deletions(-)
#2 lore raw

PATCH 1/4 bnx2: In bnx2_set_mac_link() return void rather then int

bnx2_set_mac_link() doesn't need to return any error codes. And all the callers don't check the return code. It is safe to change the return type to a void.

---
 drivers/net/bnx2.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/net/bnx2.c +1 -3
index 2486a65..192a24e 100644
@@ -1127,7 +1127,7 @@ bnx2_init_all_rx_contexts(struct bnx2 *bp)
 	}
 }
 
-static int
+static void
 bnx2_set_mac_link(struct bnx2 *bp)
 {
 	u32 val;
@@ -1193,8 +1193,6 @@ bnx2_set_mac_link(struct bnx2 *bp)
 
 	if (CHIP_NUM(bp) == CHIP_NUM_5709)
 		bnx2_init_all_rx_contexts(bp);
-
-	return 0;
 }
 
 static void
Signature · 1 line
1.6.0.1
#3 lore raw

PATCH 2/4 bnx2: Update MODULE_DESCRIPTION to include the 5716

---
 drivers/net/bnx2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/bnx2.c +1 -1
index 192a24e..a78b664 100644
@@ -69,7 +69,7 @@ static char version[] __devinitdata =
 	"Broadcom NetXtreme II Gigabit Ethernet Driver " DRV_MODULE_NAME " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
 
 MODULE_AUTHOR("Michael Chan <[email protected]>");
-MODULE_DESCRIPTION("Broadcom NetXtreme II BCM5706/5708/5709 Driver");
+MODULE_DESCRIPTION("Broadcom NetXtreme II BCM5706/5708/5709/5716 Driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_MODULE_VERSION);
 
Signature · 1 line
1.6.0.1
#4 lore raw

PATCH 3/4 bnx2: Remove name field from bnx2 structure

The name of the board is only used during the initialization of the adapter. We can save the space of a pointer by not storing this information.

---
 drivers/net/bnx2.c |    3 +--
 drivers/net/bnx2.h |    2 --
 2 files changed, 1 insertions(+), 4 deletions(-)
drivers/net/bnx2.c +1 -2
index a78b664..8417766 100644
@@ -7718,7 +7718,6 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	memcpy(dev->dev_addr, bp->mac_addr, 6);
 	memcpy(dev->perm_addr, bp->mac_addr, 6);
-	bp->name = board_info[ent->driver_data].name;
 
 	dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
 	if (CHIP_NUM(bp) == CHIP_NUM_5709)
@@ -7745,7 +7744,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	printk(KERN_INFO "%s: %s (%c%d) %s found at mem %lx, "
 		"IRQ %d, node addr %s\n",
 		dev->name,
-		bp->name,
+		board_info[ent->driver_data].name,
 		((CHIP_ID(bp) & 0xf000) >> 12) + 'A',
 		((CHIP_ID(bp) & 0x0ff0) >> 4),
 		bnx2_bus_string(bp, str),
drivers/net/bnx2.h +0 -2
index c3c579f..cb47c98 100644
@@ -6701,8 +6701,6 @@ struct bnx2 {
 
 	/* End of fields used in the performance code paths. */
 
-	char			*name;
-
 	int			timer_interval;
 	int			current_interval;
 	struct			timer_list timer;
Signature · 1 line
1.6.0.1
#5 lore raw

PATCH 4/4 bnx2: Remove timer_interval field from the bnx2 structure

The timer_interval field is only assigned once, and never reassigned. We can safely replace all instances of the timer_interval with a constant value.

---
 drivers/net/bnx2.c |   13 ++++++-------
 drivers/net/bnx2.h |    3 ++-
 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/bnx2.c +6 -7
index 8417766..883e0a7 100644
@@ -5598,7 +5598,7 @@ bnx2_5706_serdes_timer(struct bnx2 *bp)
 	} else if ((bp->link_up == 0) && (bp->autoneg & AUTONEG_SPEED)) {
 		u32 bmcr;
 
-		bp->current_interval = bp->timer_interval;
+		bp->current_interval = BNX2_TIMER_INTERVAL;
 
 		bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
 
@@ -5627,7 +5627,7 @@ bnx2_5706_serdes_timer(struct bnx2 *bp)
 			bp->phy_flags &= ~BNX2_PHY_FLAG_PARALLEL_DETECT;
 		}
 	} else
-		bp->current_interval = bp->timer_interval;
+		bp->current_interval = BNX2_TIMER_INTERVAL;
 
 	if (check_link) {
 		u32 val;
@@ -5672,11 +5672,11 @@ bnx2_5708_serdes_timer(struct bnx2 *bp)
 		} else {
 			bnx2_disable_forced_2g5(bp);
 			bp->serdes_an_pending = 2;
-			bp->current_interval = bp->timer_interval;
+			bp->current_interval = BNX2_TIMER_INTERVAL;
 		}
 
 	} else
-		bp->current_interval = bp->timer_interval;
+		bp->current_interval = BNX2_TIMER_INTERVAL;
 
 	spin_unlock(&bp->phy_lock);
 }
@@ -7514,8 +7514,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
 
 	bp->stats_ticks = USEC_PER_SEC & BNX2_HC_STATS_TICKS_HC_STAT_TICKS;
 
-	bp->timer_interval =  HZ;
-	bp->current_interval =  HZ;
+	bp->current_interval = BNX2_TIMER_INTERVAL;
 
 	bp->phy_addr = 1;
 
@@ -7605,7 +7604,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
 	bp->req_flow_ctrl = FLOW_CTRL_RX | FLOW_CTRL_TX;
 
 	init_timer(&bp->timer);
-	bp->timer.expires = RUN_AT(bp->timer_interval);
+	bp->timer.expires = RUN_AT(BNX2_TIMER_INTERVAL);
 	bp->timer.data = (unsigned long) bp;
 	bp->timer.function = bnx2_timer;
 
drivers/net/bnx2.h +2 -1
index cb47c98..682b8f0 100644
@@ -6654,6 +6654,8 @@ struct bnx2_napi {
 	struct bnx2_tx_ring_info	tx_ring;
 };
 
+#define BNX2_TIMER_INTERVAL			HZ
+
 struct bnx2 {
 	/* Fields used in the tx and intr/napi performance paths are grouped */
 	/* together in the beginning of the structure. */
@@ -6701,7 +6703,6 @@ struct bnx2 {
 
 	/* End of fields used in the performance code paths. */
 
-	int			timer_interval;
 	int			current_interval;
 	struct			timer_list timer;
 	struct work_struct	reset_task;
Signature · 1 line
1.6.0.1
maintainer
#6 lore raw

Re: [UPDATED][NET-NEXT PATCH 4/4] bnx2: Remove timer_interval field from the bnx2 structure

From: "Benjamin Li" <[email protected]>
Date: Thu, 18 Sep 2008 09:57:13 -0700

Quoted 6 lines

The timer_interval field is only assigned once, and never reassigned. We can safely replace all instances of the timer_interval with a constant value.

Also applied, thanks.

maintainer Applied
#7 lore raw

Re: [UPDATED][NET-NEXT PATCH 3/4] bnx2: Remove name field from bnx2 structure

In reply to Benjamin Li

From: "Benjamin Li" <[email protected]>
Date: Thu, 18 Sep 2008 09:57:12 -0700

Quoted 6 lines

The name of the board is only used during the initialization of the adapter. We can save the space of a pointer by not storing this information.

Applied.

maintainer
#8 lore raw
In reply to Benjamin Li

I've seen these patches posted at least 3 other times already.

Please be patient, we saw it the first 3 times, you need not submit them again.

maintainer Applied
#10 lore raw

Re: [UPDATED][NET-NEXT PATCH 1/4] bnx2: In bnx2_set_mac_link() return void rather then int

In reply to Benjamin Li

From: "Benjamin Li" <[email protected]>
Date: Thu, 18 Sep 2008 09:57:10 -0700

Quoted 6 lines

bnx2_set_mac_link() doesn't need to return any error codes. And all the callers don't check the return code. It is safe to change the return type to a void.

Applied.

#11 lore raw

Re: [UPDATED][NET-NEXT PATCH 0/4] Minor bnx2 patches

In reply to Benjamin Li
Quoted 38 lines · Benjamin Li

Thanks for the comments Simon. I have integrated the changes that you have suggested. I have reposted the entire patch set in numbered form so that it could be merged in easier.

Thanks again.

-Ben

Quoted 6 lines
(quoted diff) +0 -0
@@ -7514,7 +7514,6 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
 >       bp->stats_ticks = USEC_PER_SEC & BNX2_HC_STATS_TICKS_HC_STAT_TICKS;
Quoted 3 lines
-     bp->timer_interval =  HZ;
      bp->current_interval =  HZ;

Would it make sense to set current_interval to BNX2_TIMER_INTERVAL?

Changed.

Quoted 6 lines
Quoted 6 lines
drivers/net/bnx2.h +0 -0
index cb47c98..e534c1d 100644
@@ -6701,7 +6701,7 @@ struct bnx2 {
 
Quoted 7 lines

drivers/net/bnx2.h struct bnx2 { · line 6704

Quoted 4 lines
drivers/net/bnx2.h +1 -1
      /* End of fields used in the performance code paths. */
 
-     int                     timer_interval;
+#define BNX2_TIMER_INTERVAL                  HZ

Perhaps its just me, but would it be nicer to define BNX2_TIMER_INTERVAL somewhere other than in the middle of this structure?

Moved outside of the bnx2 structure.

--------------------

Benjamin Li (4):
bnx2: In bnx2_set_mac_link() return void rather then int
bnx2: Update MODULE_DESCRIPTION to include the 5716
bnx2: Remove name field from bnx2 structure
bnx2: Remove timer_interval field from the bnx2 structure

Quoted 3 lines
 drivers/net/bnx2.c |   22 +++++++++-------------
 drivers/net/bnx2.h |    5 ++---
 2 files changed, 11 insertions(+), 16 deletions(-)

Patches 1-4 Acked-by: Jeff Garzik <[email protected]>

Unlike most net drivers, as a special case, davem usually applies patches to this net driver (and tg3), rather than me. So I'll let him pick these up (CC'd).

maintainer
#12 lore raw

Re: [UPDATED][NET-NEXT PATCH 0/4] Minor bnx2 patches

From: Jeff Garzik <[email protected]>
Date: Thu, 18 Sep 2008 13:04:02 -0400

Quoted 3 lines

Patches 1-4 Acked-by: Jeff Garzik <[email protected]>

Unlike most net drivers, as a special case, davem usually applies patches to this net driver (and tg3), rather than me. So I'll let him pick these up (CC'd).

Oh I see, this was an update, sigh.

Ok, I'll look at these and integrate them later as needed.