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 C465EA0524; Fri, 31 Jan 2020 20:27:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1B9391C0DD; Fri, 31 Jan 2020 20:27:04 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 6C3B91C0CC for ; Fri, 31 Jan 2020 20:27:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580498822; 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=ZEdyMLaVEHcLl+ueYPgTXnfW67xpRXPWQae42dWe8bE=; b=eXBBdALWWxO50ixNbm8Vh32FiJWj2q9XosOfwH988gGvvQ1y1CHfkdMMkIde5czv2HZ2IN 1gkIYhzATl+ONwHv4+dVPuvblQpk6z9Cxg4KwDu2VHfsoYfoei4tSXvoRHjcut/LaAMWuv pelO5ijkQv6v/xG5LDE5qJd50jQDj68= 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-118-NfY5HVZyND67Qx7KGC72xw-1; Fri, 31 Jan 2020 14:26:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D28D01005516; Fri, 31 Jan 2020 19:26:54 +0000 (UTC) Received: from [10.33.36.12] (unknown [10.33.36.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB0E1100EBA8; Fri, 31 Jan 2020 19:26:52 +0000 (UTC) To: Raslan Darawsheh , Matan Azrad , Slava Ovsiienko , "Yigit, Ferruh" Cc: "dev@dpdk.org" , "stable@dpdk.org" References: <1580231203-13912-1-git-send-email-matan@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 2TIgW4ckxhRFCvFu/606bnvCPie88ake4uWVWMAWwc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26:51 +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.84 on 10.5.11.22 X-MC-Unique: NfY5HVZyND67Qx7KGC72xw-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] net/mlx5: make FDB default rule optional 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 30/01/2020 13:06, Raslan Darawsheh wrote: > Hi, >> -----Original Message----- >> From: dev On Behalf Of Matan Azrad >> Sent: Tuesday, January 28, 2020 7:07 PM >> To: Slava Ovsiienko >> Cc: dev@dpdk.org; stable@dpdk.org >> Subject: [dpdk-dev] [PATCH] net/mlx5: make FDB default rule optional >> >> There are RDMA-CORE versions which are not supported multi-table for >> some Mellanox mlx5 devices. >> >> Hence, the optimization added in commit [1] which forwards all the FDB >> traffic to table 1 cannot be configured. >> >> Make the above optimization optional: >> Do not fail when either table 1 cannot be created or the jump rule >> (all =3D>jump to table 1) is not configured successfully. >> In this case, all the flows will be configured to table 0. >> >> [1] commit b67b4ecbde22 ("net/mlx5: skip table zero to improve >> insertion rate") >> Hi, can we replace with correct 'Fixes:' tag before it gets to master to be consistent and so it can be found/used by stable scripts. Thanks. >> Cc: stable@dpdk.org >> >> Signed-off-by: Matan Azrad >> --- >> drivers/net/mlx5/mlx5.h | 1 + >> drivers/net/mlx5/mlx5_flow.c | 6 ++++-- >> drivers/net/mlx5/mlx5_flow.h | 4 ++-- >> drivers/net/mlx5/mlx5_flow_dv.c | 11 ++++++----- >> drivers/net/mlx5/mlx5_trigger.c | 11 ++++++++--- >> 5 files changed, 21 insertions(+), 12 deletions(-) >> >> diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h >> index 5818349..1fc2063 100644 >> --- a/drivers/net/mlx5/mlx5.h >> +++ b/drivers/net/mlx5/mlx5.h >> @@ -792,6 +792,7 @@ struct mlx5_priv { >> =09/* UAR same-page access control required in 32bit implementations. >> */ >> #endif >> =09uint8_t skip_default_rss_reta; /* Skip configuration of default reta= . >> */ >> +=09uint8_t fdb_def_rule; /* Whether fdb jump to table 1 is configured. >> */ >> }; >> >> #define PORT_ID(priv) ((priv)->dev_data->port_id) >> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c >> index 5c9fea6..ffaf8a2 100644 >> --- a/drivers/net/mlx5/mlx5_flow.c >> +++ b/drivers/net/mlx5/mlx5_flow.c >> @@ -5575,6 +5575,8 @@ struct mlx5_flow_counter * >> * Value is part of flow rule created by request external to PMD. >> * @param[in] group >> * rte_flow group index value. >> + * @param[out] fdb_def_rule >> + * Whether fdb jump to table 1 is configured. >> * @param[out] table >> * HW table value. >> * @param[out] error >> @@ -5585,10 +5587,10 @@ struct mlx5_flow_counter * >> */ >> int >> mlx5_flow_group_to_table(const struct rte_flow_attr *attributes, bool >> external, >> -=09=09=09 uint32_t group, uint32_t *table, >> +=09=09=09 uint32_t group, bool fdb_def_rule, uint32_t *table, >> =09=09=09 struct rte_flow_error *error) >> { >> -=09if (attributes->transfer && external) { >> +=09if (attributes->transfer && external && fdb_def_rule) { >> =09=09if (group =3D=3D UINT32_MAX) >> =09=09=09return rte_flow_error_set >> =09=09=09=09=09=09(error, EINVAL, >> diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h >> index 39be5ba..82b4292 100644 >> --- a/drivers/net/mlx5/mlx5_flow.h >> +++ b/drivers/net/mlx5/mlx5_flow.h >> @@ -753,8 +753,8 @@ struct mlx5_flow_driver_ops { >> uint32_t mlx5_flow_id_release(struct mlx5_flow_id_pool *pool, >> =09=09=09 uint32_t id); >> int mlx5_flow_group_to_table(const struct rte_flow_attr *attributes, >> -=09=09=09 bool external, uint32_t group, uint32_t *table, >> -=09=09=09 struct rte_flow_error *error); >> +=09=09=09 bool external, uint32_t group, bool fdb_def_rule, >> +=09=09=09 uint32_t *table, struct rte_flow_error *error); >> uint64_t mlx5_flow_hashfields_adjust(struct mlx5_flow *dev_flow, int >> tunnel, >> =09=09=09=09 uint64_t layer_types, >> =09=09=09=09 uint64_t hash_fields); >> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c >> b/drivers/net/mlx5/mlx5_flow_dv.c >> index b90734e..d57d360 100644 >> --- a/drivers/net/mlx5/mlx5_flow_dv.c >> +++ b/drivers/net/mlx5/mlx5_flow_dv.c >> @@ -3357,7 +3357,7 @@ struct field_modify_info modify_tcp[] =3D { >> =09target_group =3D >> =09=09((const struct rte_flow_action_jump *)action->conf)->group; >> =09ret =3D mlx5_flow_group_to_table(attributes, external, target_group, >> -=09=09=09=09 &table, error); >> +=09=09=09=09 true, &table, error); >> =09if (ret) >> =09=09return ret; >> =09if (attributes->group =3D=3D target_group) >> @@ -4334,7 +4334,7 @@ struct field_modify_info modify_tcp[] =3D { >> =09int ret; >> >> =09ret =3D mlx5_flow_group_to_table(attributes, external, >> -=09=09=09=09 attributes->group, >> +=09=09=09=09 attributes->group, !!priv->fdb_def_rule, >> =09=09=09=09 &table, error); >> =09if (ret) >> =09=09return ret; >> @@ -7011,7 +7011,7 @@ struct field_modify_info modify_tcp[] =3D { >> =09mhdr_res->ft_type =3D attr->egress ? >> MLX5DV_FLOW_TABLE_TYPE_NIC_TX : >> >> MLX5DV_FLOW_TABLE_TYPE_NIC_RX; >> =09ret =3D mlx5_flow_group_to_table(attr, dev_flow->external, attr- >>> group, >> -=09=09=09=09 &table, error); >> +=09=09=09=09 !!priv->fdb_def_rule, &table, error); >> =09if (ret) >> =09=09return ret; >> =09dev_flow->group =3D table; >> @@ -7279,8 +7279,9 @@ struct field_modify_info modify_tcp[] =3D { >> =09=09case RTE_FLOW_ACTION_TYPE_JUMP: >> =09=09=09jump_data =3D action->conf; >> =09=09=09ret =3D mlx5_flow_group_to_table(attr, dev_flow- >>> external, >> -=09=09=09=09=09=09 jump_data->group, >> &table, >> -=09=09=09=09=09=09 error); >> +=09=09=09=09=09=09 jump_data->group, >> +=09=09=09=09=09=09 !!priv->fdb_def_rule, >> +=09=09=09=09=09=09 &table, error); >> =09=09=09if (ret) >> =09=09=09=09return ret; >> =09=09=09tbl =3D flow_dv_tbl_resource_get(dev, table, >> diff --git a/drivers/net/mlx5/mlx5_trigger.c >> b/drivers/net/mlx5/mlx5_trigger.c >> index ab6937a..7e12cd5 100644 >> --- a/drivers/net/mlx5/mlx5_trigger.c >> +++ b/drivers/net/mlx5/mlx5_trigger.c >> @@ -423,9 +423,14 @@ >> =09=09} >> =09=09mlx5_txq_release(dev, i); >> =09} >> -=09if (priv->config.dv_esw_en && !priv->config.vf) >> -=09=09if (!mlx5_flow_create_esw_table_zero_flow(dev)) >> -=09=09=09goto error; >> +=09if (priv->config.dv_esw_en && !priv->config.vf) { >> +=09=09if (mlx5_flow_create_esw_table_zero_flow(dev)) >> +=09=09=09priv->fdb_def_rule =3D 1; >> +=09=09else >> +=09=09=09DRV_LOG(INFO, "port %u FDB default rule cannot >> be" >> +=09=09=09=09" configured - only Eswitch group 0 flows are" >> +=09=09=09=09" supported.", dev->data->port_id); >> +=09} >> =09if (priv->isolated) >> =09=09return 0; >> =09if (dev->data->promiscuous) { >> -- >> 1.8.3.1 >=20 >=20 > Patch applied to next-net-mlx, >=20 > Kindest regards, > Raslan Darawsheh >=20