From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60049.outbound.protection.outlook.com [40.107.6.49]) by dpdk.org (Postfix) with ESMTP id 8A3CF1B1F4; Wed, 30 Jan 2019 08:24:31 +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=RwbaapTaUNUdKDsVgc9JLn44qQVZQznr+6xLM2sI1lc=; b=wVJJJx5dHZPiwnMBTHMJ/7ht/O1jXRMiH2VOu22q+HcMKQYimgI1KoEUBN81CoMq6X5BfaMoTkXLXFTjKX/8h7iwoMHH9u2+jdg/aznK1NFBuI1Vo62rBet4yYM+59X7/lHJvAySDv5Y7SzrMssdMHVudF0mXYmM1WvDfFMhpug= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4058.eurprd05.prod.outlook.com (52.134.68.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.20; Wed, 30 Jan 2019 07:24:29 +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 07:24:29 +0000 From: Yongseok Koh To: Dekel Peled CC: Shahaf Shuler , "dev@dpdk.org" , Ori Kam , "stable@dpdk.org" Thread-Topic: [PATCH v3] net/mlx5: fix Tx metadata for multi-segment packet Thread-Index: AQHUuGfSFytECPmgskupiVor/2LlMaXHaNqA Date: Wed, 30 Jan 2019 07:24:29 +0000 Message-ID: <1755A434-C394-4C0C-9484-37D9C116630C@mellanox.com> References: <1548761276-62740-1-git-send-email-dekelp@mellanox.com> <1548830609-29686-1-git-send-email-dekelp@mellanox.com> In-Reply-To: <1548830609-29686-1-git-send-email-dekelp@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=yskoh@mellanox.com; x-originating-ip: [59.1.177.86] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB4058; 6:n8yjkY7/Ny/wMAYf6yDE0cuG1JnkG3jInlWHdgwGS5kBUEX918r+JAZtwThs4E4cNQF3NIpEamwH/GHOhYToQ44fkVWNB8fPmO+AwT3LjRCQWXbwYInhj5q2yAni6GqdjVhnkyilq1fMYmiRtjb9XCqXZ9/SypxxFkys5/FXx6zacIV13OkPJzQ6oe9BQ2qwDl3GlGxK3DgO6qlKMOKNcva/EVlZv0lFdLkCw0fzaU0xGOdteifF5ixtgJZJM4PeM0xFHxkzuTw7Vm2py5Lmo8se7FaSNsdyRTX0T9JcUkB/To0ryzme0QMQLcZLg6fKTHifIgZS3lwk344n1KILqpPC+OoWSjVkRr5/7hCbJ2zWrYuSCn2mEYIwo+m/slvzjRnGgAWxfBuCqYYw+nBEuasC+aZuK4MbRZTZtknKjE/whBRpH3qVzJCapyIpGYizRYSqb71wrVo6qvjb7PT7CQ==; 5:2MG08ZfRZcTkLlRINyIe71rfhsEb6T/aEP/KPNDBcLViVktnrMIjsU0PRqtCW1yoBLu+4jl2z0cdtVSPulB1EAm0ncwNdxwC8jsh+XjwVEfRxNjqxajoHjsja3BXGddwYQt46DlrWkHtwvWcOIhi4NY7JTFoVjiSeNo+UIxZY5ywsx5Y+ACNFkvBwsL/jbL8zCCai33h2OBHgJ3XSB7Tog==; 7:UiquUCsUYfsS16pqwdQpPk8fobqM5D9hQKygWOUshi+0MZO1qErg201f2YxNgUNRF7MQnS4kbLOqHwKmkrGKsfxG9BUB7Ea2PEW5nYK6KPcM7UXsvNOin4MYImMvmq5ND05QYq4pwiJgcL9R4WDBMQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 84ca1edb-ce2a-4bf9-2a24-08d68683f915 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:DB3PR0502MB4058; x-ms-traffictypediagnostic: DB3PR0502MB4058: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(396003)(366004)(346002)(136003)(39860400002)(189003)(199004)(53546011)(6506007)(33656002)(2906002)(8936002)(71200400001)(82746002)(83716004)(478600001)(8676002)(81156014)(6486002)(305945005)(7736002)(81166006)(102836004)(229853002)(71190400001)(97736004)(14454004)(37006003)(6636002)(99286004)(76176011)(68736007)(26005)(86362001)(66066001)(105586002)(316002)(256004)(14444005)(36756003)(54906003)(6512007)(6862004)(6436002)(53936002)(450100002)(106356001)(186003)(3846002)(6116002)(11346002)(2616005)(446003)(476003)(6246003)(4326008)(25786009)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4058; H:DB3PR0502MB3980.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: MV8kLsWq8oNXeX5WfHDef8Aj2uEowF6r/w+aZegwFGeuwlQKdRoAKwk0krlw2E/A8rAQVCJB3jc93tSHoTdjjKzNPJuEm23Slzzp7Zm8LLPrjPHA83Dbir00biukJA67vJ6PQWNI9ZPuv1aGRLj8crcI4UljyTWLZITCQ+ySINe+P00s20fUCLzopXGypYJ7VQ4ivtPxQi8A+h2ikq+QM/+8s9qk9gwSPxPLlhehGm4LON6cHDghWx8OQxIrdA1SzxZNXMWeVwq9Gi8Rf0VONuE+KTKyLifraZK77v78QyEZu9Sjj1xRR8Zc+8+kues+37DMrcf/DdlQ2ajq/Fz+rLQRol8mnvGFQwHqTrFjPp+mx0qzZFs9wYkEL/1vUJmvIF0AUzCt40bqMyZ7NPAHy/0e0QEDFhInhdGzudUD9fk= Content-Type: text/plain; charset="us-ascii" Content-ID: <184536692A021841846EFEDC1D8E21CF@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84ca1edb-ce2a-4bf9-2a24-08d68683f915 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 07:24:29.5844 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4058 Subject: Re: [dpdk-stable] [PATCH v3] net/mlx5: fix Tx metadata for multi-segment packet X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 07:24:31 -0000 > On Jan 30, 2019, at 3:43 PM, Dekel Peled wrote: >=20 > 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 > --- Acked-by: Yongseok Koh =20 Thanks > 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(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx= 5_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; >=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 && (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,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; >=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 && (buf->ol_flags & PKT_TX_METADATA) ? > + buf->tx_metadata : 0; >=20 > 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) > --=20 > 1.8.3.1 >=20