From: Dan Carpenter <dan.carpenter@linaro.org>
To: Meghana Malladi <m-malladi@ti.com>
Cc: rogerq@kernel.org, danishanwar@ti.com, pabeni@redhat.com,
kuba@kernel.org, edumazet@google.com, davem@davemloft.net,
andrew+netdev@lunn.ch, bpf@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
u.kleine-koenig@baylibre.com, matthias.schiffer@ew.tq-group.com,
schnelle@linux.ibm.com, diogo.ivo@siemens.com,
glaroque@baylibre.com, macro@orcam.me.uk,
john.fastabend@gmail.com, hawk@kernel.org, daniel@iogearbox.net,
ast@kernel.org, srk@ti.com, Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH net-next v3 2/3] net: ti: icssg-prueth: introduce and use prueth_swdata struct for SWDATA
Date: Wed, 26 Feb 2025 13:29:57 +0300 [thread overview]
Message-ID: <41fbeb70-bf49-4751-b4ba-6b122a45233d@stanley.mountain> (raw)
In-Reply-To: <20250224110102.1528552-3-m-malladi@ti.com>
On Mon, Feb 24, 2025 at 04:31:01PM +0530, Meghana Malladi wrote:
> From: Roger Quadros <rogerq@kernel.org>
>
> We have different cases for SWDATA (skb, page, cmd, etc)
> so it is better to have a dedicated data structure for that.
> We can embed the type field inside the struct and use it
> to interpret the data in completion handlers.
>
> Increase SWDATA size to 48 so we have some room to add
> more data if required.
What is the "SWDATA size"? Where is that specified? Is
that a variable or a define or the size of a struct or
what?
>
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
> Signed-off-by: Meghana Malladi <m-malladi@ti.com>
> ---
> Changes since v2 (v3-v2):
> - Fix leaking tx descriptor in emac_tx_complete_packets()
> - Free rx descriptor if swdata type is not page in emac_rx_packet()
> - Revert back the size of PRUETH_NAV_SW_DATA_SIZE
> - Use build time check for prueth_swdata size
> - re-write prueth_swdata to have enum type as first member in the struct
> and prueth_data union embedded in the struct
>
> All the above changes have been suggested by Roger Quadros <rogerq@kernel.org>
>
> drivers/net/ethernet/ti/icssg/icssg_common.c | 52 +++++++++++++------
> drivers/net/ethernet/ti/icssg/icssg_prueth.c | 3 ++
> drivers/net/ethernet/ti/icssg/icssg_prueth.h | 16 ++++++
> .../net/ethernet/ti/icssg/icssg_prueth_sr1.c | 4 +-
> 4 files changed, 57 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c
> index acbb79ad8b0c..01eeabe83eff 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_common.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c
> @@ -136,12 +136,12 @@ int emac_tx_complete_packets(struct prueth_emac *emac, int chn,
> struct net_device *ndev = emac->ndev;
> struct cppi5_host_desc_t *desc_tx;
> struct netdev_queue *netif_txq;
> + struct prueth_swdata *swdata;
> struct prueth_tx_chn *tx_chn;
> unsigned int total_bytes = 0;
> struct sk_buff *skb;
> dma_addr_t desc_dma;
> int res, num_tx = 0;
> - void **swdata;
>
> tx_chn = &emac->tx_chns[chn];
>
> @@ -163,12 +163,19 @@ int emac_tx_complete_packets(struct prueth_emac *emac, int chn,
> swdata = cppi5_hdesc_get_swdata(desc_tx);
>
> /* was this command's TX complete? */
> - if (emac->is_sr1 && *(swdata) == emac->cmd_data) {
> + if (emac->is_sr1 && (void *)(swdata) == emac->cmd_data) {
I don't think this conversion is correct. You still need to say:
if (emac->is_sr1 && swdata->data.something == emac->cmd_data) {
Where something is probably "page".
regards,
dan carpenter
> prueth_xmit_free(tx_chn, desc_tx);
> continue;
> }
>
> - skb = *(swdata);
> + if (swdata->type != PRUETH_SWDATA_SKB) {
> + netdev_err(ndev, "tx_complete: invalid swdata type %d\n", swdata->type);
> + prueth_xmit_free(tx_chn, desc_tx);
> + budget++;
> + continue;
> + }
next prev parent reply other threads:[~2025-02-26 10:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 11:00 [PATCH net-next v3 0/3] net: ti: icssg-prueth: Add native mode XDP support Meghana Malladi
2025-02-24 11:01 ` [PATCH net-next v3 1/3] net: ti: icssg-prueth: Use page_pool API for RX buffer allocation Meghana Malladi
2025-02-24 14:20 ` Roger Quadros
2025-03-03 11:16 ` Malladi, Meghana
2025-02-24 11:01 ` [PATCH net-next v3 2/3] net: ti: icssg-prueth: introduce and use prueth_swdata struct for SWDATA Meghana Malladi
2025-02-26 10:29 ` Dan Carpenter [this message]
2025-03-03 11:49 ` [EXTERNAL] " Malladi, Meghana
2025-02-27 12:27 ` Roger Quadros
2025-03-03 11:23 ` Malladi, Meghana
2025-02-24 11:01 ` [PATCH net-next v3 3/3] net: ti: icssg-prueth: Add XDP support Meghana Malladi
2025-02-26 10:49 ` Dan Carpenter
2025-03-03 12:06 ` [EXTERNAL] " Malladi, Meghana
2025-03-03 12:31 ` Dan Carpenter
2025-03-03 13:36 ` Malladi, Meghana
2025-03-03 14:08 ` Dan Carpenter
2025-03-05 9:23 ` Malladi, Meghana
2025-03-05 9:31 ` Dan Carpenter
2025-02-27 15:37 ` Roger Quadros
2025-03-03 11:36 ` Malladi, Meghana
2025-02-24 13:35 ` [PATCH net-next v3 0/3] net: ti: icssg-prueth: Add native mode " Diogo Ivo
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=41fbeb70-bf49-4751-b4ba-6b122a45233d@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=diogo.ivo@siemens.com \
--cc=edumazet@google.com \
--cc=glaroque@baylibre.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m-malladi@ti.com \
--cc=macro@orcam.me.uk \
--cc=matthias.schiffer@ew.tq-group.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rogerq@kernel.org \
--cc=schnelle@linux.ibm.com \
--cc=srk@ti.com \
--cc=u.kleine-koenig@baylibre.com \
--cc=vigneshr@ti.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