From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Brandeburg Date: Mon, 31 Aug 2015 10:54:52 -0700 Subject: [Intel-wired-lan] [next PATCH S13 11/15] i40evf: use capabilities flags properly In-Reply-To: <1440798961-17326-12-git-send-email-catherine.sullivan@intel.com> References: <1440798961-17326-1-git-send-email-catherine.sullivan@intel.com> <1440798961-17326-12-git-send-email-catherine.sullivan@intel.com> Message-ID: <20150831105452.00006230@unknown> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: intel-wired-lan@osuosl.org List-ID: On Fri, 28 Aug 2015 17:55:57 -0400 Catherine Sullivan wrote: > From: Mitch Williams > > Use the capabilities passed to us by the PF driver to control VF driver > behavior. In the process, clean up the VLAN add/remove code so it's not > a horrible morass of ifdefs. In this case I think the description should read: Use the capabilities passed to us by the PF driver to control VF driver behavior. And drop the second sentence as it doesn't make sense. > > Signed-off-by: Mitch Williams > Change-ID: I1050eaf12b658a26fea6813047c9964163c70a73 > --- > drivers/net/ethernet/intel/i40evf/i40evf_main.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c > index 53ecc09..4eff523 100644 > --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c > +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c > @@ -730,6 +730,8 @@ static int i40evf_vlan_rx_add_vid(struct net_device *netdev, > { > struct i40evf_adapter *adapter = netdev_priv(netdev); > > + if (!VLAN_ALLOWED(adapter)) > + return -EIO; > if (i40evf_add_vlan(adapter, vid) == NULL) > return -ENOMEM; > return 0; > @@ -745,8 +747,11 @@ static int i40evf_vlan_rx_kill_vid(struct net_device *netdev, > { > struct i40evf_adapter *adapter = netdev_priv(netdev); > > - i40evf_del_vlan(adapter, vid); > - return 0; > + if (VLAN_ALLOWED(adapter)) { > + i40evf_del_vlan(adapter, vid); > + return 0; > + } > + return -EIO; > } > > /**