* Re: [PATCH net-next] ipv6: implement rt_genid_bump_ipv6 with fn_sernum and remove rt6i_genid
From: Vlad Yasevich @ 2014-09-10 13:26 UTC (permalink / raw)
To: Hannes Frederic Sowa, netdev; +Cc: Eric Dumazet, Nicolas Dichtel
In-Reply-To: <130f98f49b1b90a30908bfda8f01109c91edfe1c.1410341451.git.hannes@stressinduktion.org>
On 09/10/2014 05:31 AM, Hannes Frederic Sowa wrote:
> Some special routes will never be cloned in IPv6. Those are mainly
> DST_HOST routes without RTF_NONEXTHOP or RTF_GATEWAY flags, thus mostly
> routes handling the input path.
>
> rt_genid depends on rt6_info clones being removed from the trie and
> recreated with current rt6i_genid, thus bumping the genid would invalidate
> all routes cached in the sockets and relookup will recreate them. But in
> case a non-cloned route ends up in the per-socket cache, it will never
> be recreated, thus will never get a current rt_genid.
>
> After the rt_genid is incremented for the first time all those routes
> will always get invalidated by ip6_dst_check on the next check, thus
> making early socket demultiplexing absolutely pointless for IPv6. It is
> not possible to solve this with rt6i_genid, thus remove it.
>
> In case we need to force the sockets to relookup the routes we now
> increase the fn_sernum on all fibnodes in the routing tree. This is a
> costly operation but should only happen if we have major routing/policy
> changes in the kernel (e.g. manual route adding/removal, xfrm policy
> changes). Also this patch optimized the walk over the trie a bit, we
> don't touch every rt6_info but only touch the fib6_nodes.
>
> Thanks to Eric Dumazet who noticed this problem.
Hi Hannes
I also noticed the ipv6_ifa_notify() is called a lot with even being
0. This will only trigger rtnl notification, but would not trigger any
routing table changes, but would trigger a call to bump the gen_id
which now would perform a rather expensive clean-table operation.
In particular the loop in manage_tempaddrs() is very scary as it can
bump the rev multiples times.
I think it the genid bump in __ipv6_ifa_notify() should only happen
if there was an actual address change.
-vlad
>
> Fixes: 6f3118b571b8 ("ipv6: use net->rt_genid to check dst validity")
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---
>
> Notes:
> I based this patch on net-next, because it "only" fixes a performance
> problem so far and want it to be a bit more exposed to testing before
> a possible submission to stable.
>
> include/net/ip6_fib.h | 5 ++--
> include/net/net_namespace.h | 4 +++-
> net/core/dst.c | 8 +++++++
> net/ipv6/ip6_fib.c | 57 ++++++++++++++++++++++++++++++++++++---------
> net/ipv6/route.c | 4 ----
> 5 files changed, 59 insertions(+), 19 deletions(-)
>
> diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
> index 9bcb220..a5e09b8 100644
> --- a/include/net/ip6_fib.h
> +++ b/include/net/ip6_fib.h
> @@ -119,8 +119,6 @@ struct rt6_info {
> struct inet6_dev *rt6i_idev;
> unsigned long _rt6i_peer;
>
> - u32 rt6i_genid;
> -
> /* more non-fragment space at head required */
> unsigned short rt6i_nfheader_len;
>
> @@ -281,7 +279,8 @@ struct fib6_node *fib6_locate(struct fib6_node *root,
> const struct in6_addr *daddr, int dst_len,
> const struct in6_addr *saddr, int src_len);
>
> -void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg),
> +void fib6_clean_all(struct net *net,
> + int (*rt_visit)(struct rt6_info *, void *arg),
> void *arg);
>
> int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info,
> diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
> index 361d260..e0b0476 100644
> --- a/include/net/net_namespace.h
> +++ b/include/net/net_namespace.h
> @@ -358,9 +358,11 @@ static inline int rt_genid_ipv6(struct net *net)
> return atomic_read(&net->ipv6.rt_genid);
> }
>
> +extern void (*__rt_genid_bump_ipv6)(struct net *net);
> static inline void rt_genid_bump_ipv6(struct net *net)
> {
> - atomic_inc(&net->ipv6.rt_genid);
> + if (__rt_genid_bump_ipv6)
> + __rt_genid_bump_ipv6(net);
> }
> #else
> static inline int rt_genid_ipv6(struct net *net)
> diff --git a/net/core/dst.c b/net/core/dst.c
> index a028409..995183b 100644
> --- a/net/core/dst.c
> +++ b/net/core/dst.c
> @@ -23,6 +23,14 @@
>
> #include <net/dst.h>
>
> +/* as soon as the ipv6 module registers, this function is used to
> + * force all cached routing lookups to relookup
> + */
> +#if IS_ENABLED(CONFIG_IPV6)
> +void (*__rt_genid_bump_ipv6)(struct net *net);
> +EXPORT_SYMBOL(__rt_genid_bump_ipv6);
> +#endif
> +
> /*
> * Theory of operations:
> * 1) We use a list, protected by a spinlock, to add
> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> index 76b7f5e..d23b76f 100644
> --- a/net/ipv6/ip6_fib.c
> +++ b/net/ipv6/ip6_fib.c
> @@ -106,10 +106,15 @@ static inline void fib6_walker_unlink(struct fib6_walker_t *w)
> }
> static __inline__ u32 fib6_new_sernum(void)
> {
> - u32 n = ++rt_sernum;
> - if ((__s32)n <= 0)
> - rt_sernum = n = 1;
> - return n;
> + u32 new, old;
> +
> + do {
> + old = ACCESS_ONCE(rt_sernum);
> + new = old + 1;
> + if ((s32)new <= 0)
> + new = 1;
> + } while (cmpxchg(&rt_sernum, old, new) != old);
> + return new;
> }
>
> /*
> @@ -1553,25 +1558,28 @@ static int fib6_clean_node(struct fib6_walker_t *w)
> */
>
> static void fib6_clean_tree(struct net *net, struct fib6_node *root,
> - int (*func)(struct rt6_info *, void *arg),
> + int (*node_visit)(struct fib6_walker_t *),
> + int (*rt_visit)(struct rt6_info *, void *arg),
> int prune, void *arg)
> {
> struct fib6_cleaner_t c;
>
> c.w.root = root;
> - c.w.func = fib6_clean_node;
> + c.w.func = node_visit;
> c.w.prune = prune;
> c.w.count = 0;
> c.w.skip = 0;
> - c.func = func;
> + c.func = rt_visit;
> c.arg = arg;
> c.net = net;
>
> fib6_walk(&c.w);
> }
>
> -void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg),
> - void *arg)
> +static void __fib6_clean_all(struct net *net,
> + int (*node_visit)(struct fib6_walker_t *),
> + int (*rt_visit)(struct rt6_info *, void *arg),
> + void *arg)
> {
> struct fib6_table *table;
> struct hlist_head *head;
> @@ -1583,13 +1591,20 @@ void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg),
> hlist_for_each_entry_rcu(table, head, tb6_hlist) {
> write_lock_bh(&table->tb6_lock);
> fib6_clean_tree(net, &table->tb6_root,
> - func, 0, arg);
> + node_visit, rt_visit, 0, arg);
> write_unlock_bh(&table->tb6_lock);
> }
> }
> rcu_read_unlock();
> }
>
> +void fib6_clean_all(struct net *net,
> + int (*rt_visit)(struct rt6_info *, void *arg),
> + void *arg)
> +{
> + __fib6_clean_all(net, fib6_clean_node, rt_visit, arg);
> +}
> +
> static int fib6_prune_clone(struct rt6_info *rt, void *arg)
> {
> if (rt->rt6i_flags & RTF_CACHE) {
> @@ -1602,7 +1617,25 @@ static int fib6_prune_clone(struct rt6_info *rt, void *arg)
>
> static void fib6_prune_clones(struct net *net, struct fib6_node *fn)
> {
> - fib6_clean_tree(net, fn, fib6_prune_clone, 1, NULL);
> + fib6_clean_tree(net, fn, fib6_clean_node, fib6_prune_clone, 1, NULL);
> +}
> +
> +static int fib6_upd_sernum(struct fib6_walker_t *w)
> +{
> + struct fib6_cleaner_t *c = container_of(w, struct fib6_cleaner_t, w);
> + int *sernum = c->arg;
> +
> + w->node->fn_sernum = *sernum;
> + w->leaf = NULL;
> + return 0;
> +}
> +
> +static void fib6_genid_bump(struct net *net)
> +{
> + int sernum;
> +
> + sernum = fib6_new_sernum();
> + __fib6_clean_all(net, fib6_upd_sernum, NULL, &sernum);
> }
>
> /*
> @@ -1788,6 +1821,8 @@ int __init fib6_init(void)
> NULL);
> if (ret)
> goto out_unregister_subsys;
> +
> + __rt_genid_bump_ipv6 = fib6_genid_bump;
> out:
> return ret;
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index f74b041..a318dd89 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -314,7 +314,6 @@ static inline struct rt6_info *ip6_dst_alloc(struct net *net,
>
> memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst));
> rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers);
> - rt->rt6i_genid = rt_genid_ipv6(net);
> INIT_LIST_HEAD(&rt->rt6i_siblings);
> }
> return rt;
> @@ -1096,9 +1095,6 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
> * DST_OBSOLETE_FORCE_CHK which forces validation calls down
> * into this function always.
> */
> - if (rt->rt6i_genid != rt_genid_ipv6(dev_net(rt->dst.dev)))
> - return NULL;
> -
> if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie))
> return NULL;
>
>
^ permalink raw reply
* Re: [PATCH ipvs v2] ipvs: Add simple weighted failover scheduler
From: kmathis @ 2014-09-10 13:22 UTC (permalink / raw)
To: Simon Horman; +Cc: Julian Anastasov, netdev, Wensong Zhang
In-Reply-To: <20140910061708.GD10233@verge.net.au>
>From what I can tell, ipvsadm doesn't need any specific code updates.
The only place that the schedulers are actually listed is in the man page
and the SCHEDULERS file, but I can submit a change to ensure it's
listed. When I tested with keepalived, the failover (fo) module showed
up properly under ipvsadm as well without any modifications.
On Wed, Sep 10, 2014 at 03:17:09PM +0900, Simon Horman wrote:
> On Wed, Sep 10, 2014 at 09:21:09AM +0900, Simon Horman wrote:
> > On Tue, Sep 09, 2014 at 10:55:42PM +0300, Julian Anastasov wrote:
> > >
> > > Hello,
> > >
> > > On Tue, 9 Sep 2014, Kenny Mathis wrote:
> > >
> > > > Please consider this patch for addition in 3.17
> >
> > There is no need to update this patch, but for reference
> > the line above belongs below scissors ('---') below your Signed-off-by line.
> > i.e. just above the diffstat below.
> >
> > That way git will automatically remove it when you apply your patch.
> >
> > > > Add simple weighted IPVS failover support to the Linux kernel. All
> > > > other scheduling modules implement some form of load balancing, while
> > > > this offers a simple failover solution. Connections are directed to
> > > > the appropriate server based solely on highest weight value and server
> > > > availability. Tested functionality with keepalived.
> > > >
> > > > Signed-off-by: Kenny Mathis <kmathis@chokepoint.net>
> > >
> > > Looks good to me, thanks!
> > >
> > > Acked-by: Julian Anastasov <ja@ssi.bg>
> > >
> > > Simon, you can apply it to ipvs-next if there are
> > > no any objections.
> >
> > I have no objections. I have applied it.
>
> Kenny, are you planning an update to ipvsadm to allow it to use
> the new scheduler?
^ permalink raw reply
* Re: [Patch v2 net-next 09/12] net: fec: change FEC alignment according to i.mx6 sx requirement
From: Zhi Li @ 2014-09-10 13:22 UTC (permalink / raw)
To: Fabio Estevam
Cc: Frank Li, Duan Fugang-B38611, David S. Miller,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Shawn Guo,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <CAOMZO5AwOWr8uWCvt3XzM8CJideu+1LBY6QUQ772QjLjCYxL1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Wed, Sep 10, 2014 at 7:51 AM, Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Tue, Sep 9, 2014 at 5:15 PM, Frank Li <Frank.Li-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
>
>> + fep->rx_align = 0x3;
>> + fep->tx_align = 0x3;
>
> Why do you unconditionally set it as 0x3? It was 0xf for ARM and 0x3
> for non-ARM.
Will fix it at next version.
--
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 net-next v2 2/2] bonding: Simplify the xmit function for modes that use xmit_hash
From: Nikolay Aleksandrov @ 2014-09-10 13:20 UTC (permalink / raw)
To: Mahesh Bandewar, Jay Vosburgh, Veaceslav Falico, Andy Gospodarek,
David Miller
Cc: netdev, Eric Dumazet, Maciej Zenczykowski
In-Reply-To: <1410309999-10596-1-git-send-email-maheshb@google.com>
On 10/09/14 02:46, Mahesh Bandewar wrote:
> Earlier change to use usable slave array for TLB mode had an additional
> performance advantage. So extending the same logic to all other modes
> that use xmit-hash for slave selection (viz 802.3AD, and XOR modes).
> Also consolidating this with the earlier TLB change.
>
> The main idea is to build the usable slaves array in the control path
> and use that array for slave selection during xmit operation.
>
> Measured performance in a setup with a bond of 4x1G NICs with 200
> instances of netperf for the modes involved (3ad, xor, tlb)
> cmd: netperf -t TCP_RR -H <TargetHost> -l 60 -s 5
>
> Mode TPS-Before TPS-After
>
> 802.3ad : 468,694 493,101
> TLB (lb=0): 392,583 392,965
> XOR : 475,696 484,517
>
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> ---
> v1:
> (a) If bond_update_slave_arr() fails to allocate memory, it will overwrite
> the slave that need to be removed.
> (b) Freeing of array will assign NULL (to handle bond->down to bond->up
> transition gracefully.
> (c) Change from pr_debug() to pr_err() if bond_update_slave_arr() returns
> failure.
> (d) XOR: bond_update_slave_arr() will consider mii-mon, arp-mon cases and
> will populate the array even if these parameters are not used.
> (e) 3AD: Should handle the ad_agg_selection_logic correctly.
> v2:
> (a) Removed rcu_read_{un}lock() calls from array manipulation code.
> (b) Slave link-events now refresh array for all these modes.
> (c) Moved free-array call from bond_close() to bond_uninit().
>
> drivers/net/bonding/bond_3ad.c | 76 +++----------------
> drivers/net/bonding/bond_alb.c | 51 ++-----------
> drivers/net/bonding/bond_alb.h | 8 --
> drivers/net/bonding/bond_main.c | 158 +++++++++++++++++++++++++++++++++++++---
> drivers/net/bonding/bonding.h | 8 ++
> 5 files changed, 170 insertions(+), 131 deletions(-)
>
Hello Mahesh,
First a question, if a bond device in XOR mode is up and we enslave a single
slave how would it start transmitting ? Same question, if we are enslaving a
second device then the array will be rebuild with only the first upon NETDEV_UP
(of course all this is in the case miimon is 0).
The NETDEV_UP upon enslave happens before the slave is linked in.
One side note, you can now simplify these patches and drop the checks for
bond->lock since Dave applied my patches.
A few more important problems below.
> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> index ee2c73a9de39..1549e718074a 100644
> --- a/drivers/net/bonding/bond_3ad.c
> +++ b/drivers/net/bonding/bond_3ad.c
> @@ -1579,6 +1579,8 @@ static void ad_agg_selection_logic(struct aggregator *agg)
> __disable_port(port);
> }
> }
> + if (bond_update_slave_arr(bond, NULL))
> + pr_err("Failed to build slave-array for 3ad mode.\n");
> }
>
> /* if the selected aggregator is of join individuals
> @@ -1717,6 +1719,8 @@ static void ad_enable_collecting_distributing(struct port *port)
> port->actor_port_number,
> port->aggregator->aggregator_identifier);
> __enable_port(port);
> + if (bond_update_slave_arr(port->slave->bond, NULL))
> + pr_err("Failed to build slave-array for 3ad mode.\n");
> }
> }
>
> @@ -1733,6 +1737,8 @@ static void ad_disable_collecting_distributing(struct port *port)
> port->actor_port_number,
> port->aggregator->aggregator_identifier);
> __disable_port(port);
> + if (bond_update_slave_arr(port->slave->bond, NULL))
> + pr_err("Failed to build slave-array for 3ad mode.\n");
> }
> }
>
> @@ -2311,6 +2317,9 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
> */
> port->sm_vars |= AD_PORT_BEGIN;
>
> + if (bond_update_slave_arr(slave->bond, NULL))
> + pr_err("Failed to build slave-array for 3ad mode.\n");
> +
> __release_state_machine_lock(port);
> }
>
> @@ -2407,73 +2416,6 @@ int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info)
> return ret;
> }
>
> -int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
> -{
> - struct bonding *bond = netdev_priv(dev);
> - struct slave *slave, *first_ok_slave;
> - struct aggregator *agg;
> - struct ad_info ad_info;
> - struct list_head *iter;
> - int slaves_in_agg;
> - int slave_agg_no;
> - int agg_id;
> -
> - if (__bond_3ad_get_active_agg_info(bond, &ad_info)) {
> - netdev_dbg(dev, "__bond_3ad_get_active_agg_info failed\n");
> - goto err_free;
> - }
> -
> - slaves_in_agg = ad_info.ports;
> - agg_id = ad_info.aggregator_id;
> -
> - if (slaves_in_agg == 0) {
> - netdev_dbg(dev, "active aggregator is empty\n");
> - goto err_free;
> - }
> -
> - slave_agg_no = bond_xmit_hash(bond, skb) % slaves_in_agg;
> - first_ok_slave = NULL;
> -
> - bond_for_each_slave_rcu(bond, slave, iter) {
> - agg = SLAVE_AD_INFO(slave)->port.aggregator;
> - if (!agg || agg->aggregator_identifier != agg_id)
> - continue;
> -
> - if (slave_agg_no >= 0) {
> - if (!first_ok_slave && bond_slave_can_tx(slave))
> - first_ok_slave = slave;
> - slave_agg_no--;
> - continue;
> - }
> -
> - if (bond_slave_can_tx(slave)) {
> - bond_dev_queue_xmit(bond, skb, slave->dev);
> - goto out;
> - }
> - }
> -
> - if (slave_agg_no >= 0) {
> - netdev_err(dev, "Couldn't find a slave to tx on for aggregator ID %d\n",
> - agg_id);
> - goto err_free;
> - }
> -
> - /* we couldn't find any suitable slave after the agg_no, so use the
> - * first suitable found, if found.
> - */
> - if (first_ok_slave)
> - bond_dev_queue_xmit(bond, skb, first_ok_slave->dev);
> - else
> - goto err_free;
> -
> -out:
> - return NETDEV_TX_OK;
> -err_free:
> - /* no suitable interface, frame not sent */
> - dev_kfree_skb_any(skb);
> - goto out;
> -}
> -
> int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
> struct slave *slave)
> {
> diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
> index 73c21e233131..c44cabd8f2ba 100644
> --- a/drivers/net/bonding/bond_alb.c
> +++ b/drivers/net/bonding/bond_alb.c
> @@ -200,7 +200,6 @@ static int tlb_initialize(struct bonding *bond)
> static void tlb_deinitialize(struct bonding *bond)
> {
> struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
> - struct tlb_up_slave *arr;
>
> _lock_tx_hashtbl_bh(bond);
>
> @@ -208,10 +207,6 @@ static void tlb_deinitialize(struct bonding *bond)
> bond_info->tx_hashtbl = NULL;
>
> _unlock_tx_hashtbl_bh(bond);
> -
> - arr = rtnl_dereference(bond_info->slave_arr);
> - if (arr)
> - kfree_rcu(arr, rcu);
> }
>
> static long long compute_gap(struct slave *slave)
> @@ -1409,39 +1404,9 @@ out:
> return NETDEV_TX_OK;
> }
>
> -static int bond_tlb_update_slave_arr(struct bonding *bond,
> - struct slave *skipslave)
> -{
> - struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
> - struct slave *tx_slave;
> - struct list_head *iter;
> - struct tlb_up_slave *new_arr, *old_arr;
> -
> - new_arr = kzalloc(offsetof(struct tlb_up_slave, arr[bond->slave_cnt]),
> - GFP_ATOMIC);
> - if (!new_arr)
> - return -ENOMEM;
> -
> - bond_for_each_slave(bond, tx_slave, iter) {
> - if (!bond_slave_can_tx(tx_slave))
> - continue;
> - if (skipslave == tx_slave)
> - continue;
> - new_arr->arr[new_arr->count++] = tx_slave;
> - }
> -
> - old_arr = rtnl_dereference(bond_info->slave_arr);
> - rcu_assign_pointer(bond_info->slave_arr, new_arr);
> - if (old_arr)
> - kfree_rcu(old_arr, rcu);
> -
> - return 0;
> -}
> -
> int bond_tlb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
> {
> struct bonding *bond = netdev_priv(bond_dev);
> - struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
> struct ethhdr *eth_data;
> struct slave *tx_slave = NULL;
> u32 hash_index;
> @@ -1462,12 +1427,14 @@ int bond_tlb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
> hash_index & 0xFF,
> skb->len);
> } else {
> - struct tlb_up_slave *slaves;
> + struct bond_up_slave *slaves;
> + unsigned int count;
>
> - slaves = rcu_dereference(bond_info->slave_arr);
> - if (slaves && slaves->count)
> + slaves = rcu_dereference(bond->slave_arr);
> + count = slaves->count;
^^^^^^^^^^^^^^^
What happens if slaves is still NULL ? We'll dereference a NULL pointer here.
I'm beginning to think you don't test these submissions at all, I hit the
obvious NULL pointer dereference immediately after trying to enslave a device in
XOR mode with these patches applied.
> + if (slaves && count)
> tx_slave = slaves->arr[hash_index %
> - slaves->count];
> + count];
> }
> break;
> }
> @@ -1733,10 +1700,6 @@ void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave)
> rlb_clear_slave(bond, slave);
> }
>
> - if (bond_is_nondyn_tlb(bond))
> - if (bond_tlb_update_slave_arr(bond, slave))
> - pr_err("Failed to build slave-array for TLB mode.\n");
> -
> }
>
> /* Caller must hold bond lock for read */
> @@ -1762,7 +1725,7 @@ void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char
> }
>
> if (bond_is_nondyn_tlb(bond)) {
> - if (bond_tlb_update_slave_arr(bond, NULL))
> + if (bond_update_slave_arr(bond, NULL))
> pr_err("Failed to build slave-array for TLB mode.\n");
> }
> }
> diff --git a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h
> index aaeac61d03cf..5fc76c01636c 100644
> --- a/drivers/net/bonding/bond_alb.h
> +++ b/drivers/net/bonding/bond_alb.h
> @@ -139,20 +139,12 @@ struct tlb_slave_info {
> */
> };
>
> -struct tlb_up_slave {
> - unsigned int count;
> - struct rcu_head rcu;
> - struct slave *arr[0];
> -};
> -
> struct alb_bond_info {
> struct tlb_client_info *tx_hashtbl; /* Dynamically allocated */
> spinlock_t tx_hashtbl_lock;
> u32 unbalanced_load;
> int tx_rebalance_counter;
> int lp_counter;
> - /* -------- non-dynamic tlb mode only ---------*/
> - struct tlb_up_slave __rcu *slave_arr; /* Up slaves */
> /* -------- rlb parameters -------- */
> int rlb_enabled;
> struct rlb_client_info *rx_hashtbl; /* Receive hash table */
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index f0f5eab0fab1..456cda67383b 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1693,6 +1693,10 @@ static int __bond_release_one(struct net_device *bond_dev,
> if (BOND_MODE(bond) == BOND_MODE_8023AD)
> bond_3ad_unbind_slave(slave);
>
> + if (bond_mode_uses_xmit_hash(bond) &&
> + bond_update_slave_arr(bond, slave))
> + pr_err("Failed to build slave-array.\n");
> +
> write_unlock_bh(&bond->lock);
>
> netdev_info(bond_dev, "Releasing %s interface %s\n",
> @@ -2009,6 +2013,10 @@ static void bond_miimon_commit(struct bonding *bond)
> bond_alb_handle_link_change(bond, slave,
> BOND_LINK_UP);
>
> + if (BOND_MODE(bond) == BOND_MODE_XOR &&
> + bond_update_slave_arr(bond, NULL))
> + pr_err("Failed to build slave-array for XOR mode.\n");
> +
> if (!bond->curr_active_slave ||
> (slave == bond->primary_slave))
> goto do_failover;
> @@ -2037,6 +2045,10 @@ static void bond_miimon_commit(struct bonding *bond)
> bond_alb_handle_link_change(bond, slave,
> BOND_LINK_DOWN);
>
> + if (BOND_MODE(bond) == BOND_MODE_XOR &&
> + bond_update_slave_arr(bond, NULL))
> + pr_err("Failed to build slave-array for XOR mode.\n");
> +
> if (slave == rcu_access_pointer(bond->curr_active_slave))
> goto do_failover;
>
> @@ -2500,6 +2512,9 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
>
> if (slave_state_changed) {
> bond_slave_state_change(bond);
> + if (BOND_MODE(bond) == BOND_MODE_XOR &&
> + bond_update_slave_arr(bond, NULL))
> + pr_err("Failed to build slave-array for XOR mode.\n");
> } else if (do_failover) {
> /* the bond_select_active_slave must hold RTNL
> * and curr_slave_lock for write.
> @@ -2893,11 +2908,23 @@ static int bond_slave_netdev_event(unsigned long event,
> if (old_duplex != slave->duplex)
> bond_3ad_adapter_duplex_changed(slave);
> }
> + /* Refresh slave-array if applicable!
> + * If the setuo does not use miimon or arpmon (mode-specific!),
> + * then these event will not cause the slave-array to be
> + * refreshed. This will cause xmit to use a slave that is not
> + * usable. Avoid such situation by refeshing the array at these
> + * events. If these (miimon/arpmon) parameters are configured
> + * then array gets refreshed twice and that should be fine!
> + */
> + if (bond_mode_uses_xmit_hash(bond) &&
> + bond_update_slave_arr(bond, NULL))
> + pr_err("Failed to build slave-array for XOR mode.\n");
> break;
> case NETDEV_DOWN:
> - /*
> - * ... Or is it this?
> - */
> + /* Refresh slave-array if applicable! */
> + if (bond_mode_uses_xmit_hash(bond) &&
> + bond_update_slave_arr(bond, NULL))
> + pr_err("Failed to build slave-array for XOR mode.\n");
> break;
> case NETDEV_CHANGEMTU:
> /*
> @@ -3143,6 +3170,10 @@ static int bond_open(struct net_device *bond_dev)
> bond_3ad_initiate_agg_selection(bond, 1);
> }
>
> + if (bond_mode_uses_xmit_hash(bond) &&
> + bond_update_slave_arr(bond, NULL))
> + pr_err("Failed to build slave-array for XOR mode.\n");
> +
> return 0;
> }
>
> @@ -3684,15 +3715,112 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_d
> return NETDEV_TX_OK;
> }
>
> -/* In bond_xmit_xor() , we determine the output device by using a pre-
> - * determined xmit_hash_policy(), If the selected device is not enabled,
> - * find the next active slave.
> +/* Build the usable slaves array in control path for modes that use xmit-hash
> + * to determine the slave interface -
> + * (a) BOND_MODE_8023AD
> + * (b) BOND_MODE_XOR
> + * (c) BOND_MODE_TLB && tlb_dynamic_lb == 0
> */
> -static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
> +int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave)
> {
> - struct bonding *bond = netdev_priv(bond_dev);
> + struct slave *slave;
> + struct list_head *iter;
> + struct bond_up_slave *new_arr, *old_arr;
> + int slaves_in_agg;
> + int agg_id = 0;
> + int ret = 0;
> +
> + if (!bond_has_slaves(bond))
> + goto out;
> +
> + new_arr = kzalloc(offsetof(struct bond_up_slave, arr[bond->slave_cnt]),
> + GFP_ATOMIC);
> + if (!new_arr) {
> + ret = -ENOMEM;
> + goto out;
> + }
> + if (BOND_MODE(bond) == BOND_MODE_8023AD) {
> + struct ad_info ad_info;
> +
> + if (bond_3ad_get_active_agg_info(bond, &ad_info)) {
> + pr_debug("bond_3ad_get_active_agg_info failed\n");
> + kfree_rcu(new_arr, rcu);
> + ret = -EINVAL;
> + goto out;
> + }
> + slaves_in_agg = ad_info.ports;
> + agg_id = ad_info.aggregator_id;
> + }
> + bond_for_each_slave(bond, slave, iter) {
> + if (BOND_MODE(bond) == BOND_MODE_8023AD) {
> + struct aggregator *agg;
> +
> + agg = SLAVE_AD_INFO(slave)->port.aggregator;
> + if (!agg || agg->aggregator_identifier != agg_id)
> + continue;
> + }
> + if (!bond_slave_can_tx(slave))
> + continue;
> + if (skipslave == slave)
> + continue;
> + new_arr->arr[new_arr->count++] = slave;
> + }
>
> - bond_xmit_slave_id(bond, skb, bond_xmit_hash(bond, skb) % bond->slave_cnt);
> + old_arr = rcu_dereference_protected(bond->slave_arr,
> + lockdep_rtnl_is_held() ||
> + lockdep_is_held(&bond->lock) ||
> + lockdep_is_held(&bond->curr_slave_lock));
> + rcu_assign_pointer(bond->slave_arr, new_arr);
> + if (old_arr)
> + kfree_rcu(old_arr, rcu);
> +
> +out:
> + if (ret != 0 && skipslave) {
> + int idx;
> +
> + /* Rare situation where caller has asked to skip a specific
> + * slave but allocation failed (most likely!). BTW this is
> + * only possible when the call is initiated from
> + * __bond_release_one(). In this sitation; overwrite the
> + * skipslave entry in the array with the last entry from the
> + * array to avoid a situation where the xmit path may choose
> + * this to-be-skipped slave to send a packet out.
> + */
> + old_arr = rcu_dereference_protected(bond->slave_arr,
> + lockdep_is_held(&bond->lock) &&
> + lockdep_rtnl_is_held());
> + for (idx = 0; idx < old_arr->count; idx++) {
> + if (skipslave == old_arr->arr[idx]) {
> + old_arr->arr[idx] =
> + old_arr->arr[old_arr->count-1];
> + old_arr->count--;
> + break;
> + }
> + }
> + }
> + return ret;
> +}
> +
> +/* Use this Xmit function for 3AD as well as XOR modes. The current
> + * usable slave array is formed in the control path. The xmit function
> + * just calculates hash and sends the packet out.
> + */
> +int bond_3ad_xor_xmit(struct sk_buff *skb, struct net_device *dev)
> +{
> + struct bonding *bond = netdev_priv(dev);
> + struct slave *slave;
> + struct bond_up_slave *slaves;
> + unsigned int count;
> +
> + slaves = rcu_dereference(bond->slave_arr);
> + count = slaves->count;
^^^^^^^^^^^
Same here, if slaves is NULL we'll dereference a NULL ptr.
> + if (slaves && count) {
> + slave = slaves->arr[bond_xmit_hash(bond, skb) % count];
> + bond_dev_queue_xmit(bond, skb, slave->dev);
> + } else {
> + dev_kfree_skb_any(skb);
> + atomic_long_inc(&dev->tx_dropped);
> + }
>
> return NETDEV_TX_OK;
> }
> @@ -3794,12 +3922,11 @@ static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *dev
> return bond_xmit_roundrobin(skb, dev);
> case BOND_MODE_ACTIVEBACKUP:
> return bond_xmit_activebackup(skb, dev);
> + case BOND_MODE_8023AD:
> case BOND_MODE_XOR:
> - return bond_xmit_xor(skb, dev);
> + return bond_3ad_xor_xmit(skb, dev);
> case BOND_MODE_BROADCAST:
> return bond_xmit_broadcast(skb, dev);
> - case BOND_MODE_8023AD:
> - return bond_3ad_xmit_xor(skb, dev);
> case BOND_MODE_ALB:
> return bond_alb_xmit(skb, dev);
> case BOND_MODE_TLB:
> @@ -3980,6 +4107,7 @@ static void bond_uninit(struct net_device *bond_dev)
> struct bonding *bond = netdev_priv(bond_dev);
> struct list_head *iter;
> struct slave *slave;
> + struct bond_up_slave *arr;
>
> bond_netpoll_cleanup(bond_dev);
>
> @@ -3988,6 +4116,12 @@ static void bond_uninit(struct net_device *bond_dev)
> __bond_release_one(bond_dev, slave->dev, true);
> netdev_info(bond_dev, "Released all slaves\n");
>
> + arr = rtnl_dereference(bond->slave_arr);
> + if (arr) {
> + kfree_rcu(arr, rcu);
> + RCU_INIT_POINTER(bond->slave_arr, NULL);
> + }
> +
> list_del(&bond->bond_list);
>
> bond_debug_unregister(bond);
> diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
> index 64b36ba65b89..5642cccd4469 100644
> --- a/drivers/net/bonding/bonding.h
> +++ b/drivers/net/bonding/bonding.h
> @@ -177,6 +177,12 @@ struct slave {
> struct kobject kobj;
> };
>
> +struct bond_up_slave {
> + unsigned int count;
> + struct rcu_head rcu;
> + struct slave *arr[0];
> +};
> +
> /*
> * Link pseudo-state only used internally by monitors
> */
> @@ -196,6 +202,7 @@ struct bonding {
> struct slave __rcu *curr_active_slave;
> struct slave __rcu *current_arp_slave;
> struct slave *primary_slave;
> + struct bond_up_slave __rcu *slave_arr; /* Array of usable slaves */
> bool force_primary;
> s32 slave_cnt; /* never change this value outside the attach/detach wrappers */
> int (*recv_probe)(const struct sk_buff *, struct bonding *,
> @@ -534,6 +541,7 @@ const char *bond_slave_link_status(s8 link);
> struct bond_vlan_tag *bond_verify_device_path(struct net_device *start_dev,
> struct net_device *end_dev,
> int level);
> +int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave);
>
> #ifdef CONFIG_PROC_FS
> void bond_create_proc_entry(struct bonding *bond);
>
^ permalink raw reply
* Re: Question about synchronize_net() in AF_PACKET close()
From: Marcelo Ricardo Leitner @ 2014-09-10 13:19 UTC (permalink / raw)
To: martin; +Cc: David Miller, netdev, paulmck, stephen
In-Reply-To: <20140909.150000.1647602729214485795.davem@davemloft.net>
Em 09-09-2014 19:00, David Miller escreveu:
> From: Martin Kelly <martin@martingkelly.com>
> Date: Tue, 9 Sep 2014 14:44:56 -0700
>
>> In net/packet/af_packet.c, I noticed the following few lines within
>> packet_release:
>>
>> synchronize_net();
>> /*
>> * Now the socket is dead. No more input will appear.
>> */
>> sock_orphan(sk);
>> sock->sk = NULL;
>>
>> From testing and code analysis, I have found that it appears to be safe
>> to move sock_orphan and sock->sk = NULL before the synchronize_net()
>> call like so:
>>
>> /*
>> * Now the socket is dead. No more input will appear.
>> */
>> sock_orphan(sk);
>> sock->sk = NULL;
>> synchronize_net();
>>
>> Could some RCU and/or networking experts chime in about whether this a
>> safe operation? For all I know, there is some deep, fundamental reason
>> why those lines are in the order they are. On the other hand, perhaps
>> there is not.
>
> The synchronize_net() is also there to protect against the prot hook
> which can run asynchronously from the core packet input path on any
> cpu.
>
> You probably want to reference commit:
>
> commit 808f5114a9206fee855117d416440e1071ab375c
> Author: stephen hemminger <shemminger@vyatta.com>
> Date: Mon Feb 22 07:57:18 2010 +0000
>
> packet: convert socket list to RCU (v3)
>
> which put the synchronize_net() there in the first place.
And also http://patchwork.ozlabs.org/patch/181605/
Which was an attempt on improving it.
Marcelo
^ permalink raw reply
* [PATCH net-next v2] net: bpf: only build bpf_jit_binary_{alloc,free}() when jit selected
From: Daniel Borkmann @ 2014-09-10 13:01 UTC (permalink / raw)
To: davem; +Cc: fengguang.wu, ast, netdev
Since BPF JIT depends on the availability of module_alloc() and
module_free() helpers (HAVE_BPF_JIT and MODULES), we better build
that code only in case we have BPF_JIT in our config enabled, just
like with other JIT code. Fixes builds for arm/marzen_defconfig
and sh/rsk7269_defconfig.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Fixes: 738cbe72adc5 ("net: bpf: consolidate JIT binary allocator")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
v1->v2:
- Sorry, we can reduce it further and remove the else part of
the code as bpf_jit_binary_{alloc,free} helpers are only used
from within JIT code anyway, of course.
include/linux/filter.h | 78 +++++++++++++++++++++++++-------------------------
kernel/bpf/core.c | 2 ++
2 files changed, 41 insertions(+), 39 deletions(-)
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 4b59ede..1a0bc6d 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -4,12 +4,18 @@
#ifndef __LINUX_FILTER_H__
#define __LINUX_FILTER_H__
+#include <stdarg.h>
+
#include <linux/atomic.h>
#include <linux/compat.h>
#include <linux/skbuff.h>
+#include <linux/linkage.h>
+#include <linux/printk.h>
#include <linux/workqueue.h>
-#include <uapi/linux/filter.h>
+
#include <asm/cacheflush.h>
+
+#include <uapi/linux/filter.h>
#include <uapi/linux/bpf.h>
struct sk_buff;
@@ -363,14 +369,6 @@ struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
gfp_t gfp_extra_flags);
void __bpf_prog_free(struct bpf_prog *fp);
-typedef void (*bpf_jit_fill_hole_t)(void *area, unsigned int size);
-
-struct bpf_binary_header *
-bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
- unsigned int alignment,
- bpf_jit_fill_hole_t bpf_fill_ill_insns);
-void bpf_jit_binary_free(struct bpf_binary_header *hdr);
-
static inline void bpf_prog_unlock_free(struct bpf_prog *fp)
{
bpf_prog_unlock_ro(fp);
@@ -393,6 +391,38 @@ void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp);
u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);
void bpf_int_jit_compile(struct bpf_prog *fp);
+#ifdef CONFIG_BPF_JIT
+typedef void (*bpf_jit_fill_hole_t)(void *area, unsigned int size);
+
+struct bpf_binary_header *
+bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
+ unsigned int alignment,
+ bpf_jit_fill_hole_t bpf_fill_ill_insns);
+void bpf_jit_binary_free(struct bpf_binary_header *hdr);
+
+void bpf_jit_compile(struct bpf_prog *fp);
+void bpf_jit_free(struct bpf_prog *fp);
+
+static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
+ u32 pass, void *image)
+{
+ pr_err("flen=%u proglen=%u pass=%u image=%pK\n",
+ flen, proglen, pass, image);
+ if (image)
+ print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_OFFSET,
+ 16, 1, image, proglen, false);
+}
+#else
+static inline void bpf_jit_compile(struct bpf_prog *fp)
+{
+}
+
+static inline void bpf_jit_free(struct bpf_prog *fp)
+{
+ bpf_prog_unlock_free(fp);
+}
+#endif /* CONFIG_BPF_JIT */
+
#define BPF_ANC BIT(15)
static inline u16 bpf_anc_helper(const struct sock_filter *ftest)
@@ -440,36 +470,6 @@ static inline void *bpf_load_pointer(const struct sk_buff *skb, int k,
return bpf_internal_load_pointer_neg_helper(skb, k, size);
}
-#ifdef CONFIG_BPF_JIT
-#include <stdarg.h>
-#include <linux/linkage.h>
-#include <linux/printk.h>
-
-void bpf_jit_compile(struct bpf_prog *fp);
-void bpf_jit_free(struct bpf_prog *fp);
-
-static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
- u32 pass, void *image)
-{
- pr_err("flen=%u proglen=%u pass=%u image=%pK\n",
- flen, proglen, pass, image);
- if (image)
- print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_OFFSET,
- 16, 1, image, proglen, false);
-}
-#else
-#include <linux/slab.h>
-
-static inline void bpf_jit_compile(struct bpf_prog *fp)
-{
-}
-
-static inline void bpf_jit_free(struct bpf_prog *fp)
-{
- bpf_prog_unlock_free(fp);
-}
-#endif /* CONFIG_BPF_JIT */
-
static inline int bpf_tell_extensions(void)
{
return SKF_AD_MAX;
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 8ee520f..8b70024 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -128,6 +128,7 @@ void __bpf_prog_free(struct bpf_prog *fp)
}
EXPORT_SYMBOL_GPL(__bpf_prog_free);
+#ifdef CONFIG_BPF_JIT
struct bpf_binary_header *
bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
unsigned int alignment,
@@ -163,6 +164,7 @@ void bpf_jit_binary_free(struct bpf_binary_header *hdr)
{
module_free(NULL, hdr);
}
+#endif /* CONFIG_BPF_JIT */
/* Base function for offset calculation. Needs to go into .text section,
* therefore keeping it non-static as well; will also be used by JITs
--
1.7.11.7
^ permalink raw reply related
* Re: [Patch v2 net-next 09/12] net: fec: change FEC alignment according to i.mx6 sx requirement
From: Fabio Estevam @ 2014-09-10 12:51 UTC (permalink / raw)
To: Frank Li
Cc: Duan Fugang-B38611, David S. Miller, netdev@vger.kernel.org,
李智, Shawn Guo, linux-arm-kernel@lists.infradead.org,
devicetree@vger.kernel.org
In-Reply-To: <1410293743-27874-10-git-send-email-Frank.Li@freescale.com>
On Tue, Sep 9, 2014 at 5:15 PM, Frank Li <Frank.Li@freescale.com> wrote:
> + fep->rx_align = 0x3;
> + fep->tx_align = 0x3;
Why do you unconditionally set it as 0x3? It was 0xf for ARM and 0x3
for non-ARM.
^ permalink raw reply
* Trouble with Realtek Ethernet RTL8111/8168/8411 (rev 12)
From: Luis de Lago @ 2014-09-10 12:47 UTC (permalink / raw)
To: netdev
Hello everybody,
i was directed here by members of the arch forum where i have reported
my problem and where the information provided below is perhaps more
readable:
https://bbs.archlinux.org/viewtopic.php?pid=1455220#p1455220
if i shouldn't have written to you plz feel free to let me know and
plz help me adressing this to the right channel.
my situation is the following ... [BlogPost]
i plugin the ethernet cable but network manager still shows "no cable
attached" and no ip adress information ...
neither the lights of the ethernet port of the router nor the ones of
the laptop light up ...
here are my details:
i have the same problem under arch in kernel 3.16 and 3.14 and under
ubuntu 14.04 kernel 3.13
$ ifconfig
-------------------------------------------------------------------------------------
enp3s0f1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 00:90:f5:f9:fd:d9 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 656 bytes 51072 (49.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 656 bytes 51072 (49.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp2s0: wlan chip by intel works fine
$ lspci -v
----------------------------------------------------------------------------------------------
[...]
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd.
Device 5287 (rev 01)
Subsystem: CLEVO/KAPOK Computer Device 5494
Flags: bus master, fast devsel, latency 0, IRQ 56
Memory at f7c15000 (32-bit, non-prefetchable) [size=4K]
Expansion ROM at f7c00000 [disabled] [size=64K]
Capabilities: <access denied>
Kernel driver in use: rtsx_pci
Kernel modules: rtsx_pci
03:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)
Subsystem: CLEVO/KAPOK Computer Device 5494
Flags: bus master, fast devsel, latency 0, IRQ 61
I/O ports at e000 [size=256]
Memory at f7c14000 (64-bit, non-prefetchable) [size=4K]
Memory at f7c10000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: r8169
Kernel modules: r8169
the computer that has the problem is a laptop and i dunno why there
are 2 Realtek Entries ... it definitly has only ONE ethernet port!
((installing aur r8168 and loading the module ofc did not fix the
problem as suggested by others ...))
$ dmesg | grep 8169
------------------------------------------------------------
[ 2.304595] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[ 2.304609] r8169 0000:03:00.1: can't disable ASPM; OS doesn't have
ASPM control
[ 2.310138] r8169 0000:03:00.1: irq 61 for MSI/MSI-X
[ 2.310452] r8169 0000:03:00.1 eth0: RTL8411 at 0xffffc900018c6000,
00:90:f5:f9:fd:d9, XID 1c800880 IRQ 61
[ 2.310457] r8169 0000:03:00.1 eth0: jumbo features [frames: 9200
bytes, tx checksumming: ko]
[ 5.594516] r8169 0000:03:00.1 enp3s0f1: rtl_phy_reset_cond == 1
(loop: 100, delay: 1).
[ 5.596608] r8169 0000:03:00.1 enp3s0f1: link down
thanks for reading!
Bruno
^ permalink raw reply
* [PATCH net-next] net: bpf: only build bpf_jit_binary_{alloc,free}() when jit selected
From: Daniel Borkmann @ 2014-09-10 12:45 UTC (permalink / raw)
To: davem; +Cc: fengguang.wu, ast, netdev
Since BPF JIT depends on the availability of module_alloc() and
module_free() helpers (HAVE_BPF_JIT and MODULES), we better build
that code only in case we have BPF_JIT in our config enabled, just
like with other JIT code. Fixes builds for arm/marzen_defconfig
and sh/rsk7269_defconfig.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Fixes: 738cbe72adc5 ("net: bpf: consolidate JIT binary allocator")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
include/linux/filter.h | 90 ++++++++++++++++++++++++++++----------------------
kernel/bpf/core.c | 2 ++
2 files changed, 53 insertions(+), 39 deletions(-)
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 4b59ede..71d74f8 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -4,12 +4,18 @@
#ifndef __LINUX_FILTER_H__
#define __LINUX_FILTER_H__
+#include <stdarg.h>
+
#include <linux/atomic.h>
#include <linux/compat.h>
#include <linux/skbuff.h>
+#include <linux/linkage.h>
+#include <linux/printk.h>
#include <linux/workqueue.h>
-#include <uapi/linux/filter.h>
+
#include <asm/cacheflush.h>
+
+#include <uapi/linux/filter.h>
#include <uapi/linux/bpf.h>
struct sk_buff;
@@ -320,6 +326,8 @@ struct sk_filter {
struct bpf_prog *prog;
};
+typedef void (*bpf_jit_fill_hole_t)(void *area, unsigned int size);
+
#define BPF_PROG_RUN(filter, ctx) (*filter->bpf_func)(ctx, filter->insnsi)
static inline unsigned int bpf_prog_size(unsigned int proglen)
@@ -363,14 +371,6 @@ struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
gfp_t gfp_extra_flags);
void __bpf_prog_free(struct bpf_prog *fp);
-typedef void (*bpf_jit_fill_hole_t)(void *area, unsigned int size);
-
-struct bpf_binary_header *
-bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
- unsigned int alignment,
- bpf_jit_fill_hole_t bpf_fill_ill_insns);
-void bpf_jit_binary_free(struct bpf_binary_header *hdr);
-
static inline void bpf_prog_unlock_free(struct bpf_prog *fp)
{
bpf_prog_unlock_ro(fp);
@@ -393,6 +393,48 @@ void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp);
u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);
void bpf_int_jit_compile(struct bpf_prog *fp);
+#ifdef CONFIG_BPF_JIT
+struct bpf_binary_header *
+bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
+ unsigned int alignment,
+ bpf_jit_fill_hole_t bpf_fill_ill_insns);
+void bpf_jit_binary_free(struct bpf_binary_header *hdr);
+
+void bpf_jit_compile(struct bpf_prog *fp);
+void bpf_jit_free(struct bpf_prog *fp);
+
+static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
+ u32 pass, void *image)
+{
+ pr_err("flen=%u proglen=%u pass=%u image=%pK\n",
+ flen, proglen, pass, image);
+ if (image)
+ print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_OFFSET,
+ 16, 1, image, proglen, false);
+}
+#else
+static inline struct bpf_binary_header *
+bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
+ unsigned int alignment,
+ bpf_jit_fill_hole_t bpf_fill_ill_insns)
+{
+ return NULL;
+}
+
+static inline void bpf_jit_binary_free(struct bpf_binary_header *hdr)
+{
+}
+
+static inline void bpf_jit_compile(struct bpf_prog *fp)
+{
+}
+
+static inline void bpf_jit_free(struct bpf_prog *fp)
+{
+ bpf_prog_unlock_free(fp);
+}
+#endif /* CONFIG_BPF_JIT */
+
#define BPF_ANC BIT(15)
static inline u16 bpf_anc_helper(const struct sock_filter *ftest)
@@ -440,36 +482,6 @@ static inline void *bpf_load_pointer(const struct sk_buff *skb, int k,
return bpf_internal_load_pointer_neg_helper(skb, k, size);
}
-#ifdef CONFIG_BPF_JIT
-#include <stdarg.h>
-#include <linux/linkage.h>
-#include <linux/printk.h>
-
-void bpf_jit_compile(struct bpf_prog *fp);
-void bpf_jit_free(struct bpf_prog *fp);
-
-static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
- u32 pass, void *image)
-{
- pr_err("flen=%u proglen=%u pass=%u image=%pK\n",
- flen, proglen, pass, image);
- if (image)
- print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_OFFSET,
- 16, 1, image, proglen, false);
-}
-#else
-#include <linux/slab.h>
-
-static inline void bpf_jit_compile(struct bpf_prog *fp)
-{
-}
-
-static inline void bpf_jit_free(struct bpf_prog *fp)
-{
- bpf_prog_unlock_free(fp);
-}
-#endif /* CONFIG_BPF_JIT */
-
static inline int bpf_tell_extensions(void)
{
return SKF_AD_MAX;
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 8ee520f..8b70024 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -128,6 +128,7 @@ void __bpf_prog_free(struct bpf_prog *fp)
}
EXPORT_SYMBOL_GPL(__bpf_prog_free);
+#ifdef CONFIG_BPF_JIT
struct bpf_binary_header *
bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,
unsigned int alignment,
@@ -163,6 +164,7 @@ void bpf_jit_binary_free(struct bpf_binary_header *hdr)
{
module_free(NULL, hdr);
}
+#endif /* CONFIG_BPF_JIT */
/* Base function for offset calculation. Needs to go into .text section,
* therefore keeping it non-static as well; will also be used by JITs
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH net-next 2/5] ceph: Convert pr_warning to pr_warn
From: Ilya Dryomov @ 2014-09-10 12:38 UTC (permalink / raw)
To: Joe Perches
Cc: netdev, Sage Weil, David S. Miller, Ceph Development,
Linux Kernel Mailing List
In-Reply-To: <714b7551f5a6ea5e721fed705568a39eeae4623b.1410322181.git.joe@perches.com>
On Wed, Sep 10, 2014 at 8:17 AM, Joe Perches <joe@perches.com> wrote:
> Use the more common pr_warn.
>
> Other miscellanea:
>
> o Coalesce formats
> o Realign arguments
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> net/ceph/ceph_common.c | 15 +++++++++------
> net/ceph/messenger.c | 19 ++++++++++---------
> net/ceph/osd_client.c | 15 +++++++--------
> net/ceph/osdmap.c | 20 ++++++++++----------
> 4 files changed, 36 insertions(+), 33 deletions(-)
>
> diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
> index 1675021..58fbfe1 100644
> --- a/net/ceph/ceph_common.c
> +++ b/net/ceph/ceph_common.c
> @@ -293,17 +293,20 @@ static int get_secret(struct ceph_crypto_key *dst, const char *name) {
> key_err = PTR_ERR(ukey);
> switch (key_err) {
> case -ENOKEY:
> - pr_warning("ceph: Mount failed due to key not found: %s\n", name);
> + pr_warn("ceph: Mount failed due to key not found: %s\n",
> + name);
> break;
> case -EKEYEXPIRED:
> - pr_warning("ceph: Mount failed due to expired key: %s\n", name);
> + pr_warn("ceph: Mount failed due to expired key: %s\n",
> + name);
> break;
> case -EKEYREVOKED:
> - pr_warning("ceph: Mount failed due to revoked key: %s\n", name);
> + pr_warn("ceph: Mount failed due to revoked key: %s\n",
> + name);
> break;
> default:
> - pr_warning("ceph: Mount failed due to unknown key error"
> - " %d: %s\n", key_err, name);
> + pr_warn("ceph: Mount failed due to unknown key error %d: %s\n",
> + key_err, name);
> }
> err = -EPERM;
> goto out;
> @@ -433,7 +436,7 @@ ceph_parse_options(char *options, const char *dev_name,
>
> /* misc */
> case Opt_osdtimeout:
> - pr_warning("ignoring deprecated osdtimeout option\n");
> + pr_warn("ignoring deprecated osdtimeout option\n");
> break;
> case Opt_osdkeepalivetimeout:
> opt->osd_keepalive_timeout = intval;
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index b2f571d..a7203be 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -1937,11 +1937,11 @@ static int process_banner(struct ceph_connection *con)
> sizeof(con->peer_addr)) != 0 &&
> !(addr_is_blank(&con->actual_peer_addr.in_addr) &&
> con->actual_peer_addr.nonce == con->peer_addr.nonce)) {
> - pr_warning("wrong peer, want %s/%d, got %s/%d\n",
> - ceph_pr_addr(&con->peer_addr.in_addr),
> - (int)le32_to_cpu(con->peer_addr.nonce),
> - ceph_pr_addr(&con->actual_peer_addr.in_addr),
> - (int)le32_to_cpu(con->actual_peer_addr.nonce));
> + pr_warn("wrong peer, want %s/%d, got %s/%d\n",
> + ceph_pr_addr(&con->peer_addr.in_addr),
> + (int)le32_to_cpu(con->peer_addr.nonce),
> + ceph_pr_addr(&con->actual_peer_addr.in_addr),
> + (int)le32_to_cpu(con->actual_peer_addr.nonce));
> con->error_msg = "wrong peer at address";
> return -1;
> }
> @@ -2302,7 +2302,7 @@ static int read_partial_message(struct ceph_connection *con)
>
> BUG_ON(!con->in_msg ^ skip);
> if (con->in_msg && data_len > con->in_msg->data_length) {
> - pr_warning("%s skipping long message (%u > %zd)\n",
> + pr_warn("%s skipping long message (%u > %zd)\n",
> __func__, data_len, con->in_msg->data_length);
> ceph_msg_put(con->in_msg);
> con->in_msg = NULL;
> @@ -2712,7 +2712,7 @@ static bool con_sock_closed(struct ceph_connection *con)
> CASE(OPEN);
> CASE(STANDBY);
> default:
> - pr_warning("%s con %p unrecognized state %lu\n",
> + pr_warn("%s con %p unrecognized state %lu\n",
> __func__, con, con->state);
> con->error_msg = "unrecognized con state";
> BUG();
> @@ -2828,8 +2828,9 @@ static void con_work(struct work_struct *work)
> */
> static void con_fault(struct ceph_connection *con)
> {
> - pr_warning("%s%lld %s %s\n", ENTITY_NAME(con->peer_name),
> - ceph_pr_addr(&con->peer_addr.in_addr), con->error_msg);
> + pr_warn("%s%lld %s %s\n",
> + ENTITY_NAME(con->peer_name),
> + ceph_pr_addr(&con->peer_addr.in_addr), con->error_msg);
Just wondering, why did you move ENITITY_NAME argument to the next
line? I see you are doing this pretty consistently. Is this a style
guideline or something?
Thanks,
Ilya
^ permalink raw reply
* Re: gcc 4.8.3 miscompiles drivers/net/ethernet/freescale/fec_main.c ?!
From: Mikael Pettersson @ 2014-09-10 12:32 UTC (permalink / raw)
To: David Jander; +Cc: Russell King, David S. Miller, netdev, linux-arm-kernel
In-Reply-To: <20140910110943.3673dbb4@archvile>
David Jander writes:
>
> Hi,
>
> I am seeing a strange problem when building a recent kernel with gcc-4.8.3 for
> armv7-a that contains the following patch:
>
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=bfd4ecdd87d350e19457fe0d02fa1e046774c44e
>
> Unfortunately I am not good enough at reading ARM assembly output from GCC to
> understand whats going wrong, so I am asking for help.
>
> I started noticing ethernet packet loss on a i.MX6 board after upgrading the
> kernel from 3.16-rc-something to latest mainline. The problem is very easy to
> reproduce so I started git-bisecting. Git bisect gave me the above patch as
> the culprit, and indeed: Without the patch a flood-ping goes fine (just one
> dot on screen, no lost packets). I apply the patch and the dots start filling
> the screen instantly.
>
> I am compiling the kernel using Pengutronix's OSELAS toolchain version
> 2013.12.1, which is based on linaro gcc-4.8.3 without any relevant patches
> AFAIK.
Linaro's toolchain is itself heavily modified compared to FSF gcc-4.8.3,
so first please try a pure vanilla FSF gcc-4.8.3, and then a likewise
vanilla gcc-4.9.1. If those also cause the malfunction, then you have
proof for a bug in upstream gcc (or possibly undefined code in the kernel),
otherwise the bug is likely Linaro's.
> Compiling with -O2 breaks the code, while -Os seems to produce a correctly
> working kernel.
>
> I decided to make changes to the code and see if I could find other ways to
> "fix" the problem, and I got the following result:
>
> The above mentioned patch introduces the static function fec_enet_hwtstamp()
> near line 1068 of fec_main.c. If I make an exact copy of this function, where
> I only change the name (e.g. fec_enet_hwtstamp2), and change one of the two
> places this function is called to instead use the other name, GCC inlines both
> copies and the problem disappears!
>
> Since I am not very good at GCC internals nor do I know this piece of code in
> fec_main.c very well, I am asking here for help in hunting down the real bug,
> which I suspect is in GCC... but I want to know for sure.
>
> Best regards,
>
> --
> David Jander
> Protonic Holland.
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
^ permalink raw reply
* Wildcard destination address in SAs in SAD?
From: Markus Stenberg @ 2014-09-10 12:26 UTC (permalink / raw)
To: netdev; +Cc: Markus Stenberg
Let us assume I’m trying to implement RFC4552 (authentication/confidentiality for OSPFv3). What it specifies is basically per-port SA with AH and manual keying, of chosen granularity. As I am quite lazy, I would rather specify just one SA for whole set of routers I happen to manage, with fixed SPI and key material.
Currently, it simply is not possible to configure in sane way without using external daemon that would create SA for every destination a router wants to interact with. That is very suboptimal.
The xfrm code has already concept of ‘wildcard source’. I am proposing to extend the logic also to destinations, with which (for example) securing of all Babel traffic looks like this:
root@ir1:/# ip xfrm state
src :: dst ::
proto esp spi 0x00000042 reqid 42 mode transport
replay-window 0
auth-trunc hmac(md5) 0x666f6f00000000000000000000000000 96
enc cbc(aes) 0x666f6f00000000000000000000000000
sel src ::/0 dst ::/0
root@ir1:/# ip xfrm policy
src ::/0 dst ff02::/16 proto udp dport 6696
dir out priority 0
tmpl src :: dst ::
proto esp reqid 42 mode transport
src ::/0 dst fe80::/64 proto udp dport 6696
dir out priority 0
tmpl src :: dst ::
proto esp reqid 42 mode transport
src ::/0 dst fe80::/64 proto esp
dir in priority 0
tmpl src :: dst ::
proto 0 reqid 42 mode transport
src ::/0 dst ff02::/16 proto esp
dir in priority 0
tmpl src :: dst ::
proto 0 reqid 42 mode transport
root@ir1:/#
I wrote (fairly small) patch for this ( http://www.employees.org/~mstenber/x/0001-xfrm-Support-for-any-dst.patch ). But is this a good idea? The changes are just:
- change xfrm_state_addr_check to allow wildcard (any)
- xfrm_state_lookup checks for both exact dst match, as well as wildcard dst match
- xfrm_state_find checks for exact, dst + src any, and dst/src any
- XFRM_STATE_WILDRECV caused SA to be ignored in some lookups, I don’t know why (it is helpful at times). so I removed the checks against it.
Cheers,
-Markus
^ permalink raw reply
* Re: [PATCH net-next 2/5] ceph: Convert pr_warning to pr_warn
From: Ilya Dryomov @ 2014-09-10 12:30 UTC (permalink / raw)
To: Joe Perches
Cc: netdev, Sage Weil, David S. Miller, Ceph Development,
Linux Kernel Mailing List
In-Reply-To: <714b7551f5a6ea5e721fed705568a39eeae4623b.1410322181.git.joe@perches.com>
On Wed, Sep 10, 2014 at 8:17 AM, Joe Perches <joe@perches.com> wrote:
> Use the more common pr_warn.
>
> Other miscellanea:
>
> o Coalesce formats
> o Realign arguments
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> net/ceph/ceph_common.c | 15 +++++++++------
> net/ceph/messenger.c | 19 ++++++++++---------
> net/ceph/osd_client.c | 15 +++++++--------
> net/ceph/osdmap.c | 20 ++++++++++----------
> 4 files changed, 36 insertions(+), 33 deletions(-)
>
> diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
> index 1675021..58fbfe1 100644
> --- a/net/ceph/ceph_common.c
> +++ b/net/ceph/ceph_common.c
> @@ -293,17 +293,20 @@ static int get_secret(struct ceph_crypto_key *dst, const char *name) {
> key_err = PTR_ERR(ukey);
> switch (key_err) {
> case -ENOKEY:
> - pr_warning("ceph: Mount failed due to key not found: %s\n", name);
> + pr_warn("ceph: Mount failed due to key not found: %s\n",
> + name);
> break;
> case -EKEYEXPIRED:
> - pr_warning("ceph: Mount failed due to expired key: %s\n", name);
> + pr_warn("ceph: Mount failed due to expired key: %s\n",
> + name);
> break;
> case -EKEYREVOKED:
> - pr_warning("ceph: Mount failed due to revoked key: %s\n", name);
> + pr_warn("ceph: Mount failed due to revoked key: %s\n",
> + name);
> break;
> default:
> - pr_warning("ceph: Mount failed due to unknown key error"
> - " %d: %s\n", key_err, name);
> + pr_warn("ceph: Mount failed due to unknown key error %d: %s\n",
> + key_err, name);
> }
> err = -EPERM;
> goto out;
> @@ -433,7 +436,7 @@ ceph_parse_options(char *options, const char *dev_name,
>
> /* misc */
> case Opt_osdtimeout:
> - pr_warning("ignoring deprecated osdtimeout option\n");
> + pr_warn("ignoring deprecated osdtimeout option\n");
> break;
> case Opt_osdkeepalivetimeout:
> opt->osd_keepalive_timeout = intval;
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index b2f571d..a7203be 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -1937,11 +1937,11 @@ static int process_banner(struct ceph_connection *con)
> sizeof(con->peer_addr)) != 0 &&
> !(addr_is_blank(&con->actual_peer_addr.in_addr) &&
> con->actual_peer_addr.nonce == con->peer_addr.nonce)) {
> - pr_warning("wrong peer, want %s/%d, got %s/%d\n",
> - ceph_pr_addr(&con->peer_addr.in_addr),
> - (int)le32_to_cpu(con->peer_addr.nonce),
> - ceph_pr_addr(&con->actual_peer_addr.in_addr),
> - (int)le32_to_cpu(con->actual_peer_addr.nonce));
> + pr_warn("wrong peer, want %s/%d, got %s/%d\n",
> + ceph_pr_addr(&con->peer_addr.in_addr),
> + (int)le32_to_cpu(con->peer_addr.nonce),
> + ceph_pr_addr(&con->actual_peer_addr.in_addr),
> + (int)le32_to_cpu(con->actual_peer_addr.nonce));
> con->error_msg = "wrong peer at address";
> return -1;
> }
> @@ -2302,7 +2302,7 @@ static int read_partial_message(struct ceph_connection *con)
>
> BUG_ON(!con->in_msg ^ skip);
> if (con->in_msg && data_len > con->in_msg->data_length) {
> - pr_warning("%s skipping long message (%u > %zd)\n",
> + pr_warn("%s skipping long message (%u > %zd)\n",
> __func__, data_len, con->in_msg->data_length);
> ceph_msg_put(con->in_msg);
> con->in_msg = NULL;
> @@ -2712,7 +2712,7 @@ static bool con_sock_closed(struct ceph_connection *con)
> CASE(OPEN);
> CASE(STANDBY);
> default:
> - pr_warning("%s con %p unrecognized state %lu\n",
> + pr_warn("%s con %p unrecognized state %lu\n",
> __func__, con, con->state);
> con->error_msg = "unrecognized con state";
> BUG();
> @@ -2828,8 +2828,9 @@ static void con_work(struct work_struct *work)
> */
> static void con_fault(struct ceph_connection *con)
> {
> - pr_warning("%s%lld %s %s\n", ENTITY_NAME(con->peer_name),
> - ceph_pr_addr(&con->peer_addr.in_addr), con->error_msg);
> + pr_warn("%s%lld %s %s\n",
> + ENTITY_NAME(con->peer_name),
> + ceph_pr_addr(&con->peer_addr.in_addr), con->error_msg);
> dout("fault %p state %lu to peer %s\n",
> con, con->state, ceph_pr_addr(&con->peer_addr.in_addr));
>
> diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
> index 30f6faf..8ebb748 100644
> --- a/net/ceph/osd_client.c
> +++ b/net/ceph/osd_client.c
> @@ -1774,8 +1774,8 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg,
> }
> bytes = le32_to_cpu(msg->hdr.data_len);
> if (payload_len != bytes) {
> - pr_warning("sum of op payload lens %d != data_len %d",
> - payload_len, bytes);
> + pr_warn("sum of op payload lens %d != data_len %d\n",
> + payload_len, bytes);
> goto bad_put;
> }
>
> @@ -2797,10 +2797,10 @@ static struct ceph_msg *get_reply(struct ceph_connection *con,
> ceph_msg_revoke_incoming(req->r_reply);
>
> if (front_len > req->r_reply->front_alloc_len) {
> - pr_warning("get_reply front %d > preallocated %d (%u#%llu)\n",
> - front_len, req->r_reply->front_alloc_len,
> - (unsigned int)con->peer_name.type,
> - le64_to_cpu(con->peer_name.num));
> + pr_warn("get_reply front %d > preallocated %d (%u#%llu)\n",
> + front_len, req->r_reply->front_alloc_len,
> + (unsigned int)con->peer_name.type,
> + le64_to_cpu(con->peer_name.num));
> m = ceph_msg_new(CEPH_MSG_OSD_OPREPLY, front_len, GFP_NOFS,
> false);
> if (!m)
> @@ -2823,8 +2823,7 @@ static struct ceph_msg *get_reply(struct ceph_connection *con,
> if (osd_data->pages &&
> unlikely(osd_data->length < data_len)) {
>
> - pr_warning("tid %lld reply has %d bytes "
> - "we had only %llu bytes ready\n",
> + pr_warn("tid %lld reply has %d bytes we had only %llu bytes ready\n",
> tid, data_len, osd_data->length);
> *skip = 1;
> ceph_msg_put(m);
> diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
> index c547e46..ae5a507 100644
> --- a/net/ceph/osdmap.c
> +++ b/net/ceph/osdmap.c
> @@ -521,11 +521,11 @@ static int decode_pool(void **p, void *end, struct ceph_pg_pool_info *pi)
> ev = ceph_decode_8(p); /* encoding version */
> cv = ceph_decode_8(p); /* compat version */
> if (ev < 5) {
> - pr_warning("got v %d < 5 cv %d of ceph_pg_pool\n", ev, cv);
> + pr_warn("got v %d < 5 cv %d of ceph_pg_pool\n", ev, cv);
> return -EINVAL;
> }
> if (cv > 9) {
> - pr_warning("got v %d cv %d > 9 of ceph_pg_pool\n", ev, cv);
> + pr_warn("got v %d cv %d > 9 of ceph_pg_pool\n", ev, cv);
> return -EINVAL;
> }
> len = ceph_decode_32(p);
> @@ -729,9 +729,9 @@ static int get_osdmap_client_data_v(void **p, void *end,
>
> ceph_decode_8_safe(p, end, struct_compat, e_inval);
> if (struct_compat > OSDMAP_WRAPPER_COMPAT_VER) {
> - pr_warning("got v %d cv %d > %d of %s ceph_osdmap\n",
> - struct_v, struct_compat,
> - OSDMAP_WRAPPER_COMPAT_VER, prefix);
> + pr_warn("got v %d cv %d > %d of %s ceph_osdmap\n",
> + struct_v, struct_compat,
> + OSDMAP_WRAPPER_COMPAT_VER, prefix);
> return -EINVAL;
> }
> *p += 4; /* ignore wrapper struct_len */
> @@ -739,9 +739,9 @@ static int get_osdmap_client_data_v(void **p, void *end,
> ceph_decode_8_safe(p, end, struct_v, e_inval);
> ceph_decode_8_safe(p, end, struct_compat, e_inval);
> if (struct_compat > OSDMAP_CLIENT_DATA_COMPAT_VER) {
> - pr_warning("got v %d cv %d > %d of %s ceph_osdmap client data\n",
> - struct_v, struct_compat,
> - OSDMAP_CLIENT_DATA_COMPAT_VER, prefix);
> + pr_warn("got v %d cv %d > %d of %s ceph_osdmap client data\n",
> + struct_v, struct_compat,
> + OSDMAP_CLIENT_DATA_COMPAT_VER, prefix);
> return -EINVAL;
> }
> *p += 4; /* ignore client data struct_len */
> @@ -751,8 +751,8 @@ static int get_osdmap_client_data_v(void **p, void *end,
> *p -= 1;
> ceph_decode_16_safe(p, end, version, e_inval);
> if (version < 6) {
> - pr_warning("got v %d < 6 of %s ceph_osdmap\n", version,
> - prefix);
> + pr_warn("got v %d < 6 of %s ceph_osdmap\n",
> + version, prefix);
> return -EINVAL;
> }
>
> --
> 1.8.1.2.459.gbcd45b4.dirty
Looks good. I'll take it though ceph tree to avoid possible conflicts?
Thanks,
Ilya
^ permalink raw reply
* Re: [Patch net-next 3/5] ipv6: clean up ipv6_dev_ac_inc()
From: Hannes Frederic Sowa @ 2014-09-10 12:23 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev, Hideaki YOSHIFUJI, David S. Miller
In-Reply-To: <1410306738-18036-4-git-send-email-xiyou.wangcong@gmail.com>
On Di, 2014-09-09 at 16:52 -0700, Cong Wang wrote:
> Make it accept inet6_dev, and rename it to __ipv6_dev_ac_inc()
> to reflect this change.
>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> ---
> include/net/addrconf.h | 2 +-
> net/ipv6/addrconf.c | 2 +-
> net/ipv6/anycast.c | 17 +++++------------
> 3 files changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/include/net/addrconf.h b/include/net/addrconf.h
> index f679877..9b1d42e 100644
> --- a/include/net/addrconf.h
> +++ b/include/net/addrconf.h
> @@ -202,7 +202,7 @@ int ipv6_sock_ac_drop(struct sock *sk, int ifindex,
> const struct in6_addr *addr);
> void ipv6_sock_ac_close(struct sock *sk);
>
> -int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
> +int __ipv6_dev_ac_inc(struct inet6_dev *idev, const struct in6_addr *addr);
> int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
> bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
> const struct in6_addr *addr);
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index ad4598f..6b6a373 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -1725,7 +1725,7 @@ static void addrconf_join_anycast(struct inet6_ifaddr *ifp)
> ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
> if (ipv6_addr_any(&addr))
> return;
> - ipv6_dev_ac_inc(ifp->idev->dev, &addr);
> + __ipv6_dev_ac_inc(ifp->idev, &addr);
> }
>
> /* caller must hold RTNL */
> diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
> index d10f2e2..bec8d14 100644
> --- a/net/ipv6/anycast.c
> +++ b/net/ipv6/anycast.c
> @@ -122,7 +122,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
> goto error;
> }
>
> - err = ipv6_dev_ac_inc(dev, addr);
> + err = __ipv6_dev_ac_inc(idev, addr);
> if (!err) {
> pac->acl_next = np->ipv6_ac_list;
> np->ipv6_ac_list = pac;
> @@ -215,20 +215,15 @@ static void aca_put(struct ifacaddr6 *ac)
> /*
> * device anycast group inc (add if not found)
> */
> -int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr)
> +int __ipv6_dev_ac_inc(struct inet6_dev *idev, const struct in6_addr *addr)
> {
> struct ifacaddr6 *aca;
> - struct inet6_dev *idev;
> struct rt6_info *rt;
> int err;
>
> ASSERT_RTNL();
>
> - idev = in6_dev_get(dev);
> -
> - if (idev == NULL)
> - return -EINVAL;
> -
> + in6_dev_hold(idev);
Please move this in6_dev_hold down to where it gets attached to the
ifacaddr6 and remove the in6_dev_put from below the out: label.
> write_lock_bh(&idev->lock);
> if (idev->dead) {
> err = -ENODEV;
> @@ -267,7 +262,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr)
> aca->aca_users = 1;
> /* aca_tstamp should be updated upon changes */
> aca->aca_cstamp = aca->aca_tstamp = jiffies;
> - atomic_set(&aca->aca_refcnt, 2);
> + atomic_set(&aca->aca_refcnt, 1);
> spin_lock_init(&aca->aca_lock);
>
> aca->aca_next = idev->ac_list;
> @@ -276,9 +271,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr)
>
> ip6_ins_rt(rt);
>
> - addrconf_join_solict(dev, &aca->aca_addr);
> -
> - aca_put(aca);
I am not sure why you changed the aca_refcnt code. idev->ac_list is only
protected by idev->lock and you publish one reference and unlock, thus
you need a second reference during addrconf_join_solict. All accesses
should also be protected by rtnl, so it shouldn't be a problem, but if
people review the code they might have problems to figure that out.
Maybe you can also remove the idev->lock?
> + addrconf_join_solict(idev->dev, &aca->aca_addr);
> return 0;
> out:
> write_unlock_bh(&idev->lock);
Thanks,
Hannes
^ permalink raw reply
* Re: [PATCH 09/28] Remove ATHEROS_AR231X
From: Sergey Ryazanov @ 2014-09-10 12:19 UTC (permalink / raw)
To: Jiri Slaby
Cc: John W. Linville, Paul Bolle, Nick Kossifidis, Luis R. Rodriguez,
Oleksij Rempel, Richard Weinberger, Jonathan Bither,
Hauke Mehrtens, ath5k-devel, open,
list@hauke-m.de:NETWORKING DRIVERS, antonynpavlov@gmail.com,
OpenWrt Development List, linux-wireless@vger.kernel.org,
list@hauke-m.de:NETWORKING DRIVERS, open list
In-Reply-To: <541037D2.7060007@gmail.com>
2014-09-10 15:36 GMT+04:00, Jiri Slaby <jirislaby@gmail.com>:
> On 09/10/2014, 12:33 PM, Sergey Ryazanov wrote:
>> 2014-09-09 22:27 GMT+04:00, John W. Linville <linville@tuxdriver.com>:
>>> On Fri, Sep 05, 2014 at 04:02:10PM +0400, Sergey Ryazanov wrote:
>>>> 2014-09-05 15:33 GMT+04:00 Paul Bolle <pebolle@tiscali.nl>:
>>>>> Hi Sergey,
>>>>>
>>>>> On Fri, 2014-09-05 at 15:12 +0400, Sergey Ryazanov wrote:
>>>>>> 2014-09-05 14:10 GMT+04:00, Paul Bolle <pebolle@tiscali.nl>:
>>>>>>> On Wed, 2014-06-18 at 13:46 +0200, Paul Bolle wrote:
>>>>>>>> Having this conversation every rc1 is getting a bit silly. Could
>>>>>>>> Jiri
>>>>>>>> e.a. perhaps set some specific deadline for ATHEROS_AR231X to be
>>>>>>>> submitted?
>>>>>>>
>>>>>>> I waited until rc3. Have you seen any activity on this front? If
>>>>>>> not,
>>>>>>> should I resend the patch that removes the code in mainline that
>>>>>>> depends
>>>>>>> on ATHEROS_AR231X (ie, AHB bus support)?
>>>>>>>
>>>>>> Recent activity always could be found in [1]. Now I finish another
>>>>>> one
>>>>>> round of cleanups and have a plan to fix several things (you can
>>>>>> always find something that you really want to improve). But if you
>>>>>> insist I could immediately switch to "send upstream" mode. And seems
>>>>>> that this would be better approach.
>>>>>>
>>>>>> 1. https://dev.openwrt.org/log/trunk/target/linux/atheros
>>>>>
>>>>> And where can the related PULL requests or patch submissions be found?
>>>>>
>>>> I have not sent patches yet, since I thought that it would be easier
>>>> to cleanup them in openwrt tree and then send them upstream.
>>>
>>> That excuse has worn a bit thin. Perhaps Paul should repost his
>>> removal and you can add a revert to the start of your patch series?
>>>
>> As for me, I do not like such flapping
>
> Agreed in case what you have is in a good enough shape. You (and also
> others) can still clean up the code in upstream too. So, if it is
> mergeable, send it for upstream inclusion now, otherwise I am all for
> John to apply the Paul's patch.
Two days is the last deadline :)
> The unused code has been a way too long
> in the tree now.
Code actively used in owrt firmware and its forks.
--
BR,
Sergey
^ permalink raw reply
* [PATCH net-next 5/5] cxgb4/cxgb4vf: Add device ID for new adapter and remove for dbg adapter
From: Hariprasad Shenai @ 2014-09-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai
In-Reply-To: <1410351271-26428-1-git-send-email-hariprasad@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 ++
.../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 3 +--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index d6a9a0b..f56b95a 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -283,6 +283,7 @@ static const struct pci_device_id cxgb4_pci_tbl[] = {
CH_DEVICE(0x5083, 4),
CH_DEVICE(0x5084, 4),
CH_DEVICE(0x5085, 4),
+ CH_DEVICE(0x5086, 4),
CH_DEVICE(0x5401, 4),
CH_DEVICE(0x5402, 4),
CH_DEVICE(0x5403, 4),
@@ -310,6 +311,7 @@ static const struct pci_device_id cxgb4_pci_tbl[] = {
CH_DEVICE(0x5483, 4),
CH_DEVICE(0x5484, 4),
CH_DEVICE(0x5485, 4),
+ CH_DEVICE(0x5486, 4),
{ 0, }
};
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 2102a4c..8253403 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -2912,7 +2912,6 @@ static void cxgb4vf_pci_shutdown(struct pci_dev *pdev)
static const struct pci_device_id cxgb4vf_pci_tbl[] = {
CH_DEVICE(0xb000, 0), /* PE10K FPGA */
- CH_DEVICE(0x4800, 0), /* T440-dbg */
CH_DEVICE(0x4801, 0), /* T420-cr */
CH_DEVICE(0x4802, 0), /* T422-cr */
CH_DEVICE(0x4803, 0), /* T440-cr */
@@ -2934,7 +2933,6 @@ static const struct pci_device_id cxgb4vf_pci_tbl[] = {
CH_DEVICE(0x4880, 6),
CH_DEVICE(0x4880, 7),
CH_DEVICE(0x4880, 8),
- CH_DEVICE(0x5800, 0), /* T580-dbg */
CH_DEVICE(0x5801, 0), /* T520-cr */
CH_DEVICE(0x5802, 0), /* T522-cr */
CH_DEVICE(0x5803, 0), /* T540-cr */
@@ -2962,6 +2960,7 @@ static const struct pci_device_id cxgb4vf_pci_tbl[] = {
CH_DEVICE(0x5883, 0),
CH_DEVICE(0x5884, 0),
CH_DEVICE(0x5885, 0),
+ CH_DEVICE(0x5886, 0),
{ 0, }
};
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 4/5] cxgb4: Add warning msg when attaching to adapters which have FLASHes smaller than 2Mb
From: Hariprasad Shenai @ 2014-09-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai
In-Reply-To: <1410351271-26428-1-git-send-email-hariprasad@chelsio.com>
Based on original work by Casey Leedom <leedom@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 4 ++++
drivers/net/ethernet/chelsio/cxgb4/t4_hw.h | 6 ++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 586a5f1..22d7581 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -3897,6 +3897,10 @@ static int get_flash_params(struct adapter *adap)
adap->params.sf_size = 1 << info;
adap->params.sf_fw_start =
t4_read_reg(adap, CIM_BOOT_CFG) & BOOTADDR_MASK;
+
+ if (adap->params.sf_size < FLASH_MIN_SIZE)
+ dev_warn(adap->pdev_dev, "WARNING!!! FLASH size %#x < %#x!!!\n",
+ adap->params.sf_size, FLASH_MIN_SIZE);
return 0;
}
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
index 06fa583..6833a7b 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
@@ -206,6 +206,12 @@ enum {
FLASH_CFG_START = FLASH_START(FLASH_CFG_START_SEC),
FLASH_CFG_MAX_SIZE = FLASH_MAX_SIZE(FLASH_CFG_NSECS),
+ /* We don't support FLASH devices which can't support the full
+ * standard set of sections which we need for normal
+ * operations.
+ */
+ FLASH_MIN_SIZE = FLASH_CFG_START + FLASH_CFG_MAX_SIZE,
+
FLASH_FPGA_CFG_START_SEC = 15,
FLASH_FPGA_CFG_START = FLASH_START(FLASH_FPGA_CFG_START_SEC),
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 3/5] cxgb4: Fix t4_flash_erase_sectors() to throw an error when requested to erase sectors which aren't in the FLASH
From: Hariprasad Shenai @ 2014-09-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai
In-Reply-To: <1410351271-26428-1-git-send-email-hariprasad@chelsio.com>
Based on original work by Casey Leedom <leedom@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 7d4cc28..586a5f1 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -1099,6 +1099,9 @@ static int t4_flash_erase_sectors(struct adapter *adapter, int start, int end)
{
int ret = 0;
+ if (end >= adapter->params.sf_nsec)
+ return -EINVAL;
+
while (start <= end) {
if ((ret = sf1_write(adapter, 1, 0, 1, SF_WR_ENABLE)) != 0 ||
(ret = sf1_write(adapter, 4, 0, 1,
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 2/5] cxgb4: Add support to S25FL032P flash
From: Hariprasad Shenai @ 2014-09-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai
In-Reply-To: <1410351271-26428-1-git-send-email-hariprasad@chelsio.com>
Add support for Spansion S25FL032P flash
Based on original work by Dimitris Michailidis
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 41d0446..7d4cc28 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -3850,8 +3850,20 @@ int t4_wait_dev_ready(struct adapter *adap)
return t4_read_reg(adap, PL_WHOAMI) != 0xffffffff ? 0 : -EIO;
}
+struct flash_desc {
+ u32 vendor_and_model_id;
+ u32 size_mb;
+};
+
static int get_flash_params(struct adapter *adap)
{
+ /* Table for non-Numonix supported flash parts. Numonix parts are left
+ * to the preexisting code. All flash parts have 64KB sectors.
+ */
+ static struct flash_desc supported_flash[] = {
+ { 0x150201, 4 << 20 }, /* Spansion 4MB S25FL032P */
+ };
+
int ret;
u32 info;
@@ -3862,6 +3874,14 @@ static int get_flash_params(struct adapter *adap)
if (ret)
return ret;
+ for (ret = 0; ret < ARRAY_SIZE(supported_flash); ++ret)
+ if (supported_flash[ret].vendor_and_model_id == info) {
+ adap->params.sf_size = supported_flash[ret].size_mb;
+ adap->params.sf_nsec =
+ adap->params.sf_size / SF_SEC_SIZE;
+ return 0;
+ }
+
if ((info & 0xff) != 0x20) /* not a Numonix flash */
return -EINVAL;
info >>= 16; /* log2 of size */
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 1/5] cxgb4: Allow T4/T5 firmware sizes up to 1MB
From: Hariprasad Shenai @ 2014-09-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai
In-Reply-To: <1410351271-26428-1-git-send-email-hariprasad@chelsio.com>
Based on original work by Casey Leedom <leedom@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
index 35e3d8e..06fa583 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.h
@@ -175,7 +175,7 @@ enum {
* Location of firmware image in FLASH.
*/
FLASH_FW_START_SEC = 8,
- FLASH_FW_NSECS = 8,
+ FLASH_FW_NSECS = 16,
FLASH_FW_START = FLASH_START(FLASH_FW_START_SEC),
FLASH_FW_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FW_NSECS),
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 0/5] Allow FW size upto 1MB, support for S25FL032P flash and misc. fixes
From: Hariprasad Shenai @ 2014-09-10 12:14 UTC (permalink / raw)
To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai
Hi,
This patch series adds support to allow FW size upto 1MB, support for S25FL032P
flash. Fix t4_flash_erase_sectors to throw an error, when erase sector aren't in
the flash and also warning message when adapters have flashes less than 2Mb.
Adds device id of new adapter and removes device id of debug adapter.
The patches series is created against 'net-next' tree.
And includes patches on cxgb4 driver and cxgb4vf driver.
We have included all the maintainers of respective drivers. Kindly review the
change and let us know in case of any review comments.
Thanks
Hariprasad Shenai (5):
cxgb4: Allow T4/T5 firmware sizes up to 1MB
cxgb4: Add support to S25FL032P flash
cxgb4: Fix t4_flash_erase_sectors() to throw an error when requested
to erase sectors which aren't in the FLASH
cxgb4: Add warning msg when attaching to adapters which have FLASHes
smaller than 2Mb
cxgb4/cxgb4vf: Add device ID for new adapter and remove for dbg
adapter
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 27 ++++++++++++++++++++
drivers/net/ethernet/chelsio/cxgb4/t4_hw.h | 8 +++++-
.../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 3 +-
4 files changed, 37 insertions(+), 3 deletions(-)
^ permalink raw reply
* [PATCH net-next] tipc: fix sparse warnings
From: erik.hugne @ 2014-09-10 12:02 UTC (permalink / raw)
To: netdev; +Cc: tipc-discussion, Erik Hugne
From: Erik Hugne <erik.hugne@ericsson.com>
This fixes the following sparse warnings:
sparse: symbol 'tipc_update_nametbl' was not declared. Should it be static?
Also, the function is changed to return bool upon success, rather than a
potentially freed pointer.
Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
net/tipc/name_distr.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 780ef71..376d2bb 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -284,8 +284,7 @@ static void named_purge_publ(struct publication *publ)
* tipc_nametbl_lock must be held.
* Returns the publication item if successful, otherwise NULL.
*/
-struct publication *tipc_update_nametbl(struct distr_item *i, u32 node,
- u32 dtype)
+static bool tipc_update_nametbl(struct distr_item *i, u32 node, u32 dtype)
{
struct publication *publ = NULL;
@@ -298,6 +297,7 @@ struct publication *tipc_update_nametbl(struct distr_item *i, u32 node,
tipc_nodesub_subscribe(&publ->subscr, node, publ,
(net_ev_handler)
named_purge_publ);
+ return true;
}
} else if (dtype == WITHDRAWAL) {
publ = tipc_nametbl_remove_publ(ntohl(i->type), ntohl(i->lower),
@@ -306,11 +306,12 @@ struct publication *tipc_update_nametbl(struct distr_item *i, u32 node,
if (publ) {
tipc_nodesub_unsubscribe(&publ->subscr);
kfree(publ);
+ return true;
}
} else {
pr_warn("Unrecognized name table message received\n");
}
- return publ;
+ return false;
}
/**
--
1.8.3.2
^ permalink raw reply related
* Re: [PATCH 09/28] Remove ATHEROS_AR231X
From: Jiri Slaby @ 2014-09-10 11:36 UTC (permalink / raw)
To: Sergey Ryazanov, John W. Linville
Cc: Paul Bolle, Nick Kossifidis, Luis R. Rodriguez, Oleksij Rempel,
Richard Weinberger, Jonathan Bither, Hauke Mehrtens,
ath5k-devel-juf53994utBLZpfksSYvnA, open-5/S+JYg5SzeELgA04lAiVw,
list-5/S+JYg5SzeELgA04lAiVw@public.gmane.org:NETWORKING DRIVERS,
antonynpavlov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
OpenWrt Development List,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
list-5/S+JYg5SzeELgA04lAiVw@public.gmane.org:NETWORKING DRIVERS,
open list
In-Reply-To: <CAHNKnsQ8G3ZFHshq7wOqex1J6DbVD5uHVAyvs+aDC2Znk5zWww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 09/10/2014, 12:33 PM, Sergey Ryazanov wrote:
> 2014-09-09 22:27 GMT+04:00, John W. Linville <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>:
>> On Fri, Sep 05, 2014 at 04:02:10PM +0400, Sergey Ryazanov wrote:
>>> 2014-09-05 15:33 GMT+04:00 Paul Bolle <pebolle-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>:
>>>> Hi Sergey,
>>>>
>>>> On Fri, 2014-09-05 at 15:12 +0400, Sergey Ryazanov wrote:
>>>>> 2014-09-05 14:10 GMT+04:00, Paul Bolle <pebolle-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>:
>>>>>> On Wed, 2014-06-18 at 13:46 +0200, Paul Bolle wrote:
>>>>>>> Having this conversation every rc1 is getting a bit silly. Could
>>>>>>> Jiri
>>>>>>> e.a. perhaps set some specific deadline for ATHEROS_AR231X to be
>>>>>>> submitted?
>>>>>>
>>>>>> I waited until rc3. Have you seen any activity on this front? If
>>>>>> not,
>>>>>> should I resend the patch that removes the code in mainline that
>>>>>> depends
>>>>>> on ATHEROS_AR231X (ie, AHB bus support)?
>>>>>>
>>>>> Recent activity always could be found in [1]. Now I finish another one
>>>>> round of cleanups and have a plan to fix several things (you can
>>>>> always find something that you really want to improve). But if you
>>>>> insist I could immediately switch to "send upstream" mode. And seems
>>>>> that this would be better approach.
>>>>>
>>>>> 1. https://dev.openwrt.org/log/trunk/target/linux/atheros
>>>>
>>>> And where can the related PULL requests or patch submissions be found?
>>>>
>>> I have not sent patches yet, since I thought that it would be easier
>>> to cleanup them in openwrt tree and then send them upstream.
>>
>> That excuse has worn a bit thin. Perhaps Paul should repost his
>> removal and you can add a revert to the start of your patch series?
>>
> As for me, I do not like such flapping
Agreed in case what you have is in a good enough shape. You (and also
others) can still clean up the code in upstream too. So, if it is
mergeable, send it for upstream inclusion now, otherwise I am all for
John to apply the Paul's patch. The unused code has been a way too long
in the tree now.
thanks,
--
js
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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 v11 net-next 12/12] bpf: mini eBPF library, test stubs and verifier testsuite
From: Daniel Borkmann @ 2014-09-10 11:35 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: David S. Miller, Ingo Molnar, Linus Torvalds, Andy Lutomirski,
Steven Rostedt, Hannes Frederic Sowa, Chema Gonzalez,
Eric Dumazet, Peter Zijlstra, Pablo Neira Ayuso, H. Peter Anvin,
Andrew Morton, Kees Cook, linux-api-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1410325808-3657-13-git-send-email-ast-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org>
On 09/10/2014 07:10 AM, Alexei Starovoitov wrote:
> 1.
> the library includes a trivial set of BPF syscall wrappers:
> int bpf_create_map(int key_size, int value_size, int max_entries);
> int bpf_update_elem(int fd, void *key, void *value);
> int bpf_lookup_elem(int fd, void *key, void *value);
> int bpf_delete_elem(int fd, void *key);
> int bpf_get_next_key(int fd, void *key, void *next_key);
> int bpf_prog_load(enum bpf_prog_type prog_type,
> const struct sock_filter_int *insns, int insn_len,
> const char *license);
> bpf_prog_load() stores verifier log into global bpf_log_buf[] array
>
> 2.
> test stubs configure eBPF infra with 'unspec' map and program types.
> These are fake types used by user space testsuite only.
>
> 3.
> verifier tests valid and invalid programs and expects predefined
> error log messages from kernel.
> 40 tests so far.
>
> $ sudo ./test_verifier
> #0 add+sub+mul OK
> #1 unreachable OK
> #2 unreachable2 OK
> #3 out of range jump OK
> #4 out of range jump2 OK
> #5 test1 ld_imm64 OK
> ...
>
> Signed-off-by: Alexei Starovoitov <ast-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org>
Since we already have an extensive BPF test suite, that is, lib/test_bpf.c,
which currently also does sanity checks for the classic BPF verifier, is
there a reason these verifier test cases cannot be extended/integrated there
as well but have to go to kernel/bpf/test_stub.c resp. samples/bpf/test_verifier.c ?
I don't like that we put testing code into kernel/bpf/ whereas we already
have a BPF test infrastructure in the kernel elsewhere.
^ permalink raw reply
* Re: [PATCH v2 0/3] net: Add Keystone NetCP ethernet driver support
From: Jamal Hadi Salim @ 2014-09-10 11:33 UTC (permalink / raw)
To: Santosh Shilimkar, David Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
grant.likely-QSEj5FYQhm4dnm+yROfE0A,
devicetree-u79uwXL29TY76Z2rM5mHXA, sandeep_n-l0cyMroinI0,
Benjamin LaHaise, shrijeet Mukherjee
In-Reply-To: <540F1A9A.1020309-l0cyMroinI0@public.gmane.org>
On 09/09/14 11:19, Santosh Shilimkar wrote:
> All the documentation is open including packet accelerator offload
> in ti.com.
Very nice.
Would you do me a kindness and point to the switch interface
documentation (and other ones on that soc)?
> We got such requests from customers but couldn't
> support it for Linux.
It has been difficult because every chip vendor is trying
to do their own thing. Some have huge (fugly) SDKs in user space
which make it worse. Thats the struggle we are trying to
deal with. Of course none of those vendors want to open
up their specs. You present a nice opportunity to not follow
that path.
> We are also looking for such
> support and any direction are welcome. Your slide
> deck seems to capture the key topics like L2/IPSEC
> offload which we are also interested to hear.
>
The slides list the most popular offloads. But not necessarily
all known offloads.
> Just to be clear, your point was about L2 switch offload
> which the driver don't support at the moment. It might confuse
> others. The driver doesn't implements anything non-standard.
>
If i understood you correctly:
Your initial patches dont intend to expose any offloads - you are just
abstracting this as a NIC. I think that is a legit reason.
However, the problem is you are also exposing the packet processors
and switch offloading in a proprietary way.
For a sample of how L2 basic functions like FDB tables are controlled
within a NIC - take a look at the Intel NICs.
Either that or you hide all the offload interfaces and over time add
them (starting with L2 - NICs with L2 are common).
cheers,
jamal
--
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
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