From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0064.outbound.protection.outlook.com [104.47.0.64]) by dpdk.org (Postfix) with ESMTP id 2BAA223A for ; Sun, 6 May 2018 08:07:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=O7T+6my/bMIjPwH+p3OjWHjrlyJatv+WDVLCaDXqSrs=; b=CSkUBFnNANEWrXIZOgApNlIJ7WbL6WUxWv6WgvbgSD+yQnoPdoXK91i4O+aVc00M9nVJp95W+wCOV6itdKI4NDbl3hT9OmKU154VwaBVAejP2OE+tGpW38IgsHkplqARmqEn+TsCon/XhWv2b6OwTcFUGuFjpH/RV0qExI76DGY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (141.226.120.58) by AM6PR05MB4422.eurprd05.prod.outlook.com (2603:10a6:209:43::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.16; Sun, 6 May 2018 06:06:58 +0000 From: Shahaf Shuler To: bluca@debian.org Cc: stable@dpdk.org, nelio.laranjeiro@6wind.com, yskoh@mellanox.com, adrien.mazarguil@6wind.com Date: Sun, 6 May 2018 09:05:57 +0300 Message-Id: <34b1fa4cfba6838ede531b7f6fbe2e7c1db47094.1525586526.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 In-Reply-To: References: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Originating-IP: [141.226.120.58] X-ClientProxiedBy: LO2P265CA0008.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::20) To AM6PR05MB4422.eurprd05.prod.outlook.com (2603:10a6:209:43::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4422; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 3:SfYuqGM84PFK8UUjdoA/tY90KB7b7V4LqUtkuQ4o6bY2C+apKQPZD+XuXEseNZsLSwJeUwIg/T6W7HRbhHufwL54kbBTnnAFu5CWn5nXHJI1RiV75ArOW/qt17o7VCVB/lcGxeDUOyW/hoGm+/fbtShnzxXBHvWmhVE60e5govn+IshXrW7Tip813LhOOup5yVQwvw1s64WmVS88Vtma0Giw07r91OdpKINIqHO0FzTUgENxLKkYu5I1bsgUx1Rn; 25:lBtUouPvuEt7RB2C0jBJ22zrO+atSi6pH8mt7GhcLfcCGgGTky8Z/zn3q6XYeV+dbWQtN+prNLj2XTYjK0tL6KOu9jhdhKjUdv5R1rH/5vXxIkZUuPw4cFA+Ta81FqI3Vc0x3zVOEP5aILGHj8ilhtYq8cF9TNkrhsxagjsKRT5SwRJt8JH6fwp9IVKKkWJM0mi8XZiHFr9VJR/RyHj5tWgbk7lfyaNcMj8kFHAxbzfLyieOVcoJbKaWkEhPQaWZiOMlZIT3MhGJ18ZF/XLuxgeBIY+Cd7dxBKJ4V45PeRX4rxz0ydGMxupHPFTcjFjVIHWcKtCamU8cR5KY+JA0dg==; 31:Z5/VN6Mj4tT/w0wZLfgTomXHEo1fEVQ2LfojcpCQXU3mvqSaWqkb6Aw1NgTnb7m3xTZNpTzL9Bd6BY/6QfEoKcpY2/GZDVFczYXV9DI8Txsh5zpE0jG7Ay7niy4/J14p8SOqk1wXGKTMaz9CXEAcZiVwoGJ+l39LSFB1XRFl/y+0FcIYcHt5/FBkWTI2ej63pWSTXUAq/Re3brKXHf0kQRCme9a5LK27/Xi578DVgjs= X-MS-TrafficTypeDiagnostic: AM6PR05MB4422: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 20:ENKT/vdZ6jn+KUd1rGmP3cC57FUZEuv9LOR05m1o2xs5mGGD860N+NVhjFFsKFetYt8uT6Kg8wIdgcVStD06XA3gTb5TBBIXYgNAw267/IZBCzOm36Ix8fKv4jhQMw4w5p6GVFnKJ+za9X6aKLSCXSIMbX4fg0DrFI7te4k9bV1rlCIa83NKa2gZznYxNZB6PPkehrCOBfI0lq9qSk2LvrzvRMyWWyXBXJVN3mk9ulHA3Jr8VYBJCxrRFgc7Uc6SaNZd13resSdfkd5rtgZp6KDv4Hw2Vjdmmb64NibyE5kL7tngIGpf1M2ysbsKL7wrTwbYBv/pEo1ZBhmR/9/oSDtQldlcQnBq9ZzehtGbJURrMMP1CzjDz3Gkkqg8OmncLaOjSZ3M+szQPzNyVCctquXvJZCeYX8+NcJPyszfcbjOAj4DDoQAKRU6ubIhhoxiGHQkuEdF9hmgPc/xce7uUxHRrzmRGuQSpvR7Q0UU/GcAqJ8FElbK4C20ES1fHJyC; 4:kOCvOBoip7+NBtA07v9rDlZlplRcLDQIvoDuHg85ToBoj6uZc3ZqRIk6+2abmsSWZU14XVpHWx4BP29ZFs4EAyE62vpBhokRfFpFuNhn3aKEqJyvffpKku0C6wXgITFIOhzXKn5IDQd4gRKzQGq5o2wfG6Op0quYgGfOKRqUybGPkHVQEf1bJOS541OJ/BPvM7L7Qhf4/f3txvnQ0oc/vTXxsJdu919C1hj3Xl9h9HbdIvs8+X468aBUhZBeg+gDL8bjx79VHqledDNgyyXY9Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:AM6PR05MB4422; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4422; X-Forefront-PRVS: 06640999CA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39380400002)(396003)(346002)(39860400002)(189003)(199004)(105586002)(8676002)(8936002)(316002)(2351001)(53936002)(86362001)(575784001)(2361001)(6116002)(3846002)(106356001)(118296001)(66066001)(36756003)(47776003)(81156014)(55016002)(2906002)(2870700001)(50226002)(4326008)(68736007)(305945005)(7736002)(81166006)(50466002)(25786009)(486006)(5660300001)(476003)(2616005)(69596002)(16526019)(26005)(59450400001)(386003)(97736004)(956004)(186003)(478600001)(7696005)(52116002)(23676004)(6916009)(21086003)(446003)(11346002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4422; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTZQUjA1TUI0NDIyOzIzOk1pRG1Yc0VWaDNCODByN2piNmtEV2NaTzdO?= =?utf-8?B?NWpuNjQzWWtuTDR4bmV3cG1RQTZ5cWxNUUpxRVBWQ2ovNEs2UjQweDJJZFhK?= =?utf-8?B?Q2Fsa1BnN2FrNVVwWWt2VHNFcjEzTHpkZ3RXWStLRWlQYm5pZDhkVDkyWUs1?= =?utf-8?B?aWJ0OTB3YzlPakViSWFZQnVIWGhEVjR2RUlwa2ZrSkNYS2VjZHczdVZQOGNw?= =?utf-8?B?T1RkdnBSYVRhOXg5UG4yU0RWUTMvZWJVeG9yOEUvUU1VRlp6MXdxeDNRS3Qy?= =?utf-8?B?akFnTmJLdmVDVFRHMFRab2ljOU9hdDhRc25nMjVIQngzN3pTM3hhMXp6Yk5z?= =?utf-8?B?V1JyOFVJa0o4dVU3RVRtbmQwZ3Nicyt6Q3cwZHYwdklidkJyc1ByblR0eHZt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zP0vpGXK5eyBbVw1K2BYqjK8wHNGrc+EvSERdh6WY3GOcAOx7AYtF5zT8UVqQHYJggyWE4zLReYZmfmjIdjw1eyDTJ1InQ2RmBgiP+t0g4ALIg11T9IYIFDkHrQzpG+JUoPcNdEpfYh3ErO7m0rP+sqXQ==; 5:5O9O41i19/8WIxOky6vLNlblEEEN/LgouiY/MwGPOKoWxugrrbjmeSqBet+iZB6Azr7LLmlazgwPBqSdlxYhchRJk7Y+q9fVJaHxTRFgpdIuHw+5QrtvEuBvm9zQNHTkMqd0NRL6aBlLPg4ftvw86LK+FrvaxaJ14hRTYPYW1H4=; 24:bfxLsWnqnVGbX04bi9RY+mwYsCgOWXvN9BRP4oqsZHakBpnSxmUQIbxCsENiVy8qYJcekvEVZHktDiRemFpBmqyAGDITLds6StIDTd0CTnQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 7:KYXax2kR6jCU/uztO+NyIujT6hfsNbt+w2ODuu+UDsQNFT3dTP9i+GOrsucEbjuSap2+Q1dmt1VdfdGmZOFlaCYUfUHAvI6sHeU7btWoRcdeYxA9ycXr0Dlbg7ObjQXPxHEQUqmmmV3JNIQOIbWAelXcZ+VUmoNRL6bL1sq5Dgv864W+j6eZ83THHN3EvCpt7HY6a7WN4dk5sskTs6ISSX1hdur8DiFSGLuVLtbrk799xFNlfhXSbQPFI+gcl578 X-MS-Office365-Filtering-Correlation-Id: 58874f23-3eb1-4191-a332-08d5b31793c4 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2018 06:06:58.2237 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58874f23-3eb1-4191-a332-08d5b31793c4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4422 Subject: [dpdk-stable] [PATCH 28/33] net/mlx5: fix flow director mask X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2018 06:07:00 -0000 From: NĂ©lio Laranjeiro [ upstream commit 3c0db1ab516498e96b42fa804a3cf14e0ccf7647 ] During the transition to resurrect flow director on top of rte_flow, mask handling was removed by mistake. Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director") Cc: stable@dpdk.org Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5_flow.c | 56 +++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 6a7d578cf1..5bae8ee885 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -438,9 +438,17 @@ struct mlx5_fdir { struct rte_flow_item_ipv6 ipv6; } l3; union { + struct rte_flow_item_ipv4 ipv4; + struct rte_flow_item_ipv6 ipv6; + } l3_mask; + union { struct rte_flow_item_udp udp; struct rte_flow_item_tcp tcp; } l4; + union { + struct rte_flow_item_udp udp; + struct rte_flow_item_tcp tcp; + } l4_mask; struct rte_flow_action_queue queue; }; @@ -2619,6 +2627,8 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev, { struct priv *priv = dev->data->dev_private; const struct rte_eth_fdir_input *input = &fdir_filter->input; + const struct rte_eth_fdir_masks *mask = + &dev->data->dev_conf.fdir_conf.mask; /* Validate queue number. */ if (fdir_filter->action.rx_queue >= priv->rxqs_n) { @@ -2662,29 +2672,43 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev, .type_of_service = input->flow.ip4_flow.tos, .next_proto_id = input->flow.ip4_flow.proto, }; + attributes->l3_mask.ipv4.hdr = (struct ipv4_hdr){ + .src_addr = mask->ipv4_mask.src_ip, + .dst_addr = mask->ipv4_mask.dst_ip, + .time_to_live = mask->ipv4_mask.ttl, + .type_of_service = mask->ipv4_mask.tos, + .next_proto_id = mask->ipv4_mask.proto, + }; attributes->items[1] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_IPV4, .spec = &attributes->l3, - .mask = &attributes->l3, + .mask = &attributes->l3_mask, }; break; case RTE_ETH_FLOW_NONFRAG_IPV6_UDP: case RTE_ETH_FLOW_NONFRAG_IPV6_TCP: case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER: attributes->l3.ipv6.hdr = (struct ipv6_hdr){ - .hop_limits = input->flow.udp6_flow.ip.hop_limits, - .proto = input->flow.udp6_flow.ip.proto, + .hop_limits = input->flow.ipv6_flow.hop_limits, + .proto = input->flow.ipv6_flow.proto, }; + memcpy(attributes->l3.ipv6.hdr.src_addr, input->flow.ipv6_flow.src_ip, RTE_DIM(attributes->l3.ipv6.hdr.src_addr)); memcpy(attributes->l3.ipv6.hdr.dst_addr, input->flow.ipv6_flow.dst_ip, RTE_DIM(attributes->l3.ipv6.hdr.src_addr)); + memcpy(attributes->l3_mask.ipv6.hdr.src_addr, + mask->ipv6_mask.src_ip, + RTE_DIM(attributes->l3_mask.ipv6.hdr.src_addr)); + memcpy(attributes->l3_mask.ipv6.hdr.dst_addr, + mask->ipv6_mask.dst_ip, + RTE_DIM(attributes->l3_mask.ipv6.hdr.src_addr)); attributes->items[1] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_IPV6, .spec = &attributes->l3, - .mask = &attributes->l3, + .mask = &attributes->l3_mask, }; break; default: @@ -2700,10 +2724,14 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev, .src_port = input->flow.udp4_flow.src_port, .dst_port = input->flow.udp4_flow.dst_port, }; + attributes->l4_mask.udp.hdr = (struct udp_hdr){ + .src_port = mask->src_port_mask, + .dst_port = mask->dst_port_mask, + }; attributes->items[2] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_UDP, .spec = &attributes->l4, - .mask = &attributes->l4, + .mask = &attributes->l4_mask, }; break; case RTE_ETH_FLOW_NONFRAG_IPV4_TCP: @@ -2711,10 +2739,14 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev, .src_port = input->flow.tcp4_flow.src_port, .dst_port = input->flow.tcp4_flow.dst_port, }; + attributes->l4_mask.tcp.hdr = (struct tcp_hdr){ + .src_port = mask->src_port_mask, + .dst_port = mask->dst_port_mask, + }; attributes->items[2] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_TCP, .spec = &attributes->l4, - .mask = &attributes->l4, + .mask = &attributes->l4_mask, }; break; case RTE_ETH_FLOW_NONFRAG_IPV6_UDP: @@ -2722,10 +2754,14 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev, .src_port = input->flow.udp6_flow.src_port, .dst_port = input->flow.udp6_flow.dst_port, }; + attributes->l4_mask.udp.hdr = (struct udp_hdr){ + .src_port = mask->src_port_mask, + .dst_port = mask->dst_port_mask, + }; attributes->items[2] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_UDP, .spec = &attributes->l4, - .mask = &attributes->l4, + .mask = &attributes->l4_mask, }; break; case RTE_ETH_FLOW_NONFRAG_IPV6_TCP: @@ -2733,10 +2769,14 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev, .src_port = input->flow.tcp6_flow.src_port, .dst_port = input->flow.tcp6_flow.dst_port, }; + attributes->l4_mask.tcp.hdr = (struct tcp_hdr){ + .src_port = mask->src_port_mask, + .dst_port = mask->dst_port_mask, + }; attributes->items[2] = (struct rte_flow_item){ .type = RTE_FLOW_ITEM_TYPE_TCP, .spec = &attributes->l4, - .mask = &attributes->l4, + .mask = &attributes->l4_mask, }; break; case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER: -- 2.12.0