/**
* chain_busy - check if the chain is still processing last requests
* @chain: chain to check
- **/
+ */
static int chain_busy(struct hinic_api_cmd_chain *chain)
{
switch (chain->chain_type) {
/**
* get_cell_data_size - get the data size of specific cell type
* @type: chain type
- **/
+ */
static u16 get_cell_data_size(enum hinic_api_cmd_chain_type type,
__rte_unused u16 cmd_size)
{
* prepare_cell_ctrl - prepare the ctrl of the cell for the command
* @cell_ctrl: the control of the cell to set the control into it
* @cell_len: the size of the cell
- **/
+ */
static void prepare_cell_ctrl(u64 *cell_ctrl, u16 cell_len)
{
u64 ctrl;
* @dest: destination node on the card that will receive the command
* @cmd: command data
* @cmd_size: the command size
- **/
+ */
static void prepare_api_cmd(struct hinic_api_cmd_chain *chain,
struct hinic_api_cmd_cell *cell,
enum hinic_node_id dest,
* @dest: destination node on the card that will receive the command
* @cmd: command data
* @cmd_size: the command size
- **/
+ */
static void prepare_cell(struct hinic_api_cmd_chain *chain,
enum hinic_node_id dest,
void *cmd, u16 cmd_size)
/**
* api_cmd_status_update - update the status of the chain
* @chain: chain to update
- **/
+ */
static void api_cmd_status_update(struct hinic_api_cmd_chain *chain)
{
struct hinic_api_cmd_status *wb_status;
* wait_for_status_poll - wait for write to mgmt command to complete
* @chain: the chain of the command
* Return: 0 - success, negative - failure
- **/
+ */
static int wait_for_status_poll(struct hinic_api_cmd_chain *chain)
{
unsigned long end;
* wait_for_api_cmd_completion - wait for command to complete
* @chain: chain for the command
* Return: 0 - success, negative - failure
- **/
+ */
static int wait_for_api_cmd_completion(struct hinic_api_cmd_chain *chain,
__rte_unused struct hinic_api_cmd_cell_ctxt *ctxt,
__rte_unused void *ack, __rte_unused u16 ack_size)
* @ack: pointer to messages to response
* @ack_size: the size of ack message
* Return: 0 - success, negative - failure
- **/
+ */
static int api_cmd(struct hinic_api_cmd_chain *chain,
enum hinic_node_id dest,
void *cmd, u16 cmd_size, void *ack, u16 ack_size)
* @cmd: command data
* @size: the command size
* Return: 0 - success, negative - failure
- **/
+ */
int hinic_api_cmd_write(struct hinic_api_cmd_chain *chain,
enum hinic_node_id dest, void *cmd, u16 size)
{
/**
* api_cmd_hw_restart - restart the chain in the HW
* @chain: the API CMD specific chain to restart
- **/
+ */
static int api_cmd_hw_restart(struct hinic_api_cmd_chain *chain)
{
struct hinic_hwif *hwif = chain->hwdev->hwif;
/**
* api_cmd_ctrl_init - set the control register of a chain
* @chain: the API CMD specific chain to set control register for
- **/
+ */
static void api_cmd_ctrl_init(struct hinic_api_cmd_chain *chain)
{
struct hinic_hwif *hwif = chain->hwdev->hwif;
/**
* api_cmd_set_status_addr - set the status address of a chain in the HW
* @chain: the API CMD specific chain to set status address for
- **/
+ */
static void api_cmd_set_status_addr(struct hinic_api_cmd_chain *chain)
{
struct hinic_hwif *hwif = chain->hwdev->hwif;
/**
* api_cmd_set_num_cells - set the number cells of a chain in the HW
* @chain: the API CMD specific chain to set the number of cells for
- **/
+ */
static void api_cmd_set_num_cells(struct hinic_api_cmd_chain *chain)
{
struct hinic_hwif *hwif = chain->hwdev->hwif;
/**
* api_cmd_head_init - set the head cell of a chain in the HW
* @chain: the API CMD specific chain to set the head for
- **/
+ */
static void api_cmd_head_init(struct hinic_api_cmd_chain *chain)
{
struct hinic_hwif *hwif = chain->hwdev->hwif;
* wait_for_ready_chain - wait for the chain to be ready
* @chain: the API CMD specific chain to wait for
* Return: 0 - success, negative - failure
- **/
+ */
static int wait_for_ready_chain(struct hinic_api_cmd_chain *chain)
{
struct hinic_hwif *hwif = chain->hwdev->hwif;
/**
* api_cmd_chain_hw_clean - clean the HW
* @chain: the API CMD specific chain
- **/
+ */
static void api_cmd_chain_hw_clean(struct hinic_api_cmd_chain *chain)
{
struct hinic_hwif *hwif = chain->hwdev->hwif;
*(initialize API command csr)
* @chain: the API CMD specific chain to initialize in HW
* Return: 0 - success, negative - failure
- **/
+ */
static int api_cmd_chain_hw_init(struct hinic_api_cmd_chain *chain)
{
api_cmd_chain_hw_clean(chain);
* free_cmd_buf - free the dma buffer of API CMD command
* @chain: the API CMD specific chain of the cmd
* @cell_idx: the cell index of the cmd
- **/
+ */
static void free_cmd_buf(struct hinic_api_cmd_chain *chain, u32 cell_idx)
{
struct hinic_api_cmd_cell_ctxt *cell_ctxt;
* @cell: the cell in the HW for the cmd
* @cell_idx: the index of the cell
* Return: 0 - success, negative - failure
- **/
+ */
static int alloc_cmd_buf(struct hinic_api_cmd_chain *chain,
struct hinic_api_cmd_cell *cell, u32 cell_idx)
{
cmd_vaddr_alloc = dma_zalloc_coherent(dev, (API_CMD_BUF_SIZE +
API_PAYLOAD_ALIGN_SIZE),
- &cmd_paddr, GFP_KERNEL);
+ &cmd_paddr, SOCKET_ID_ANY);
if (!cmd_vaddr_alloc) {
PMD_DRV_LOG(ERR, "Allocate API CMD dma memory failed");
return -ENOMEM;
* @pre_node: previous cell
* @node_vaddr: the virt addr of the cell
* Return: 0 - success, negative - failure
- **/
+ */
static int api_cmd_create_cell(struct hinic_api_cmd_chain *chain,
u32 cell_idx,
struct hinic_api_cmd_cell *pre_node,
node_vaddr_alloc = dma_zalloc_coherent(dev, (chain->cell_size +
API_CMD_NODE_ALIGN_SIZE),
- &node_paddr, GFP_KERNEL);
+ &node_paddr, SOCKET_ID_ANY);
if (!node_vaddr_alloc) {
PMD_DRV_LOG(ERR, "Allocate dma API CMD cell failed");
return -ENOMEM;
* api_cmd_destroy_cell - destroy API CMD cell of specific chain
* @chain: the API CMD specific chain to destroy its cell
* @cell_idx: the cell to destroy
- **/
+ */
static void api_cmd_destroy_cell(struct hinic_api_cmd_chain *chain,
u32 cell_idx)
{
* api_cmd_destroy_cells - destroy API CMD cells of specific chain
* @chain: the API CMD specific chain to destroy its cells
* @num_cells: number of cells to destroy
- **/
+ */
static void api_cmd_destroy_cells(struct hinic_api_cmd_chain *chain,
u32 num_cells)
{
* api_cmd_create_cells - create API CMD cells for specific chain
* @chain: the API CMD specific chain
* Return: 0 - success, negative - failure
- **/
+ */
static int api_cmd_create_cells(struct hinic_api_cmd_chain *chain)
{
struct hinic_api_cmd_cell *node = NULL, *pre_node = NULL;
* @chain: the API CMD specific chain to initialize
* @attr: attributes to set in the chain
* Return: 0 - success, negative - failure
- **/
+ */
static int api_chain_init(struct hinic_api_cmd_chain *chain,
struct hinic_api_cmd_chain_attr *attr)
{
chain->wb_status = (struct hinic_api_cmd_status *)
dma_zalloc_coherent(dev, sizeof(*chain->wb_status),
- &chain->wb_status_paddr,
- GFP_KERNEL);
+ &chain->wb_status_paddr, SOCKET_ID_ANY);
if (!chain->wb_status) {
PMD_DRV_LOG(ERR, "Allocate DMA wb status failed");
err = -ENOMEM;
/**
* api_chain_free - free API CMD specific chain
* @chain: the API CMD specific chain to free
- **/
+ */
static void api_chain_free(struct hinic_api_cmd_chain *chain)
{
void *dev = chain->hwdev;
* @cmd_chain: the API CMD specific chain to create
* @attr: attributes to set in the chain
* Return: 0 - success, negative - failure
- **/
+ */
static int api_cmd_create_chain(struct hinic_api_cmd_chain **cmd_chain,
struct hinic_api_cmd_chain_attr *attr)
{
/**
* api_cmd_destroy_chain - destroy API CMD specific chain
* @chain: the API CMD specific chain to destroy
- **/
+ */
static void api_cmd_destroy_chain(struct hinic_api_cmd_chain *chain)
{
api_cmd_destroy_cells(chain, chain->num_cells);
* @hwdev: the hardware interface of a pci function device
* @chain: the API CMD chains that will be initialized
* Return: 0 - success, negative - failure
- **/
+ */
int hinic_api_cmd_init(struct hinic_hwdev *hwdev,
struct hinic_api_cmd_chain **chain)
{
/**
* hinic_api_cmd_free - free the API CMD chains
* @chain: the API CMD chains that will be freed
- **/
+ */
void hinic_api_cmd_free(struct hinic_api_cmd_chain **chain)
{
enum hinic_api_cmd_chain_type chain_type;