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 1598743883; Wed, 10 Jan 2024 15:43:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCF9B406BC; Wed, 10 Jan 2024 15:43:18 +0100 (CET) Received: from mail-pl1-f227.google.com (mail-pl1-f227.google.com [209.85.214.227]) by mails.dpdk.org (Postfix) with ESMTP id 24EBD4067C for ; Wed, 10 Jan 2024 15:43:16 +0100 (CET) Received: by mail-pl1-f227.google.com with SMTP id d9443c01a7336-1d3eb299e2eso25513415ad.2 for ; Wed, 10 Jan 2024 06:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704897795; x=1705502595; 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=QDUAne9XD+6/osGoVkSSeV7Dm5uiKDddL3STaSQ/vWCS1fLaTg0CWkHERi/wvJO56C gE+qpjJQ69UNkRO3ipaxvg99sC102Am1B+4Lx6D9cpwwllJLrdvILavRZqCmYJy+alkd huGce8Oql1sCXHSP7TkbTvKcsaDiwZRpuwF30= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704897795; x=1705502595; 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=OndXDDv2l+QVcjLRAF3XW5hQJUWGeTMgG81bJsDRtvjMsYOSZfjUQU1lS57It10RwR OvXvacYqkNyPEtjAOsFqLzXGdmvK/Jvw0Wyf7uPPRRsWvwLdNTDe4a9r0y/7QX4SqLvF 4pOUUn+rWLe42WBDe2T1J2nyrP9ElOF7WsaA/Gf+pJB+Zk1f33vyvvZx6F2NhMzn3Z12 IOU0Kxc9g9ej8eUwCX6nzAHZ75cLFIW8QgytrePXenv9FQ1sZZOfb8SbBKt50sisuCBl Ao0OdCak3mNg5f6X+UZgxJJO9B7Eq4BfmTEDIDj+BWjgEBA5wxUG5cEOlVUdDVrVQOxL RSoA== X-Gm-Message-State: AOJu0YwsO4pMFt3xcqhLoWxuTN18qXHBkd0KtR5HJWE9LQ59gG0z57aT 6oNULENtM348UDV7I48RXs5r7x4SQZY3QxjrOyl+v2O17NTOTQO6VFiz97Sw75Otr28xDo7M7g= = X-Google-Smtp-Source: AGHT+IEzcNBAj+Z46hDxZJV40tZJqSua35i4/kjctgzuq6tcV8zHoa/oT7gJJt02usSO8xTCfv+c5rwfB4n/ X-Received: by 2002:a17:903:52:b0:1d3:ee8d:25db with SMTP id l18-20020a170903005200b001d3ee8d25dbmr714647pla.117.1704897795329; Wed, 10 Jan 2024 06:43:15 -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 q18-20020a170902b11200b001d3af947bf3sm147364plr.121.2024.01.10.06.43.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2024 06:43:15 -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 790696043481; Wed, 10 Jan 2024 09:43:14 -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 v8 5/7] dts: allow configuring MTU of ports Date: Wed, 10 Jan 2024 09:42:47 -0500 Message-ID: <20240110144249.20719-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240110144249.20719-1-jspewock@iol.unh.edu> References: <20240109153633.766-1-jspewock@iol.unh.edu> <20240110144249.20719-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