Skip to contentSkip to conversation

net/softnic: add flow classification support

PATCH In review Jasvinder Singh 3 participants 8 messages Nov 30, 2017 – Dec 8, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

cover net/softnic: add flow classification support

This patchset extends the softnic device by implementing the software fallback for flow classification as defined using Flow APIs. When feature is enabled, softnic classifies and executes actions on the received packets based on flow rules specified using rte_flow.h.

The motivation behind this feature is to implement metering and policing function in softnic which requires each flow to be classified at the preceding stage of the packet processing pipeline. Another aspect is to support classification of the greater number of flows (For e.g. 64K) which is not feasible in some hardware due to resource limitation such as memory, etc.

This feature, inherently, uses the abstraction provided by dpdk librte_table library to create hash table for classification, and allows users to validate, add and delete flow rules. Current version does not implement all functions and will be completed in the next version.

Jasvinder Singh (2):
net/softnic: add flow classification support
net/softnic: add flow classification ops

 drivers/net/softnic/Makefile                    |   2 +-
 drivers/net/softnic/rte_eth_softnic.c           | 389 +++++++++++++-
 drivers/net/softnic/rte_eth_softnic.h           |  16 +
 drivers/net/softnic/rte_eth_softnic_fc.c        | 680 ++++++++++++++++++++++++
 drivers/net/softnic/rte_eth_softnic_internals.h | 162 +++++-
 mk/rte.app.mk                                   |   2 +
 6 files changed, 1240 insertions(+), 11 deletions(-)
 create mode 100644 drivers/net/softnic/rte_eth_softnic_fc.c
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/2 net/softnic: enable flow classification function

Enables flow classification on softnic rx path so that proceding functions of the packet processing pipeline such as metering and policing could be implemented.

Example: Create "soft" port for "hard" port "0000:02:00.1", enable the Flow Classification (FC) feature with default settings:
--vdev 'net_softnic0,hard_name=0000:02:00.1,soft_fc=on'

---
 drivers/net/softnic/Makefile                    |   2 +-
 drivers/net/softnic/rte_eth_softnic.c           | 389 +++++++++++++++++++++++-
 drivers/net/softnic/rte_eth_softnic.h           |  16 +
 drivers/net/softnic/rte_eth_softnic_fc.c        | 377 +++++++++++++++++++++++
 drivers/net/softnic/rte_eth_softnic_internals.h | 162 +++++++++-
 mk/rte.app.mk                                   |   2 +
 6 files changed, 937 insertions(+), 11 deletions(-)
 create mode 100644 drivers/net/softnic/rte_eth_softnic_fc.c
drivers/net/softnic/Makefile +1 -1
index 09ed62e..4f7f6c9 100644
@@ -51,7 +51,7 @@ LIBABIVER := 1
 #
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += rte_eth_softnic.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += rte_eth_softnic_tm.c
-
+SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += rte_eth_softnic_fc.c
 #
 # Export include files
 #
drivers/net/softnic/rte_eth_softnic.c +380 -9

522 lines not on this page · raw message

drivers/net/softnic/rte_eth_softnic.h +16 -0
index b49e582..1dd17b1 100644
@@ -56,6 +56,22 @@ extern "C" {
 #define SOFTNIC_SOFT_TM_DEQ_BSZ				24
 #endif
 
+#ifndef SOFTNIC_SOFT_FC_NB_RULES
+#define SOFTNIC_SOFT_FC_NB_RULES			4096
+#endif
+
+#ifndef SOFTNIC_SOFT_FC_FLOW_RULE_KEY_SIZE
+#define SOFTNIC_SOFT_FC_FLOW_RULE_KEY_SIZE		16
+#endif
+
+#ifndef SOFTNIC_SOFT_FC_FLOW_RULE_KEY_OFFSET
+#define SOFTNIC_SOFT_FC_FLOW_RULE_KEY_OFFSET		278
+#endif
+
+#ifndef SOFTNIC_SOFT_FC_FLOW_RULE_KEY_MAX_SIZE
+#define SOFTNIC_SOFT_FC_FLOW_RULE_KEY_MAX_SIZE		64
+#endif
+
 #ifndef SOFTNIC_HARD_TX_QUEUE_ID
 #define SOFTNIC_HARD_TX_QUEUE_ID			0
 #endif
drivers/net/softnic/rte_eth_softnic_fc.c new file +377 -0

377 lines not on this page · raw message

drivers/net/softnic/rte_eth_softnic_internals.h +161 -1

215 lines not on this page · raw message

mk/rte.app.mk +2 -0
index 6a6a745..72d684c 100644
@@ -60,7 +60,9 @@ _LDLIBS-y += -L$(RTE_SDK_BIN)/lib
 #
 _LDLIBS-$(CONFIG_RTE_LIBRTE_FLOW_CLASSIFY)  += -lrte_flow_classify
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE)       += -lrte_pipeline
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)            += --whole-archive
 _LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)          += -lrte_table
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)            += --no-whole-archive
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PORT)           += -lrte_port
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PDUMP)          += -lrte_pdump
Signature · 1 line
2.9.3
#5 lore raw

PATCH 2/2 net/softnic: add flow classification ops

In reply to Jasvinder Singh

To manage and configure flow rules, implements operations to validate, create, destroy and flush the flow rules.

---
 drivers/net/softnic/rte_eth_softnic_fc.c | 311 ++++++++++++++++++++++++++++++-
 1 file changed, 307 insertions(+), 4 deletions(-)
drivers/net/softnic/rte_eth_softnic_fc.c +307 -4
index 83f7fd3..e41eb57 100644
@@ -330,6 +330,9 @@ fc_flow_uninit(struct pmd_internals *p)
 			break;
 
 		TAILQ_REMOVE(&p->soft.fc.flow_list, flow, node);
+
+		free(flow->pattern);
+		free(flow->actions);
 		free(flow);
 	}
 }
@@ -369,9 +372,309 @@ fc_free(struct pmd_internals *p)
 	rte_free(p->soft.fc.pkts);
 }
 
+static struct rte_flow *
+fc_flow_search(struct pmd_internals *p,
+	const struct rte_flow_attr *attr,
+	const struct rte_flow_item pattern[],
+	const struct rte_flow_action actions[])
+{
+	struct fc_flow_list *fl = &p->soft.fc.flow_list;
+	struct rte_flow *f;
+	uint32_t n_item, n_act, n_match_params;
+
+	TAILQ_FOREACH(f, fl, node) {
+		n_item = 0;
+		n_act = 0;
+		n_match_params = 0;
+
+		/* Check: Flow attr */
+		if (memcmp(&f->attr,
+			(const void *)attr, sizeof(*attr)))
+			continue;
+		else
+			n_match_params += 1;
+
+		/* Check: Flow pattern */
+		while (pattern[n_item].type != RTE_FLOW_ITEM_TYPE_END) {
+			if (pattern[n_item].type != f->pattern[n_item].type)
+				n_match_params = 0;
+
+			n_item++;
+		}
+
+		if (n_match_params)
+			n_match_params += 1;
+		else
+			continue;
+
+		/* Check: Flow action */
+		while (actions[n_act].type != RTE_FLOW_ACTION_TYPE_END) {
+			if (actions[n_act].type != f->actions[n_act].type)
+				n_match_params = 0;
+
+			n_act++;
+		}
+
+		if (n_match_params)
+			n_match_params += 1;
+		else
+			continue;
+
+		if (n_match_params == 3)
+			return f;
+	}
+	return NULL;
+}
+
+static int rule_add_check(struct pmd_internals *p,
+	const struct rte_flow_attr *attr,
+	const struct rte_flow_item pattern[],
+	const struct rte_flow_action actions[],
+	struct rte_flow_error *error)
+{
+	struct rte_flow *flow;
+	uint32_t n_flow_rules;
+
+	/** Check: Number of rules */
+	n_flow_rules = p->soft.fc.n_flow_rules;
+	if (n_flow_rules >= p->params.soft.fc.nb_rules) {
+		rte_flow_error_set(error,
+		EINVAL,
+		RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+		NULL,
+		"Number of Flow rule exceeds.");
+		return -EINVAL;
+	}
+
+	flow = fc_flow_search(p, attr, pattern, actions);
+	if (flow != NULL) {
+		rte_flow_error_set(error,
+		EEXIST,
+		RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+		NULL,
+		"Flow rule exists.");
+		return -EEXIST;
+	}
+
+	return 0;
+}
+
+/* Flow rule validate */
+static int
+pmd_flow_validate(__rte_unused 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_flow_error *error)
+{
+	if (!pattern) {
+		rte_flow_error_set(error,
+			EINVAL,
+			RTE_FLOW_ERROR_TYPE_ITEM_NUM,
+			NULL,
+			"NULL pattern.");
+		return -rte_errno;
+	}
+
+	if (!actions) {
+		rte_flow_error_set(error,
+			EINVAL,
+			RTE_FLOW_ERROR_TYPE_ACTION_NUM,
+			NULL,
+			"NULL action.");
+		return -rte_errno;
+	}
+
+	if (!attr) {
+		rte_flow_error_set(error,
+			EINVAL,
+			RTE_FLOW_ERROR_TYPE_ATTR,
+			NULL,
+			"NULL attribute.");
+		return -rte_errno;
+	}
+
+	/* Add validate function */
+
+	return 0;
+}
+
+/* Create flow rule */
+static struct rte_flow *
+pmd_flow_create(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_flow_error *error)
+{
+	struct pmd_internals *p = dev->data->dev_private;
+	struct fc_flow_list *fl = &p->soft.fc.flow_list;
+	struct rte_flow *f;
+	uint32_t n_item = 0, n_act = 0;
+	int status;
+
+	/** Check: Attributes */
+	if (!attr) {
+		rte_flow_error_set(error,
+			EINVAL,
+			RTE_FLOW_ERROR_TYPE_ATTR,
+			NULL,
+			"NULL attribute.");
+		return NULL;
+	}
+
+	/** Check: Pattern */
+	if (!pattern) {
+		rte_flow_error_set(error,
+			EINVAL,
+			RTE_FLOW_ERROR_TYPE_ITEM_NUM,
+			NULL,
+			"NULL pattern.");
+		return NULL;
+	}
+
+	/** Check: Actions */
+	if (!actions) {
+		rte_flow_error_set(error,
+			EINVAL,
+			RTE_FLOW_ERROR_TYPE_ACTION_NUM,
+			NULL,
+			"NULL action.");
+		return NULL;
+	}
+
+	/** Check: Rule */
+	status = rule_add_check(p, attr, pattern, actions, error);
+	if (status)
+		return NULL;
+
+	/** Add rule to the table */
+
+	/* Memory allocation */
+	f = calloc(1, sizeof(struct rte_flow));
+	if (f == NULL) {
+		rte_flow_error_set(error,
+		ENOMEM,
+		RTE_TM_ERROR_TYPE_UNSPECIFIED,
+		NULL,
+		"Failed to create flow.");
+		return NULL;
+	}
+
+	/** Add attr to list */
+	memcpy((void *)&f->attr, (const void *)attr,  sizeof(*attr));
+
+	/** Allocate for pattern */
+	while ((pattern + n_item)->type != RTE_FLOW_ITEM_TYPE_END)
+		n_item++;
+
+	n_item++;
+
+	f->pattern = calloc(n_item, sizeof(struct rte_flow_item));
+	if (f->pattern) {
+		rte_flow_error_set(error,
+		ENOMEM,
+		RTE_TM_ERROR_TYPE_UNSPECIFIED,
+		NULL,
+		"Failed to create flow.");
+		return NULL;
+	}
+
+	/** Add pattern */
+	memcpy((void *)f->pattern, (const void *)pattern,  sizeof(*f->pattern));
+
+	/** Allocate for action */
+	while ((actions + n_act)->type != RTE_FLOW_ACTION_TYPE_END)
+		n_act++;
+
+	n_act++;
+
+	f->actions = calloc(n_act, sizeof(struct rte_flow_action));
+	if (f->actions) {
+		rte_flow_error_set(error,
+		ENOMEM,
+		RTE_TM_ERROR_TYPE_UNSPECIFIED,
+		NULL,
+		"Failed to create flow.");
+		return NULL;
+	}
+
+	/** Add actions */
+	memcpy((void *)f->actions, (const void *)actions,  sizeof(*f->actions));
+
+	TAILQ_INSERT_TAIL(fl, f, node);
+	p->soft.fc.n_flow_rules++;
+
+	return f;
+}
+
+/* Destroy flow rule */
+static int
+pmd_flow_destroy(struct rte_eth_dev *dev,
+	struct rte_flow *flow,
+	struct rte_flow_error *error)
+{
+	struct pmd_internals *p = dev->data->dev_private;
+	struct fc_flow_list *fl = &p->soft.fc.flow_list;
+	struct rte_flow *f;
+
+	/** Check: flow */
+	if (!flow) {
+		rte_flow_error_set(error,
+			EINVAL,
+			RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+			NULL,
+			"NULL flow.");
+		return -EINVAL;
+	}
+	/* Check existing */
+	f = fc_flow_search(p, &flow->attr, flow->pattern, flow->actions);
+	if (f == NULL) {
+		rte_flow_error_set(error,
+			EINVAL,
+			RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+			NULL,
+			"Flow not exist");
+			return -EINVAL;
+	}
+
+	/** Remove from Classifier table */
+
+	/** Remove from list */
+	TAILQ_REMOVE(fl, f, node);
+	p->soft.fc.n_flow_rules--;
+	free(f);
+
+	return 0;
+}
+
+/* Destroy flow rules */
+static int
+pmd_flow_flush(struct rte_eth_dev *dev,
+	__rte_unused struct rte_flow_error *error)
+{
+	struct pmd_internals *p = dev->data->dev_private;
+
+	for ( ; ; ) {
+		struct rte_flow *f;
+
+		f = TAILQ_FIRST(&p->soft.fc.flow_list);
+		if (f == NULL)
+			break;
+
+		/** Remove from Classifier table */
+
+		/** Remove from list */
+		TAILQ_REMOVE(&p->soft.fc.flow_list, f, node);
+		free(f);
+	}
+
+	return 0;
+}
+
 const struct rte_flow_ops pmd_flow_ops = {
-	.validate = NULL,
-	.create = NULL,
-	.destroy = NULL,
-	.flush = NULL,
+	.validate = pmd_flow_validate,
+	.create = pmd_flow_create,
+	.destroy = pmd_flow_destroy,
+	.flush = pmd_flow_flush,
 };
Signature · 1 line
2.9.3
#6 lore raw
In reply to Jasvinder Singh
Quoted 19 lines · Jasvinder Singh

This patchset extends the softnic device by implementing the software fallback for flow classification as defined using Flow APIs. When feature is enabled, softnic classifies and executes actions on the received packets based on flow rules specified using rte_flow.h.

The motivation behind this feature is to implement metering and policing function in softnic which requires each flow to be classified at the preceding stage of the packet processing pipeline. Another aspect is to support classification of the greater number of flows (For e.g. 64K) which is not feasible in some hardware due to resource limitation such as memory, etc.

This feature, inherently, uses the abstraction provided by dpdk librte_table library to create hash table for classification, and allows users to validate, add and delete flow rules. Current version does not implement all functions and will be completed in the next version.

Quoted 3 lines

Jasvinder Singh (2):
net/softnic: add flow classification support
net/softnic: add flow classification ops

Hi Jasvinder,

I was about to ask adding documentation for "software fallback for flow classification" but it seems there is no documentation at all for softnic, it seems we missed it, and softnic is a complex PMD which requires some documentation I believe.
Can you please add documentation including new flow classification fallback info?

And I am getting some build errors [1][2].

Thanks,
ferruh

[1]
.../dpdk/drivers/net/softnic/rte_eth_softnic_fc.c:558:3: error: implicit conversion from enumeration type 'enum rte_tm_error_type' to different enumeration type 'enum rte_flow_error_type' [-Werror,-Wenum-conversion]

                RTE_TM_ERROR_TYPE_UNSPECIFIED,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../dpdk/drivers/net/softnic/rte_eth_softnic_fc.c:577:3: error: implicit
conversion from enumeration type 'enum rte_tm_error_type' to different
enumeration type 'enum rte_flow_error_type' [-Werror,-Wenum-conversion]
                RTE_TM_ERROR_TYPE_UNSPECIFIED,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../dpdk/drivers/net/softnic/rte_eth_softnic_fc.c:596:3: error: implicit
conversion from enumeration type 'enum rte_tm_error_type' to different
enumeration type 'enum rte_flow_error_type' [-Werror,-Wenum-conversion]
                RTE_TM_ERROR_TYPE_UNSPECIFIED,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[2]
.../dpdk/drivers/net/softnic/rte_eth_softnic_fc.c: In function ‘pmd_flow_create’:
.../dpdk/drivers/net/softnic/rte_eth_softnic_fc.c:584:2: error: argument 1 null where non-null expected [-Werror=nonnull]
memcpy((void *)f->pattern, (const void *)pattern, sizeof(*f->pattern)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#2 lore raw

Re: [PATCH 1/2] net/softnic: enable flow classification function

In reply to Jasvinder Singh
Quoted 10 lines · Jasvinder Singh

Enables flow classification on softnic rx path so that proceding functions of the packet processing pipeline such as metering and policing could be implemented.

Example: Create "soft" port for "hard" port "0000:02:00.1", enable the Flow Classification (FC) feature with default settings:
--vdev 'net_softnic0,hard_name=0000:02:00.1,soft_fc=on'

<...>

drivers/net/softnic/rte_eth_softnic.c line 71

Quoted 8 lines
drivers/net/softnic/rte_eth_softnic.c +6 -0
+#define PMD_PARAM_SOFT_FC					"soft_fc"
+#define PMD_PARAM_SOFT_FC_NB_RULES			"soft_fc_nb_rules"
+#define PMD_PARAM_SOFT_FC_FLOW_KEY_SIZE		"soft_fc_flow_key_size"
+#define PMD_PARAM_SOFT_FC_FLOW_KEY_OFFSET	"soft_fc_flow_key_offset"
+#define PMD_PARAM_SOFT_FC_FLOW_KEY_MASK		"soft_fc_flow_key_mask"
+
 #define PMD_PARAM_HARD_NAME					"hard_name"
 #define PMD_PARAM_HARD_TX_QUEUE_ID			"hard_tx_queue_id"

I wouldn't mention if you won't be already sending a new version but can you please align them :)

<...>

mk/rte.app.mk _LDLIBS-y += -L$(RTE_SDK_BIN)/lib · line 65

Quoted 7 lines
mk/rte.app.mk +2 -0
@@ -60,7 +60,9 @@ _LDLIBS-y += -L$(RTE_SDK_BIN)/lib
 #
 _LDLIBS-$(CONFIG_RTE_LIBRTE_FLOW_CLASSIFY)  += -lrte_flow_classify
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE)       += -lrte_pipeline
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)            += --whole-archive
 _LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)          += -lrte_table
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)            += --no-whole-archive

I think it is better to move rte_table between whole-archive flags, but I vaguely remember Thomas preferred this in the past, so adding him for comment.

#3 lore raw

Re: [PATCH 1/2] net/softnic: enable flow classification function

07/12/2017 22:02, Ferruh Yigit:

Quoted 9 lines · Jasvinder Singh

mk/rte.app.mk _LDLIBS-y += -L$(RTE_SDK_BIN)/lib · line 65

Quoted 5 lines

_LDLIBS-$(CONFIG_RTE_LIBRTE_FLOW_CLASSIFY) += -lrte_flow_classify
_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline

mk/rte.app.mk +2 -0
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)            += --whole-archive
 _LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)          += -lrte_table
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)            += --no-whole-archive

I think it is better to move rte_table between whole-archive flags, but I vaguely remember Thomas preferred this in the past, so adding him for comment.

Yes it is good to keep the order, and insert whole-archive flags where necessary.

Ideally we should not require these flags. Just checking: you need them for static link of libs while dynamically linking the PMDs, right?

#7 lore raw
In reply to Ferruh Yigit

HI Ferruh,

Quoted 55 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Thursday, December 7, 2017 9:02 PM
To: Singh, Jasvinder <[email protected]>; [email protected]
Cc: Dumitrescu, Cristian <[email protected]>
Subject: Re: [PATCH 0/2] net/softnic: add flow classification support

Quoted 18 lines · Jasvinder Singh

This patchset extends the softnic device by implementing the software fallback for flow classification as defined using Flow APIs. When feature is enabled, softnic classifies and executes actions on the received packets based on flow rules specified using rte_flow.h.

The motivation behind this feature is to implement metering and policing function in softnic which requires each flow to be classified at the preceding stage of the packet processing pipeline. Another aspect is to support classification of the greater number of flows (For e.g. 64K) which is not feasible in some hardware due to resource limitation such as memory, etc.

This feature, inherently, uses the abstraction provided by dpdk librte_table library to create hash table for classification, and allows users to validate, add and delete flow rules. Current version does not implement all functions and will be completed in the next version.

Quoted 3 lines

Jasvinder Singh (2):
net/softnic: add flow classification support
net/softnic: add flow classification ops

Hi Jasvinder,

I was about to ask adding documentation for "software fallback for flow classification" but it seems there is no documentation at all for softnic, it seems we missed it, and softnic is a complex PMD which requires some documentation I believe.
Can you please add documentation including new flow classification fallback info?

And I am getting some build errors [1][2].

Thanks,
ferruh

[1]
.../dpdk/drivers/net/softnic/rte_eth_softnic_fc.c:558:3: error: implicit conversion from enumeration type 'enum rte_tm_error_type' to different enumeration type 'enum rte_flow_error_type' [-Werror,-Wenum- conversion]

                RTE_TM_ERROR_TYPE_UNSPECIFIED,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.../dpdk/drivers/net/softnic/rte_eth_softnic_fc.c:577:3: error: implicit conversion from enumeration type 'enum rte_tm_error_type' to different enumeration type 'enum rte_flow_error_type' [-Werror,-Wenum- conversion]

Quoted 8 lines
                RTE_TM_ERROR_TYPE_UNSPECIFIED,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.../dpdk/drivers/net/softnic/rte_eth_softnic_fc.c:596:3: error: implicit conversion from enumeration type 'enum rte_tm_error_type' to different enumeration type 'enum rte_flow_error_type' [-Werror,-Wenum- conversion]

                RTE_TM_ERROR_TYPE_UNSPECIFIED,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Copy-paste error :(
will fix this.

Quoted 9 lines

[2]
.../dpdk/drivers/net/softnic/rte_eth_softnic_fc.c: In function ‘pmd_flow_create’:
.../dpdk/drivers/net/softnic/rte_eth_softnic_fc.c:584:2: error: argument 1 null where non-null expected [-Werror=nonnull]
memcpy((void *)f->pattern, (const void *)pattern, sizeof(*f->pattern));

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~

Will fix this.

Regarding documentation, I have to add that in programmer's guide.

Thanks,
Jasvinder

#4 lore raw

Re: [PATCH 1/2] net/softnic: enable flow classification function

In reply to Ferruh Yigit

Hi Ferruh,

Quoted 32 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Thursday, December 7, 2017 9:03 PM
To: Singh, Jasvinder <[email protected]>; [email protected]
Cc: Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>
Subject: Re: [PATCH 1/2] net/softnic: enable flow classification function

Quoted 10 lines · Jasvinder Singh

Enables flow classification on softnic rx path so that proceding functions of the packet processing pipeline such as metering and policing could be implemented.

Example: Create "soft" port for "hard" port "0000:02:00.1", enable the Flow Classification (FC) feature with default
settings:
--vdev 'net_softnic0,hard_name=0000:02:00.1,soft_fc=on'

<...>

Quoted 1 line

+#define PMD_PARAM_SOFT_FC

	"soft_fc"
Quoted 1 line

+#define PMD_PARAM_SOFT_FC_NB_RULES

	"soft_fc_nb_rules"
Quoted 1 line

+#define PMD_PARAM_SOFT_FC_FLOW_KEY_SIZE

	"soft_fc_flow_key_size"
Quoted 1 line

+#define PMD_PARAM_SOFT_FC_FLOW_KEY_OFFSET

"soft_fc_flow_key_offset"

Quoted 1 line

+#define PMD_PARAM_SOFT_FC_FLOW_KEY_MASK

	"soft_fc_flow_key_mask"
Quoted 8 lines
Quoted 2 lines

+
#define PMD_PARAM_HARD_NAME

	"hard_name"
Quoted 1 line

#define PMD_PARAM_HARD_TX_QUEUE_ID

	"hard_tx_queue_id"

I wouldn't mention if you won't be already sending a new version but can you please align them :)

Yes, will take care of alignment in next version.

Quoted 12 lines

<...>

mk/rte.app.mk _LDLIBS-y += -L$(RTE_SDK_BIN)/lib # · line 64

Quoted 6 lines
mk/rte.app.mk +2 -0
@@ -60,7 +60,9 @@ _LDLIBS-y += -L$(RTE_SDK_BIN)/lib  #
 _LDLIBS-$(CONFIG_RTE_LIBRTE_FLOW_CLASSIFY)  += -lrte_flow_classify
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE)       += -lrte_pipeline
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)            += --whole-archive
 _LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)          += -lrte_table
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE)            += --no-whole-archive

I think it is better to move rte_table between whole-archive flags, but I vaguely remember Thomas preferred this in the past, so adding him for comment.

Yes, I followed what Thomas suggested once. The order should be protected and flags should be inserted without changing the order.

Thanks,
Jasvinder