> -----Original Message-----
> From: Stephen Hemminger <[email protected]>
> Sent: Thursday, October 29, 2020 10:31 AM
> To: McDaniel, Timothy <[email protected]>
> Cc: [email protected]; Carrillo, Erik G <[email protected]>; Eads, Gage
> <[email protected]>; Van Haaren, Harry <[email protected]>;
> [email protected]; [email protected]
> 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 <[email protected]> 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.

Reply via email to