[v2,1/5] net/i40e: add private APIs

Message ID 20200615021858.13985-2-chenxux.di@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series re-implement legacy filter functions by private API |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Chenxu Di June 15, 2020, 2:18 a.m. UTC
  The legacy filter API will be superseded by rte_flow.
There are also several small features which can not be
implemented in rte_flow. This patch re-implemented these
features as private API.
Three APIs are added:
rte_pmd_i40e_get_fdir_info.
rte_pmd_i40e_get_fdir_stats.
rte_pmd_i40e_set_gre_key_len.

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
---
 doc/guides/rel_notes/release_20_08.rst    | 14 +++++++
 drivers/net/i40e/i40e_ethdev.c            |  2 +-
 drivers/net/i40e/i40e_ethdev.h            |  5 +++
 drivers/net/i40e/i40e_fdir.c              |  4 +-
 drivers/net/i40e/rte_pmd_i40e.c           | 51 +++++++++++++++++++++++
 drivers/net/i40e/rte_pmd_i40e.h           | 49 ++++++++++++++++++++++
 drivers/net/i40e/rte_pmd_i40e_version.map |  3 ++
 7 files changed, 125 insertions(+), 3 deletions(-)
  

Comments

Guo, Jia June 30, 2020, 4:22 a.m. UTC | #1
hi, chenxu

On 6/15/2020 10:18 AM, Chenxu Di wrote:
> The legacy filter API will be superseded by rte_flow.
> There are also several small features which can not be
> implemented in rte_flow. This patch re-implemented these
> features as private API.
> Three APIs are added:
> rte_pmd_i40e_get_fdir_info.
> rte_pmd_i40e_get_fdir_stats.
> rte_pmd_i40e_set_gre_key_len.
>
> Signed-off-by: Chenxu Di <chenxux.di@intel.com>
> ---
>   doc/guides/rel_notes/release_20_08.rst    | 14 +++++++
>   drivers/net/i40e/i40e_ethdev.c            |  2 +-
>   drivers/net/i40e/i40e_ethdev.h            |  5 +++
>   drivers/net/i40e/i40e_fdir.c              |  4 +-
>   drivers/net/i40e/rte_pmd_i40e.c           | 51 +++++++++++++++++++++++
>   drivers/net/i40e/rte_pmd_i40e.h           | 49 ++++++++++++++++++++++
>   drivers/net/i40e/rte_pmd_i40e_version.map |  3 ++
>   7 files changed, 125 insertions(+), 3 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst
> index dee4ccbb5..550ad33aa 100644
> --- a/doc/guides/rel_notes/release_20_08.rst
> +++ b/doc/guides/rel_notes/release_20_08.rst
> @@ -62,6 +62,20 @@ New Features
>   
>     * Added new PMD devarg ``reclaim_mem_mode``.
>   
> +* **Updated the Intel i40e driver.**
> +
> +  Updated the Intel i40e driver with new features and improvements, including:
> +
> +  * Re-implemented get_fdir_info and get_fdir_stat in private API.
> +  * Re-implemented set_gre_key_len in private API.
> +  * Added support for flow query RSS.
> +
> +* **Updated the Intel ixgbe driver.**
> +
> +  Updated the Intel ixgbe driver with new features and improvements, including:
> +
> +  * Re-implemented get_fdir_info and get_fdir_stat in private API.
> +
>   


Should the ixgbe part of document remove into the next ixgbe patch [2/5]?


>   Removed Items
>   -------------
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 970a31cb2..674b711d9 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -8787,7 +8787,7 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf,
>   
>   #define I40E_GL_PRS_FVBM_MSK_ENA 0x80000000
>   #define I40E_GL_PRS_FVBM(_i)     (0x00269760 + ((_i) * 4))
> -static int
> +int
>   i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len)
>   {
>   	struct i40e_pf *pf = &((struct i40e_adapter *)hw->back)->pf;
> diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
> index e5d0ce53f..192636927 100644
> --- a/drivers/net/i40e/i40e_ethdev.h
> +++ b/drivers/net/i40e/i40e_ethdev.h
> @@ -1270,6 +1270,11 @@ enum i40e_filter_pctype
>   				uint16_t flow_type);
>   uint16_t i40e_pctype_to_flowtype(const struct i40e_adapter *adapter,
>   				 enum i40e_filter_pctype pctype);
> +int i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len);
> +void i40e_fdir_info_get(struct rte_eth_dev *dev,
> +			struct rte_eth_fdir_info *fdir);
> +void i40e_fdir_stats_get(struct rte_eth_dev *dev,
> +			 struct rte_eth_fdir_stats *stat);


Please check the alignment.


>   int i40e_fdir_ctrl_func(struct rte_eth_dev *dev,
>   			  enum rte_filter_op filter_op,
>   			  void *arg);
> diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
> index d59399afe..4a778db4c 100644
> --- a/drivers/net/i40e/i40e_fdir.c
> +++ b/drivers/net/i40e/i40e_fdir.c
> @@ -2169,7 +2169,7 @@ i40e_fdir_info_get_flex_mask(struct i40e_pf *pf,
>    * @fdir: a pointer to a structure of type *rte_eth_fdir_info* to be filled with
>    *    the flow director information.
>    */
> -static void
> +void
>   i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir)
>   {
>   	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> @@ -2214,7 +2214,7 @@ i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir)
>    * @stat: a pointer to a structure of type *rte_eth_fdir_stats* to be filled with
>    *    the flow director statistics.
>    */
> -static void
> +void
>   i40e_fdir_stats_get(struct rte_eth_dev *dev, struct rte_eth_fdir_stats *stat)
>   {
>   	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
> index 446e31710..e216e6783 100644
> --- a/drivers/net/i40e/rte_pmd_i40e.c
> +++ b/drivers/net/i40e/rte_pmd_i40e.c
> @@ -3209,6 +3209,57 @@ rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
>   	return 0;
>   }
>   
> +int
> +rte_pmd_i40e_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info)
> +{
> +	struct rte_eth_dev *dev;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
> +
> +	dev = &rte_eth_devices[port];
> +	if (!is_i40e_supported(dev))
> +		return -ENOTSUP;
> +
> +	i40e_fdir_info_get(dev, fdir_info);
> +
> +	return 0;
> +}
> +
> +int
> +rte_pmd_i40e_get_fdir_stats(uint16_t port, struct rte_eth_fdir_stats *fdir_stat)
> +{
> +	struct rte_eth_dev *dev;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
> +
> +	dev = &rte_eth_devices[port];
> +	if (!is_i40e_supported(dev))
> +		return -ENOTSUP;
> +
> +	i40e_fdir_stats_get(dev, fdir_stat);
> +
> +	return 0;
> +}
> +
> +int
> +rte_pmd_i40e_set_gre_key_len(uint16_t port, uint8_t len)
> +{
> +	struct rte_eth_dev *dev;
> +	struct i40e_pf *pf;
> +	struct i40e_hw *hw;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
> +
> +	dev = &rte_eth_devices[port];
> +	if (!is_i40e_supported(dev))
> +		return -ENOTSUP;
> +
> +	pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> +	hw = I40E_PF_TO_HW(pf);
> +
> +	return i40e_dev_set_gre_key_len(hw, len);
> +}
> +
>   int
>   rte_pmd_i40e_set_switch_dev(uint16_t port_id, struct rte_eth_dev *switch_dev)
>   {
> diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
> index 915cdf076..0f6715efc 100644
> --- a/drivers/net/i40e/rte_pmd_i40e.h
> +++ b/drivers/net/i40e/rte_pmd_i40e.h
> @@ -1061,6 +1061,55 @@ rte_pmd_i40e_inset_field_clear(uint64_t *inset, uint8_t field_idx)
>   	return 0;
>   }
>   
> +/**
> + * Get port fdir info
> + *
> + * @param port
> + *   The port identifier of the Ethernet device.
> + * @param fdir_info
> + *   The fdir info of the port
> + * @return
> + *   - (0) if successful.
> + *   - (-ENODEV) if *port* invalid.
> + *   - (-ENOTSUP) if operation not supported.
> + */
> +__rte_experimental
> +int
> +rte_pmd_i40e_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info);
> +
> +/**
> + * Get port fdir status
> + *
> + * @param port
> + *   The port identifier of the Ethernet device.
> + * @param fdir_stat
> + *   The fdir status of the port
> + * @return
> + *   - (0) if successful.
> + *   - (-ENODEV) if *port* invalid.
> + *   - (-ENOTSUP) if operation not supported.
> + */
> +__rte_experimental
> +int
> +rte_pmd_i40e_get_fdir_stats(uint16_t port,
> +			    struct rte_eth_fdir_stats *fdir_stat);
> +
> +/**
> + * Set GRE key length
> + *
> + * @param port
> + *   The port identifier of the Ethernet device.
> + * @param len
> + *   Length of gre-key
> + * @return
> + *   - (0) if successful.
> + *   - (-ENODEV) if *port* invalid.
> + *   - (-ENOTSUP) if operation not supported.
> + */
> +__rte_experimental
> +int
> +rte_pmd_i40e_set_gre_key_len(uint16_t port, uint8_t len);
> +
>   /**
>    * For ipn3ke, i40e works with FPGA.
>    * In this situation, i40e get link status from fpga,
> diff --git a/drivers/net/i40e/rte_pmd_i40e_version.map b/drivers/net/i40e/rte_pmd_i40e_version.map
> index c92c0cf46..f6cd3b356 100644
> --- a/drivers/net/i40e/rte_pmd_i40e_version.map
> +++ b/drivers/net/i40e/rte_pmd_i40e_version.map
> @@ -42,5 +42,8 @@ DPDK_20.0 {
>   EXPERIMENTAL {
>   	global:
>   
> +	rte_pmd_i40e_get_fdir_info;
> +	rte_pmd_i40e_get_fdir_stats;
> +	rte_pmd_i40e_set_gre_key_len;
>   	rte_pmd_i40e_set_switch_dev;
>   };
  
Qiming Yang June 30, 2020, 10:24 a.m. UTC | #2
> -----Original Message-----
> From: Di, ChenxuX <chenxux.di@intel.com>
> Sent: Monday, June 15, 2020 10:19
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Di, ChenxuX <chenxux.di@intel.com>
> Subject: [PATCH v2 1/5] net/i40e: add private APIs
> 
> The legacy filter API will be superseded by rte_flow.
> There are also several small features which can not be implemented in
> rte_flow. This patch re-implemented these features as private API.
> Three APIs are added:
> rte_pmd_i40e_get_fdir_info.
> rte_pmd_i40e_get_fdir_stats.
> rte_pmd_i40e_set_gre_key_len.
> 
> Signed-off-by: Chenxu Di <chenxux.di@intel.com>
> ---
>  doc/guides/rel_notes/release_20_08.rst    | 14 +++++++
>  drivers/net/i40e/i40e_ethdev.c            |  2 +-
>  drivers/net/i40e/i40e_ethdev.h            |  5 +++
>  drivers/net/i40e/i40e_fdir.c              |  4 +-
>  drivers/net/i40e/rte_pmd_i40e.c           | 51 +++++++++++++++++++++++
>  drivers/net/i40e/rte_pmd_i40e.h           | 49 ++++++++++++++++++++++
>  drivers/net/i40e/rte_pmd_i40e_version.map |  3 ++
>  7 files changed, 125 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/release_20_08.rst
> b/doc/guides/rel_notes/release_20_08.rst
> index dee4ccbb5..550ad33aa 100644
> --- a/doc/guides/rel_notes/release_20_08.rst
> +++ b/doc/guides/rel_notes/release_20_08.rst
> @@ -62,6 +62,20 @@ New Features
> 
>    * Added new PMD devarg ``reclaim_mem_mode``.
> 
> +* **Updated the Intel i40e driver.**
> +
> +  Updated the Intel i40e driver with new features and improvements,
> including:
> +
> +  * Re-implemented get_fdir_info and get_fdir_stat in private API.
> +  * Re-implemented set_gre_key_len in private API.
> +  * Added support for flow query RSS.
> +
> +* **Updated the Intel ixgbe driver.**
> +
> +  Updated the Intel ixgbe driver with new features and improvements,
> including:
> +
> +  * Re-implemented get_fdir_info and get_fdir_stat in private API.
> +
> 
>  Removed Items
>  -------------
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 970a31cb2..674b711d9 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -8787,7 +8787,7 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf,
> 
>  #define I40E_GL_PRS_FVBM_MSK_ENA 0x80000000
>  #define I40E_GL_PRS_FVBM(_i)     (0x00269760 + ((_i) * 4))
> -static int
> +int
>  i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len)  {
>  	struct i40e_pf *pf = &((struct i40e_adapter *)hw->back)->pf; diff --
> git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
> index e5d0ce53f..192636927 100644
> --- a/drivers/net/i40e/i40e_ethdev.h
> +++ b/drivers/net/i40e/i40e_ethdev.h
> @@ -1270,6 +1270,11 @@ enum i40e_filter_pctype
>  				uint16_t flow_type);
>  uint16_t i40e_pctype_to_flowtype(const struct i40e_adapter *adapter,
>  				 enum i40e_filter_pctype pctype);
> +int i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len); void
> +i40e_fdir_info_get(struct rte_eth_dev *dev,
> +			struct rte_eth_fdir_info *fdir);
> +void i40e_fdir_stats_get(struct rte_eth_dev *dev,
> +			 struct rte_eth_fdir_stats *stat);
>  int i40e_fdir_ctrl_func(struct rte_eth_dev *dev,
>  			  enum rte_filter_op filter_op,
>  			  void *arg);

It doesn't make sense to add the definition here as these functions only called by private API.
I think it better to move these function to private also

[...]


> --
> 2.17.1
  
Chenxu Di July 1, 2020, 1:30 a.m. UTC | #3
> -----Original Message-----
> From: Yang, Qiming
> Sent: Tuesday, June 30, 2020 6:25 PM
> To: Di, ChenxuX <chenxux.di@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>
> Subject: RE: [PATCH v2 1/5] net/i40e: add private APIs
> 
> 
> 
> > -----Original Message-----
> > From: Di, ChenxuX <chenxux.di@intel.com>
> > Sent: Monday, June 15, 2020 10:19
> > To: dev@dpdk.org
> > Cc: Xing, Beilei <beilei.xing@intel.com>; Yang, Qiming
> > <qiming.yang@intel.com>; Di, ChenxuX <chenxux.di@intel.com>
> > Subject: [PATCH v2 1/5] net/i40e: add private APIs
> >
> > The legacy filter API will be superseded by rte_flow.
> > There are also several small features which can not be implemented in
> > rte_flow. This patch re-implemented these features as private API.
> > Three APIs are added:
> > rte_pmd_i40e_get_fdir_info.
> > rte_pmd_i40e_get_fdir_stats.
> > rte_pmd_i40e_set_gre_key_len.
> >
> > Signed-off-by: Chenxu Di <chenxux.di@intel.com>
> > ---
> >  doc/guides/rel_notes/release_20_08.rst    | 14 +++++++
> >  drivers/net/i40e/i40e_ethdev.c            |  2 +-
> >  drivers/net/i40e/i40e_ethdev.h            |  5 +++
> >  drivers/net/i40e/i40e_fdir.c              |  4 +-
> >  drivers/net/i40e/rte_pmd_i40e.c           | 51 +++++++++++++++++++++++
> >  drivers/net/i40e/rte_pmd_i40e.h           | 49 ++++++++++++++++++++++
> >  drivers/net/i40e/rte_pmd_i40e_version.map |  3 ++
> >  7 files changed, 125 insertions(+), 3 deletions(-)
> >
> > diff --git a/doc/guides/rel_notes/release_20_08.rst
> > b/doc/guides/rel_notes/release_20_08.rst
> > index dee4ccbb5..550ad33aa 100644
> > --- a/doc/guides/rel_notes/release_20_08.rst
> > +++ b/doc/guides/rel_notes/release_20_08.rst
> > @@ -62,6 +62,20 @@ New Features
> >
> >    * Added new PMD devarg ``reclaim_mem_mode``.
> >
> > +* **Updated the Intel i40e driver.**
> > +
> > +  Updated the Intel i40e driver with new features and improvements,
> > including:
> > +
> > +  * Re-implemented get_fdir_info and get_fdir_stat in private API.
> > +  * Re-implemented set_gre_key_len in private API.
> > +  * Added support for flow query RSS.
> > +
> > +* **Updated the Intel ixgbe driver.**
> > +
> > +  Updated the Intel ixgbe driver with new features and improvements,
> > including:
> > +
> > +  * Re-implemented get_fdir_info and get_fdir_stat in private API.
> > +
> >
> >  Removed Items
> >  -------------
> > diff --git a/drivers/net/i40e/i40e_ethdev.c
> > b/drivers/net/i40e/i40e_ethdev.c index 970a31cb2..674b711d9 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -8787,7 +8787,7 @@ i40e_tunnel_filter_param_check(struct i40e_pf
> > *pf,
> >
> >  #define I40E_GL_PRS_FVBM_MSK_ENA 0x80000000
> >  #define I40E_GL_PRS_FVBM(_i)     (0x00269760 + ((_i) * 4))
> > -static int
> > +int
> >  i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len)  {  struct
> > i40e_pf *pf = &((struct i40e_adapter *)hw->back)->pf; diff -- git
> > a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
> > index e5d0ce53f..192636927 100644
> > --- a/drivers/net/i40e/i40e_ethdev.h
> > +++ b/drivers/net/i40e/i40e_ethdev.h
> > @@ -1270,6 +1270,11 @@ enum i40e_filter_pctype  uint16_t flow_type);
> > uint16_t i40e_pctype_to_flowtype(const struct i40e_adapter *adapter,
> >   enum i40e_filter_pctype pctype);
> > +int i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len); void
> > +i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info
> > +*fdir); void i40e_fdir_stats_get(struct rte_eth_dev *dev,  struct
> > +rte_eth_fdir_stats *stat);
> >  int i40e_fdir_ctrl_func(struct rte_eth_dev *dev,
> >    enum rte_filter_op filter_op,
> >    void *arg);
> 
> It doesn't make sense to add the definition here as these functions only called by
> private API.
> I think it better to move these function to private also
> 

For the reason the legacy filter API and function is not really removed, it will call the function.
It may not be the right time to move the functions to private.

The same as ixgbe.

> [...]
> 
> 
> > --
> > 2.17.1
>
  

Patch

diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst
index dee4ccbb5..550ad33aa 100644
--- a/doc/guides/rel_notes/release_20_08.rst
+++ b/doc/guides/rel_notes/release_20_08.rst
@@ -62,6 +62,20 @@  New Features
 
   * Added new PMD devarg ``reclaim_mem_mode``.
 
+* **Updated the Intel i40e driver.**
+
+  Updated the Intel i40e driver with new features and improvements, including:
+
+  * Re-implemented get_fdir_info and get_fdir_stat in private API.
+  * Re-implemented set_gre_key_len in private API.
+  * Added support for flow query RSS.
+
+* **Updated the Intel ixgbe driver.**
+
+  Updated the Intel ixgbe driver with new features and improvements, including:
+
+  * Re-implemented get_fdir_info and get_fdir_stat in private API.
+
 
 Removed Items
 -------------
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 970a31cb2..674b711d9 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -8787,7 +8787,7 @@  i40e_tunnel_filter_param_check(struct i40e_pf *pf,
 
 #define I40E_GL_PRS_FVBM_MSK_ENA 0x80000000
 #define I40E_GL_PRS_FVBM(_i)     (0x00269760 + ((_i) * 4))
-static int
+int
 i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len)
 {
 	struct i40e_pf *pf = &((struct i40e_adapter *)hw->back)->pf;
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index e5d0ce53f..192636927 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -1270,6 +1270,11 @@  enum i40e_filter_pctype
 				uint16_t flow_type);
 uint16_t i40e_pctype_to_flowtype(const struct i40e_adapter *adapter,
 				 enum i40e_filter_pctype pctype);
+int i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len);
+void i40e_fdir_info_get(struct rte_eth_dev *dev,
+			struct rte_eth_fdir_info *fdir);
+void i40e_fdir_stats_get(struct rte_eth_dev *dev,
+			 struct rte_eth_fdir_stats *stat);
 int i40e_fdir_ctrl_func(struct rte_eth_dev *dev,
 			  enum rte_filter_op filter_op,
 			  void *arg);
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index d59399afe..4a778db4c 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -2169,7 +2169,7 @@  i40e_fdir_info_get_flex_mask(struct i40e_pf *pf,
  * @fdir: a pointer to a structure of type *rte_eth_fdir_info* to be filled with
  *    the flow director information.
  */
-static void
+void
 i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir)
 {
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
@@ -2214,7 +2214,7 @@  i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir)
  * @stat: a pointer to a structure of type *rte_eth_fdir_stats* to be filled with
  *    the flow director statistics.
  */
-static void
+void
 i40e_fdir_stats_get(struct rte_eth_dev *dev, struct rte_eth_fdir_stats *stat)
 {
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 446e31710..e216e6783 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -3209,6 +3209,57 @@  rte_pmd_i40e_inset_set(uint16_t port, uint8_t pctype,
 	return 0;
 }
 
+int
+rte_pmd_i40e_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info)
+{
+	struct rte_eth_dev *dev;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	if (!is_i40e_supported(dev))
+		return -ENOTSUP;
+
+	i40e_fdir_info_get(dev, fdir_info);
+
+	return 0;
+}
+
+int
+rte_pmd_i40e_get_fdir_stats(uint16_t port, struct rte_eth_fdir_stats *fdir_stat)
+{
+	struct rte_eth_dev *dev;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	if (!is_i40e_supported(dev))
+		return -ENOTSUP;
+
+	i40e_fdir_stats_get(dev, fdir_stat);
+
+	return 0;
+}
+
+int
+rte_pmd_i40e_set_gre_key_len(uint16_t port, uint8_t len)
+{
+	struct rte_eth_dev *dev;
+	struct i40e_pf *pf;
+	struct i40e_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	if (!is_i40e_supported(dev))
+		return -ENOTSUP;
+
+	pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	hw = I40E_PF_TO_HW(pf);
+
+	return i40e_dev_set_gre_key_len(hw, len);
+}
+
 int
 rte_pmd_i40e_set_switch_dev(uint16_t port_id, struct rte_eth_dev *switch_dev)
 {
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index 915cdf076..0f6715efc 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -1061,6 +1061,55 @@  rte_pmd_i40e_inset_field_clear(uint64_t *inset, uint8_t field_idx)
 	return 0;
 }
 
+/**
+ * Get port fdir info
+ *
+ * @param port
+ *   The port identifier of the Ethernet device.
+ * @param fdir_info
+ *   The fdir info of the port
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-ENOTSUP) if operation not supported.
+ */
+__rte_experimental
+int
+rte_pmd_i40e_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info);
+
+/**
+ * Get port fdir status
+ *
+ * @param port
+ *   The port identifier of the Ethernet device.
+ * @param fdir_stat
+ *   The fdir status of the port
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-ENOTSUP) if operation not supported.
+ */
+__rte_experimental
+int
+rte_pmd_i40e_get_fdir_stats(uint16_t port,
+			    struct rte_eth_fdir_stats *fdir_stat);
+
+/**
+ * Set GRE key length
+ *
+ * @param port
+ *   The port identifier of the Ethernet device.
+ * @param len
+ *   Length of gre-key
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-ENOTSUP) if operation not supported.
+ */
+__rte_experimental
+int
+rte_pmd_i40e_set_gre_key_len(uint16_t port, uint8_t len);
+
 /**
  * For ipn3ke, i40e works with FPGA.
  * In this situation, i40e get link status from fpga,
diff --git a/drivers/net/i40e/rte_pmd_i40e_version.map b/drivers/net/i40e/rte_pmd_i40e_version.map
index c92c0cf46..f6cd3b356 100644
--- a/drivers/net/i40e/rte_pmd_i40e_version.map
+++ b/drivers/net/i40e/rte_pmd_i40e_version.map
@@ -42,5 +42,8 @@  DPDK_20.0 {
 EXPERIMENTAL {
 	global:
 
+	rte_pmd_i40e_get_fdir_info;
+	rte_pmd_i40e_get_fdir_stats;
+	rte_pmd_i40e_set_gre_key_len;
 	rte_pmd_i40e_set_switch_dev;
 };