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 92C8F45B09; Thu, 10 Oct 2024 22:17:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 074534068A; Thu, 10 Oct 2024 22:17:34 +0200 (CEST) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) by mails.dpdk.org (Postfix) with ESMTP id CDD6D4028E for ; Thu, 10 Oct 2024 22:17:32 +0200 (CEST) Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-7afcf50e2d0so62612985a.3 for ; Thu, 10 Oct 2024 13:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1728591452; x=1729196252; 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=RH3RyeFYa4EiBvLGOOotbTrFTqt5T08hGjF7kHgdDAQ=; b=Bg45yP4uwRa8ROwD1I4AGi34UUqD9um3XmSd3v8Sf6WlGfRgBEMvkHxVIXVxmUOjO6 qOmNb+MK3CU9Dk9qbRnjgBDuo7nJeUCQAx+fW6ZGIhoYQZxzCREuMTQGS42hYqTX+VOY SKN1R5xVWkFMUVNEnJIWuNOFDPgQSzOqia7PA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728591452; x=1729196252; 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=RH3RyeFYa4EiBvLGOOotbTrFTqt5T08hGjF7kHgdDAQ=; b=vJ2p7zuXDoALCr7e3s98TQi6ER4u/iwlV+6zelIfC3CnCYYdenA4nZkT7dE1PspB7g XZQGPIe7IQiajcORUuVB/EBKo5hIZxNnVE1wFqk7xaRkmnQF0IvuFcW0KlfOE9MspWck pqAxd2uT7mcBJwEph/xltf5cYVqouymh1iJ/LYOmErIyOnHyOW4//0mFeAfg9GT/aim7 vWJ+QBg0k7H8kCzYvkt298Bp5YAvaVZFst2SqlqpXp2Hpmyd18ATnBhuiJTTaPTa/82S ty2HHj5TONKkSXdo3rmkwxD/DLWeMBrJjc1dl5clAUhIaLgWnFH24dtkna140emCtGS2 Yhkg== X-Gm-Message-State: AOJu0Yy26uY2EGSN/Gsrnjl1tptJguR7LEV2i7oC4WXL5yt9qfhun1Y+ DsjNACwdH2Dx23Y7wQ74ENO2f65aVET91haKnP2DppKxWrLwc5+PyR78nt6gtpQ= X-Google-Smtp-Source: AGHT+IHsZOkOeX+Hn68oY/9ievKzGivAxOWHmVOi+TVaydGHCrdjZcRMd0+l2TS0B3Kokx2A63axlA== X-Received: by 2002:a05:620a:1a84:b0:7ae:6ba2:faba with SMTP id af79cd13be357-7b11a36d4ddmr42234985a.28.1728591452105; Thu, 10 Oct 2024 13:17:32 -0700 (PDT) Received: from dean-laptop.iol.unh.edu ([2606:4100:3880:1271:f9bd:24da:464d:6294]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b1148d6a09sm74172385a.42.2024.10.10.13.17.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 13:17:31 -0700 (PDT) From: Dean Marx To: probb@iol.unh.edu, npratte@iol.unh.edu, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com Cc: dev@dpdk.org, Dean Marx Subject: [PATCH v7 1/2] dts: add multicast set funciton to shell Date: Thu, 10 Oct 2024 16:17:55 -0400 Message-ID: <20241010201756.13894-2-dmarx@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241010201756.13894-1-dmarx@iol.unh.edu> References: <20240807191818.15978-1-dmarx@iol.unh.edu> <20241010201756.13894-1-dmarx@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 Add set multicast function for changing allmulticast mode within testpmd shell. Signed-off-by: Dean Marx --- dts/framework/remote_session/testpmd_shell.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index dc1bef431d..ab0ffa930d 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -1718,6 +1718,30 @@ def show_port_stats(self, port_id: int) -> TestPmdPortStats: return TestPmdPortStats.parse(output) + def set_multicast_all(self, on: bool, verify: bool = True): + """Turns multicast mode on/off for the specified port. + + Args: + on: If :data:`True`, turns multicast mode on, otherwise turns off. + verify: If :data:`True` an additional command will be sent to verify + that multicast mode is properly set. Defaults to :data:`True`. + + Raises: + InteractiveCommandExecutionError: If `verify` is :data:`True` and multicast + mode is not properly set. + """ + multicast_cmd_output = self.send_command(f"set allmulti all {'on' if on else 'off'}") + if verify: + stats0 = self.show_port_info(port_id=0) + stats1 = self.show_port_info(port_id=1) + if on ^ (stats0.is_allmulticast_mode_enabled and stats1.is_allmulticast_mode_enabled): + self._logger.debug( + f"Failed to set multicast mode on all ports.: \n{multicast_cmd_output}" + ) + raise InteractiveCommandExecutionError( + "Testpmd failed to set multicast mode on all ports." + ) + @requires_stopped_ports def set_port_mtu(self, port_id: int, mtu: int, verify: bool = True) -> None: """Change the MTU of a port using testpmd. -- 2.44.0