From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 EA11C36405E for ; Fri, 13 Feb 2026 16:14:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770999257; cv=none; b=IXpPyYu16ik6IWBskijq28DQPJBydfIc3lXm5qY2sBJVbuvoLef2kTlitnz66e/YLZRpKWM4K1WNOw9VWZj1lqzlgbo9JrMXKBLvYv1TlQtFlvO6qCAzpeZ1Od9P938YkHEEshgA2+SgoHBAUJRMcmKbNGmw1Ytr0m9aToTXJhU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770999257; c=relaxed/simple; bh=gYOA7Jd2sD+F4AI6OhnO4bQgKhYCRfntgN+Nceji7DA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qg50kl4AKfZjUzpsLoJCRWj39ujmTEDBH4nPH9Ohy95HsekFscsf+rq2bKWQ8soSqhNYBiuGt92H5fUzf1D0IrD8+qoGCgJ2GjuipMoeuM0GKO4FgRlZqXaM2064Oridg0ogsj2pd4rbs50Fnltp2eYD6nKBqpqk3fddOzk7Sx4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=dghY7PcD; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="dghY7PcD" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-8cb4acdacb2so25240785a.3 for ; Fri, 13 Feb 2026 08:14:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1770999254; x=1771604054; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jgbJ2hZD9atfYQt5BUJcJLNlHTxXKvF+WEu0/IJVXc4=; b=dghY7PcDu4mhNNln83RJ8sCUeLOZeMXaL++PIS2JAbS1FgOv85lf4FnJrwG/FAH8bT 5gGKG9xcs1sM5hiClFHDRU+/zgkclZxm7gcWdFrFftlgMIzMBtifE4fYU6NoHgkudjcJ HCPP+QRIcvxPRL0BNJwCslhbbhSjShnD1uDbnKIgIrKil5wb5Uj5njK3St9aBP1mTyWd TUcJAOe+rX7JOjvU/2Lk9wR7wa+xRr7wmPHXlzub/zntQ+te58tShzWIKyf/6UatLGu0 Tf7jSnNxrdhQhXJEWI0te3JVvGt/bZaWGoPrsm4uzy8G5Chg0UtJkQxgmLPceZzoacf/ 2DRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770999254; x=1771604054; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jgbJ2hZD9atfYQt5BUJcJLNlHTxXKvF+WEu0/IJVXc4=; b=g6/b8XMSV8BNOtltGIG7N5k6QdBsR8NJProU68FJyVTukAWiP2Pxq4EsIJIY7bK3e9 ofmu9doKgbgK1Oon9R5bM2MyRpZVEYoeUfb3NEg0bOZlhb+HmuFP64VPJD2DgIJIegTi n+BXOhyPv44lucNuNNiYiFkbKhRD+D9LD4nCqdLHFHMa/8TRt4msZ7MsP3wKCFtxERfh N/VlniIKfuy94EwlkAQIKiGoeoxAvVGcnHQ75XCEnNp4DR40Ofn2yPa5iJMYga+uf5FX ktAjGmzC+2gBQ8+EjiR4HSv/S08r0zSZ4b3M0EBejzUjHyuBKKRwUQkObsE6t/YdSNia bUoQ== X-Forwarded-Encrypted: i=1; AJvYcCXnjLt6MEi3NkQE9g+kStX9CJ5IKHzlp8i1D8s6PAnvLmYM/5vkUS+Q9OTXeCOjYmVM3KzHGkp7Y4IfNzE=@vger.kernel.org X-Gm-Message-State: AOJu0YzK7xO4CGlaGCxGygU7EX+XDhSbfVRP/cWsekxHj5neK0sHjl80 glfUNCdclgN9dSmAy/JfrE+ItagL6IaJ0JdE3AH6FVxDJz5gPZXkdmgd/lFjGg5SVyA= X-Gm-Gg: AZuq6aL/6vnphostlXDJYoV+dq7I4Jw2MNGMLau6uBJMCjmsa0723dfgARfiOGgOofL U14oUzmzbarj5V49l0Ytpma1/JQbAGFPiHECHoS+oG2IXtQzT/JtrpHUKt+hptNN/WDA221twr6 BCduJ4Y6Y37m6C1ukOt0wuGCdSIQyu8bAzHskO6qqHg0XrHVg4ZDfaNnvoKtOAfFVfHTI/3nbkY IZOOIBEaSKI1WwWEHFZ6xP2znVS4d/8VPXGEeUtBeQ9LlICDSiFKTOIWkr6VZMu5u4qQgEva8sk bhsVlXmNzNcEcipfmThnW0eRa4WAVrdEf1pGWx27y/uplVrEY2eHZQ7oPF29X0PIEW3/m3mM9lw OpPSlFJlgUWicArCTKPbR3fc7f7bJcEY4iQAUtQaiq58ZcQZ/bgBBJ5Nhzspg8LX8vhElhmsQg9 6oSiDf4rmRypsyZ3Jl+RZpFNIz7W48saWzdRBrcUeRD58bKfyWOqcDCa9vG0KITZdwoIx+Ux088 crCrsDvVQEPpoQ= X-Received: by 2002:a05:620a:3188:b0:8c6:af59:5e2c with SMTP id af79cd13be357-8cb4bf6a3cbmr8015185a.18.1770999253839; Fri, 13 Feb 2026 08:14:13 -0800 (PST) Received: from gourry-fedora-PF4VCD3F.lan (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cb39da3dc6sm401861185a.51.2026.02.13.08.14.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Feb 2026 08:14:13 -0800 (PST) From: Gregory Price To: Alejandro Lucero Cc: linux-cxl@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 22/22] sfc: support pio mapping based on cxl Date: Fri, 13 Feb 2026 11:14:07 -0500 Message-ID: <20260213161410.2945294-3-gourry@gourry.net> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260201155438.2664640-23-alejandro.lucero-palau@amd.com> References: <20260201155438.2664640-1-alejandro.lucero-palau@amd.com> <20260201155438.2664640-23-alejandro.lucero-palau@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable This review was generated by kreview-0811365ff2. =0D =0D This is not an automated email, the reviewer though this report=0D looked valid enough to consider discussion.=0D =0D ----=0D I am completely unfamiliar with this code, but the question it poses=0D at least seems reasonable.=0D =0D ~Gregory=0D ----=0D =0D On Sat, Feb 01, 2026, Alejandro Lucero wrote:=0D =0D > diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/e= f10.c=0D > index fcec81f862ec..2bb6d3136c7c 100644=0D > --- a/drivers/net/ethernet/sfc/ef10.c=0D > +++ b/drivers/net/ethernet/sfc/ef10.c=0D =0D [ ... ]=0D =0D > @@ -1263,8 +1281,25 @@ static int efx_ef10_dimension_resources(struct efx= _nic *efx)=0D > iounmap(efx->membase);=0D > efx->membase =3D membase;=0D >=0D > - /* Set up the WC mapping if needed */=0D > - if (wc_mem_map_size) {=0D > + if (!wc_mem_map_size)=0D > + goto skip_pio;=0D > +=0D > + /* Set up the WC mapping */=0D > +=0D > +#ifdef CONFIG_SFC_CXL=0D > + probe_data =3D container_of(efx, struct efx_probe_data, efx);=0D > + if ((nic_data->datapath_caps3 &=0D > + (1 << MC_CMD_GET_CAPABILITIES_V7_OUT_CXL_CONFIG_ENABLE_LBN)) &&=0D > + probe_data->cxl_pio_initialised) {=0D > + /* Using PIO through CXL mapping? */=0D > + nic_data->pio_write_base =3D probe_data->cxl->ctpio_cxl +=0D > + (pio_write_vi_base * efx->vi_stride +=0D > + ER_DZ_TX_PIOBUF - uc_mem_map_size);=0D > + probe_data->cxl_pio_in_use =3D true;=0D > + } else=0D > +#endif=0D > + {=0D > + /* Using legacy PIO BAR mapping */=0D > nic_data->wc_membase =3D ioremap_wc(efx->membase_phys +=0D > uc_mem_map_size,=0D > wc_mem_map_size);=0D > @@ -1279,12 +1314,13 @@ static int efx_ef10_dimension_resources(struct ef= x_nic *efx)=0D > nic_data->wc_membase +=0D > (pio_write_vi_base * efx->vi_stride + ER_DZ_TX_PIOBUF -=0D > uc_mem_map_size);=0D > -=0D > - rc =3D efx_ef10_link_piobufs(efx);=0D > - if (rc)=0D > - efx_ef10_free_piobufs(efx);=0D > }=0D =0D The CXL path sets nic_data->pio_write_base but does not set=0D nic_data->pio_write_vi_base, while the legacy path does:=0D =0D nic_data->pio_write_vi_base =3D pio_write_vi_base;=0D =0D Since nic_data is kzalloc'd, pio_write_vi_base stays at 0 in the CXL=0D path. efx_ef10_link_piobufs() then uses nic_data->pio_write_vi_base=0D to issue MC_CMD_LINK_PIOBUF commands:=0D =0D MCDI_SET_DWORD(inbuf, LINK_PIOBUF_IN_TXQ_INSTANCE,=0D nic_data->pio_write_vi_base + index);=0D =0D and also for the special-case check:=0D =0D if (tx_queue->queue =3D=3D nic_data->pio_write_vi_base) {=0D =0D Wouldn't this link PIO buffers to incorrect VI instances when using=0D CXL, since the local variable pio_write_vi_base has the correct=0D non-zero value but the struct field was never updated?=0D