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 79DC4459E1; Fri, 20 Sep 2024 20:33:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4673940655; Fri, 20 Sep 2024 20:33:57 +0200 (CEST) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mails.dpdk.org (Postfix) with ESMTP id A34FE40275 for ; Fri, 20 Sep 2024 20:33:55 +0200 (CEST) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-7d4f9e39c55so1709262a12.2 for ; Fri, 20 Sep 2024 11:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1726857234; x=1727462034; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=y/RG9baPEx4tYz4vJEk76GSZCOITKT23XUiOKLvXGak=; b=i1fk4iuwE5UyxeYSMs586PLP+LYqVatbQMKx+Ghwbhuz0OyUxTw+pWLpzLSw6qGyH9 AUKU7cYAn+9KylH7eGMzg67zZQtDPFOqsxDhvSms+kj4Rj7NW7rYODMDCMSgntof1jf2 6c4tJyb9c19COcF/HoSOo8jm9sB0kF57qJy7I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726857234; x=1727462034; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y/RG9baPEx4tYz4vJEk76GSZCOITKT23XUiOKLvXGak=; b=OkVfyQbK5p89qo2vuuq6V/IKAOJIHqje4WJ5TwcaP/bbhruiIRhG2ZLqVhsHKSQYn2 dqWTt2l0HBH78/CNI4S7gfPKQtTP89/6bvWMMsOoUv7ee6teZOFZX78Nde8Kc9gcF/Ss im/CDQGQJMlXupv3foHIFFXLQQJXkTE6CK0ZkDZ4aoJ9GiwaHIFhSkKWAAB1LyLu5dB0 q3nVVD7VJBPI+H9t6XaEfEkgxXo8jycOmZAzddzS3WkMtAooudPOoArCH9z5lH9gBMOO y2dRUzcaWM8gg79WmR0dk3FN9DzjVl1REvic2uhO8ykRdfLIBo+xKti90ceKiOXXuenH zuDQ== X-Forwarded-Encrypted: i=1; AJvYcCUQbNBfq7ULTVeyvW8muChVlznOJgk+/0QUfA0jebmPVvvtyi5r03RjcW1kttknQMTPUHg=@dpdk.org X-Gm-Message-State: AOJu0Yydk8qdIxN1U7ykcCNFn/LsBBn5CbP5VO/XSnXYIiBfFlVxc7AP b388zSp96u4Wh34IfeZ3I59VqayNgdkzgEJT5CvPNOblUTTikvpM7Cr20fqzhcOaNajW9TVOOVd yz2uPaspOtl+Uz8pob+1HeCtzauqbidYlyuPrEg== X-Google-Smtp-Source: AGHT+IErBv2nJ4hfRkC0CupjjAwXXle/7jNBEWY/MYdSmgqGDrJ2snV2sQhv4zPSihNfhAue2W+oXxI3TfP7zg2xjwk= X-Received: by 2002:a17:90a:b117:b0:2d8:7572:4bc1 with SMTP id 98e67ed59e1d1-2dd7f3806abmr4527083a91.1.1726857234632; Fri, 20 Sep 2024 11:33:54 -0700 (PDT) MIME-Version: 1.0 References: <20240911173801.16538-1-dmarx@iol.unh.edu> <20240918194127.11556-1-dmarx@iol.unh.edu> In-Reply-To: <20240918194127.11556-1-dmarx@iol.unh.edu> From: Jeremy Spewock Date: Fri, 20 Sep 2024 14:33:43 -0400 Message-ID: Subject: Re: [PATCH v2] dts: add VLAN methods to testpmd shell To: Dean Marx Cc: 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, juraj.linkes@pantheon.tech, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Wed, Sep 18, 2024 at 3:41=E2=80=AFPM Dean Marx wrote= : > > + > + def tx_vlan_set(self, port: int, vlan: int, verify: bool =3D True) -= > None: One thing to note is that I think this method (unlike rx_vlan_set for some reason) requires the ports to be stopped for it to work, so we should probably decorate this with @requires_stopped_ports to make it more convenient for the developer. > + """Set hardware insertion of vlan tags in packets sent on a port= . > + > + Args: > + port: The port number to use, should be within 0-32. > + vlan: The vlan tag to insert, should be within 1-4094. > + verify: If :data:`True`, the output of the command is scanne= d to verify that > + vlan insertion was enabled on the specified port. If not= , it is > + considered an error. > + > + Raises: > + InteractiveCommandExecutionError: If `verify` is :data:`True= ` and the insertion > + tag is not set. > + """ > + vlan_insert_output =3D self.send_command(f"tx_vlan set {port} {v= lan}") > + if verify: > + if ( > + "Please stop port" in vlan_insert_output > + or "Invalid vlan_id" in vlan_insert_output > + or "Invalid port" in vlan_insert_output > + ): > + self._logger.debug( > + f"Failed to set vlan tag {vlan} on port {port}:\n{vl= an_insert_output}" > + ) > + raise InteractiveCommandExecutionError( > + f"Testpmd failed to set vlan insertion tag {vlan} on= port {port}." > + ) > + > + def tx_vlan_reset(self, port: int, verify: bool =3D True) -> None: I believe this method also required ports to be stopped. > + """Disable hardware insertion of vlan tags in packets sent on a = port. > + > + Args: > + port: The port number to use, should be within 0-32. > + verify: If :data:`True`, the output of the command is scanne= d to verify that > + vlan insertion was disabled on the specified port. If no= t, it is > + considered an error. > + > + Raises: > + InteractiveCommandExecutionError: If `verify` is :data:`True= ` and the insertion > + tag is not reset. > + """ > + vlan_insert_output =3D self.send_command(f"tx_vlan reset {port}"= ) > + if verify: > + if "Please stop port" in vlan_insert_output or "Invalid port= " in vlan_insert_output: > + self._logger.debug( > + f"Failed to reset vlan insertion on port {port}: \n{= vlan_insert_output}" > + ) > + raise InteractiveCommandExecutionError( > + f"Testpmd failed to reset vlan insertion on port {po= rt}." > + ) > + > 2.44.0 >