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 E07254373D; Mon, 18 Dec 2023 19:13:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BDD6C42DC9; Mon, 18 Dec 2023 19:13:08 +0100 (CET) Received: from mail-ot1-f97.google.com (mail-ot1-f97.google.com [209.85.210.97]) by mails.dpdk.org (Postfix) with ESMTP id 1DE9742D92 for ; Mon, 18 Dec 2023 19:13:05 +0100 (CET) Received: by mail-ot1-f97.google.com with SMTP id 46e09a7af769-6d9f4eed60eso2908102a34.1 for ; Mon, 18 Dec 2023 10:13:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1702923184; x=1703527984; 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=LWy5yLdKpzUDzJB70ubur9uEm4/JCOHh/XV+76RBED4=; b=bMn4BlqKAbqY0EFHdXM6c/Z6KMiArs6R91FssVblyL5R2jfCi5gi0pQNUTK8fjgWj4 bADlUy+B9U6GxVQ+lpvzeJ0IVHYFIQATmX+JZ3of6vwn5i72jKZa6q68lAxw/pa2W+5p upliq+ayjMRGcGiLlSF9e2aawnCCph3dmBwUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702923184; x=1703527984; 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=LWy5yLdKpzUDzJB70ubur9uEm4/JCOHh/XV+76RBED4=; b=IZLSXaGHv2u7Luob+iEqCoNsgffDl0KcjRlZ+UfSZvdq0iJnnBpXuXPDy3T+nnEvHm tvyBvgGXGQE9UpjuluwUuElzrF2UujNRZ3PPiDHQRi57zC/TnMTkDPPovD0TzzQzss6m X8E0sHNa7EtgRT1mSPSaL/EzFEHwlUT9aGUEz7Plpw7pwzQVvcFeOuSC9PMc3tXtesXV U8hk5MuXB+wUFu3iLtKcuBmAw7ZO/wEFFZ0euW54Q0hM+uAOtwIlk8LVkMOItKZmXJSa hOLwvZZkxY/zrQMs0oScDNlC8bkH6dbwL6heYAcECjtEPvXnnlE/sluzfD3diOvbp2QO jomw== X-Gm-Message-State: AOJu0YxUDk3kZWWkZRN/85YiQK5+EUEAhDkmsoS+7DJT14y4zxUuHQES AkV/9OELbNVukOmsY99yMfUmb7fhCesQfpudacAetuUtw6bCRO6UIMi4cYUc9PNNyg== X-Google-Smtp-Source: AGHT+IF5RRQlpqqOA7wHG+uUMQwnlhbjRgKegkkhW9ZkpZRl+DO9j+19e0SCrS/6/JSNiJuiRXfDNqQm2kLU X-Received: by 2002:a05:6830:32a6:b0:6d9:a1c1:3ac6 with SMTP id m38-20020a05683032a600b006d9a1c13ac6mr15653336ott.58.1702923184539; Mon, 18 Dec 2023 10:13:04 -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 v36-20020a056830092400b006bb1331b18esm1338026ott.6.2023.12.18.10.13.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2023 10:13:04 -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 CFF8C605C311; Mon, 18 Dec 2023 13:13:03 -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 v4 5/7] dts: allow configuring MTU of ports Date: Mon, 18 Dec 2023 13:12:19 -0500 Message-ID: <20231218181221.10057-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218181221.10057-1-jspewock@iol.unh.edu> References: <20231218181221.10057-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 in an OS agnostic way. Signed-off-by: Jeremy Spewock --- dts/framework/remote_session/linux_session.py | 8 ++++++++ dts/framework/remote_session/os_session.py | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/dts/framework/remote_session/linux_session.py b/dts/framework/remote_session/linux_session.py index fd877fbfae..aaa4d57a36 100644 --- a/dts/framework/remote_session/linux_session.py +++ b/dts/framework/remote_session/linux_session.py @@ -177,6 +177,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: 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..cd073f5774 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 `port`. + + Args: + mtu: Desired MTU value. + port: Port to set `mtu` on. + """ + @abstractmethod def configure_ipv4_forwarding(self, enable: bool) -> None: """ -- 2.43.0