Commit d1976b2e authored by Dmitry Kravkov's avatar Dmitry Kravkov Committed by David S. Miller

bnx2x: PFC support for 578xx

Add supoprt for 3 COSes for 578xx devices.
Fix HW configuration for PFC feature according to new HSI in link layer.
Signed-off-by: default avatarDmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: default avatarVladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@conan.davemloft.net>
parent 60d2fe03
This diff is collapsed.
...@@ -27,22 +27,30 @@ struct bnx2x_dcbx_app_params { ...@@ -27,22 +27,30 @@ struct bnx2x_dcbx_app_params {
u32 traffic_type_priority[LLFC_DRIVER_TRAFFIC_TYPE_MAX]; u32 traffic_type_priority[LLFC_DRIVER_TRAFFIC_TYPE_MAX];
}; };
#define E2_NUM_OF_COS 2 #define DCBX_COS_MAX_NUM_E2 DCBX_E2E3_MAX_NUM_COS
#define BNX2X_DCBX_COS_NOT_STRICT 0 /* bnx2x currently limits numbers of supported COSes to 3 to be extended to 6 */
#define BNX2X_DCBX_COS_LOW_STRICT 1 #define BNX2X_MAX_COS_SUPPORT 3
#define BNX2X_DCBX_COS_HIGH_STRICT 2 #define DCBX_COS_MAX_NUM_E3B0 BNX2X_MAX_COS_SUPPORT
#define DCBX_COS_MAX_NUM BNX2X_MAX_COS_SUPPORT
struct bnx2x_dcbx_cos_params { struct bnx2x_dcbx_cos_params {
u32 bw_tbl; u32 bw_tbl;
u32 pri_bitmask; u32 pri_bitmask;
/*
* strict priority: valid values are 0..5; 0 is highest priority.
* There can't be two COSes with the same priority.
*/
u8 strict; u8 strict;
#define BNX2X_DCBX_STRICT_INVALID DCBX_COS_MAX_NUM
#define BNX2X_DCBX_STRICT_COS_HIGHEST 0
#define BNX2X_DCBX_STRICT_COS_NEXT_LOWER_PRI(sp) ((sp) + 1)
u8 pauseable; u8 pauseable;
}; };
struct bnx2x_dcbx_pg_params { struct bnx2x_dcbx_pg_params {
u32 enabled; u32 enabled;
u8 num_of_cos; /* valid COS entries */ u8 num_of_cos; /* valid COS entries */
struct bnx2x_dcbx_cos_params cos_params[E2_NUM_OF_COS]; struct bnx2x_dcbx_cos_params cos_params[DCBX_COS_MAX_NUM];
}; };
struct bnx2x_dcbx_pfc_params { struct bnx2x_dcbx_pfc_params {
...@@ -134,7 +142,7 @@ struct cos_entry_help_data { ...@@ -134,7 +142,7 @@ struct cos_entry_help_data {
}; };
struct cos_help_data { struct cos_help_data {
struct cos_entry_help_data data[E2_NUM_OF_COS]; struct cos_entry_help_data data[DCBX_COS_MAX_NUM];
u8 num_of_cos; u8 num_of_cos;
}; };
...@@ -150,6 +158,8 @@ struct cos_help_data { ...@@ -150,6 +158,8 @@ struct cos_help_data {
((pg_pri) & (DCBX_PFC_PRI_PAUSE_MASK(bp))) ((pg_pri) & (DCBX_PFC_PRI_PAUSE_MASK(bp)))
#define DCBX_PFC_PRI_GET_NON_PAUSE(bp, pg_pri) \ #define DCBX_PFC_PRI_GET_NON_PAUSE(bp, pg_pri) \
(DCBX_PFC_PRI_NON_PAUSE_MASK(bp) & (pg_pri)) (DCBX_PFC_PRI_NON_PAUSE_MASK(bp) & (pg_pri))
#define DCBX_IS_PFC_PRI_SOME_PAUSE(bp, pg_pri) \
(0 != DCBX_PFC_PRI_GET_PAUSE(bp, pg_pri))
#define IS_DCBX_PFC_PRI_ONLY_PAUSE(bp, pg_pri) \ #define IS_DCBX_PFC_PRI_ONLY_PAUSE(bp, pg_pri) \
(pg_pri == DCBX_PFC_PRI_GET_PAUSE((bp), (pg_pri))) (pg_pri == DCBX_PFC_PRI_GET_PAUSE((bp), (pg_pri)))
#define IS_DCBX_PFC_PRI_ONLY_NON_PAUSE(bp, pg_pri)\ #define IS_DCBX_PFC_PRI_ONLY_NON_PAUSE(bp, pg_pri)\
...@@ -172,7 +182,6 @@ struct pg_help_data { ...@@ -172,7 +182,6 @@ struct pg_help_data {
/* forward DCB/PFC related declarations */ /* forward DCB/PFC related declarations */
struct bnx2x; struct bnx2x;
void bnx2x_dcb_init_intmem_pfc(struct bnx2x *bp);
void bnx2x_dcbx_update(struct work_struct *work); void bnx2x_dcbx_update(struct work_struct *work);
void bnx2x_dcbx_init_params(struct bnx2x *bp); void bnx2x_dcbx_init_params(struct bnx2x *bp);
void bnx2x_dcbx_set_state(struct bnx2x *bp, bool dcb_on, u32 dcbx_enabled); void bnx2x_dcbx_set_state(struct bnx2x *bp, bool dcb_on, u32 dcbx_enabled);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment