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 6D1A4432EC; Fri, 10 Nov 2023 00:23:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2834942D99; Fri, 10 Nov 2023 00:23:41 +0100 (CET) Received: from mail-io1-f100.google.com (mail-io1-f100.google.com [209.85.166.100]) by mails.dpdk.org (Postfix) with ESMTP id 0C8C242D99 for ; Fri, 10 Nov 2023 00:23:40 +0100 (CET) Received: by mail-io1-f100.google.com with SMTP id ca18e2360f4ac-7a683bd610dso50154439f.1 for ; Thu, 09 Nov 2023 15:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699572219; x=1700177019; 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=6WZJatjom6fBc4Cl+Z/GP97YRbLXWZIxuBHF1O6ZbKw=; b=h78AS9DGvl4y8uGEBd/U8z6tEwhz/rsX5UItRZihLAVfdLe85SFvftajzvZHT43whP 0BT0LG1nB4W+rFDi32pbef2MFDS+7v/zI2xTQnMNjMHGwGzPr9Mi7nhJuTb5e1Liv9DY o3Rej8KgyZtotNdqB6y+Bw5o/wSOzPRKhWZSA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699572219; x=1700177019; 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=6WZJatjom6fBc4Cl+Z/GP97YRbLXWZIxuBHF1O6ZbKw=; b=AVSqfPZXBi2MP/0T6SCtawbbvwfWq7gFNqzAt/eaKvCD+9TinkVfgeQ5MlQhFKtTxm XYR4vVDpmc8213/GR/i89NB2cscHLP75UOHrpkyBcHgAF5G3uAZbAvMwEQhMo8F2f0WH WV2V6Y+chzhn06BVKMC5gaWifXE1P03kzjyq2/Wauw+a/7ofldQtCkVv6VGOV/8bTP6z 4O2ZFjfvvuPv6TVF2dyuKibF083+9RsnbP1FxDg0vmhfTXBJkyPrWXN2j3fYMuGIU27d S89SL9vsA8sPoMOOBfICBd1eEwhry99t8HYkJMVCQM+fJ5N1pp1+C/jso7fHkCCWJB1Q tyKQ== X-Gm-Message-State: AOJu0YwJvpyj4CguvB9TUOhCKkMkhZzTzwV1EkKShQ3GUTdJWafAJTNv vbc/gjQzGXH6g4TR62t/nw8tLJD2eD08auaWkhSmMmlkQmxclN9C2LO+FTq8NAlEmg== X-Google-Smtp-Source: AGHT+IFZKZBv/da7jJ9OYfBtXIJ5FYpS9ycMW7UGLWSwlSWZatJXdAsPaP9HZiJ8F7hYLMnCuPaVGkHgQazl X-Received: by 2002:a5d:9b96:0:b0:79f:d04d:ce5a with SMTP id r22-20020a5d9b96000000b0079fd04dce5amr3428512iom.2.1699572219371; Thu, 09 Nov 2023 15:23:39 -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 a13-20020a029f8d000000b0045a47d447fdsm952719jam.30.2023.11.09.15.23.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:23:39 -0800 (PST) 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 CF96B605C318; Thu, 9 Nov 2023 18:23:38 -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, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v2 7/7] dts: allow configuring MTU of ports Date: Thu, 9 Nov 2023 18:20:17 -0500 Message-ID: <20231109232223.25644-9-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109232223.25644-2-jspewock@iol.unh.edu> References: <20231109232223.25644-2-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 in an OS agnostic way. Signed-off-by: Jeremy Spewock --- dts/framework/remote_session/linux_session.py | 7 +++++++ dts/framework/remote_session/os_session.py | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/dts/framework/remote_session/linux_session.py b/dts/framework/remote_session/linux_session.py index a3f1a6bf3b..dab68d41b1 100644 --- a/dts/framework/remote_session/linux_session.py +++ b/dts/framework/remote_session/linux_session.py @@ -196,6 +196,13 @@ def configure_port_ip_address( verify=True, ) + def configure_port_mtu(self, mtu: int, port: Port) -> None: + 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: state = 1 if enable else 0 self.send_command(f"sysctl -w net.ipv4.ip_forward={state}", privileged=True) diff --git a/dts/framework/remote_session/os_session.py b/dts/framework/remote_session/os_session.py index 8a709eac1c..c038f78b79 100644 --- a/dts/framework/remote_session/os_session.py +++ b/dts/framework/remote_session/os_session.py @@ -277,6 +277,15 @@ def configure_port_ip_address( Configure (add or delete) an IP address of the input port. """ + @abstractmethod + def configure_port_mtu(self, mtu: int, port: Port) -> None: + """Configure MTU on a given port. + + Args: + mtu: Desired MTU value. + port: Port to set the MTU on. + """ + @abstractmethod def configure_ipv4_forwarding(self, enable: bool) -> None: """ -- 2.42.0