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 5FB4D4380D; Wed, 3 Jan 2024 23:13:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE8B04068E; Wed, 3 Jan 2024 23:13:35 +0100 (CET) Received: from mail-pl1-f226.google.com (mail-pl1-f226.google.com [209.85.214.226]) by mails.dpdk.org (Postfix) with ESMTP id 2B0A240608 for ; Wed, 3 Jan 2024 23:13:34 +0100 (CET) Received: by mail-pl1-f226.google.com with SMTP id d9443c01a7336-1d4c3393f99so16566225ad.0 for ; Wed, 03 Jan 2024 14:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704320013; x=1704924813; 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=beYLCIXUxJDqkSlkF2aKf5dzi8pgy4qUAH3yiKxWALmM/P7BjBdWbEkXMZ9pLtSKeT QYXgm/+YkffqkSNVmnO4y3YZwODCW8c44jecESxAq8xTyfOsYTADJPgaf4F24S+aQ8Ft siXfh7d71jVL4/8RnAguieFK8BWGO890ZMkUA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704320013; x=1704924813; 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=RQC1hRzUcLtQmwRHh+pQ9NwIsHBKPfA8/nb6z9wSWKfiGjpu1Rgw3X/V8v61kWEWEM EuDuwSuHJuRqwFcxznAizt7uyhevnOMVQPAq9qXAXQ7kNgLi8iYxKn6JcjOhaoiIteMi faW0mL3tPwgKBjLyUG73m8JdKe2cCnya87q/iLqpeBPmKS3HCO6e+spxnKTXIZ9dZ84k KlvPdWuWBo97jRvzqFY0KjDLnhb0jvwsqElhSd1IxdMc2qm9xtfWgSX72Iwb/+xX+Itr bUeTaeqRjVn7QX4LQwNsw/DtoUZ5r8thenEMOPZJwd/9Ost205wNNZaoJelhr4mu1o6e bgdg== X-Gm-Message-State: AOJu0Yy7Z1qK58juJGjRTfdNaIuIKYyKMzptEqnWDFZmMUZ4sn8tSXUm bcfiGFnlqz+B13/1wShN+yhuuNqICKZGMfz9GpQ0E8ZOSjkx5IpQIxjbjw== X-Google-Smtp-Source: AGHT+IE/p20bmhi3geLSV1MbXnMW/pZV3ot/Fc4FpAWfePI0HiIeyPVuehvGrUeXmK97gKUg1oD2tBwC46p8 X-Received: by 2002:a17:903:64d:b0:1d3:f112:2c03 with SMTP id kh13-20020a170903064d00b001d3f1122c03mr19072191plb.53.1704320013395; Wed, 03 Jan 2024 14:13:33 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id c18-20020a170902849200b001d4872d942asm407636plo.132.2024.01.03.14.13.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:13:33 -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 4CEE9605C311; Wed, 3 Jan 2024 17:13:32 -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 v5 5/7] dts: allow configuring MTU of ports Date: Wed, 3 Jan 2024 17:12:15 -0500 Message-ID: <20240103221217.18954-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103221217.18954-1-jspewock@iol.unh.edu> References: <20231218181221.10057-1-jspewock@iol.unh.edu> <20240103221217.18954-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