Skip to contentSkip to conversation

dpaa_eth: fix the access method for the dpaa_napi_portal

PATCH Applied Camelia Groza 4 participants 4 messages Feb 18, 2021 – Feb 23, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +1 -1
index 6faa20bed488..9905caeaeee3 100644
@@ -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;
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 41 lines

-----Original Message-----
From: Camelia Alexandra Groza <[email protected]>
Sent: 18 February 2021 20:21
To: [email protected]; [email protected]; [email protected]
Cc: [email protected]; Madalin Bucur (OSS) <[email protected]>; [email protected]; Camelia Alexandra Groza <[email protected]>
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")
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +0 -1
index 6faa20bed488..9905caeaeee3 100644
@@ -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);
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +1 -0
 	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,
Quoted 4 lines

sched_napi)))
return qman_cb_dqrr_stop;
--
2.17.1

Acked-by on v1 1/1
#2 lore raw
In reply to Camelia Groza
Quoted 9 lines · On Thu, 18 Feb 2021 20:21:06 +0200 Camelia Groza <[email protected]> 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")
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

LGTM

Signature · 4 lines
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer
#3 lore raw
In reply to Camelia Groza
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 8 lines · 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")

[...]

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