DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org
Cc: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Subject: [dpdk-dev] [PATCH v2 3/9] net/mlx5: support ether type support in flow item
Date: Wed,  1 Mar 2017 13:49:42 +0100	[thread overview]
Message-ID: <e715c8c44b7238d5db169629c979a5fff720aa78.1488372438.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <cover.1488372438.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <cover.1488372438.git.nelio.laranjeiro@6wind.com>

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 0712926..d3c0661 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -163,6 +163,7 @@ static const struct mlx5_flow_items mlx5_flow_items[] = {
 		.mask = &(const struct rte_flow_item_eth){
 			.dst.addr_bytes = "\xff\xff\xff\xff\xff\xff",
 			.src.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+			.type = -1,
 		},
 		.default_mask = &rte_flow_item_eth_mask,
 		.mask_sz = sizeof(struct rte_flow_item_eth),
@@ -552,13 +553,16 @@ mlx5_flow_create_eth(const struct rte_flow_item *item,
 		mask = default_mask;
 	memcpy(eth->val.dst_mac, spec->dst.addr_bytes, ETHER_ADDR_LEN);
 	memcpy(eth->val.src_mac, spec->src.addr_bytes, ETHER_ADDR_LEN);
+	eth->val.ether_type = spec->type;
 	memcpy(eth->mask.dst_mac, mask->dst.addr_bytes, ETHER_ADDR_LEN);
 	memcpy(eth->mask.src_mac, mask->src.addr_bytes, ETHER_ADDR_LEN);
+	eth->mask.ether_type = mask->type;
 	/* Remove unwanted bits from values. */
 	for (i = 0; i < ETHER_ADDR_LEN; ++i) {
 		eth->val.dst_mac[i] &= eth->mask.dst_mac[i];
 		eth->val.src_mac[i] &= eth->mask.src_mac[i];
 	}
+	eth->val.ether_type &= eth->mask.ether_type;
 	return 0;
 }
 
-- 
2.1.4

  parent reply	other threads:[~2017-03-01 12:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1488364873.git.nelio.laranjeiro@6wind.com>
2017-03-01 12:49 ` [dpdk-dev] [PATCH v2 0/9] net/mlx5: enhance flow API Nelio Laranjeiro
2017-03-03 23:36   ` Ferruh Yigit
2017-03-04 12:42   ` Ferruh Yigit
2017-03-01 12:49 ` [dpdk-dev] [PATCH v2 1/9] net/mlx5: fix drop queue creation error Nelio Laranjeiro
2017-03-01 12:49 ` [dpdk-dev] [PATCH v2 2/9] net/mlx5: fix resources free in the right function Nelio Laranjeiro
2017-03-01 12:49 ` Nelio Laranjeiro [this message]
2017-03-01 12:49 ` [dpdk-dev] [PATCH v2 4/9] net/mlx5: add RSS hash result with mark id Nelio Laranjeiro
2017-03-01 12:49 ` [dpdk-dev] [PATCH v2 5/9] net/mlx5: extend IPv6 flow item Nelio Laranjeiro
2017-03-01 12:49 ` [dpdk-dev] [PATCH v2 6/9] net/mlx5: support flag flow action Nelio Laranjeiro
2017-03-01 12:49 ` [dpdk-dev] [PATCH v2 7/9] net/mlx5: prepare support for RSS action rule Nelio Laranjeiro
2017-03-01 12:49 ` [dpdk-dev] [PATCH v2 8/9] net/mlx5: support RSS action flow rule Nelio Laranjeiro
2017-03-01 12:49 ` [dpdk-dev] [PATCH v2 9/9] net/mlx5: use an RSS drop queue Nelio Laranjeiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e715c8c44b7238d5db169629c979a5fff720aa78.1488372438.git.nelio.laranjeiro@6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).