[dpdk-dev,v3,1/3] ethdev: extend struct to support flow director in VFs

Message ID 1446308653-2378-2-git-send-email-jingjing.wu@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Jingjing Wu Oct. 31, 2015, 4:24 p.m. UTC
  This patch extends struct rte_eth_fdir_flow_ext to support flow
director in VFs.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 4 ----
 doc/guides/rel_notes/release_2_2.rst | 3 +++
 lib/librte_ether/rte_eth_ctrl.h      | 2 ++
 3 files changed, 5 insertions(+), 4 deletions(-)
  

Comments

Thomas Monjalon Nov. 1, 2015, 2:27 p.m. UTC | #1
2015-11-01 00:24, Jingjing Wu:
> This patch extends struct rte_eth_fdir_flow_ext to support flow
> director in VFs.
[...]
> --- a/lib/librte_ether/rte_eth_ctrl.h
> +++ b/lib/librte_ether/rte_eth_ctrl.h
> @@ -426,6 +426,8 @@ struct rte_eth_fdir_flow_ext {
>  	uint16_t vlan_tci;
>  	uint8_t flexbytes[RTE_ETH_FDIR_MAX_FLEXLEN];
>  	/**< It is filled by the flexible payload to match. */
> +	uint8_t is_vf;   /**< 1 for VF, 0 for port dev */
> +	uint16_t dst_id; /**< VF ID, available when is_vf is 1*/
>  };

Why adding these parameters in an input struct?
Shouldn't it be in rte_eth_fdir_action along with rx_queue?
  
Jingjing Wu Nov. 1, 2015, 2:33 p.m. UTC | #2
Hi, Thomas


> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Sunday, November 1, 2015 10:28 PM
> To: Wu, Jingjing
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3 1/3] ethdev: extend struct to support flow director in VFs
> 
> 2015-11-01 00:24, Jingjing Wu:
> > This patch extends struct rte_eth_fdir_flow_ext to support flow
> > director in VFs.
> [...]
> > --- a/lib/librte_ether/rte_eth_ctrl.h
> > +++ b/lib/librte_ether/rte_eth_ctrl.h
> > @@ -426,6 +426,8 @@ struct rte_eth_fdir_flow_ext {
> >  	uint16_t vlan_tci;
> >  	uint8_t flexbytes[RTE_ETH_FDIR_MAX_FLEXLEN];
> >  	/**< It is filled by the flexible payload to match. */
> > +	uint8_t is_vf;   /**< 1 for VF, 0 for port dev */
> > +	uint16_t dst_id; /**< VF ID, available when is_vf is 1*/
> >  };
> 
> Why adding these parameters in an input struct?
> Shouldn't it be in rte_eth_fdir_action along with rx_queue?
Thanks for your comments. The reason of adding these in input is because this is input but not action.
The patch is to support Flow director works in VF, then direct packets to the rx_queue (belong this vf) 
which defined in action, but not direct packets to VF.

Thanks
Jingjing
  
Thomas Monjalon Nov. 1, 2015, 2:55 p.m. UTC | #3
2015-11-01 14:33, Wu, Jingjing:
> Hi, Thomas
> 
> 
> > -----Original Message-----
> > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > Sent: Sunday, November 1, 2015 10:28 PM
> > To: Wu, Jingjing
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v3 1/3] ethdev: extend struct to support flow director in VFs
> > 
> > 2015-11-01 00:24, Jingjing Wu:
> > > This patch extends struct rte_eth_fdir_flow_ext to support flow
> > > director in VFs.
> > [...]
> > > --- a/lib/librte_ether/rte_eth_ctrl.h
> > > +++ b/lib/librte_ether/rte_eth_ctrl.h
> > > @@ -426,6 +426,8 @@ struct rte_eth_fdir_flow_ext {
> > >  	uint16_t vlan_tci;
> > >  	uint8_t flexbytes[RTE_ETH_FDIR_MAX_FLEXLEN];
> > >  	/**< It is filled by the flexible payload to match. */
> > > +	uint8_t is_vf;   /**< 1 for VF, 0 for port dev */
> > > +	uint16_t dst_id; /**< VF ID, available when is_vf is 1*/
> > >  };
> > 
> > Why adding these parameters in an input struct?
> > Shouldn't it be in rte_eth_fdir_action along with rx_queue?
> Thanks for your comments. The reason of adding these in input is because this is input but not action.
> The patch is to support Flow director works in VF, then direct packets to the rx_queue (belong this vf) 
> which defined in action, but not direct packets to VF.

Oh!
From the VM, using
rte_eth_dev_filter_ctrl(port_id, filter_type, filter_op, arg)
it can be deduced from the VF device, no?
Is the use case to define a VF flow director outside of the VM?
  
Jingjing Wu Nov. 2, 2015, 5:24 a.m. UTC | #4
> 
> Oh!
> From the VM, using
> rte_eth_dev_filter_ctrl(port_id, filter_type, filter_op, arg)
> it can be deduced from the VF device, no?
> Is the use case to define a VF flow director outside of the VM?

Yes, if VM can configure through rte_eth_dev_filter_ctrl, it will be better.
But flow director can only be programed on PF, and currently there is no such
virtual channel between PF and VF in share code. Due to the principle aligned
with i40e kernel driver develop, we cannot add new virtual channel by ourselves.
So I did it this way on DPDK when DPDK using as PF driver.

Thanks
Jingjing
  

Patch

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index a391ff0..cd2b80c 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -17,10 +17,6 @@  Deprecation Notices
   imissed, ibadcrc, ibadlen, imcasts, fdirmatch, fdirmiss,
   tx_pause_xon, rx_pause_xon, tx_pause_xoff, rx_pause_xoff
 
-* ABI changes are planned for struct rte_eth_fdir_flow_ext in order to support
-  flow director filtering in VF. The release 2.1 does not contain these ABI
-  changes, but release 2.2 will, and no backwards compatibility is planned.
-
 * ABI changes are planned for struct rte_eth_fdir_filter and
   rte_eth_fdir_masks in order to support new flow director modes,
   MAC VLAN and Cloud, on x550. The MAC VLAN mode means the MAC and
diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst
index 116162e..8ca3872 100644
--- a/doc/guides/rel_notes/release_2_2.rst
+++ b/doc/guides/rel_notes/release_2_2.rst
@@ -164,6 +164,9 @@  ABI Changes
 * librte_cfgfile: Allow longer names and values by increasing the constants
   CFG_NAME_LEN and CFG_VALUE_LEN to 64 and 256 respectively.
 
+* The rte_eth_fdir_flow_ext structure is changed. New fields are added to
+  support flow director filtering in VF.
+
 
 Shared Library Versions
 -----------------------
diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 770c76c..3f86094 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -426,6 +426,8 @@  struct rte_eth_fdir_flow_ext {
 	uint16_t vlan_tci;
 	uint8_t flexbytes[RTE_ETH_FDIR_MAX_FLEXLEN];
 	/**< It is filled by the flexible payload to match. */
+	uint8_t is_vf;   /**< 1 for VF, 0 for port dev */
+	uint16_t dst_id; /**< VF ID, available when is_vf is 1*/
 };
 
 /**