From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10088.outbound.protection.outlook.com [40.107.1.88]) by dpdk.org (Postfix) with ESMTP id 40AF17CB0; Tue, 29 Jan 2019 08:54:58 +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=nGiR5jsK09pn41CGsjrAdzGgjCdR0s/Cxd9mLdgv3+4=; b=ExahjlcjjyWO5LQIjL3iyk6Tj4Yrg6dDrjIKUPQ5lhvwFcfU7Xmt2jRdN6Sg5mK07lcJBzQYlIVrEsRrgOvu6J7CgzdbTrYuMi8wU4p9R6mMwqNUSRF1Lu8grF9i3jhsWwRC0z5DwX8by1o/458PpVtthEDG4TBRKYSm+maySa8= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3961.eurprd05.prod.outlook.com (52.134.70.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.18; Tue, 29 Jan 2019 07:54:56 +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.023; Tue, 29 Jan 2019 07:54:56 +0000 From: Yongseok Koh To: Dekel Peled CC: Shahaf Shuler , dev , Ori Kam , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix concurrent use of Tx offloads Thread-Index: AQHUtxEBisUZOlJHDUKCgsjVSOgCOaXF4bUA Date: Tue, 29 Jan 2019 07:54:56 +0000 Message-ID: References: <1548683340-26470-1-git-send-email-dekelp@mellanox.com> In-Reply-To: <1548683340-26470-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.202.79] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB3961; 6:ger+0ngmQxKyUIFvDeyLlWPzNMc5qdFWuU4wPGx34sEIq/oaEi5eXeyFAKIouylx8QFvjYeTCKsaSrJEJTleEVyTRZTet/81BfRDZ5DPsWSuocTv1WYoV+PcPPZ3Ne6m81qHSV3RItWomxlQ0GDp17wNm2xJYJbkJXpGHvn+fIQlV8UtqGlfo4GQmBGe5giSPebTtaFU0OY7iJli2IKYxq6MvXaZLLPDWjdN4QCNaq5DEdu9cIKdR4nbqFn0JVjJ8+xCotKLYSiDAt3CwGevccD2FaBnORtyG+/v+/CyiJZMlrpKfsvVz+utraQSx8P9pJ0wsGPCvpvM35ntTmCoJeqvqF1tkKPWw6rTwufpKKjWDmsXHCQc8q98YUkMOlm/NYB7ZsvI+QC2BUil1q4eEmNpbuIS0sZYkuQTvWawzQ2lSWodSlxuT2GxLjKzEnzGzKqS+lTBP4d3HjAqwx+uHg==; 5:0yaiVQnezY60AQCtefZ+CvL3oN38nKORAmbxFJDcEedQ2huRLlg+SGIQu16yY+H19a/284dkIzQ9W7LLgiQ/0jffzN4u6dXwP4GVk2iJSQ3OxI7js3a+uO3S3ALzUf8ZDtI28fNOQcWpR4GVlsOvV+l8heSU7Gr2fh3ODvjNvddTpQBgE6+ZAGoVYrNDE3HiMxeQaQY0MBzXF8hMWJZ1OA==; 7:4ivZyr4jzDCxjcYmaOioiP2cTaUHRhO+z2Xy3GavMuySx91jJaTXBPR7CJCCN+hwp4cfQzL8sAyZt9oUOJnRSUUxBdsUJVE21H6MysFbRjthxlRH5YYuRQzPSCqmWgzN6nS2+CcBP5uQFYX112mZqg== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: a97554bd-288c-4280-3cd2-08d685bf0f6f 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:DB3PR0502MB3961; x-ms-traffictypediagnostic: DB3PR0502MB3961: x-microsoft-antispam-prvs: x-forefront-prvs: 093290AD39 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(396003)(136003)(346002)(366004)(39860400002)(189003)(199004)(81166006)(81156014)(105586002)(3846002)(102836004)(8676002)(53936002)(2906002)(86362001)(2616005)(476003)(11346002)(7736002)(53546011)(4326008)(305945005)(36756003)(6506007)(25786009)(33656002)(486006)(6862004)(82746002)(6116002)(99286004)(6486002)(26005)(186003)(478600001)(229853002)(6636002)(66066001)(8936002)(316002)(71200400001)(68736007)(54906003)(450100002)(6512007)(76176011)(106356001)(6246003)(71190400001)(97736004)(6436002)(83716004)(256004)(14454004)(37006003)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3961; 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: H1HZGNkZKmBK+fVlEINP4Pun6ZvSPVmimHwk+KM5jyhyRfYjqgYvSYcKsGIYErDefBMLnnLvWaxG9ym0Z3a2w89g2atIhxe16OmfXvB+euTc5MZjf9JHCmUrwiJd5SJI8KNJ12wUi7l83qNWySShPEIZAP1Y+0rpCLXkB/1zZK3gtg7AU/p/Q4K+Dz5QIqQU06bMTSj8e6q0tV/gZcgbuGfRvvLYC7Lamq6oQrH8d5q8QWCPIQCRhy6ezf9p0qHHMwWnAlXJxP3GwhRb44gZvhb3StoPU0focnvheUAR8c0p/ZaWRw6HCYW8lQftgA+qsl3KKh4bYB7dZcJ10o/ooMekBvu84AY90rjThgGOD1YjsRnO2J6EBTgcxOkYYL/fBXHEkvOBLGskWdUsJzeUcnllP4vamiQtigJWQDbAyXc= Content-Type: text/plain; charset="us-ascii" Content-ID: <1AD70F31CD67674E8725BDA039421873@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: a97554bd-288c-4280-3cd2-08d685bf0f6f X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jan 2019 07:54:56.2789 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3961 Subject: Re: [dpdk-dev] [PATCH] 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: Tue, 29 Jan 2019 07:54:58 -0000 > On Jan 28, 2019, at 10:49 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 > --- > drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 10 +++++++--- > drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 10 ++++++---- > 2 files changed, 13 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..cfcb923 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > @@ -104,6 +104,7 @@ > sizeof(struct mlx5_wqe) / MLX5_WQE_DWORD_SIZE; > unsigned int n; > volatile struct mlx5_wqe *wqe =3D NULL; > + uint32_t metadata_ol =3D txq->offloads & DEV_TX_OFFLOAD_MATCH_METADATA; Shouldn't it be uint64_t? Or, you just can inline it as there's only one occurrence below. >=20 > assert(elts_n > pkts_n); > mlx5_tx_complete(txq); > @@ -127,6 +128,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; Please fix indentation. There're a few more below. Please fix all. Thanks, Yongseok >=20 > assert(segs_n); > max_elts =3D elts_n - (elts_head - txq->elts_tail); > @@ -164,9 +168,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 })); > 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..dbc7d6f 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > @@ -104,6 +104,7 @@ > sizeof(struct mlx5_wqe) / MLX5_WQE_DWORD_SIZE; > unsigned int n; > volatile struct mlx5_wqe *wqe =3D NULL; > + uint32_t metadata_ol =3D txq->offloads & DEV_TX_OFFLOAD_MATCH_METADATA; >=20 > assert(elts_n > pkts_n); > mlx5_tx_complete(txq); > @@ -125,6 +126,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; >=20 > assert(segs_n); > max_elts =3D elts_n - (elts_head - txq->elts_tail); > @@ -164,10 +168,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)); > txq->wqe_ci =3D wqe_ci; > } > if (!n) > --=20 > 1.8.3.1 >=20