Skip to contentSkip to conversation

bnx2x: Adjust ETS to 578xx

PATCH Applied Vlad Zolotarov 1 participant 1 message Jun 14, 2011

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

PATCH 19/24 bnx2x: Adjust ETS to 578xx

From: Yaniv Rosner <[email protected]>

---
 drivers/net/bnx2x/bnx2x_dcb.c  |    2 +-
 drivers/net/bnx2x/bnx2x_link.c |  753 +++++++++++++++++++++++++++++++++++++++-
 drivers/net/bnx2x/bnx2x_link.h |   40 ++-
 drivers/net/bnx2x/bnx2x_reg.h  |  172 +++++++++
 4 files changed, 963 insertions(+), 4 deletions(-)
drivers/net/bnx2x/bnx2x_dcb.c +1 -1
index aaed9f0..50a5c4f 100644
@@ -424,7 +424,7 @@ static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp)
 	struct bnx2x_dcbx_pg_params *ets = &(bp->dcbx_port_params.ets);
 	u8	status = 0;
 
-	bnx2x_ets_disabled(&bp->link_params/*, &bp->link_vars*/);
+	bnx2x_ets_disabled(&bp->link_params, &bp->link_vars);
 
 	if (!ets->enabled)
 		return;
drivers/net/bnx2x/bnx2x_link.c +751 -2

770 lines not on this page · raw message

drivers/net/bnx2x/bnx2x_link.h +39 -1
index 82bc021..3d9c46b 100644
@@ -411,6 +411,38 @@ struct bnx2x_nig_brb_pfc_port_params {
 	u32 cos1_pauseable;
 };
 
+
+/* ETS port configuration params */
+struct bnx2x_ets_bw_params {
+	u8 bw;
+};
+
+struct bnx2x_ets_sp_params {
+	/**
+	 * valid values are 0 - 5. 0 is highest strict priority.
+	 * There can't be two COS's with the same pri.
+	 */
+	u8 pri;
+};
+
+enum bnx2x_cos_state {
+	bnx2x_cos_state_strict = 0,
+	bnx2x_cos_state_bw = 1,
+};
+
+struct bnx2x_ets_cos_params {
+	enum bnx2x_cos_state state ;
+	union {
+		struct bnx2x_ets_bw_params bw_params;
+		struct bnx2x_ets_sp_params sp_params;
+	} params;
+};
+
+struct bnx2x_ets_params {
+	u8 num_of_cos; /* Number of valid COS entries*/
+	struct bnx2x_ets_cos_params cos[DCBX_MAX_NUM_COS];
+};
+
 /**
  * Used to update the PFC attributes in EMAC, BMAC, NIG and BRB
  * when link is already up
@@ -421,7 +453,8 @@ int bnx2x_update_pfc(struct link_params *params,
 
 
 /* Used to configure the ETS to disable */
-void bnx2x_ets_disabled(struct link_params *params);
+int bnx2x_ets_disabled(struct link_params *params,
+		       struct link_vars *vars);
 
 /* Used to configure the ETS to BW limited */
 void bnx2x_ets_bw_limit(const struct link_params *params, const u32 cos0_bw,
@@ -430,6 +463,11 @@ void bnx2x_ets_bw_limit(const struct link_params *params, const u32 cos0_bw,
 /* Used to configure the ETS to strict */
 int bnx2x_ets_strict(const struct link_params *params, const u8 strict_cos);
 
+
+/*  Configure the COS to ETS according to BW and SP settings.*/
+int bnx2x_ets_e3b0_config(const struct link_params *params,
+			 const struct link_vars *vars,
+			 const struct bnx2x_ets_params *ets_params);
 /* Read pfc statistic*/
 void bnx2x_pfc_statistic(struct link_params *params, struct link_vars *vars,
 						 u32 pfc_frames_sent[2],
drivers/net/bnx2x/bnx2x_reg.h +172 -0

218 lines not on this page · raw message

Signature · 1 line
1.7.1