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

McDaniel, Timothy timothy.mcdaniel at intel.com
Thu Oct 29 17:10:10 CET 2020



> -----Original Message-----
> From: Stephen Hemminger <stephen at networkplumber.org>
> Sent: Thursday, October 29, 2020 10:31 AM
> To: McDaniel, Timothy <timothy.mcdaniel at intel.com>
> Cc: dev at dpdk.org; Carrillo, Erik G <Erik.G.Carrillo at intel.com>; Eads, Gage
> <gage.eads at intel.com>; Van Haaren, Harry <harry.van.haaren at intel.com>;
> jerinj at marvell.com; thomas at monjalon.net
> Subject: Re: [dpdk-dev] [PATCH v4 03/23] event/dlb2: add private data
> structures and constants
> 
> 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?

These structure members should never go negative.  I believe that I could change them to
unsigned if required, but I don't think it really matters for these.



More information about the dev mailing list