Hello Steve, Thank you for the patch.
I think a couple of improvements can be done: 1. Function existence check – if (*dev->dev_ops->mac_addr_add) – can be taken out of the loop. We don't need to check it on each iteration. 2. I'm not completely sure, but I think loop can be started from 1, not from 0, because mac_pool_sel[0] is always zero. Am I right? Best regards, Igor On Thu, Jan 19, 2017 at 10:35 PM, Steve Shin (jonshin) <jons...@cisco.com> wrote: > Dear maintainer, > > Sorry that I forgot to add “Fixes:” line as follows: > > Fixes: 4bdefaade6d1 ("ethdev: VMDQ enhancements") > > Can you please add the above line as part of comment? > > Thanks, > Steve > > On 1/19/17, 10:47 AM, "Steve Shin (jonshin)" <jons...@cisco.com> wrote: > > This patch fixes a bug in replaying MAC address to the hardware > in rte_eth_dev_config_restore() routine. > > Signed-off-by: Steve Shin <jons...@cisco.com> > --- > lib/librte_ether/rte_ethdev.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/lib/librte_ether/rte_ethdev.c > b/lib/librte_ether/rte_ethdev.c > index 4790faf..7e01f10 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -951,10 +951,12 @@ rte_eth_dev_config_restore(uint8_t port_id) > continue; > > /* add address to the hardware */ > - if (*dev->dev_ops->mac_addr_add && > - (dev->data->mac_pool_sel[i] & (1ULL << pool))) > - (*dev->dev_ops->mac_addr_add)(dev, &addr, i, > pool); > - else { > + if (*dev->dev_ops->mac_addr_add) { > + if (dev->data->mac_pool_sel[i] & (1ULL << pool)) > + (*dev->dev_ops->mac_addr_add)(dev, &addr, > i, pool); > + else > + continue; > + } else { > RTE_PMD_DEBUG_TRACE("port %d: MAC address array > not supported\n", > port_id); > /* exit the loop but not return an error */ > -- > 2.9.3 > > > >