diff mbox

[dpdk-dev,v2,1/3] ethdev: define ctrl_pkt filter type and its structure

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

Commit Message

Jingjing Wu Oct. 22, 2014, 8:19 a.m. UTC
define new filter type and its structure
 - RTE_ETH_FILTER_CTRL_PKT
 - struct rte_ctrl_pkt_filter

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 lib/librte_ether/rte_eth_ctrl.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Thomas Monjalon Oct. 30, 2014, 10:47 p.m. UTC | #1
2014-10-22 16:19, Jingjing Wu:
> +/**
> + * Define all structures for Control Packet Filter type corresponding with specific operations.
> + */

Please explain what is a control packet.

> +
> +#define RTE_CONTROL_PACKET_FLAGS_IGNORE_MAC    0x0001
> +#define RTE_CONTROL_PACKET_FLAGS_DROP          0x0002
> +#define RTE_CONTROL_PACKET_FLAGS_TO_QUEUE      0x0004
> +#define RTE_CONTROL_PACKET_FLAGS_TX            0x0008
> +#define RTE_CONTROL_PACKET_FLAGS_RX            0x0000

Flag RX is 0?

> +/**
> + * A structure used to define the control packet filter entry
> + * to support RTE_ETH_FILTER_CTRL_PKT with RTE_ETH_FILTER_ADD
> + * and RTE_ETH_FILTER_DELETE operations.
> + */
> +struct rte_ctrl_pkt_filter {
> +	struct ether_addr mac_addr;   /**< mac address to match. */
> +	uint16_t ether_type;          /**< ether type to match */
> +	uint16_t flags;               /**< options for filter's behavior*/
> +	uint16_t dest_id;             /**< destination vsi id or pool id*/

vsi id and pool id cannot be understood in a generic context.
Please explain what you mean and why queue is not enough.

> +	uint16_t queue;               /**< queue assign to if TO QUEUE flag is set */

TO QUEUE is not defined. Is it really needed?

Thanks
Jingjing Wu Oct. 31, 2014, 7:05 a.m. UTC | #2
Hi, Thomas

Thanks for your comments

Jingjing 

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Friday, October 31, 2014 6:47 AM
> To: Wu, Jingjing
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 1/3] ethdev: define ctrl_pkt filter type
> and its structure
> 
> 2014-10-22 16:19, Jingjing Wu:
> > +/**
> > + * Define all structures for Control Packet Filter type corresponding with
> specific operations.
> > + */
> 
> Please explain what is a control packet.
A control element in Fortville can be used to receive control packets and control other switching elements. Control packet filter can filter control packet (such as LLDP) to different queues in receive and identify the switch element that should process the packets in transmit.
At the same time, we also can use this filter to route non-control packets to queue or other engine by filtering mac and ether_type. The name "control packet filter" comes from Fortville.

> 
> > +
> > +#define RTE_CONTROL_PACKET_FLAGS_IGNORE_MAC    0x0001
> > +#define RTE_CONTROL_PACKET_FLAGS_DROP          0x0002
> > +#define RTE_CONTROL_PACKET_FLAGS_TO_QUEUE      0x0004
> > +#define RTE_CONTROL_PACKET_FLAGS_TX            0x0008
> > +#define RTE_CONTROL_PACKET_FLAGS_RX            0x0000
> 
> Flag RX is 0?
Yes, RX is default value. Maybe it need to be removed. 
> 
> > +/**
> > + * A structure used to define the control packet filter entry
> > + * to support RTE_ETH_FILTER_CTRL_PKT with RTE_ETH_FILTER_ADD
> > + * and RTE_ETH_FILTER_DELETE operations.
> > + */
> > +struct rte_ctrl_pkt_filter {
> > +	struct ether_addr mac_addr;   /**< mac address to match. */
> > +	uint16_t ether_type;          /**< ether type to match */
> > +	uint16_t flags;               /**< options for filter's behavior*/
> > +	uint16_t dest_id;             /**< destination vsi id or pool id*/
> 
> vsi id and pool id cannot be understood in a generic context.
> Please explain what you mean and why queue is not enough.
If queue is not specified, dest_id defines which element (vsi) will get the packet.
If queue is specified, the queue need belong to the destination element.
> 
> > +	uint16_t queue;               /**< queue assign to if TO QUEUE flag is set
> */
> 
> TO QUEUE is not defined. Is it really needed?
> 
TO QUEUE is just the flag RTE_CONTROL_PACKET_FLAGS_TO_QUEUE above.

> Thanks
> --
> Thomas
Thomas Monjalon Oct. 31, 2014, 8:44 a.m. UTC | #3
Hi Jingjing,

I'm sorry, but your explanations are not sufficient.
Please keep in mind that the user of the API don't know i40e internals.

2014-10-31 07:05, Wu, Jingjing:
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > 2014-10-22 16:19, Jingjing Wu:
> > > +/**
> > > + * Define all structures for Control Packet Filter type corresponding with
> > specific operations.
> > > + */
> > 
> > Please explain what is a control packet.
> 
> A control element in Fortville can be used to receive control packets and control other switching elements. Control packet filter can filter control packet (such as LLDP) to different queues in receive and identify the switch element that should process the packets in transmit.
> At the same time, we also can use this filter to route non-control packets to queue or other engine by filtering mac and ether_type. The name "control packet filter" comes from Fortville.

I still don't know what is a control packet.

> > > +#define RTE_CONTROL_PACKET_FLAGS_IGNORE_MAC    0x0001
> > > +#define RTE_CONTROL_PACKET_FLAGS_DROP          0x0002
> > > +#define RTE_CONTROL_PACKET_FLAGS_TO_QUEUE      0x0004
> > > +#define RTE_CONTROL_PACKET_FLAGS_TX            0x0008
> > > +#define RTE_CONTROL_PACKET_FLAGS_RX            0x0000
> > 
> > Flag RX is 0?
> 
> Yes, RX is default value. Maybe it need to be removed.

No, it doesn't need to be removed. But a flag must not be 0.
0 means none.
It's impossible to disable this flag.

Moreover, you should comment each flag.

> > > +/**
> > > + * A structure used to define the control packet filter entry
> > > + * to support RTE_ETH_FILTER_CTRL_PKT with RTE_ETH_FILTER_ADD
> > > + * and RTE_ETH_FILTER_DELETE operations.
> > > + */
> > > +struct rte_ctrl_pkt_filter {
> > > +	struct ether_addr mac_addr;   /**< mac address to match. */
> > > +	uint16_t ether_type;          /**< ether type to match */
> > > +	uint16_t flags;               /**< options for filter's behavior*/
> > > +	uint16_t dest_id;             /**< destination vsi id or pool id*/
> > 
> > vsi id and pool id cannot be understood in a generic context.
> > Please explain what you mean and why queue is not enough.
> 
> If queue is not specified, dest_id defines which element (vsi) will get the packet.
> If queue is specified, the queue need belong to the destination element.

You really need to define what is a vsi id and pool id. These notions are not
known in the API layer.

> > > +	uint16_t queue;               /**< queue assign to if TO QUEUE flag is set
> > */
> > 
> > TO QUEUE is not defined. Is it really needed?
> > 
> TO QUEUE is just the flag RTE_CONTROL_PACKET_FLAGS_TO_QUEUE above.

OK, please use the same wording or users will get lost.
Jingjing Wu Nov. 13, 2014, 5:44 a.m. UTC | #4
Hi, Thomas

The input set of control packet filter are dst_mac and ethertype in Ethernet head.
To be clear, I think it's better to use the name ethertype filter.

While there is already ethertype filter existing in igb and ixgbe driver. I will rename
The patchset to ethertype filter and also integrate igb and ixgbe's ethertype filter
To the filter_ctrl API.

What do you think?
  
Jingjing

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Friday, October 31, 2014 4:45 PM
> To: Wu, Jingjing
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 1/3] ethdev: define ctrl_pkt filter type
> and its structure
> 
> Hi Jingjing,
> 
> I'm sorry, but your explanations are not sufficient.
> Please keep in mind that the user of the API don't know i40e internals.
> 
> 2014-10-31 07:05, Wu, Jingjing:
> > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > > 2014-10-22 16:19, Jingjing Wu:
> > > > +/**
> > > > + * Define all structures for Control Packet Filter type
> > > > +corresponding with
> > > specific operations.
> > > > + */
> > >
> > > Please explain what is a control packet.
> >
> > A control element in Fortville can be used to receive control packets and
> control other switching elements. Control packet filter can filter control
> packet (such as LLDP) to different queues in receive and identify the switch
> element that should process the packets in transmit.
> > At the same time, we also can use this filter to route non-control packets to
> queue or other engine by filtering mac and ether_type. The name "control
> packet filter" comes from Fortville.
> 
> I still don't know what is a control packet.
> 
> > > > +#define RTE_CONTROL_PACKET_FLAGS_IGNORE_MAC    0x0001
> > > > +#define RTE_CONTROL_PACKET_FLAGS_DROP          0x0002
> > > > +#define RTE_CONTROL_PACKET_FLAGS_TO_QUEUE      0x0004
> > > > +#define RTE_CONTROL_PACKET_FLAGS_TX            0x0008
> > > > +#define RTE_CONTROL_PACKET_FLAGS_RX            0x0000
> > >
> > > Flag RX is 0?
> >
> > Yes, RX is default value. Maybe it need to be removed.
> 
> No, it doesn't need to be removed. But a flag must not be 0.
> 0 means none.
> It's impossible to disable this flag.
> 
> Moreover, you should comment each flag.
> 
> > > > +/**
> > > > + * A structure used to define the control packet filter entry
> > > > + * to support RTE_ETH_FILTER_CTRL_PKT with RTE_ETH_FILTER_ADD
> > > > + * and RTE_ETH_FILTER_DELETE operations.
> > > > + */
> > > > +struct rte_ctrl_pkt_filter {
> > > > +	struct ether_addr mac_addr;   /**< mac address to match. */
> > > > +	uint16_t ether_type;          /**< ether type to match */
> > > > +	uint16_t flags;               /**< options for filter's behavior*/
> > > > +	uint16_t dest_id;             /**< destination vsi id or pool id*/
> > >
> > > vsi id and pool id cannot be understood in a generic context.
> > > Please explain what you mean and why queue is not enough.
> >
> > If queue is not specified, dest_id defines which element (vsi) will get the
> packet.
> > If queue is specified, the queue need belong to the destination element.
> 
> You really need to define what is a vsi id and pool id. These notions are not
> known in the API layer.
> 
> > > > +	uint16_t queue;               /**< queue assign to if TO QUEUE flag is set
> > > */
> > >
> > > TO QUEUE is not defined. Is it really needed?
> > >
> > TO QUEUE is just the flag RTE_CONTROL_PACKET_FLAGS_TO_QUEUE
> above.
> 
> OK, please use the same wording or users will get lost.
> 
> --
> Thomas
Thomas Monjalon Nov. 13, 2014, 8:41 a.m. UTC | #5
Hi Jingjing,

2014-11-13 05:44, Wu, Jingjing:
> The input set of control packet filter are dst_mac and ethertype in Ethernet head.
> To be clear, I think it's better to use the name ethertype filter.
> 
> While there is already ethertype filter existing in igb and ixgbe driver. I will rename
> The patchset to ethertype filter and also integrate igb and ixgbe's ethertype filter
> To the filter_ctrl API.
> 
> What do you think?

OK, good.
If I understand well, this feature is now planned for release 2.0?
Jingjing Wu Nov. 13, 2014, 9 a.m. UTC | #6
Hi, Thomas

Nop.

We target to have it in r1.8. And the whole patch set is almost ready, but lack of review internally.

I have two proposes here:
1. Send a patch set include all the ethdev, i40e, ixgbe, igb and testpmd changes just as my previous mail.

2. send a patch set only include the ethdev, i40e part. Without testpmd changes to support testing it in fortville. And will send remaining changes later. Maybe r2.0?

The second proposal will split the whole task to small patchset. And easy to review.

Which one do you prefer?

Look forward to your reply!
Thanks

Jingjing 


> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Thursday, November 13, 2014 4:41 PM
> To: Wu, Jingjing
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 1/3] ethdev: define ctrl_pkt filter type and its structure
> 
> Hi Jingjing,
> 
> 2014-11-13 05:44, Wu, Jingjing:
> > The input set of control packet filter are dst_mac and ethertype in Ethernet head.
> > To be clear, I think it's better to use the name ethertype filter.
> >
> > While there is already ethertype filter existing in igb and ixgbe driver. I will rename
> > The patchset to ethertype filter and also integrate igb and ixgbe's ethertype filter
> > To the filter_ctrl API.
> >
> > What do you think?
> 
> OK, good.
> If I understand well, this feature is now planned for release 2.0?
> 
> --
> Thomas
diff mbox

Patch

diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index df21ac6..8d3dba9 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -51,6 +51,7 @@  extern "C" {
  */
 enum rte_filter_type {
 	RTE_ETH_FILTER_NONE = 0,
+	RTE_ETH_FILTER_CTRL_PKT,
 	RTE_ETH_FILTER_MAX
 };
 
@@ -71,6 +72,29 @@  enum rte_filter_op {
 	RTE_ETH_FILTER_OP_MAX
 };
 
+/**
+ * Define all structures for Control Packet Filter type corresponding with specific operations.
+ */
+
+#define RTE_CONTROL_PACKET_FLAGS_IGNORE_MAC    0x0001
+#define RTE_CONTROL_PACKET_FLAGS_DROP          0x0002
+#define RTE_CONTROL_PACKET_FLAGS_TO_QUEUE      0x0004
+#define RTE_CONTROL_PACKET_FLAGS_TX            0x0008
+#define RTE_CONTROL_PACKET_FLAGS_RX            0x0000
+
+/**
+ * A structure used to define the control packet filter entry
+ * to support RTE_ETH_FILTER_CTRL_PKT with RTE_ETH_FILTER_ADD
+ * and RTE_ETH_FILTER_DELETE operations.
+ */
+struct rte_ctrl_pkt_filter {
+	struct ether_addr mac_addr;   /**< mac address to match. */
+	uint16_t ether_type;          /**< ether type to match */
+	uint16_t flags;               /**< options for filter's behavior*/
+	uint16_t dest_id;             /**< destination vsi id or pool id*/
+	uint16_t queue;               /**< queue assign to if TO QUEUE flag is set */
+};
+
 #ifdef __cplusplus
 }
 #endif