* [patch net-next 08/20] net: sched: use tcf_exts_has_actions instead of exts->nr_actions
From: Jiri Pirko @ 2017-07-28 14:40 UTC (permalink / raw)
To: netdev; +Cc: davem, jhs, xiyou.wangcong, daniel, mlxsw
In-Reply-To: <20170728144042.6380-1-jiri@resnulli.us>
From: Jiri Pirko <jiri@mellanox.com>
For check in tcf_exts_dump use tcf_exts_has_actions helper instead
of exts->nr_actions for checking if there are any actions present.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
net/sched/cls_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 287ae6c..735d556 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -915,7 +915,7 @@ int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts)
#ifdef CONFIG_NET_CLS_ACT
struct nlattr *nest;
- if (exts->action && exts->nr_actions) {
+ if (exts->action && tcf_exts_has_actions(exts)) {
/*
* again for backward compatible mode - we want
* to work with both old and new modes of entering
--
2.9.3
^ permalink raw reply related
* [patch net-next 07/20] net: sched: remove check for number of actions in tcf_exts_exec
From: Jiri Pirko @ 2017-07-28 14:40 UTC (permalink / raw)
To: netdev; +Cc: davem, jhs, xiyou.wangcong, daniel, mlxsw
In-Reply-To: <20170728144042.6380-1-jiri@resnulli.us>
From: Jiri Pirko <jiri@mellanox.com>
Leave it to tcf_action_exec to return TC_ACT_OK in case there is no
action present.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
include/net/pkt_cls.h | 4 +---
net/sched/act_api.c | 3 ++-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 61ce521..b8959c9 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -192,9 +192,7 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
struct tcf_result *res)
{
#ifdef CONFIG_NET_CLS_ACT
- if (tcf_exts_has_actions(exts))
- return tcf_action_exec(skb, exts->actions, exts->nr_actions,
- res);
+ return tcf_action_exec(skb, exts->actions, exts->nr_actions, res);
#endif
return TC_ACT_OK;
}
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index f2e9ed3..8d2e506 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -460,9 +460,10 @@ static struct tc_action_ops *tc_lookup_action(struct nlattr *kind)
int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions,
int nr_actions, struct tcf_result *res)
{
- int ret = -1, i;
u32 jmp_prgcnt = 0;
u32 jmp_ttl = TCA_ACT_MAX_PRIO; /*matches actions per filter */
+ int i;
+ int ret = TC_ACT_OK;
if (skb_skip_tc_classify(skb))
return TC_ACT_OK;
--
2.9.3
^ permalink raw reply related
* [patch net-next 06/20] net: sched: fix return value of tcf_exts_exec
From: Jiri Pirko @ 2017-07-28 14:40 UTC (permalink / raw)
To: netdev; +Cc: davem, jhs, xiyou.wangcong, daniel, mlxsw
In-Reply-To: <20170728144042.6380-1-jiri@resnulli.us>
From: Jiri Pirko <jiri@mellanox.com>
Return the defined TC_ACT_OK instead of 0.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
include/net/pkt_cls.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 817badf..61ce521 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -182,7 +182,7 @@ static inline bool tcf_exts_has_one_action(struct tcf_exts *exts)
* @exts: tc filter extensions handle
* @res: desired result
*
- * Executes all configured extensions. Returns 0 on a normal execution,
+ * Executes all configured extensions. Returns TC_ACT_OK on a normal execution,
* a negative number if the filter must be considered unmatched or
* a positive action code (TC_ACT_*) which must be returned to the
* underlying layer.
@@ -196,7 +196,7 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
return tcf_action_exec(skb, exts->actions, exts->nr_actions,
res);
#endif
- return 0;
+ return TC_ACT_OK;
}
int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
--
2.9.3
^ permalink raw reply related
* [patch net-next 05/20] net: sched: remove redundant helpers tcf_exts_is_predicative and tcf_exts_is_available
From: Jiri Pirko @ 2017-07-28 14:40 UTC (permalink / raw)
To: netdev; +Cc: davem, jhs, xiyou.wangcong, daniel, mlxsw
In-Reply-To: <20170728144042.6380-1-jiri@resnulli.us>
From: Jiri Pirko <jiri@mellanox.com>
These two helpers are doing the same as tcf_exts_has_actions, so remove
them and use tcf_exts_has_actions instead.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
include/net/pkt_cls.h | 30 ------------------------------
net/sched/cls_fw.c | 2 +-
net/sched/cls_route.c | 2 +-
net/sched/cls_tcindex.c | 2 +-
4 files changed, 3 insertions(+), 33 deletions(-)
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 322a282..817badf 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -113,36 +113,6 @@ static inline int tcf_exts_init(struct tcf_exts *exts, int action, int police)
return 0;
}
-/**
- * tcf_exts_is_predicative - check if a predicative extension is present
- * @exts: tc filter extensions handle
- *
- * Returns 1 if a predicative extension is present, i.e. an extension which
- * might cause further actions and thus overrule the regular tcf_result.
- */
-static inline int
-tcf_exts_is_predicative(struct tcf_exts *exts)
-{
-#ifdef CONFIG_NET_CLS_ACT
- return exts->nr_actions;
-#else
- return 0;
-#endif
-}
-
-/**
- * tcf_exts_is_available - check if at least one extension is present
- * @exts: tc filter extensions handle
- *
- * Returns 1 if at least one extension is present.
- */
-static inline int
-tcf_exts_is_available(struct tcf_exts *exts)
-{
- /* All non-predicative extensions must be added here. */
- return tcf_exts_is_predicative(exts);
-}
-
static inline void tcf_exts_to_list(const struct tcf_exts *exts,
struct list_head *actions)
{
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index d388536..a53fa75 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -387,7 +387,7 @@ static int fw_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
t->tcm_handle = f->id;
- if (!f->res.classid && !tcf_exts_is_available(&f->exts))
+ if (!f->res.classid && !tcf_exts_has_actions(&f->exts))
return skb->len;
nest = nla_nest_start(skb, TCA_OPTIONS);
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index d63d550..26f8636 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -113,7 +113,7 @@ static inline int route4_hash_wild(void)
#define ROUTE4_APPLY_RESULT() \
{ \
*res = f->res; \
- if (tcf_exts_is_available(&f->exts)) { \
+ if (tcf_exts_has_actions(&f->exts)) { \
int r = tcf_exts_exec(skb, &f->exts, res); \
if (r < 0) { \
dont_cache = 1; \
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index 8a8a583..66924d1 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -52,7 +52,7 @@ struct tcindex_data {
static inline int tcindex_filter_is_set(struct tcindex_filter_result *r)
{
- return tcf_exts_is_predicative(&r->exts) || r->res.classid;
+ return tcf_exts_has_actions(&r->exts) || r->res.classid;
}
static struct tcindex_filter_result *tcindex_lookup(struct tcindex_data *p,
--
2.9.3
^ permalink raw reply related
* [patch net-next 04/20] net: sched: use tcf_exts_has_actions in tcf_exts_exec
From: Jiri Pirko @ 2017-07-28 14:40 UTC (permalink / raw)
To: netdev; +Cc: davem, jhs, xiyou.wangcong, daniel, mlxsw
In-Reply-To: <20170728144042.6380-1-jiri@resnulli.us>
From: Jiri Pirko <jiri@mellanox.com>
Use the tcf_exts_has_actions helper instead or directly testing
exts->nr_actions in tcf_exts_exec.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
include/net/pkt_cls.h | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 7f25636..322a282 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -177,29 +177,6 @@ tcf_exts_stats_update(const struct tcf_exts *exts,
}
/**
- * tcf_exts_exec - execute tc filter extensions
- * @skb: socket buffer
- * @exts: tc filter extensions handle
- * @res: desired result
- *
- * Executes all configured extensions. Returns 0 on a normal execution,
- * a negative number if the filter must be considered unmatched or
- * a positive action code (TC_ACT_*) which must be returned to the
- * underlying layer.
- */
-static inline int
-tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
- struct tcf_result *res)
-{
-#ifdef CONFIG_NET_CLS_ACT
- if (exts->nr_actions)
- return tcf_action_exec(skb, exts->actions, exts->nr_actions,
- res);
-#endif
- return 0;
-}
-
-/**
* tcf_exts_has_actions - check if at least one action is present
* @exts: tc filter extensions handle
*
@@ -229,6 +206,29 @@ static inline bool tcf_exts_has_one_action(struct tcf_exts *exts)
#endif
}
+/**
+ * tcf_exts_exec - execute tc filter extensions
+ * @skb: socket buffer
+ * @exts: tc filter extensions handle
+ * @res: desired result
+ *
+ * Executes all configured extensions. Returns 0 on a normal execution,
+ * a negative number if the filter must be considered unmatched or
+ * a positive action code (TC_ACT_*) which must be returned to the
+ * underlying layer.
+ */
+static inline int
+tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
+ struct tcf_result *res)
+{
+#ifdef CONFIG_NET_CLS_ACT
+ if (tcf_exts_has_actions(exts))
+ return tcf_action_exec(skb, exts->actions, exts->nr_actions,
+ res);
+#endif
+ return 0;
+}
+
int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
struct nlattr **tb, struct nlattr *rate_tlv,
struct tcf_exts *exts, bool ovr);
--
2.9.3
^ permalink raw reply related
* [patch net-next 03/20] net: sched: change names of action number helpers to be aligned with the rest
From: Jiri Pirko @ 2017-07-28 14:40 UTC (permalink / raw)
To: netdev; +Cc: davem, jhs, xiyou.wangcong, daniel, mlxsw
In-Reply-To: <20170728144042.6380-1-jiri@resnulli.us>
From: Jiri Pirko <jiri@mellanox.com>
The rest of the helpers are named tcf_exts_*, so change the name of
the action number helpers to be aligned. While at it, change to inline
functions.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 +--
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +-
.../net/ethernet/mellanox/mlxsw/spectrum_flower.c | 2 +-
drivers/net/ethernet/netronome/nfp/bpf/offload.c | 4 +--
include/net/pkt_cls.h | 36 ++++++++++++++++------
net/dsa/slave.c | 2 +-
net/sched/cls_api.c | 2 +-
9 files changed, 37 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c
index ef06ce8..6f734c5 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c
@@ -96,7 +96,7 @@ static int fill_action_fields(struct adapter *adap,
LIST_HEAD(actions);
exts = cls->knode.exts;
- if (tc_no_actions(exts))
+ if (!tcf_exts_has_actions(exts))
return -EINVAL;
tcf_exts_to_list(exts, &actions);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 0f867dc..89d9aba 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -8953,7 +8953,7 @@ static int parse_tc_actions(struct ixgbe_adapter *adapter,
LIST_HEAD(actions);
int err;
- if (tc_no_actions(exts))
+ if (!tcf_exts_has_actions(exts))
return -EINVAL;
tcf_exts_to_list(exts, &actions);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 3c536f5..78f50d9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -1326,7 +1326,7 @@ static int parse_tc_nic_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
LIST_HEAD(actions);
int err;
- if (tc_no_actions(exts))
+ if (!tcf_exts_has_actions(exts))
return -EINVAL;
attr->flow_tag = MLX5_FS_DEFAULT_FLOW_TAG;
@@ -1839,7 +1839,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
bool encap = false;
int err = 0;
- if (tc_no_actions(exts))
+ if (!tcf_exts_has_actions(exts))
return -EINVAL;
memset(attr, 0, sizeof(*attr));
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 88b668b..66d511d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -1626,7 +1626,7 @@ static int mlxsw_sp_port_add_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
LIST_HEAD(actions);
int err;
- if (!tc_single_action(cls->exts)) {
+ if (!tcf_exts_has_one_action(cls->exts)) {
netdev_err(mlxsw_sp_port->dev, "only singular actions are supported\n");
return -EOPNOTSUPP;
}
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
index 400ad40..9be48d2e 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
@@ -53,7 +53,7 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
LIST_HEAD(actions);
int err;
- if (tc_no_actions(exts))
+ if (!tcf_exts_has_actions(exts))
return 0;
/* Count action is inserted first */
diff --git a/drivers/net/ethernet/netronome/nfp/bpf/offload.c b/drivers/net/ethernet/netronome/nfp/bpf/offload.c
index 78d80a3..a88bb5b 100644
--- a/drivers/net/ethernet/netronome/nfp/bpf/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/bpf/offload.c
@@ -115,14 +115,14 @@ nfp_net_bpf_get_act(struct nfp_net *nn, struct tc_cls_bpf_offload *cls_bpf)
/* TC direct action */
if (cls_bpf->exts_integrated) {
- if (tc_no_actions(cls_bpf->exts))
+ if (!tcf_exts_has_actions(cls_bpf->exts))
return NN_ACT_DIRECT;
return -EOPNOTSUPP;
}
/* TC legacy mode */
- if (!tc_single_action(cls_bpf->exts))
+ if (!tcf_exts_has_one_action(cls_bpf->exts))
return -EOPNOTSUPP;
tcf_exts_to_list(cls_bpf->exts, &actions);
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index f4462ec..7f25636 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -199,17 +199,35 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
return 0;
}
+/**
+ * tcf_exts_has_actions - check if at least one action is present
+ * @exts: tc filter extensions handle
+ *
+ * Returns true if at least one action is present.
+ */
+static inline bool tcf_exts_has_actions(struct tcf_exts *exts)
+{
#ifdef CONFIG_NET_CLS_ACT
+ return exts->nr_actions;
+#else
+ return false;
+#endif
+}
-#define tc_no_actions(_exts) ((_exts)->nr_actions == 0)
-#define tc_single_action(_exts) ((_exts)->nr_actions == 1)
-
-#else /* CONFIG_NET_CLS_ACT */
-
-#define tc_no_actions(_exts) true
-#define tc_single_action(_exts) false
-
-#endif /* CONFIG_NET_CLS_ACT */
+/**
+ * tcf_exts_has_one_action - check if exactly one action is present
+ * @exts: tc filter extensions handle
+ *
+ * Returns true if exactly one action is present.
+ */
+static inline bool tcf_exts_has_one_action(struct tcf_exts *exts)
+{
+#ifdef CONFIG_NET_CLS_ACT
+ return exts->nr_actions == 1;
+#else
+ return false;
+#endif
+}
int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
struct nlattr **tb, struct nlattr *rate_tlv,
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 9507bd3..9f15fcc 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -765,7 +765,7 @@ static int dsa_slave_add_cls_matchall(struct net_device *dev,
if (!ds->ops->port_mirror_add)
return err;
- if (!tc_single_action(cls->exts))
+ if (!tcf_exts_has_one_action(cls->exts))
return err;
tcf_exts_to_list(cls->exts, &actions);
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 39da0c5..287ae6c 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -972,7 +972,7 @@ int tcf_exts_get_dev(struct net_device *dev, struct tcf_exts *exts,
const struct tc_action *a;
LIST_HEAD(actions);
- if (tc_no_actions(exts))
+ if (!tcf_exts_has_actions(exts))
return -EINVAL;
tcf_exts_to_list(exts, &actions);
--
2.9.3
^ permalink raw reply related
* [patch net-next 02/20] net: sched: remove unneeded tcf_em_tree_change
From: Jiri Pirko @ 2017-07-28 14:40 UTC (permalink / raw)
To: netdev; +Cc: davem, jhs, xiyou.wangcong, daniel, mlxsw
In-Reply-To: <20170728144042.6380-1-jiri@resnulli.us>
From: Jiri Pirko <jiri@mellanox.com>
Since tcf_em_tree_validate could be always called on a newly created
filter, there is no need for this change function.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
include/net/pkt_cls.h | 21 ---------------------
net/sched/cls_basic.c | 4 +---
net/sched/cls_cgroup.c | 4 +---
net/sched/cls_flow.c | 12 +++++-------
4 files changed, 7 insertions(+), 34 deletions(-)
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 537d0a0..f4462ec 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -333,26 +333,6 @@ int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *,
struct tcf_pkt_info *);
/**
- * tcf_em_tree_change - replace ematch tree of a running classifier
- *
- * @tp: classifier kind handle
- * @dst: destination ematch tree variable
- * @src: source ematch tree (temporary tree from tcf_em_tree_validate)
- *
- * This functions replaces the ematch tree in @dst with the ematch
- * tree in @src. The classifier in charge of the ematch tree may be
- * running.
- */
-static inline void tcf_em_tree_change(struct tcf_proto *tp,
- struct tcf_ematch_tree *dst,
- struct tcf_ematch_tree *src)
-{
- tcf_tree_lock(tp);
- memcpy(dst, src, sizeof(*dst));
- tcf_tree_unlock(tp);
-}
-
-/**
* tcf_em_tree_match - evaulate an ematch tree
*
* @skb: socket buffer of the packet in question
@@ -386,7 +366,6 @@ struct tcf_ematch_tree {
#define tcf_em_tree_validate(tp, tb, t) ((void)(t), 0)
#define tcf_em_tree_destroy(t) do { (void)(t); } while(0)
#define tcf_em_tree_dump(skb, t, tlv) (0)
-#define tcf_em_tree_change(tp, dst, src) do { } while(0)
#define tcf_em_tree_match(skb, t, info) ((void)(info), 1)
#endif /* CONFIG_NET_EMATCH */
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index c4fd63a..979cd26 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -130,7 +130,6 @@ static int basic_set_parms(struct net *net, struct tcf_proto *tp,
{
int err;
struct tcf_exts e;
- struct tcf_ematch_tree t;
err = tcf_exts_init(&e, TCA_BASIC_ACT, TCA_BASIC_POLICE);
if (err < 0)
@@ -139,7 +138,7 @@ static int basic_set_parms(struct net *net, struct tcf_proto *tp,
if (err < 0)
goto errout;
- err = tcf_em_tree_validate(tp, tb[TCA_BASIC_EMATCHES], &t);
+ err = tcf_em_tree_validate(tp, tb[TCA_BASIC_EMATCHES], &f->ematches);
if (err < 0)
goto errout;
@@ -149,7 +148,6 @@ static int basic_set_parms(struct net *net, struct tcf_proto *tp,
}
tcf_exts_change(tp, &f->exts, &e);
- tcf_em_tree_change(tp, &f->ematches, &t);
f->tp = tp;
return 0;
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 12ce547..ce7d38b 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -76,7 +76,6 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
struct nlattr *tb[TCA_CGROUP_MAX + 1];
struct cls_cgroup_head *head = rtnl_dereference(tp->root);
struct cls_cgroup_head *new;
- struct tcf_ematch_tree t;
struct tcf_exts e;
int err;
@@ -112,14 +111,13 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
goto errout;
}
- err = tcf_em_tree_validate(tp, tb[TCA_CGROUP_EMATCHES], &t);
+ err = tcf_em_tree_validate(tp, tb[TCA_CGROUP_EMATCHES], &new->ematches);
if (err < 0) {
tcf_exts_destroy(&e);
goto errout;
}
tcf_exts_change(tp, &new->exts, &e);
- tcf_em_tree_change(tp, &new->ematches, &t);
rcu_assign_pointer(tp->root, new);
if (head)
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c
index 3065752..71fd1af 100644
--- a/net/sched/cls_flow.c
+++ b/net/sched/cls_flow.c
@@ -389,7 +389,6 @@ static int flow_change(struct net *net, struct sk_buff *in_skb,
struct nlattr *opt = tca[TCA_OPTIONS];
struct nlattr *tb[TCA_FLOW_MAX + 1];
struct tcf_exts e;
- struct tcf_ematch_tree t;
unsigned int nkeys = 0;
unsigned int perturb_period = 0;
u32 baseclass = 0;
@@ -432,13 +431,13 @@ static int flow_change(struct net *net, struct sk_buff *in_skb,
if (err < 0)
goto err1;
- err = tcf_em_tree_validate(tp, tb[TCA_FLOW_EMATCHES], &t);
- if (err < 0)
- goto err1;
-
err = -ENOBUFS;
fnew = kzalloc(sizeof(*fnew), GFP_KERNEL);
if (!fnew)
+ goto err1;
+
+ err = tcf_em_tree_validate(tp, tb[TCA_FLOW_EMATCHES], &fnew->ematches);
+ if (err < 0)
goto err2;
err = tcf_exts_init(&fnew->exts, TCA_FLOW_ACT, TCA_FLOW_POLICE);
@@ -512,7 +511,6 @@ static int flow_change(struct net *net, struct sk_buff *in_skb,
(unsigned long)fnew);
tcf_exts_change(tp, &fnew->exts, &e);
- tcf_em_tree_change(tp, &fnew->ematches, &t);
netif_keep_dst(qdisc_dev(tp->q));
@@ -554,8 +552,8 @@ static int flow_change(struct net *net, struct sk_buff *in_skb,
err3:
tcf_exts_destroy(&fnew->exts);
+ tcf_em_tree_destroy(&fnew->ematches);
err2:
- tcf_em_tree_destroy(&t);
kfree(fnew);
err1:
tcf_exts_destroy(&e);
--
2.9.3
^ permalink raw reply related
* [patch net-next 01/20] net: sched: sch_atm: use Qdisc_class_common structure
From: Jiri Pirko @ 2017-07-28 14:40 UTC (permalink / raw)
To: netdev; +Cc: davem, jhs, xiyou.wangcong, daniel, mlxsw
In-Reply-To: <20170728144042.6380-1-jiri@resnulli.us>
From: Jiri Pirko <jiri@mellanox.com>
Even if it is only for classid now, use this common struct a be aligned
with the rest of the classful qdiscs.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
net/sched/sch_atm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index 572fe25..0af4b1c 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -41,6 +41,7 @@
#define VCC2FLOW(vcc) ((struct atm_flow_data *) ((vcc)->user_back))
struct atm_flow_data {
+ struct Qdisc_class_common common;
struct Qdisc *q; /* FIFO, TBF, etc. */
struct tcf_proto __rcu *filter_list;
struct tcf_block *block;
@@ -49,7 +50,6 @@ struct atm_flow_data {
struct sk_buff *skb); /* chaining */
struct atm_qdisc_data *parent; /* parent qdisc */
struct socket *sock; /* for closing */
- u32 classid; /* x:y type ID */
int ref; /* reference count */
struct gnet_stats_basic_packed bstats;
struct gnet_stats_queue qstats;
@@ -75,7 +75,7 @@ static inline struct atm_flow_data *lookup_flow(struct Qdisc *sch, u32 classid)
struct atm_flow_data *flow;
list_for_each_entry(flow, &p->flows, list) {
- if (flow->classid == classid)
+ if (flow->common.classid == classid)
return flow;
}
return NULL;
@@ -293,7 +293,7 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
flow->old_pop = flow->vcc->pop;
flow->parent = p;
flow->vcc->pop = sch_atm_pop;
- flow->classid = classid;
+ flow->common.classid = classid;
flow->ref = 1;
flow->excess = excess;
list_add(&flow->list, &p->link.list);
@@ -549,7 +549,7 @@ static int atm_tc_init(struct Qdisc *sch, struct nlattr *opt)
p->link.vcc = NULL;
p->link.sock = NULL;
- p->link.classid = sch->handle;
+ p->link.common.classid = sch->handle;
p->link.ref = 1;
tasklet_init(&p->task, sch_atm_dequeue, (unsigned long)sch);
return 0;
@@ -594,7 +594,7 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl,
sch, p, flow, skb, tcm);
if (list_empty(&flow->list))
return -EINVAL;
- tcm->tcm_handle = flow->classid;
+ tcm->tcm_handle = flow->common.classid;
tcm->tcm_info = flow->q->handle;
nest = nla_nest_start(skb, TCA_OPTIONS);
@@ -619,7 +619,7 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl,
goto nla_put_failure;
}
if (flow->excess) {
- if (nla_put_u32(skb, TCA_ATM_EXCESS, flow->classid))
+ if (nla_put_u32(skb, TCA_ATM_EXCESS, flow->common.classid))
goto nla_put_failure;
} else {
if (nla_put_u32(skb, TCA_ATM_EXCESS, 0))
--
2.9.3
^ permalink raw reply related
* [patch net-next 00/20] net: sched: summer cleanup part 1, mainly in exts area
From: Jiri Pirko @ 2017-07-28 14:40 UTC (permalink / raw)
To: netdev; +Cc: davem, jhs, xiyou.wangcong, daniel, mlxsw
From: Jiri Pirko <jiri@mellanox.com>
This patchset is one of the couple cleanup patchsets I have in queue.
The motivation aside the obvious need to "make things nicer" is also
to prepare for shared filter blocks introduction. That requires tp->q
removal, and therefore removal of all tp->q users.
Patch 1 is just some small thing I spotted on the way
Patch 2 removes one user of tp->q, namely tcf_em_tree_change
Patches 3-8 do preparations for exts->nr_actions removal
Patch 9 does the conversion of action array into rcuized list. This is also
one tp->q user removal.
Patches 10-11 do simple renames of functions in cls*
The rest of the patches remove unnecessary calls of tcf_exts_change helper.
Tested by tools/testing/selftests/tc-testing
Jiri Pirko (20):
net: sched: sch_atm: use Qdisc_class_common structure
net: sched: remove unneeded tcf_em_tree_change
net: sched: change names of action number helpers to be aligned with
the rest
net: sched: use tcf_exts_has_actions in tcf_exts_exec
net: sched: remove redundant helpers tcf_exts_is_predicative and
tcf_exts_is_available
net: sched: fix return value of tcf_exts_exec
net: sched: remove check for number of actions in tcf_exts_exec
net: sched: use tcf_exts_has_actions instead of exts->nr_actions
net: sched: convert actions array into rcu list
net: sched: cls_bpf: rename cls_bpf_modify_existing function
net: sched: cls_fw: rename fw_change_attrs function
net: sched: cls_flower: no need to call tcf_exts_change for newly
allocated struct
net: sched: cls_fw: no need to call tcf_exts_change for newly
allocated struct
net: sched: cls_matchall: no need to call tcf_exts_change for newly
allocated struct
net: sched: cls_basic: no need to call tcf_exts_change for newly
allocated struct
net: sched: cls_bpf: no need to call tcf_exts_change for newly
allocated struct
net: sched: cls_cgroup: no need to call tcf_exts_change for newly
allocated struct
net: sched: cls_flow: no need to call tcf_exts_change for newly
allocated struct
net: sched: cls_route: no need to call tcf_exts_change for newly
allocated struct
net: sched: cls_u32: no need to call tcf_exts_change for newly
allocated struct
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 +-
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +-
.../net/ethernet/mellanox/mlxsw/spectrum_flower.c | 2 +-
drivers/net/ethernet/netronome/nfp/bpf/offload.c | 4 +-
include/net/act_api.h | 11 +-
include/net/pkt_cls.h | 143 ++++++++-------------
net/dsa/slave.c | 2 +-
net/sched/act_api.c | 17 ++-
net/sched/cls_api.c | 35 +++--
net/sched/cls_basic.c | 21 +--
net/sched/cls_bpf.c | 39 ++----
net/sched/cls_cgroup.c | 22 +---
net/sched/cls_flow.c | 48 +++----
net/sched/cls_flower.c | 17 +--
net/sched/cls_fw.c | 44 ++-----
net/sched/cls_matchall.c | 19 +--
net/sched/cls_route.c | 36 ++----
net/sched/cls_rsvp.h | 18 +--
net/sched/cls_tcindex.c | 55 +++-----
net/sched/cls_u32.c | 27 +---
net/sched/sch_atm.c | 12 +-
23 files changed, 192 insertions(+), 390 deletions(-)
--
2.9.3
^ permalink raw reply
* Re: [PATCH 0/3] net-next: stmmac: support future possible different internal phy mode
From: Andrew Lunn @ 2017-07-28 14:36 UTC (permalink / raw)
To: Corentin Labbe
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, wens-jdAy2FN1RRM,
linux-I+IVW8TIWO2tmTQ+vhA3Yw, peppe.cavallaro-qxv4g6HH51o,
alexandre.torgue-qxv4g6HH51o, devicetree-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
icenowy-h8G6r0blFSE
In-Reply-To: <20170728142508.GA7221@Red>
> > I've probably asked this before: Does the internal PHY use a different
> > PHY ID in registers 2 and 3?
> >
>
> yes
>
> reg2: 0x0044
> reg3: 0X1500
So this is not about loading the correct PHY driver. You can already
do this based on the PHY IDs...
This is about selecting which PHY to use. Internal or External?
Andrew
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 0/3] net-next: stmmac: support future possible different internal phy mode
From: Corentin Labbe @ 2017-07-28 14:25 UTC (permalink / raw)
To: Andrew Lunn
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, wens-jdAy2FN1RRM,
linux-I+IVW8TIWO2tmTQ+vhA3Yw, peppe.cavallaro-qxv4g6HH51o,
alexandre.torgue-qxv4g6HH51o, devicetree-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
icenowy-h8G6r0blFSE
In-Reply-To: <20170728135544.GD32230-g2DYL2Zd6BY@public.gmane.org>
On Fri, Jul 28, 2017 at 03:55:44PM +0200, Andrew Lunn wrote:
> On Fri, Jul 28, 2017 at 11:28:15AM +0200, Corentin Labbe wrote:
> > Hello
> >
> > The current way to find if the phy is internal is to compare DT phy-mode
> > and emac_variant/internal_phy.
> > But it will negate a possible future SoC where an external PHY use the
> > same phy mode than the internal one.
> >
> > This patchs series adds a new way to find if the PHY is internal, via its
> > compatible.
>
> http://elixir.free-electrons.com/linux/latest/source/drivers/of/of_mdio.c#L144
>
> Since you also have "ethernet-phy-ieee802.3-c22", you won't get the
> warning. But still, your device tree gives the wrong idea.
>
> I've probably asked this before: Does the internal PHY use a different
> PHY ID in registers 2 and 3?
>
yes
reg2: 0x0044
reg3: 0X1500
Regards
^ permalink raw reply
* Re: [PATCH net] xgene: Don't fail probe, if there is no clk resource for SGMII interfaces
From: Tom Bogendoerfer @ 2017-07-28 14:23 UTC (permalink / raw)
To: Laura Abbott; +Cc: isubramanian, kchudgar, qnguyen, netdev, linux-kernel
In-Reply-To: <1b3391f2-2fae-2a9a-719d-3f8358e39c71@redhat.com>
On Thu, Jul 27, 2017 at 03:39:58PM -0700, Laura Abbott wrote:
> I don't know the intricacies of the Mustang hardware but external
> aborts have been a symptom of missing clocks on other hardware.
you are right, it's a missing clock. For SGMII ports the driver
doesn't really use the clock source other then doing the one
devm_clk_get(), but this is enough to get the clock going.
Below patch fixes the crash and brings back the second SGMII port
(even without a clock source in device tree, I guess it uses clock
from first port). From a correctness standpoint there should probably
be a clk_prepare_enable(), if port is SGMII.
Could you test the patch ? If it works, I'll submit it.
Thomas.
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index 86058a9f3417..1d307f2def2d 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -1785,9 +1785,9 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
xgene_enet_gpiod_get(pdata);
- if (pdata->phy_mode != PHY_INTERFACE_MODE_SGMII) {
- pdata->clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(pdata->clk)) {
+ pdata->clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(pdata->clk)) {
+ if (pdata->phy_mode != PHY_INTERFACE_MODE_SGMII) {
/* Abort if the clock is defined but couldn't be
* retrived. Always abort if the clock is missing on
* DT system as the driver can't cope with this case.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply related
* Re: [PATCH net-next v11 1/4] net netlink: Add new type NLA_BITFIELD_32
From: David Ahern @ 2017-07-28 14:19 UTC (permalink / raw)
To: Jamal Hadi Salim, davem
Cc: netdev, jiri, xiyou.wangcong, eric.dumazet, mrv, simon.horman,
alex.aring
In-Reply-To: <7c17a575-53bb-1f25-4a9a-7418f99660f2@mojatatu.com>
On 7/28/17 7:51 AM, Jamal Hadi Salim wrote:
> On 17-07-25 10:41 AM, David Ahern wrote:
>> On 7/23/17 7:35 PM, Jamal Hadi Salim wrote:
>>> In the most basic form, the user specifies the attribute policy as:
>>> [ATTR_GOO] = { .type = NLA_BITFIELD_32, .validation_data =
>>> &myvalidflags },
>>>
>>> where myvalidflags is the bit mask of the flags the kernel understands.
>>>
>>> If the user _does not_ provide myvalidflags then the attribute will
>>> also be rejected.
>>
>> No other netlink attribute has this requirement.
>
> This is the first one where we have to inspect content. We add things
> when we need them - as in this case.
Sure, the validation is required. My argument is that the validation
should be done where other attributes are validated -- inline with its
use. Nothing about this new bitfield says it must have a generic
validation code.
>
>> Users of the attributes
>> are the only ones that know if a value is valid or not (e.g, attribute
>> passing a device index) and those are always checked in line.
>
> It doesnt make sense that every user of the API has to repeat that
> validation code. Same principle as someone specifying that a type is
> u32 and have the nla validation check it. At some point we never had
> the u32 validation code. Then it was factored out because everyone
> repeats the same boilerplate code.
Every user of an attribute that uses a device index must verify the
device index is valid. The same code is repeated over and over.
Now you are suggesting to have 1 attribute whose content is validated by
generic infra and the rest are validated inline by the code using it. I
believe it is wrong and going to lead to problems.
^ permalink raw reply
* Re: [RFC] switchdev: generate phys_port_name in the core
From: Andrew Lunn @ 2017-07-28 14:13 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Or Gerlitz, Jiri Pirko, netdev, Or Gerlitz, Michael Chan,
Sathya Perla, David Miller, simon.horman
In-Reply-To: <20170728023122.1674-1-jakub.kicinski@netronome.com>
On Thu, Jul 27, 2017 at 07:31:22PM -0700, Jakub Kicinski wrote:
> On Thu, 27 Jul 2017 13:30:44 +0300, Or Gerlitz wrote:
> > > want to add port splitting support, for example, reporting the name on
> > > physical ports will become more of a necessity.
> >
> > > If we adopt Jiri's suggestion of returning structured data it will be
> > > very easy to give user space type and indexes separately, but we should
> > > probably still return the string for backwards compatibility.
> >
> > I am not still clear how the structured data would look like
>
> I decided to just quickly write the code, that should be easier to
> understand. We can probably leave out the netlink part of the API
> if there is no need for it right now, but that's what I ment by
> returning the information in a more structured way.
>
> Tested-by: nobody :)
> Suggested-by: Jiri (if I understood correctly)
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 8 ++-
> drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 10 ++--
> drivers/net/ethernet/netronome/nfp/nfp_port.c | 26 ++++-----
> drivers/net/ethernet/netronome/nfp/nfp_port.h | 4 +-
> include/linux/netdevice.h | 18 ++++++-
> include/uapi/linux/if_link.h | 16 ++++++
> net/core/dev.c | 31 +++++++++--
> net/core/rtnetlink.c | 69 ++++++++++++++++++++++++
Hi Jakub
Don't forget net/dsa/slave.c when you go from RFC to a real patch for
submission.
Andrew
^ permalink raw reply
* Re: [PATCH net-next v11 3/4] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
From: Jiri Pirko @ 2017-07-28 14:12 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: davem, netdev, xiyou.wangcong, dsahern, eric.dumazet, mrv,
simon.horman, alex.aring
In-Reply-To: <27472f41-1dd3-66a0-d4fc-6b7290c14b27@mojatatu.com>
Fri, Jul 28, 2017 at 03:41:44PM CEST, jhs@mojatatu.com wrote:
>On 17-07-25 08:37 AM, Jiri Pirko wrote:
>> Tue, Jul 25, 2017 at 02:34:58PM CEST, jhs@mojatatu.com wrote:
>> > On 17-07-25 07:33 AM, Jiri Pirko wrote:
>> > > Tue, Jul 25, 2017 at 01:22:44PM CEST, jhs@mojatatu.com wrote:
>
>[..]
>> > > What if I pass val 0x1 and selector 0x0 from userspace. I don't have the
>> > > bit selected, so you should not process it in kernel, no?
>> > >
>> >
>> > Yes, valid point. I am not sure - should we reject?
>>
>> I think that the validation might check this and reject. Makes sense to
>> me.
>>
>
>How does this look? I havent tested it but covers all angles
Looks like a big mess to be honest. Mixing up u32* u32 void*. I don't
understand ****. Would be probably good to first apply my review comment
on the function itselt, then to add the checks :)
>I can think of.
>
>static int validate_nla_bitfield32(const struct nlattr *nla,
> void *valid_flags_allowed)
>{
> const struct nla_bitfield32 *bf = nla_data(nla);
> u32 *valid_flags_mask = valid_flags_allowed;
>
> if (!valid_flags_allowed)
> return -EINVAL;
> /*disallow invalid selector */
> if ((bf->selector & valid_flags_allowed) >*valid_flags_allowed)
> return -EINVAL;
> /*disallow invalid bit values */
> if (bf->value & ~*valid_flags_mask)
> return -EINVAL;
> /*disallow valid bit values that are not selected*/
> if (bf->value & ~nbf->selector)
> return -EINVAL;
>
> return 0;
>}
>
>cheers,
>jamal
^ permalink raw reply
* Re: [PATCH net-next v11 1/4] net netlink: Add new type NLA_BITFIELD_32
From: Jiri Pirko @ 2017-07-28 14:08 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: David Ahern, davem, netdev, xiyou.wangcong, eric.dumazet, mrv,
simon.horman, alex.aring
In-Reply-To: <7c17a575-53bb-1f25-4a9a-7418f99660f2@mojatatu.com>
Fri, Jul 28, 2017 at 03:51:41PM CEST, jhs@mojatatu.com wrote:
>On 17-07-25 10:41 AM, David Ahern wrote:
>> On 7/23/17 7:35 PM, Jamal Hadi Salim wrote:
>> > In the most basic form, the user specifies the attribute policy as:
>> > [ATTR_GOO] = { .type = NLA_BITFIELD_32, .validation_data = &myvalidflags },
>> >
>> > where myvalidflags is the bit mask of the flags the kernel understands.
>> >
>> > If the user _does not_ provide myvalidflags then the attribute will
>> > also be rejected.
>>
>> No other netlink attribute has this requirement.
>
>This is the first one where we have to inspect content. We add things
>when we need them - as in this case.
>
>> Users of the attributes
>> are the only ones that know if a value is valid or not (e.g, attribute
>> passing a device index) and those are always checked in line.
>
>It doesnt make sense that every user of the API has to repeat that
>validation code. Same principle as someone specifying that a type is
>u32 and have the nla validation check it. At some point we never had
>the u32 validation code. Then it was factored out because everyone
>repeats the same boilerplate code.
>I see this in the same spirit.
Agreed.
^ permalink raw reply
* Re: pull-request: wireless-drivers-next 2017-07-28
From: Kalle Valo @ 2017-07-28 14:05 UTC (permalink / raw)
To: David Miller
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
In-Reply-To: <87h8xwvevj.fsf@kamboji.qca.qualcomm.com>
Kalle Valo <kvalo@codeaurora.org> writes:
> Hi Dave,
>
> here's a pull request for net, more info the signed tag below. Please
> let me know if there are any problems.
>
> Kalle
>
> The following changes since commit d755cbc26e8295ae8e5d30425364e093b4247a85:
>
> Merge tag 'iwlwifi-for-kalle-2017-07-21' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes (2017-07-21 14:33:27 +0300)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git tags/wireless-drivers-for-davem-2017-07-28
Argh, the subject is of course wrong and it should be:
pull-request: wireless-drivers 2017-07-28
So this pull request is for net tree to get these two brcmfmac fixes to
4.13. Otherwise the pull request is correct so I don't submit a new one
(but let me know if you prefer that).
--
Kalle Valo
^ permalink raw reply
* pull-request: wireless-drivers-next 2017-07-28
From: Kalle Valo @ 2017-07-28 14:02 UTC (permalink / raw)
To: David Miller; +Cc: linux-wireless, netdev, linux-kernel
Hi Dave,
here's a pull request for net, more info the signed tag below. Please
let me know if there are any problems.
Kalle
The following changes since commit d755cbc26e8295ae8e5d30425364e093b4247a85:
Merge tag 'iwlwifi-for-kalle-2017-07-21' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes (2017-07-21 14:33:27 +0300)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git tags/wireless-drivers-for-davem-2017-07-28
for you to fetch changes up to 5f5d03143de5e0c593da4ab18fc6393c2815e108:
brcmfmac: fix memleak due to calling brcmf_sdiod_sgtable_alloc() twice (2017-07-27 14:03:14 +0300)
----------------------------------------------------------------
wireless-drivers fixes for 4.13
Two fixes for for brcmfmac, the crash was reported by two people
already so it's a high priority fix.
brcmfmac
* fix a crash in skb headroom handling in v4.13-rc1
* fix a memory leak due to a merge error in v4.6
----------------------------------------------------------------
Arend Van Spriel (1):
brcmfmac: fix memleak due to calling brcmf_sdiod_sgtable_alloc() twice
Daniel Stone (1):
brcmfmac: Don't grow SKB by negative size
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 2 +-
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 5 -----
2 files changed, 1 insertion(+), 6 deletions(-)
^ permalink raw reply
* Re: [PATCH 0/3] net-next: stmmac: support future possible different internal phy mode
From: Andrew Lunn @ 2017-07-28 13:55 UTC (permalink / raw)
To: Corentin Labbe
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, wens-jdAy2FN1RRM,
linux-I+IVW8TIWO2tmTQ+vhA3Yw, peppe.cavallaro-qxv4g6HH51o,
alexandre.torgue-qxv4g6HH51o, devicetree-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
icenowy-h8G6r0blFSE
In-Reply-To: <20170728092818.23419-1-clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Fri, Jul 28, 2017 at 11:28:15AM +0200, Corentin Labbe wrote:
> Hello
>
> The current way to find if the phy is internal is to compare DT phy-mode
> and emac_variant/internal_phy.
> But it will negate a possible future SoC where an external PHY use the
> same phy mode than the internal one.
>
> This patchs series adds a new way to find if the PHY is internal, via its
> compatible.
http://elixir.free-electrons.com/linux/latest/source/drivers/of/of_mdio.c#L144
Since you also have "ethernet-phy-ieee802.3-c22", you won't get the
warning. But still, your device tree gives the wrong idea.
I've probably asked this before: Does the internal PHY use a different
PHY ID in registers 2 and 3?
Andrew
^ permalink raw reply
* Re: [PATCH net-next v11 1/4] net netlink: Add new type NLA_BITFIELD_32
From: Jamal Hadi Salim @ 2017-07-28 13:51 UTC (permalink / raw)
To: David Ahern, davem
Cc: netdev, jiri, xiyou.wangcong, eric.dumazet, mrv, simon.horman,
alex.aring
In-Reply-To: <1a2578ca-35c6-884e-1daf-fcc47e5eb618@gmail.com>
On 17-07-25 10:41 AM, David Ahern wrote:
> On 7/23/17 7:35 PM, Jamal Hadi Salim wrote:
>> In the most basic form, the user specifies the attribute policy as:
>> [ATTR_GOO] = { .type = NLA_BITFIELD_32, .validation_data = &myvalidflags },
>>
>> where myvalidflags is the bit mask of the flags the kernel understands.
>>
>> If the user _does not_ provide myvalidflags then the attribute will
>> also be rejected.
>
> No other netlink attribute has this requirement.
This is the first one where we have to inspect content. We add things
when we need them - as in this case.
> Users of the attributes
> are the only ones that know if a value is valid or not (e.g, attribute
> passing a device index) and those are always checked in line.
It doesnt make sense that every user of the API has to repeat that
validation code. Same principle as someone specifying that a type is
u32 and have the nla validation check it. At some point we never had
the u32 validation code. Then it was factored out because everyone
repeats the same boilerplate code.
I see this in the same spirit.
> Furthermore, you are locking this attribute into a static meaning of
> what is a valid value when flags can be valid or invalid based on other
> attributes passed in the request.
>
That doesnt disqualify that i factored out common code that all users
of this nltype are going to cutnpaste.
On the dependency on bit presence topic: I had added an "extra
validation" ops - but it was distracting enough that i removed that
patch altogether.
cheers,
jamal
^ permalink raw reply
* Re: [PATCH 0/3] net-next: stmmac: support future possible different internal phy mode
From: Andrew Lunn @ 2017-07-28 13:47 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Corentin Labbe, Mark Rutland, devicetree,
alexandre.torgue-qxv4g6HH51o, netdev, linux-sunxi, Russell King,
linux-kernel, Rob Herring, Giuseppe Cavallaro, Maxime Ripard,
linux-arm-kernel, Icenowy Zheng
In-Reply-To: <CAGb2v66=h_5df=B0Us-kvvFg9r_qSUroDzn-xvQLSpD1d8DhBQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Fri, Jul 28, 2017 at 05:53:40PM +0800, Chen-Yu Tsai wrote:
> On Fri, Jul 28, 2017 at 5:28 PM, Corentin Labbe
> <clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > Hello
> >
> > The current way to find if the phy is internal is to compare DT phy-mode
> > and emac_variant/internal_phy.
> > But it will negate a possible future SoC where an external PHY use the
> > same phy mode than the internal one.
> >
> > This patchs series adds a new way to find if the PHY is internal, via its
> > compatible.
>
> You've already joined in on the discussion for the patch "net: stmmac:
> dwmac-rk: Add internal phy support". It is pretty much the same issue.
> Please wait for it to come to a proper conclusion. At least then we can
> agree on something so different platforms with the same problem don't
> have diverging solutions.
Yes, this is important.
Andrew
^ permalink raw reply
* Re: [PATCH net-next v11 3/4] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
From: Jamal Hadi Salim @ 2017-07-28 13:41 UTC (permalink / raw)
To: Jiri Pirko
Cc: davem, netdev, xiyou.wangcong, dsahern, eric.dumazet, mrv,
simon.horman, alex.aring
In-Reply-To: <20170725123728.GC3186@nanopsycho>
On 17-07-25 08:37 AM, Jiri Pirko wrote:
> Tue, Jul 25, 2017 at 02:34:58PM CEST, jhs@mojatatu.com wrote:
>> On 17-07-25 07:33 AM, Jiri Pirko wrote:
>>> Tue, Jul 25, 2017 at 01:22:44PM CEST, jhs@mojatatu.com wrote:
[..]
>>> What if I pass val 0x1 and selector 0x0 from userspace. I don't have the
>>> bit selected, so you should not process it in kernel, no?
>>>
>>
>> Yes, valid point. I am not sure - should we reject?
>
> I think that the validation might check this and reject. Makes sense to
> me.
>
How does this look? I havent tested it but covers all angles
I can think of.
static int validate_nla_bitfield32(const struct nlattr *nla,
void *valid_flags_allowed)
{
const struct nla_bitfield32 *bf = nla_data(nla);
u32 *valid_flags_mask = valid_flags_allowed;
if (!valid_flags_allowed)
return -EINVAL;
/*disallow invalid selector */
if ((bf->selector & valid_flags_allowed) >*valid_flags_allowed)
return -EINVAL;
/*disallow invalid bit values */
if (bf->value & ~*valid_flags_mask)
return -EINVAL;
/*disallow valid bit values that are not selected*/
if (bf->value & ~nbf->selector)
return -EINVAL;
return 0;
}
cheers,
jamal
^ permalink raw reply
* Re: [PATCH net-next v2 01/10] net: dsa: lan9303: Fixed MDIO interface
From: Andrew Lunn @ 2017-07-28 13:36 UTC (permalink / raw)
To: Egil Hjelmeland
Cc: corbet, vivien.didelot, f.fainelli, davem, kernel, linux-doc,
linux-kernel, netdev
In-Reply-To: <4e36827f-fdcc-d55a-3559-e080883c715c@egil-hjelmeland.no>
On Fri, Jul 28, 2017 at 01:08:25PM +0200, Egil Hjelmeland wrote:
> On 26. juli 2017 18:55, Andrew Lunn wrote:
> >On Tue, Jul 25, 2017 at 06:15:44PM +0200, Egil Hjelmeland wrote:
> >It is better to use mdiobus_read/write or if you are nesting mdio
> >busses, mdiobus_read_nested/mdiobus_write_nested. Please test this
> >code with lockdep enabled.
> >
>
> I have CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_MUTEXES. Should I enable
> more?
Hi Egil
Enable CONFIG_LOCKDEP and CONFIG_PROVE_LOCKING.
Any lockdep splat you get while accessing the mdio bus at this point
are probably false positives, since it is a different mutex. Using the
_nested() version should avoid these false positives. But you might
find other places your locking is not right.
Andrew
^ permalink raw reply
* [PATCH v3] ARM: dts: tango4: Request RGMII RX and TX clock delays
From: Marc Gonzalez @ 2017-07-28 13:27 UTC (permalink / raw)
To: arm-soc; +Cc: Florian Fainelli, Mans Rullgard, Mason, netdev, Linux ARM
RX and TX clock delays are required. Request them explicitly.
Fixes: cad008b8a77e6 ("ARM: dts: tango4: Initial device trees")
Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
---
Arnd, Kevin, Olof, can one of you take this patch through arm-soc?
Greg will apply it to all stable branches, right?
---
arch/arm/boot/dts/tango4-vantage-1172.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/tango4-vantage-1172.dts b/arch/arm/boot/dts/tango4-vantage-1172.dts
index 86d8df98802f..13bcc460bcb2 100644
--- a/arch/arm/boot/dts/tango4-vantage-1172.dts
+++ b/arch/arm/boot/dts/tango4-vantage-1172.dts
@@ -22,7 +22,7 @@
};
ð0 {
- phy-connection-type = "rgmii";
+ phy-connection-type = "rgmii-id";
phy-handle = <ð0_phy>;
#address-cells = <1>;
#size-cells = <0>;
--
2.11.0
^ permalink raw reply related
* Re: Performance regression with virtio_net
From: Seth Forshee @ 2017-07-28 13:12 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: Jason Wang, virtualization, netdev
In-Reply-To: <20170728002913-mutt-send-email-mst@kernel.org>
On Fri, Jul 28, 2017 at 12:30:54AM +0300, Michael S. Tsirkin wrote:
> On Thu, Jul 27, 2017 at 04:14:30PM -0500, Seth Forshee wrote:
> > On Thu, Jul 27, 2017 at 11:38:52PM +0300, Michael S. Tsirkin wrote:
> > > On Thu, Jul 27, 2017 at 12:09:42PM -0500, Seth Forshee wrote:
> > > > I'm seeing a performance regression with virtio_net that looks to have
> > > > started in 4.12-rc1. I only see it in one context though, downloading
> > > > snap packages from the Ubuntu snap store. For example:
> > > >
> > > > https://api.snapcraft.io/api/v1/snaps/download/b8X2psL1ryVrPt5WEmpYiqfr5emixTd7_1797.snap
> > > >
> > > > which redirects to Internap's CDN. Normally this downloads in a few
> > > > seconds at ~10 MB/s, but with 4.12 and 4.13 it takes minutes with a rate
> > > > of ~150 KB/s. Everything else I've tried downloads as normal speeds.
> > >
> > > So just wget that URL should be enough?
> >
> > Yes. Note that sometimes it starts out faster then slows down.
> > > > I bisected this to 680557cf79f8 "virtio_net: rework mergeable buffer
> > > > handling". If I revert this on top of 4.13-rc2 (along with other changes
> > > > needed to successfully revert it) speeds return to normal.
> > > >
> > > > Thanks,
> > > > Seth
> > >
> > >
> > > Interesting. A more likely suspect would be
> > > e377fcc8486d40867c6c217077ad0fa40977e060 - could you please try
> > > reverting that one instead?
> >
> > I tried it, and I still get slow download speeds. I did test at
> > 680557cf79f82623e2c4fd42733077d60a843513 during the bisect so I'm
> > reasonably confident that this is the one where things went bad.
> > > Also, could you please look at mergeable_rx_buffer_size in sysfs with
> > > and without the change?
> >
> > In all cases (stock 4.13-rc2, 680557cf79f8 reverted, and e377fcc8486d
> > reverted) mergeable_rx_buffer_size was 1536.
> >
> > Thanks,
> > Seth
>
> Do you see any error counters incrementing after it slows down?
I see rx_dropped and rx_length_errors increasing in lockstep once it
slows down.
Thanks,
Seth
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox