[dpdk-dev] [PATCH v4 03/23] event/dlb2: add private data structures and constants

Stephen Hemminger stephen at networkplumber.org
Thu Oct 29 16:30:43 CET 2020


On Thu, 29 Oct 2020 10:24:57 -0500
Timothy McDaniel <timothy.mcdaniel at intel.com> wrote:

> +struct dlb2_port {
> +	uint32_t id;
> +	bool is_directed;
> +	bool gen_bit;
> +	uint16_t dir_credits;
> +	uint32_t dequeue_depth;
> +	union dlb2_port_config cfg;
> +	uint32_t *credit_pool[DLB2_NUM_QUEUE_TYPES]; /* use __atomic builtins */
> +	uint16_t cached_ldb_credits;
> +	uint16_t ldb_credits;
> +	uint16_t cached_dir_credits;
> +	bool int_armed;
> +	uint16_t owed_tokens;
> +	int16_t issued_releases;
> +	int cq_depth;
> +	uint16_t cq_idx;
> +	uint16_t cq_idx_unmasked;
> +	uint16_t cq_depth_mask;
> +	uint16_t gen_bit_shift;
> +	enum dlb2_port_state state;
> +	enum dlb2_configuration_state config_state;
> +	int num_mapped_qids;
> +	uint8_t *qid_mappings;
> +	struct dlb2_enqueue_qe *qe4; /* Cache line's worth of QEs (4) */
> +	struct dlb2_enqueue_qe *int_arm_qe;
> +	struct dlb2_cq_pop_qe *consume_qe;
> +	struct dlb2_eventdev *dlb2; /* back ptr */
> +	struct dlb2_eventdev_port *ev_port; /* back ptr */
> +};

Is there any case where these int values could be negative?
Would you be better off using unsigned types?


More information about the dev mailing list