From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by dpdk.org (Postfix) with ESMTP id C6D995A for ; Tue, 2 Apr 2019 09:23:28 +0200 (CEST) Received: by mail-pg1-f180.google.com with SMTP id q1so6077954pgv.13 for ; Tue, 02 Apr 2019 00:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=lyjzzUj1VXqO2gWJzS+f3YZ1l50y9d8ejQUV+DI7/DI=; b=Kpu9tyXohGzFGUc2dwUAS/KgLBQ/Yg+UvbLs8vuXJ9ALJA36xIJZ0cklkgNH8UPdoN vdrWr/2+ArI9eEqm6aCpYd5VjDrvpGNgubnRXNwKJTrwKnV1Q05Zhj/rpi+pMfITj9bB F+jDAe+0L2PB/wMb6cO9QOjmCzycRggyTq5MsRXH5FA9kHfSFV8MFNVegGctKAai1SWG bj0n/AAGQJ21n8TbdO/ObgM5YCmQuEk5I+H1V/Patercb+HlagNgtAxARfRBR5S5MGEZ yC7TmxmOk2ManOSj58F2rSF82wwQrketCsY2S0m2sSuGEsBQFl9EyQsREma0LGqtGaA+ a44A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=lyjzzUj1VXqO2gWJzS+f3YZ1l50y9d8ejQUV+DI7/DI=; b=pXTn66RwCB8mksb6p7VYEEgTmwLiVJj6Y6haKodc1MlgpLfij8K+r4DdbkrPDel84M jvybztBhfgHGpuM6Dd6YblQAE6/xIhbEdOPlnrGuPtSu8pxSag0UoUHZTUS1AwRWPdFx EKAmfGSs9Mn52CLRiVBXfOE2zwEf3Z1+MMOlk1jF8j1wRf6tPU6/JhVp2wfB7XR6sEJh iOSiOcpgZ1j+dS7t8dsfKzawWvhAWJLlhllyHD8prZ2ALuOCtuS9MVpRdlY8u7hM+1Ia WzfOZFlnibLBHxy/LOFZSH84qekxPxm+nnBDOf/2EWtqW54kdBRxHqZCFfRtHbelWfvb LaRg== X-Gm-Message-State: APjAAAWvoKWYoJ2ewx0m7xxrbzM431VLqYDKziBDXLT43FiY3hEm5dDi 9vwnG0Fy96TfWrhlL8D3356ywazw X-Google-Smtp-Source: APXvYqyzkxW/ZtMy9+I/6nyUPMtIUMdiKgjGQacCk6MoFeZbslvaVEFKkXvnMwq9DX8y/kaVxvsWXQ== X-Received: by 2002:a63:fc43:: with SMTP id r3mr47225418pgk.44.1554189807871; Tue, 02 Apr 2019 00:23:27 -0700 (PDT) Received: from [10.2.211.140] ([61.120.150.70]) by smtp.gmail.com with ESMTPSA id o89sm21352006pfi.178.2019.04.02.00.23.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 00:23:27 -0700 (PDT) From: benli ye Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Message-Id: <2D0CB568-B970-408A-9463-5D05D201370A@gmail.com> Date: Tue, 2 Apr 2019 15:23:22 +0800 To: dev@dpdk.org X-Mailer: Apple Mail (2.3445.102.3) Subject: [dpdk-dev] mlx5 FDIR rule comparison issue 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: Tue, 02 Apr 2019 07:23:29 -0000 Hi Developers, I am adding two FDIR rule (one is for UDP and the other is for TCP) for = mlx5 pmd driver. The rules are listed below. struct rte_eth_fdir_filter filt[MAX_FDIR_PROTO] =3D { { .input.flow_type =3D RTE_ETH_FLOW_NONFRAG_IPV4_TCP, .input.flow.tcp4_flow.ip.dst_ip =3D dip, .input.flow.tcp4_flow.dst_port =3D dport, .action.behavior =3D RTE_ETH_FDIR_ACCEPT, .action.report_status =3D RTE_ETH_FDIR_REPORT_ID, .soft_id =3D 0, }, { .input.flow_type =3D RTE_ETH_FLOW_NONFRAG_IPV4_UDP, .input.flow.udp4_flow.ip.dst_ip =3D dip, .input.flow.udp4_flow.dst_port =3D dport, .action.behavior =3D RTE_ETH_FDIR_ACCEPT, .action.report_status =3D RTE_ETH_FDIR_REPORT_ID, .soft_id =3D 1, }, }; However, mlx5 lib prevent me to doing this as when it treats the two = rules are the same. I debugged for a while and found flow_fdir_cmp() didn=E2=80=99t compare = the protocol type in field items of struct mlx5_fdir. So should this be = a bug for mlx5? flow_fdir_cmp(const struct mlx5_fdir *f1, const struct mlx5_fdir *f2) { if (FLOW_FDIR_CMP(f1, f2, attr) || FLOW_FDIR_CMP(f1, f2, l2) || FLOW_FDIR_CMP(f1, f2, l2_mask) || FLOW_FDIR_CMP(f1, f2, l3) || FLOW_FDIR_CMP(f1, f2, l3_mask) || FLOW_FDIR_CMP(f1, f2, l4) || FLOW_FDIR_CMP(f1, f2, l4_mask) || FLOW_FDIR_CMP(f1, f2, actions[0].type)) return 1; if (f1->actions[0].type =3D=3D RTE_FLOW_ACTION_TYPE_QUEUE && FLOW_FDIR_CMP(f1, f2, queue)) return 1; return 0; } Thanks, Daniel= From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id C4456A0679 for ; Tue, 2 Apr 2019 09:23:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8DA1034F3; Tue, 2 Apr 2019 09:23:29 +0200 (CEST) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by dpdk.org (Postfix) with ESMTP id C6D995A for ; Tue, 2 Apr 2019 09:23:28 +0200 (CEST) Received: by mail-pg1-f180.google.com with SMTP id q1so6077954pgv.13 for ; Tue, 02 Apr 2019 00:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=lyjzzUj1VXqO2gWJzS+f3YZ1l50y9d8ejQUV+DI7/DI=; b=Kpu9tyXohGzFGUc2dwUAS/KgLBQ/Yg+UvbLs8vuXJ9ALJA36xIJZ0cklkgNH8UPdoN vdrWr/2+ArI9eEqm6aCpYd5VjDrvpGNgubnRXNwKJTrwKnV1Q05Zhj/rpi+pMfITj9bB F+jDAe+0L2PB/wMb6cO9QOjmCzycRggyTq5MsRXH5FA9kHfSFV8MFNVegGctKAai1SWG bj0n/AAGQJ21n8TbdO/ObgM5YCmQuEk5I+H1V/Patercb+HlagNgtAxARfRBR5S5MGEZ yC7TmxmOk2ManOSj58F2rSF82wwQrketCsY2S0m2sSuGEsBQFl9EyQsREma0LGqtGaA+ a44A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=lyjzzUj1VXqO2gWJzS+f3YZ1l50y9d8ejQUV+DI7/DI=; b=pXTn66RwCB8mksb6p7VYEEgTmwLiVJj6Y6haKodc1MlgpLfij8K+r4DdbkrPDel84M jvybztBhfgHGpuM6Dd6YblQAE6/xIhbEdOPlnrGuPtSu8pxSag0UoUHZTUS1AwRWPdFx EKAmfGSs9Mn52CLRiVBXfOE2zwEf3Z1+MMOlk1jF8j1wRf6tPU6/JhVp2wfB7XR6sEJh iOSiOcpgZ1j+dS7t8dsfKzawWvhAWJLlhllyHD8prZ2ALuOCtuS9MVpRdlY8u7hM+1Ia WzfOZFlnibLBHxy/LOFZSH84qekxPxm+nnBDOf/2EWtqW54kdBRxHqZCFfRtHbelWfvb LaRg== X-Gm-Message-State: APjAAAWvoKWYoJ2ewx0m7xxrbzM431VLqYDKziBDXLT43FiY3hEm5dDi 9vwnG0Fy96TfWrhlL8D3356ywazw X-Google-Smtp-Source: APXvYqyzkxW/ZtMy9+I/6nyUPMtIUMdiKgjGQacCk6MoFeZbslvaVEFKkXvnMwq9DX8y/kaVxvsWXQ== X-Received: by 2002:a63:fc43:: with SMTP id r3mr47225418pgk.44.1554189807871; Tue, 02 Apr 2019 00:23:27 -0700 (PDT) Received: from [10.2.211.140] ([61.120.150.70]) by smtp.gmail.com with ESMTPSA id o89sm21352006pfi.178.2019.04.02.00.23.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 00:23:27 -0700 (PDT) From: benli ye Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Message-Id: <2D0CB568-B970-408A-9463-5D05D201370A@gmail.com> Date: Tue, 2 Apr 2019 15:23:22 +0800 To: dev@dpdk.org X-Mailer: Apple Mail (2.3445.102.3) Subject: [dpdk-dev] mlx5 FDIR rule comparison issue 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190402072322.Iswwe__tYYpmozD_boVbMStVeRrBKy5iae0OqecAMdA@z> Hi Developers, I am adding two FDIR rule (one is for UDP and the other is for TCP) for = mlx5 pmd driver. The rules are listed below. struct rte_eth_fdir_filter filt[MAX_FDIR_PROTO] =3D { { .input.flow_type =3D RTE_ETH_FLOW_NONFRAG_IPV4_TCP, .input.flow.tcp4_flow.ip.dst_ip =3D dip, .input.flow.tcp4_flow.dst_port =3D dport, .action.behavior =3D RTE_ETH_FDIR_ACCEPT, .action.report_status =3D RTE_ETH_FDIR_REPORT_ID, .soft_id =3D 0, }, { .input.flow_type =3D RTE_ETH_FLOW_NONFRAG_IPV4_UDP, .input.flow.udp4_flow.ip.dst_ip =3D dip, .input.flow.udp4_flow.dst_port =3D dport, .action.behavior =3D RTE_ETH_FDIR_ACCEPT, .action.report_status =3D RTE_ETH_FDIR_REPORT_ID, .soft_id =3D 1, }, }; However, mlx5 lib prevent me to doing this as when it treats the two = rules are the same. I debugged for a while and found flow_fdir_cmp() didn=E2=80=99t compare = the protocol type in field items of struct mlx5_fdir. So should this be = a bug for mlx5? flow_fdir_cmp(const struct mlx5_fdir *f1, const struct mlx5_fdir *f2) { if (FLOW_FDIR_CMP(f1, f2, attr) || FLOW_FDIR_CMP(f1, f2, l2) || FLOW_FDIR_CMP(f1, f2, l2_mask) || FLOW_FDIR_CMP(f1, f2, l3) || FLOW_FDIR_CMP(f1, f2, l3_mask) || FLOW_FDIR_CMP(f1, f2, l4) || FLOW_FDIR_CMP(f1, f2, l4_mask) || FLOW_FDIR_CMP(f1, f2, actions[0].type)) return 1; if (f1->actions[0].type =3D=3D RTE_FLOW_ACTION_TYPE_QUEUE && FLOW_FDIR_CMP(f1, f2, queue)) return 1; return 0; } Thanks, Daniel=