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 7424945B09; Thu, 10 Oct 2024 22:20:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E2C8409FA; Thu, 10 Oct 2024 22:20:43 +0200 (CEST) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by mails.dpdk.org (Postfix) with ESMTP id 47C0140671 for ; Thu, 10 Oct 2024 22:20:41 +0200 (CEST) Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-7b111003738so89430185a.1 for ; Thu, 10 Oct 2024 13:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1728591640; x=1729196440; 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=VZFoX0VIuuqExlOE4qtwuGVrVV1rwcxsuM9mHFsbztDPPlzXiTjw6FmZt3WKXBDuMJ Nv7BtpVpTTppmeXPTHn8gdJv5ieuJYLT3y94MPro7gfEYwCip35zTfT7rZoj6K+IIzMh Gkdy5pHj/38zeAOZri6INAVu6VtqhxpGF51XQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728591640; x=1729196440; 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=UxyBm/ZNzSVkjG+aipAbCbgTHC4EvGQP7KAT3rbbeyKOVY4dA9UgvXjWir996tW7dX PqHjQFh2Lqjn7Effhoox2rY/pMZirLCs672bHg57Pvw5wLRg5zkOeXXGzwOlB6w8IIF1 gtAjlWmqs4ySH8ugf5EhTJvPB3ffzModMrSSMHAC0bG6sQ0G+cGDIvhRS2meMSFGTAHN kJz4M25ngTEcGLAyQdp1mGxCt/j3HWzeCRfwRXS/HnHHD7c76rs0PtnujAWmGptMT+0o YvTe8cD9/X0T8gCBJLLkPxRrWQH5LEp7Hlj92Weay2PN+iA5hhtG8ed8DPWB8y9VmbF1 26aw== X-Gm-Message-State: AOJu0Yz40CDRGAwFDJb3/K+kvhdslZJXl6vUDHmYn4uX8Z9NEULKo1aO rojxTnKmfBwJP4EqbF5mHksm79I1QTJB9Ljo0poZPaiNFbm9u6Mw+uEzZObmqhg= X-Google-Smtp-Source: AGHT+IEeWziTTgvJTOEiB42etHUAvuJNQVv3ZWlCmdT0cekvHG/AAEqJQpHVJWoail+xcQn/ALQ8Tg== X-Received: by 2002:a05:620a:269b:b0:7b1:f13:28d6 with SMTP id af79cd13be357-7b11a3ad452mr54667785a.41.1728591640624; Thu, 10 Oct 2024 13:20:40 -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-7b114958016sm73878185a.81.2024.10.10.13.20.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 13:20:39 -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 function to shell Date: Thu, 10 Oct 2024 16:21:03 -0400 Message-ID: <20241010202104.15364-2-dmarx@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241010202104.15364-1-dmarx@iol.unh.edu> References: <20240807191818.15978-1-dmarx@iol.unh.edu> <20241010202104.15364-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