From patchwork Wed Jan 8 11:08:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roni Bar Yanai X-Patchwork-Id: 1219523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="TgOBt6XX"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47t62B1vTdz9sRf for ; Wed, 8 Jan 2020 22:09:05 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 279B3204F7; Wed, 8 Jan 2020 11:09:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I0Q9YAlTLU8y; Wed, 8 Jan 2020 11:09:02 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id A65162000B; Wed, 8 Jan 2020 11:09:02 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 87186C1796; Wed, 8 Jan 2020 11:09:02 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8E192C0881 for ; Wed, 8 Jan 2020 11:09:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7308A204D0 for ; Wed, 8 Jan 2020 11:09:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zfuTd36t2CIV for ; Wed, 8 Jan 2020 11:09:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80047.outbound.protection.outlook.com [40.107.8.47]) by silver.osuosl.org (Postfix) with ESMTPS id C37532000B for ; Wed, 8 Jan 2020 11:08:59 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MBoQu7F1UYoFpbaxqAg0rtMHkEaz2U1+9gdUZi/RXPFnPevOtv6u8LdtPkl4Ts1BjJ2TKnVmISo9DfzBFgm6V9CYMVdcZA338rdbW/zQcprBVv2IhPQbFTTvPVEDfA9SwYE2sxN12uKNEIhZmMq6LTyce49igjd31+MMle53YdEOk8FZ9yoIpT3NzNxQrID6c1CiwDZIrNnfIlXC9G0CbsaGj+5cf1E+LKq0FY1ICzNAbjlJSAXsIb/6rh5FLAgawoIh7AJcJqmty1n7b+NCRwu1BOVijfKC8WBgTw0vwubGNqF987LxmkHgDL1DavFzq0qh2/R3g1ty/IpTH9NB9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MyM39r90qNSfVoW69m5As/Npi4JPcEe0cXd4pC/7/8I=; b=Npuh6CHAcaK5GvTMh8iRJb3kOy239+1S7xVzKzeaHZ+SqEQNh6SVSkxRn5+Ii9Er+XldMh7ncUGVZbWirX9R+4zJhrx9/cqr8oJDJ8+1lvloFz7zIf+Sf20JjRIzQGVejWNDM4fRViX/iV+L37NGUG+ij0lyMrFAeqSvXaEKcGWv1jZMNV/j7EvEOrxs/sgtULKyqzdbZ5yXgR0C6tWDgxbXGaDz017TWxUhHGcW+9PxtOhBZC6hOt+/9kVQx4v4YZ3hfBrajHkwz6WzUkbnXdelI2Rh1YJptQh9uJsvQQb/W3Lo1Er1pAp2TSG1WyKAMm0vL5nUp4fAoGeQuu+VgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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:X-MS-Exchange-SenderADCheck; bh=MyM39r90qNSfVoW69m5As/Npi4JPcEe0cXd4pC/7/8I=; b=TgOBt6XXU8m2IcHaIivd4hgJH84Au4HFeXLXNKDYg06ymCv3aYXQwr1+6gqcoi6Soqm0vBMaHDZunlPSva+3LFbv0cUY7Hrxgn9pdU+lxpVeIMt60ibglgdA9BrpvQnLC7oAKnRSskAcgbDURRATvIPFMfRGjfOClfQ6BarqcOY= Received: from AM4PR05MB3187.eurprd05.prod.outlook.com (10.171.189.12) by AM4PR05MB3362.eurprd05.prod.outlook.com (10.171.187.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.9; Wed, 8 Jan 2020 11:08:57 +0000 Received: from AM4PR05MB3187.eurprd05.prod.outlook.com ([fe80::317e:d99a:3d5b:259d]) by AM4PR05MB3187.eurprd05.prod.outlook.com ([fe80::317e:d99a:3d5b:259d%7]) with mapi id 15.20.2623.008; Wed, 8 Jan 2020 11:08:57 +0000 From: Roni Bar Yanai To: "ovs-dev@openvswitch.org" , Ilya Maximets Thread-Topic: [RFC] odp-execute: dp_hash HW offload inconsistency. Thread-Index: AdXGCOlpiTmy5rqRQcuc7+uvTndflQ== Date: Wed, 8 Jan 2020 11:08:57 +0000 Message-ID: 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=roniba@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b0aba358-e532-40c6-e56b-08d7942b2805 x-ms-traffictypediagnostic: AM4PR05MB3362: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 02760F0D1C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(366004)(376002)(396003)(39860400002)(189003)(199004)(7696005)(55016002)(8676002)(81166006)(71200400001)(6506007)(81156014)(478600001)(64756008)(186003)(66556008)(26005)(66476007)(66446008)(316002)(33656002)(76116006)(66946007)(9686003)(52536014)(110136005)(2906002)(86362001)(8936002)(9326002)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3362; H:AM4PR05MB3187.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Gjbqby/ncnzMV4z1O8mQ6xkSfzBdBmAgcw6ZJI4/LxxM1MqSvR3QAvVlvkKyQ00It9LGPNn5xBV5eHgDfn7ldiUKlq/0XIkxFuHLwvQsrXOLY11OS9wk9If8DWP2TQ6bYEpMzk1OB71P9UvU/G7u2PHQLh7utbD/7FqqFrvn8l7mN2F3qfZu+fEYcpduxq+rCOC7CO1Ty7aKKSUNBRLl69KFbxQHBPJOLUNxMnhO7O0PGNQP2gcBDfRsDDzoy8AO3a2MUd0ff5hMi1ZQrO4SLjYQaogT0EY6R4WCKxe9cK4qVAc5PmACb4ZKds8B57uWgsWgxIxTiz5BKayikYAvmzNWSrZimsZUWHCgA9DkgNW1sXW/yh3LCSrx+zwyOxPhfowZxlTXeuWt9qRNJgiGN6/KIoDt8pg5/sAOBPh8mAvvF0LKB6mja/iMyHH5jfTm x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0aba358-e532-40c6-e56b-08d7942b2805 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2020 11:08:57.0655 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: p+6hqe94SgUXAK5MKVMeEALRs30hnmjMbek6ehscr++AfqvDTYs4Of1kHhXNmFb+OrGk3sxCjRTRUQ2AFiIdrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3362 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [ovs-dev] [RFC] odp-execute: dp_hash HW offload inconsistency. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Hi Ilya, I have a setup with vxlan, and then I do dp_hash (after pop). First packet does pop in SW, so RSS is invalidated (and anyway it was probably calculated on outer), dp_hash is calculated again SW. Following packet will do decap in HW so packet has a valid internal RSS (mark+rss), And it is used as the hash. I have inconsistency between the packets that passed through SW and packet that were offloaded with the same 5-tuple (internal). I know vxlan pop is not offload yet, but we hope it will soon. I thought of solving this issue by calling netdev_offload_dpdk layer to calc the hash in case when HW offload Is enabled. So it will be the same hash for both cases. dp_hash HW offload without a tunnel, will have the same issue, as HW will use some hash not necessarily the same as RSS configuration, and even if RSS is used, in SW there is another salt on top of that, so packet with same 5-tuple offload vs not offloaded will get different hash. What do you think? BR, Roni diff --git a/lib/odp-execute.c b/lib/odp-execute.c index 563ad1d..26dc907 100644 --- a/lib/odp-execute.c +++ b/lib/odp-execute.c @@ -822,14 +822,18 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal, DP_PACKET_BATCH_FOR_EACH (i, packet, batch) { /* RSS hash can be used here instead of 5tuple for * performance reasons. */ - if (dp_packet_rss_valid(packet)) { - hash = dp_packet_get_rss_hash(packet); - hash = hash_int(hash, hash_act->hash_basis); + if (netdev_is_flow_api_enabled()) { + hash = netdev_offload_dpdk_set_dp_hash(packet); } else { - flow_extract(packet, &flow); - hash = flow_hash_5tuple(&flow, hash_act->hash_basis); - } - packet->md.dp_hash = hash; + + if (dp_packet_rss_valid(packet)) { + hash = dp_packet_get_rss_hash(packet); + hash = hash_int(hash, hash_act->hash_basis); + } else { + flow_extract(packet, &flow); + hash = flow_hash_5tuple(&flow, hash_act->hash_basis); + } + packet->md.dp_hash = hash; } break; }