On 11/11/2020 6:49 AM, Jiawen Wu wrote:
Add support to parse flow for ntuple filter.
Can you please add more information to the commit log what does it mean to
support 'ntuple filter' in rte_flow? Like if matching packets dropped, etc..?
(From the code below I can see only queue action is supported...)
What are the supported patterns with "ntuple filter"?
And can be good to provide some sample rte_flow commands enabled with this
commit.
Above comments are for all filter types in this set.
Signed-off-by: Jiawen Wu <[email protected]>
<...>
@@ -0,0 +1,536 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2015-2020
+ */
+
+#include <sys/queue.h>
+#include <stdio.h>
+#include <errno.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <inttypes.h>
+#include <netinet/in.h>
+#include <rte_byteorder.h>
+#include <rte_common.h>
+#include <rte_cycles.h>
+
+#include <rte_flow.h>
+#include <rte_flow_driver.h>
+
+#include "txgbe_logs.h"
+#include "base/txgbe.h"
+#include "txgbe_ethdev.h"
+#include "txgbe_rxtx.h"
+
Same comment with previous sets, can you please double check if all these
headers are required in this patch, and add them as required.
<...>
+/* a specific function for txgbe because the flags is specific */
+static int
+txgbe_parse_ntuple_filter(struct rte_eth_dev *dev,
+ const struct rte_flow_attr *attr,
+ const struct rte_flow_item pattern[],
+ const struct rte_flow_action actions[],
+ struct rte_eth_ntuple_filter *filter,
+ struct rte_flow_error *error)
+{
This function is to parse the rte_flow rule, but rte_flow is not introduced into
the driver yet.
All these filter parse functions, this and other ones, will not be functional
until rte_flow support is added. What do you think adding initial rte_flow
support first and add filters one by one being functional? This will enable
incrementally building the functionality and testing in each step.
<...>
+ if (filter->queue >= dev->data->nb_rx_queues)
+ return -rte_errno;
+
Why not set rte flow error in this case?