linux/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c

// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
/* Copyright (c) 2019 Mellanox Technologies. */

#include <linux/smp.h>
#include "dr_types.h"

#define QUEUE_SIZE
#define SIGNAL_PER_DIV_QUEUE
#define TH_NUMS_TO_DRAIN
#define DR_SEND_INFO_POOL_SIZE

enum {};

struct dr_data_seg {};

enum send_info_type {};

struct postsend_info {};

struct dr_qp_rtr_attr {};

struct dr_qp_rts_attr {};

struct dr_qp_init_attr {};

struct mlx5dr_send_info_pool_obj {};

struct mlx5dr_send_info_pool {};

static int dr_send_info_pool_fill(struct mlx5dr_send_info_pool *pool)
{}

static void dr_send_info_pool_destroy(struct mlx5dr_send_info_pool *pool)
{}

void mlx5dr_send_info_pool_destroy(struct mlx5dr_domain *dmn)
{}

static struct mlx5dr_send_info_pool *dr_send_info_pool_create(void)
{}

int mlx5dr_send_info_pool_create(struct mlx5dr_domain *dmn)
{}

struct mlx5dr_ste_send_info
*mlx5dr_send_info_alloc(struct mlx5dr_domain *dmn,
			enum mlx5dr_domain_nic_type nic_type)
{}

void mlx5dr_send_info_free(struct mlx5dr_ste_send_info *ste_send_info)
{}

static int dr_parse_cqe(struct mlx5dr_cq *dr_cq, struct mlx5_cqe64 *cqe64)
{}

static int dr_cq_poll_one(struct mlx5dr_cq *dr_cq)
{}

static int dr_poll_cq(struct mlx5dr_cq *dr_cq, int ne)
{}

static struct mlx5dr_qp *dr_create_rc_qp(struct mlx5_core_dev *mdev,
					 struct dr_qp_init_attr *attr)
{}

static void dr_destroy_qp(struct mlx5_core_dev *mdev,
			  struct mlx5dr_qp *dr_qp)
{}

static void dr_cmd_notify_hw(struct mlx5dr_qp *dr_qp, void *ctrl)
{}

static void
dr_rdma_handle_flow_access_arg_segments(struct mlx5_wqe_ctrl_seg *wq_ctrl,
					u32 remote_addr,
					struct dr_data_seg *data_seg,
					int *size)
{}

static void
dr_rdma_handle_icm_write_segments(struct mlx5_wqe_ctrl_seg *wq_ctrl,
				  u64 remote_addr,
				  u32 rkey,
				  struct dr_data_seg *data_seg,
				  unsigned int *size)
{}

static void dr_set_ctrl_seg(struct mlx5_wqe_ctrl_seg *wq_ctrl,
			    struct dr_data_seg *data_seg)
{}

static void dr_rdma_segments(struct mlx5dr_qp *dr_qp, u64 remote_addr,
			     u32 rkey, struct dr_data_seg *data_seg,
			     u32 opcode, bool notify_hw)
{}

static void dr_post_send(struct mlx5dr_qp *dr_qp, struct postsend_info *send_info)
{}

/**
 * mlx5dr_send_fill_and_append_ste_send_info: Add data to be sent
 * with send_list parameters:
 *
 *     @ste:       The data that attached to this specific ste
 *     @size:      of data to write
 *     @offset:    of the data from start of the hw_ste entry
 *     @data:      data
 *     @ste_info:  ste to be sent with send_list
 *     @send_list: to append into it
 *     @copy_data: if true indicates that the data should be kept because
 *                 it's not backuped any where (like in re-hash).
 *                 if false, it lets the data to be updated after
 *                 it was added to the list.
 */
void mlx5dr_send_fill_and_append_ste_send_info(struct mlx5dr_ste *ste, u16 size,
					       u16 offset, u8 *data,
					       struct mlx5dr_ste_send_info *ste_info,
					       struct list_head *send_list,
					       bool copy_data)
{}

/* The function tries to consume one wc each time, unless the queue is full, in
 * that case, which means that the hw is behind the sw in a full queue len
 * the function will drain the cq till it empty.
 */
static int dr_handle_pending_wc(struct mlx5dr_domain *dmn,
				struct mlx5dr_send_ring *send_ring)
{}

static void dr_fill_write_args_segs(struct mlx5dr_send_ring *send_ring,
				    struct postsend_info *send_info)
{}

static void dr_fill_write_icm_segs(struct mlx5dr_domain *dmn,
				   struct mlx5dr_send_ring *send_ring,
				   struct postsend_info *send_info)
{}

static void dr_fill_data_segs(struct mlx5dr_domain *dmn,
			      struct mlx5dr_send_ring *send_ring,
			      struct postsend_info *send_info)
{}

static int dr_postsend_icm_data(struct mlx5dr_domain *dmn,
				struct postsend_info *send_info)
{}

static int dr_get_tbl_copy_details(struct mlx5dr_domain *dmn,
				   struct mlx5dr_ste_htbl *htbl,
				   u8 **data,
				   u32 *byte_size,
				   int *iterations,
				   int *num_stes)
{}

/**
 * mlx5dr_send_postsend_ste: write size bytes into offset from the hw cm.
 *
 *     @dmn:    Domain
 *     @ste:    The ste struct that contains the data (at
 *              least part of it)
 *     @data:   The real data to send size data
 *     @size:   for writing.
 *     @offset: The offset from the icm mapped data to
 *              start write to this for write only part of the
 *              buffer.
 *
 * Return: 0 on success.
 */
int mlx5dr_send_postsend_ste(struct mlx5dr_domain *dmn, struct mlx5dr_ste *ste,
			     u8 *data, u16 size, u16 offset)
{}

int mlx5dr_send_postsend_htbl(struct mlx5dr_domain *dmn,
			      struct mlx5dr_ste_htbl *htbl,
			      u8 *formatted_ste, u8 *mask)
{}

/* Initialize htble with default STEs */
int mlx5dr_send_postsend_formatted_htbl(struct mlx5dr_domain *dmn,
					struct mlx5dr_ste_htbl *htbl,
					u8 *ste_init_data,
					bool update_hw_ste)
{}

int mlx5dr_send_postsend_action(struct mlx5dr_domain *dmn,
				struct mlx5dr_action *action)
{}

int mlx5dr_send_postsend_pattern(struct mlx5dr_domain *dmn,
				 struct mlx5dr_icm_chunk *chunk,
				 u16 num_of_actions,
				 u8 *data)
{}

int mlx5dr_send_postsend_args(struct mlx5dr_domain *dmn, u64 arg_id,
			      u16 num_of_actions, u8 *actions_data)
{}

static int dr_modify_qp_rst2init(struct mlx5_core_dev *mdev,
				 struct mlx5dr_qp *dr_qp,
				 int port)
{}

static int dr_cmd_modify_qp_rtr2rts(struct mlx5_core_dev *mdev,
				    struct mlx5dr_qp *dr_qp,
				    struct dr_qp_rts_attr *attr)
{}

static int dr_cmd_modify_qp_init2rtr(struct mlx5_core_dev *mdev,
				     struct mlx5dr_qp *dr_qp,
				     struct dr_qp_rtr_attr *attr)
{}

static bool dr_send_allow_fl(struct mlx5dr_cmd_caps *caps)
{}

static int dr_prepare_qp_to_rts(struct mlx5dr_domain *dmn)
{}

static void dr_cq_complete(struct mlx5_core_cq *mcq,
			   struct mlx5_eqe *eqe)
{}

static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev,
				      struct mlx5_uars_page *uar,
				      size_t ncqe)
{}

static void dr_destroy_cq(struct mlx5_core_dev *mdev, struct mlx5dr_cq *cq)
{}

static int dr_create_mkey(struct mlx5_core_dev *mdev, u32 pdn, u32 *mkey)
{}

static struct mlx5dr_mr *dr_reg_mr(struct mlx5_core_dev *mdev,
				   u32 pdn, void *buf, size_t size)
{}

static void dr_dereg_mr(struct mlx5_core_dev *mdev, struct mlx5dr_mr *mr)
{}

int mlx5dr_send_ring_alloc(struct mlx5dr_domain *dmn)
{}

void mlx5dr_send_ring_free(struct mlx5dr_domain *dmn,
			   struct mlx5dr_send_ring *send_ring)
{}

int mlx5dr_send_ring_force_drain(struct mlx5dr_domain *dmn)
{}