From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00080.outbound.protection.outlook.com [40.107.0.80]) by dpdk.org (Postfix) with ESMTP id 6E83F1B13F; Wed, 30 Jan 2019 05:06:26 +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=35KEMqPPxb31KHX/dKL5+PEKJe4ah6vYIx7qP+nXuPQ=; b=uL/8eeZ/ppnAv7XKYN5JSMxiJNlbACJlPJFNt03dkeXtHMTnlUWK1FYmcKUDysbOeHe1VnVwKN0sOdsafAHckiUint6b5T/msURJU9BBraaT3oyfrtzdARrCtBNDdDeCzF72055R+xDEuRS8rAVfm+heMKX0qLM652l8URBdHj4= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4092.eurprd05.prod.outlook.com (52.134.73.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Wed, 30 Jan 2019 04:06:24 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1da8:cd09:4e78:111c]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1da8:cd09:4e78:111c%2]) with mapi id 15.20.1558.025; Wed, 30 Jan 2019 04:06:24 +0000 From: Yongseok Koh To: Dekel Peled CC: Shahaf Shuler , "dev@dpdk.org" , Ori Kam , "stable@dpdk.org" Thread-Topic: [PATCH v2] net/mlx5: fix concurrent use of Tx offloads Thread-Index: AQHUt8aBHitO9KIU6EORMA8obbWt36XHMrsA Date: Wed, 30 Jan 2019 04:06:24 +0000 Message-ID: <20190130040613.GA39039@yongseok-MBP.local> References: <1548683340-26470-1-git-send-email-dekelp@mellanox.com> <1548761276-62740-1-git-send-email-dekelp@mellanox.com> In-Reply-To: <1548761276-62740-1-git-send-email-dekelp@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR02CA0011.namprd02.prod.outlook.com (2603:10b6:a02:ee::24) To DB3PR0502MB3980.eurprd05.prod.outlook.com (2603:10a6:8:10::27) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [59.1.177.86] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB4092; 6:zeL7VWTDOLZkeXm09Jd7ZWMgUNeWEge/phuf5kfhie+sprDUYiZYAxMHhJq+ZqYywsoCfOirvK8mz3bB2bB8cKW9PyWNOGpN/NAvIidLO7p7Tab0FkCDfL8Awf3Ly4zt9kJ+kVKoagKPs/aQFi2GsFVn5Tl/sevCef0YGubDIwGwB0pJEnbQnfdUdGnmFZ7KbsSEw26sz6Q0SuQJzBzW1F5c/4Tn3mJhh7TZC8ZbbyTxxNjfxYKgfvn62Nk+APeeUDFFWlbnLtmm92Fecw685WEUHow0oXPV9WJGcLwDoFpumscs+dodYdBMLkGWGib5oizpl7tR3NtZpPT7VzpdqY46gjfgR8Ln8wDJvSKYVw7LQAEGNaqt/KimHV2Uoq5p/t7nEqleFpkx2NJcz/qU+lHkfbroxn7JoOGcQbyLRoNsFNZbFiyGigkW/lePOvJ02GLySEpVKLzReCiSuabzLA==; 5:T8OxV4xG4/6kQEBeML8gEJh2oY/mc8kFvylIpbg6dwCL/xiw4zM+X7h4rIiJ5Vymxhuxb1a476EsCNVVJceZiPqNpHQtvjKB1aNZTjjU1YhxiUoMFGApSrELTafFDJ8MtobnTTKZDlXcmUzXj3GgWM5DsqKFwpOLaARuksbT5MKPpoALAJlLBituQBiEp9ZratUbOtgVzV7j6wf26IYmvA==; 7:oLWT/JY3s+tBEO9c6O5U84GyDuZCcRiKjdufUMwDk7GjFJkxn1hUTpwQh733tUXOXpOjIVLkRkkc84J96QMTUzx07Hk89UwU0TQ0FUOort2q+CWZik20aACrclXDFxlwKqzNLRh83KKyEGsD1b3CIQ== x-ms-office365-filtering-correlation-id: 18b4df43-e90e-4d4c-61ca-08d686684cb4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB4092; x-ms-traffictypediagnostic: DB3PR0502MB4092: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(366004)(136003)(39860400002)(199004)(189003)(6436002)(478600001)(486006)(33656002)(9686003)(6512007)(446003)(11346002)(386003)(98436002)(7736002)(476003)(14454004)(97736004)(26005)(186003)(99286004)(71200400001)(81156014)(8676002)(68736007)(6116002)(71190400001)(305945005)(450100002)(4326008)(6862004)(106356001)(229853002)(8936002)(25786009)(105586002)(2906002)(81166006)(66066001)(6506007)(76176011)(52116002)(6486002)(3846002)(33896004)(53936002)(6246003)(86362001)(1076003)(6636002)(256004)(102836004)(54906003)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4092; H:DB3PR0502MB3980.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: DVhSr7RtsrLdly01pLxhr3YE4Cgy5jFTxrZB42BFSb8KNX+SoziLcv0kJnvPyGdK9LFo6CZrNwbq8/4TEeXO/p76NUnckUHRRjNx7HWo0iFZxD2/wDWyDIt7gZpX89AEs5JJGGuppABdD8JJZAOhRoc2o7O56qCUTyYdXCDjlhTgEW+kj8ovw1ZLS1KslxkajK/dm4Ma1neChPIDckX52ZywkQ4BZ6YloYWvhIM0MoYnu9e4Z+5Xh30XRNAhj3RtN2mIllKCi2owcrrwM9jJeoh96X8sTvUi6QVsA0N+tGpwUMemu3j4l+s68zyHkgl0Y7JIDSI6Hzv4Q6vDRkevnZXn/TtG3NSC9bPnxOC8+SlhoVlRJayYvU8Sd/PFujeAHD6GzGrfRU1Dd3fX2Z2td299b8Oe8V35LEsem5Jqw5k= Content-Type: text/plain; charset="us-ascii" Content-ID: <3B3FCF38A8644046BBE2764876695734@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18b4df43-e90e-4d4c-61ca-08d686684cb4 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 04:06:22.0699 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4092 Subject: Re: [dpdk-dev] [PATCH v2] net/mlx5: fix concurrent use of Tx offloads 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: , X-List-Received-Date: Wed, 30 Jan 2019 04:06:26 -0000 On Tue, Jan 29, 2019 at 01:27:56PM +0200, Dekel Peled wrote: > Original patch implemented the use of match_metadata offload in the > different burst functions. > The concurrent use of match_metadata and multi_segs offloads was > not handled. >=20 > This patch updates function txq_scatter_v(), to pass metadata value > from mbuf to wqe, when indicated by offload flags. >=20 > Fixes: 6bd7fbd03c62 ("net/mlx5: support metadata as flow rule criteria") > Cc: stable@dpdk.org >=20 > Signed-off-by: Dekel Peled >=20 > --- Not sure if the title represents this patch well. net/mlx5: fix concurrent use of Tx offloads How about, net/mlx5: fix Tx metadata for multi-segment packet > v2: Apply code review comments. > --- > --- > drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 11 ++++++++--- > drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 11 +++++++---- > 2 files changed, 15 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx= 5_rxtx_vec_neon.h > index 883fe1b..7353457 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > @@ -104,6 +104,8 @@ > sizeof(struct mlx5_wqe) / MLX5_WQE_DWORD_SIZE; > unsigned int n; > volatile struct mlx5_wqe *wqe =3D NULL; > + bool metadata_ol =3D > + txq->offloads & DEV_TX_OFFLOAD_MATCH_METADATA ? true : false; > =20 > assert(elts_n > pkts_n); > mlx5_tx_complete(txq); > @@ -127,6 +129,9 @@ > uint8x16_t *t_wqe; > uint8_t *dseg; > uint8x16_t ctrl; > + rte_be32_t metadata =3D (metadata_ol && > + (pkts[n]->ol_flags & PKT_TX_METADATA)) ? > + pkts[n]->tx_metadata : 0; Why pkts[n] instead of buf? And indentation. rte_be32_t metadata =3D metadata_ol && (buf->ol_flags & PKT_TX_METADATA) ? buf->tx_metadata : 0; > =20 > assert(segs_n); > max_elts =3D elts_n - (elts_head - txq->elts_tail); > @@ -164,9 +169,9 @@ > ctrl =3D vqtbl1q_u8(ctrl, ctrl_shuf_m); > vst1q_u8((void *)t_wqe, ctrl); > /* Fill ESEG in the header. */ > - vst1q_u16((void *)(t_wqe + 1), > - ((uint16x8_t) { 0, 0, cs_flags, rte_cpu_to_be_16(len), > - 0, 0, 0, 0 })); > + vst1q_u32((void *)(t_wqe + 1), ((uint32x4_t){ 0, > + cs_flags << 16 | rte_cpu_to_be_16(len), > + metadata, 0 })); Indentation. vst1q_u32((void *)(t_wqe + 1), ((uint32x4_t){ 0, cs_flags << 16 | rte_cpu_to_be_16(len), metadata, 0 })); > txq->wqe_ci =3D wqe_ci; > } > if (!n) > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5= _rxtx_vec_sse.h > index 14117c4..7b580d3 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > @@ -104,6 +104,8 @@ > sizeof(struct mlx5_wqe) / MLX5_WQE_DWORD_SIZE; > unsigned int n; > volatile struct mlx5_wqe *wqe =3D NULL; > + bool metadata_ol =3D > + txq->offloads & DEV_TX_OFFLOAD_MATCH_METADATA ? true : false; > =20 > assert(elts_n > pkts_n); > mlx5_tx_complete(txq); > @@ -125,6 +127,9 @@ > uint16_t max_wqe; > __m128i *t_wqe, *dseg; > __m128i ctrl; > + rte_be32_t metadata =3D (metadata_ol && > + (pkts[n]->ol_flags & PKT_TX_METADATA)) ? > + pkts[n]->tx_metadata : 0; rte_be32_t metadata =3D metadata_ol && (buf->ol_flags & PKT_TX_METADATA) ? buf->tx_metadata : 0; > =20 > assert(segs_n); > max_elts =3D elts_n - (elts_head - txq->elts_tail); > @@ -164,10 +169,8 @@ > ctrl =3D _mm_shuffle_epi8(ctrl, shuf_mask_ctrl); > _mm_store_si128(t_wqe, ctrl); > /* Fill ESEG in the header. */ > - _mm_store_si128(t_wqe + 1, > - _mm_set_epi16(0, 0, 0, 0, > - rte_cpu_to_be_16(len), cs_flags, > - 0, 0)); > + _mm_store_si128(t_wqe + 1, _mm_set_epi32(0, metadata, > + (rte_cpu_to_be_16(len) << 16) | cs_flags, 0)); _mm_store_si128(t_wqe + 1, _mm_set_epi32(0, metadata, (rte_cpu_to_be_16(len) << 16) | cs_flags, 0)); Thanks, Yongseok > txq->wqe_ci =3D wqe_ci; > } > if (!n) > --=20 > 1.8.3.1 >=20