From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <shahafs@mellanox.com>
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-eopbgr130054.outbound.protection.outlook.com [40.107.13.54])
 by dpdk.org (Postfix) with ESMTP id 3172A2BD3
 for <dev@dpdk.org>; Tue, 26 Mar 2019 13:21:07 +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:X-MS-Exchange-SenderADCheck;
 bh=htoGFS+6KfPipr4KZYNRVXSb8tIzSaV2f/ACm4KLzvE=;
 b=Clo6wUJ6pGyajTZWW2OHDTOtSBDWSyh7R6ko0pn2oLDPf9V8A6KuEmBxoDS0dxzdQj4DkMZLgsuEmFa9ZF/Pjkskb4ci+S+97KLxuVARMuQli3LOSLUPDNSNYV7qCt9ll2jsG5vtHzW1NyHKIpaqqv05Jcy9pnU5ONuonSVGpCo=
Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by
 AM0PR0502MB3633.eurprd05.prod.outlook.com (52.133.46.138) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.1750.15; Tue, 26 Mar 2019 12:21:06 +0000
Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com
 ([fe80::84f3:7e92:7a51:1003]) by AM0PR0502MB3795.eurprd05.prod.outlook.com
 ([fe80::84f3:7e92:7a51:1003%2]) with mapi id 15.20.1750.014; Tue, 26 Mar 2019
 12:21:06 +0000
From: Shahaf Shuler <shahafs@mellanox.com>
To: Slava Ovsiienko <viacheslavo@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [PATCH v2 13/13] net/mlx5: add source vport match to the ingress
 rules
Thread-Index: AQHU4yzWlUJClj8gb0SHbf3wu8R30KYd1jng
Date: Tue, 26 Mar 2019 12:21:06 +0000
Message-ID: <AM0PR0502MB3795D619EAA0C2A534DD42A7C35F0@AM0PR0502MB3795.eurprd05.prod.outlook.com>
References: <1553155888-27498-1-git-send-email-viacheslavo@mellanox.com>
 <1553533414-9911-1-git-send-email-viacheslavo@mellanox.com>
 <1553533414-9911-14-git-send-email-viacheslavo@mellanox.com>
In-Reply-To: <1553533414-9911-14-git-send-email-viacheslavo@mellanox.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.105]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 37a3fceb-d6b5-4de8-4542-08d6b1e5855f
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: BCL:0; PCL:0;
 RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);
 SRVR:AM0PR0502MB3633; 
x-ms-traffictypediagnostic: AM0PR0502MB3633:
x-microsoft-antispam-prvs: <AM0PR0502MB36330896686B2EE28D70F9C4C35F0@AM0PR0502MB3633.eurprd05.prod.outlook.com>
x-forefront-prvs: 09888BC01D
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10009020)(136003)(396003)(366004)(346002)(376002)(39860400002)(199004)(189003)(26005)(186003)(102836004)(7696005)(6436002)(33656002)(14444005)(68736007)(256004)(74316002)(105586002)(66066001)(14454004)(6506007)(76176011)(106356001)(6246003)(305945005)(9686003)(7736002)(55016002)(53936002)(476003)(316002)(110136005)(3846002)(478600001)(2501003)(6116002)(25786009)(99286004)(52536014)(86362001)(229853002)(81156014)(11346002)(446003)(8676002)(71190400001)(81166006)(71200400001)(97736004)(486006)(5660300002)(2906002)(8936002);
 DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3633;
 H:AM0PR0502MB3795.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-message-info: p7zW/TQntAFiP4g3AY1N2+mvmgxMd4QvvR1ZIHbJbIGIXNdnFKx6VR8iBQHoH9pl2eeM9EqvnmP4Zl+tbhb7ZXmdqTS6J3DDlYSlm0n+UGav7DxdU2BBiGzRwQlWJitCuwg7L55DhoQp/tU+fo/uIGrMKFIgMdp3AtiAEjtDKBeRjBFLbjVtBxjbfdf/Dy9gPYnw+EtH2AbHHDdspgdihZ6W39PX4qWuDIH6NvhL0Sg7zFj1Tr4cvy8ghosranasucPqCDb4sa3EYnMYDyYy9S8n6IzYm44UFOzQAkNlo03JcK/+vsaL4QhOq3KZH2rib6/UnV11R9q7EruJYEm2YEPluZCAk+K89SOsEzIuQjIoEH/d5v/XNEvtnlKVblQCOFRuRVlbhb5ujRSKHcWlni9bGaptIv87YB6xqD/fGEk=
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: 37a3fceb-d6b5-4de8-4542-08d6b1e5855f
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 12:21:06.1113 (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-Transport-CrossTenantHeadersStamped: AM0PR0502MB3633
Subject: Re: [dpdk-dev] [PATCH v2 13/13] net/mlx5: add source vport match to
 the ingress rules
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Mar 2019 12:21:07 -0000

Monday, March 25, 2019 7:04 PM, Viacheslav Ovsiienko:
> Subject: [PATCH v2 13/13] net/mlx5: add source vport match to the ingress
> rules
>=20
> For E-Switch configurations over multiport Infiniband devices we should a=
dd
> source vport match to correctly distribute traffic between representors.
>=20
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 36
> ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
>=20
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index b8943da..67b359f 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -3095,6 +3095,29 @@ struct field_modify_info modify_tcp[] =3D {  }
>=20
>  /**
> + * Add source vport match to the specified matcher.
> + *
> + * @param[in, out] matcher
> + *   Flow matcher.
> + * @param[in, out] key
> + *   Flow matcher value.
> + * @param[in] port
> + *   Source vport value to match
> + * @param[in] mask
> + *   Mask
> + */
> +static void
> +flow_dv_translate_source_vport(void *matcher, void *key,
> +			      int16_t port, uint16_t mask)
> +{
> +	void *misc_m =3D MLX5_ADDR_OF(fte_match_param, matcher,
> misc_parameters);
> +	void *misc_v =3D MLX5_ADDR_OF(fte_match_param, key,
> misc_parameters);
> +
> +	MLX5_SET(fte_match_set_misc, misc_m, source_port, mask);
> +	MLX5_SET(fte_match_set_misc, misc_v, source_port, port); }
> +
> +/**
>   * Fill the flow with DV spec.
>   *
>   * @param[in] dev
> @@ -3389,6 +3412,19 @@ struct field_modify_info modify_tcp[] =3D {
>  	}
>  	dev_flow->dv.actions_n =3D actions_n;
>  	flow->actions =3D action_flags;
> +	if (attr->ingress && !attr->transfer &&
> +	    (priv->representor || priv->master)) {
> +		/* It was validated - we support unidirections flows only. */
> +		assert(!attr->egress);
> +		/*
> +		 * Add matching on source vport index only
> +		 * for ingress rules in E-Switch configurations.
> +		 */
> +		flow_dv_translate_source_vport(matcher.mask.buf,
> +					       dev_flow->dv.value.buf,
> +					       priv->representor_id,

Overall looks OK apart from the override of the representor_id.=20

> +					       0xffff);
> +	}
>  	for (; items->type !=3D RTE_FLOW_ITEM_TYPE_END; items++) {
>  		int tunnel =3D !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
>  		void *match_mask =3D matcher.mask.buf;
> --
> 1.8.3.1

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 2895BA05D3
	for <public@inbox.dpdk.org>; Tue, 26 Mar 2019 13:21:08 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id F31D437A2;
	Tue, 26 Mar 2019 13:21:07 +0100 (CET)
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-eopbgr130054.outbound.protection.outlook.com [40.107.13.54])
 by dpdk.org (Postfix) with ESMTP id 3172A2BD3
 for <dev@dpdk.org>; Tue, 26 Mar 2019 13:21:07 +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:X-MS-Exchange-SenderADCheck;
 bh=htoGFS+6KfPipr4KZYNRVXSb8tIzSaV2f/ACm4KLzvE=;
 b=Clo6wUJ6pGyajTZWW2OHDTOtSBDWSyh7R6ko0pn2oLDPf9V8A6KuEmBxoDS0dxzdQj4DkMZLgsuEmFa9ZF/Pjkskb4ci+S+97KLxuVARMuQli3LOSLUPDNSNYV7qCt9ll2jsG5vtHzW1NyHKIpaqqv05Jcy9pnU5ONuonSVGpCo=
Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by
 AM0PR0502MB3633.eurprd05.prod.outlook.com (52.133.46.138) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.1750.15; Tue, 26 Mar 2019 12:21:06 +0000
Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com
 ([fe80::84f3:7e92:7a51:1003]) by AM0PR0502MB3795.eurprd05.prod.outlook.com
 ([fe80::84f3:7e92:7a51:1003%2]) with mapi id 15.20.1750.014; Tue, 26 Mar 2019
 12:21:06 +0000
From: Shahaf Shuler <shahafs@mellanox.com>
To: Slava Ovsiienko <viacheslavo@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [PATCH v2 13/13] net/mlx5: add source vport match to the ingress
 rules
Thread-Index: AQHU4yzWlUJClj8gb0SHbf3wu8R30KYd1jng
Date: Tue, 26 Mar 2019 12:21:06 +0000
Message-ID:
 <AM0PR0502MB3795D619EAA0C2A534DD42A7C35F0@AM0PR0502MB3795.eurprd05.prod.outlook.com>
References: <1553155888-27498-1-git-send-email-viacheslavo@mellanox.com>
 <1553533414-9911-1-git-send-email-viacheslavo@mellanox.com>
 <1553533414-9911-14-git-send-email-viacheslavo@mellanox.com>
In-Reply-To: <1553533414-9911-14-git-send-email-viacheslavo@mellanox.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.105]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 37a3fceb-d6b5-4de8-4542-08d6b1e5855f
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: BCL:0; PCL:0;
 RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);
 SRVR:AM0PR0502MB3633; 
x-ms-traffictypediagnostic: AM0PR0502MB3633:
x-microsoft-antispam-prvs: <AM0PR0502MB36330896686B2EE28D70F9C4C35F0@AM0PR0502MB3633.eurprd05.prod.outlook.com>
x-forefront-prvs: 09888BC01D
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10009020)(136003)(396003)(366004)(346002)(376002)(39860400002)(199004)(189003)(26005)(186003)(102836004)(7696005)(6436002)(33656002)(14444005)(68736007)(256004)(74316002)(105586002)(66066001)(14454004)(6506007)(76176011)(106356001)(6246003)(305945005)(9686003)(7736002)(55016002)(53936002)(476003)(316002)(110136005)(3846002)(478600001)(2501003)(6116002)(25786009)(99286004)(52536014)(86362001)(229853002)(81156014)(11346002)(446003)(8676002)(71190400001)(81166006)(71200400001)(97736004)(486006)(5660300002)(2906002)(8936002);
 DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3633;
 H:AM0PR0502MB3795.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-message-info: p7zW/TQntAFiP4g3AY1N2+mvmgxMd4QvvR1ZIHbJbIGIXNdnFKx6VR8iBQHoH9pl2eeM9EqvnmP4Zl+tbhb7ZXmdqTS6J3DDlYSlm0n+UGav7DxdU2BBiGzRwQlWJitCuwg7L55DhoQp/tU+fo/uIGrMKFIgMdp3AtiAEjtDKBeRjBFLbjVtBxjbfdf/Dy9gPYnw+EtH2AbHHDdspgdihZ6W39PX4qWuDIH6NvhL0Sg7zFj1Tr4cvy8ghosranasucPqCDb4sa3EYnMYDyYy9S8n6IzYm44UFOzQAkNlo03JcK/+vsaL4QhOq3KZH2rib6/UnV11R9q7EruJYEm2YEPluZCAk+K89SOsEzIuQjIoEH/d5v/XNEvtnlKVblQCOFRuRVlbhb5ujRSKHcWlni9bGaptIv87YB6xqD/fGEk=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: Mellanox.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 37a3fceb-d6b5-4de8-4542-08d6b1e5855f
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 12:21:06.1113 (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-Transport-CrossTenantHeadersStamped: AM0PR0502MB3633
Subject: Re: [dpdk-dev] [PATCH v2 13/13] net/mlx5: add source vport match to
 the ingress rules
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Message-ID: <20190326122106.qRrHSxhL7aWP7Pbhk-rUTbtLWLjK5ZpixhFNgormFKM@z>

Monday, March 25, 2019 7:04 PM, Viacheslav Ovsiienko:
> Subject: [PATCH v2 13/13] net/mlx5: add source vport match to the ingress
> rules
>=20
> For E-Switch configurations over multiport Infiniband devices we should a=
dd
> source vport match to correctly distribute traffic between representors.
>=20
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 36
> ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
>=20
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index b8943da..67b359f 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -3095,6 +3095,29 @@ struct field_modify_info modify_tcp[] =3D {  }
>=20
>  /**
> + * Add source vport match to the specified matcher.
> + *
> + * @param[in, out] matcher
> + *   Flow matcher.
> + * @param[in, out] key
> + *   Flow matcher value.
> + * @param[in] port
> + *   Source vport value to match
> + * @param[in] mask
> + *   Mask
> + */
> +static void
> +flow_dv_translate_source_vport(void *matcher, void *key,
> +			      int16_t port, uint16_t mask)
> +{
> +	void *misc_m =3D MLX5_ADDR_OF(fte_match_param, matcher,
> misc_parameters);
> +	void *misc_v =3D MLX5_ADDR_OF(fte_match_param, key,
> misc_parameters);
> +
> +	MLX5_SET(fte_match_set_misc, misc_m, source_port, mask);
> +	MLX5_SET(fte_match_set_misc, misc_v, source_port, port); }
> +
> +/**
>   * Fill the flow with DV spec.
>   *
>   * @param[in] dev
> @@ -3389,6 +3412,19 @@ struct field_modify_info modify_tcp[] =3D {
>  	}
>  	dev_flow->dv.actions_n =3D actions_n;
>  	flow->actions =3D action_flags;
> +	if (attr->ingress && !attr->transfer &&
> +	    (priv->representor || priv->master)) {
> +		/* It was validated - we support unidirections flows only. */
> +		assert(!attr->egress);
> +		/*
> +		 * Add matching on source vport index only
> +		 * for ingress rules in E-Switch configurations.
> +		 */
> +		flow_dv_translate_source_vport(matcher.mask.buf,
> +					       dev_flow->dv.value.buf,
> +					       priv->representor_id,

Overall looks OK apart from the override of the representor_id.=20

> +					       0xffff);
> +	}
>  	for (; items->type !=3D RTE_FLOW_ITEM_TYPE_END; items++) {
>  		int tunnel =3D !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
>  		void *match_mask =3D matcher.mask.buf;
> --
> 1.8.3.1