All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Wagner <dwagner@suse.de>
To: James Smart <jsmart2021@gmail.com>
Cc: linux-scsi@vger.kernel.org, Ram Vegesna <ram.vegesna@broadcom.com>
Subject: Re: [PATCH v6 20/31] elx: efct: RQ buffer, memory pool allocation and deallocation APIs
Date: Thu, 7 Jan 2021 10:06:58 +0100	[thread overview]
Message-ID: <20210107090658.xtbj5uqqmp3b2hf7@beryllium.lan> (raw)
In-Reply-To: <20210107005030.2929-21-jsmart2021@gmail.com>

On Wed, Jan 06, 2021 at 04:50:19PM -0800, James Smart wrote:
> +static int
> +efct_hw_cmd_submit_pending(struct efct_hw *hw)
> +{
> +	struct efct_command_ctx *ctx = NULL;
> +	int rc = 0;
> +
> +	/* Assumes lock held */
> +
> +	/* Only submit MQE if there's room */
> +	while (hw->cmd_head_count < (EFCT_HW_MQ_DEPTH - 1) &&
> +	       !list_empty(&hw->cmd_pending)) {
> +		ctx = list_first_entry(&hw->cmd_pending,
> +				       struct efct_command_ctx, list_entry);
> +		if (!ctx)
> +			break;
> +
> +		list_del_init(&ctx->list_entry);
> +
> +		list_add_tail(&ctx->list_entry, &hw->cmd_head);
> +		hw->cmd_head_count++;
> +		if (sli_mq_write(&hw->sli, hw->mq, ctx->buf) < 0) {
> +			efc_log_debug(hw->os,
> +				      "sli_queue_write failed: %d\n", rc);
> +			rc = -1;

EFC_FAIL?

> +			break;
> +		}
> +	}
> +	return rc;
> +}

> +int
> +efct_issue_mbox_rqst(void *base, void *cmd, void *cb, void *arg)
> +{
> +	int rc = 0;
> +	struct efct_mbox_rqst_ctx *ctx;
> +	struct efct *efct = base;
> +	struct efct_hw *hw = &efct->hw;
> +
> +	/*
> +	 * Allocate a callback context (which includes the mbox cmd buffer),
> +	 * we need this to be persistent as the mbox cmd submission may be
> +	 * queued and executed later execution.
> +	 */
> +	ctx = mempool_alloc(hw->mbox_rqst_pool, GFP_ATOMIC);
> +	if (!ctx)
> +		return EFC_FAIL;
> +
> +	ctx->callback = cb;
> +	ctx->arg = arg;
> +
> +	if (efct_hw_command(hw, cmd, EFCT_CMD_NOWAIT, efct_mbox_rsp_cb, ctx)) {
> +		efc_log_err(efct, "issue mbox rqst failure\n");
> +		mempool_free(ctx, hw->mbox_rqst_pool);
> +		rc = -1;

EFC_FAIL?

> +	}
> +	return rc;
> +}

  reply	other threads:[~2021-01-07  9:08 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07  0:49 [PATCH v6 00/31] [NEW] efct: Broadcom (Emulex) FC Target driver James Smart
2021-01-07  0:50 ` [PATCH v6 01/31] elx: libefc_sli: SLI-4 register offsets and field definitions James Smart
2021-01-07  0:50 ` [PATCH v6 02/31] elx: libefc_sli: SLI Descriptors and Queue entries James Smart
2021-01-07  0:50 ` [PATCH v6 03/31] elx: libefc_sli: Data structures and defines for mbox commands James Smart
2021-01-07  0:50 ` [PATCH v6 04/31] elx: libefc_sli: queue create/destroy/parse routines James Smart
2021-01-07  8:50   ` Daniel Wagner
2021-01-07  0:50 ` [PATCH v6 05/31] elx: libefc_sli: Populate and post different WQEs James Smart
2021-01-07  0:50 ` [PATCH v6 06/31] elx: libefc_sli: bmbx routines and SLI config commands James Smart
2021-01-07  0:50 ` [PATCH v6 07/31] elx: libefc_sli: APIs to setup SLI library James Smart
2021-01-07  0:50 ` [PATCH v6 08/31] elx: libefc: Generic state machine framework James Smart
2021-01-07  0:50 ` [PATCH v6 09/31] elx: libefc: Emulex FC discovery library APIs and definitions James Smart
2021-01-07  0:50 ` [PATCH v6 10/31] elx: libefc: FC Domain state machine interfaces James Smart
2021-01-07  0:50 ` [PATCH v6 11/31] elx: libefc: SLI and FC PORT " James Smart
2021-01-07  0:50 ` [PATCH v6 12/31] elx: libefc: Remote node " James Smart
2021-01-07  0:50 ` [PATCH v6 13/31] elx: libefc: Fabric " James Smart
2021-01-07  0:50 ` [PATCH v6 14/31] elx: libefc: FC node ELS and state handling James Smart
2021-01-07  0:50 ` [PATCH v6 15/31] elx: libefc: Extended link Service IO handling James Smart
2021-01-07  8:53   ` Daniel Wagner
2021-01-07  0:50 ` [PATCH v6 16/31] elx: libefc: Register discovery objects with hardware James Smart
2021-01-07  0:50 ` [PATCH v6 17/31] elx: efct: Data structures and defines for hw operations James Smart
2021-01-07  0:50 ` [PATCH v6 18/31] elx: efct: Driver initialization routines James Smart
2021-01-07  0:50 ` [PATCH v6 19/31] elx: efct: Hardware queues creation and deletion James Smart
2021-01-07  9:04   ` Daniel Wagner
2021-01-07  0:50 ` [PATCH v6 20/31] elx: efct: RQ buffer, memory pool allocation and deallocation APIs James Smart
2021-01-07  9:06   ` Daniel Wagner [this message]
2021-01-07  0:50 ` [PATCH v6 21/31] elx: efct: Hardware IO and SGL initialization James Smart
2021-01-07  9:09   ` Daniel Wagner
2021-01-07  0:50 ` [PATCH v6 22/31] elx: efct: Hardware queues processing James Smart
2021-01-07  9:11   ` Daniel Wagner
2021-01-07  0:50 ` [PATCH v6 23/31] elx: efct: Unsolicited FC frame processing routines James Smart
2021-01-07  0:50 ` [PATCH v6 24/31] elx: efct: SCSI IO handling routines James Smart
2021-01-07  0:50 ` [PATCH v6 25/31] elx: efct: LIO backend interface routines James Smart
2021-01-07  0:50 ` [PATCH v6 26/31] elx: efct: Hardware IO submission routines James Smart
2021-01-07  0:50 ` [PATCH v6 27/31] elx: efct: link and host statistics James Smart
2021-01-07  0:50 ` [PATCH v6 28/31] elx: efct: xport and hardware teardown routines James Smart
2021-01-07  0:50 ` [PATCH v6 29/31] elx: efct: scsi_transport_fc host interface support James Smart
2021-01-07  0:50 ` [PATCH v6 30/31] elx: efct: Add Makefile and Kconfig for efct driver James Smart
2021-01-07  0:50 ` [PATCH v6 31/31] elx: efct: Tie into kernel Kconfig and build process James Smart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210107090658.xtbj5uqqmp3b2hf7@beryllium.lan \
    --to=dwagner@suse.de \
    --cc=jsmart2021@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ram.vegesna@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.