From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DE31308F00 for ; Fri, 12 Dec 2025 06:50:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765522201; cv=none; b=iWUHHtrG0MonpRhIuy4nshYY57Xl4CKyMzPflkC5AFfVYhVPMn0Uv6CJjs05o5hp2iTxIp2nB2P49tdASKV7YoC6u0aSIabkR+NXPSAEF1yXz9FoekEP4yfQ34NJHghBB0Za6rOxfcnXaEO4HwYyWYoI+nP/QaWJS44lhEXvPeA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765522201; c=relaxed/simple; bh=DTFGwWuNKbAmdwHkTzFow5YiMCJGtQ8mcyQMBrXwz54=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jLOW2ohBMWVyZCRVQ6lzheFKMv7otaofvbua4GtHDz7DkW2+L3R/eNz6u7Z/pthszYTD3W0y5kFkZKbAYy4/kZaU4W6WoeqkW/XN1KG/pFnISHI0umxIyfUsGBV0mdxvb9wH35b5LKo9YWG701XOkcKW4n06yu5D58LCQXQrIls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=pXz9MJxw; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="pXz9MJxw" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-298145fe27eso13355095ad.1 for ; Thu, 11 Dec 2025 22:50:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1765522200; x=1766127000; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=WlnV1FiR/V7IBDigSGeFMTF57gfnchPRlGaj43u2A0o=; b=pXz9MJxwnmLhQVc5MdOkkZcnmLvp7GN4k2mXXt7//EF2GNXWWv5DaTBN00YQiK/UWZ V4UWHFbD+xdTnhER7byxgILnPtwq5MEKiqUHnhaP1EHSmt4u+Qs/x7/iJNd/xJj2xupA Gajun2crv6tkhI+bdRhcnQyAfBcEwMWbFoJuUq1TArwM5v/q0/sk9M3gJT+Yg34i2pFa xCCv4bPH59eXQ62lfYWGewxlYkSUIj3BuDMPPdl8aUDUt948qPYGKO+ZsYvljSqL9v/9 J0ZR9CD07tPKLS3A2PBQVzOFOorfLq5Ot+gzZ87x5VxaiK2RWPXXwBxyStHwxyKX9su6 A7dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765522200; x=1766127000; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WlnV1FiR/V7IBDigSGeFMTF57gfnchPRlGaj43u2A0o=; b=tOjfPDrEKuEDjm/LPCn4liKCOFwL9sLcxAzwU/pyXA3C+azNSiJlH/o+OcjmMtEL1g hzfFpvaQ1nKUMhf7Kt4mSImichQrVdKHdjzml7B1P8r483EinE9+LAKT5B1qwKP9KsaF hge9SQrxKhxwargLkuUEZulY/ZR0Msmn+6l/1Nwh7IFazTua3p6q0Ipv/AmVMw0LkG8r afXAg9J1eCiBC3YgejwkE0StMnm30OYcVMoeZYZ4wr/+4AKt4WunsueIP9b57NKRk4nz S2ZlpwH0Z+89quEMNHalXGLqzFSe6of1urDMK0U8Yn+vkzcDknthSsh2M3oP5MEqL1Vt zJvw== X-Forwarded-Encrypted: i=1; AJvYcCXNmFUf1KXDuEPm/vFJAP1u91X/egVEhVUs+z9oTKgcNu54zDFBJn/4MJmfJofEEJfozV8hegBFlJBouSk=@vger.kernel.org X-Gm-Message-State: AOJu0YyKuhcSqd77TpyZEMt19gbQ11iIUQ+IhYDUAIwa7izW4P16eqGM xXEH9Qka3vZ6rsVSGUXVawp6HsJx38KEXggqc2Ca7FkA7QnXNpyIT07yJ/9dGnVihb8= X-Gm-Gg: AY/fxX7yKdEDLTFDDb2uhP4+uq90EBfue1CVGxyxA3D/qncmi0zsggupJtERBSObszy 3HHmXWTBf2u6QnIz/7nd+CXIu0T5e76xIFMfmbfNh0OCb14Iq/fUQ8L5ogDe8N41/neVTuJENn2 dpwcYbkYwPE4b+SPkL2K05Wf/VegKi/j+gjMXOwQShi1e7/xYfpW8n+J1c75M5Vz+JsJXv4XGiF DpMC4e5Ds0MWF/57ptyQkwK6KmzafkJs5WBal7tu6cfTQpGdgPnNrD9sczLm8p8ugHFYtpUYkAg BzRVT27CennMXUpzFDhjunUxeFS1Wg6CUgWUhqjes3Rn2rth7x06ZNCoy38dmAgfQGXPAaYfVYG Y9Ayng43DbVT45lWWyJ0b7R7+innk/D43/hth5qhL9LWfvr6c6uHRu0lEDgQ55YWUS8xCmHBd1E ycAB86PhJESuI+jqLHhm4= X-Google-Smtp-Source: AGHT+IFGlG7Khs7l0RX0nbij+9e0KUsOdKjB25WRf4l6rO1/TPgRflxwJpbDrMlMSorhExmwkad+NQ== X-Received: by 2002:a17:902:dac3:b0:295:888e:d204 with SMTP id d9443c01a7336-29f23d1edcemr14254525ad.57.1765522199698; Thu, 11 Dec 2025 22:49:59 -0800 (PST) Received: from ziepe.ca (p99249-ipoefx.ipoe.ocn.ne.jp. [153.246.134.248]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29eea01723bsm44047885ad.62.2025.12.11.22.49.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Dec 2025 22:49:58 -0800 (PST) Received: from jgg by jggl with local (Exim 4.95) (envelope-from ) id 1vTwyS-00027A-LS; Fri, 12 Dec 2025 02:49:56 -0400 Date: Fri, 12 Dec 2025 02:49:56 -0400 From: Jason Gunthorpe To: Thorsten Blum Cc: Abhijit Gangurde , Allen Hubbe , Leon Romanovsky , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] RDMA/ionic: Replace cpu_to_be64 + le64_to_cpu with swab64 Message-ID: References: <20251210131428.569187-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251210131428.569187-2-thorsten.blum@linux.dev> On Wed, Dec 10, 2025 at 02:14:29PM +0100, Thorsten Blum wrote: > Replace cpu_to_be64(le64_to_cpu()) with swab64() to simplify > ionic_prep_reg(). No functional changes. > > Signed-off-by: Thorsten Blum > --- > drivers/infiniband/hw/ionic/ionic_datapath.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/hw/ionic/ionic_datapath.c b/drivers/infiniband/hw/ionic/ionic_datapath.c > index aa2944887f23..1a1cf82d1745 100644 > --- a/drivers/infiniband/hw/ionic/ionic_datapath.c > +++ b/drivers/infiniband/hw/ionic/ionic_datapath.c > @@ -1105,7 +1105,7 @@ static int ionic_prep_reg(struct ionic_qp *qp, > wqe->reg_mr.length = cpu_to_be64(mr->ibmr.length); > wqe->reg_mr.offset = ionic_pgtbl_off(&mr->buf, mr->ibmr.iova); > dma_addr = ionic_pgtbl_dma(&mr->buf, mr->ibmr.iova); > - wqe->reg_mr.dma_addr = cpu_to_be64(le64_to_cpu(dma_addr)); > + wqe->reg_mr.dma_addr = swab64(dma_addr); This doesn't make any sense to me. The original code looks wrong and would fail sparse, switching to swab just highlights how nonsense it is, there is no way that is right on BE and LE. Pensando guys what is the right thing to do here?? Jason