Message ID | 20230330120840.52079-1-nbd@nbd.name (mailing list archive) |
---|---|
State | Accepted |
Commit | 8c1cb87c2a5c29da416848451a687473f379611c |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v2,1/3] net: ethernet: mtk_eth_soc: fix flow block refcounting logic | expand |
On Thu, Mar 30, 2023 at 02:08:38PM +0200, Felix Fietkau wrote: > Since we call flow_block_cb_decref on FLOW_BLOCK_UNBIND, we also need to > call flow_block_cb_incref for a newly allocated cb. > Also fix the accidentally inverted refcount check on unbind. > > Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support") > Reviewed-by: Simon Horman <simon.horman@corigine.com> > Signed-off-by: Felix Fietkau <nbd@nbd.name> > --- > drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) So what was changed between version 1 and 2? It is expected to send cover letter too for series with more than 2 patches. Thanks
On 30.03.23 14:13, Leon Romanovsky wrote: > On Thu, Mar 30, 2023 at 02:08:38PM +0200, Felix Fietkau wrote: >> Since we call flow_block_cb_decref on FLOW_BLOCK_UNBIND, we also need to >> call flow_block_cb_incref for a newly allocated cb. >> Also fix the accidentally inverted refcount check on unbind. >> >> Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support") >> Reviewed-by: Simon Horman <simon.horman@corigine.com> >> Signed-off-by: Felix Fietkau <nbd@nbd.name> >> --- >> drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) > > So what was changed between version 1 and 2? > It is expected to send cover letter too for series with more than 2 patches. I had already sent v2 without the net prefix, this was just a resend without any further code changes. Unfortunately I forgot to copy the changelog as well. Here it is: v2: fix description, simplify refcounting change Sorry about that. - Felix
On Thu, Mar 30, 2023 at 02:08:38PM +0200, Felix Fietkau wrote: > Since we call flow_block_cb_decref on FLOW_BLOCK_UNBIND, we also need to > call flow_block_cb_incref for a newly allocated cb. > Also fix the accidentally inverted refcount check on unbind. > > Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support") > Reviewed-by: Simon Horman <simon.horman@corigine.com> > Signed-off-by: Felix Fietkau <nbd@nbd.name> > --- > drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Thanks, Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Hello: This series was applied to netdev/net.git (main) by Jakub Kicinski <kuba@kernel.org>: On Thu, 30 Mar 2023 14:08:38 +0200 you wrote: > Since we call flow_block_cb_decref on FLOW_BLOCK_UNBIND, we also need to > call flow_block_cb_incref for a newly allocated cb. > Also fix the accidentally inverted refcount check on unbind. > > Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support") > Reviewed-by: Simon Horman <simon.horman@corigine.com> > Signed-off-by: Felix Fietkau <nbd@nbd.name> > > [...] Here is the summary with links: - [net,v2,1/3] net: ethernet: mtk_eth_soc: fix flow block refcounting logic https://git.kernel.org/netdev/net/c/8c1cb87c2a5c - [net,v2,2/3] net: ethernet: mtk_eth_soc: fix L2 offloading with DSA untag offload https://git.kernel.org/netdev/net/c/5f36ca1b841f - [net,v2,3/3] net: ethernet: mtk_eth_soc: add missing ppe cache flush when deleting a flow https://git.kernel.org/netdev/net/c/924531326e2d You are awesome, thank you!
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c index 81afd5ee3fbf..161751bb36c9 100644 --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c @@ -576,6 +576,7 @@ mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f) if (IS_ERR(block_cb)) return PTR_ERR(block_cb); + flow_block_cb_incref(block_cb); flow_block_cb_add(block_cb, f); list_add_tail(&block_cb->driver_list, &block_cb_list); return 0; @@ -584,7 +585,7 @@ mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f) if (!block_cb) return -ENOENT; - if (flow_block_cb_decref(block_cb)) { + if (!flow_block_cb_decref(block_cb)) { flow_block_cb_remove(block_cb, f); list_del(&block_cb->driver_list); }