* [PATCH net] dpaa_eth: fix the access method for the dpaa_napi_portal
@ 2021-02-18 18:21 Camelia Groza
2021-02-19 10:14 ` Madalin Bucur (OSS)
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Camelia Groza @ 2021-02-18 18:21 UTC (permalink / raw)
To: kuba, davem, s.hauer; +Cc: brouer, madalin.bucur, netdev, Camelia Groza
The current use of container_of is flawed and unnecessary. Obtain
the dpaa_napi_portal reference from the private percpu data instead.
Fixes: a1e031ffb422 ("dpaa_eth: add XDP_REDIRECT support")
Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
---
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 6faa20bed488..9905caeaeee3 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -2672,7 +2672,6 @@ static enum qman_cb_dqrr_result rx_default_dqrr(struct qman_portal *portal,
u32 hash;
u64 ns;
- np = container_of(&portal, struct dpaa_napi_portal, p);
dpaa_fq = container_of(fq, struct dpaa_fq, fq_base);
fd_status = be32_to_cpu(fd->status);
fd_format = qm_fd_get_format(fd);
@@ -2687,6 +2686,7 @@ static enum qman_cb_dqrr_result rx_default_dqrr(struct qman_portal *portal,
percpu_priv = this_cpu_ptr(priv->percpu_priv);
percpu_stats = &percpu_priv->stats;
+ np = &percpu_priv->np;
if (unlikely(dpaa_eth_napi_schedule(percpu_priv, portal, sched_napi)))
return qman_cb_dqrr_stop;
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH net] dpaa_eth: fix the access method for the dpaa_napi_portal
2021-02-18 18:21 [PATCH net] dpaa_eth: fix the access method for the dpaa_napi_portal Camelia Groza
@ 2021-02-19 10:14 ` Madalin Bucur (OSS)
2021-02-19 13:40 ` Jesper Dangaard Brouer
2021-02-23 2:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Madalin Bucur (OSS) @ 2021-02-19 10:14 UTC (permalink / raw)
To: Camelia Alexandra Groza, kuba, davem, s.hauer
Cc: brouer, Madalin Bucur (OSS), netdev
> -----Original Message-----
> From: Camelia Alexandra Groza <camelia.groza@nxp.com>
> Sent: 18 February 2021 20:21
> To: kuba@kernel.org; davem@davemloft.net; s.hauer@pengutronix.de
> Cc: brouer@redhat.com; Madalin Bucur (OSS) <madalin.bucur@oss.nxp.com>;
> netdev@vger.kernel.org; Camelia Alexandra Groza <camelia.groza@nxp.com>
> Subject: [PATCH net] dpaa_eth: fix the access method for the
> dpaa_napi_portal
>
> The current use of container_of is flawed and unnecessary. Obtain
> the dpaa_napi_portal reference from the private percpu data instead.
>
> Fixes: a1e031ffb422 ("dpaa_eth: add XDP_REDIRECT support")
> Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
> ---
> drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index 6faa20bed488..9905caeaeee3 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -2672,7 +2672,6 @@ static enum qman_cb_dqrr_result
> rx_default_dqrr(struct qman_portal *portal,
> u32 hash;
> u64 ns;
>
> - np = container_of(&portal, struct dpaa_napi_portal, p);
> dpaa_fq = container_of(fq, struct dpaa_fq, fq_base);
> fd_status = be32_to_cpu(fd->status);
> fd_format = qm_fd_get_format(fd);
> @@ -2687,6 +2686,7 @@ static enum qman_cb_dqrr_result
> rx_default_dqrr(struct qman_portal *portal,
>
> percpu_priv = this_cpu_ptr(priv->percpu_priv);
> percpu_stats = &percpu_priv->stats;
> + np = &percpu_priv->np;
>
> if (unlikely(dpaa_eth_napi_schedule(percpu_priv, portal,
> sched_napi)))
> return qman_cb_dqrr_stop;
> --
> 2.17.1
Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] dpaa_eth: fix the access method for the dpaa_napi_portal
2021-02-18 18:21 [PATCH net] dpaa_eth: fix the access method for the dpaa_napi_portal Camelia Groza
2021-02-19 10:14 ` Madalin Bucur (OSS)
@ 2021-02-19 13:40 ` Jesper Dangaard Brouer
2021-02-23 2:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Jesper Dangaard Brouer @ 2021-02-19 13:40 UTC (permalink / raw)
To: Camelia Groza; +Cc: kuba, davem, s.hauer, madalin.bucur, netdev, brouer
On Thu, 18 Feb 2021 20:21:06 +0200
Camelia Groza <camelia.groza@nxp.com> wrote:
> The current use of container_of is flawed and unnecessary. Obtain
> the dpaa_napi_portal reference from the private percpu data instead.
>
> Fixes: a1e031ffb422 ("dpaa_eth: add XDP_REDIRECT support")
> Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
> ---
> drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
LGTM
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] dpaa_eth: fix the access method for the dpaa_napi_portal
2021-02-18 18:21 [PATCH net] dpaa_eth: fix the access method for the dpaa_napi_portal Camelia Groza
2021-02-19 10:14 ` Madalin Bucur (OSS)
2021-02-19 13:40 ` Jesper Dangaard Brouer
@ 2021-02-23 2:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-23 2:50 UTC (permalink / raw)
To: Camelia Groza; +Cc: kuba, davem, s.hauer, brouer, madalin.bucur, netdev
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Thu, 18 Feb 2021 20:21:06 +0200 you wrote:
> The current use of container_of is flawed and unnecessary. Obtain
> the dpaa_napi_portal reference from the private percpu data instead.
>
> Fixes: a1e031ffb422 ("dpaa_eth: add XDP_REDIRECT support")
> Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
>
> [...]
Here is the summary with links:
- [net] dpaa_eth: fix the access method for the dpaa_napi_portal
https://git.kernel.org/netdev/net/c/433dfc99aa3e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-23 2:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 18:21 [PATCH net] dpaa_eth: fix the access method for the dpaa_napi_portal Camelia Groza
2021-02-19 10:14 ` Madalin Bucur (OSS)
2021-02-19 13:40 ` Jesper Dangaard Brouer
2021-02-23 2:50 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.