[dpdk-dev] [dpdk-stable] [PATCH v1] net/mlx4: fix single port configuration

Shahaf Shuler shahafs at mellanox.com
Sun Jan 28 08:22:31 CET 2018


Friday, January 26, 2018 6:44 PM,  Adrien Mazarguil:
> Hi Ophir,
> 
> On Tue, Jan 23, 2018 at 11:32:47PM +0000, Ophir Munk wrote:
> > The number of mlx4 present ports is calculated as follows:
> > conf.ports.present |= (UINT64_C(1) << device_attr.phys_port_cnt) - 1;
> >
> > That is - all ones sequence (due to -1 subtraction) When retrieving
> > the number of ports, 1 must be added in order to obtain the correct
> > number of ports to the power of 2, as follows:
> > uint32_t ports = rte_log2_u32(conf->ports.present + 1); If 1 was not
> > added, in the case of one port, the number of ports would be falsely
> > calculated as 0.
> >
> > Fixes: 82642799 ("net/mlx4: check max number of ports dynamically")
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: Ophir Munk <ophirmu at mellanox.com>
> 
> I was too busy to reply earlier, thanks for taking care of this issue.
> 
> Acked-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>

Applied to next-net-mlx, thanks. 

> 
> --
> Adrien Mazarguil
> 6WIND


More information about the dev mailing list