Skip to content

Commit

Permalink
[SCSI] bfa: Added support for CEE info and stats query.
Browse files Browse the repository at this point in the history
- Added CEE sub-module.
- Added support to collect stats/cee module info
  using BSG interface.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Krishna Gudipati authored and James Bottomley committed Jun 29, 2011
1 parent 6013806 commit 148d610
Show file tree
Hide file tree
Showing 8 changed files with 683 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/scsi/bfa/bfa_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ bfa_com_ablk_attach(struct bfa_s *bfa)
bfa_ablk_memclaim(ablk, ablk_dma->kva_curp, ablk_dma->dma_curp);
}

static void
bfa_com_cee_attach(struct bfa_s *bfa)
{
struct bfa_cee_s *cee = &bfa->modules.cee;
struct bfa_mem_dma_s *cee_dma = BFA_MEM_CEE_DMA(bfa);

cee->trcmod = bfa->trcmod;
bfa_cee_attach(cee, &bfa->ioc, bfa);
bfa_cee_mem_claim(cee, cee_dma->kva_curp, cee_dma->dma_curp);
}

/*
* BFA IOC FC related definitions
*/
Expand Down Expand Up @@ -1348,6 +1359,7 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo,
int i;
struct bfa_mem_dma_s *port_dma = BFA_MEM_PORT_DMA(bfa);
struct bfa_mem_dma_s *ablk_dma = BFA_MEM_ABLK_DMA(bfa);
struct bfa_mem_dma_s *cee_dma = BFA_MEM_CEE_DMA(bfa);

WARN_ON((cfg == NULL) || (meminfo == NULL));

Expand All @@ -1365,6 +1377,7 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo,
/* dma info setup */
bfa_mem_dma_setup(meminfo, port_dma, bfa_port_meminfo());
bfa_mem_dma_setup(meminfo, ablk_dma, bfa_ablk_meminfo());
bfa_mem_dma_setup(meminfo, cee_dma, bfa_cee_meminfo());
}

/*
Expand Down Expand Up @@ -1432,6 +1445,7 @@ bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,

bfa_com_port_attach(bfa);
bfa_com_ablk_attach(bfa);
bfa_com_cee_attach(bfa);
}

/*
Expand Down
73 changes: 73 additions & 0 deletions drivers/scsi/bfa/bfa_defs_svc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1142,4 +1142,77 @@ struct bfa_port_cfg_mode_s {
enum bfa_mode_s mode;
};

#pragma pack(1)

#define BFA_CEE_LLDP_MAX_STRING_LEN (128)
#define BFA_CEE_DCBX_MAX_PRIORITY (8)
#define BFA_CEE_DCBX_MAX_PGID (8)

struct bfa_cee_lldp_str_s {
u8 sub_type;
u8 len;
u8 rsvd[2];
u8 value[BFA_CEE_LLDP_MAX_STRING_LEN];
};

struct bfa_cee_lldp_cfg_s {
struct bfa_cee_lldp_str_s chassis_id;
struct bfa_cee_lldp_str_s port_id;
struct bfa_cee_lldp_str_s port_desc;
struct bfa_cee_lldp_str_s sys_name;
struct bfa_cee_lldp_str_s sys_desc;
struct bfa_cee_lldp_str_s mgmt_addr;
u16 time_to_live;
u16 enabled_system_cap;
};

/* CEE/DCBX parameters */
struct bfa_cee_dcbx_cfg_s {
u8 pgid[BFA_CEE_DCBX_MAX_PRIORITY];
u8 pg_percentage[BFA_CEE_DCBX_MAX_PGID];
u8 pfc_primap; /* bitmap of priorties with PFC enabled */
u8 fcoe_primap; /* bitmap of priorities used for FcoE traffic */
u8 iscsi_primap; /* bitmap of priorities used for iSCSI traffic */
u8 dcbx_version; /* operating version:CEE or preCEE */
u8 lls_fcoe; /* FCoE Logical Link Status */
u8 lls_lan; /* LAN Logical Link Status */
u8 rsvd[2];
};

/* CEE Query */
struct bfa_cee_attr_s {
u8 cee_status;
u8 error_reason;
struct bfa_cee_lldp_cfg_s lldp_remote;
struct bfa_cee_dcbx_cfg_s dcbx_remote;
mac_t src_mac;
u8 link_speed;
u8 nw_priority;
u8 filler[2];
};

/* LLDP/DCBX/CEE Statistics */
struct bfa_cee_stats_s {
u32 lldp_tx_frames; /* LLDP Tx Frames */
u32 lldp_rx_frames; /* LLDP Rx Frames */
u32 lldp_rx_frames_invalid; /* LLDP Rx Frames invalid */
u32 lldp_rx_frames_new; /* LLDP Rx Frames new */
u32 lldp_tlvs_unrecognized; /* LLDP Rx unrecog. TLVs */
u32 lldp_rx_shutdown_tlvs; /* LLDP Rx shutdown TLVs */
u32 lldp_info_aged_out; /* LLDP remote info aged */
u32 dcbx_phylink_ups; /* DCBX phy link ups */
u32 dcbx_phylink_downs; /* DCBX phy link downs */
u32 dcbx_rx_tlvs; /* DCBX Rx TLVs */
u32 dcbx_rx_tlvs_invalid; /* DCBX Rx TLVs invalid */
u32 dcbx_control_tlv_error; /* DCBX control TLV errors */
u32 dcbx_feature_tlv_error; /* DCBX feature TLV errors */
u32 dcbx_cee_cfg_new; /* DCBX new CEE cfg rcvd */
u32 cee_status_down; /* DCB status down */
u32 cee_status_up; /* DCB status up */
u32 cee_hw_cfg_changed; /* DCB hw cfg changed */
u32 cee_rx_invalid_cfg; /* DCB invalid cfg */
};

#pragma pack()

#endif /* __BFA_DEFS_SVC_H__ */
1 change: 1 addition & 0 deletions drivers/scsi/bfa/bfa_modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct bfa_modules_s {
struct bfa_sgpg_mod_s sgpg_mod; /* SG page module */
struct bfa_port_s port; /* Physical port module */
struct bfa_ablk_s ablk; /* ASIC block config module */
struct bfa_cee_s cee; /* CEE Module */
};

/*
Expand Down
Loading

0 comments on commit 148d610

Please sign in to comment.