Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Shannon Nelson <shannon.nelson@oracle.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [next PATCH S87 V2 2/7] i40e: rename i40e_vlan_rx_register to i40e_setup_vlan_stripping
Date: Mon, 26 Feb 2018 09:51:36 -0800	[thread overview]
Message-ID: <6c3ac127-22fd-5de7-c36f-e1857f3f4812@oracle.com> (raw)
In-Reply-To: <20180226083311.52442-2-alice.michael@intel.com>

On 2/26/2018 12:33 AM, Alice Michael wrote:
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> We used to use the function i40e_vlan_rx_register as a way to hook
> into the now defunct .ndo_vlan_rx_register netdev hook. This was
> removed but we kept the function around because we still used it
> internally to control enabling or disabling of VLAN stripping.
> 
> Simplify this function and make its intent clear. Pass the *vsi
> pointer directly instead of the netdev pointer. Additionally, move
> it closer to the point where it is called in the file.
> 
> This helps clarify the functions use and purpose, and makes the
> code a bit easier to understand.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>   drivers/net/ethernet/intel/i40e/i40e_main.c | 31 +++++++++++++----------------
>   1 file changed, 14 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index d188ff1..9ad80d2 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -2720,22 +2720,6 @@ void i40e_vlan_stripping_disable(struct i40e_vsi *vsi)
>   }
>   
>   /**
> - * i40e_vlan_rx_register - Setup or shutdown vlan offload
> - * @netdev: network interface to be adjusted
> - * @features: netdev features to test if VLAN offload is enabled or not
> - **/
> -static void i40e_vlan_rx_register(struct net_device *netdev, u32 features)
> -{
> -	struct i40e_netdev_priv *np = netdev_priv(netdev);
> -	struct i40e_vsi *vsi = np->vsi;
> -
> -	if (features & NETIF_F_HW_VLAN_CTAG_RX)
> -		i40e_vlan_stripping_enable(vsi);
> -	else
> -		i40e_vlan_stripping_disable(vsi);
> -}
> -
> -/**
>    * i40e_add_vlan_all_mac - Add a MAC/VLAN filter for each existing MAC address
>    * @vsi: the vsi being configured
>    * @vid: vlan id to be added (0 = untagged only , -1 = any)
> @@ -2900,6 +2884,19 @@ static int i40e_vlan_rx_kill_vid(struct net_device *netdev,
>   }
>   
>   /**
> + * i40e_setup_vlan_stripping - Enable or disable VLAN stripping
> + * @vsi: the vsi being configured
> + * @features: netdevice feature flags
> + **/
> +static void i40e_setup_vlan_stripping(struct i40e_vsi *vsi, u32 features)
> +{
> +	if (features & NETIF_F_HW_VLAN_CTAG_RX)
> +		i40e_vlan_stripping_enable(vsi);
> +	else
> +		i40e_vlan_stripping_disable(vsi);
> +}
> +
> +/**
>    * i40e_restore_vlan - Reinstate vlans when vsi/netdev comes back up
>    * @vsi: the vsi being brought back up
>    **/
> @@ -2910,7 +2907,7 @@ static void i40e_restore_vlan(struct i40e_vsi *vsi)
>   	if (!vsi->netdev)
>   		return;
>   
> -	i40e_vlan_rx_register(vsi->netdev, vsi->netdev->features);
> +	i40e_setup_vlan_stripping(vsi, vsi->netdev->features);

If this is the only place from which it is called, why even bother with 
a function?

sln

>   
>   	for_each_set_bit(vid, vsi->active_vlans, VLAN_N_VID)
>   		i40e_vlan_rx_add_vid(vsi->netdev, htons(ETH_P_8021Q),
> 

  reply	other threads:[~2018-02-26 17:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26  8:33 [Intel-wired-lan] [next PATCH S87 V2 1/7] i40e: Fix attach VF to VM issue Alice Michael
2018-02-26  8:33 ` [Intel-wired-lan] [next PATCH S87 V2 2/7] i40e: rename i40e_vlan_rx_register to i40e_setup_vlan_stripping Alice Michael
2018-02-26 17:51   ` Shannon Nelson [this message]
2018-02-26 18:15     ` Keller, Jacob E
2018-02-26  8:33 ` [Intel-wired-lan] [next PATCH S87 V2 3/7] i40e: Fix permission check for VF MAC filters Alice Michael
2018-02-26 17:51   ` Shannon Nelson
2018-02-26  8:33 ` [Intel-wired-lan] [next PATCH S87 V2 4/7] i40e: track filter type statistics when deleting invalid filters Alice Michael
2018-02-26  8:33 ` [Intel-wired-lan] [next PATCH S87 V2 5/7] i40e: factor out re-enable functions for ATR and SB Alice Michael
2018-02-26  8:33 ` [Intel-wired-lan] [next PATCH S87 V2 6/7] i40e: fix for wrong partition id calculation on OCP mezz cards Alice Michael
2018-02-26  8:33 ` [Intel-wired-lan] [next PATCH S87 V2 7/7] i40e: restore TCPv4 input set when re-enabling ATR Alice Michael

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c3ac127-22fd-5de7-c36f-e1857f3f4812@oracle.com \
    --to=shannon.nelson@oracle.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox