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 05E0B45711; Thu, 1 Aug 2024 14:34:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9C53427B3; Thu, 1 Aug 2024 14:34:34 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 5D4CC427B2 for ; Thu, 1 Aug 2024 14:34:32 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 404491007; Thu, 1 Aug 2024 05:34:57 -0700 (PDT) Received: from [10.1.38.17] (JR4XG4HTQC.cambridge.arm.com [10.1.38.17]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4A0863F766; Thu, 1 Aug 2024 05:34:30 -0700 (PDT) Message-ID: Date: Thu, 1 Aug 2024 13:34:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: dts: add multicast set function to shell Content-Language: en-GB To: Dean Marx , Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, jspewock@iol.unh.edu, bruce.richardson@intel.com Cc: dev@dpdk.org References: <20240708190858.26583-1-dmarx@iol.unh.edu> <20240708190858.26583-2-dmarx@iol.unh.edu> From: Luca Vizzarro In-Reply-To: <20240708190858.26583-2-dmarx@iol.unh.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Hi Dean, thank you for your work. On 08/07/2024 20:08, Dean Marx wrote: > + 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_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) This assumes that we have port 0 and 1, but *technically* we shouldn't be making assumptions about the environment in the framework. I'd rather use show_port_info_all and sample from there what's available. > + 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_output}" > + ) > + raise InteractiveCommandExecutionError( > + "Testpmd failed to set multicast mode on all ports." > + )