* drivers/net/ethernet/mediatek/mtk_ppe_offload.c - suspicious code?
@ 2021-04-19 1:02 ` Valdis Klētnieks
0 siblings, 0 replies; 6+ messages in thread
From: Valdis Klētnieks @ 2021-04-19 1:02 UTC (permalink / raw)
To: Felix Fietkau, Pablo Neira Ayuso, David S. Miller
Cc: Christoph Hellwig, netdev, linux-arm-kernel, linux-mediatek,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 943 bytes --]
While doing some code auditing for -Woverride_init, I spotted some questionable code
commit 502e84e2382d92654a2ecbc52cdbdb5a11cdcec7
Author: Felix Fietkau <nbd@nbd.name>
Date: Wed Mar 24 02:30:54 2021 +0100
net: ethernet: mtk_eth_soc: add flow offloading support
In drivers/net/ethernet/mediatek/mtk_ppe_offload.c:
+static const struct rhashtable_params mtk_flow_ht_params = {
+ .head_offset = offsetof(struct mtk_flow_entry, node),
+ .head_offset = offsetof(struct mtk_flow_entry, cookie),
+ .key_len = sizeof(unsigned long),
+ .automatic_shrinking = true,
+};
What's intended for head_offset here?
Christoph: This was the only actual questionable code caught by override-init
across allmodconfig builds of arm, arm64, and x86_64. The other 218 warnings
not already silenced by Makefile twiddling of CFLAGS are all legitimate. I
admit not being sure what that means for its use in W=1 builds in general.
[-- Attachment #2: Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/net/ethernet/mediatek/mtk_ppe_offload.c - suspicious code?
@ 2021-04-19 1:02 ` Valdis Klētnieks
0 siblings, 0 replies; 6+ messages in thread
From: Valdis Klētnieks @ 2021-04-19 1:02 UTC (permalink / raw)
To: Felix Fietkau, Pablo Neira Ayuso, David S. Miller
Cc: Christoph Hellwig, netdev, linux-arm-kernel, linux-mediatek,
linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 943 bytes --]
While doing some code auditing for -Woverride_init, I spotted some questionable code
commit 502e84e2382d92654a2ecbc52cdbdb5a11cdcec7
Author: Felix Fietkau <nbd@nbd.name>
Date: Wed Mar 24 02:30:54 2021 +0100
net: ethernet: mtk_eth_soc: add flow offloading support
In drivers/net/ethernet/mediatek/mtk_ppe_offload.c:
+static const struct rhashtable_params mtk_flow_ht_params = {
+ .head_offset = offsetof(struct mtk_flow_entry, node),
+ .head_offset = offsetof(struct mtk_flow_entry, cookie),
+ .key_len = sizeof(unsigned long),
+ .automatic_shrinking = true,
+};
What's intended for head_offset here?
Christoph: This was the only actual questionable code caught by override-init
across allmodconfig builds of arm, arm64, and x86_64. The other 218 warnings
not already silenced by Makefile twiddling of CFLAGS are all legitimate. I
admit not being sure what that means for its use in W=1 builds in general.
[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/net/ethernet/mediatek/mtk_ppe_offload.c - suspicious code?
@ 2021-04-19 1:02 ` Valdis Klētnieks
0 siblings, 0 replies; 6+ messages in thread
From: Valdis Klētnieks @ 2021-04-19 1:02 UTC (permalink / raw)
To: Felix Fietkau, Pablo Neira Ayuso, David S. Miller
Cc: Christoph Hellwig, netdev, linux-arm-kernel, linux-mediatek,
linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 943 bytes --]
While doing some code auditing for -Woverride_init, I spotted some questionable code
commit 502e84e2382d92654a2ecbc52cdbdb5a11cdcec7
Author: Felix Fietkau <nbd@nbd.name>
Date: Wed Mar 24 02:30:54 2021 +0100
net: ethernet: mtk_eth_soc: add flow offloading support
In drivers/net/ethernet/mediatek/mtk_ppe_offload.c:
+static const struct rhashtable_params mtk_flow_ht_params = {
+ .head_offset = offsetof(struct mtk_flow_entry, node),
+ .head_offset = offsetof(struct mtk_flow_entry, cookie),
+ .key_len = sizeof(unsigned long),
+ .automatic_shrinking = true,
+};
What's intended for head_offset here?
Christoph: This was the only actual questionable code caught by override-init
across allmodconfig builds of arm, arm64, and x86_64. The other 218 warnings
not already silenced by Makefile twiddling of CFLAGS are all legitimate. I
admit not being sure what that means for its use in W=1 builds in general.
[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: drivers/net/ethernet/mediatek/mtk_ppe_offload.c - suspicious code?
2021-04-19 1:02 ` Valdis Klētnieks
(?)
@ 2021-04-19 8:06 ` Pablo Neira Ayuso
-1 siblings, 0 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2021-04-19 8:06 UTC (permalink / raw)
To: Valdis Klētnieks
Cc: Felix Fietkau, David S. Miller, Christoph Hellwig, netdev,
linux-arm-kernel, linux-mediatek, linux-kernel
On Sun, Apr 18, 2021 at 09:02:12PM -0400, Valdis Klētnieks wrote:
> While doing some code auditing for -Woverride_init, I spotted some questionable code
>
> commit 502e84e2382d92654a2ecbc52cdbdb5a11cdcec7
> Author: Felix Fietkau <nbd@nbd.name>
> Date: Wed Mar 24 02:30:54 2021 +0100
>
> net: ethernet: mtk_eth_soc: add flow offloading support
>
> In drivers/net/ethernet/mediatek/mtk_ppe_offload.c:
>
> +static const struct rhashtable_params mtk_flow_ht_params = {
> + .head_offset = offsetof(struct mtk_flow_entry, node),
> + .head_offset = offsetof(struct mtk_flow_entry, cookie),
> + .key_len = sizeof(unsigned long),
> + .automatic_shrinking = true,
> +};
>
> What's intended for head_offset here?
It's a bug, there's a fix here:
https://www.spinics.net/lists/netdev/msg736368.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: drivers/net/ethernet/mediatek/mtk_ppe_offload.c - suspicious code?
@ 2021-04-19 8:06 ` Pablo Neira Ayuso
0 siblings, 0 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2021-04-19 8:06 UTC (permalink / raw)
To: Valdis Klētnieks
Cc: Felix Fietkau, David S. Miller, Christoph Hellwig, netdev,
linux-arm-kernel, linux-mediatek, linux-kernel
On Sun, Apr 18, 2021 at 09:02:12PM -0400, Valdis Klētnieks wrote:
> While doing some code auditing for -Woverride_init, I spotted some questionable code
>
> commit 502e84e2382d92654a2ecbc52cdbdb5a11cdcec7
> Author: Felix Fietkau <nbd@nbd.name>
> Date: Wed Mar 24 02:30:54 2021 +0100
>
> net: ethernet: mtk_eth_soc: add flow offloading support
>
> In drivers/net/ethernet/mediatek/mtk_ppe_offload.c:
>
> +static const struct rhashtable_params mtk_flow_ht_params = {
> + .head_offset = offsetof(struct mtk_flow_entry, node),
> + .head_offset = offsetof(struct mtk_flow_entry, cookie),
> + .key_len = sizeof(unsigned long),
> + .automatic_shrinking = true,
> +};
>
> What's intended for head_offset here?
It's a bug, there's a fix here:
https://www.spinics.net/lists/netdev/msg736368.html
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: drivers/net/ethernet/mediatek/mtk_ppe_offload.c - suspicious code?
@ 2021-04-19 8:06 ` Pablo Neira Ayuso
0 siblings, 0 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2021-04-19 8:06 UTC (permalink / raw)
To: Valdis Klētnieks
Cc: Felix Fietkau, David S. Miller, Christoph Hellwig, netdev,
linux-arm-kernel, linux-mediatek, linux-kernel
On Sun, Apr 18, 2021 at 09:02:12PM -0400, Valdis Klētnieks wrote:
> While doing some code auditing for -Woverride_init, I spotted some questionable code
>
> commit 502e84e2382d92654a2ecbc52cdbdb5a11cdcec7
> Author: Felix Fietkau <nbd@nbd.name>
> Date: Wed Mar 24 02:30:54 2021 +0100
>
> net: ethernet: mtk_eth_soc: add flow offloading support
>
> In drivers/net/ethernet/mediatek/mtk_ppe_offload.c:
>
> +static const struct rhashtable_params mtk_flow_ht_params = {
> + .head_offset = offsetof(struct mtk_flow_entry, node),
> + .head_offset = offsetof(struct mtk_flow_entry, cookie),
> + .key_len = sizeof(unsigned long),
> + .automatic_shrinking = true,
> +};
>
> What's intended for head_offset here?
It's a bug, there's a fix here:
https://www.spinics.net/lists/netdev/msg736368.html
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-04-19 8:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 1:02 drivers/net/ethernet/mediatek/mtk_ppe_offload.c - suspicious code? Valdis Klētnieks
2021-04-19 1:02 ` Valdis Klētnieks
2021-04-19 1:02 ` Valdis Klētnieks
2021-04-19 8:06 ` Pablo Neira Ayuso
2021-04-19 8:06 ` Pablo Neira Ayuso
2021-04-19 8:06 ` Pablo Neira Ayuso
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.