[dpdk-dev] [PATCH] net/mlx5: allow flow rule with attribute egress

Dekel Peled dekelp at mellanox.com
Wed Oct 3 15:02:03 CEST 2018


Thanks, PSB.

> -----Original Message-----
> From: Yongseok Koh
> Sent: Wednesday, October 3, 2018 10:28 AM
> To: Dekel Peled <dekelp at mellanox.com>
> Cc: dev at dpdk.org; Shahaf Shuler <shahafs at mellanox.com>; Ori Kam
> <orika at mellanox.com>
> Subject: Re: [PATCH] net/mlx5: allow flow rule with attribute egress
> 
> On Tue, Oct 02, 2018 at 11:06:07PM -0700, Dekel Peled wrote:
> > Thanks, PSB.
> >
> > > -----Original Message-----
> > > From: Yongseok Koh
> > > Sent: Saturday, September 29, 2018 12:24 PM
> > > To: Dekel Peled <dekelp at mellanox.com>
> > > Cc: dev at dpdk.org; Shahaf Shuler <shahafs at mellanox.com>; Ori Kam
> > > <orika at mellanox.com>
> > > Subject: Re: [PATCH] net/mlx5: allow flow rule with attribute egress
> > >
> > > On Thu, Sep 27, 2018 at 05:25:30PM +0300, Dekel Peled wrote:
> > > > This patch complements [1], adding to MLX5 PMD the option to set
> > > > flow rule for egress traffic.
> > > >
> > > > [1] "net/mlx5: support metadata as flow rule criteria"
> > > >     http://mails.dpdk.org/archives/dev/2018-September/113275.html
> > > >
> > > > Signed-off-by: Dekel Peled <dekelp at mellanox.com>
> > > > ---
> > > >  drivers/net/mlx5/mlx5_flow.c       | 54
> > > ++++++++++++++++++++++++++++++++++++++
> > > >  drivers/net/mlx5/mlx5_flow.h       |  6 +++++
> > > >  drivers/net/mlx5/mlx5_flow_dv.c    | 24 ++++++++++-------
> > > >  drivers/net/mlx5/mlx5_flow_verbs.c |  7 ++++-
> > > >  4 files changed, 80 insertions(+), 11 deletions(-)
> > > >
> > > > diff --git a/drivers/net/mlx5/mlx5_flow.c
> > > > b/drivers/net/mlx5/mlx5_flow.c index 9581691..79a06df 100644
> > > > --- a/drivers/net/mlx5/mlx5_flow.c
> > > > +++ b/drivers/net/mlx5/mlx5_flow.c
> > > > @@ -644,6 +644,8 @@ uint32_t mlx5_flow_adjust_priority(struct
> > > rte_eth_dev *dev, int32_t priority,
> > > >   *
> > > >   * @param[in] action_flags
> > > >   *   Bit-fields that holds the actions detected until now.
> > > > + * @param[in] attr
> > > > + *   Attributes of flow that includes this action.
> > > >   * @param[out] error
> > > >   *   Pointer to error structure.
> > > >   *
> > > > @@ -652,6 +654,7 @@ uint32_t mlx5_flow_adjust_priority(struct
> > > rte_eth_dev *dev, int32_t priority,
> > > >   */
> > > >  int
> > > >  mlx5_flow_validate_action_flag(uint64_t action_flags,
> > > > +			       const struct rte_flow_attr *attr,
> > > >  			       struct rte_flow_error *error)  {
> > > >
> > > > @@ -668,6 +671,12 @@ uint32_t mlx5_flow_adjust_priority(struct
> > > rte_eth_dev *dev, int32_t priority,
> > > >  					  RTE_FLOW_ERROR_TYPE_ACTION,
> > > NULL,
> > > >  					  "can't have 2 flag"
> > > >  					  " actions in same flow");
> > > > +	if (attr->egress)
> > > > +		return rte_flow_error_set(error, ENOTSUP,
> > > > +
> > > RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,
> > > > +					  NULL,
> > >
> > > These two lines could be one line.
> > Can't do, It exceeds the 80 characters limit.
> 
> 	if (attr->egress)
> 		return rte_flow_error_set(error, ENOTSUP,
> 
> RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL,
> 0123456789012345678901234567890123456789012345678901234567890123456
> 7890123456789
> 					  "flag action not supported for "
> 					  "egress");
> 
> Exactly 80 :-)

Done.

> 
> Thanks,
> Yongseok


More information about the dev mailing list