All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Creeley, Brett" <brett.creeley@intel.com>
To: "Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"davem@davemloft.net" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"nhorman@redhat.com" <nhorman@redhat.com>,
	"sassmann@redhat.com" <sassmann@redhat.com>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	"Bowers, AndrewX" <andrewx.bowers@intel.com>
Subject: RE: [net-next 11/15] ice: Allow all VLANs in safe mode
Date: Wed, 29 Jul 2020 16:31:22 +0000	[thread overview]
Message-ID: <BYAPR11MB317440BB64EA1D3289B66EA6F5700@BYAPR11MB3174.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200729162405.1596435-12-anthony.l.nguyen@intel.com>

ACK.

Thanks,

Brett

> -----Original Message-----
> From: Nguyen, Anthony L <anthony.l.nguyen@intel.com>
> Sent: Wednesday, July 29, 2020 9:24 AM
> To: davem@davemloft.net
> Cc: Creeley, Brett <brett.creeley@intel.com>; netdev@vger.kernel.org; nhorman@redhat.com; sassmann@redhat.com; Kirsher,
> Jeffrey T <jeffrey.t.kirsher@intel.com>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Bowers, AndrewX
> <andrewx.bowers@intel.com>
> Subject: [net-next 11/15] ice: Allow all VLANs in safe mode
> 
> From: Brett Creeley <brett.creeley@intel.com>
> 
> Currently the PF VSI's context parameters are left in a bad state when
> going into safe mode. This is causing VLAN traffic to not pass. Fix this
> by configuring the PF VSI to allow all VLAN tagged traffic.
> 
> Also, remove redundant comment explaining the safe mode flow in
> ice_probe().
> 
> Signed-off-by: Brett Creeley <brett.creeley@intel.com>
> Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_main.c | 59 ++++++++++++++++++++++-
>  1 file changed, 57 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index 9b9e30a7d690..a68371fc0a75 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -3583,6 +3583,60 @@ int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx)
>  	return err;
>  }
> 
> +/**
> + * ice_set_safe_mode_vlan_cfg - configure PF VSI to allow all VLANs in safe mode
> + * @pf: PF to configure
> + *
> + * No VLAN offloads/filtering are advertised in safe mode so make sure the PF
> + * VSI can still Tx/Rx VLAN tagged packets.
> + */
> +static void ice_set_safe_mode_vlan_cfg(struct ice_pf *pf)
> +{
> +	struct ice_vsi *vsi = ice_get_main_vsi(pf);
> +	struct ice_vsi_ctx *ctxt;
> +	enum ice_status status;
> +	struct ice_hw *hw;
> +
> +	if (!vsi)
> +		return;
> +
> +	ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);
> +	if (!ctxt)
> +		return;
> +
> +	hw = &pf->hw;
> +	ctxt->info = vsi->info;
> +
> +	ctxt->info.valid_sections =
> +		cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID |
> +			    ICE_AQ_VSI_PROP_SECURITY_VALID |
> +			    ICE_AQ_VSI_PROP_SW_VALID);
> +
> +	/* disable VLAN anti-spoof */
> +	ctxt->info.sec_flags &= ~(ICE_AQ_VSI_SEC_TX_VLAN_PRUNE_ENA <<
> +				  ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S);
> +
> +	/* disable VLAN pruning and keep all other settings */
> +	ctxt->info.sw_flags2 &= ~ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA;
> +
> +	/* allow all VLANs on Tx and don't strip on Rx */
> +	ctxt->info.vlan_flags = ICE_AQ_VSI_VLAN_MODE_ALL |
> +		ICE_AQ_VSI_VLAN_EMOD_NOTHING;
> +
> +	status = ice_update_vsi(hw, vsi->idx, ctxt, NULL);
> +	if (status) {
> +		dev_err(ice_pf_to_dev(vsi->back), "Failed to update VSI for safe mode VLANs, err %s aq_err %s\n",
> +			ice_stat_str(status),
> +			ice_aq_str(hw->adminq.sq_last_status));
> +	} else {
> +		vsi->info.sec_flags = ctxt->info.sec_flags;
> +		vsi->info.sw_flags2 = ctxt->info.sw_flags2;
> +		vsi->info.vlan_flags = ctxt->info.vlan_flags;
> +	}
> +
> +	kfree(ctxt);
> +}
> +
>  /**
>   * ice_log_pkg_init - log result of DDP package load
>   * @hw: pointer to hardware info
> @@ -4139,9 +4193,10 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
>  	/* Disable WoL at init, wait for user to enable */
>  	device_set_wakeup_enable(dev, false);
> 
> -	/* If no DDP driven features have to be setup, we are done with probe */
> -	if (ice_is_safe_mode(pf))
> +	if (ice_is_safe_mode(pf)) {
> +		ice_set_safe_mode_vlan_cfg(pf);
>  		goto probe_done;
> +	}
> 
>  	/* initialize DDP driven features */
> 
> --
> 2.26.2


  reply	other threads:[~2020-07-29 16:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 16:23 [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2020-07-29 Tony Nguyen
2020-07-29 16:23 ` [net-next 01/15] ice: Implement LFC workaround Tony Nguyen
2020-07-29 16:23 ` [net-next 02/15] ice: Fix link broken after GLOBR reset Tony Nguyen
2020-07-29 16:23 ` [net-next 03/15] ice: fix link event handling timing Tony Nguyen
2020-07-29 16:23 ` [net-next 04/15] ice: restore VF MSI-X state during PCI reset Tony Nguyen
2020-07-29 16:23 ` [net-next 05/15] ice: return correct error code from ice_aq_sw_rules Tony Nguyen
2020-07-29 16:26   ` Patil, Kiran
2020-07-29 16:23 ` [net-next 06/15] ice: fix overwriting TX/RX descriptor values when rebuilding VSI Tony Nguyen
2020-07-29 16:23 ` [net-next 07/15] ice: Add RL profile bit mask check Tony Nguyen
2020-07-29 16:23 ` [net-next 08/15] ice: Adjust scheduler default BW weight Tony Nguyen
2020-07-29 16:23 ` [net-next 09/15] ice: distribute Tx queues evenly Tony Nguyen
2020-07-29 16:24 ` [net-next 10/15] ice: need_wakeup flag might not be set for Tx Tony Nguyen
2020-07-29 16:24 ` [net-next 11/15] ice: Allow all VLANs in safe mode Tony Nguyen
2020-07-29 16:31   ` Creeley, Brett [this message]
2020-07-29 16:24 ` [net-next 12/15] ice: cleanup VSI on probe fail Tony Nguyen
2020-07-29 16:24 ` [net-next 13/15] ice: reduce scope of variable Tony Nguyen
2020-07-29 16:24 ` [net-next 14/15] ice: disable no longer needed workaround for FW logging Tony Nguyen
2020-07-29 16:24 ` [net-next 15/15] ice: fix unused parameter warning Tony Nguyen
2020-07-29 20:15 ` [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2020-07-29 David Miller

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=BYAPR11MB317440BB64EA1D3289B66EA6F5700@BYAPR11MB3174.namprd11.prod.outlook.com \
    --to=brett.creeley@intel.com \
    --cc=andrewx.bowers@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.