From: Simon Horman <simon.horman@corigine.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, nbd@nbd.name,
john@phrozen.org, sean.wang@mediatek.com,
Mark-MC.Lee@mediatek.com, lorenzo.bianconi@redhat.com,
daniel@makrotopia.org
Subject: Re: [PATCH net-next] net: ethernet: mtk_ppe: add MTK_FOE_ENTRY_V{1,2}_SIZE macros
Date: Thu, 20 Jul 2023 18:55:57 +0100 [thread overview]
Message-ID: <ZLl1Le1JiuoC8DIc@corigine.com> (raw)
In-Reply-To: <725aa4b427e8ae2384ff1c8a32111fb24ceda231.1689762482.git.lorenzo@kernel.org>
On Wed, Jul 19, 2023 at 12:29:49PM +0200, Lorenzo Bianconi wrote:
> Introduce MTK_FOE_ENTRY_V{1,2}_SIZE macros in order to make more
> explicit foe_entry size for different chipset revisions.
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 10 +++++-----
> drivers/net/ethernet/mediatek/mtk_ppe.h | 3 +++
> 2 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index 834c644b67db..7f9e23ddb3c4 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -4811,7 +4811,7 @@ static const struct mtk_soc_data mt7621_data = {
> .required_pctl = false,
> .offload_version = 1,
> .hash_offset = 2,
> - .foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
> + .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
> .txrx = {
> .txd_size = sizeof(struct mtk_tx_dma),
> .rxd_size = sizeof(struct mtk_rx_dma),
...
> @@ -4889,8 +4889,8 @@ static const struct mtk_soc_data mt7981_data = {
> .required_pctl = false,
> .offload_version = 2,
> .hash_offset = 4,
> - .foe_entry_size = sizeof(struct mtk_foe_entry),
> .has_accounting = true,
> + .foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
> .txrx = {
> .txd_size = sizeof(struct mtk_tx_dma_v2),
> .rxd_size = sizeof(struct mtk_rx_dma_v2),
...
> diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.h b/drivers/net/ethernet/mediatek/mtk_ppe.h
> index e51de31a52ec..fb6bf58172d9 100644
> --- a/drivers/net/ethernet/mediatek/mtk_ppe.h
> +++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
> @@ -216,6 +216,9 @@ struct mtk_foe_ipv6_6rd {
> struct mtk_foe_mac_info l2;
> };
>
> +#define MTK_FOE_ENTRY_V1_SIZE 80
> +#define MTK_FOE_ENTRY_V2_SIZE 96
Hi Lorenzo,
Would it make sense to define these in terms of sizeof(struct mtk_foe_entry) ?
...
next prev parent reply other threads:[~2023-07-20 17:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-19 10:29 [PATCH net-next] net: ethernet: mtk_ppe: add MTK_FOE_ENTRY_V{1,2}_SIZE macros Lorenzo Bianconi
2023-07-20 17:55 ` Simon Horman [this message]
2023-07-20 20:52 ` Lorenzo Bianconi
2023-07-21 6:52 ` Simon Horman
2023-07-21 7:50 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZLl1Le1JiuoC8DIc@corigine.com \
--to=simon.horman@corigine.com \
--cc=Mark-MC.Lee@mediatek.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=john@phrozen.org \
--cc=kuba@kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sean.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).