public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] bnx2x: Fix compilation with no IOV support
@ 2013-06-24  8:04 Yuval Mintz
  2013-06-24  8:48 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Yuval Mintz @ 2013-06-24  8:04 UTC (permalink / raw)
  To: netdev, davem; +Cc: fengguang.wu, Yuval Mintz, Ariel Elior, Eilon Greenstein

This fixes an issue caused by submit 78c3bcc5d1af64f51d9f30b0f5a2d1985bf69734
`bnx2x: Improve PF behaviour toward VF', which made the bnx2x driver fail
compilation when PCI_IOV is not set.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
Hi Dave,

Please consider applying this to `net-next'.

Thanks,
Yuval Mintz
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c  | 14 ++------------
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 14 ++++++++++++++
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h |  2 ++
 3 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index d468fe4..7318988 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -5457,18 +5457,8 @@ static void bnx2x_timer(unsigned long data)
 		bnx2x_stats_handle(bp, STATS_EVENT_UPDATE);
 
 	/* sample pf vf bulletin board for new posts from pf */
-	if (IS_VF(bp)) {
-		bnx2x_sample_bulletin(bp);
-
-		/* if channel is down we need to self destruct */
-		if (bp->old_bulletin.valid_bitmap & 1 << CHANNEL_DOWN) {
-			smp_mb__before_clear_bit();
-			set_bit(BNX2X_SP_RTNL_VFPF_CHANNEL_DOWN,
-				&bp->sp_rtnl_state);
-			smp_mb__after_clear_bit();
-			schedule_delayed_work(&bp->sp_rtnl_task, 0);
-		}
-	}
+	if (IS_VF(bp))
+		bnx2x_timer_sriov(bp);
 
 	mod_timer(&bp->timer, jiffies + bp->current_interval);
 }
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index bda4d7e..95861ef 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -3426,6 +3426,20 @@ enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp)
 	return PFVF_BULLETIN_UPDATED;
 }
 
+void bnx2x_timer_sriov(struct bnx2x *bp)
+{
+	bnx2x_sample_bulletin(bp);
+
+	/* if channel is down we need to self destruct */
+	if (bp->old_bulletin.valid_bitmap & 1 << CHANNEL_DOWN) {
+		smp_mb__before_clear_bit();
+		set_bit(BNX2X_SP_RTNL_VFPF_CHANNEL_DOWN,
+			&bp->sp_rtnl_state);
+		smp_mb__after_clear_bit();
+		schedule_delayed_work(&bp->sp_rtnl_task, 0);
+	}
+}
+
 void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp)
 {
 	/* vf doorbells are embedded within the regview */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
index 9fc029e..d143a7c 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
@@ -751,6 +751,7 @@ static inline int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp,
 }
 
 enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp);
+void bnx2x_timer_sriov(struct bnx2x *bp);
 void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp);
 int bnx2x_vf_pci_alloc(struct bnx2x *bp);
 int bnx2x_enable_sriov(struct bnx2x *bp);
@@ -809,6 +810,7 @@ static inline enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp
 {
 	return PFVF_BULLETIN_UNCHANGED;
 }
+static inline void bnx2x_timer_sriov(struct bnx2x *bp) {}
 
 static inline void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp)
 {
-- 
1.8.1.227.g44fe835

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] bnx2x: Fix compilation with no IOV support
  2013-06-24  8:04 [PATCH net-next] bnx2x: Fix compilation with no IOV support Yuval Mintz
@ 2013-06-24  8:48 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-06-24  8:48 UTC (permalink / raw)
  To: yuvalmin; +Cc: netdev, fengguang.wu, ariele, eilong

From: "Yuval Mintz" <yuvalmin@broadcom.com>
Date: Mon, 24 Jun 2013 11:04:10 +0300

> This fixes an issue caused by submit 78c3bcc5d1af64f51d9f30b0f5a2d1985bf69734
> `bnx2x: Improve PF behaviour toward VF', which made the bnx2x driver fail
> compilation when PCI_IOV is not set.
> 
> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
> Signed-off-by: Ariel Elior <ariele@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-24  8:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-24  8:04 [PATCH net-next] bnx2x: Fix compilation with no IOV support Yuval Mintz
2013-06-24  8:48 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox