From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0049.outbound.protection.outlook.com [104.47.0.49]) by dpdk.org (Postfix) with ESMTP id 64D5C2BF3 for ; Thu, 25 Jan 2018 07:54:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=xWNP2xCtpOiOE4Xe6tr+eSKpSagE8L1TU1ktSNdaO8g=; b=BwvxUhdo9fcAnEDg3wsI04jAM9e3vB8bB/PQ6fWrrksQ8LPholIrZnS65kUx9jVvgwyilMdnzrDWu0P6bfzdyieH7LzeDxmEydQwicVV8IwVIjqRm3ciHfcqs932WXduZdFZ5EzWE6RjIHb7Kg4bsB2yMPQRbTxrVZb5z1GQ6ms= Received: from VI1PR05MB3149.eurprd05.prod.outlook.com (10.170.237.142) by VI1PR05MB1693.eurprd05.prod.outlook.com (10.165.235.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Thu, 25 Jan 2018 06:54:22 +0000 Received: from VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::789c:3f06:bb88:e29c]) by VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::789c:3f06:bb88:e29c%13]) with mapi id 15.20.0428.019; Thu, 25 Jan 2018 06:54:22 +0000 From: Shahaf Shuler To: Jiayu Hu , "dev@dpdk.org" CC: "wenzhuo.lu@intel.com" , "lei.a.yao@intel.com" Thread-Topic: [PATCH] app/testpmd: fix failing to enable SW checksum calculation Thread-Index: AQHTlYGe0P27ztVZpEGFZh2v5EjE2KOEJxgg Date: Thu, 25 Jan 2018 06:54:22 +0000 Message-ID: References: <1516846424-19929-1-git-send-email-jiayu.hu@intel.com> In-Reply-To: <1516846424-19929-1-git-send-email-jiayu.hu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.107] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB1693; 7:kVikcGIUfYikg8kzv5gQ5Dz9wqZWYV6ec96pzbM+dgxFXAYZ1lqAy76zQpYWUPZ4u04oafNKcjwxvDaNlozcYaZfh2XSEHVXTjzeIAA2hXucl2GP8tMrPwV4i7JlcymdfbwBCR/Yt9Fr2TKvEN6BgHMIQ49HK9nrtH3//SSCKw31b/FFh9f5kvj6GUOkw1DyL5k/tBXmJVditprXLdFp9k0ULY54DpfTwI15VQPlp5kCutMue0CNQHj0np4gB2nL x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 376b0d2c-a881-4faf-c68a-08d563c0773a x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:VI1PR05MB1693; x-ms-traffictypediagnostic: VI1PR05MB1693: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(2400081)(944501161)(6055026)(6041288)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:VI1PR05MB1693; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB1693; x-forefront-prvs: 0563F2E8B7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(39380400002)(396003)(376002)(366004)(189003)(199004)(2501003)(3660700001)(7696005)(3280700002)(66066001)(54906003)(110136005)(316002)(6246003)(76176011)(8936002)(8676002)(106356001)(3846002)(2900100001)(25786009)(14454004)(105586002)(6116002)(9686003)(81166006)(2906002)(55016002)(81156014)(33656002)(5660300001)(97736004)(478600001)(6506007)(26005)(102836004)(229853002)(99286004)(305945005)(7736002)(86362001)(68736007)(5250100002)(74316002)(575784001)(6436002)(2950100002)(53936002)(4326008)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB1693; H:VI1PR05MB3149.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ijb2w7SrJbi2OqkqM9FLam0seh3EtIQn+hNA4tDs2JUttjEdY2g+YYJU/AyP2HVLYozRJ/GeYxhrE5DdfvsHWg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 376b0d2c-a881-4faf-c68a-08d563c0773a X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jan 2018 06:54:22.7691 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1693 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix failing to enable SW checksum calculation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jan 2018 06:54:25 -0000 Hi Jiayu Hu, Good fix, thanks. Thursday, January 25, 2018 4:14 AM, Jiayu Hu: > In current design, we can't enable SW checksum calculation for the device= s > which don't have checksum offloading abilities via the command "csum set > ip|tcp|udp|sctp|outer-ip sw ". > But SW checksum calculation shouldn't depend on HW offloading abilities. > This patch is to fix this issue. >=20 > Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check") > Signed-off-by: Jiayu Hu > --- > app/test-pmd/cmdline.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > 9f12c0f..a2db9b7 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -3706,40 +3706,40 @@ cmd_csum_parsed(void *parsed_result, > hw =3D 1; >=20 > if (!strcmp(res->proto, "ip")) { > - if (dev_info.tx_offload_capa & > - > DEV_TX_OFFLOAD_IPV4_CKSUM) { > + if (hw =3D=3D 0 || (dev_info.tx_offload_capa & > + > DEV_TX_OFFLOAD_IPV4_CKSUM)) { > csum_offloads |=3D > DEV_TX_OFFLOAD_IPV4_CKSUM; > } else { > printf("IP checksum offload is not supported > " > "by port %u\n", res->port_id); > } > } else if (!strcmp(res->proto, "udp")) { > - if (dev_info.tx_offload_capa & > - > DEV_TX_OFFLOAD_UDP_CKSUM) { > + if (hw =3D=3D 0 || (dev_info.tx_offload_capa & > + > DEV_TX_OFFLOAD_UDP_CKSUM)) { > csum_offloads |=3D > DEV_TX_OFFLOAD_UDP_CKSUM; > } else { > printf("UDP checksum offload is not > supported " > "by port %u\n", res->port_id); > } > } else if (!strcmp(res->proto, "tcp")) { > - if (dev_info.tx_offload_capa & > - > DEV_TX_OFFLOAD_TCP_CKSUM) { > + if (hw =3D=3D 0 || (dev_info.tx_offload_capa & > + > DEV_TX_OFFLOAD_TCP_CKSUM)) { > csum_offloads |=3D > DEV_TX_OFFLOAD_TCP_CKSUM; > } else { > printf("TCP checksum offload is not > supported " > "by port %u\n", res->port_id); > } > } else if (!strcmp(res->proto, "sctp")) { > - if (dev_info.tx_offload_capa & > - > DEV_TX_OFFLOAD_SCTP_CKSUM) { > + if (hw =3D=3D 0 || (dev_info.tx_offload_capa & > + > DEV_TX_OFFLOAD_SCTP_CKSUM)) { > csum_offloads |=3D > DEV_TX_OFFLOAD_SCTP_CKSUM; > } else { > printf("SCTP checksum offload is not > supported " > "by port %u\n", res->port_id); > } > } else if (!strcmp(res->proto, "outer-ip")) { > - if (dev_info.tx_offload_capa & > - > DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) { > + if (hw =3D=3D 0 || (dev_info.tx_offload_capa & > + > DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)) { > csum_offloads |=3D >=20 > DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM; > } else { Reviewed-by: Shahaf Shuler > -- > 2.7.4