From patchwork Tue Jan 9 15:36:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135815 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 544A343874; Tue, 9 Jan 2024 16:37:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC88140A70; Tue, 9 Jan 2024 16:37:05 +0100 (CET) Received: from mail-oa1-f99.google.com (mail-oa1-f99.google.com [209.85.160.99]) by mails.dpdk.org (Postfix) with ESMTP id 3647640A80 for ; Tue, 9 Jan 2024 16:37:03 +0100 (CET) Received: by mail-oa1-f99.google.com with SMTP id 586e51a60fabf-2045bedb806so2738416fac.3 for ; Tue, 09 Jan 2024 07:37:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704814622; x=1705419422; 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=NoNBeBJQlkt3iB6Lxwko1yuqC4bq8FCklF6sWfwkQ/eXHRRuUWSEb1IhZgjwtsrrDK IOqkWMNmRVdmBXaUJiN6CYc2MViCqGtUqfeNHTbbOZcLNgQiZ55jCLoM3o+c1YYgUMUy ysTgMmb9RRQfv3+ENHYvvxsNykMq17EdpEuRg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704814622; x=1705419422; 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=rk9BOZ4aXDVVHw3O2o4dnPvtYt0MZV81QXX6C9iDL6TeCzMHavCKEG8A75kAMhqszb HGL0hc2fI/vvodrcwii+HamGiyZfF7GxxTx8eAEgixDAVE4dnqsXzjdzkbar8BlOYCst aSAQSIfybMc04nL8yzzAsKTbyPzoUn4CbuPNHE4z+eI5axFu2a/glx3kPCNA62od9n5O 9CuLnJDwn1+DhnHghMnD8m+EU7JBT5aukzIqC1zD89SBNAUZTsSybYwk1Wd4nMhDM2cE iC1cu4omVILQuCnC1OXODy0w5nq5LMYs25ACcV/bkFEF9+RPQbGVC+UX4MpBSjjvsA5k MtEw== X-Gm-Message-State: AOJu0Ywj/ueI4ZnCgwES1vPIjjtENgJTS2a+ZhUkmnHDH06zwI4Gr6Al bkTE4MD0iE/zepES9hrP2OwuIKXu0q8DN2xwDni42+jrmOu1aHeDsDwcGQ== X-Google-Smtp-Source: AGHT+IG9i51JvmGVn/geeaTYj5WUoc3KkLEq6W8SFQuMr4tzyhWHRewk0fw/RzowgGWgx6g32f2JuzioC2Lj X-Received: by 2002:a05:6870:5e50:b0:1fb:75c:3fe4 with SMTP id ne16-20020a0568705e5000b001fb075c3fe4mr7710643oac.68.1704814621108; Tue, 09 Jan 2024 07:37:01 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id ds8-20020a0568705b0800b00203b9707d1fsm77820oab.2.2024.01.09.07.37.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2024 07:37:01 -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 2641F6043300; Tue, 9 Jan 2024 10:37:00 -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 v7 5/7] dts: allow configuring MTU of ports Date: Tue, 9 Jan 2024 10:36:31 -0500 Message-ID: <20240109153633.766-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109153633.766-1-jspewock@iol.unh.edu> References: <20240103223206.23129-1-jspewock@iol.unh.edu> <20240109153633.766-1-jspewock@iol.unh.edu> MIME-Version: 1.0 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.