> -----Original Message----- > From: Gaëtan Rivet [mailto:gaetan.ri...@6wind.com] > Sent: Friday, March 10, 2017 12:12 PM > The first solution might be interesting, however it makes this option > dependent on two defines instead of one. If one had to change the > default MAX_PHYS_PORT value for mlx4 (however unlikely it might be), > then they would have to change the valid ALL_PORTS mask as well. In > principle this contradicts DRY[1]. > > [1]: https://en.wikipedia.org/wiki/Don't_repeat_yourself
#define MLX4_PMD_MAX_PHYS_PORTS 2 #define MLX4_PMD_ALL_PHYS_PORTS ((1 << MLX4_PMD_MAX_PHYS_PORTS) - 1)