>-----Original Message----- >From: Andrzej Ostruszka [C] <[email protected]> >Sent: Monday, April 27, 2020 3:06 PM >To: Sunil Kumar Kori <[email protected]>; Pavan Nikhilesh Bhagavatula ><[email protected]>; Jerin Jacob Kollanukkaran ><[email protected]>; [email protected]; John McNamara ><[email protected]>; Marko Kovacevic ><[email protected]>; Ori Kam <[email protected]>; Bruce >Richardson <[email protected]>; Radu Nicolau ><[email protected]>; Akhil Goyal <[email protected]>; Tomasz >Kantecki <[email protected]> >Cc: [email protected]; Vamsi Krishna Attunuru <[email protected]> >Subject: Re: [dpdk-dev] [PATCH v3] examples/l2fwd: add cmdline option for >forwarding port info > >On 27/04/2020 11:19, Sunil Kumar Kori wrote: >>> -----Original Message----- >>> From: [email protected] <[email protected]> >[...] >>> @@ -67,6 +68,15 @@ static uint32_t l2fwd_enabled_port_mask = 0; >>> /* list of enabled ports */ >>> static uint32_t l2fwd_dst_ports[RTE_MAX_ETHPORTS]; >>> >>> +struct port_pair_params { >>> +#define NUM_PORTS 2 >>> + uint16_t port[NUM_PORTS]; >>> +} __rte_cache_aligned; >> >> Is there any specific reason to use this syntax to declare two ports >> instead of following struct port_pair_params { >> uint16_t port1; >> uint16_t port2; >> }; > >Initially it was so, but I made a comment that this leads to code duplication >in >check_port_pair_config() (same checks for port1 and port2 >- now handled via loop). I still stand by this comment :) > Okay, I think having for two variables only is not a big deal. if it is some higher number then it look fine. IMO, it is more readable when using suggested way. You can take on this.
>With regards >Andrzej Ostruszka

