Hi Wei,
> -----Original Message----- > From: Zhao1, Wei > Sent: Monday, June 5, 2017 9:55 AM > To: Lu, Wenzhuo; dev@dpdk.org > Subject: RE: [PATCH v2 05/11] net/e1000: parse n-tuple filter > > HI, wenzhuo > > > -----Original Message----- > > From: Lu, Wenzhuo > > Sent: Monday, June 5, 2017 9:21 AM > > To: Zhao1, Wei <wei.zh...@intel.com>; dev@dpdk.org > > Subject: RE: [PATCH v2 05/11] net/e1000: parse n-tuple filter > > > > Hi Wei, > > > > > -----Original Message----- > > > From: Zhao1, Wei > > > Sent: Friday, June 2, 2017 2:36 PM > > > To: dev@dpdk.org > > > Cc: Lu, Wenzhuo; Zhao1, Wei > > > Subject: [PATCH v2 05/11] net/e1000: parse n-tuple filter > > > > > > Add rule validate function and check if the rule is a n-tuple rule, > > > and get the n-tuple info. > > > > > > Signed-off-by: Wei Zhao <wei.zh...@intel.com> > > > --- > > > drivers/net/e1000/Makefile | 1 + > > > drivers/net/e1000/e1000_ethdev.h | 9 + > > > drivers/net/e1000/igb_ethdev.c | 14 +- > > > drivers/net/e1000/igb_flow.c | 505 > > > +++++++++++++++++++++++++++++++++++++++ > > > 4 files changed, 521 insertions(+), 8 deletions(-) create mode > > > 100644 > > > > > + > > > + if (hw->mac.type == e1000_82576) { > > > + if (filter->queue >= IGB_MAX_RX_QUEUE_NUM_82576) { > > > + memset(filter, 0, sizeof(struct > > rte_eth_ntuple_filter)); > > > + rte_flow_error_set(error, EINVAL, > > > + RTE_FLOW_ERROR_TYPE_ITEM, > > > + NULL, "queue number not " > > > + "supported by ntuple filter"); > > > + return -rte_errno; > > > + } > > > + filter->flags |= RTE_5TUPLE_FLAGS; > > To my opinion, that the filter is 5-tuple or 2-tuple should depend on > > the input pattern. I don't understand why it's set based on the NIC type. > > This is because i350 and 82580 nic only support 2 tuple filter, But 82576 > support 5 tuple filter. > This is list in function igb_add_del_ntuple_filter(). I mean the tuple is only related to the input. For example, APP can input a 5-tuple pattern, driver should know it's a 5-tuple. Then the driver checks the NIC type, if it's i350, driver can return unsupported. > > > > > > > + } else { > > > + if (filter->queue >= IGB_MAX_RX_QUEUE_NUM) { > > > + memset(filter, 0, sizeof(struct > > rte_eth_ntuple_filter)); > > > + rte_flow_error_set(error, EINVAL, > > > + RTE_FLOW_ERROR_TYPE_ITEM, > > > + NULL, "queue number not " > > > + "supported by ntuple filter"); > > > + return -rte_errno; > > > + } > > > + filter->flags |= RTE_2TUPLE_FLAGS; > > > + }