From patchwork Tue Mar 5 11:08:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Panis X-Patchwork-Id: 13582122 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 9DCFD57326 for ; Tue, 5 Mar 2024 11:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709636911; cv=none; b=U8tRsvuqzklqkodY4F+fdZbYziaMS0hAOAhik1jNY6mqF9tkq259QaGYXvK/iBNRBojTacZLgXuexDdA9fItrD1Et+FzJ2mXZ7wLpOcRBGzwLr+ZBA9WAU2IqpKbADUJj49ryjBZ5z9boUG5jl6U5ogHbgws6+U2GA2MfVMJ3jg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709636911; c=relaxed/simple; bh=jlmDA8j5BPsGTQCQEi11/ZrPzSbTV7KDqXuvMXnrWBo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VWc+sCHs/lRntXNObb3zPX6pxhXvDJdfuHFkmxF+hWMUfzbHXQKfsTlrQqXrohuQyMQSN2uSrNO3QWYd9qsFL15/TQ2yrTaWHaxyyO+f/4P+yLGWuJih0ErSlwuYVVWtsaDr4RW7xpf2Yr/ZhuYD+h9JsI7xJXggKDfWcedEyig= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=XBkOqmoy; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="XBkOqmoy" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-33d9c3f36c2so317211f8f.2 for ; Tue, 05 Mar 2024 03:08:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1709636908; x=1710241708; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qEaZoF9mx7Xkycbcd21LmA2/00TCeHKVbh1e2Dzr7Vc=; b=XBkOqmoyLYJ7y+GW5bf3b56XKA5JAPM0QBc3ZM2TSaJ0xYuY7r7loY88QscPFSW7e8 sEhvEvUva+A9/iPqqBT/a990OQPn/mXLCpbT3kwT0DO+jEZ5/9DemjkWbi+ghr9OEEjz LR6pwcnhxmgW69zaX90KP5VS/U3KT45ycDPZt0tLibte58A+5bkWTpUlbdLmN5M75+tU zoeRanJGAoHMOB36p/1MApyJb769D8RzaWUhDJY05qf/507B/7gcraUgxWo62FEAfqAX UHp9TcpBXTyFcu2wCjzJBvFKqS1Km+fP04NE4+PK3LXRtX7TO23PsciKpx8g7mevBpOw YsPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709636908; x=1710241708; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qEaZoF9mx7Xkycbcd21LmA2/00TCeHKVbh1e2Dzr7Vc=; b=cny1w1FkVHtxYa17yiZnUuUzuxOuEwMmapu5yeCz8PmcKxA+rnmVoRMRvUC1tBJBap auz3P3/2EglqsN1fYaN/2GKZokYRINxhi81Jh5jmYpJ0nRwq/x+S73B90kw2XOt7DKKm TdwaXkMinYLfGiyGi6sT2Hw9YpoE1Yxm/v7zy1Xn4sMbgVd24hJ1pNJ/1UBXqv+uBmz5 jvF2ufYNgf9hPrqRG4mSgj7EBVICvsLh2/G810tvKufK4cL6ugft6HC3/NQD8w+YSRMg 6knVNdlTGoGpNNHLGmHfRqNAt1PZoYAXC4P2lEws+IDtHsI3E3GRihq2ggYEvKLkIehk uLSQ== X-Forwarded-Encrypted: i=1; AJvYcCXYdoM2r/NsRcI2DyNg7ocoDVbFSa1MvY5btuxxrnj5faCX97tf5wcxeVee73zipqQlYfdwOOJiJbuB2gi9hQZEJjft X-Gm-Message-State: AOJu0YyvEMugWt6CvPv6Lbvg2VtMU9juUSjFphP7gyUj6XklTkoQxOhT Ed7VqH+p4lN7LmOHZjsIYE29Jv6MFEOwDl7hdzGFf7gqGa/D/lcdwiIMXZpWhz8= X-Google-Smtp-Source: AGHT+IE9UuSurqoXqrMGlUzmaVAS5zp1obFuVFAEL0FLf8GIm/g3hMOXZyErpfk1zJpIMEuMGX/ehg== X-Received: by 2002:a5d:4047:0:b0:33d:61fe:6ca3 with SMTP id w7-20020a5d4047000000b0033d61fe6ca3mr7985438wrp.26.1709636908019; Tue, 05 Mar 2024 03:08:28 -0800 (PST) Received: from [127.0.1.1] ([84.102.31.43]) by smtp.gmail.com with ESMTPSA id v7-20020a5d59c7000000b0033e475940fasm2190993wry.66.2024.03.05.03.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 03:08:27 -0800 (PST) From: Julien Panis Date: Tue, 05 Mar 2024 12:08:18 +0100 Subject: [PATCH v3 1/3] net: ethernet: ti: Add accessors for struct k3_cppi_desc_pool members Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240223-am65-cpsw-xdp-basic-v3-1-5d944a9d84a0@baylibre.com> References: <20240223-am65-cpsw-xdp-basic-v3-0-5d944a9d84a0@baylibre.com> In-Reply-To: <20240223-am65-cpsw-xdp-basic-v3-0-5d944a9d84a0@baylibre.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , Simon Horman , Andrew Lunn Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Julien Panis X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709636903; l=1852; i=jpanis@baylibre.com; s=20230526; h=from:subject:message-id; bh=jlmDA8j5BPsGTQCQEi11/ZrPzSbTV7KDqXuvMXnrWBo=; b=dfeer2o0y3GGm8RrN/JvsU55HT41wNQJYnV7qThO2EEG4VL5/5uFU+kGT7yuR5zglIGMB/bAo RDemmHF2XC2B5I/tvt6x8yUrU26eWs0i6goZX8R4eJai/yp7iJrzvFc X-Developer-Key: i=jpanis@baylibre.com; a=ed25519; pk=8eSM4/xkiHWz2M1Cw1U3m2/YfPbsUdEJPCWY3Mh9ekQ= X-Patchwork-Delegate: kuba@kernel.org This patch adds accessors for desc_size and cpumem members. They may be used, for instance, to compute a descriptor index. Signed-off-by: Julien Panis --- drivers/net/ethernet/ti/k3-cppi-desc-pool.c | 12 ++++++++++++ drivers/net/ethernet/ti/k3-cppi-desc-pool.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c index 05cc7aab1ec8..fe8203c05731 100644 --- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c +++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c @@ -132,5 +132,17 @@ size_t k3_cppi_desc_pool_avail(struct k3_cppi_desc_pool *pool) } EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_avail); +size_t k3_cppi_desc_pool_desc_size(struct k3_cppi_desc_pool *pool) +{ + return pool->desc_size; +} +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_desc_size); + +void *k3_cppi_desc_pool_cpuaddr(struct k3_cppi_desc_pool *pool) +{ + return pool->cpumem; +} +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_cpuaddr); + MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("TI K3 CPPI5 descriptors pool API"); diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.h b/drivers/net/ethernet/ti/k3-cppi-desc-pool.h index a7e3fa5e7b62..149d5579a5e2 100644 --- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.h +++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.h @@ -26,5 +26,7 @@ k3_cppi_desc_pool_dma2virt(struct k3_cppi_desc_pool *pool, dma_addr_t dma); void *k3_cppi_desc_pool_alloc(struct k3_cppi_desc_pool *pool); void k3_cppi_desc_pool_free(struct k3_cppi_desc_pool *pool, void *addr); size_t k3_cppi_desc_pool_avail(struct k3_cppi_desc_pool *pool); +size_t k3_cppi_desc_pool_desc_size(struct k3_cppi_desc_pool *pool); +void *k3_cppi_desc_pool_cpuaddr(struct k3_cppi_desc_pool *pool); #endif /* K3_CPPI_DESC_POOL_H_ */