On Mon, Jun 7, 2021 at 11:35 PM Nithin Dabilpuram <ndabilpu...@marvell.com> wrote: > > Add link status update callback to get current > link status. > > Signed-off-by: Nithin Dabilpuram <ndabilpu...@marvell.com> > --- > doc/guides/nics/cnxk.rst | 1 + > doc/guides/nics/features/cnxk.ini | 2 + > doc/guides/nics/features/cnxk_vec.ini | 2 + > doc/guides/nics/features/cnxk_vf.ini | 2 + > drivers/net/cnxk/cnxk_ethdev.c | 7 +++ > drivers/net/cnxk/cnxk_ethdev.h | 8 +++ > drivers/net/cnxk/cnxk_link.c | 102 > ++++++++++++++++++++++++++++++++++ > drivers/net/cnxk/meson.build | 3 +- > 8 files changed, 126 insertions(+), 1 deletion(-) > create mode 100644 drivers/net/cnxk/cnxk_link.c > > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2021 Marvell. > + */ > + > +#include "cnxk_ethdev.h" > + > +static inline int > +nix_wait_for_link_cfg(struct cnxk_eth_dev *dev) > +{ > + uint16_t wait = 1000; > + > + do { > + rte_rmb();
Please use gcc atomics instead. With above change: Reviewed-by: Jerin Jacob <jer...@marvell.com> > + if (!(dev->flags & CNXK_LINK_CFG_IN_PROGRESS_F)) > + break; > + wait--; > + rte_delay_ms(1); > + } while (wait); > + > + return wait ? 0 : -1; > +} >