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 669FBA0512; Tue, 14 Jan 2020 19:10:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DB5911C06A; Tue, 14 Jan 2020 19:10:24 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id C00B31C069 for ; Tue, 14 Jan 2020 19:10:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579025423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=PPWCIKlOlXxxG8SZ02cN/1GqsM0okdT7RmpVZeyz6YU=; b=Ba3/+hqO4rYP0m05omPrMb7zaTM+QDcZvgHyONNLf93iydCikrP8TR6YsUBRuGAjX17rP2 F55/H1DzCk/NOY6ooo0XwpuBY+VGRqVLupdTy7lkjfaNkU54WtyWwCnbLoATGmMk9gn4Ri 9ST2gwN5DQgYaRiP2GWAbM7kSgP0rTQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-8-nIgfCRu5Og-1MiqNZJZ4vw-1; Tue, 14 Jan 2020 13:10:19 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3F0A2DBA5; Tue, 14 Jan 2020 18:10:18 +0000 (UTC) Received: from [10.33.36.27] (unknown [10.33.36.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 623A95C1D6; Tue, 14 Jan 2020 18:10:16 +0000 (UTC) To: Dekel Peled , matan@mellanox.com, viacheslavo@mellanox.com Cc: rasland@mellanox.com, orika@mellanox.com, dev@dpdk.org, stable@dpdk.org References: <57bc3225d6cc2dfa0423a86d8ca99aab4ab39e55.1578497959.git.dekelp@mellanox.com> From: Kevin Traynor Autocrypt: addr=ktraynor@redhat.com; keydata= mQINBF2J2awBEADUEPNhgNI+nJNgiTAUcw4YIgVXEoHlsNPyyzG1BEXkWXALy0Y3fNTiw6+r ltWDkF9jzL9kfkecgQ67itGfk1OaBXgSGKuw1PUpxAwX2Bi76LAR6M5OsyGM9TSVVQwARalz hMwRBIZPzPc7or6Pw7jAOJ8SQGJ1Zlp1YJCjrvpe87V1tH/LY8Wnxn/EuoseFmWILAQZAtYS tGjcrAgYn3SPMLR1B0BP5bTBY06vWQjiufH8drenfDnMJAzuBdG1mqjnTqCjULZ3Hunv4xqZ aMnkvL/K5Tj1c12Oe4930EE53LrXIBUltRg5mBudSWHnC7twjH0082HH9f963Z/2UI63SFIT iUvRvAzJYytgy7XnWLQ0+goZBADKYfolOuC0H8VgCaux8u8KFF28Dy+N6TV2KI58jTlyg1Zu l7QwykZpnOkJFiy37Gfbu3YEOzO72cP/S7/A+zvuqkxi63jyEkd+FY99vLt/HN2MUZwRmKDw UPbLkmrs8WU01/POVsqDcfvz7vu2St8hqqTiSIdQGS2zyTKB2/DvPSM3jws3udkIYSuhn+X4 QBiV6lkVZ7DSE6a065gnAauAql+b32Eymy+xnG5jCt1tR+0Cp2VZYCR9OU2gmomUKBDoX/He pSgED01CqYPNjN+TddirwmQX7ep4DtXc8FWvv2g/pq9WZFQk2QARAQABtCNLZXZpbiBUcmF5 bm9yIDxrdHJheW5vckByZWRoYXQuY29tPokCTgQTAQgAOBYhBAoiOaH51tHF7VYtEI9CINER a+yJBQJdidmsAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEI9CINERa+yJoxIP/3VF 2TIgW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a60b@redhat.com> Date: Tue, 14 Jan 2020 18:10:15 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: nIgfCRu5Og-1MiqNZJZ4vw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v2] 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" On 14/01/2020 09:18, Dekel Peled wrote: > 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 > 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.=20 Thanks for the effort to categorize it correctly. Even if it's not with the Fixes tag, can you add a reference in the commit log to the "Previous fix". It will provide context for someone reading this commit log and stable maintainer can at check if the previous commit is in a particular stable branch. Kevin. > --- >=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 * > =09=09} > =09} else { /* ind_tbl->type =3D=3D MLX5_IND_TBL_TYPE_DEVX */ > =09=09struct mlx5_devx_tir_attr tir_attr; > -=09=09struct mlx5_rx_hash_field_select *rx_hash_field_select; > =09=09uint32_t i; > =09=09uint32_t lro =3D 1; > =20 > @@ -2474,23 +2473,27 @@ struct mlx5_hrxq * > =09=09memset(&tir_attr, 0, sizeof(tir_attr)); > =09=09tir_attr.disp_type =3D MLX5_TIRC_DISP_TYPE_INDIRECT; > =09=09tir_attr.rx_hash_fn =3D MLX5_RX_HASH_FN_TOEPLITZ; > -#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT > =09=09tir_attr.tunneled_offload_en =3D !!tunnel; > -=09=09/* Translate hash_fields bitmap to PRM format. */ > -=09=09rx_hash_field_select =3D hash_fields & IBV_RX_HASH_INNER ? > -=09=09=09=09 &tir_attr.rx_hash_field_selector_inner : > -=09=09=09=09 &tir_attr.rx_hash_field_selector_outer; > +=09=09/* If needed, translate hash_fields bitmap to PRM format. */ > +=09=09if (hash_fields) { > +#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT > +=09=09=09struct mlx5_rx_hash_field_select *rx_hash_field_select =3D > +=09=09=09=09=09hash_fields & IBV_RX_HASH_INNER ? > +=09=09=09=09=09&tir_attr.rx_hash_field_selector_inner : > +=09=09=09=09=09&tir_attr.rx_hash_field_selector_outer; > #else > -=09=09rx_hash_field_select =3D &tir_attr.rx_hash_field_selector_outer; > +=09=09=09struct mlx5_rx_hash_field_select *rx_hash_field_select =3D > +=09=09=09=09=09&tir_attr.rx_hash_field_selector_outer; > #endif > -=09=09/* 1 bit: 0: IPv4, 1: IPv6. */ > -=09=09rx_hash_field_select->l3_prot_type =3D > -=09=09=09!!(hash_fields & MLX5_IPV6_IBV_RX_HASH); > -=09=09/* 1 bit: 0: TCP, 1: UDP. */ > -=09=09rx_hash_field_select->l4_prot_type =3D > -=09=09=09!!(hash_fields & MLX5_UDP_IBV_RX_HASH); > -=09=09/* Bitmask which sets which fields to use in RX Hash. */ > -=09=09rx_hash_field_select->selected_fields =3D > + > +=09=09=09/* 1 bit: 0: IPv4, 1: IPv6. */ > +=09=09=09rx_hash_field_select->l3_prot_type =3D > +=09=09=09=09!!(hash_fields & MLX5_IPV6_IBV_RX_HASH); > +=09=09=09/* 1 bit: 0: TCP, 1: UDP. */ > +=09=09=09rx_hash_field_select->l4_prot_type =3D > +=09=09=09=09!!(hash_fields & MLX5_UDP_IBV_RX_HASH); > +=09=09=09/* Bitmask which sets which fields to use in RX Hash. */ > +=09=09=09rx_hash_field_select->selected_fields =3D > =09=09=09((!!(hash_fields & MLX5_L3_SRC_IBV_RX_HASH)) << > =09=09=09 MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_SRC_IP) | > =09=09=09(!!(hash_fields & MLX5_L3_DST_IBV_RX_HASH)) << > @@ -2499,6 +2502,7 @@ struct mlx5_hrxq * > =09=09=09 MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_SPORT | > =09=09=09(!!(hash_fields & MLX5_L4_DST_IBV_RX_HASH)) << > =09=09=09 MLX5_RX_HASH_FIELD_SELECT_SELECTED_FIELDS_L4_DPORT; > +=09=09} > =09=09if (rxq_ctrl->obj->type =3D=3D MLX5_RXQ_OBJ_TYPE_DEVX_HAIRPIN) > =09=09=09tir_attr.transport_domain =3D priv->sh->td->id; > =09=09else >=20