DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Rybalchenko, Kirill" <kirill.rybalchenko@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Chilikin, Andrey" <andrey.chilikin@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/i40e: do not turn on flexible payload on driver init
Date: Mon, 11 Dec 2017 06:00:19 +0000	[thread overview]
Message-ID: <94479800C636CB44BD422CB454846E013207E0DF@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1512142049-122930-1-git-send-email-kirill.rybalchenko@intel.com>

> -----Original Message-----
> From: Rybalchenko, Kirill
> Sent: Friday, December 1, 2017 11:27 PM
> To: dev@dpdk.org
> Cc: Rybalchenko, Kirill <kirill.rybalchenko@intel.com>; Chilikin, Andrey
> <andrey.chilikin@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>
> Subject: [PATCH] net/i40e: do not turn on flexible payload on driver init
> 
> Function i40e_GLQF_reg_init() overwrites global register for flexible payload,
> forcing extraction of first 16 bytes of
> L2/L3/L4 payload to the field vector even if flexible payload is not used by an
> application. Such unconditional turn on of flexible payload effectively
> disables ability to use outer IP Destination address for RSS/FDIR for tunnelled
> packets, as flexible payload overwrites outer IP destination address on the
> field vector.
> 
> Now flexible payload turned on only when flow director is enabled and
> configured.
> 
> v1:
> Global registers will be set only when payload is enabled.
> They will be reset if payload is disabled or on port reset (uninit).
> 
> Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c | 32 +++++++++++++++++++++-----------
> drivers/net/i40e/i40e_ethdev.h |  1 +
>  drivers/net/i40e/i40e_fdir.c   |  1 +
>  3 files changed, 23 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 811cc9f..d6a207f 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -701,17 +701,6 @@ RTE_PMD_REGISTER_KMOD_DEP(net_i40e, "*
> igb_uio | uio_pci_generic | vfio-pci");  static inline void
> i40e_GLQF_reg_init(struct i40e_hw *hw)  {
>  	/*
> -	 * Force global configuration for flexible payload
> -	 * to the first 16 bytes of the corresponding L2/L3/L4 paylod.
> -	 * This should be removed from code once proper
> -	 * configuration API is added to avoid configuration conflicts
> -	 * between ports of the same device.
> -	 */
> -	I40E_WRITE_REG(hw, I40E_GLQF_ORT(33), 0x000000E0);
> -	I40E_WRITE_REG(hw, I40E_GLQF_ORT(34), 0x000000E3);
> -	I40E_WRITE_REG(hw, I40E_GLQF_ORT(35), 0x000000E6);
> -
> -	/*
>  	 * Initialize registers for parsing packet type of QinQ
>  	 * This should be removed from code once proper
>  	 * configuration API is added to avoid configuration conflicts @@ -
> 1435,6 +1424,24 @@ i40e_rm_fdir_filter_list(struct i40e_pf *pf)
>  	}
>  }
> 
> +void i40e_flex_payload_reg_cfg(struct i40e_hw *hw, bool enable) {
> +	if (enable) {
> +		/*
> +		 * Set global configuration for flexible payload
> +		 * to the first 16 bytes of the corresponding L2/L3/L4 paylod.
> +		 */
> +		I40E_WRITE_REG(hw, I40E_GLQF_ORT(33), 0x000000E0);
> +		I40E_WRITE_REG(hw, I40E_GLQF_ORT(34), 0x000000E3);
> +		I40E_WRITE_REG(hw, I40E_GLQF_ORT(35), 0x000000E6);
> +	} else {
> +		/* Disable flexible payload in global configuration */
> +		I40E_WRITE_REG(hw, I40E_GLQF_ORT(33), 0x00000000);
> +		I40E_WRITE_REG(hw, I40E_GLQF_ORT(34), 0x00000000);
> +		I40E_WRITE_REG(hw, I40E_GLQF_ORT(35), 0x00000000);

I'm not sure if 0 is the default value for the three registers, just remind to check the value in FW first.

> +	}
> +}
> +
>  static int
>  eth_i40e_dev_uninit(struct rte_eth_dev *dev)  { @@ -1478,6 +1485,9 @@
> eth_i40e_dev_uninit(struct rte_eth_dev *dev)
>  	hw->fc.requested_mode = I40E_FC_NONE;
>  	i40e_set_fc(hw, &aq_fail, TRUE);
> 
> +	/* Disable flexible payload in global configuration */
> +	i40e_flex_payload_reg_cfg(hw, false);
> +

How about moving it to dev_close and also adding disable flexible payload in dev_init function?
Guarantee flexible payload is disabled during the next launch if application quits in unexpected way.

>  	/* uninitialize pf host driver */
>  	i40e_pf_host_uninit(dev);
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.h
> b/drivers/net/i40e/i40e_ethdev.h index cd67453..2cbe9cb 100644
> --- a/drivers/net/i40e/i40e_ethdev.h
> +++ b/drivers/net/i40e/i40e_ethdev.h
> @@ -1198,6 +1198,7 @@ int i40e_dcb_init_configure(struct rte_eth_dev
> *dev, bool sw_dcb);  int i40e_flush_queue_region_all_conf(struct
> rte_eth_dev *dev,
>  		struct i40e_hw *hw, struct i40e_pf *pf, uint16_t on);  void
> i40e_init_queue_region_conf(struct rte_eth_dev *dev);
> +void i40e_flex_payload_reg_cfg(struct i40e_hw *hw, bool enable);
> 
>  #define I40E_DEV_TO_PCI(eth_dev) \
>  	RTE_DEV_TO_PCI((eth_dev)->device)
> diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index
> 3d7170d..0ae8fbd 100644
> --- a/drivers/net/i40e/i40e_fdir.c
> +++ b/drivers/net/i40e/i40e_fdir.c
> @@ -671,6 +671,7 @@ i40e_fdir_configure(struct rte_eth_dev *dev)
>  		return -EINVAL;
>  	}
>  	/* configure flex payload */
> +	i40e_flex_payload_reg_cfg(hw, !!conf->nb_payloads);
>  	for (i = 0; i < conf->nb_payloads; i++)
>  		i40e_set_flx_pld_cfg(pf, &conf->flex_set[i]);
>  	/* configure flex mask*/
> --
> 2.5.5

  reply	other threads:[~2017-12-11  6:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 12:55 Kirill Rybalchenko
2017-11-30  9:17 ` Xing, Beilei
2017-12-01 15:27 ` Kirill Rybalchenko
2017-12-11  6:00   ` Xing, Beilei [this message]
2017-12-12  3:40     ` Xing, Beilei
2018-01-04 17:45   ` [dpdk-dev] [PATCH v2] " Kirill Rybalchenko
2018-01-08  5:41     ` Xing, Beilei
2018-01-09 15:28       ` Zhang, Helin
2018-01-09 15:36     ` [dpdk-dev] [PATCH v3] " Kirill Rybalchenko
2018-01-09 16:06       ` Zhang, Helin

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=94479800C636CB44BD422CB454846E013207E0DF@SHSMSX101.ccr.corp.intel.com \
    --to=beilei.xing@intel.com \
    --cc=andrey.chilikin@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=kirill.rybalchenko@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).