[Intel-wired-lan] [next PATCH S18 3/8] i40e: Fix VEB/VEPA bridge mode mismatch issue
Nelson, Shannon
shannon.nelson at intel.com
Thu Oct 1 21:40:29 UTC 2015
> > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c
> > > b/drivers/net/ethernet/intel/i40e/i40e_main.c
> > > index d341f56..a56aefe 100644
> > > --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> > > +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> > > @@ -8758,12 +8758,22 @@ int i40e_is_vsi_uplink_mode_veb(struct
> > > i40e_vsi
> > > *vsi)
> > > return 1;
> > >
> > > veb = pf->veb[vsi->veb_idx];
> > > + if (!veb) {
> > > + dev_info(&pf->pdev->dev,
> > > + "There is no veb associated with the bridge\n");
> > > + return -ENOENT;
> > > + }
> > > +
> >
> > This introduces a subtle bug into the code - the caller of
> > i40e_is_vsi_uplink_mode_veb() is looking for 0/non-0, not looking for an
> > error condition.
> >
> > sln
>
> So, we need to make sure that caller knows how to handle instance of non-
> existence of VEB or we are guaranteed there is always going to be VEB,
> then we can just forget checking for error? Please, let me know...
>
> Thanks,
> ~Akeem
Since it's already returning 1 in the veb_idx==NO_VEB case, I suppose you can use similar reasoning to return 1 in the !veb case. I would think that neither case should actually ever get hit.
sln
More information about the Intel-wired-lan
mailing list