diff options
author | Selvin Xavier <selvin.xavier@emulex.com> | 2014-06-10 18:02:13 +0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-08-02 02:07:36 +0400 |
commit | 31dbdd9af58c63c7f8376a0fa680f5fc1b6cce98 (patch) | |
tree | a6d096308dc817e9ce4194ba4aec804294de2185 /drivers/infiniband/hw/ocrdma/ocrdma.h | |
parent | f50f31e42fb772b62e209cf6ff5254b1bc02b756 (diff) | |
download | linux-31dbdd9af58c63c7f8376a0fa680f5fc1b6cce98.tar.xz |
RDMA/ocrdma: Query and initalize the PFC SL
This patch implements routine to query the PFC priority from the
adapter port.
Following are the changes implemented:
* A new FW command is implemented to query the operational/admin DCBX
configuration from the FW and obtain active priority(service
level).
* Adds support for the async event reported by FW when the PFC
priority changes. Service level is re-initialized during modify_qp
or create_ah, based on this event.
* Maintain SL value in ocrdma_dev structure and refer that as and
when needed.
Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma.h')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h index 19011dbb930f..5cd65c244191 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma.h +++ b/drivers/infiniband/hw/ocrdma/ocrdma.h @@ -236,6 +236,9 @@ struct ocrdma_dev { struct rcu_head rcu; int id; u64 stag_arr[OCRDMA_MAX_STAG]; + u8 sl; /* service level */ + bool pfc_state; + atomic_t update_sl; u16 pvid; u32 asic_id; @@ -518,4 +521,22 @@ static inline u8 ocrdma_get_asic_type(struct ocrdma_dev *dev) OCRDMA_SLI_ASIC_GEN_NUM_SHIFT; } +static inline u8 ocrdma_get_pfc_prio(u8 *pfc, u8 prio) +{ + return *(pfc + prio); +} + +static inline u8 ocrdma_get_app_prio(u8 *app_prio, u8 prio) +{ + return *(app_prio + prio); +} + +static inline u8 ocrdma_is_enabled_and_synced(u32 state) +{ /* May also be used to interpret TC-state, QCN-state + * Appl-state and Logical-link-state in future. + */ + return (state & OCRDMA_STATE_FLAG_ENABLED) && + (state & OCRDMA_STATE_FLAG_SYNC); +} + #endif |