From patchwork Mon Nov 13 20:28:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134184 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 8C04B4331E; Mon, 13 Nov 2023 21:29:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6FBF40DFB; Mon, 13 Nov 2023 21:28:59 +0100 (CET) Received: from mail-lf1-f99.google.com (mail-lf1-f99.google.com [209.85.167.99]) by mails.dpdk.org (Postfix) with ESMTP id C8D8B40685 for ; Mon, 13 Nov 2023 21:28:55 +0100 (CET) Received: by mail-lf1-f99.google.com with SMTP id 2adb3069b0e04-507bd644a96so6975505e87.3 for ; Mon, 13 Nov 2023 12:28:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699907335; x=1700512135; 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=bIQPkeMceVZUeatimCQuScEVHwHt/VI4UjlTKTHqyYOFu9W4mwob+k/h2HpCjvpiDj rb6mr6m1wXU3CmAgIEhqkC6KZx5qPpO8Bs8yu/8HfRVpqgRV2naiDuzQqBiq1IFcWr43 l82CSXNFBZK8N5CIX9VoMO7TnjUxK2slSSGB8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699907335; x=1700512135; 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=e1eg0HW3miKx/fH7hX2ZrFodTwWRLhn+YrZt081Q5xe5RqAqUrDo+BtvsCBDcNpUc5 9R89itTiXhQ8kBp2v41ahxZbYKfg57boz+Pjet6rpr9TUfjWFjYXl5lWzWm9muxeSirF 5jJtBv/dLg1Js6/WxNo1tKHxCuzYp+cymqYfw9iXRbU7nbxUj4lkzDpu1UiGgF0EtgBw 4IEYCDSsYVHMyQaNHT/hPnKj0bVUPNbx5cd4T/CosxLYgMsUXU48o2oE5MY1oGEvO824 63u82GcHNqgLSiz9bBd1hRpG4/vPx7rsZynzF1VQIHWEjA7NBVSXtl9EAfh6pWzSeh1p C/Gg== X-Gm-Message-State: AOJu0Yz1MUI0Mp2rTbd7fR79rn56Jn4PXpyJZo96spl9RP/UB3rP2yb1 FFcM3mlyHA9VrPTxGywkeiFZN09tRlSL3w/hfnLaZZV9mkDUBySRsc8RWczj4CHfHA== X-Google-Smtp-Source: AGHT+IEzTWOJQ46cwcvQl7FrEGVSd+lSalYI09kEwhIIvC3GQVKdF1z+8LE8PbOTInwSESxksgJsv1hL+VKp X-Received: by 2002:a19:ac03:0:b0:508:1a25:a190 with SMTP id g3-20020a19ac03000000b005081a25a190mr5075220lfc.23.1699907335358; Mon, 13 Nov 2023 12:28:55 -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 k8-20020a0565123d8800b0050a72f43623sm1557258lfv.97.2023.11.13.12.28.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2023 12:28:55 -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 0248B605C345; Mon, 13 Nov 2023 15:28:54 -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 v3 7/7] dts: allow configuring MTU of ports Date: Mon, 13 Nov 2023 15:28:12 -0500 Message-ID: <20231113202833.12900-8-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231113202833.12900-1-jspewock@iol.unh.edu> References: <20231113202833.12900-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 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: """