2017-04-04 06:16:59 +00:00
|
|
|
/*
|
2018-07-25 02:36:55 +00:00
|
|
|
* Copyright (c) 2017-2018 Cavium, Inc.
|
2017-04-04 06:16:59 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* $FreeBSD$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
#ifndef __ECORE_ROCE_H__
|
|
|
|
#define __ECORE_ROCE_H__
|
2017-04-04 06:16:59 +00:00
|
|
|
|
|
|
|
#include "ecore_status.h"
|
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
#define ECORE_ROCE_QP_TO_ICID(qp_idx) ((qp_idx)*2)
|
|
|
|
#define ECORE_ROCE_ICID_TO_QP(icid) ((icid)/2)
|
2017-04-04 06:16:59 +00:00
|
|
|
|
|
|
|
/* functions for enabling/disabling edpm in rdma PFs according to existence of
|
|
|
|
* qps during DCBx update or bar size
|
|
|
|
*/
|
2018-07-25 02:36:55 +00:00
|
|
|
void
|
|
|
|
ecore_roce_dpm_dcbx(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);
|
2017-04-04 06:16:59 +00:00
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
void
|
|
|
|
ecore_rdma_dpm_bar(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);
|
2017-06-15 02:45:43 +00:00
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
enum _ecore_status_t
|
|
|
|
ecore_roce_dcqcn_cfg(struct ecore_hwfn *p_hwfn,
|
|
|
|
struct ecore_roce_dcqcn_params *params,
|
|
|
|
struct roce_init_func_ramrod_data *p_ramrod,
|
|
|
|
struct ecore_ptt *p_ptt);
|
2017-04-04 06:16:59 +00:00
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
enum _ecore_status_t
|
|
|
|
ecore_roce_setup(struct ecore_hwfn *p_hwfn);
|
2017-04-04 06:16:59 +00:00
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
enum _ecore_status_t
|
|
|
|
ecore_roce_stop_rl(struct ecore_hwfn *p_hwfn);
|
2017-04-04 06:16:59 +00:00
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
enum _ecore_status_t
|
|
|
|
ecore_roce_stop(struct ecore_hwfn *p_hwfn);
|
2017-04-04 06:16:59 +00:00
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
enum _ecore_status_t
|
|
|
|
ecore_roce_query_qp(struct ecore_hwfn *p_hwfn,
|
|
|
|
struct ecore_rdma_qp *qp,
|
|
|
|
struct ecore_rdma_query_qp_out_params *out_params);
|
2017-04-04 06:16:59 +00:00
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
enum _ecore_status_t
|
|
|
|
ecore_roce_destroy_qp(struct ecore_hwfn *p_hwfn,
|
|
|
|
struct ecore_rdma_qp *qp,
|
|
|
|
struct ecore_rdma_destroy_qp_out_params *out_params);
|
2017-04-04 06:16:59 +00:00
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
enum _ecore_status_t
|
|
|
|
ecore_roce_alloc_qp_idx(struct ecore_hwfn *p_hwfn,
|
|
|
|
u16 *qp_idx16);
|
2017-04-04 06:16:59 +00:00
|
|
|
|
|
|
|
#define IS_ECORE_DCQCN(p_hwfn) \
|
|
|
|
(!!(p_hwfn->pf_params.rdma_pf_params.enable_dcqcn))
|
|
|
|
|
|
|
|
struct ecore_roce_info {
|
|
|
|
struct roce_events_stats event_stats;
|
2018-07-25 02:36:55 +00:00
|
|
|
struct roce_dcqcn_received_stats dcqcn_rx_stats;
|
|
|
|
struct roce_dcqcn_sent_stats dcqcn_tx_stats;
|
2017-04-04 06:16:59 +00:00
|
|
|
|
|
|
|
u8 dcqcn_enabled;
|
|
|
|
u8 dcqcn_reaction_point;
|
|
|
|
};
|
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
enum _ecore_status_t
|
|
|
|
ecore_roce_modify_qp(struct ecore_hwfn *p_hwfn,
|
|
|
|
struct ecore_rdma_qp *qp,
|
|
|
|
enum ecore_roce_qp_state prev_state,
|
|
|
|
struct ecore_rdma_modify_qp_in_params *params);
|
2017-04-04 06:16:59 +00:00
|
|
|
|
2018-07-25 02:36:55 +00:00
|
|
|
#endif /*__ECORE_ROCE_H__*/
|