From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E9A6343C89; Mon, 11 Mar 2024 16:45:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 969C840E6E; Mon, 11 Mar 2024 16:45:01 +0100 (CET) Received: from mail-il1-f225.google.com (mail-il1-f225.google.com [209.85.166.225]) by mails.dpdk.org (Postfix) with ESMTP id 2E5DD40DF8 for ; Mon, 11 Mar 2024 16:44:59 +0100 (CET) Received: by mail-il1-f225.google.com with SMTP id e9e14a558f8ab-36663cc77eeso337405ab.2 for ; Mon, 11 Mar 2024 08:44:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1710171898; x=1710776698; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3RK5kuzo0Jq6RyRhe77VtFxJ613Gmy3kqJRnJ/Uz8bs=; b=fMqnpJnhn1LfDiK8WQOVQTJuzKBF4m6iALtj8q96LozUjCrw50AYoDmnaZQdyeww+w W94eUQbyR+dgRWZnpPqOmzWpk21192Nio+HdhK4UdAXK+FfjXFpr5/Ari+BkbN/DkDKp dyXrAEO1CiM94ruXwTibFMlVYBx1gbraE7taE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710171898; x=1710776698; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3RK5kuzo0Jq6RyRhe77VtFxJ613Gmy3kqJRnJ/Uz8bs=; b=d9XMG/FSwMyDMLt9Abv3g+/dI/mEldQ+fBGGQLYRzOtA6IOwfTpBjf8aYzOo/wcqLQ lTLo38U+xckuFiOjqu7wellne9GpT2WCpyu4mua9PIMzcKahvCGZxQjz5dGZU/rDiXJt 0f5HqDOE3/1aO5kGkQEGK8dR0roEqxCIJ8+txqdTnmFnFhL9W25UkEltkK6qPpND5oEk 6hvXsS/r6cidA4B2S376Mlv0ykZotSLdVf9+5Sl1hEjsDPW6rDIE4mLBQxEIDGfjKFa5 lz2cpR7vpgtOxN7CEXuqf2xWLSxMrNw2XEJy1hiSXJ2huMA9dMYmHvZAC8wVRMBqQWVD AyQg== X-Gm-Message-State: AOJu0YzxUkkZY9PJSvP16LGVzhDVV2ZslbU+0EhXrNEWBm45aqhJHUUv 7yqkSsKhvigBIEX5ivF+gEUjU6TyyqMUsCvONa3rThZrNW7blG8fmZ7+9ED+oC4MIZE57KXxahm UNuwODIyFXAeIWBXv0ihpiLvt2DfaUlVtBfaz1CSoW+EEfeI3 X-Google-Smtp-Source: AGHT+IFROF+HTRaAidtoWPU7yo/k1U62sVx2zjAfcChidVHHRFwQHxJ26FuQfkxXcgLWi1MOtRR1L7knY1Ng X-Received: by 2002:a05:6602:1d1a:b0:7c8:bc7a:bef6 with SMTP id hh26-20020a0566021d1a00b007c8bc7abef6mr2727492iob.15.1710171898603; Mon, 11 Mar 2024 08:44:58 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id n28-20020a056602341c00b007c8875fb2acsm222982ioz.28.2024.03.11.08.44.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2024 08:44:58 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f]) by postal.iol.unh.edu (Postfix) with ESMTP id 0E1006052471; Mon, 11 Mar 2024 11:44:58 -0400 (EDT) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v9 5/7] dts: allow configuring MTU of ports Date: Mon, 11 Mar 2024 11:44:03 -0400 Message-ID: <20240311154405.13269-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240311154405.13269-1-jspewock@iol.unh.edu> References: <20240110144249.20719-1-jspewock@iol.unh.edu> <20240311154405.13269-1-jspewock@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Adds methods in both os_session and linux session to allow for setting MTU of port interfaces so that suites that require the sending and receiving of packets of a specific size, or the rejection of packets over a certain size, can configure this maximum as needed. Signed-off-by: Jeremy Spewock --- dts/framework/testbed_model/linux_session.py | 8 ++++++++ dts/framework/testbed_model/os_session.py | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py index 0ab59cef85..5d24030c3d 100644 --- a/dts/framework/testbed_model/linux_session.py +++ b/dts/framework/testbed_model/linux_session.py @@ -198,6 +198,14 @@ def configure_port_ip_address( verify=True, ) + def configure_port_mtu(self, mtu: int, port: Port) -> None: + """Overrides :meth:`~.os_session.OSSession.configure_port_mtu`.""" + self.send_command( + f"ip link set dev {port.logical_name} mtu {mtu}", + privileged=True, + verify=True, + ) + def configure_ipv4_forwarding(self, enable: bool) -> None: """Overrides :meth:`~.os_session.OSSession.configure_ipv4_forwarding`.""" state = 1 if enable else 0 diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py index 6983aa4a77..d5bf7e0401 100644 --- a/dts/framework/testbed_model/os_session.py +++ b/dts/framework/testbed_model/os_session.py @@ -412,6 +412,15 @@ def configure_port_ip_address( delete: If :data:`True`, remove the IP address, otherwise configure it. """ + @abstractmethod + def configure_port_mtu(self, mtu: int, port: Port) -> None: + """Configure `mtu` on `port`. + + Args: + mtu: Desired MTU value. + port: Port to set `mtu` on. + """ + @abstractmethod def configure_ipv4_forwarding(self, enable: bool) -> None: """Enable IPv4 forwarding in the operating system. -- 2.43.2