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 4882B457A5; Mon, 12 Aug 2024 22:55:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39AB140E2E; Mon, 12 Aug 2024 22:55:14 +0200 (CEST) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 1262C40E1D for ; Mon, 12 Aug 2024 22:55:12 +0200 (CEST) Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2cb576db1c5so3163165a91.1 for ; Mon, 12 Aug 2024 13:55:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1723496111; x=1724100911; 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=yxrRAjjH8RajZIfBUXmh7CipTKAl32qYthwroTiyH3w=; b=HgTUQQtSi0mlh94cGzbJVm8kPkp2k1/0BT5lvE9FCzDrAWMsRJOdKgyhq8X4zjnM+l 5qIh/7bbQ/AdRWrF1rvxUbN46KTyTSiF1CH3FztQC8rwEK/Mcxx98tVhMk/BoyNDj1kw 2sZlJMI3NwFW3Rm/F4wJRR3TXicoB6mbOn1LE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723496111; x=1724100911; 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=yxrRAjjH8RajZIfBUXmh7CipTKAl32qYthwroTiyH3w=; b=rbcdI9+wHpcEJpbJg4McXG9qJ2sW0E3DJF2EgUTD2dKmibcS4yqs2P+2z0qlF+y0r0 vy5QbUijI27HVN1NjJdmXy1gX9ksMSiSahWOG0enVE6C0Za7HDGmDg4rW4TUPt5rpagn gt57VVr4iQfFBTlDUn+udnStxPDGXS56nV/ynnOoamDjxISL6m4tnPglsn/5WLZiClW/ D4foJCFX603sRIgII05qxCiKUj+gPB+2Df9VE2lCCUdvcLure/Ax1a4Q0rgobE+LY7OV KvcGLha3Y4gLIZVS3wZhspiiUTM5GU2gdacAXEOyONPQdDdLadmuFgUdXyX+KnHD50WD y/UQ== X-Forwarded-Encrypted: i=1; AJvYcCXB0xzcBDJdKEKllUoYWYod7BKz/FKkWbtOfNJ2rz5Lo82Qcm/GSSx6m0+egVNITJK3kHiEt0m4jU8IdU4= X-Gm-Message-State: AOJu0Yz8O4+K8NmWnpZ0BC6lSyA4r15Rnj6k/7iA4uBOvtvfbU41M490 L23y67M2yTDsxwZtfAwDVMJ7EFEaDIRji9hrqPO8lL8sJ33l9YwU/p8d5/lHnbNoqVyjuU+exyo TLATiF2PY9T5SdAks6C+2DLwXbiP9v5v1z3YxrQ== X-Google-Smtp-Source: AGHT+IHEO5tTwEcHpKPCoXCcKv7vDJWB8ep7GkmBZMEpHP8HAS8foQfxijCbViyOVVdeLW3Ri7Sq/5u6H6rCa/cu0J0= X-Received: by 2002:a17:90b:3907:b0:2c9:5c67:dd9e with SMTP id 98e67ed59e1d1-2d392546ce0mr1563794a91.19.1723496111063; Mon, 12 Aug 2024 13:55:11 -0700 (PDT) MIME-Version: 1.0 References: <20240812134124.27637-1-dmarx@iol.unh.edu> <20240812134124.27637-2-dmarx@iol.unh.edu> In-Reply-To: <20240812134124.27637-2-dmarx@iol.unh.edu> From: Jeremy Spewock Date: Mon, 12 Aug 2024 16:55:00 -0400 Message-ID: Subject: Re: [RFC v1 1/2] dts: add csum HW offload 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 Mon, Aug 12, 2024 at 9:41=E2=80=AFAM Dean Marx wrote= : > > add csum_set_hw method to testpmd shell class. Port over > set_verbose and port start/stop from queue start/stop suite. > > Signed-off-by: Dean Marx > --- > + def csum_set_hw(self, layer: str, port_id: int, verify: bool =3D Tru= e) -> None: > + """Enables hardware checksum offloading on the specified layer. > + > + Args: > + layer: The layer that checksum offloading should be enabled = on. > + options: tcp, ip, udp, sctp, outer-ip, outer-udp. If there are specific options like this, it might be worth making this parameter into a flag where users can specify one or more of the options and testpmd can handle setting them all. That way users don't have to even read the doc-string for the options, it will be apparent in the class they have to use. > + port_id: The port number to enable checksum offloading on, s= hould be within 0-32. > + verify: If :data:`True` the output of the command will be sc= anned in an attempt to > + verify that checksum offloading was enabled on the port. > + > + Raises: > + InteractiveCommandExecutionError: If checksum offload is not= enabled successfully. > + """ > + csum_output =3D self.send_command(f"csum set {layer} hw {port_id= }") > + if (verify and ("Bad arguments" in csum_output or f"Please stop = port {port_id} first")): > + self._logger.debug(f"Failed to set csum hw mode on port {por= t_id}:\n{csum_output}") > + raise InteractiveCommandExecutionError( > + f"Failed to set csum hw mode on port {port_id}" > + ) > + if verify and f"checksum offload is not supported by port {port_= id}" in csum_output: > + self._logger.debug(f"Checksum {layer} offload is not support= ed by port {port_id}:\n{csum_output}") > + > + success =3D False > + if "outer-ip" in layer: > + if "Outer-Ip checksum offload is hw" in csum_output: > + success =3D True > + if "outer-udp" in layer: > + if "Outer-Udp checksum offload is hw" in csum_output: > + success =3D True > + else: > + if f"{layer.upper} checksum offload is hw" in csum_output: > + success =3D True > + if not success and verify: > + self._logger.debug(f"Failed to set csum hw mode on port {por= t_id}:\n{csum_output}") > + > -- > 2.44.0 >