diff mbox

[dpdk-dev,v1,3/4] net/i40e: changes to consistent filter set

Message ID 1488552491-20432-4-git-send-email-bernard.iremonger@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail apply patch file failure

Commit Message

Iremonger, Bernard March 3, 2017, 2:48 p.m. UTC
Set filter.element.flags for QINQ filter.
Minor formatting changes.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 744b4ac..2b0d08a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -6950,10 +6950,10 @@  i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
 	bool big_buffer = 0;
 
 	cld_filter = rte_zmalloc("tunnel_filter",
-	sizeof(struct i40e_aqc_add_remove_cloud_filters_element_big_data),
-	0);
+		sizeof(struct i40e_aqc_add_remove_cloud_filters_element_big_data),
+		0);
 
-	if (cld_filter == NULL) {
+	if (NULL == cld_filter) {
 		PMD_DRV_LOG(ERR, "Failed to alloc memory.");
 		return -EINVAL;
 	}
@@ -7020,11 +7020,15 @@  i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
 		return -EINVAL;
 	}
 
-	val = i40e_dev_get_filter_type(tunnel_filter->filter_type,
-				       &pfilter->element.flags);
-	if (val < 0) {
-		rte_free(cld_filter);
-		return -EINVAL;
+	if (tunnel_filter->tunnel_type == I40E_TUNNEL_TYPE_QINQ)
+		pfilter->element.flags = 0x10;
+	else {
+		val = i40e_dev_get_filter_type(tunnel_filter->filter_type,
+						&pfilter->element.flags);
+		if (val < 0) {
+			rte_free(cld_filter);
+			return -EINVAL;
+		}
 	}
 
 	pfilter->element.flags |= rte_cpu_to_le_16(