Netdev List
 help / color / mirror / Atom feed
* Re: [Patch net-next v3 3/5] net_sched: act: move tcf_hashinfo_init() into tcf_register_action()
From: Jamal Hadi Salim @ 2014-02-12 12:44 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: David S. Miller
In-Reply-To: <1392167255-21744-4-git-send-email-xiyou.wangcong@gmail.com>

On 02/11/14 20:07, Cong Wang wrote:
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>


Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>

> ---
>   include/net/act_api.h   |  2 +-
>   net/sched/act_api.c     | 16 +++++++++++++++-
>   net/sched/act_csum.c    |  8 +-------
>   net/sched/act_gact.c    |  8 +-------
>   net/sched/act_ipt.c     | 14 +++-----------
>   net/sched/act_mirred.c  | 10 +---------
>   net/sched/act_nat.c     |  9 +--------
>   net/sched/act_pedit.c   |  9 +--------
>   net/sched/act_police.c  | 13 ++-----------
>   net/sched/act_simple.c  | 14 ++------------
>   net/sched/act_skbedit.c |  8 +-------
>   11 files changed, 29 insertions(+), 82 deletions(-)
>
> diff --git a/include/net/act_api.h b/include/net/act_api.h
> index 3d22f42..969cac6 100644
> --- a/include/net/act_api.h
> +++ b/include/net/act_api.h
> @@ -107,7 +107,7 @@ int tcf_hash_create(u32 index, struct nlattr *est, struct tc_action *a,
>   void tcf_hash_cleanup(struct tc_action *a, struct nlattr *est);
>   void tcf_hash_insert(struct tc_action *a);
>
> -int tcf_register_action(struct tc_action_ops *a);
> +int tcf_register_action(struct tc_action_ops *a, unsigned int mask);
>   int tcf_unregister_action(struct tc_action_ops *a);
>   void tcf_action_destroy(struct list_head *actions, int bind);
>   int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions,
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index a5bf935..c88d382 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -275,9 +275,10 @@ EXPORT_SYMBOL(tcf_hash_insert);
>   static LIST_HEAD(act_base);
>   static DEFINE_RWLOCK(act_mod_lock);
>
> -int tcf_register_action(struct tc_action_ops *act)
> +int tcf_register_action(struct tc_action_ops *act, unsigned int mask)
>   {
>   	struct tc_action_ops *a;
> +	int err;
>
>   	/* Must supply act, dump and init */
>   	if (!act->act || !act->dump || !act->init)
> @@ -289,10 +290,21 @@ int tcf_register_action(struct tc_action_ops *act)
>   	if (!act->walk)
>   		act->walk = tcf_generic_walker;
>
> +	act->hinfo = kmalloc(sizeof(struct tcf_hashinfo), GFP_KERNEL);
> +	if (!act->hinfo)
> +		return -ENOMEM;
> +	err = tcf_hashinfo_init(act->hinfo, mask);
> +	if (err) {
> +		kfree(act->hinfo);
> +		return err;
> +	}
> +
>   	write_lock(&act_mod_lock);
>   	list_for_each_entry(a, &act_base, head) {
>   		if (act->type == a->type || (strcmp(act->kind, a->kind) == 0)) {
>   			write_unlock(&act_mod_lock);
> +			tcf_hashinfo_destroy(act->hinfo);
> +			kfree(act->hinfo);
>   			return -EEXIST;
>   		}
>   	}
> @@ -311,6 +323,8 @@ int tcf_unregister_action(struct tc_action_ops *act)
>   	list_for_each_entry(a, &act_base, head) {
>   		if (a == act) {
>   			list_del(&act->head);
> +			tcf_hashinfo_destroy(act->hinfo);
> +			kfree(act->hinfo);
>   			err = 0;
>   			break;
>   		}
> diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c
> index 8df3060..edbf40d 100644
> --- a/net/sched/act_csum.c
> +++ b/net/sched/act_csum.c
> @@ -37,7 +37,6 @@
>   #include <net/tc_act/tc_csum.h>
>
>   #define CSUM_TAB_MASK 15
> -static struct tcf_hashinfo csum_hash_info;
>
>   static const struct nla_policy csum_policy[TCA_CSUM_MAX + 1] = {
>   	[TCA_CSUM_PARMS] = { .len = sizeof(struct tc_csum), },
> @@ -561,7 +560,6 @@ nla_put_failure:
>
>   static struct tc_action_ops act_csum_ops = {
>   	.kind		= "csum",
> -	.hinfo		= &csum_hash_info,
>   	.type		= TCA_ACT_CSUM,
>   	.owner		= THIS_MODULE,
>   	.act		= tcf_csum,
> @@ -574,11 +572,7 @@ MODULE_LICENSE("GPL");
>
>   static int __init csum_init_module(void)
>   {
> -	int err = tcf_hashinfo_init(&csum_hash_info, CSUM_TAB_MASK);
> -	if (err)
> -		return err;
> -
> -	return tcf_register_action(&act_csum_ops);
> +	return tcf_register_action(&act_csum_ops, CSUM_TAB_MASK);
>   }
>
>   static void __exit csum_cleanup_module(void)
> diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
> index 094a1b5..d6bcbd9 100644
> --- a/net/sched/act_gact.c
> +++ b/net/sched/act_gact.c
> @@ -24,7 +24,6 @@
>   #include <net/tc_act/tc_gact.h>
>
>   #define GACT_TAB_MASK	15
> -static struct tcf_hashinfo gact_hash_info;
>
>   #ifdef CONFIG_GACT_PROB
>   static int gact_net_rand(struct tcf_gact *gact)
> @@ -180,7 +179,6 @@ nla_put_failure:
>
>   static struct tc_action_ops act_gact_ops = {
>   	.kind		=	"gact",
> -	.hinfo		=	&gact_hash_info,
>   	.type		=	TCA_ACT_GACT,
>   	.owner		=	THIS_MODULE,
>   	.act		=	tcf_gact,
> @@ -194,21 +192,17 @@ MODULE_LICENSE("GPL");
>
>   static int __init gact_init_module(void)
>   {
> -	int err = tcf_hashinfo_init(&gact_hash_info, GACT_TAB_MASK);
> -	if (err)
> -		return err;
>   #ifdef CONFIG_GACT_PROB
>   	pr_info("GACT probability on\n");
>   #else
>   	pr_info("GACT probability NOT on\n");
>   #endif
> -	return tcf_register_action(&act_gact_ops);
> +	return tcf_register_action(&act_gact_ops, GACT_TAB_MASK);
>   }
>
>   static void __exit gact_cleanup_module(void)
>   {
>   	tcf_unregister_action(&act_gact_ops);
> -	tcf_hashinfo_destroy(&gact_hash_info);
>   }
>
>   module_init(gact_init_module);
> diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
> index 71f29f1..8a64a07 100644
> --- a/net/sched/act_ipt.c
> +++ b/net/sched/act_ipt.c
> @@ -29,7 +29,6 @@
>
>
>   #define IPT_TAB_MASK     15
> -static struct tcf_hashinfo ipt_hash_info;
>
>   static int ipt_init_target(struct xt_entry_target *t, char *table, unsigned int hook)
>   {
> @@ -262,7 +261,6 @@ nla_put_failure:
>
>   static struct tc_action_ops act_ipt_ops = {
>   	.kind		=	"ipt",
> -	.hinfo		=	&ipt_hash_info,
>   	.type		=	TCA_ACT_IPT,
>   	.owner		=	THIS_MODULE,
>   	.act		=	tcf_ipt,
> @@ -273,7 +271,6 @@ static struct tc_action_ops act_ipt_ops = {
>
>   static struct tc_action_ops act_xt_ops = {
>   	.kind		=	"xt",
> -	.hinfo		=	&ipt_hash_info,
>   	.type		=	TCA_ACT_XT,
>   	.owner		=	THIS_MODULE,
>   	.act		=	tcf_ipt,
> @@ -289,20 +286,16 @@ MODULE_ALIAS("act_xt");
>
>   static int __init ipt_init_module(void)
>   {
> -	int ret1, ret2, err;
> -	err = tcf_hashinfo_init(&ipt_hash_info, IPT_TAB_MASK);
> -	if (err)
> -		return err;
> +	int ret1, ret2;
>
> -	ret1 = tcf_register_action(&act_xt_ops);
> +	ret1 = tcf_register_action(&act_xt_ops, IPT_TAB_MASK);
>   	if (ret1 < 0)
>   		printk("Failed to load xt action\n");
> -	ret2 = tcf_register_action(&act_ipt_ops);
> +	ret2 = tcf_register_action(&act_ipt_ops, IPT_TAB_MASK);
>   	if (ret2 < 0)
>   		printk("Failed to load ipt action\n");
>
>   	if (ret1 < 0 && ret2 < 0) {
> -		tcf_hashinfo_destroy(&ipt_hash_info);
>   		return ret1;
>   	} else
>   		return 0;
> @@ -312,7 +305,6 @@ static void __exit ipt_cleanup_module(void)
>   {
>   	tcf_unregister_action(&act_xt_ops);
>   	tcf_unregister_action(&act_ipt_ops);
> -	tcf_hashinfo_destroy(&ipt_hash_info);
>   }
>
>   module_init(ipt_init_module);
> diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
> index 0f00eb9..4f912c0 100644
> --- a/net/sched/act_mirred.c
> +++ b/net/sched/act_mirred.c
> @@ -31,7 +31,6 @@
>
>   #define MIRRED_TAB_MASK     7
>   static LIST_HEAD(mirred_list);
> -static struct tcf_hashinfo mirred_hash_info;
>
>   static void tcf_mirred_release(struct tc_action *a, int bind)
>   {
> @@ -234,7 +233,6 @@ static struct notifier_block mirred_device_notifier = {
>
>   static struct tc_action_ops act_mirred_ops = {
>   	.kind		=	"mirred",
> -	.hinfo		=	&mirred_hash_info,
>   	.type		=	TCA_ACT_MIRRED,
>   	.owner		=	THIS_MODULE,
>   	.act		=	tcf_mirred,
> @@ -253,19 +251,13 @@ static int __init mirred_init_module(void)
>   	if (err)
>   		return err;
>
> -	err = tcf_hashinfo_init(&mirred_hash_info, MIRRED_TAB_MASK);
> -	if (err) {
> -		unregister_netdevice_notifier(&mirred_device_notifier);
> -		return err;
> -	}
>   	pr_info("Mirror/redirect action on\n");
> -	return tcf_register_action(&act_mirred_ops);
> +	return tcf_register_action(&act_mirred_ops, MIRRED_TAB_MASK);
>   }
>
>   static void __exit mirred_cleanup_module(void)
>   {
>   	tcf_unregister_action(&act_mirred_ops);
> -	tcf_hashinfo_destroy(&mirred_hash_info);
>   	unregister_netdevice_notifier(&mirred_device_notifier);
>   }
>
> diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c
> index 9a3cb1d..270a030 100644
> --- a/net/sched/act_nat.c
> +++ b/net/sched/act_nat.c
> @@ -31,8 +31,6 @@
>
>   #define NAT_TAB_MASK	15
>
> -static struct tcf_hashinfo nat_hash_info;
> -
>   static const struct nla_policy nat_policy[TCA_NAT_MAX + 1] = {
>   	[TCA_NAT_PARMS]	= { .len = sizeof(struct tc_nat) },
>   };
> @@ -284,7 +282,6 @@ nla_put_failure:
>
>   static struct tc_action_ops act_nat_ops = {
>   	.kind		=	"nat",
> -	.hinfo		=	&nat_hash_info,
>   	.type		=	TCA_ACT_NAT,
>   	.owner		=	THIS_MODULE,
>   	.act		=	tcf_nat,
> @@ -297,16 +294,12 @@ MODULE_LICENSE("GPL");
>
>   static int __init nat_init_module(void)
>   {
> -	int err = tcf_hashinfo_init(&nat_hash_info, NAT_TAB_MASK);
> -	if (err)
> -		return err;
> -	return tcf_register_action(&act_nat_ops);
> +	return tcf_register_action(&act_nat_ops, NAT_TAB_MASK);
>   }
>
>   static void __exit nat_cleanup_module(void)
>   {
>   	tcf_unregister_action(&act_nat_ops);
> -	tcf_hashinfo_destroy(&nat_hash_info);
>   }
>
>   module_init(nat_init_module);
> diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
> index 8aa795b..5f9bcb2 100644
> --- a/net/sched/act_pedit.c
> +++ b/net/sched/act_pedit.c
> @@ -25,8 +25,6 @@
>
>   #define PEDIT_TAB_MASK	15
>
> -static struct tcf_hashinfo pedit_hash_info;
> -
>   static const struct nla_policy pedit_policy[TCA_PEDIT_MAX + 1] = {
>   	[TCA_PEDIT_PARMS]	= { .len = sizeof(struct tc_pedit) },
>   };
> @@ -218,7 +216,6 @@ nla_put_failure:
>
>   static struct tc_action_ops act_pedit_ops = {
>   	.kind		=	"pedit",
> -	.hinfo		=	&pedit_hash_info,
>   	.type		=	TCA_ACT_PEDIT,
>   	.owner		=	THIS_MODULE,
>   	.act		=	tcf_pedit,
> @@ -233,15 +230,11 @@ MODULE_LICENSE("GPL");
>
>   static int __init pedit_init_module(void)
>   {
> -	int err = tcf_hashinfo_init(&pedit_hash_info, PEDIT_TAB_MASK);
> -	if (err)
> -		return err;
> -	return tcf_register_action(&act_pedit_ops);
> +	return tcf_register_action(&act_pedit_ops, PEDIT_TAB_MASK);
>   }
>
>   static void __exit pedit_cleanup_module(void)
>   {
> -	tcf_hashinfo_destroy(&pedit_hash_info);
>   	tcf_unregister_action(&act_pedit_ops);
>   }
>
> diff --git a/net/sched/act_police.c b/net/sched/act_police.c
> index 7ff7bef..0566e46 100644
> --- a/net/sched/act_police.c
> +++ b/net/sched/act_police.c
> @@ -41,7 +41,6 @@ struct tcf_police {
>   	container_of(pc, struct tcf_police, common)
>
>   #define POL_TAB_MASK     15
> -static struct tcf_hashinfo police_hash_info;
>
>   /* old policer structure from before tc actions */
>   struct tc_police_compat {
> @@ -234,7 +233,7 @@ override:
>
>   	police->tcfp_t_c = ktime_to_ns(ktime_get());
>   	police->tcf_index = parm->index ? parm->index :
> -		tcf_hash_new_index(a->ops->hinfo);
> +		tcf_hash_new_index(hinfo);
>   	h = tcf_hash(police->tcf_index, POL_TAB_MASK);
>   	spin_lock_bh(&hinfo->lock);
>   	hlist_add_head(&police->tcf_head, &hinfo->htab[h]);
> @@ -349,7 +348,6 @@ MODULE_LICENSE("GPL");
>
>   static struct tc_action_ops act_police_ops = {
>   	.kind		=	"police",
> -	.hinfo		=	&police_hash_info,
>   	.type		=	TCA_ID_POLICE,
>   	.owner		=	THIS_MODULE,
>   	.act		=	tcf_act_police,
> @@ -361,19 +359,12 @@ static struct tc_action_ops act_police_ops = {
>   static int __init
>   police_init_module(void)
>   {
> -	int err = tcf_hashinfo_init(&police_hash_info, POL_TAB_MASK);
> -	if (err)
> -		return err;
> -	err = tcf_register_action(&act_police_ops);
> -	if (err)
> -		tcf_hashinfo_destroy(&police_hash_info);
> -	return err;
> +	return tcf_register_action(&act_police_ops, POL_TAB_MASK);
>   }
>
>   static void __exit
>   police_cleanup_module(void)
>   {
> -	tcf_hashinfo_destroy(&police_hash_info);
>   	tcf_unregister_action(&act_police_ops);
>   }
>
> diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
> index 14b5e36..992c231 100644
> --- a/net/sched/act_simple.c
> +++ b/net/sched/act_simple.c
> @@ -25,7 +25,6 @@
>   #include <net/tc_act/tc_defact.h>
>
>   #define SIMP_TAB_MASK     7
> -static struct tcf_hashinfo simp_hash_info;
>
>   #define SIMP_MAX_DATA	32
>   static int tcf_simp(struct sk_buff *skb, const struct tc_action *a,
> @@ -163,7 +162,6 @@ nla_put_failure:
>
>   static struct tc_action_ops act_simp_ops = {
>   	.kind		=	"simple",
> -	.hinfo		=	&simp_hash_info,
>   	.type		=	TCA_ACT_SIMP,
>   	.owner		=	THIS_MODULE,
>   	.act		=	tcf_simp,
> @@ -178,23 +176,15 @@ MODULE_LICENSE("GPL");
>
>   static int __init simp_init_module(void)
>   {
> -	int err, ret;
> -	err = tcf_hashinfo_init(&simp_hash_info, SIMP_TAB_MASK);
> -	if (err)
> -		return err;
> -
> -	ret = tcf_register_action(&act_simp_ops);
> +	int ret;
> +	ret = tcf_register_action(&act_simp_ops, SIMP_TAB_MASK);
>   	if (!ret)
>   		pr_info("Simple TC action Loaded\n");
> -	else
> -		tcf_hashinfo_destroy(&simp_hash_info);
> -
>   	return ret;
>   }
>
>   static void __exit simp_cleanup_module(void)
>   {
> -	tcf_hashinfo_destroy(&simp_hash_info);
>   	tcf_unregister_action(&act_simp_ops);
>   }
>
> diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c
> index 9f91928..fcfeeaf 100644
> --- a/net/sched/act_skbedit.c
> +++ b/net/sched/act_skbedit.c
> @@ -28,7 +28,6 @@
>   #include <net/tc_act/tc_skbedit.h>
>
>   #define SKBEDIT_TAB_MASK     15
> -static struct tcf_hashinfo skbedit_hash_info;
>
>   static int tcf_skbedit(struct sk_buff *skb, const struct tc_action *a,
>   		       struct tcf_result *res)
> @@ -175,7 +174,6 @@ nla_put_failure:
>
>   static struct tc_action_ops act_skbedit_ops = {
>   	.kind		=	"skbedit",
> -	.hinfo		=	&skbedit_hash_info,
>   	.type		=	TCA_ACT_SKBEDIT,
>   	.owner		=	THIS_MODULE,
>   	.act		=	tcf_skbedit,
> @@ -189,15 +187,11 @@ MODULE_LICENSE("GPL");
>
>   static int __init skbedit_init_module(void)
>   {
> -	int err = tcf_hashinfo_init(&skbedit_hash_info, SKBEDIT_TAB_MASK);
> -	if (err)
> -		return err;
> -	return tcf_register_action(&act_skbedit_ops);
> +	return tcf_register_action(&act_skbedit_ops, SKBEDIT_TAB_MASK);
>   }
>
>   static void __exit skbedit_cleanup_module(void)
>   {
> -	tcf_hashinfo_destroy(&skbedit_hash_info);
>   	tcf_unregister_action(&act_skbedit_ops);
>   }
>
>

^ permalink raw reply

* Re: [Patch net-next v3 4/5] net_sched: act: refuse to remove bound action outside
From: Jamal Hadi Salim @ 2014-02-12 12:44 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: David S. Miller
In-Reply-To: <1392167255-21744-5-git-send-email-xiyou.wangcong@gmail.com>

On 02/11/14 20:07, Cong Wang wrote:
> When an action is bonnd to a filter, there is no point to
> remove it outside. Currently we just silently decrease the refcnt,
> we should reject this explicitly with EPERM.
>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>


Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>

> ---
>   include/net/act_api.h |  2 +-
>   net/sched/act_api.c   | 26 ++++++++++++++++++++------
>   2 files changed, 21 insertions(+), 7 deletions(-)
>
> diff --git a/include/net/act_api.h b/include/net/act_api.h
> index 969cac6..3ee4c92 100644
> --- a/include/net/act_api.h
> +++ b/include/net/act_api.h
> @@ -109,7 +109,7 @@ void tcf_hash_insert(struct tc_action *a);
>
>   int tcf_register_action(struct tc_action_ops *a, unsigned int mask);
>   int tcf_unregister_action(struct tc_action_ops *a);
> -void tcf_action_destroy(struct list_head *actions, int bind);
> +int tcf_action_destroy(struct list_head *actions, int bind);
>   int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions,
>   		    struct tcf_result *res);
>   int tcf_action_init(struct net *net, struct nlattr *nla,
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index c88d382..27e4c53 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -53,6 +53,8 @@ int tcf_hash_release(struct tc_action *a, int bind)
>   	if (p) {
>   		if (bind)
>   			p->tcfc_bindcnt--;
> +		else if (p->tcfc_bindcnt > 0)
> +			return -EPERM;
>
>   		p->tcfc_refcnt--;
>   		if (p->tcfc_bindcnt <= 0 && p->tcfc_refcnt <= 0) {
> @@ -123,6 +125,7 @@ static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a)
>   	struct tcf_common *p;
>   	struct nlattr *nest;
>   	int i = 0, n_i = 0;
> +	int ret = -EINVAL;
>
>   	nest = nla_nest_start(skb, a->order);
>   	if (nest == NULL)
> @@ -133,10 +136,12 @@ static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a)
>   		head = &hinfo->htab[tcf_hash(i, hinfo->hmask)];
>   		hlist_for_each_entry_safe(p, n, head, tcfc_head) {
>   			a->priv = p;
> -			if (ACT_P_DELETED == tcf_hash_release(a, 0)) {
> +			ret = tcf_hash_release(a, 0);
> +			if (ret == ACT_P_DELETED) {
>   				module_put(a->ops->owner);
>   				n_i++;
> -			}
> +			} else if (ret < 0)
> +				goto nla_put_failure;
>   		}
>   	}
>   	if (nla_put_u32(skb, TCA_FCNT, n_i))
> @@ -146,7 +151,7 @@ static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a)
>   	return n_i;
>   nla_put_failure:
>   	nla_nest_cancel(skb, nest);
> -	return -EINVAL;
> +	return ret;
>   }
>
>   static int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb,
> @@ -401,16 +406,21 @@ exec_done:
>   }
>   EXPORT_SYMBOL(tcf_action_exec);
>
> -void tcf_action_destroy(struct list_head *actions, int bind)
> +int tcf_action_destroy(struct list_head *actions, int bind)
>   {
>   	struct tc_action *a, *tmp;
> +	int ret = 0;
>
>   	list_for_each_entry_safe(a, tmp, actions, list) {
> -		if (tcf_hash_release(a, bind) == ACT_P_DELETED)
> +		ret = tcf_hash_release(a, bind);
> +		if (ret == ACT_P_DELETED)
>   			module_put(a->ops->owner);
> +		else if (ret < 0)
> +			return ret;
>   		list_del(&a->list);
>   		kfree(a);
>   	}
> +	return ret;
>   }
>
>   int
> @@ -838,7 +848,11 @@ tcf_del_notify(struct net *net, struct nlmsghdr *n, struct list_head *actions,
>   	}
>
>   	/* now do the delete */
> -	tcf_action_destroy(actions, 0);
> +	ret = tcf_action_destroy(actions, 0);
> +	if (ret < 0) {
> +		kfree_skb(skb);
> +		return ret;
> +	}
>
>   	ret = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
>   			     n->nlmsg_flags & NLM_F_ECHO);
>

^ permalink raw reply

* Re: [Patch net-next v3 5/5] net_sched: act: clean up tca_action_flush()
From: Jamal Hadi Salim @ 2014-02-12 12:44 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: David S. Miller
In-Reply-To: <1392167255-21744-6-git-send-email-xiyou.wangcong@gmail.com>

On 02/11/14 20:07, Cong Wang wrote:
> We could allocate tc_action on stack in tca_action_flush(),
> since it is not large.
>
> Also, we could use create_a() in tcf_action_get_1().
>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>


Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>

> ---
>   net/sched/act_api.c | 53 +++++++++++++++++++++++------------------------------
>   1 file changed, 23 insertions(+), 30 deletions(-)
>
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index 27e4c53..8a5ba5a 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -685,6 +685,20 @@ act_get_notify(struct net *net, u32 portid, struct nlmsghdr *n,
>   	return rtnl_unicast(skb, net, portid);
>   }
>
> +static struct tc_action *create_a(int i)
> +{
> +	struct tc_action *act;
> +
> +	act = kzalloc(sizeof(*act), GFP_KERNEL);
> +	if (act == NULL) {
> +		pr_debug("create_a: failed to alloc!\n");
> +		return NULL;
> +	}
> +	act->order = i;
> +	INIT_LIST_HEAD(&act->list);
> +	return act;
> +}
> +
>   static struct tc_action *
>   tcf_action_get_1(struct nlattr *nla, struct nlmsghdr *n, u32 portid)
>   {
> @@ -704,11 +718,10 @@ tcf_action_get_1(struct nlattr *nla, struct nlmsghdr *n, u32 portid)
>   	index = nla_get_u32(tb[TCA_ACT_INDEX]);
>
>   	err = -ENOMEM;
> -	a = kzalloc(sizeof(struct tc_action), GFP_KERNEL);
> +	a = create_a(0);
>   	if (a == NULL)
>   		goto err_out;
>
> -	INIT_LIST_HEAD(&a->list);
>   	err = -EINVAL;
>   	a->ops = tc_lookup_action(tb[TCA_ACT_KIND]);
>   	if (a->ops == NULL) /* could happen in batch of actions */
> @@ -738,20 +751,6 @@ static void cleanup_a(struct list_head *actions)
>   	}
>   }
>
> -static struct tc_action *create_a(int i)
> -{
> -	struct tc_action *act;
> -
> -	act = kzalloc(sizeof(*act), GFP_KERNEL);
> -	if (act == NULL) {
> -		pr_debug("create_a: failed to alloc!\n");
> -		return NULL;
> -	}
> -	act->order = i;
> -	INIT_LIST_HEAD(&act->list);
> -	return act;
> -}
> -
>   static int tca_action_flush(struct net *net, struct nlattr *nla,
>   			    struct nlmsghdr *n, u32 portid)
>   {
> @@ -763,18 +762,12 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
>   	struct nlattr *nest;
>   	struct nlattr *tb[TCA_ACT_MAX + 1];
>   	struct nlattr *kind;
> -	struct tc_action *a = create_a(0);
> +	struct tc_action a;
>   	int err = -ENOMEM;
>
> -	if (a == NULL) {
> -		pr_debug("tca_action_flush: couldnt create tc_action\n");
> -		return err;
> -	}
> -
>   	skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
>   	if (!skb) {
>   		pr_debug("tca_action_flush: failed skb alloc\n");
> -		kfree(a);
>   		return err;
>   	}
>
> @@ -786,8 +779,10 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
>
>   	err = -EINVAL;
>   	kind = tb[TCA_ACT_KIND];
> -	a->ops = tc_lookup_action(kind);
> -	if (a->ops == NULL) /*some idjot trying to flush unknown action */
> +	memset(&a, 0, sizeof(struct tc_action));
> +	INIT_LIST_HEAD(&a.list);
> +	a.ops = tc_lookup_action(kind);
> +	if (a.ops == NULL) /*some idjot trying to flush unknown action */
>   		goto err_out;
>
>   	nlh = nlmsg_put(skb, portid, n->nlmsg_seq, RTM_DELACTION, sizeof(*t), 0);
> @@ -802,7 +797,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
>   	if (nest == NULL)
>   		goto out_module_put;
>
> -	err = a->ops->walk(skb, &dcb, RTM_DELACTION, a);
> +	err = a.ops->walk(skb, &dcb, RTM_DELACTION, &a);
>   	if (err < 0)
>   		goto out_module_put;
>   	if (err == 0)
> @@ -812,8 +807,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
>
>   	nlh->nlmsg_len = skb_tail_pointer(skb) - b;
>   	nlh->nlmsg_flags |= NLM_F_ROOT;
> -	module_put(a->ops->owner);
> -	kfree(a);
> +	module_put(a.ops->owner);
>   	err = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
>   			     n->nlmsg_flags & NLM_F_ECHO);
>   	if (err > 0)
> @@ -822,11 +816,10 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
>   	return err;
>
>   out_module_put:
> -	module_put(a->ops->owner);
> +	module_put(a.ops->owner);
>   err_out:
>   noflush_out:
>   	kfree_skb(skb);
> -	kfree(a);
>   	return err;
>   }
>
>

^ permalink raw reply

* team driver MAC addresses questions
From: qca_dlansky @ 2014-02-12 13:04 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev@vger.kernel.org, qca_vkondrat

Hi Jiri,

We have couple of questions about the team driver with regards to MAC addresses assignment.
For our testing, we have ath9k (wlan1) as the port being added into team0.

Q1:
When team device created it gets some random MAC address. When adding wlan1 into team device, team sticks to its random MAC and doesn't inherit from the added port.
This is because inside team_dev_type_check_change():

if (dev->type == port_dev->type)
        return 0;

What is the reason for this behavior? Doesn't it make sense to inherit MAC from the 1st port being added?

Q2:
We've noticed the following behavior:
- wlan1 has some MAC address - m1
- team0 created with random MAC address - m2

root@lx-foo:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 00:21:70:be:4f:68 brd ff:ff:ff:ff:ff:ff
4: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DORMANT qlen 1000
    link/ether 44:39:c4:18:b5:7a brd ff:ff:ff:ff:ff:ff
12: team0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT 
    link/ether 9a:ac:d5:91:df:aa brd ff:ff:ff:ff:ff:ff

- When adding port wlan1 into team0, m1 gets assigned to team0 and m2 gets assigned to wlan1

root@lx-foo:~# LD_LIBRARY_PATH=/usr/local/lib/ teamdctl team0 port add wlan1
root@lx-foo:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 00:21:70:be:4f:68 brd ff:ff:ff:ff:ff:ff
4: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master team0 state UP mode DORMANT qlen 1000
    link/ether 9a:ac:d5:91:df:aa brd ff:ff:ff:ff:ff:ff
12: team0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT 
    link/ether 44:39:c4:18:b5:7a brd ff:ff:ff:ff:ff:ff

This is a bit strange for us. We were expecting both of them to have the same MAC address.

Further investigation showed that when adding the port, the MAC address of the added port is set twice:
once by team_add_slave(), when wlan1 is still down. The MAC address is set to m2.
second time by team_set_mac_address(), after wlan1 is up. The MAC address is set to m1.

However, the 2nd call fails which leaves wlan1 with m2. The reason for the failure is because ath9k doesn't support IFF_LIVE_ADDR_CHANGE.

Our question: in team_set_mac_address(), in case there is a failure setting MAC address for any port inside port_list, doesn't it make sense to undo MAC address changes and report the failure up the stack?

Thanks,
  Vladimir & Dedy.

^ permalink raw reply

* Re: team driver MAC addresses questions
From: Jiri Pirko @ 2014-02-12 13:37 UTC (permalink / raw)
  To: qca_dlansky; +Cc: netdev@vger.kernel.org, qca_vkondrat
In-Reply-To: <65502A17874025489B7D8479C16CFA634E91D1D0@nasanexd02f.na.qualcomm.com>

Wed, Feb 12, 2014 at 02:04:45PM CET, qca_dlansky@qualcomm.com wrote:
>Hi Jiri,
>
>We have couple of questions about the team driver with regards to MAC addresses assignment.
>For our testing, we have ath9k (wlan1) as the port being added into team0.
>
>Q1:
>When team device created it gets some random MAC address. When adding wlan1 into team device, team sticks to its random MAC and doesn't inherit from the added port.
>This is because inside team_dev_type_check_change():
>
>if (dev->type == port_dev->type)
>        return 0;
>
>What is the reason for this behavior? Doesn't it make sense to inherit MAC from the 1st port being added?

Well there is no reason to inherit mac from first, second, ... port
added. consider that different order of addition would end up team with
different mac every time. Administrator can easily set mac addressto
anything which he sees fit and this mac will be always used.

>
>Q2:
>We've noticed the following behavior:
>- wlan1 has some MAC address - m1
>- team0 created with random MAC address - m2
>
>root@lx-foo:~# ip link
>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
>    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
>    link/ether 00:21:70:be:4f:68 brd ff:ff:ff:ff:ff:ff
>4: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DORMANT qlen 1000
>    link/ether 44:39:c4:18:b5:7a brd ff:ff:ff:ff:ff:ff
>12: team0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT 
>    link/ether 9a:ac:d5:91:df:aa brd ff:ff:ff:ff:ff:ff
>
>- When adding port wlan1 into team0, m1 gets assigned to team0 and m2 gets assigned to wlan1
>
>root@lx-foo:~# LD_LIBRARY_PATH=/usr/local/lib/ teamdctl team0 port add wlan1
>root@lx-foo:~# ip link
>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
>    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
>    link/ether 00:21:70:be:4f:68 brd ff:ff:ff:ff:ff:ff
>4: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master team0 state UP mode DORMANT qlen 1000
>    link/ether 9a:ac:d5:91:df:aa brd ff:ff:ff:ff:ff:ff
>12: team0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT 
>    link/ether 44:39:c4:18:b5:7a brd ff:ff:ff:ff:ff:ff
>
>This is a bit strange for us. We were expecting both of them to have the same MAC address.
>
>Further investigation showed that when adding the port, the MAC address of the added port is set twice:
>once by team_add_slave(), when wlan1 is still down. The MAC address is set to m2.
>second time by team_set_mac_address(), after wlan1 is up. The MAC address is set to m1.

Are you using teamd? What config?

>
>However, the 2nd call fails which leaves wlan1 with m2. The reason for the failure is because ath9k doesn't support IFF_LIVE_ADDR_CHANGE.
>
>Our question: in team_set_mac_address(), in case there is a failure setting MAC address for any port inside port_list, doesn't it make sense to undo MAC address changes and report the failure up the stack?
>

Yes. That would be probably the proper thing to do. WOuld you send the
patch or I should do it? Would be needed to do something similar what
bonding does.

>Thanks,
>  Vladimir & Dedy.

^ permalink raw reply

* [PATCH net-next v2] IPv6: enable bind() to assign an anycast address
From: Francois-Xavier Le Bail @ 2014-02-12 13:38 UTC (permalink / raw)
  To: NETDEV, David Miller, Hannes Frederic Sowa

- Use ipv6_chk_acast_addr_src() in inet6_bind().

Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
---
v2: ipv6_chk_acast_addr_src() was previously added.

 net/ipv6/af_inet6.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index c921d5d..68b81e9 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -347,7 +347,9 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 			if (!(addr_type & IPV6_ADDR_MULTICAST))	{
 				if (!(inet->freebind || inet->transparent) &&
 				    !ipv6_chk_addr(net, &addr->sin6_addr,
-						   dev, 0)) {
+						   dev, 0) &&
+				    !ipv6_chk_acast_addr_src(net, dev,
+							     &addr->sin6_addr)) {
 					err = -EADDRNOTAVAIL;
 					goto out_unlock;
 				}

^ permalink raw reply related

* bnx2x + SR-IOV, no internal L2 switching
From: Yoann Juet @ 2014-02-12 13:33 UTC (permalink / raw)
  To: netdev


[-- Attachment #1.1: Type: text/plain, Size: 1363 bytes --]

Hi all,

I'm conducting experiments on SR-IOV with Broadcom and Intel cards on 
debian/unstable with KVM hypervisor. On Broadcom cards (bnx2x module, 
BCM57810 devices), Virtual Functions (VFs) get running, Virtual Machines 
attached to such VFs inherit network connectivity with excellent 
performance.

However, VMs attached to VFs on the Broadcom Physical Functions (PFs) 
behave like they were connected to an ancient hub, not a L2 switch. It 
is as if there was no internal L2 switching on the Broadcom card to 
process VF <-> VF or VF <-> PF communications. As a result, a VM sees 
all inbound/outbound traffic from/to others VMs as well as traffic 
destined to the PF (for instance, the physical ethX has an IP address).

On the other hand, everything works like a charm with Intel cards (ixgbe 
module, 82599EB devices). Traffic between VFs or VF/PF is switched 
internally by the card.

I found very little literature about SR-IOV on Broadcom devices. I 
wonder if it's a normal behaviour, a misconfiguration on my side or 
perhaps a firmware/driver bug.

Have you seen this issue before ?

---
Kernel 3.12.9 (same behaviour with kernels 3.10.x)
	driver: bnx2x
	firmware-version: 7.8.17
Debian/unstable
	libvirt 1.2.1
	QEMU 1.7.0
---

Best regards,
-- 
Université de Nantes - Direction des Systèmes d'Information



[-- Attachment #1.2: yoann_juet.vcf --]
[-- Type: text/x-vcard, Size: 377 bytes --]

begin:vcard
fn:Yoann Juet
n:Juet;Yoann
org;quoted-printable;quoted-printable:Direction des Syst=C3=A8mes d'Information;P=C3=B4le R=C3=A9seau
adr;quoted-printable:BP 92208;;2 rue de la Houssini=C3=A8re;Nantes Cedex 3;;44322;France
email;internet:yoann.juet@univ-nantes.fr
tel;work:02.53.48.49.26
tel;fax:02.53.48.49.09
tel;cell:06.73.15.42.19
version:2.1
end:vcard


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 3256 bytes --]

^ permalink raw reply

* [PATCH] [CLEANUP] tcp: remove unused min_cwnd member of tcp_congestion_ops
From: Stanislav Fomichev @ 2014-02-12 13:35 UTC (permalink / raw)
  To: davem, kuznet, jmorris, yoshfuji, kaber, edumazet, ncardwell,
	ycheng; +Cc: netdev

Commit 684bad110757 "tcp: use PRR to reduce cwin in CWR state" removed all
calls to min_cwnd, so we can safely remove it.
Also, remove tcp_reno_min_cwnd because it was only used for min_cwnd.

Signed-off-by: Stanislav Fomichev <stfomichev@yandex-team.ru>
---
 Documentation/networking/tcp.txt |  2 +-
 include/net/tcp.h                |  3 ---
 net/ipv4/tcp_cong.c              | 10 ----------
 net/ipv4/tcp_highspeed.c         |  1 -
 net/ipv4/tcp_hybla.c             |  1 -
 net/ipv4/tcp_illinois.c          |  1 -
 net/ipv4/tcp_lp.c                |  1 -
 net/ipv4/tcp_scalable.c          |  1 -
 net/ipv4/tcp_vegas.c             |  1 -
 net/ipv4/tcp_westwood.c          |  1 -
 net/ipv4/tcp_yeah.c              |  1 -
 11 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/Documentation/networking/tcp.txt b/Documentation/networking/tcp.txt
index 7d11bb5dc30a..bdc4c0db51e1 100644
--- a/Documentation/networking/tcp.txt
+++ b/Documentation/networking/tcp.txt
@@ -30,7 +30,7 @@ A congestion control mechanism can be registered through functions in
 tcp_cong.c. The functions used by the congestion control mechanism are
 registered via passing a tcp_congestion_ops struct to
 tcp_register_congestion_control. As a minimum name, ssthresh,
-cong_avoid, min_cwnd must be valid.
+cong_avoid must be valid.
 
 Private data for a congestion control mechanism is stored in tp->ca_priv.
 tcp_ca(tp) returns a pointer to this space.  This is preallocated space - it
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 70e55d200610..8ccc431f7269 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -793,8 +793,6 @@ struct tcp_congestion_ops {
 
 	/* return slow start threshold (required) */
 	u32 (*ssthresh)(struct sock *sk);
-	/* lower bound for congestion window (optional) */
-	u32 (*min_cwnd)(const struct sock *sk);
 	/* do new cwnd calculation (required) */
 	void (*cong_avoid)(struct sock *sk, u32 ack, u32 acked, u32 in_flight);
 	/* call before changing ca_state (optional) */
@@ -829,7 +827,6 @@ void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w);
 extern struct tcp_congestion_ops tcp_init_congestion_ops;
 u32 tcp_reno_ssthresh(struct sock *sk);
 void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked, u32 in_flight);
-u32 tcp_reno_min_cwnd(const struct sock *sk);
 extern struct tcp_congestion_ops tcp_reno;
 
 static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state)
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index ad37bf18ae4b..f49351edf97d 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -362,21 +362,12 @@ u32 tcp_reno_ssthresh(struct sock *sk)
 }
 EXPORT_SYMBOL_GPL(tcp_reno_ssthresh);
 
-/* Lower bound on congestion window with halving. */
-u32 tcp_reno_min_cwnd(const struct sock *sk)
-{
-	const struct tcp_sock *tp = tcp_sk(sk);
-	return tp->snd_ssthresh/2;
-}
-EXPORT_SYMBOL_GPL(tcp_reno_min_cwnd);
-
 struct tcp_congestion_ops tcp_reno = {
 	.flags		= TCP_CONG_NON_RESTRICTED,
 	.name		= "reno",
 	.owner		= THIS_MODULE,
 	.ssthresh	= tcp_reno_ssthresh,
 	.cong_avoid	= tcp_reno_cong_avoid,
-	.min_cwnd	= tcp_reno_min_cwnd,
 };
 
 /* Initial congestion control used (until SYN)
@@ -388,6 +379,5 @@ struct tcp_congestion_ops tcp_init_congestion_ops  = {
 	.owner		= THIS_MODULE,
 	.ssthresh	= tcp_reno_ssthresh,
 	.cong_avoid	= tcp_reno_cong_avoid,
-	.min_cwnd	= tcp_reno_min_cwnd,
 };
 EXPORT_SYMBOL_GPL(tcp_init_congestion_ops);
diff --git a/net/ipv4/tcp_highspeed.c b/net/ipv4/tcp_highspeed.c
index 8ed9305dfdf4..8b9e7bad77c0 100644
--- a/net/ipv4/tcp_highspeed.c
+++ b/net/ipv4/tcp_highspeed.c
@@ -162,7 +162,6 @@ static struct tcp_congestion_ops tcp_highspeed __read_mostly = {
 	.init		= hstcp_init,
 	.ssthresh	= hstcp_ssthresh,
 	.cong_avoid	= hstcp_cong_avoid,
-	.min_cwnd	= tcp_reno_min_cwnd,
 
 	.owner		= THIS_MODULE,
 	.name		= "highspeed"
diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c
index 478fe82611bf..2a1a9e2a4e51 100644
--- a/net/ipv4/tcp_hybla.c
+++ b/net/ipv4/tcp_hybla.c
@@ -166,7 +166,6 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 acked,
 static struct tcp_congestion_ops tcp_hybla __read_mostly = {
 	.init		= hybla_init,
 	.ssthresh	= tcp_reno_ssthresh,
-	.min_cwnd	= tcp_reno_min_cwnd,
 	.cong_avoid	= hybla_cong_avoid,
 	.set_state	= hybla_state,
 
diff --git a/net/ipv4/tcp_illinois.c b/net/ipv4/tcp_illinois.c
index 8a520996f3d2..560d9879b89c 100644
--- a/net/ipv4/tcp_illinois.c
+++ b/net/ipv4/tcp_illinois.c
@@ -329,7 +329,6 @@ static struct tcp_congestion_ops tcp_illinois __read_mostly = {
 	.flags		= TCP_CONG_RTT_STAMP,
 	.init		= tcp_illinois_init,
 	.ssthresh	= tcp_illinois_ssthresh,
-	.min_cwnd	= tcp_reno_min_cwnd,
 	.cong_avoid	= tcp_illinois_cong_avoid,
 	.set_state	= tcp_illinois_state,
 	.get_info	= tcp_illinois_info,
diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c
index 991d62a2f9bb..503798f2fcd6 100644
--- a/net/ipv4/tcp_lp.c
+++ b/net/ipv4/tcp_lp.c
@@ -319,7 +319,6 @@ static struct tcp_congestion_ops tcp_lp __read_mostly = {
 	.init = tcp_lp_init,
 	.ssthresh = tcp_reno_ssthresh,
 	.cong_avoid = tcp_lp_cong_avoid,
-	.min_cwnd = tcp_reno_min_cwnd,
 	.pkts_acked = tcp_lp_pkts_acked,
 
 	.owner = THIS_MODULE,
diff --git a/net/ipv4/tcp_scalable.c b/net/ipv4/tcp_scalable.c
index 19ea6c2951f3..0ac50836da4d 100644
--- a/net/ipv4/tcp_scalable.c
+++ b/net/ipv4/tcp_scalable.c
@@ -39,7 +39,6 @@ static u32 tcp_scalable_ssthresh(struct sock *sk)
 static struct tcp_congestion_ops tcp_scalable __read_mostly = {
 	.ssthresh	= tcp_scalable_ssthresh,
 	.cong_avoid	= tcp_scalable_cong_avoid,
-	.min_cwnd	= tcp_reno_min_cwnd,
 
 	.owner		= THIS_MODULE,
 	.name		= "scalable",
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index 06cae62bf208..a022c17c9cf1 100644
--- a/net/ipv4/tcp_vegas.c
+++ b/net/ipv4/tcp_vegas.c
@@ -310,7 +310,6 @@ static struct tcp_congestion_ops tcp_vegas __read_mostly = {
 	.init		= tcp_vegas_init,
 	.ssthresh	= tcp_reno_ssthresh,
 	.cong_avoid	= tcp_vegas_cong_avoid,
-	.min_cwnd	= tcp_reno_min_cwnd,
 	.pkts_acked	= tcp_vegas_pkts_acked,
 	.set_state	= tcp_vegas_state,
 	.cwnd_event	= tcp_vegas_cwnd_event,
diff --git a/net/ipv4/tcp_westwood.c b/net/ipv4/tcp_westwood.c
index 76a1e23259e1..b94a04ae2ed5 100644
--- a/net/ipv4/tcp_westwood.c
+++ b/net/ipv4/tcp_westwood.c
@@ -276,7 +276,6 @@ static struct tcp_congestion_ops tcp_westwood __read_mostly = {
 	.init		= tcp_westwood_init,
 	.ssthresh	= tcp_reno_ssthresh,
 	.cong_avoid	= tcp_reno_cong_avoid,
-	.min_cwnd	= tcp_westwood_bw_rttmin,
 	.cwnd_event	= tcp_westwood_event,
 	.get_info	= tcp_westwood_info,
 	.pkts_acked	= tcp_westwood_pkts_acked,
diff --git a/net/ipv4/tcp_yeah.c b/net/ipv4/tcp_yeah.c
index a347a078ee07..5d2d15c5295f 100644
--- a/net/ipv4/tcp_yeah.c
+++ b/net/ipv4/tcp_yeah.c
@@ -231,7 +231,6 @@ static struct tcp_congestion_ops tcp_yeah __read_mostly = {
 	.init		= tcp_yeah_init,
 	.ssthresh	= tcp_yeah_ssthresh,
 	.cong_avoid	= tcp_yeah_cong_avoid,
-	.min_cwnd	= tcp_reno_min_cwnd,
 	.set_state	= tcp_vegas_state,
 	.cwnd_event	= tcp_vegas_cwnd_event,
 	.get_info	= tcp_vegas_get_info,
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH ipsec-next v2] xfrm: avoid creating temporary SA when there are no listeners
From: Horia Geanta @ 2014-02-12 14:00 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: David S. Miller, netdev
In-Reply-To: <20140212120914.GB3438@secunet.com>

In the case when KMs have no listeners, km_query() will fail and
temporary SAs are garbage collected immediately after their allocation.
This causes strain on memory allocation, leading even to OOM since
temporary SA alloc/free cycle is performed for every packet
and garbage collection does not keep up the pace.

The sane thing to do is to make sure we have audience before
temporary SA allocation.

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
---
v2: rebased onto current ipsec-next and fixed build failure

 include/net/xfrm.h    | 15 +++++++++++++++
 net/key/af_key.c      | 19 +++++++++++++++++++
 net/xfrm/xfrm_state.c | 31 +++++++++++++++++++++++++++++++
 net/xfrm/xfrm_user.c  |  6 ++++++
 4 files changed, 71 insertions(+)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index afa5730..5313ccf 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -594,6 +594,7 @@ struct xfrm_mgr {
 					   const struct xfrm_migrate *m,
 					   int num_bundles,
 					   const struct xfrm_kmaddress *k);
+	bool			(*is_alive)(const struct km_event *c);
 };
 
 int xfrm_register_km(struct xfrm_mgr *km);
@@ -1646,6 +1647,20 @@ static inline int xfrm_aevent_is_on(struct net *net)
 	rcu_read_unlock();
 	return ret;
 }
+
+static inline int xfrm_acquire_is_on(struct net *net)
+{
+	struct sock *nlsk;
+	int ret = 0;
+
+	rcu_read_lock();
+	nlsk = rcu_dereference(net->xfrm.nlsk);
+	if (nlsk)
+		ret = netlink_has_listeners(nlsk, XFRMNLGRP_ACQUIRE);
+	rcu_read_unlock();
+
+	return ret;
+}
 #endif
 
 static inline int xfrm_alg_len(const struct xfrm_algo *alg)
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 1a04c13..e1c69d0 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3059,6 +3059,24 @@ static u32 get_acqseq(void)
 	return res;
 }
 
+static bool pfkey_is_alive(const struct km_event *c)
+{
+	struct netns_pfkey *net_pfkey = net_generic(c->net, pfkey_net_id);
+	struct sock *sk;
+	bool is_alive = false;
+
+	rcu_read_lock();
+	sk_for_each_rcu(sk, &net_pfkey->table) {
+		if (pfkey_sk(sk)->registered) {
+			is_alive = true;
+			break;
+		}
+	}
+	rcu_read_unlock();
+
+	return is_alive;
+}
+
 static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *xp)
 {
 	struct sk_buff *skb;
@@ -3784,6 +3802,7 @@ static struct xfrm_mgr pfkeyv2_mgr =
 	.new_mapping	= pfkey_send_new_mapping,
 	.notify_policy	= pfkey_send_policy_notify,
 	.migrate	= pfkey_send_migrate,
+	.is_alive	= pfkey_is_alive,
 };
 
 static int __net_init pfkey_net_init(struct net *net)
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index a26b7aa..cea0dad 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -161,6 +161,7 @@ static DEFINE_SPINLOCK(xfrm_state_gc_lock);
 int __xfrm_state_delete(struct xfrm_state *x);
 
 int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol);
+bool km_is_alive(const struct km_event *c);
 void km_state_expired(struct xfrm_state *x, int hard, u32 portid);
 
 static DEFINE_SPINLOCK(xfrm_type_lock);
@@ -788,6 +789,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr,
 	struct xfrm_state *best = NULL;
 	u32 mark = pol->mark.v & pol->mark.m;
 	unsigned short encap_family = tmpl->encap_family;
+	struct km_event c;
 
 	to_put = NULL;
 
@@ -832,6 +834,17 @@ found:
 			error = -EEXIST;
 			goto out;
 		}
+
+		c.net = net;
+		/* If the KMs have no listeners (yet...), avoid allocating an SA
+		 * for each and every packet - garbage collection might not
+		 * handle the flood.
+		 */
+		if (!km_is_alive(&c)) {
+			error = -ESRCH;
+			goto out;
+		}
+
 		x = xfrm_state_alloc(net);
 		if (x == NULL) {
 			error = -ENOMEM;
@@ -1793,6 +1806,24 @@ int km_report(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address
 }
 EXPORT_SYMBOL(km_report);
 
+bool km_is_alive(const struct km_event *c)
+{
+	struct xfrm_mgr *km;
+	bool is_alive = false;
+
+	rcu_read_lock();
+	list_for_each_entry(km, &xfrm_km_list, list) {
+		if (km->is_alive && km->is_alive(c)) {
+			is_alive = true;
+			break;
+		}
+	}
+	rcu_read_unlock();
+
+	return is_alive;
+}
+EXPORT_SYMBOL(km_is_alive);
+
 int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen)
 {
 	int err;
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index ade9988..d7694f2 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2982,6 +2982,11 @@ static int xfrm_send_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr,
 	return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_MAPPING, GFP_ATOMIC);
 }
 
+static bool xfrm_is_alive(const struct km_event *c)
+{
+	return (bool)xfrm_acquire_is_on(c->net);
+}
+
 static struct xfrm_mgr netlink_mgr = {
 	.id		= "netlink",
 	.notify		= xfrm_send_state_notify,
@@ -2991,6 +2996,7 @@ static struct xfrm_mgr netlink_mgr = {
 	.report		= xfrm_send_report,
 	.migrate	= xfrm_send_migrate,
 	.new_mapping	= xfrm_send_mapping,
+	.is_alive	= xfrm_is_alive,
 };
 
 static int __net_init xfrm_user_net_init(struct net *net)
-- 
1.8.3.1

^ permalink raw reply related

* Re: [PATCH v6] can: add Renesas R-Car CAN driver
From: Sergei Shtylyov @ 2014-02-12 14:08 UTC (permalink / raw)
  To: wg, mkl, linux-can; +Cc: linux-sh, vksavl, netdev
In-Reply-To: <201401250416.13430.sergei.shtylyov@cogentembedded.com>

Hello.

On 25-01-2014 5:16, Sergei Shtylyov wrote:

> Add support for the CAN controller found in Renesas R-Car SoCs.

> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

> ---
> The patch is against the 'linux-can-next.git' repo.
> Not posting to netdev@vger.kernel.org this time or DaveM will scold me. :-)

    Wolfgang, Marc, more than 2 weeks has passed since I posted this new 
version, any feedback now that net-next is open again?

WBR, Sergei


^ permalink raw reply

* RE: team driver MAC addresses questions
From: qca_dlansky @ 2014-02-12 14:17 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev@vger.kernel.org, qca_vkondrat
In-Reply-To: <20140212133726.GA3027@minipsycho.orion>

>Q2:
>We've noticed the following behavior:
>- wlan1 has some MAC address - m1
>- team0 created with random MAC address - m2
>
>root@lx-foo:~# ip link
>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
>    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
>    link/ether 00:21:70:be:4f:68 brd ff:ff:ff:ff:ff:ff
>4: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DORMANT qlen 1000
>    link/ether 44:39:c4:18:b5:7a brd ff:ff:ff:ff:ff:ff
>12: team0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT 
>    link/ether 9a:ac:d5:91:df:aa brd ff:ff:ff:ff:ff:ff
>
>- When adding port wlan1 into team0, m1 gets assigned to team0 and m2 
>gets assigned to wlan1
>
>root@lx-foo:~# LD_LIBRARY_PATH=/usr/local/lib/ teamdctl team0 port add 
>wlan1 root@lx-foo:~# ip link
>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
>    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
>    link/ether 00:21:70:be:4f:68 brd ff:ff:ff:ff:ff:ff
>4: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master team0 state UP mode DORMANT qlen 1000
>    link/ether 9a:ac:d5:91:df:aa brd ff:ff:ff:ff:ff:ff
>12: team0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT 
>    link/ether 44:39:c4:18:b5:7a brd ff:ff:ff:ff:ff:ff
>
>This is a bit strange for us. We were expecting both of them to have the same MAC address.
>
>Further investigation showed that when adding the port, the MAC address of the added port is set twice:
>once by team_add_slave(), when wlan1 is still down. The MAC address is set to m2.
>second time by team_set_mac_address(), after wlan1 is up. The MAC address is set to m1.

Are you using teamd? What config?

[DL]  just 'teamd -d', no config at all

>
>However, the 2nd call fails which leaves wlan1 with m2. The reason for the failure is because ath9k doesn't support IFF_LIVE_ADDR_CHANGE.
>
>Our question: in team_set_mac_address(), in case there is a failure setting MAC address for any port inside port_list, doesn't it make sense to undo MAC address changes and report the failure up the stack?
>

Yes. That would be probably the proper thing to do. WOuld you send the patch or I should do it? Would be needed to do something similar what bonding does.

[DL] Let us think about it. We want to prepare patch, but we need time to do so.

>Thanks,
>  Vladimir & Dedy.

^ permalink raw reply

* Re: netfilter: nf_tables: add reject module for NFPROTO_INET
From: Dave Jones @ 2014-02-12 14:18 UTC (permalink / raw)
  To: netdev; +Cc: kaber, pablo
In-Reply-To: <20140211203359.56ED7660CD3@gitolite.kernel.org>

On Tue, Feb 11, 2014 at 08:33:59PM +0000, Linux Kernel wrote:
 > Gitweb:     http://git.kernel.org/linus/;a=commit;h=05513e9e33dbded8124567466a444d32173eecc6
 > Commit:     05513e9e33dbded8124567466a444d32173eecc6
 > Parent:     cc4723ca316742891954efa346298e7c747c0d17
 > Author:     Patrick McHardy <kaber@trash.net>
 > AuthorDate: Wed Feb 5 15:03:39 2014 +0000
 > Committer:  Pablo Neira Ayuso <pablo@netfilter.org>
 > CommitDate: Thu Feb 6 09:44:18 2014 +0100
 > 
 >     netfilter: nf_tables: add reject module for NFPROTO_INET
 >     
 >     Add a reject module for NFPROTO_INET. It does nothing but dispatch
 >     to the AF-specific modules based on the hook family.
 >     
 >     Signed-off-by: Patrick McHardy <kaber@trash.net>
 >     Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
 > ---

....

 > +static void nft_reject_inet_eval(const struct nft_expr *expr,
 > +				 struct nft_data data[NFT_REG_MAX + 1],
 > +				 const struct nft_pktinfo *pkt)
 > +{
 > +	switch (pkt->ops->pf) {
 > +	case NFPROTO_IPV4:
 > +		nft_reject_ipv4_eval(expr, data, pkt);
 > +	case NFPROTO_IPV6:
 > +		nft_reject_ipv6_eval(expr, data, pkt);
 > +	}
 > +}

Is the fallthrough intentional here, or is there a missing break ?

	Dave

^ permalink raw reply

* [PATCH ipsec-next v3] xfrm: avoid creating temporary SA when there are no listeners
From: Horia Geanta @ 2014-02-12 14:20 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: David S. Miller, netdev
In-Reply-To: <1392213609-20098-1-git-send-email-horia.geanta@freescale.com>

In the case when KMs have no listeners, km_query() will fail and
temporary SAs are garbage collected immediately after their allocation.
This causes strain on memory allocation, leading even to OOM since
temporary SA alloc/free cycle is performed for every packet
and garbage collection does not keep up the pace.

The sane thing to do is to make sure we have audience before
temporary SA allocation.

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
---
v3: rebase typo in v2 - must use list_for_each_entry_rcu
instead of list_for_each_entry

v2: rebased onto current ipsec-next and fixed build failure

 include/net/xfrm.h    | 15 +++++++++++++++
 net/key/af_key.c      | 19 +++++++++++++++++++
 net/xfrm/xfrm_state.c | 31 +++++++++++++++++++++++++++++++
 net/xfrm/xfrm_user.c  |  6 ++++++
 4 files changed, 71 insertions(+)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index afa5730..5313ccf 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -594,6 +594,7 @@ struct xfrm_mgr {
 					   const struct xfrm_migrate *m,
 					   int num_bundles,
 					   const struct xfrm_kmaddress *k);
+	bool			(*is_alive)(const struct km_event *c);
 };
 
 int xfrm_register_km(struct xfrm_mgr *km);
@@ -1646,6 +1647,20 @@ static inline int xfrm_aevent_is_on(struct net *net)
 	rcu_read_unlock();
 	return ret;
 }
+
+static inline int xfrm_acquire_is_on(struct net *net)
+{
+	struct sock *nlsk;
+	int ret = 0;
+
+	rcu_read_lock();
+	nlsk = rcu_dereference(net->xfrm.nlsk);
+	if (nlsk)
+		ret = netlink_has_listeners(nlsk, XFRMNLGRP_ACQUIRE);
+	rcu_read_unlock();
+
+	return ret;
+}
 #endif
 
 static inline int xfrm_alg_len(const struct xfrm_algo *alg)
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 1a04c13..e1c69d0 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3059,6 +3059,24 @@ static u32 get_acqseq(void)
 	return res;
 }
 
+static bool pfkey_is_alive(const struct km_event *c)
+{
+	struct netns_pfkey *net_pfkey = net_generic(c->net, pfkey_net_id);
+	struct sock *sk;
+	bool is_alive = false;
+
+	rcu_read_lock();
+	sk_for_each_rcu(sk, &net_pfkey->table) {
+		if (pfkey_sk(sk)->registered) {
+			is_alive = true;
+			break;
+		}
+	}
+	rcu_read_unlock();
+
+	return is_alive;
+}
+
 static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *xp)
 {
 	struct sk_buff *skb;
@@ -3784,6 +3802,7 @@ static struct xfrm_mgr pfkeyv2_mgr =
 	.new_mapping	= pfkey_send_new_mapping,
 	.notify_policy	= pfkey_send_policy_notify,
 	.migrate	= pfkey_send_migrate,
+	.is_alive	= pfkey_is_alive,
 };
 
 static int __net_init pfkey_net_init(struct net *net)
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index a26b7aa..0bf12f6 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -161,6 +161,7 @@ static DEFINE_SPINLOCK(xfrm_state_gc_lock);
 int __xfrm_state_delete(struct xfrm_state *x);
 
 int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol);
+bool km_is_alive(const struct km_event *c);
 void km_state_expired(struct xfrm_state *x, int hard, u32 portid);
 
 static DEFINE_SPINLOCK(xfrm_type_lock);
@@ -788,6 +789,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr,
 	struct xfrm_state *best = NULL;
 	u32 mark = pol->mark.v & pol->mark.m;
 	unsigned short encap_family = tmpl->encap_family;
+	struct km_event c;
 
 	to_put = NULL;
 
@@ -832,6 +834,17 @@ found:
 			error = -EEXIST;
 			goto out;
 		}
+
+		c.net = net;
+		/* If the KMs have no listeners (yet...), avoid allocating an SA
+		 * for each and every packet - garbage collection might not
+		 * handle the flood.
+		 */
+		if (!km_is_alive(&c)) {
+			error = -ESRCH;
+			goto out;
+		}
+
 		x = xfrm_state_alloc(net);
 		if (x == NULL) {
 			error = -ENOMEM;
@@ -1793,6 +1806,24 @@ int km_report(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address
 }
 EXPORT_SYMBOL(km_report);
 
+bool km_is_alive(const struct km_event *c)
+{
+	struct xfrm_mgr *km;
+	bool is_alive = false;
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(km, &xfrm_km_list, list) {
+		if (km->is_alive && km->is_alive(c)) {
+			is_alive = true;
+			break;
+		}
+	}
+	rcu_read_unlock();
+
+	return is_alive;
+}
+EXPORT_SYMBOL(km_is_alive);
+
 int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen)
 {
 	int err;
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index ade9988..d7694f2 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2982,6 +2982,11 @@ static int xfrm_send_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr,
 	return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_MAPPING, GFP_ATOMIC);
 }
 
+static bool xfrm_is_alive(const struct km_event *c)
+{
+	return (bool)xfrm_acquire_is_on(c->net);
+}
+
 static struct xfrm_mgr netlink_mgr = {
 	.id		= "netlink",
 	.notify		= xfrm_send_state_notify,
@@ -2991,6 +2996,7 @@ static struct xfrm_mgr netlink_mgr = {
 	.report		= xfrm_send_report,
 	.migrate	= xfrm_send_migrate,
 	.new_mapping	= xfrm_send_mapping,
+	.is_alive	= xfrm_is_alive,
 };
 
 static int __net_init xfrm_user_net_init(struct net *net)
-- 
1.8.3.1

^ permalink raw reply related

* Re: [PATCH net-next] ipv4: ip_forward: perform skb->pkt_type check at the beginning
From: Sergei Shtylyov @ 2014-02-12 14:25 UTC (permalink / raw)
  To: Denis Kirjanov, davem, netdev
In-Reply-To: <1392192632-24513-1-git-send-email-kda@linux-powerpc.org>

Hello.

On 12-02-2014 12:10, Denis Kirjanov wrote:

> Packets which have L2 address different from ours should be
> already filtered before entering into ip_forward().

> Perform that check at the beginning to avoid processing such packets.

> Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
> ---
>   net/ipv4/ip_forward.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)

> diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
> index e9f1217..1a07056 100644
> --- a/net/ipv4/ip_forward.c
> +++ b/net/ipv4/ip_forward.c
> @@ -59,6 +59,10 @@ int ip_forward(struct sk_buff *skb)
>   	struct rtable *rt;	/* Route we use */
>   	struct ip_options *opt	= &(IPCB(skb)->opt);
>
> +    /* that should never happen */
> +    if (skb->pkt_type != PACKET_HOST)
> +        goto drop;
> +

    Please indent the code with tabs, not spaces.

>   	if (skb_warn_if_lro(skb))
>   		goto drop;
>
> @@ -68,9 +72,6 @@ int ip_forward(struct sk_buff *skb)
>   	if (IPCB(skb)->opt.router_alert && ip_call_ra_chain(skb))
>   		return NET_RX_SUCCESS;
>
> -	if (skb->pkt_type != PACKET_HOST)
> -		goto drop;
> -

    Like it was here.

WBR, Sergei

^ permalink raw reply

* Re: netfilter: nf_tables: add reject module for NFPROTO_INET
From: Patrick McHardy @ 2014-02-12 14:27 UTC (permalink / raw)
  To: Dave Jones; +Cc: netdev, pablo
In-Reply-To: <20140212141827.GA7129@redhat.com>

On Wed, Feb 12, 2014 at 09:18:27AM -0500, Dave Jones wrote:
> On Tue, Feb 11, 2014 at 08:33:59PM +0000, Linux Kernel wrote:
>  > Gitweb:     http://git.kernel.org/linus/;a=commit;h=05513e9e33dbded8124567466a444d32173eecc6
>  > Commit:     05513e9e33dbded8124567466a444d32173eecc6
>  > Parent:     cc4723ca316742891954efa346298e7c747c0d17
>  > Author:     Patrick McHardy <kaber@trash.net>
>  > AuthorDate: Wed Feb 5 15:03:39 2014 +0000
>  > Committer:  Pablo Neira Ayuso <pablo@netfilter.org>
>  > CommitDate: Thu Feb 6 09:44:18 2014 +0100
>  > 
>  >     netfilter: nf_tables: add reject module for NFPROTO_INET
>  >     
>  >     Add a reject module for NFPROTO_INET. It does nothing but dispatch
>  >     to the AF-specific modules based on the hook family.
>  >     
>  >     Signed-off-by: Patrick McHardy <kaber@trash.net>
>  >     Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
>  > ---
> 
> ....
> 
>  > +static void nft_reject_inet_eval(const struct nft_expr *expr,
>  > +				 struct nft_data data[NFT_REG_MAX + 1],
>  > +				 const struct nft_pktinfo *pkt)
>  > +{
>  > +	switch (pkt->ops->pf) {
>  > +	case NFPROTO_IPV4:
>  > +		nft_reject_ipv4_eval(expr, data, pkt);
>  > +	case NFPROTO_IPV6:
>  > +		nft_reject_ipv6_eval(expr, data, pkt);
>  > +	}
>  > +}
> 
> Is the fallthrough intentional here, or is there a missing break ?

Crap. Thanks for catching this, I'll send a fix later.

^ permalink raw reply

* Re: [PATCH net-next 01/10] net: phy: add "internal" PHY mode
From: Sergei Shtylyov @ 2014-02-12 14:35 UTC (permalink / raw)
  To: Florian Fainelli, netdev; +Cc: davem, cernekee, devicetree
In-Reply-To: <1392178053-3143-2-git-send-email-f.fainelli@gmail.com>

Hello.

On 12-02-2014 8:07, Florian Fainelli wrote:

> On some systems, the PHY can be internal, in the same package as the
> Ethernet MAC, and still be responding to a specific address on the MDIO
> bus, in that case, the Ethernet MAC might need to know about it to
> properly configure a port multiplexer to switch to an internal or
> external PHY. Add a new PHY interface mode for this and update the
> Device Tree of_get_phy_mode() function to look for it.

> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
[...]

> @@ -553,7 +554,8 @@ static inline bool phy_interrupt_is_valid(struct phy_device *phydev)
>    */
>   static inline bool phy_is_internal(struct phy_device *phydev)
>   {
> -	return phydev->is_internal;
> +	return phydev->is_internal ||
> +		phydev->interface == PHY_INTERFACE_MODE_INTERNAL;

    Shouldn't the continuation line be aligned under 'phydev' on the borken up 
line)?

WBR, Sergei

^ permalink raw reply

* RE: bnx2x + SR-IOV, no internal L2 switching
From: Ariel Elior @ 2014-02-12 14:38 UTC (permalink / raw)
  To: yoann.juet@univ-nantes.fr, netdev@vger.kernel.org
In-Reply-To: <52FB7843.6050601@univ-nantes.fr>

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On Behalf Of Yoann Juet
> Sent: Wednesday, February 12, 2014 3:34 PM
> To: netdev@vger.kernel.org
> Subject: bnx2x + SR-IOV, no internal L2 switching

Hi Yoan,
57810 device does support l2 switching.
I find your terminology a little bit confusing and I have some further questions besides:

[Q1]: Are you attaching physical functions to VMs? I.e. are you passing through PFs to the VMs, or only virtual functions?

[Q2]: Are you using VFs only on VMs, or directly from the Hypervisor too?

[Q3]: You wrote "for instance the physical ethX has an IP address". That in itself is no problem and no surprise. You gave this as an example to traffic arriving where is shouldn't. Please elaborate.

[Q4]: Do you have vlan filters configured anywhere in your topology? Are they configured from Host or from Guest?
(in this respect host tagging would be 'ip link set eth0 vf 5 vlan 100' on the hypervisor while guest tagging would be 'ip link add link eth4 type vlan id 100' or 'vconfig add eth4 100' where eth0 is a PF and eth4 is a VF).

[Q5]: In the case you mentioned where you saw in a VM traffic which was destined to another VM: Did both VMs contain VFs? Were the VFs created from the same Physical Function? If not, what were the BDFs pf the respective PFs? Which mac addresses did you give the VFs?

[Q6]: Please isolate a specific case where switching is not behaving as expected and describe it in more detail:
Please describe the topology (which PFs are involved and which VFs. Who is assigned to which VMs)
Where are you sending data from (a VF, a PF, some peer on the network) and where is it arriving (perhaps arriving in multiple places)
Please detail the behavior you expect and the behavior you observe.
Please supply:
Mac addresses, ip addresses and masks, configured vlans (if any), promiscuous setting, etc.
ip -d -d link show on hypervisor and each of the VMs involved
ethtool -d from Hypervisor PFs 
dmesg from hypervisor

Please note we recently submitted some fixes to our tx-switching behavior:
In e8379c79 "bnx2x: fix VLAN configuration for VFs" we fixed an issue where traffic with the wrong vlan could still end up in a VM configured to a different vlan (hence my questions on vlans).
In c14db202 "bnx2x: Correct default Tx switching behavior" we fixed a connectivity issue with pf to vf connectivity.
Depending on your answers to the above, perhaps these might be relevant to your case.

Thanks,
Ariel

^ permalink raw reply

* Re: [PATCH 04/10] net: phy: add genphy_aneg_done()
From: Sergei Shtylyov @ 2014-02-12 14:43 UTC (permalink / raw)
  To: Florian Fainelli, netdev; +Cc: davem
In-Reply-To: <1392168462-18888-5-git-send-email-f.fainelli@gmail.com>

Hello.

On 12-02-2014 5:27, Florian Fainelli wrote:

> In preparation for allowing PHY drivers to potentially override their
> auto-negotiation done callback, move the contents of phy_aneg_done() to
> genphy_aneg_done() since that function really is the generic
> implementation based on the BMSR_ANEGCOMPLETE status.

> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
[...]

> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 82514e7..4e7db72 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -865,6 +865,22 @@ int genphy_config_aneg(struct phy_device *phydev)
>   }
>   EXPORT_SYMBOL(genphy_config_aneg);
>
> +/**
> + * genphy_aneg_done - return auto-negotiation status
> + * @phydev: target phy_device struct
> + *
> + * Description: Reads the status register and returns 0 either if
> + *   auto-negotiation is incomplete, or if there was an error.
> + *   Returns BMSR_ANEGCOMPLETE if auto-negotiation is done.
> + */
> +int genphy_aneg_done(struct phy_device *phydev)
> +{
> +	int retval = phy_read(phydev, MII_BMSR);
> +
> +	return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE);

    I doubt parens are needed here.

WBR, Sergei

^ permalink raw reply

* Re: [PATCH net-next] ipv4: ip_forward: perform skb->pkt_type check at the beginning
From: David Miller @ 2014-02-12 14:44 UTC (permalink / raw)
  To: kda; +Cc: netdev
In-Reply-To: <1392192632-24513-1-git-send-email-kda@linux-powerpc.org>

From: Denis Kirjanov <kda@linux-powerpc.org>
Date: Wed, 12 Feb 2014 12:10:32 +0400

> +    /* that should never happen */
> +    if (skb->pkt_type != PACKET_HOST)
> +        goto drop;
> +

At a minimum, this is not formatted properly.  You are using spaces
instead of TAB characters.

^ permalink raw reply

* Re: [PATCH net-next] net: remove useless if check from register_netdevice()
From: David Miller @ 2014-02-12 14:46 UTC (permalink / raw)
  To: kda; +Cc: netdev
In-Reply-To: <1392191152-24182-1-git-send-email-kda@linux-powerpc.org>

From: Denis Kirjanov <kda@linux-powerpc.org>
Date: Wed, 12 Feb 2014 11:45:52 +0400

> @@ -5876,8 +5876,7 @@ int register_netdevice(struct net_device *dev)
>  	if (dev->netdev_ops->ndo_init) {
>  		ret = dev->netdev_ops->ndo_init(dev);
>  		if (ret) {
> -			if (ret > 0)
> -				ret = -EIO;
> +            ret = -EIO;
>  			goto out;
>  		}

Like your other patch you are not formatting this code properly at all.

If you cannot insert the correct TAB and space characters necessary
to indent the code properly, have something help you do it, such as
emacs's C-mode in "linux" mode.

^ permalink raw reply

* Re: [PATCH net-next] net: remove useless if check from register_netdevice()
From: Denis Kirjanov @ 2014-02-12 14:51 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20140212.094611.946835062678856302.davem@davemloft.net>

On 2/12/14, David Miller <davem@davemloft.net> wrote:
> From: Denis Kirjanov <kda@linux-powerpc.org>
> Date: Wed, 12 Feb 2014 11:45:52 +0400
>
>> @@ -5876,8 +5876,7 @@ int register_netdevice(struct net_device *dev)
>>  	if (dev->netdev_ops->ndo_init) {
>>  		ret = dev->netdev_ops->ndo_init(dev);
>>  		if (ret) {
>> -			if (ret > 0)
>> -				ret = -EIO;
>> +            ret = -EIO;
>>  			goto out;
>>  		}
>
> Like your other patch you are not formatting this code properly at all.
>

I'll resubmit both. Thank you.

> If you cannot insert the correct TAB and space characters necessary
> to indent the code properly, have something help you do it, such as
> emacs's C-mode in "linux" mode.
>

^ permalink raw reply

* [PATCH] net: qmi_wwan: add support for Cinterion PXS8 and PHS8
From: Aleksander Morgado @ 2014-02-12 14:55 UTC (permalink / raw)
  To: davem
  Cc: bjorn, netdev, linux-usb, Aleksander Morgado,
	Hans-Christoph Schemmel, Christian Schmiedl, Nicolaus Colberg,
	David McCullough

When the PXS8 and PHS8 devices show up with PID 0x0053 they will expose both a
QMI port and a WWAN interface.

CC: Hans-Christoph Schemmel <hans-christoph.schemmel@gemalto.com>
CC: Christian Schmiedl <christian.schmiedl@gemalto.com>
CC: Nicolaus Colberg <nicolaus.colberg@gemalto.com>
CC: David McCullough <david.mccullough@accelecon.com>
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
---
 drivers/net/usb/qmi_wwan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index ff5c871..1eddd43 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -732,6 +732,7 @@ static const struct usb_device_id products[] = {
 	{QMI_FIXED_INTF(0x1bc7, 0x1201, 2)},	/* Telit LE920 */
 	{QMI_FIXED_INTF(0x0b3c, 0xc005, 6)},    /* Olivetti Olicard 200 */
 	{QMI_FIXED_INTF(0x1e2d, 0x0060, 4)},	/* Cinterion PLxx */
+	{QMI_FIXED_INTF(0x1e2d, 0x0053, 4)},	/* Cinterion PHxx,PXxx */
 
 	/* 4. Gobi 1000 devices */
 	{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)},	/* Acer Gobi Modem Device */
-- 
1.8.5.3

^ permalink raw reply related

* Re: 3.14-mw regression: rtl8169 WARNING: DMA-API: exceeded 7 overlapping mappings of pfn 55ebe
From: Dan Williams @ 2014-02-12 14:56 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Sander Eikelenboom, Konrad Rzeszutek Wilk, Wei Liu,
	Francois Romieu, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Dave Jones,
	Russell King - ARM Linux
In-Reply-To: <1392178661.1752.1.camel@edumazet-glaptop2.roam.corp.google.com>

On Tue, Feb 11, 2014 at 8:17 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Tue, 2014-02-11 at 18:07 -0800, Dan Williams wrote:
>
>> The overlap granularity is too large.  Multiple dma_map_single
>> mappings are allowed to a given page as long as they don't collide on
>> the same cache line.
>>
>
> I am not sure why you try number of mappings of a page.

For this debug facility I am tracking whether dma has completed by
making sure there are no active dma_map entries in the address range
of a page being cow'd.

> Try launching 100 concurrent netperf -t TCP_SENFILE
>
> Same page might be mapped more than 100 times, more than 10000 times in
> some cases.
>

Aren't these mapping serialized by the device to some extent?
Although multi-queue / multi-device would even defeat that...

Hmm, then I think at a minimum the activity tracking needs to be
constrained to overlapping DMA_FROM_DEVICE or DMA_BIDIRECTIONAL
mappings.  However, I am still operating on the assumption that some
architectures (especially non-io-coherent or dmabounce architectures)
expect a dma mapping to reflect exclusive ownership of the buffer.
>From the conversation I had with Russell, back in the day [1]:

"When we get to the second async_xor(), as we haven't started to run any
of these operations, the source and destination buffers are still mapped.
However, we ignore that and call dma_map_page() on them again - this is
illegal because the CPU does not own these buffers."

It might be the case that we can't have a general overlap detection
facility as it will flag stable use cases that nonetheless violate the
exclusivity expectation.

--
Dan

[1]: http://marc.info/?l=linux-arm-kernel&m=129389649101566&w=2

^ permalink raw reply

* Re: [PATCH] net: qmi_wwan: add support for Cinterion PXS8 and PHS8
From: Bjørn Mork @ 2014-02-12 15:25 UTC (permalink / raw)
  To: Aleksander Morgado
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Hans-Christoph Schemmel,
	Christian Schmiedl, Nicolaus Colberg, David McCullough
In-Reply-To: <1392216914-11520-1-git-send-email-aleksander-Dvg4H30XQSRVIjRurl1/8g@public.gmane.org>

Aleksander Morgado <aleksander-Dvg4H30XQSRVIjRurl1/8g@public.gmane.org> writes:

> When the PXS8 and PHS8 devices show up with PID 0x0053 they will expose both a
> QMI port and a WWAN interface.
>
> CC: Hans-Christoph Schemmel <hans-christoph.schemmel-av01+Y74gORBDgjK7y7TUQ@public.gmane.org>
> CC: Christian Schmiedl <christian.schmiedl-av01+Y74gORBDgjK7y7TUQ@public.gmane.org>
> CC: Nicolaus Colberg <nicolaus.colberg-av01+Y74gORBDgjK7y7TUQ@public.gmane.org>
> CC: David McCullough <david.mccullough-BMjRkEEyyBKaMJb+Lgu22Q@public.gmane.org>
> Signed-off-by: Aleksander Morgado <aleksander-Dvg4H30XQSRVIjRurl1/8g@public.gmane.org>

Acked-by: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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] [CLEANUP] tcp: remove unused min_cwnd member of tcp_congestion_ops
From: Yuchung Cheng @ 2014-02-12 15:42 UTC (permalink / raw)
  To: Stanislav Fomichev
  Cc: David Miller, kuznet, jmorris, yoshfuji, kaber, Eric Dumazet,
	Neal Cardwell, netdev
In-Reply-To: <1392212121-28574-1-git-send-email-stfomichev@yandex-team.ru>

On Wed, Feb 12, 2014 at 5:35 AM, Stanislav Fomichev
<stfomichev@yandex-team.ru> wrote:
> Commit 684bad110757 "tcp: use PRR to reduce cwin in CWR state" removed all
> calls to min_cwnd, so we can safely remove it.
> Also, remove tcp_reno_min_cwnd because it was only used for min_cwnd.
>
> Signed-off-by: Stanislav Fomichev <stfomichev@yandex-team.ru>
Acked-by: Yuchung Cheng <ycheng@google.com>

> ---
>  Documentation/networking/tcp.txt |  2 +-
>  include/net/tcp.h                |  3 ---
>  net/ipv4/tcp_cong.c              | 10 ----------
>  net/ipv4/tcp_highspeed.c         |  1 -
>  net/ipv4/tcp_hybla.c             |  1 -
>  net/ipv4/tcp_illinois.c          |  1 -
>  net/ipv4/tcp_lp.c                |  1 -
>  net/ipv4/tcp_scalable.c          |  1 -
>  net/ipv4/tcp_vegas.c             |  1 -
>  net/ipv4/tcp_westwood.c          |  1 -
>  net/ipv4/tcp_yeah.c              |  1 -
>  11 files changed, 1 insertion(+), 22 deletions(-)
>
> diff --git a/Documentation/networking/tcp.txt b/Documentation/networking/tcp.txt
> index 7d11bb5dc30a..bdc4c0db51e1 100644
> --- a/Documentation/networking/tcp.txt
> +++ b/Documentation/networking/tcp.txt
> @@ -30,7 +30,7 @@ A congestion control mechanism can be registered through functions in
>  tcp_cong.c. The functions used by the congestion control mechanism are
>  registered via passing a tcp_congestion_ops struct to
>  tcp_register_congestion_control. As a minimum name, ssthresh,
> -cong_avoid, min_cwnd must be valid.
> +cong_avoid must be valid.
>
>  Private data for a congestion control mechanism is stored in tp->ca_priv.
>  tcp_ca(tp) returns a pointer to this space.  This is preallocated space - it
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index 70e55d200610..8ccc431f7269 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -793,8 +793,6 @@ struct tcp_congestion_ops {
>
>         /* return slow start threshold (required) */
>         u32 (*ssthresh)(struct sock *sk);
> -       /* lower bound for congestion window (optional) */
> -       u32 (*min_cwnd)(const struct sock *sk);
>         /* do new cwnd calculation (required) */
>         void (*cong_avoid)(struct sock *sk, u32 ack, u32 acked, u32 in_flight);
>         /* call before changing ca_state (optional) */
> @@ -829,7 +827,6 @@ void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w);
>  extern struct tcp_congestion_ops tcp_init_congestion_ops;
>  u32 tcp_reno_ssthresh(struct sock *sk);
>  void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked, u32 in_flight);
> -u32 tcp_reno_min_cwnd(const struct sock *sk);
>  extern struct tcp_congestion_ops tcp_reno;
>
>  static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state)
> diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
> index ad37bf18ae4b..f49351edf97d 100644
> --- a/net/ipv4/tcp_cong.c
> +++ b/net/ipv4/tcp_cong.c
> @@ -362,21 +362,12 @@ u32 tcp_reno_ssthresh(struct sock *sk)
>  }
>  EXPORT_SYMBOL_GPL(tcp_reno_ssthresh);
>
> -/* Lower bound on congestion window with halving. */
> -u32 tcp_reno_min_cwnd(const struct sock *sk)
> -{
> -       const struct tcp_sock *tp = tcp_sk(sk);
> -       return tp->snd_ssthresh/2;
> -}
> -EXPORT_SYMBOL_GPL(tcp_reno_min_cwnd);
> -
>  struct tcp_congestion_ops tcp_reno = {
>         .flags          = TCP_CONG_NON_RESTRICTED,
>         .name           = "reno",
>         .owner          = THIS_MODULE,
>         .ssthresh       = tcp_reno_ssthresh,
>         .cong_avoid     = tcp_reno_cong_avoid,
> -       .min_cwnd       = tcp_reno_min_cwnd,
>  };
>
>  /* Initial congestion control used (until SYN)
> @@ -388,6 +379,5 @@ struct tcp_congestion_ops tcp_init_congestion_ops  = {
>         .owner          = THIS_MODULE,
>         .ssthresh       = tcp_reno_ssthresh,
>         .cong_avoid     = tcp_reno_cong_avoid,
> -       .min_cwnd       = tcp_reno_min_cwnd,
>  };
>  EXPORT_SYMBOL_GPL(tcp_init_congestion_ops);
> diff --git a/net/ipv4/tcp_highspeed.c b/net/ipv4/tcp_highspeed.c
> index 8ed9305dfdf4..8b9e7bad77c0 100644
> --- a/net/ipv4/tcp_highspeed.c
> +++ b/net/ipv4/tcp_highspeed.c
> @@ -162,7 +162,6 @@ static struct tcp_congestion_ops tcp_highspeed __read_mostly = {
>         .init           = hstcp_init,
>         .ssthresh       = hstcp_ssthresh,
>         .cong_avoid     = hstcp_cong_avoid,
> -       .min_cwnd       = tcp_reno_min_cwnd,
>
>         .owner          = THIS_MODULE,
>         .name           = "highspeed"
> diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c
> index 478fe82611bf..2a1a9e2a4e51 100644
> --- a/net/ipv4/tcp_hybla.c
> +++ b/net/ipv4/tcp_hybla.c
> @@ -166,7 +166,6 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 acked,
>  static struct tcp_congestion_ops tcp_hybla __read_mostly = {
>         .init           = hybla_init,
>         .ssthresh       = tcp_reno_ssthresh,
> -       .min_cwnd       = tcp_reno_min_cwnd,
>         .cong_avoid     = hybla_cong_avoid,
>         .set_state      = hybla_state,
>
> diff --git a/net/ipv4/tcp_illinois.c b/net/ipv4/tcp_illinois.c
> index 8a520996f3d2..560d9879b89c 100644
> --- a/net/ipv4/tcp_illinois.c
> +++ b/net/ipv4/tcp_illinois.c
> @@ -329,7 +329,6 @@ static struct tcp_congestion_ops tcp_illinois __read_mostly = {
>         .flags          = TCP_CONG_RTT_STAMP,
>         .init           = tcp_illinois_init,
>         .ssthresh       = tcp_illinois_ssthresh,
> -       .min_cwnd       = tcp_reno_min_cwnd,
>         .cong_avoid     = tcp_illinois_cong_avoid,
>         .set_state      = tcp_illinois_state,
>         .get_info       = tcp_illinois_info,
> diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c
> index 991d62a2f9bb..503798f2fcd6 100644
> --- a/net/ipv4/tcp_lp.c
> +++ b/net/ipv4/tcp_lp.c
> @@ -319,7 +319,6 @@ static struct tcp_congestion_ops tcp_lp __read_mostly = {
>         .init = tcp_lp_init,
>         .ssthresh = tcp_reno_ssthresh,
>         .cong_avoid = tcp_lp_cong_avoid,
> -       .min_cwnd = tcp_reno_min_cwnd,
>         .pkts_acked = tcp_lp_pkts_acked,
>
>         .owner = THIS_MODULE,
> diff --git a/net/ipv4/tcp_scalable.c b/net/ipv4/tcp_scalable.c
> index 19ea6c2951f3..0ac50836da4d 100644
> --- a/net/ipv4/tcp_scalable.c
> +++ b/net/ipv4/tcp_scalable.c
> @@ -39,7 +39,6 @@ static u32 tcp_scalable_ssthresh(struct sock *sk)
>  static struct tcp_congestion_ops tcp_scalable __read_mostly = {
>         .ssthresh       = tcp_scalable_ssthresh,
>         .cong_avoid     = tcp_scalable_cong_avoid,
> -       .min_cwnd       = tcp_reno_min_cwnd,
>
>         .owner          = THIS_MODULE,
>         .name           = "scalable",
> diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
> index 06cae62bf208..a022c17c9cf1 100644
> --- a/net/ipv4/tcp_vegas.c
> +++ b/net/ipv4/tcp_vegas.c
> @@ -310,7 +310,6 @@ static struct tcp_congestion_ops tcp_vegas __read_mostly = {
>         .init           = tcp_vegas_init,
>         .ssthresh       = tcp_reno_ssthresh,
>         .cong_avoid     = tcp_vegas_cong_avoid,
> -       .min_cwnd       = tcp_reno_min_cwnd,
>         .pkts_acked     = tcp_vegas_pkts_acked,
>         .set_state      = tcp_vegas_state,
>         .cwnd_event     = tcp_vegas_cwnd_event,
> diff --git a/net/ipv4/tcp_westwood.c b/net/ipv4/tcp_westwood.c
> index 76a1e23259e1..b94a04ae2ed5 100644
> --- a/net/ipv4/tcp_westwood.c
> +++ b/net/ipv4/tcp_westwood.c
> @@ -276,7 +276,6 @@ static struct tcp_congestion_ops tcp_westwood __read_mostly = {
>         .init           = tcp_westwood_init,
>         .ssthresh       = tcp_reno_ssthresh,
>         .cong_avoid     = tcp_reno_cong_avoid,
> -       .min_cwnd       = tcp_westwood_bw_rttmin,
>         .cwnd_event     = tcp_westwood_event,
>         .get_info       = tcp_westwood_info,
>         .pkts_acked     = tcp_westwood_pkts_acked,
> diff --git a/net/ipv4/tcp_yeah.c b/net/ipv4/tcp_yeah.c
> index a347a078ee07..5d2d15c5295f 100644
> --- a/net/ipv4/tcp_yeah.c
> +++ b/net/ipv4/tcp_yeah.c
> @@ -231,7 +231,6 @@ static struct tcp_congestion_ops tcp_yeah __read_mostly = {
>         .init           = tcp_yeah_init,
>         .ssthresh       = tcp_yeah_ssthresh,
>         .cong_avoid     = tcp_yeah_cong_avoid,
> -       .min_cwnd       = tcp_reno_min_cwnd,
>         .set_state      = tcp_vegas_state,
>         .cwnd_event     = tcp_vegas_cwnd_event,
>         .get_info       = tcp_vegas_get_info,
> --
> 1.8.3.2
>

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox