/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2021 Broadcom. All Rights Reserved. The term * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
*/
#ifndef _EFCT_HW_H #define _EFCT_HW_H
#include"../libefc_sli/sli4.h"
/* * EFCT PCI IDs
*/ #define EFCT_VENDOR_ID 0x10df /* LightPulse 16Gb x 4 FC (lancer-g6) */ #define EFCT_DEVICE_LANCER_G6 0xe307 /* LightPulse 32Gb x 4 FC (lancer-g7) */ #define EFCT_DEVICE_LANCER_G7 0xf407
/*Default RQ entries len used by driver*/ #define EFCT_HW_RQ_ENTRIES_MIN 512 #define EFCT_HW_RQ_ENTRIES_DEF 1024 #define EFCT_HW_RQ_ENTRIES_MAX 4096
/*Defines the size of the RQ buffers used for each RQ*/ #define EFCT_HW_RQ_SIZE_HDR 128 #define EFCT_HW_RQ_SIZE_PAYLOAD 1024
/*Define the maximum number of multi-receive queues*/ #define EFCT_HW_MAX_MRQS 8
/* * Define count of when to set the WQEC bit in a submitted * WQE, causing a consummed/released completion to be posted.
*/ #define EFCT_HW_WQEC_SET_COUNT 32
/*Send frame timeout in seconds*/ #define EFCT_HW_SEND_FRAME_TIMEOUT 10
/* * FDT Transfer Hint value, reads greater than this value * will be segmented to implement fairness. A value of zero disables * the feature.
*/ #define EFCT_HW_FDT_XFER_HINT 8192
/* * A CQ will be assinged to each WQ * (CQ must have 2X entries of the WQ for abort * processing), plus a separate one for each RQ PAIR and one for MQ
*/ #define EFCT_HW_MAX_NUM_CQ \
((EFCT_HW_MAX_NUM_WQ * 2) + 1 + (OCE_HW_MAX_NUM_MRQ_PAIRS * 2))
/** * HW IO object. * * Stores the per-IO information necessary * for both SLI and efct. * @ref: reference counter for hw io object * @state: state of IO: free, busy, wait_free * @list_entry used for busy, wait_free, free lists * @wqe Work queue object, with link for pending * @hw pointer back to hardware context * @xfer_rdy transfer ready data * @type IO type * @xbusy Exchange is active in FW * @abort_in_progress if TRUE, abort is in progress * @status_saved if TRUE, latched status should be returned * @wq_class WQ class if steering mode is Class * @reqtag request tag for this HW IO * @wq WQ assigned to the exchange * @done Function called on IO completion * @arg argument passed to IO done callback * @abort_done Function called on abort completion * @abort_arg argument passed to abort done callback * @wq_steering WQ steering mode request * @saved_status Saved status * @saved_len Status length * @saved_ext Saved extended status * @eq EQ on which this HIO came up * @sge_offset SGE data offset * @def_sgl_count Count of SGEs in default SGL * @abort_reqtag request tag for an abort of this HW IO * @indicator Exchange indicator * @def_sgl default SGL * @sgl pointer to current active SGL * @sgl_count count of SGEs in io->sgl * @first_data_sge index of first data SGE * @n_sge number of active SGEs
*/ struct efct_hw_io { struct kref ref; enum efct_hw_io_state state; void (*release)(struct kref *arg); struct list_head list_entry; struct efct_hw_wqe wqe;
/* Sequence objects used in incoming frame processing */ struct efc_hw_sequence *seq_pool;
/* Maintain an ordered, linked list of outstanding HW commands. */ struct mutex bmbx_lock;
spinlock_t cmd_lock; struct list_head cmd_head; struct list_head cmd_pending;
mempool_t *cmd_ctx_pool;
mempool_t *mbox_rqst_pool;
struct sli4_link_event link;
/* pointer array of IO objects */ struct efct_hw_io **io; /* array of WQE buffs mapped to IO objects */
u8 *wqe_buffs;
/* IO lock to synchronize list access */
spinlock_t io_lock; /* List of IO objects in use */ struct list_head io_inuse; /* List of IO objects waiting to be freed */ struct list_head io_wait_free; /* List of IO objects available for allocation */ struct list_head io_free;
/* RQ completion handlers for RQ pair mode */ int
efct_hw_rqpair_process_rq(struct efct_hw *hw, struct hw_cq *cq, u8 *cqe); int
efct_hw_rqpair_sequence_free(struct efct_hw *hw, struct efc_hw_sequence *seq); staticinlinevoid
efct_hw_sequence_copy(struct efc_hw_sequence *dst, struct efc_hw_sequence *src)
{ /* Copy src to dst, then zero out the linked list link */
*dst = *src;
}
int
efct_efc_hw_sequence_free(struct efc *efc, struct efc_hw_sequence *seq);
staticinlineint
efct_hw_sequence_free(struct efct_hw *hw, struct efc_hw_sequence *seq)
{ /* Only RQ pair mode is supported */ return efct_hw_rqpair_sequence_free(hw, seq);
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.11Bemerkung:
(vorverarbeitet am 2026-06-07)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.