From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150055.outbound.protection.outlook.com [40.107.15.55]) by dpdk.org (Postfix) with ESMTP id 7E4AA1B5C6; Sun, 10 Feb 2019 16:10:27 +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=8ENJEPLXtRq2SE7NisicpyHhfBftKVISMOwmE0525hA=; b=CA4312WSMD67OcSUodMSFg/YMWiFT1qveNQK3g3dOQ/d5bhxlSWLlsyzfjtHHusnnUxY4iHQ/lpPvPZLeGWw5FjfDTBEg9Md5iHvrX5xmAWiNMzh8+ziCkBTjVeCbNB6Za3VMf2QHUP1SYho21ZaGbKtH3bEqQkLaZz5Kcu647w= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.47.29) by AM0PR0502MB3953.eurprd05.prod.outlook.com (52.133.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.21; Sun, 10 Feb 2019 15:10:25 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::386e:f86:50bf:31be]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::386e:f86:50bf:31be%5]) with mapi id 15.20.1601.023; Sun, 10 Feb 2019 15:10:25 +0000 From: Shahaf Shuler To: Yongseok Koh , Dekel Peled CC: "dev@dpdk.org" , Ori Kam , "stable@dpdk.org" Thread-Topic: [PATCH v3] net/mlx5: fix Tx metadata for multi-segment packet Thread-Index: AQHUuGzX/42LRmDyT0aC7OHgVNhdYaXZNIgQ Date: Sun, 10 Feb 2019 15:10:25 +0000 Message-ID: References: <1548761276-62740-1-git-send-email-dekelp@mellanox.com> <1548830609-29686-1-git-send-email-dekelp@mellanox.com> <1755A434-C394-4C0C-9484-37D9C116630C@mellanox.com> In-Reply-To: <1755A434-C394-4C0C-9484-37D9C116630C@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-microsoft-exchange-diagnostics: 1; AM0PR0502MB3953; 6:5y0RKTsxbgDMD/GbBMEGeBWF/bQSWq2SmyDFUQePhfPAIPd8DDFrXzbhTlz8a0s7mTqcOt3Cj8I0jj8p/9UMF1SexC+PTiUMx4cLfTG3aLAl/U37fGRigBwNkwKc/VnOC++8f+8JwKQAc0nFbdX+c2iVCTY/f1iIK6tnMeEBvNQZNwXfTJhJgCoDsD134Lvojk9z56Q1D9QcsFlB8rS+XK8eEQQw8YWKABAJFEQHvFpmKv7xHfgMPhWVkiA2XcMd1JpPBvW2ljwpsEGIUCmpHNuta0a87e9ODJ/k32G/AKxi7nODkTnmNIaxtdf9uq8E0+Kb/ZYlti/J7E0+yio6GlNeXBfx+WQH7ik+jTiURsT3k28+KDv1U4BYeeDR6ldpYjPb8k4hNxzuFQteWBwVMeno4Op2hsgj4qg4N0iAdBeiwd+cTJcVWDMTW7Ub+wmh9KuVhDMErIicgAOt1Oq0kA==; 5:SqsmHvqOpbReKfT6fCisHZ1r6Ajv9aRZomGV7FjERyxyAwqWVI6YtNzEfB+4Sft/VvfHU9CWw+5+qKeK6IdJFN8TQCX5wqGaKmj2+STlzQ1hiyavWkuQy0pxHbwPjNsAR5JkPcEjHyoJO7zocfKulor1XTPj5l6OMWU9YN6PzjhHZpVeLqd9skjQFACP7gBVXghBLOpiwLPzdmOFzgCa3w==; 7:pGLQMC0ojutc6xdCDG+JbdObJ34aqeOYT3FfhNbiDsfb9UrhHWQNbS5eUFSpcVKMO1p705gfTqtEyfenNacblQnt/Ytft6aL4mJ+AmsSMVqTogR6Z+HhW+vV6h75LOJ1tCqnJVzZbc1XT+ohgE+6KQ== x-ms-office365-filtering-correlation-id: 72eaba38-8948-4358-81ba-08d68f69e2a1 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:AM0PR0502MB3953; x-ms-traffictypediagnostic: AM0PR0502MB3953: x-microsoft-antispam-prvs: x-forefront-prvs: 09443CAA7E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(376002)(136003)(366004)(39860400002)(189003)(199004)(450100002)(14444005)(256004)(4326008)(71190400001)(71200400001)(11346002)(476003)(486006)(446003)(6246003)(106356001)(25786009)(97736004)(53546011)(102836004)(6506007)(186003)(26005)(2906002)(105586002)(33656002)(74316002)(3846002)(6116002)(7736002)(53936002)(229853002)(305945005)(9686003)(316002)(55016002)(76176011)(14454004)(478600001)(6436002)(99286004)(7696005)(54906003)(68736007)(6636002)(81156014)(81166006)(110136005)(8936002)(8676002)(66066001)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3953; H:AM0PR0502MB3795.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: SC9UnbpcVuRUUlNKZ7wA4HOgu4G18jVX5T9D3ONkt/FVIqhfDz26QINX78tsrf424Q9sxWq7j4nNkPMTFaiRv4KuJGGkSVUqy+JuP5sSF70wePhghB/n8WRdJimBUuZgJ2b3elZTvbl4Xs2EmED80dhKTsv/FncFyycWfOaphl83ZwDUlwfpy2bGFHeR7R+xu+jAq3ADepFzuPM3HmTCRi24Mawj04kuq+pUXOeM+qLmdMEg3QQZXI8rqXvwOKLdIu0m/s8FiAUR93vbxYBK9UbCbk9uQCFxgwRZNTVkKbMh6fiB/cDH+4C+/CDPbliAo7pidpGnO/ZByhRewbcPY6SQrCRF1c2Cki7ZYhqXOpvx60l9jWbW/23twTR6j4VIZgnJYHiN68J8XjjQuUSqov4gOSsyuH47l+gMuLT+A1c= 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: 72eaba38-8948-4358-81ba-08d68f69e2a1 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2019 15:10:25.4446 (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: AM0PR0502MB3953 Subject: Re: [dpdk-dev] [PATCH v3] net/mlx5: fix Tx metadata for multi-segment packet 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: Sun, 10 Feb 2019 15:10:27 -0000 Wednesday, January 30, 2019 9:24 AM, Yongseok Koh: > Subject: Re: [PATCH v3] net/mlx5: fix Tx metadata for multi-segment packe= t >=20 > > On Jan 30, 2019, at 3:43 PM, 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. > > > > This patch updates function txq_scatter_v(), to pass metadata value > > from mbuf to wqe, when indicated by offload flags. > > > > Fixes: 6bd7fbd03c62 ("net/mlx5: support metadata as flow rule > > criteria") > > Cc: stable@dpdk.org > > > > Signed-off-by: Dekel Peled Applied to next-net-mlx, thanks . > > > > --- >=20 > Acked-by: Yongseok Koh >=20 > Thanks >=20 > > v3: Update title, modify indentation. > > v2: Apply code review comments. > > --- > > --- > > drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 12 +++++++++--- > > drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 11 ++++++++--- > > 2 files changed, 17 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > > b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > > index 883fe1b..38e915c 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; > > > > 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 && (buf->ol_flags & > PKT_TX_METADATA) ? > > + buf->tx_metadata : 0; > > > > assert(segs_n); > > max_elts =3D elts_n - (elts_head - txq->elts_tail); @@ -164,9 > +169,10 > > @@ > > 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 })); > > 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..fb384ef 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; > > > > 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 && (buf->ol_flags & > PKT_TX_METADATA) ? > > + buf->tx_metadata : 0; > > > > assert(segs_n); > > max_elts =3D elts_n - (elts_head - txq->elts_tail); @@ -165,9 > +170,9 > > @@ > > _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_set_epi32(0, metadata, > > + (rte_cpu_to_be_16(len) << 16) | > > + cs_flags, 0)); > > txq->wqe_ci =3D wqe_ci; > > } > > if (!n) > > -- > > 1.8.3.1 > >