From e82a5e7f7bdcb6a41db702abcf1c40df7e0c1569 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 19 Jun 2023 08:52:50 +0200 Subject: [PATCH] 6.1-stable patches added patches: neighbour-delete-neigh_lookup_nodev-as-not-used.patch net-sched-act_api-add-specific-ext_warn_msg-for-tc-action.patch net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch revert-net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch --- ...elete-neigh_lookup_nodev-as-not-used.patch | 75 +++++++++++++++++++ ...-specific-ext_warn_msg-for-tc-action.patch | 59 +++++++++++++++ ...xt_warn_msg-to-the-correct-hierarchy.patch | 39 ++++++++++ ...xt_warn_msg-to-the-correct-hierarchy.patch | 41 ++++++++++ queue-6.1/series | 4 + 5 files changed, 218 insertions(+) create mode 100644 queue-6.1/neighbour-delete-neigh_lookup_nodev-as-not-used.patch create mode 100644 queue-6.1/net-sched-act_api-add-specific-ext_warn_msg-for-tc-action.patch create mode 100644 queue-6.1/net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch create mode 100644 queue-6.1/revert-net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch diff --git a/queue-6.1/neighbour-delete-neigh_lookup_nodev-as-not-used.patch b/queue-6.1/neighbour-delete-neigh_lookup_nodev-as-not-used.patch new file mode 100644 index 00000000000..0640cd89592 --- /dev/null +++ b/queue-6.1/neighbour-delete-neigh_lookup_nodev-as-not-used.patch @@ -0,0 +1,75 @@ +From 76b9bf965c98c9b53ef7420b3b11438dbd764f92 Mon Sep 17 00:00:00 2001 +From: Leon Romanovsky +Date: Wed, 8 Mar 2023 11:23:13 +0200 +Subject: neighbour: delete neigh_lookup_nodev as not used + +From: Leon Romanovsky + +commit 76b9bf965c98c9b53ef7420b3b11438dbd764f92 upstream. + +neigh_lookup_nodev isn't used in the kernel after removal +of DECnet. So let's remove it. + +Fixes: 1202cdd66531 ("Remove DECnet support from kernel") +Signed-off-by: Leon Romanovsky +Reviewed-by: Eric Dumazet +Reviewed-by: Nikolay Aleksandrov +Link: https://lore.kernel.org/r/eb5656200d7964b2d177a36b77efa3c597d6d72d.1678267343.git.leonro@nvidia.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + include/net/neighbour.h | 2 -- + net/core/neighbour.c | 31 ------------------------------- + 2 files changed, 33 deletions(-) + +--- a/include/net/neighbour.h ++++ b/include/net/neighbour.h +@@ -336,8 +336,6 @@ void neigh_table_init(int index, struct + int neigh_table_clear(int index, struct neigh_table *tbl); + struct neighbour *neigh_lookup(struct neigh_table *tbl, const void *pkey, + struct net_device *dev); +-struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, struct net *net, +- const void *pkey); + struct neighbour *__neigh_create(struct neigh_table *tbl, const void *pkey, + struct net_device *dev, bool want_ref); + static inline struct neighbour *neigh_create(struct neigh_table *tbl, +--- a/net/core/neighbour.c ++++ b/net/core/neighbour.c +@@ -627,37 +627,6 @@ struct neighbour *neigh_lookup(struct ne + } + EXPORT_SYMBOL(neigh_lookup); + +-struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, struct net *net, +- const void *pkey) +-{ +- struct neighbour *n; +- unsigned int key_len = tbl->key_len; +- u32 hash_val; +- struct neigh_hash_table *nht; +- +- NEIGH_CACHE_STAT_INC(tbl, lookups); +- +- rcu_read_lock_bh(); +- nht = rcu_dereference_bh(tbl->nht); +- hash_val = tbl->hash(pkey, NULL, nht->hash_rnd) >> (32 - nht->hash_shift); +- +- for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]); +- n != NULL; +- n = rcu_dereference_bh(n->next)) { +- if (!memcmp(n->primary_key, pkey, key_len) && +- net_eq(dev_net(n->dev), net)) { +- if (!refcount_inc_not_zero(&n->refcnt)) +- n = NULL; +- NEIGH_CACHE_STAT_INC(tbl, hits); +- break; +- } +- } +- +- rcu_read_unlock_bh(); +- return n; +-} +-EXPORT_SYMBOL(neigh_lookup_nodev); +- + static struct neighbour * + ___neigh_create(struct neigh_table *tbl, const void *pkey, + struct net_device *dev, u32 flags, diff --git a/queue-6.1/net-sched-act_api-add-specific-ext_warn_msg-for-tc-action.patch b/queue-6.1/net-sched-act_api-add-specific-ext_warn_msg-for-tc-action.patch new file mode 100644 index 00000000000..6f829a214ed --- /dev/null +++ b/queue-6.1/net-sched-act_api-add-specific-ext_warn_msg-for-tc-action.patch @@ -0,0 +1,59 @@ +From 2f59823fe696caa844249a90bb3f9aeda69cfe5c Mon Sep 17 00:00:00 2001 +From: Hangbin Liu +Date: Thu, 16 Mar 2023 11:37:53 +0800 +Subject: net/sched: act_api: add specific EXT_WARN_MSG for tc action + +From: Hangbin Liu + +commit 2f59823fe696caa844249a90bb3f9aeda69cfe5c upstream. + +In my previous commit 0349b8779cc9 ("sched: add new attr TCA_EXT_WARN_MSG +to report tc extact message") I didn't notice the tc action use different +enum with filter. So we can't use TCA_EXT_WARN_MSG directly for tc action. +Let's add a TCA_ROOT_EXT_WARN_MSG for tc action specifically and put this +param before going to the TCA_ACT_TAB nest. + +Fixes: 0349b8779cc9 ("sched: add new attr TCA_EXT_WARN_MSG to report tc extact message") +Signed-off-by: Hangbin Liu +Acked-by: Jamal Hadi Salim +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + include/uapi/linux/rtnetlink.h | 1 + + net/sched/act_api.c | 8 ++++---- + 2 files changed, 5 insertions(+), 4 deletions(-) + +--- a/include/uapi/linux/rtnetlink.h ++++ b/include/uapi/linux/rtnetlink.h +@@ -789,6 +789,7 @@ enum { + TCA_ROOT_FLAGS, + TCA_ROOT_COUNT, + TCA_ROOT_TIME_DELTA, /* in msecs */ ++ TCA_ROOT_EXT_WARN_MSG, + __TCA_ROOT_MAX, + #define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1) + }; +--- a/net/sched/act_api.c ++++ b/net/sched/act_api.c +@@ -1596,6 +1596,10 @@ static int tca_get_fill(struct sk_buff * + t->tca__pad1 = 0; + t->tca__pad2 = 0; + ++ if (extack && extack->_msg && ++ nla_put_string(skb, TCA_ROOT_EXT_WARN_MSG, extack->_msg)) ++ goto out_nlmsg_trim; ++ + nest = nla_nest_start_noflag(skb, TCA_ACT_TAB); + if (!nest) + goto out_nlmsg_trim; +@@ -1605,10 +1609,6 @@ static int tca_get_fill(struct sk_buff * + + nla_nest_end(skb, nest); + +- if (extack && extack->_msg && +- nla_put_string(skb, TCA_EXT_WARN_MSG, extack->_msg)) +- goto out_nlmsg_trim; +- + nlh->nlmsg_len = skb_tail_pointer(skb) - b; + + return skb->len; diff --git a/queue-6.1/net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch b/queue-6.1/net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch new file mode 100644 index 00000000000..a43ecfbc611 --- /dev/null +++ b/queue-6.1/net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch @@ -0,0 +1,39 @@ +From 923b2e30dc9cd05931da0f64e2e23d040865c035 Mon Sep 17 00:00:00 2001 +From: Pedro Tammela +Date: Fri, 24 Feb 2023 14:56:01 -0300 +Subject: net/sched: act_api: move TCA_EXT_WARN_MSG to the correct hierarchy + +From: Pedro Tammela + +commit 923b2e30dc9cd05931da0f64e2e23d040865c035 upstream. + +TCA_EXT_WARN_MSG is currently sitting outside of the expected hierarchy +for the tc actions code. It should sit within TCA_ACT_TAB. + +Fixes: 0349b8779cc9 ("sched: add new attr TCA_EXT_WARN_MSG to report tc extact message") +Reviewed-by: Jamal Hadi Salim +Signed-off-by: Pedro Tammela +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/sched/act_api.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/sched/act_api.c ++++ b/net/sched/act_api.c +@@ -1603,12 +1603,12 @@ static int tca_get_fill(struct sk_buff * + if (tcf_action_dump(skb, actions, bind, ref, false) < 0) + goto out_nlmsg_trim; + +- nla_nest_end(skb, nest); +- + if (extack && extack->_msg && + nla_put_string(skb, TCA_EXT_WARN_MSG, extack->_msg)) + goto out_nlmsg_trim; + ++ nla_nest_end(skb, nest); ++ + nlh->nlmsg_len = skb_tail_pointer(skb) - b; + + return skb->len; diff --git a/queue-6.1/revert-net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch b/queue-6.1/revert-net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch new file mode 100644 index 00000000000..d1eebe98854 --- /dev/null +++ b/queue-6.1/revert-net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch @@ -0,0 +1,41 @@ +From 8de2bd02439eb839a452a853c1004c2c45ff6fef Mon Sep 17 00:00:00 2001 +From: Hangbin Liu +Date: Thu, 16 Mar 2023 11:37:52 +0800 +Subject: Revert "net/sched: act_api: move TCA_EXT_WARN_MSG to the correct hierarchy" + +From: Hangbin Liu + +commit 8de2bd02439eb839a452a853c1004c2c45ff6fef upstream. + +This reverts commit 923b2e30dc9cd05931da0f64e2e23d040865c035. + +This is not a correct fix as TCA_EXT_WARN_MSG is not a hierarchy to +TCA_ACT_TAB. I didn't notice the TC actions use different enum when adding +TCA_EXT_WARN_MSG. To fix the difference I will add a new WARN enum in +TCA_ROOT_MAX as Jamal suggested. + +Signed-off-by: Hangbin Liu +Acked-by: Jamal Hadi Salim +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/sched/act_api.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/sched/act_api.c ++++ b/net/sched/act_api.c +@@ -1603,12 +1603,12 @@ static int tca_get_fill(struct sk_buff * + if (tcf_action_dump(skb, actions, bind, ref, false) < 0) + goto out_nlmsg_trim; + ++ nla_nest_end(skb, nest); ++ + if (extack && extack->_msg && + nla_put_string(skb, TCA_EXT_WARN_MSG, extack->_msg)) + goto out_nlmsg_trim; + +- nla_nest_end(skb, nest); +- + nlh->nlmsg_len = skb_tail_pointer(skb) - b; + + return skb->len; diff --git a/queue-6.1/series b/queue-6.1/series index 33521be2d2e..efffe12b659 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -155,3 +155,7 @@ afs-fix-vlserver-probe-rtt-handling.patch parisc-delete-redundant-register-definitions-in-asm-assembly.h.patch rcu-kvfree-avoid-freeing-new-kfree_rcu-memory-after-old-grace-period.patch drm-amdgpu-don-t-set-struct-drm_driver.output_poll_changed.patch +net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch +revert-net-sched-act_api-move-tca_ext_warn_msg-to-the-correct-hierarchy.patch +net-sched-act_api-add-specific-ext_warn_msg-for-tc-action.patch +neighbour-delete-neigh_lookup_nodev-as-not-used.patch -- 2.47.2