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 B05874380D; Wed, 3 Jan 2024 23:33:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 287E440A7A; Wed, 3 Jan 2024 23:33:13 +0100 (CET) Received: from mail-yw1-f227.google.com (mail-yw1-f227.google.com [209.85.128.227]) by mails.dpdk.org (Postfix) with ESMTP id 9A30240A87 for ; Wed, 3 Jan 2024 23:33:11 +0100 (CET) Received: by mail-yw1-f227.google.com with SMTP id 00721157ae682-5efb0e180f0so46485257b3.1 for ; Wed, 03 Jan 2024 14:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704321191; x=1704925991; 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=gD7HfQGkMqy/apKHbVy34aDAnQ+oEBq1bvsBtNcmKeE=; b=EgA7Ft5cDlv4m/BTXH67LqDrFliUqUMsrmMrWfA2IKTE8BPsPx8B04l7rGmEbQ4xU3 4HW9Hhm4kmXLer34/0ACSAPqQkGfOqxh1Hl/7G6g8A1E2+cRNZ1mA1o0JzjqFOeKNigF EAeeS1XDv/NkY9GQbZnfsRNyu0PNBfTKKRr2g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704321191; x=1704925991; 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=gD7HfQGkMqy/apKHbVy34aDAnQ+oEBq1bvsBtNcmKeE=; b=Fc+aQpQPuaAJI6br0qzTzyVzeSaQP8dtCk5/2wWTsY20m1p68/pVB4/PWWDkDx8/DF c7qCoqrsioiyV6llH/3FYWCUlGMSS9AY8Fem8moKgHEExrKEW7qEGt5lQZNPP1g+5Um/ UYUa1BdfquXwPJinNjla3rOhJtWbmW25bejNUxSiyaTNVWoTiddDHI+fnk3zXK+0Zj/9 PQEZC+tqWgYoipr2ARiuhUdy+Nzkf7iiXW+yic3XZnjloBNw8YQ2WDcF6Z536BxR5C8O iBFEKWgvYtjo8g1lEePJIZQg9ocUmnZSSFIRD+BjVg0Isw6OvSz4lSdB/MJ6kP2bsq1R FfUw== X-Gm-Message-State: AOJu0Yy7biLz4pQvKZ6X6L3wmyXTjDQdVNPEkC1eM2iBZJ3ZnwPmFSS1 Iz2KBx9fj+dTGzxGxrAK5qnwWYs1GXlf9qKcaYzvuJ//rxUIiSt8Au99qARzHx2hjRenwZ1Uyg= = X-Google-Smtp-Source: AGHT+IF/PqtL771GGXIKKmoiLpg+VKoSVTLFKtPulV+ua8vBkR92OZ1Y5EZnC/7MliJXx8lpN7wxNCvK+9vi X-Received: by 2002:a0d:da07:0:b0:5e9:76a3:d6bc with SMTP id c7-20020a0dda07000000b005e976a3d6bcmr16904117ywe.69.1704321191059; Wed, 03 Jan 2024 14:33:11 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id fk9-20020a05690c334900b00595853f9832sm1374672ywb.45.2024.01.03.14.33.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:33:11 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id 5A019605C311; Wed, 3 Jan 2024 17:33:10 -0500 (EST) 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, lylavoie@iol.unh.edu, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v6 5/7] dts: allow configuring MTU of ports Date: Wed, 3 Jan 2024 17:32:04 -0500 Message-ID: <20240103223206.23129-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103223206.23129-1-jspewock@iol.unh.edu> References: <20240103221217.18954-1-jspewock@iol.unh.edu> <20240103223206.23129-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 ac6bb5e112..e42f4d752a 100644 --- a/dts/framework/testbed_model/os_session.py +++ b/dts/framework/testbed_model/os_session.py @@ -413,6 +413,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.0