Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp279690lqp; Wed, 22 May 2024 04:38:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXn1PM6BWYuteWbDkPSEplCgNwdQW5wVrDSI6+b4VpyOkk586OlamBZI1GbbmG5eCPOwv2XLkH+Pr+4b1c9swHQiSuHi9+EB1bqO9Ecig== X-Google-Smtp-Source: AGHT+IEz3QDdshz3kz9NJp40Re7rjkhzEalk3v3fz5oGhSf3tEnM3umKc5GIvfl9DEJHtk8z3Ylb X-Received: by 2002:a0c:f40f:0:b0:6ab:764d:b69c with SMTP id 6a1803df08f44-6ab7c8214fcmr35496526d6.0.1716377895507; Wed, 22 May 2024 04:38:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716377895; cv=pass; d=google.com; s=arc-20160816; b=SACCv9gzCV2Wz04boPQxX5ogq5GJb98aYkPzCgLpttW1B1PXT7NITpE6CsK9zQm/Aa dAt1lS/qXZ8bAAOlrcEdSrQ2f+f+FIiz4z8w2cG8+OQ0kIYgiySEmMmtnBp/JyUjboHP NoaPHsJ/ZVa87C3GakKpz/5+pgRK7bqUhqEfEiNfYtyljrQuxB6lhhl3bsYSziBB0LUk 5ISfoHV2GbJnQyTd9EY7T2YpQF1DTuGiGvFng7Y1/3jrQP6C5RDGLoulFuHTYED3OSi0 W7qL3p3hI2MpV266kU/TfI1jrX1ul3eVB2ZVpdYdabrWAKkTBhyFyqFrceA3cmp5lg4B Qmcg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=tLtkLaJdZcABEuKym7kQ0uGy5iDx/Mdabykmq2f/jnw=; fh=PzqQBfBSafRGnhsENiTiT8DlpHbHL+JhhG/GNihhTsY=; b=zljvCqxpplivFGr6GE1iDc00VhL3m2o4yH1vsyp7/zCfQOTA4oQkrHDXXYYFjP02N2 ZcPTWTxWI6sLsOyyAM7pzRUlif91Rlx4QS2Djx/YqZCJ5jxq5sY5MJv3Rh/JXgYUjS61 oK5oG2dMhhZiqXCMfoDoZ5GpQbMWSgMsiFCjJp23rISgiRHvwN8HFQa841jHmaKRwiIi h8BTvV32XD3YGkKr0e11kuSqs6ZT+xURhzAc6Byz/PZheInBYuhj5e/jiECorhDrLFVU 1Gayjc23epGjtdnttHymbuZ9TKdD1YFrpXWHwp05L0sh76+x99JHGYgL+iKZe1ALihZU 2TqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=W96hvT8j; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-186151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6a977b8a0afsi542676d6.378.2024.05.22.04.38.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 04:38:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=W96hvT8j; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-186151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 38FB61C2247A for ; Wed, 22 May 2024 11:38:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0627982C6B; Wed, 22 May 2024 11:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="W96hvT8j" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07E1356B72; Wed, 22 May 2024 11:38:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716377886; cv=none; b=Xy/7OeacX2bng/FDOiIGZ98gZwLGwubaDMtC2slju0neMq4YgiWCDLGSKfFN25bzh0fgauwSgLbrgvGPRHXmH71R0uhlOJ1FlLpWnXuhZjqRxmluxQQ9irfYPPpHxlFmE6vQjokksFk5v4oSeVQqVHnTXfgdbiFXVY2cHvQ1tIE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716377886; c=relaxed/simple; bh=j+W4GcZJGISa77lDIEBfrxFXmjiKU9BCqC2sLBGFabQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=n+jToij07stIaBg40NI60QgTrxjCrFF8JCT3NU78ijVQmA8UDxZvTvIqEN8KkCCIIAPp6yzGdh4mKllncAuR+/slRQ2J+vaalucOZvN7JWIZUPOw2iW1MqBmNLLgkKhkuDvybabMHnWHEJzmlq+YGCap5RWIdp2ktAnID5fT2aQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=W96hvT8j; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44MBDjON004375; Wed, 22 May 2024 11:37:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=tLtkLaJdZcABEuKym7kQ0uGy5iDx/Mdabykmq2f/jnw=; b=W96hvT8jTsH9kRl7AZDQ+nNDpUDzk3m954evYLx301G0VZel/cWErybTqmIh4ProGWGl dQGcdL8jFGKIgGUASAYCTZ7hZO0u8ozgeeRAV59Kq1alfSomqiWWljVjpw0kAsLuY+qm kx6ExyANJdff/8Rabx0tg6D00oM+ElKLWGKD6v5MpOuAcFnJfMGHHxwJnefc26HsYlEZ or43uwWG/wGmzEX6dOP4WiLERsDhwCDVAUpv40AVhfgn0LN54wb2qKpGoiKn3l/RwJj8 YmfcZrbj/fNx7mglqcfzEjUtC2AmXZIxrPlcZRRpgdu6YDXOcNad+J6xtS+nrVyNukBe cQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y9fmw022k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 May 2024 11:37:36 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 44MBbaA4009010; Wed, 22 May 2024 11:37:36 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y9fmw022f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 May 2024 11:37:36 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 44M8c9gK008090; Wed, 22 May 2024 11:37:35 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3y79c338t2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 May 2024 11:37:35 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 44MBbVUM48693692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 May 2024 11:37:33 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BC51D2004B; Wed, 22 May 2024 11:37:31 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 75D4120043; Wed, 22 May 2024 11:37:29 +0000 (GMT) Received: from [9.203.115.195] (unknown [9.203.115.195]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 22 May 2024 11:37:29 +0000 (GMT) Message-ID: <922473a0-7e74-45e8-9929-154d0590d124@linux.ibm.com> Date: Wed, 22 May 2024 17:07:28 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/5] powerpc64/bpf: jit support for unconditional byte swap To: Artem Savkov , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Naveen N. Rao" , linuxppc-dev@lists.ozlabs.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240517075650.248801-1-asavkov@redhat.com> <20240517075650.248801-3-asavkov@redhat.com> Content-Language: en-US From: Hari Bathini In-Reply-To: <20240517075650.248801-3-asavkov@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: B1XldeUENKxGYq5S-5rVvIhGUSDaHHY- X-Proofpoint-GUID: X_i3t_4zqRLlNLATCKOrtc6kfWhvOpTC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-22_05,2024-05-22_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 mlxscore=0 spamscore=0 malwarescore=0 adultscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 clxscore=1011 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405220077 On 17/05/24 1:26 pm, Artem Savkov wrote: > Add jit support for unconditional byte swap. Tested using BSWAP tests > from test_bpf module. > > Signed-off-by: Artem Savkov > --- > arch/powerpc/net/bpf_jit_comp64.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c > index 3071205782b15..97191cf091bbf 100644 > --- a/arch/powerpc/net/bpf_jit_comp64.c > +++ b/arch/powerpc/net/bpf_jit_comp64.c > @@ -699,11 +699,12 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code > */ > case BPF_ALU | BPF_END | BPF_FROM_LE: > case BPF_ALU | BPF_END | BPF_FROM_BE: > + case BPF_ALU64 | BPF_END | BPF_FROM_LE: A comment here indicating this case does unconditional swap could improve readability. Other than this minor nit, the patchset looks good to me. Also, tested the changes with test_bpf module and selftests. For the series.. Reviewed-by: Hari Bathini > #ifdef __BIG_ENDIAN__ > if (BPF_SRC(code) == BPF_FROM_BE) > goto emit_clear; > #else /* !__BIG_ENDIAN__ */ > - if (BPF_SRC(code) == BPF_FROM_LE) > + if (BPF_CLASS(code) == BPF_ALU && BPF_SRC(code) == BPF_FROM_LE) > goto emit_clear; > #endif > switch (imm) {