From patchwork Thu Dec 21 13:25:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13502021 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2043.outbound.protection.outlook.com [40.107.22.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73A6F83537 for ; Thu, 21 Dec 2023 13:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Z3HaiBle" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lrHKO+8xWxUX7IDLeQphWgRVW4HjK8BYQCpnu5I2jXCzfDOWSYqVSZ1JtOeN80edeFS1KvCXqrnFHsbObdLe0R5f4r8uv6aHVA5KonnNot/Sx7bKPchb5g3c1l88Bf5OjGYy0l0C9+cAgFk60Qsf7EKElNNbLPTBDqBX34X9ide4I0laxdj4HHYMFRR628k/q8fcrrO2TVunm3nEOjX+EDJmKz7Wb3MeVCggzh5NvElvJd2AyGKs0IO1qinuMpZq2KMO3BDVQEm6sPJJ5lo46QhHJ1kgK7+wfeBCF4yiA9aggr0k7g9gMSp7op7j65esBA2WgI3kuv2/wrIk3KIeCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LdzN0M0wlAI+u+KRKJ0OYulOiSDNPCGNv8lJgQweFpM=; b=fUxmkbsXdIAhEWcwo7Sjs7+3nuvsJnXIajsLCWjZ2vzPduIIL2osjaH3qoVBVyprAtGJuGRrlBaHg1MQywxaiOZdJ5LP8rChbHyTGi6wRODP3a5RAdsJVXQe49lJ6qYRaRPpvbo0O6GuOK6swEDrBm6q6pPQfUNXdicjpl7nyuWGJGR6iERPNXL+olzogK4TyfWZSg+4qRpmeGqVl+BGd5Vg0L8FaiE+6lbSKqRUa734tIW7/641Z3u8zoX/lZlJyBODiupU+ldT7V9FpXvFDZDlbZ7e/zI758FrprynPLlwIFTHMqDg5ko5iqKgg1K6m28QqV/Pf7A7tAvibZ/mkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LdzN0M0wlAI+u+KRKJ0OYulOiSDNPCGNv8lJgQweFpM=; b=Z3HaiBledo2vgH0G1LrZdcp5dsX025H36VQBaFxgKQ5h8Rg4Q0TP+8JaFLbqJgahxj6UEsv7tW7A4wEwL1kGwEz6Cz5IfKCtuamM/iPWD6DXCNhrWn6Y/PkYOfI6WUTnQjDRq9e1JtXnDPvs/IASKJe67cRlyVR3jmQBPNZQVuY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM0PR04MB7058.eurprd04.prod.outlook.com (2603:10a6:208:195::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Thu, 21 Dec 2023 13:25:41 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4%7]) with mapi id 15.20.7113.016; Thu, 21 Dec 2023 13:25:41 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "Abdul Rahim, Faizal" Subject: [RFC PATCH for-faizal 1/4] selftests: net: forwarding: allow veth pairs to be created with multiple queues Date: Thu, 21 Dec 2023 15:25:18 +0200 Message-Id: <20231221132521.2314811-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231221132521.2314811-1-vladimir.oltean@nxp.com> References: <20231221132521.2314811-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4PR09CA0013.eurprd09.prod.outlook.com (2603:10a6:20b:5e0::19) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM0PR04MB7058:EE_ X-MS-Office365-Filtering-Correlation-Id: 758afa58-c765-42fe-64f4-08dc02285454 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xCkxIk5kkJwt8Nq5HJt6KAtP2m5EBzT7XzArDxJ55pvvulO8jqZKv+nItWZ02/iEP/ZXY4ZaTvDwXseKH0b/kapgihWAHIxZRS9WumYWOoNtrz4tF00h4vcQyF4lPB7Bd3Nw+4hVLLhjrOQuI2pa+IXl3PUpQ6Z0oKNyOVt8u4+AyITTs6cFM0OkWc/BC0hWTPAQw+bhagNkC1HsfvhG2EstjKIAvx//9HZIbZ0BQ71T8OIRa+SXlFc/a6NYw5fyB23tz93S71AosKn6BjxZSct6RHwV18fsbEUytsp7hIJhEHdJ8Ji0Zp9L+/8ErKDb6I05VYnkrHPCpZeoeBhtig0ST63Dyn9R1V1jU9aUqqaaBOhpZ3DnNGnlCl2Hopk0KfTSyRH+aRfDaTeoSF5K7EXawAGFZRtOHhzpgww1FJGbDH2OL/HxDdNVwRG0EmxvfhTXeeNXVwLHDO7gWJvOZt3RxbBjDINGd22h/PsqMlQK/59EW7wOiD6f3n22qZZ2WZfHYtAGcPS5SrUicvaflPoGefIcYOI5O3LkFyS6VvOxQl/5U50RT9uLGGLHV+VrZrP9pcnYSMStJz89wbIohapqZZlfakonVLvDjJdJSb3hFGwzW08QiV63FhE5jR/U X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(396003)(366004)(39860400002)(376002)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(2616005)(6512007)(86362001)(6506007)(52116002)(1076003)(6666004)(26005)(478600001)(66556008)(6916009)(316002)(66946007)(44832011)(66476007)(83380400001)(6486002)(38100700002)(8936002)(8676002)(4326008)(38350700005)(5660300002)(2906002)(36756003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ga4yG3ty+Dt6BR0gOks0R2pKyVeD6h61M8RpkrXKXJicbcOYqx4FaXJpGNmiyvCzUVy1y+g0jCqRbmd2k+XYBSut/5JeiMg93rSTUCReXidi1o+bKB7nl7rKctq6Ygu2B04KXRQRifWk5BZWIcX7U9qR/HcIR/I6Hg4LV6h6SFTWFtWOZrN0ZijP0gT8wdZ1ye9A2Mdna3SuUPSr+D33aR5XcCytisgHAK/WmjtTQcrUmSOlA6Oyr+LIJrtKA0fS72vTPb+/6qlM+fwX/PzW9c5vy5EExI29PUL6sforjnQH3j4EscI8cs7a49UVbQasgfYilIVZU3LtVFldXDxJ3D/vCCLEKKSaK8f97JKKHkEMhRuLcP0aYtYNN9TU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Ybqh1moTeftSbn5yzX3iR8QPWyRiUlUr9CovmTGo+1zUEI58Dchhe0lqeXKZifFfQnBx6M20Tif4iOVViU4Fieoy4WqP8DrXjV/mpAQ8YSXPO8Z0C84aEbB68MmrxAcmeLNbRwW/Jw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 758afa58-c765-42fe-64f4-08dc02285454 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2023 13:25:41.8215 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: X8/AaMmEWVrq2pf+krq/F7meraNZYxK9i8o1HBOMlUlseZICq5UXBiqsxPl4Js3pnfjc0QVMJcL4QY32OjnkhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7058 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC For tc-taprio testing on veth, the veth pairs must have multiple TX queues. Allow certain tests to provide VETH_OPTS="numtxqueues 8 numrxqueues 8", while keeping the default unchanged. Signed-off-by: Vladimir Oltean --- tools/testing/selftests/net/forwarding/lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 69ef2a40df21..c0736a591ca0 100755 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -28,6 +28,7 @@ REQUIRE_MTOOLS=${REQUIRE_MTOOLS:=no} STABLE_MAC_ADDRS=${STABLE_MAC_ADDRS:=no} TCPDUMP_EXTRA_FLAGS=${TCPDUMP_EXTRA_FLAGS:=} TROUTE6=${TROUTE6:=traceroute6} +VETH_OPTS=${VETH_OPTS:=} relative_path="${BASH_SOURCE%/*}" if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then @@ -260,7 +261,7 @@ create_netif_veth() ip link show dev ${NETIFS[p$i]} &> /dev/null if [[ $? -ne 0 ]]; then - ip link add ${NETIFS[p$i]} type veth \ + ip link add ${NETIFS[p$i]} ${VETH_OPTS} type veth \ peer name ${NETIFS[p$j]} if [[ $? -ne 0 ]]; then echo "Failed to create netif" From patchwork Thu Dec 21 13:25:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13502026 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2083.outbound.protection.outlook.com [40.107.22.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 199F9127218 for ; Thu, 21 Dec 2023 13:25:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="F1qr9lki" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bqmAQnL+2YpDoL96XwVlifg7D0am5sPo65yqSYkvO7zrZd4ugQMXwBBtd2+e42qDYEiZW+XcHFOQoHv1UgWZktcFK/3rm67q1FuhuuFaUXK1pabtkUtreN6yxTvkpJoMJ63aZAGQCqVSvhTEQq2dJApxFdNBt01I0xl067PxYeMsd2udP53L07FcTRpN/aHwRNR/EUR401sU5ewxbIEGMJmt1zoOfzIG+l8LuTcuaq0wk4h6TooVCsqK0uYueJW4u9zxVM1aPZjvRrXwbvGZRzInJeQdPy0V72YTJc1C97ts/ro+ROChkhwJFwS2MLETvUXcl5N8BIoi9O3e6YNCSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y+dV01M2w6MbyIfe+zIOWHxUTbxxhRZmMXmuoNAQgbA=; b=eYQ12BLYoSEbrcgYiTENAcguUvftk3qG6Kk8jkZbfXH2V0zIQ5U7opw+OoNrI4ACj+pksCIIHONzN8Fw88QXxrDbnJ0e0qY5ictKYIwToLB/fjPhdcF8uBL7W19WVdmHHPha465UkkZ9MFqgOHWSCRclfG443pGusj7fyStMGHbD3fQhPJT3WjfZgaQaUq0KH8vspBoWrgmCsILqTibb+bs1B+yo7mGcTGvlZS4Vu0WmXtjRArAdYhSfY70wzERT0FYnsN1H0lyhid3H/RKEt5kOMbroHfc2Cc+8cUlpWvQzeagGJ/iRifT5qSsUvhFHVrwTF40o2wOvAKk6P3dTDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y+dV01M2w6MbyIfe+zIOWHxUTbxxhRZmMXmuoNAQgbA=; b=F1qr9lki7BQpKa0bB+2pDDl8z+ZYrWT6EL3xO+ERFlVEMzAf8c9CigrZdZVjeT83kiZsLqhrcxh7W0b3zHGmAV+pbxCftieLGbM2U0Gop7kmPtATrp5rhYjjE7dxhKBFYCiyPEsdVErBf0LKWhL6Tm++zp9GUTogL6teTexZp6Y= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM0PR04MB7058.eurprd04.prod.outlook.com (2603:10a6:208:195::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Thu, 21 Dec 2023 13:25:42 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4%7]) with mapi id 15.20.7113.016; Thu, 21 Dec 2023 13:25:42 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "Abdul Rahim, Faizal" Subject: [RFC PATCH for-faizal 2/4] selftests: net: tsn: push --txtime out of isochron_do() Date: Thu, 21 Dec 2023 15:25:19 +0200 Message-Id: <20231221132521.2314811-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231221132521.2314811-1-vladimir.oltean@nxp.com> References: <20231221132521.2314811-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4PR09CA0013.eurprd09.prod.outlook.com (2603:10a6:20b:5e0::19) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM0PR04MB7058:EE_ X-MS-Office365-Filtering-Correlation-Id: d9e8fc9d-08e8-4bd6-b074-08dc022854a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TNJpfnD3Kf4wghUoNyhsmiN7XaBfx2EWvXzP3tjHbBSo+YGGeAlcTVVxJGbatskbK0NsbdH+e+OR9nqNfOQEiS6UsXCaQGOQTp7ahFZ1sO3pgX6XC9XxvNHEDTTL52PXJ/OjjSr6u4z3AIZ9Iey1zyfPuXoLosoYH9RZKD+rfFff2GRkojpbZMW6qSf8+fJRxExvmgsKiucXJqVM4SNiWFeZ2f/86baPMlI/Gfmeag5W1X3B88BO0FMtSONqOdmWFM7OKerpCNKvAJQIon4XHymA3tWQh9Mi5k/ZOCNzXG/Fp5aZGCMLIyFtflDdPSSKZKD41LXoeIz3nzN0lB0eGh4d3YwGbXksOZKcgh6tIzhqlYQD5ku6uPl6jdIL3JMSdnlgCPWHz97huKNBgbI5h4zYswYFeM+Kz+gbaS8rlJg7x6TafhppgzzTdAecD7DyQD5bDPj/nH2gQRUUmlklhBLuyOKdOlFtmQLCAX5c+Or9bENP06ksqqoJXcZTIibWjZYGpAuMhVcVu3wSdcBLDUGQLxMgq0kJ8MrGEaWqVIDdVBZlPx15HeDSvrK6lppOAOkhaFQvo8R+9RBOTaoYVgCoFpmEP6zeHDmV+4GlrnwLO7Od9TfBSArN2evcQQuT X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(396003)(366004)(39860400002)(376002)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(2616005)(6512007)(86362001)(6506007)(52116002)(1076003)(6666004)(26005)(478600001)(66556008)(6916009)(316002)(66946007)(44832011)(66476007)(83380400001)(6486002)(38100700002)(8936002)(8676002)(4326008)(38350700005)(5660300002)(2906002)(36756003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mjMMpzBzHksuTEtU9fXzYW0GtddndVFA1goriE1EJzV82NZLDD0RLjjomAek2yuQ2p/1OSZ5ooC1Q3c0NAAQVGynES4fRm1zCgodB9CJDfBcz3jTX/YxOeoLRskvZarkWO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42ZCJiZrNt6QGn2jyJa2yDPDe1b0MBDcK3H5Tt+PFRU6SY7dt1IcVkRE+elPkLnkfuXT0GC8dASghx2im+t45sg/opVUWM85bYY8Cn29+MlU98oo0TZKcYq0trVFiG0VXNKnS4zDWdYMZbSyx0e1IKmxwONjtx0iOlBrtgcIdht4tu5Iit+OYhkGRVZEDDF+d2XyTGLqWhSUIa2LwXbcN+tHrcDgh6qzyKBS7IVBJxLktEUlj9dd2P18KJXZDzliUPRm37j8kQ5pGFAiIjk3JbAAyKcNNkGRL/OCtJACiuLir16aPK4OKGeEi8+rYWUYECL5qCNc46V/L2m4zlbXPmLVHgBbL/VvPWv4is+/+QzEXHkZqRgxQRqpvo7XCfDIxK0rKgIO34xY+uw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9e8fc9d-08e8-4bd6-b074-08dc022854a0 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2023 13:25:42.3382 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cMuPFvFJxbGSNITJaqWuzeJC0NYgBDY+Ud97WjJIxGxJ9Ze1PZKWuT7xBWtP09ngRJt9j2PAw7c7KQORF1cPrw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7058 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Not all isochron tests should use the --txtime option. Make the sender_extra_args and receiver_extra_args be provided by the caller, and move --txtime to the ocelot psfp.sh test. Signed-off-by: Vladimir Oltean --- .../selftests/drivers/net/ocelot/psfp.sh | 1 + .../selftests/net/forwarding/tsn_lib.sh | 21 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/drivers/net/ocelot/psfp.sh b/tools/testing/selftests/drivers/net/ocelot/psfp.sh index bed748dde4b0..e6042b678c09 100755 --- a/tools/testing/selftests/drivers/net/ocelot/psfp.sh +++ b/tools/testing/selftests/drivers/net/ocelot/psfp.sh @@ -270,6 +270,7 @@ run_test() "${STREAM_VID}" \ "${STREAM_PRIO}" \ "" \ + "--txtime" "" \ "${isochron_dat}" # Count all received packets by looking at the non-zero RX timestamps diff --git a/tools/testing/selftests/net/forwarding/tsn_lib.sh b/tools/testing/selftests/net/forwarding/tsn_lib.sh index b91bcd8008a9..f081cebb1c65 100644 --- a/tools/testing/selftests/net/forwarding/tsn_lib.sh +++ b/tools/testing/selftests/net/forwarding/tsn_lib.sh @@ -186,9 +186,9 @@ isochron_do() local vid=$1; shift local priority=$1; shift local dst_ip=$1; shift + local sender_extra_args="$1"; shift + local receiver_extra_args="$1"; shift local isochron_dat=$1; shift - local extra_args="" - local receiver_extra_args="" local vrf="$(master_name_get ${sender_if_name})" local use_l2="true" @@ -205,19 +205,19 @@ isochron_do() fi if [ -z "${receiver_uds}" ]; then - extra_args="${extra_args} --omit-remote-sync" + sender_extra_args="${sender_extra_args} --omit-remote-sync" fi if ! [ -z "${shift_time}" ]; then - extra_args="${extra_args} --shift-time=${shift_time}" + sender_extra_args="${sender_extra_args} --shift-time=${shift_time}" fi if [ "${use_l2}" = "true" ]; then - extra_args="${extra_args} --l2 --etype=0xdead ${vid}" - receiver_extra_args="--l2 --etype=0xdead" + sender_extra_args="${sender_extra_args} --l2 --etype=0xdead ${vid}" + receiver_extra_args="${receiver_extra_args} --l2 --etype=0xdead" else - extra_args="${extra_args} --l4 --ip-destination=${dst_ip}" - receiver_extra_args="--l4" + sender_extra_args="${sender_extra_args} --l4 --ip-destination=${dst_ip}" + receiver_extra_args="${receiver_extra_args} --l4" fi cpufreq_max ${ISOCHRON_CPU} @@ -232,7 +232,6 @@ isochron_do() --cycle-time ${cycle_time} \ --num-frames ${num_pkts} \ --frame-size 64 \ - --txtime \ --utc-tai-offset ${UTC_TAI_OFFSET} \ --cpu-mask $((1 << ${ISOCHRON_CPU})) \ --sched-fifo \ @@ -240,8 +239,8 @@ isochron_do() --client 127.0.0.1 \ --sync-threshold 5000 \ --output-file ${isochron_dat} \ - ${extra_args} \ - --quiet + --quiet \ + ${sender_extra_args} isochron_recv_stop 5000 From patchwork Thu Dec 21 13:25:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13502025 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2083.outbound.protection.outlook.com [40.107.22.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C475F1271FB for ; Thu, 21 Dec 2023 13:25:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="EJRV99XG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VlJ5rbRDpDoChxVFAlfxpBFyF2pr4CdhiGOc/8HN2G8giUMqQ1xv0R/kjUdupZvNKjO5Dq1dIJ+mF1GUxpVrhN3XRawptgGk1+6vtKdtTO0d6348JBLC2/GBQaZBAZ0eFNbDTQlH+EZM+saeqRInOCvEolBY7aWAWd+ivWO1rVBhQq6PqTr/fhBsuG04/RrT/OqtVr0li0gz+Oo3lSY2oozwYQWftFe5dLYErx08gWkgNsV99qMBiiGG4pt7SS+Tod0qXxuwJ/TjMgte489RxpytIiYE3JI9r9kE7yGe4V9/szD+ghvkKrDFoP4HFCdnN07j8RfxVItCwR1AHAw25w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HzxXEceV/Uhrw9JdczA8c8XdtGY5DsSByl/EV0i9qL0=; b=eEiSL2b4qA18qrN511UYG+eeUbn8QPo4JX3Du1MT94lLHaJk6qqPfZRdBTrrVD1xKMyT/z1htm4/DtHG0Wazj0cF+5maJVyz5u0TCNEZQpt82EsljDPX6Np1PQ6xALBhFtTTxxZ2e/C0eam7SntrptW2nL4ELoD8dufm28GwT9S8PC3Ops7kJBOv15ThpEvOEykyll5ldr2y+OMUQod8MuhhREhwQa8oxx8J6sIJzAu9aNb/fj5MgYcFkqAMRZSBPtL3A241vE1Dm+hCodsCh/Tp3JQ6tS4jbjyTJ0gzkRVqzIAE56nqbVOCvw06eWVtnzG3RlD403bCFGaC8l0JmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HzxXEceV/Uhrw9JdczA8c8XdtGY5DsSByl/EV0i9qL0=; b=EJRV99XGCoHQ4h1fN3K0DJYHdQiagObaYZcl3CLDjm6lYB4OR5pjgQtjHt9XMvd1OSCu7utEYj+1XsAOvh1ZNcCVg1RqfRQo8D15Tjv3/mdfsAHctVxa847GV1xJciyxmdg0/136e1cohBbEqSKY2/DsuTH1SjnE+JPWiTvW8U4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM0PR04MB7058.eurprd04.prod.outlook.com (2603:10a6:208:195::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Thu, 21 Dec 2023 13:25:43 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4%7]) with mapi id 15.20.7113.016; Thu, 21 Dec 2023 13:25:43 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "Abdul Rahim, Faizal" Subject: [RFC PATCH for-faizal 3/4] selftests: net: tsn: allow isochron_do() to skip sync monitoring on sender too Date: Thu, 21 Dec 2023 15:25:20 +0200 Message-Id: <20231221132521.2314811-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231221132521.2314811-1-vladimir.oltean@nxp.com> References: <20231221132521.2314811-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4PR09CA0013.eurprd09.prod.outlook.com (2603:10a6:20b:5e0::19) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM0PR04MB7058:EE_ X-MS-Office365-Filtering-Correlation-Id: 83597d61-5e6f-444a-acc3-08dc022854fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Vojt/QW5D7LbVQF5KCFN2HM1LKH18vHCYNbaCNzCHhmoalSGgIpyo06w86uVOrtjh2HHPdDCbgeKzqcH0+gzzmtvCpg6lcY95sU0KhcGIV1JyXvtScs0vwJqBS6lPw4g3y0bP1R69o3aT7r32E+CTZCyTA2igiZ+TDJH5nKCpDocq0nkfS64S6BwAQm0gJW7wOO9+o1dY2qH376CMxTKWwvQ0NHfsZ2HlAaivXpIAdIuxi+k1d/x7+pmGmwjbtrm61afs3YmDz0QALbNXhQipCEuIo6gwp3SMtRM5ElTd8nzcOC/gl7XDGwYbLyh9oaqcF21E468HbKItAi0h69qMywm95ZFo+Ys3Yitxjh7rikGb/NY5LJ6naqYmU6EhSa3Ic2gVMCeCTbs0wM9m4mfbUhwpwNKl6EQ3S17GTemXt3HqkcoYmRWFpEm+gOkpWW8lZnkPrsI2rg5VjER6D0cttjO95iKZE/6lW2EsfXIaFqsXL7+WYK1y05mqJ48uoXx+o4viLpAzAydVboBhz8lwnQMbjpQW8CE9ShFB6ZrAH5wCprzXG51PADxDIuAwVUgbIXlMD3uxShVm8wH7xVm2ewU3m6xhrxXNEUdFm2PPpE+UHNNlyPDinGk33ECZ1CF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(396003)(366004)(39860400002)(376002)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(2616005)(6512007)(86362001)(6506007)(52116002)(1076003)(6666004)(26005)(478600001)(66556008)(6916009)(316002)(66946007)(44832011)(66476007)(83380400001)(6486002)(38100700002)(8936002)(8676002)(4326008)(38350700005)(5660300002)(2906002)(36756003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GmH0E4dEShHYIrv3Kyxy80EKhbaWoU+oM8FaSanS3hsGCmXos256DSzmexKGwMzmurAMWMLJdvETkN38FmS3XK4RXHOn030ZUM5gfHaBPjbGC+rlgSwLoWelZUghKPYDnfA9DcD2S03XsUtjBnDYDS+NbTxm1EJFC3SaK0hztW8mZJWepQXREW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s0fDISO7BThPIny3hexVGk1OzOurQ3jYLf5ZtGjtnCkTZ9WVqJG0plYfBDNl3sCbTRAQ8VVAXE6GxkYpQ600GJ/AOaax+vEeqliVLZg6mSLSiC1TUriDwak56q9gP01c1DXeNOsoACgiL+j36m9H3QUODTnHmSPL8p584DD2RP4NlZwnvcClIKUHfPjv3JnEwDC+9Rs3x+gkDb7I/TcAm6MbCjoq+C3lQxLv+psXGYn7gNlyFwWzQW/xeOqaAfr8tizu8fdJzqxIkUFFUQvgwKp8qGObkRHOTlEu6GKWPtFKvtSdmu9a9dVzQ4PKYQJ3aN03LoV6rEb51qvZYsVXnh/D7H4qS6cPesYd0w9g7it+w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83597d61-5e6f-444a-acc3-08dc022854fd X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2023 13:25:43.3022 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: J2vP6hiBUrDhOfAp24tGG/C5R8cr633JSd71mv+nApONpwQ4VZ9VnjuEhTmtl5l6t2KKW34169p+BD9pd3vqNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7058 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC For testing the tc-taprio software scheduling path, we don't need PTP synchronization at all, but isochron_do() was written assuming that we do. Allow skipping the UNIX domain socket for the ptp4l instance on the sender, and pass --omit-sync to isochron instead, so that it sends right away and does not monitor the PTP quality. Signed-off-by: Vladimir Oltean --- tools/testing/selftests/net/forwarding/tsn_lib.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/tsn_lib.sh b/tools/testing/selftests/net/forwarding/tsn_lib.sh index f081cebb1c65..189bf27bad76 100644 --- a/tools/testing/selftests/net/forwarding/tsn_lib.sh +++ b/tools/testing/selftests/net/forwarding/tsn_lib.sh @@ -204,6 +204,12 @@ isochron_do() vid="--vid=${vid}" fi + if [ -z "${sender_uds}" ]; then + sender_extra_args="${sender_extra_args} --omit-sync" + else + sender_extra_args="${sender_extra_args} --unix-domain-socket ${sender_uds}" + fi + if [ -z "${receiver_uds}" ]; then sender_extra_args="${sender_extra_args} --omit-remote-sync" fi @@ -226,7 +232,6 @@ isochron_do() isochron send \ --interface ${sender_if_name} \ - --unix-domain-socket ${sender_uds} \ --priority ${priority} \ --base-time ${base_time} \ --cycle-time ${cycle_time} \ From patchwork Thu Dec 21 13:25:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13502023 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2060.outbound.protection.outlook.com [40.107.21.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA36F1271E2 for ; Thu, 21 Dec 2023 13:25:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="GgfzQ5Xa" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vu4glbhB3j/cE1E1r8McUbIGevfBKp31HiiDcFU3gNdi06fi6+5ZB85iG/LjdOvW+vfcr2nk0eF4q5QYjzmimF87KPTx+LICcfDbDpxFoAsfwB0wUXXxQ3Q2seIKDU2KcLFSQqH9/jE7UQ5fCiABXDndKoNgMafSAqF98b2l2j8sF4ffcMa72eaRWF4GHyrD8vI0ke2S2gMP/YsfTlhQqqzc3ckkUTvy5neGR/14+RV055ZZJM16OaPq59wnGrFzFyoz07+1L6O6m3NNBThqP5z5g6tRcjix5OEaAeaEGHdh9zqHPT16jFRAunXbcjqTDRGkOsW+/9eBFurWhFu+cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1kwxUxqDxyXxTnogSJU0Vm33ykF96R/nBAcpFwTcfdU=; b=cNkxMF5FF2DqjGQ/vJGMcrxsgZaTTqS/rjR1yX5dqpbR5I+ieBcb1tEWBKUhUVpB0J58OQZ4ZLP0K2c7AGh0lG7s/VdQCgwLjK8OF0DZPTPVfNixi/uuqB9YbprnvjoEmuiS8eYBF2z2pOqK2edL+BQOvpX6P+4C1/zO8mcLH+Mo8tHsUBeFn/7V+sfjRVsD0GqQZQDFUPnzwv9n2G8xs/Lruv2q/VjhLx39uSvxgw824RD3kyTgPC58F/HKkSj1lDGN+0PtjtT6lw5oko2ATTH8FK46rAIaiOlhv/3WlTWD1bQcvto18mF1xM3dtTbGJXsygSOY38JsgDv7VWKWSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1kwxUxqDxyXxTnogSJU0Vm33ykF96R/nBAcpFwTcfdU=; b=GgfzQ5Xa5STDwFVgIqiWOkgzzpAK8nnbK8Kyk4uDwMp77RVDxiOjCap561m4Zhvy4GFeMYh50jq9SFBN/LdkpBkr+smtBj8Zi/p+IAmESaBKhpX7FQ8yzG65ndJTVixYL1l/qWihtqC9LnVjf1vfFtjWJbEsRr0rdJS3E/tPuZk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by DB9PR04MB9236.eurprd04.prod.outlook.com (2603:10a6:10:370::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.20; Thu, 21 Dec 2023 13:25:44 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dd33:f07:7cfd:afa4%7]) with mapi id 15.20.7113.016; Thu, 21 Dec 2023 13:25:43 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "Abdul Rahim, Faizal" Subject: [RFC PATCH for-faizal 4/4] selftests: net: tsn: add tc-taprio test cases (WIP) Date: Thu, 21 Dec 2023 15:25:21 +0200 Message-Id: <20231221132521.2314811-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231221132521.2314811-1-vladimir.oltean@nxp.com> References: <20231221132521.2314811-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4PR09CA0013.eurprd09.prod.outlook.com (2603:10a6:20b:5e0::19) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|DB9PR04MB9236:EE_ X-MS-Office365-Filtering-Correlation-Id: 312016be-a38f-40ed-93c4-08dc02285585 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iDHv4rw5i0QRi+2oboz5ooZqBNbqzQcflGY8LoL9N1A1dcA5yuUAKHrxKvn1Ji9zl52w97EarOuu+1RW7Hu+hWQddYobqBueaTwKptW2P8x4FaSMjMwELBRgR1uliH1uOmSmwGySZ3SDNrxutMGF4Tm/O6DmgJpFcUAu9dMipffZ87apQ1Y3gAcOXK3m1CxatpiH1JRduXVHPS+xQH10DeY2KO2FwxHv89WDr5RraY9WGNWBmUCjDjCUw1t9ESU1FoQdF25sQ5CS9qDQRuqC+jVoKtTjmX9aw+cTGgjLZT2YNHeHAYa6cv26gR8QA61+y9AhAOaRNm5A/M3jJ5ETCL+86QsVckbE2XBFOUaBxV9JIosIb59z4FS6bXKbFI8Sl3+vAxsHSl+opV9igUfhh5M15aQnbEhFkCuj3nyHO1biILOoUnpqSJnCLGq86Ov3xCYDJFtUHOe7iS0h30rLlBvBEiRzzHF3q3eE3uKli0U3FJSHyhzrYPFo5Uqlpa2o0EjCqbDjm9mmlfkxVWmo+ONmjQzo+rBiPe0hPj1nbewZxodmRpANGmuI/5laZNWBDv0spgp2wutRNvX2LWjuN4CMJLZ56wkv7owqcGFJTsI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(396003)(136003)(39860400002)(376002)(346002)(230922051799003)(64100799003)(451199024)(186009)(1800799012)(6486002)(6666004)(478600001)(38100700002)(26005)(83380400001)(2616005)(52116002)(6512007)(1076003)(6506007)(4326008)(8936002)(8676002)(2906002)(36756003)(5660300002)(41300700001)(44832011)(86362001)(38350700005)(66946007)(6916009)(316002)(66556008)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-M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FI9j1mARPmLkTW93fw6J2oZ7mFWTQ6tIBwUafQISAKEMnw9dADULnOcMBCief2uG6jrXs8h57zbjeFlVcCnvW+e3VIKIQ+HFFzWn1/YGZLX1lSx+3PTFF0qouJOKgOIJcpTMiTL/0+Ma/OpkwPYYkhiQTUGKzQ0GDWBmE9g/wyhUpPQqmzPmY1h2ISYh8TMhPYLQJzzUGaHWO8cFzOgXo0qRg1kKci8n8EDxxOb+CA2rlEjkKDiIkMK+4bRCvo6Etwks2+nsD9APuUsU8UrtmYf1r1xUXKoHmi5FKVVxHZL7dlLERaHChS/OkFHw3FESXkHvr1FmWNEUTZYd5kbbBAgaqUTJwy1vjBbzsHD3cTL+rtEY279qcjsa/1KcSPCq8PUw9G15Q0Q8GJ7Er7WePMZYVOTx+byWpvZr8hNJK8q/jXk0JNZzbl+OS6f65s4tD25uzmLaqSg0gzNcg38WaIz5Li/tTWJLnklBTEatauGxa3zBSl+GHYmNfE9sEr4auKpUDdLGJEFZFDWTW1vFYhhXbREgZBIp10wB9awMHrL0CSLcBP00wDd46A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 312016be-a38f-40ed-93c4-08dc02285585 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2023 13:25:43.9343 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5wnz5gKgdmMMLIBnHuiGsdm4clsuhYZOwywUKnxX/2odC7WomNberDgzTWRtM2muMCnSxHbzq4goaS21PrrdPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9236 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Obviously this is unfinished. While we were discussing about tc-taprio behavior during schedule changes in particular, it would be much better if the tests could slowly build up towards that complicated case, and make sure that the simpler cases work well first: a packet gets sent when it should (when it's sent in band with its time slot), gets blocked when it's sent out of band with its time slot, etc. Signed-off-by: Vladimir Oltean --- .../testing/selftests/net/forwarding/Makefile | 1 + .../selftests/net/forwarding/tc_taprio.sh | 143 ++++++++++++++++++ .../selftests/net/forwarding/tsn_lib.sh | 42 +++++ 3 files changed, 186 insertions(+) create mode 100755 tools/testing/selftests/net/forwarding/tc_taprio.sh diff --git a/tools/testing/selftests/net/forwarding/Makefile b/tools/testing/selftests/net/forwarding/Makefile index 452693514be4..8e8ed75a3aac 100644 --- a/tools/testing/selftests/net/forwarding/Makefile +++ b/tools/testing/selftests/net/forwarding/Makefile @@ -97,6 +97,7 @@ TEST_PROGS = bridge_fdb_learning_limit.sh \ tc_mpls_l2vpn.sh \ tc_police.sh \ tc_shblocks.sh \ + tc_taprio.sh \ tc_tunnel_key.sh \ tc_vlan_modify.sh \ vxlan_asymmetric_ipv6.sh \ diff --git a/tools/testing/selftests/net/forwarding/tc_taprio.sh b/tools/testing/selftests/net/forwarding/tc_taprio.sh new file mode 100755 index 000000000000..387cc0860d4f --- /dev/null +++ b/tools/testing/selftests/net/forwarding/tc_taprio.sh @@ -0,0 +1,143 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +ALL_TESTS="in_band out_of_band cycle_extension" +NUM_NETIFS=2 +VETH_OPTS="numtxqueues 8 numrxqueues 8" +source lib.sh +source tsn_lib.sh + +in_band() +{ + local basetime=$(clock_gettime CLOCK_REALTIME) + local window_size=$((NSEC_PER_SEC / 2)) + local cycletime=$((2 * window_size)) + local expected=1 + local isochron_dat="$(mktemp)" + local window_start + local window_end + + basetime=$((basetime + UTC_TAI_OFFSET * NSEC_PER_SEC)) + basetime=$(round_up_with_margin $basetime $NSEC_PER_SEC $NSEC_PER_SEC) + + tc qdisc replace dev $h1 root stab overhead 24 taprio num_tc 2 \ + map 0 1 \ + queues 1@0 1@1 \ + base-time $basetime \ + sched-entry S 0x3 500000000 \ + sched-entry S 0x0 500000000 \ + clockid CLOCK_TAI \ + flags 0x0 + + isochron_do \ + $h1 $h2 \ + "" "" \ + $((basetime + 2 * cycletime)) \ + $cycletime \ + 0 \ + ${expected} \ + "" \ + 1 \ + "" \ + "--omit-hwts --taprio --window-size $window_size" \ + "--omit-hwts" \ + "${isochron_dat}" + + # Count all received packets by looking at the non-zero RX timestamps + received=$(isochron report \ + --input-file "${isochron_dat}" \ + --printf-format "%u\n" --printf-args "r" | \ + grep -w -v '0' | wc -l) + + if [ "${received}" = "${expected}" ]; then + RET=0 + else + RET=1 + echo "Expected isochron to receive ${expected} packets but received ${received}" + fi + + tx_tstamp=$(isochron report \ + --input-file "${isochron_dat}" \ + --printf-format "%u\n" --printf-args "t") + + window_start=$((basetime + 2 * cycletime)) + window_end=$((window_start + window_size)) + + if (( tx_tstamp >= window_start && tx_tstamp <= window_end )); then + RET=0 + else + RET=1 + printf "Isochron TX timestamp %s sent outside expected window (%s - %s)\n" \ + $(ns_to_time $tx_tstamp) \ + $(ns_to_time $window_start) \ + $(ns_to_time $window_end) + fi + + log_test "${test_name}" + + rm ${isochron_dat} 2> /dev/null + + tc qdisc del dev $h1 root +} + +out_of_band() +{ + : +} + +cycle_extension() +{ + : +} + +h1_create() +{ + simple_if_init $h1 192.0.2.1/24 +} + +h1_destroy() +{ + simple_if_fini $h1 192.0.2.1/24 +} + +h2_create() +{ + simple_if_init $h2 192.0.2.2/24 +} + +h2_destroy() +{ + simple_if_fini $h2 192.0.2.2/24 +} + +setup_prepare() +{ + h1=${NETIFS[p1]} + h2=${NETIFS[p2]} + + vrf_prepare + + h1_create + h2_create +} + +cleanup() +{ + pre_cleanup + + isochron_recv_stop + + h2_destroy + h1_destroy + + vrf_cleanup +} + +trap cleanup EXIT + +setup_prepare +setup_wait + +tests_run + +exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/tsn_lib.sh b/tools/testing/selftests/net/forwarding/tsn_lib.sh index 189bf27bad76..e72a18a1dee0 100644 --- a/tools/testing/selftests/net/forwarding/tsn_lib.sh +++ b/tools/testing/selftests/net/forwarding/tsn_lib.sh @@ -5,6 +5,8 @@ REQUIRE_ISOCHRON=${REQUIRE_ISOCHRON:=yes} REQUIRE_LINUXPTP=${REQUIRE_LINUXPTP:=yes} +NSEC_PER_SEC=1000000000 + # Tunables UTC_TAI_OFFSET=37 ISOCHRON_CPU=1 @@ -18,6 +20,7 @@ fi if [[ "$REQUIRE_LINUXPTP" = "yes" ]]; then require_command phc2sys require_command ptp4l + require_command phc_ctl fi phc2sys_start() @@ -251,3 +254,42 @@ isochron_do() cpufreq_restore ${ISOCHRON_CPU} } + +# Convert a time specifier from 1.23456789 format to nanoseconds +time_to_ns() +{ + local time="$1" + local sec=${time%%.*} + local nsec=${time##*.} + + echo $((sec * NSEC_PER_SEC + 10#$nsec)) +} + +ns_to_time() +{ + local nsec="$1" + local sec=$((nsec / NSEC_PER_SEC)) + + nsec=$((nsec - (sec * NSEC_PER_SEC))) + + printf "%d.%09lld" $sec $nsec +} + +clock_gettime() +{ + local clkid=$1; shift + local time=$(phc_ctl $clkid get | awk '/clock time is/ { print $5 }') + + echo $(time_to_ns $time) +} + +# Round up value to next multiple, leaving a specified margin +round_up_with_margin() +{ + local val=$1; shift + local multiple=$1; shift + local margin=$1; shift + + val=$((val + margin)) + echo $((((val + margin - 1) / margin) * margin)) +}