[dpdk-dev] [PATCH v3] examples/l2fwd: add cmdline option for forwarding port info

Andrzej Ostruszka [C] aostruszka at marvell.com
Mon Apr 27 11:36:06 CEST 2020


On 27/04/2020 11:19, Sunil Kumar Kori wrote:
>> -----Original Message-----
>> From: pbhagavatula at marvell.com <pbhagavatula at marvell.com>
[...]
>> @@ -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 :)

With regards
Andrzej Ostruszka


More information about the dev mailing list