[dpdk-dev] [PATCH v7 03/27] net/i40e: set VF MAC anti-spoofing from PF
Lu, Wenzhuo
wenzhuo.lu at intel.com
Fri Jan 6 09:54:54 CET 2017
Hi Jingjing,
> -----Original Message-----
> From: Wu, Jingjing
> Sent: Friday, January 6, 2017 8:33 AM
> To: Lu, Wenzhuo; dev at dpdk.org
> Cc: Lu, Wenzhuo
> Subject: RE: [dpdk-dev] [PATCH v7 03/27] net/i40e: set VF MAC anti-spoofing
> from PF
>
> > +
> > + vsi->info.valid_sections =
> > cpu_to_le16(I40E_AQ_VSI_PROP_SECURITY_VALID);
> > + if (on)
> > + vsi->info.sec_flags |=
> > I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK;
> > + else
> > + vsi->info.sec_flags &=
> > ~I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK;
> > +
> > + memset(&ctxt, 0, sizeof(ctxt));
> > + (void)rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
> > + ctxt.seid = vsi->seid;
> > +
> > + hw = I40E_VSI_TO_HW(vsi);
> > + ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
> > + if (ret != I40E_SUCCESS)
> > + PMD_DRV_LOG(ERR, "Failed to update VSI params");
>
> If fails, will you revert the info in vsi struct?
Will not. Just leverage the existing behavior. I think it has some good side as user should not try it again and again if not success.
>
> > +
> > + return ret;
>
> Please return eth dev lib error code, but not I40E_XXX
Yes, will change it.
More information about the dev
mailing list