From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 96E2EA0520; Sun, 19 Jan 2020 17:41:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F08511E34; Sun, 19 Jan 2020 17:41:31 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130084.outbound.protection.outlook.com [40.107.13.84]) by dpdk.org (Postfix) with ESMTP id ADA321DBA; Sun, 19 Jan 2020 17:41:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iuJ1+nJQQVaamVorrrKbfssh1aIFWqkClkXiM7klwcGd7thJXk+H/3B3aMKY+PiKx1G7C9CvV2uYjWVBQfQq8jl+pGmHPkpv7PnXS/tkPMwKYS/KkAZbpBQMm/vqW9l+bicuongH2NVNBKOz4LwhWM7Bbq1guoJubKaQzsaJd9JLjLBpixPXlmakO00840eFGEmF8NpyeJHrnTIuUtvR0lihbw/qxSN4ixeZAtdZbohF4VM9VOhS/1rqd70rxnhQ9R6jzYFz6d4fKgI1lNo9Zrvx7NC/BOVy/9DnA0c0YoDVLb9SiOBVQC+WGTcPvfytU4OnnqBvDUwC9OWatxqBig== 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=9tmPnOBQVCAMVCiOTl1yBWkuvdLQUiEqq7aky13sy2A=; b=LvGN7E+gDG4cUuh1h3jeie5yXvBbyOijQtC7VKnF+aGb3w2POklaMAIuh8pRfS5jGphTMct5Dr0hD0VQuDBO+tcz1XqYOt7RWauef1ohTFd7QyfS2kbJ90mmEAXGimwPRL24DjDd4UwTMphaAdvZBJRvI0gSlsNEsi0PkxCmB2k82Q/v7qneHmUMvypRGiUXyFEqlQRlVwX6mXvYnIDpuJxC0sd9ty8kDHiGMVpMh8Izjt7x0J7eIQZFJYIaGAcL6uOp5R170NK8PxYcbvO1MWrf/3FqMyAbSUeN4phAvmj2Zwl5kjCvRf5LgmPWiFIhmvz2Xc8KbfDu/WI+bSGDMA== 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=9tmPnOBQVCAMVCiOTl1yBWkuvdLQUiEqq7aky13sy2A=; b=IluAvjCD8SOeOUpNktDM+MxxzK5vSkAFUAwwrPtaKCBOhH2/42ruPGujJnV9s//NBB61wO2N4RDaceEfOE3OMLOjt81lm1n3NXbw8r2PbdQhiniXeklidlnij89nT27fMrRimAMuH430E1h/DrZzxV5i0dfzBMum2oX8zuv8TRc= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (10.186.174.145) by AM0PR05MB5697.eurprd05.prod.outlook.com (20.178.115.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.24; Sun, 19 Jan 2020 16:41:29 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::f0b7:a92b:aeb5:5761]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::f0b7:a92b:aeb5:5761%5]) with mapi id 15.20.2644.024; Sun, 19 Jan 2020 16:41:29 +0000 From: Raslan Darawsheh To: Dekel Peled , Matan Azrad , Slava Ovsiienko CC: Ori Kam , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v3] net/mlx5: optimize Rx hash fields conversion Thread-Index: AQHVy+nSJCbx9lPKdUixY7GwwYSj+qfyNUZw Date: Sun, 19 Jan 2020 16:41:28 +0000 Message-ID: References: In-Reply-To: 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=rasland@mellanox.com; x-originating-ip: [212.29.221.74] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 671c3388-7210-4cbc-06ac-08d79cfe6ecc x-ms-traffictypediagnostic: AM0PR05MB5697:|AM0PR05MB5697: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 0287BBA78D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(136003)(346002)(366004)(396003)(376002)(199004)(189003)(9686003)(53546011)(316002)(6506007)(2906002)(186003)(55016002)(26005)(71200400001)(52536014)(8676002)(5660300002)(33656002)(81156014)(81166006)(478600001)(4326008)(7696005)(6636002)(66446008)(66476007)(66556008)(450100002)(66946007)(64756008)(110136005)(76116006)(54906003)(86362001)(8936002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB5697; H:AM0PR05MB6707.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: jNb+poAeaYro2a88tA+e4UfnJNHZSnndR6IVmfQRJS/M87OLk/bU2PlcQZwFKqJQd94eRPGuBMXtO5h8YswwzxUTML8eDIQsbBg+qVvd9k+kenTMlSep9u01BLDhgQ3mQaWne7rb2gdlubDu2sy92O6uxvW1StW+L9SmDT0D6l4BtjxAKFq/6dfIhjHAuC7qFaqphnhO8HJigtKEiSFM72+Mt7eD45aCihN25UfmOCvbqXDBsuyURnkqHII10TApmF+yBI4zugkjauG8FLRRNneWOqRo+LSdc7t1Fjp9ALut4dnagObQuaypHy0+9s/vGR1Nk6ufl+ftbgubbQB+WNHitHVfi+fTV2rO8scPj7nrNPjWZKjQEjFjw5O2zjzAHGzZ0ERxV2PjP23udzB7+CmAx4kbPOFUJAmLZINuhQ9cZdt4XyuwyAGRR9Jtg45vFRdAwSzLhzm9mcSl54Wpdo7HZPbI4TJyI9p2w8BaWNLn5zlk88eG5R5EK8gDLSxn 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: 671c3388-7210-4cbc-06ac-08d79cfe6ecc X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2020 16:41:29.0008 (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: q6eRlfGrGUB/pcuzhDINyJxxKHaaMu+lDS1V/QwW+kUrgCfaF2P5jX1/3HLjn8FxqaIpjlmrsBGVxiSO+iIQJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5697 Subject: Re: [dpdk-dev] [PATCH v3] net/mlx5: optimize Rx hash fields conversion 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, > -----Original Message----- > From: Dekel Peled > Sent: Wednesday, January 15, 2020 11:20 PM > To: Matan Azrad ; Slava Ovsiienko > > Cc: Raslan Darawsheh ; Ori Kam > ; dev@dpdk.org; stable@dpdk.org > Subject: [PATCH v3] net/mlx5: optimize Rx hash fields conversion >=20 > Previous fix added translation of Rx hash fields to PRM format. >=20 > This patch optimizes the fix, to perform value translation only > if value is not zero. > In case value is zero, there is no need to translate it. >=20 > Fixes: 51035775c3c7 ("net/mlx5: fix setting of Rx hash fields") > Cc: stable@dpdk.org >=20 > Signed-off-by: Dekel Peled > Acked-by: Viacheslav Ovsiienko >=20 > --- > v2: Modify title for clarity, change 'fix' to 'optimize'. > Remove the 'Fixes' label. > v3: Add back the 'Fixes' label. > --- >=20 > --- > drivers/net/mlx5/mlx5_rxq.c | 34 +++++++++++++++++++--------------- > 1 file changed, 19 insertions(+), 15 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index ca25e32..c936a7f 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -2460,7 +2460,6 @@ struct mlx5_hrxq * > } > } else { /* ind_tbl->type =3D=3D MLX5_IND_TBL_TYPE_DEVX */ > struct mlx5_devx_tir_attr tir_attr; > - struct mlx5_rx_hash_field_select *rx_hash_field_select; > uint32_t i; > uint32_t lro =3D 1; >=20 > @@ -2474,23 +2473,27 @@ struct mlx5_hrxq * > memset(&tir_attr, 0, sizeof(tir_attr)); > tir_attr.disp_type =3D MLX5_TIRC_DISP_TYPE_INDIRECT; > tir_attr.rx_hash_fn =3D MLX5_RX_HASH_FN_TOEPLITZ; > -#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT > tir_attr.tunneled_offload_en =3D !!tunnel; > - /* Translate hash_fields bitmap to PRM format. */ > - rx_hash_field_select =3D hash_fields & IBV_RX_HASH_INNER ? > - &tir_attr.rx_hash_field_selector_inner : > - &tir_attr.rx_hash_field_selector_outer; > + /* If needed, translate hash_fields bitmap to PRM format. */ > + if (hash_fields) { > +#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT > + struct mlx5_rx_hash_field_select > *rx_hash_field_select =3D > + hash_fields & IBV_RX_HASH_INNER ? > + > &tir_attr.rx_hash_field_selector_inner : > + > &tir_attr.rx_hash_field_selector_outer; > #else > - rx_hash_field_select =3D > &tir_attr.rx_hash_field_selector_outer; > + struct mlx5_rx_hash_field_select > *rx_hash_field_select =3D > + > &tir_attr.rx_hash_field_selector_outer; > #endif > - /* 1 bit: 0: IPv4, 1: IPv6. */ > - rx_hash_field_select->l3_prot_type =3D > - !!(hash_fields & MLX5_IPV6_IBV_RX_HASH); > - /* 1 bit: 0: TCP, 1: UDP. */ > - rx_hash_field_select->l4_prot_type =3D > - !!(hash_fields & MLX5_UDP_IBV_RX_HASH); > - /* Bitmask which sets which fields to use in RX Hash. */ > - rx_hash_field_select->selected_fields =3D > + > + /* 1 bit: 0: IPv4, 1: IPv6. */ > + rx_hash_field_select->l3_prot_type =3D > + !!(hash_fields & MLX5_IPV6_IBV_RX_HASH); > + /* 1 bit: 0: TCP, 1: UDP. */ > + rx_hash_field_select->l4_prot_type =3D > + !!(hash_fields & MLX5_UDP_IBV_RX_HASH); > + /* Bitmask which sets which fields to use in RX Hash. > */ > + rx_hash_field_select->selected_fields =3D > ((!!(hash_fields & MLX5_L3_SRC_IBV_RX_HASH)) << >=20 > MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_SRC_IP) | > (!!(hash_fields & MLX5_L3_DST_IBV_RX_HASH)) << > @@ -2499,6 +2502,7 @@ struct mlx5_hrxq * >=20 > MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_SPORT | > (!!(hash_fields & MLX5_L4_DST_IBV_RX_HASH)) << >=20 > MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_DPORT; > + } > if (rxq_ctrl->obj->type =3D=3D > MLX5_RXQ_OBJ_TYPE_DEVX_HAIRPIN) > tir_attr.transport_domain =3D priv->sh->td->id; > else > -- > 1.8.3.1 Fixed fixes reference, patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh