From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f181.google.com (mail-wr0-f181.google.com [209.85.128.181]) by dpdk.org (Postfix) with ESMTP id 088485A68 for ; Wed, 1 Mar 2017 13:50:16 +0100 (CET) Received: by mail-wr0-f181.google.com with SMTP id u108so29449672wrb.3 for ; Wed, 01 Mar 2017 04:50:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=kGizfu92Pb8kZjhweGvnGALBK5ApdY2xjxJu2dN0vHk=; b=Z48uCnaqwxqwRhAF7Z3Tpuru1s/qblVLER/mEa89Vx+k0LVLrh34aQD25EhXW6H/WF cVOjmsnjBxNMX2mlzgPj7r/3kWnTBzu06uZLZLKYPSnEpAvBYqNUlz04bY23TMPmRmtV PH1raJoX6uiiQ3RFPpYqBAu7dflznPkeVCVmI/Xw7dFUJct6xotH/aQpVI9RcxVIQ32F J9FXqBqftmNJ7hT7RW7p7mQGbUpKUYUBBiCYyHWqQb9UAdQP4Xy+p1nlkFusRK5kJVYz Y+JUUV74aIcp45MCBQ8crWFS3ie+UQpEh/pY10TAehHaoZ9d0HT6KELndPKeZMeqJrZv 3oAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=kGizfu92Pb8kZjhweGvnGALBK5ApdY2xjxJu2dN0vHk=; b=bNLRxAwE5QGN6dQyNux3/GrhZm3v+C7EtE7btvNpPbytZtmVmnFWI+uhIm9czxT7lK b5xGwNvzjSVG+uZKXBJcC7b94hWVeNg2S1VTb9ViudOJSDyReaECFYtJ9isG3UxhNXPh 6hkeHpPS2ixFBBz5EJQ6It/M1kUCmQLv9tSGQPudOk5cfbHW8MgEpwSXGs5vnn0+LUu5 ayGm0BxRL24kErx1gQEVZUN/+IwFHxj+aHJsUQ1M5Bbfh/y2X+UE0cQvC1Yv26GkttBB knA3ffcvbdrQglh0kz1Bc8zM7Wk+SR5I9n213jmQfqQZNk9mFr2R1zZ/IqI57NxsJvv1 h6/A== X-Gm-Message-State: AMke39klm01B7LjUjSsnnTPROaDMVkWMqg4q5qCkZasALpnDD5ixp2Jho2w+ICq1qpwfD/4J X-Received: by 10.223.151.138 with SMTP id s10mr6906794wrb.65.1488372616688; Wed, 01 Mar 2017 04:50:16 -0800 (PST) Received: from ping.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id l45sm6502268wrc.14.2017.03.01.04.50.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Mar 2017 04:50:16 -0800 (PST) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Adrien Mazarguil Date: Wed, 1 Mar 2017 13:49:44 +0100 Message-Id: <7d57b221415bde3e6da8e20404a5f839bee2bf1d.1488372438.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 5/9] net/mlx5: extend IPv6 flow item X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 12:50:17 -0000 This commit adds: - Vtc flow, - Protocol, - Hop limits Needs MLNX_OFED-4.0-0.0.7.0 or higher. Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5_flow.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index d3c0661..a885f6e 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -217,12 +217,15 @@ static const struct mlx5_flow_items mlx5_flow_items[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }, + .vtc_flow = -1, + .proto = -1, + .hop_limits = -1, }, }, .default_mask = &rte_flow_item_ipv6_mask, .mask_sz = sizeof(struct rte_flow_item_ipv6), .convert = mlx5_flow_create_ipv6, - .dst_sz = sizeof(struct ibv_exp_flow_spec_ipv6), + .dst_sz = sizeof(struct ibv_exp_flow_spec_ipv6_ext), }, [RTE_FLOW_ITEM_TYPE_UDP] = { .items = ITEMS(RTE_FLOW_ITEM_TYPE_VXLAN), @@ -668,15 +671,14 @@ mlx5_flow_create_ipv6(const struct rte_flow_item *item, const struct rte_flow_item_ipv6 *spec = item->spec; const struct rte_flow_item_ipv6 *mask = item->mask; struct mlx5_flow *flow = (struct mlx5_flow *)data; - struct ibv_exp_flow_spec_ipv6 *ipv6; - unsigned int ipv6_size = sizeof(struct ibv_exp_flow_spec_ipv6); - unsigned int i; + struct ibv_exp_flow_spec_ipv6_ext *ipv6; + unsigned int ipv6_size = sizeof(struct ibv_exp_flow_spec_ipv6_ext); ++flow->ibv_attr->num_of_specs; flow->ibv_attr->priority = 1; ipv6 = (void *)((uintptr_t)flow->ibv_attr + flow->offset); - *ipv6 = (struct ibv_exp_flow_spec_ipv6) { - .type = flow->inner | IBV_EXP_FLOW_SPEC_IPV6, + *ipv6 = (struct ibv_exp_flow_spec_ipv6_ext) { + .type = flow->inner | IBV_EXP_FLOW_SPEC_IPV6_EXT, .size = ipv6_size, }; if (!spec) @@ -691,11 +693,12 @@ mlx5_flow_create_ipv6(const struct rte_flow_item *item, RTE_DIM(ipv6->mask.src_ip)); memcpy(ipv6->mask.dst_ip, mask->hdr.dst_addr, RTE_DIM(ipv6->mask.dst_ip)); - /* Remove unwanted bits from values. */ - for (i = 0; i < RTE_DIM(ipv6->val.src_ip); ++i) { - ipv6->val.src_ip[i] &= ipv6->mask.src_ip[i]; - ipv6->val.dst_ip[i] &= ipv6->mask.dst_ip[i]; - } + ipv6->mask.flow_label = mask->hdr.vtc_flow; + ipv6->mask.next_hdr = mask->hdr.proto; + ipv6->mask.hop_limit = mask->hdr.hop_limits; + ipv6->val.flow_label &= ipv6->mask.flow_label; + ipv6->val.next_hdr &= ipv6->mask.next_hdr; + ipv6->val.hop_limit &= ipv6->mask.hop_limit; return 0; } -- 2.1.4