From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D350246148; Thu, 30 Jan 2025 09:21:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9EA8440275; Thu, 30 Jan 2025 09:21:53 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 1778540156 for ; Thu, 30 Jan 2025 09:21:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738225311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=InQj762Unb3GbDQtplcdsjoB14UD8vqaHlmlZ2FBrC4=; b=eAC4yieyBTsWnFPleaZ/HG+D1VrtdyqPS1ad6l3B8GYNzxkvUn5/yybe81vJlr2NJRF/sH I45bCpWCbUy87ToKUv9p8LqA27RIJJd106Nl4o2dDyAiqc6bU/X9S2kxRALr27EiaXD+QO 5ScebWhrzleJSr/uD3YXb+c0DMUYz/M= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-brODCRdRPhuWiJ0BSEuD-w-1; Thu, 30 Jan 2025 03:21:49 -0500 X-MC-Unique: brODCRdRPhuWiJ0BSEuD-w-1 X-Mimecast-MFC-AGG-ID: brODCRdRPhuWiJ0BSEuD-w Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-30239c0fbdfso2445271fa.1 for ; Thu, 30 Jan 2025 00:21:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738225308; x=1738830108; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=InQj762Unb3GbDQtplcdsjoB14UD8vqaHlmlZ2FBrC4=; b=Z90Lnv0qgW692yB0xFfV0wvYGqJSZuX2h5dxKmxwLLKqq7kUtOn6z9NIX9IfsWV0Cp RZDq/MZQ3MznzZwBYDpmja/0rCS6PMoiRduDE8Rv4uNUDMxnYdTvZOAXZbxDGC0wSUs9 T7jtNGdmQ/Hesic1OOBobPDBuyhBN+lasOes40AB6cu+fnDKxrLj/z3QAd77KvD1ajH/ axOjDr2tOzy/7j/3ALXuGLTZPVE4BX8s6PSEucpOrf9iOE4ELH7xlCwNxxjDqPTb4/de axP4sq1WsfKvDQBy9mIyPaSfnAwxsHBzfzyFrcSMdhA+T+E1x7MKHI1LWrlR5FNJl7k6 nreg== X-Gm-Message-State: AOJu0YxGxf1GaiRtMT7OgxahRborA9BzGtML7pHo8G3LCWa/hG59CaU6 uVgpl61Ue405rum8Le91C8fvIcsQm+OUi4DfdHOzrGOvZOzAOgGpNXHP/1m9nOTbFnz/laJXFrp pxlsSHh49V+05Jzm/yBxA69VJRUeWt8KozRy50dy74ZI+yHXDNqx8PLmGO6Ys3zm4k+rBy3rHvY Txb5LSh16R7jdxac0= X-Gm-Gg: ASbGnct1Bh7XKddKuHytWF8BQ3KprMLiY+Gq3CfGx2i5xNciePAQsXuYsNJKUOe2M7Q LzBj7OWwjRNoAD3OE7K45dExbU6yUljCZ6SBnruMx1K04TN45hSUt1oNgt2aYD2zs X-Received: by 2002:a2e:bd81:0:b0:302:4115:191 with SMTP id 38308e7fff4ca-307968eed35mr24003401fa.20.1738225308291; Thu, 30 Jan 2025 00:21:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEyJEo2KyS84abFEOVU2KLAZ66i69sr1hW7fFGEmM79wY+CoqbE6plE94V6TxjkC/RXxH+udNDqT0I0fFaKsJI= X-Received: by 2002:a2e:bd81:0:b0:302:4115:191 with SMTP id 38308e7fff4ca-307968eed35mr24003271fa.20.1738225307923; Thu, 30 Jan 2025 00:21:47 -0800 (PST) MIME-Version: 1.0 References: <20250129121856.1040065-2-shaiq.wani@intel.com> <20250130082445.1112043-1-shaiq.wani@intel.com> <20250130082445.1112043-2-shaiq.wani@intel.com> In-Reply-To: <20250130082445.1112043-2-shaiq.wani@intel.com> From: David Marchand Date: Thu, 30 Jan 2025 09:21:35 +0100 X-Gm-Features: AWEUYZl0HNV-wTU_tIIO-a3kou284KNTmfz_Tb-HzuieJzuniIKtsjJf9-0ZZOE Message-ID: Subject: Re: [PATCH v3 1/2] common/idpf: enable AVX2 for single queue Rx To: Shaiq Wani Cc: dev@dpdk.org, bruce.richardson@intel.com, aman.deep.singh@intel.com, Andre Muezerie X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: rNwchaaN35xw4swxDUMHT9MwNTpT7f82RlnLna4ZRLk_1738225308 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Jan 30, 2025 at 9:12=E2=80=AFAM Shaiq Wani w= rote: > > In case some CPUs don't support AVX512. Enable AVX2 for them to > get better per-core performance. > > The single queue model processes all packets in order while > the split queue model separates packet data and metadata into > different queues for parallel processing and improved performance. > > Signed-off-by: Shaiq Wani > --- > drivers/common/idpf/idpf_common_device.h | 1 + > drivers/common/idpf/idpf_common_rxtx.h | 4 + > drivers/common/idpf/idpf_common_rxtx_avx2.c | 485 ++++++++++++++++++++ > drivers/common/idpf/meson.build | 7 + > drivers/common/idpf/version.map | 1 + > drivers/net/intel/idpf/idpf_rxtx.c | 11 + > 6 files changed, 509 insertions(+) > create mode 100644 drivers/common/idpf/idpf_common_rxtx_avx2.c > > diff --git a/drivers/common/idpf/idpf_common_device.h b/drivers/common/id= pf/idpf_common_device.h > index bfa927a5ff..734be1c88a 100644 > --- a/drivers/common/idpf/idpf_common_device.h > +++ b/drivers/common/idpf/idpf_common_device.h > @@ -123,6 +123,7 @@ struct idpf_vport { > > bool rx_vec_allowed; > bool tx_vec_allowed; > + bool rx_use_avx2; > bool rx_use_avx512; > bool tx_use_avx512; > > diff --git a/drivers/common/idpf/idpf_common_rxtx.h b/drivers/common/idpf= /idpf_common_rxtx.h > index eeeeed12e2..f50cf5ef46 100644 > --- a/drivers/common/idpf/idpf_common_rxtx.h > +++ b/drivers/common/idpf/idpf_common_rxtx.h > @@ -302,5 +302,9 @@ uint16_t idpf_dp_splitq_xmit_pkts_avx512(void *tx_que= ue, struct rte_mbuf **tx_pk > __rte_internal > uint16_t idpf_dp_singleq_recv_scatter_pkts(void *rx_queue, struct rte_mb= uf **rx_pkts, > uint16_t nb_pkts); > +__rte_internal > +uint16_t idpf_dp_singleq_recv_pkts_avx2(void *rx_queue, > + struct rte_mbuf **rx_pkts, > + uint16_t nb_pkts); > > #endif /* _IDPF_COMMON_RXTX_H_ */ > diff --git a/drivers/common/idpf/idpf_common_rxtx_avx2.c b/drivers/common= /idpf/idpf_common_rxtx_avx2.c > new file mode 100644 > index 0000000000..de76f01ff8 > --- /dev/null > +++ b/drivers/common/idpf/idpf_common_rxtx_avx2.c > @@ -0,0 +1,485 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2023 Intel Corporation > + */ > + > +#include > + > +#include "idpf_common_rxtx.h" > +#include "idpf_common_device.h" > + > +#ifndef __INTEL_COMPILER > +#pragma GCC diagnostic ignored "-Wcast-qual" > +#endif Please, use newly introduced macros and stop ignoring such warnings. For example, look at: https://git.dpdk.org/dpdk/diff/drivers/net/i40e/i40e_rxtx_vec_avx2.c?id=3D4= 3fd3624fdfe3a33904a9b64d94306dd3d4f2c13 --=20 David Marchand