Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
authorDavid S. Miller <davem@davemloft.net>
Wed, 19 Jun 2013 23:49:39 +0000 (16:49 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jun 2013 23:49:39 +0000 (16:49 -0700)
Conflicts:
drivers/net/wireless/ath/ath9k/Kconfig
drivers/net/xen-netback/netback.c
net/batman-adv/bat_iv_ogm.c
net/wireless/nl80211.c

The ath9k Kconfig conflict was a change of a Kconfig option name right
next to the deletion of another option.

The xen-netback conflict was overlapping changes involving the
handling of the notify list in xen_netbk_rx_action().

Batman conflict resolution provided by Antonio Quartulli, basically
keep everything in both conflict hunks.

The nl80211 conflict is a little more involved.  In 'net' we added a
dynamic memory allocation to nl80211_dump_wiphy() to fix a race that
Linus reported.  Meanwhile in 'net-next' the handlers were converted
to use pre and post doit handlers which use a flag to determine
whether to hold the RTNL mutex around the operation.

However, the dump handlers to not use this logic.  Instead they have
to explicitly do the locking.  There were apparent bugs in the
conversion of nl80211_dump_wiphy() in that we were not dropping the
RTNL mutex in all the return paths, and it seems we very much should
be doing so.  So I fixed that whilst handling the overlapping changes.

To simplify the initial returns, I take the RTNL mutex after we try
to allocate 'tb'.

Signed-off-by: David S. Miller <davem@davemloft.net>
39 files changed:
1  2 
MAINTAINERS
drivers/net/bonding/bond_main.c
drivers/net/bonding/bonding.h
drivers/net/ethernet/broadcom/tg3.c
drivers/net/ethernet/emulex/benet/be_main.c
drivers/net/ethernet/renesas/sh_eth.c
drivers/net/ethernet/ti/cpsw.c
drivers/net/macvlan.c
drivers/net/team/team.c
drivers/net/team/team_mode_roundrobin.c
drivers/net/tun.c
drivers/net/vxlan.c
drivers/net/wireless/ath/ath9k/Kconfig
drivers/net/wireless/ath/ath9k/init.c
drivers/net/wireless/iwlwifi/dvm/rs.c
drivers/net/wireless/iwlwifi/iwl-drv.c
drivers/net/wireless/iwlwifi/mvm/rs.c
drivers/net/wireless/iwlwifi/mvm/tx.c
drivers/net/wireless/rt2x00/rt2800lib.c
drivers/net/xen-netback/netback.c
include/linux/filter.h
include/linux/if_team.h
include/net/ip_tunnels.h
net/batman-adv/bat_iv_ogm.c
net/batman-adv/bridge_loop_avoidance.c
net/bridge/br_multicast.c
net/core/ethtool.c
net/ipv4/ip_tunnel.c
net/ipv6/ndisc.c
net/mac80211/cfg.c
net/mac80211/ieee80211_i.h
net/mac80211/mlme.c
net/mac80211/util.c
net/netfilter/ipvs/ip_vs_ctl.c
net/netfilter/nfnetlink_queue_core.c
net/netlink/af_netlink.c
net/packet/af_packet.c
net/sctp/socket.c
net/wireless/nl80211.c

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -30,9 -30,10 +30,11 @@@ static bool rr_transmit(struct team *te
        struct team_port *port;
        int port_index;
  
 -      port_index = rr_priv(team)->sent_packets++ % team->en_port_count;
 +      port_index = team_num_to_port_index(team,
 +                                          rr_priv(team)->sent_packets++);
        port = team_get_port_by_index_rcu(team, port_index);
+       if (unlikely(!port))
+               goto drop;
        port = team_get_first_port_txable_rcu(team, port);
        if (unlikely(!port))
                goto drop;
Simple merge
Simple merge
@@@ -84,13 -84,25 +84,17 @@@ config ATH9K_DFS_CERTIFIE
          developed. At this point enabling this option won't do anything
          except increase code size.
  
- config ATH9K_RATE_CONTROL
 -config ATH9K_MAC_DEBUG
 -      bool "Atheros MAC statistics"
 -      depends on ATH9K_DEBUGFS
 -      default y
 -      ---help---
 -        This option enables collection of statistics for Rx/Tx status
 -        data and some other MAC related statistics
 -
+ config ATH9K_LEGACY_RATE_CONTROL
        bool "Atheros ath9k rate control"
        depends on ATH9K
-       default y
+       default n
        ---help---
          Say Y, if you want to use the ath9k specific rate control
-         module instead of minstrel_ht.
+         module instead of minstrel_ht. Be warned that there are various
+         issues with the ath9k RC and minstrel is a more robust algorithm.
+         Note that even if this option is selected, "ath9k_rate_control"
+         has to be passed to mac80211 using the module parameter,
+         ieee80211_default_rc_algo.
  
  config ATH9K_HTC
         tristate "Atheros HTC based wireless cards support"
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -789,8 -783,9 +790,9 @@@ static void xen_netbk_rx_action(struct 
        }
  
        list_for_each_entry_safe(vif, tmp, &notify, notify_list) {
 -              notify_remote_via_irq(vif->irq);
 +              notify_remote_via_irq(vif->rx_irq);
                list_del_init(&vif->notify_list);
+               xenvif_put(vif);
        }
  
        /* More work to do? */
Simple merge
Simple merge
@@@ -95,13 -95,13 +95,13 @@@ struct ip_tunnel_net 
  int ip_tunnel_init(struct net_device *dev);
  void ip_tunnel_uninit(struct net_device *dev);
  void  ip_tunnel_dellink(struct net_device *dev, struct list_head *head);
- int __net_init ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
-                                 struct rtnl_link_ops *ops, char *devname);
+ int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
+                      struct rtnl_link_ops *ops, char *devname);
  
- void __net_exit ip_tunnel_delete_net(struct ip_tunnel_net *itn);
+ void ip_tunnel_delete_net(struct ip_tunnel_net *itn);
  
  void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
 -                  const struct iphdr *tnl_params);
 +                  const struct iphdr *tnl_params, const u8 protocol);
  int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd);
  int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu);
  
  #include "network-coding.h"
  
  /**
 + * batadv_ring_buffer_set - update the ring buffer with the given value
 + * @lq_recv: pointer to the ring buffer
 + * @lq_index: index to store the value at
 + * @value: value to store in the ring buffer
 + */
 +static void batadv_ring_buffer_set(uint8_t lq_recv[], uint8_t *lq_index,
 +                                 uint8_t value)
 +{
 +      lq_recv[*lq_index] = value;
 +      *lq_index = (*lq_index + 1) % BATADV_TQ_GLOBAL_WINDOW_SIZE;
 +}
 +
 +/**
 + * batadv_ring_buffer_set - compute the average of all non-zero values stored
 + * in the given ring buffer
 + * @lq_recv: pointer to the ring buffer
 + *
 + * Returns computed average value.
 + */
 +static uint8_t batadv_ring_buffer_avg(const uint8_t lq_recv[])
 +{
 +      const uint8_t *ptr;
 +      uint16_t count = 0, i = 0, sum = 0;
 +
 +      ptr = lq_recv;
 +
 +      while (i < BATADV_TQ_GLOBAL_WINDOW_SIZE) {
 +              if (*ptr != 0) {
 +                      count++;
 +                      sum += *ptr;
 +              }
 +
 +              i++;
 +              ptr++;
 +      }
 +
 +      if (count == 0)
 +              return 0;
 +
 +      return (uint8_t)(sum / count);
 +}
++
++/*
+  * batadv_dup_status - duplicate status
+  * @BATADV_NO_DUP: the packet is a duplicate
+  * @BATADV_ORIG_DUP: OGM is a duplicate in the originator (but not for the
+  *  neighbor)
+  * @BATADV_NEIGH_DUP: OGM is a duplicate for the neighbor
+  * @BATADV_PROTECTED: originator is currently protected (after reboot)
+  */
+ enum batadv_dup_status {
+       BATADV_NO_DUP = 0,
+       BATADV_ORIG_DUP,
+       BATADV_NEIGH_DUP,
+       BATADV_PROTECTED,
+ };
  static struct batadv_neigh_node *
  batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface,
                        const uint8_t *neigh_addr,
@@@ -1062,10 -1013,11 +1085,11 @@@ static void batadv_iv_ogm_process(cons
        struct batadv_neigh_node *orig_neigh_router = NULL;
        int has_directlink_flag;
        int is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0;
 -      int is_broadcast = 0, is_bidirect;
 +      int is_bidirect;
        bool is_single_hop_neigh = false;
        bool is_from_best_next_hop = false;
-       int is_duplicate, sameseq, simlar_ttl;
+       int sameseq, similar_ttl;
+       enum batadv_dup_status dup_status;
        uint32_t if_incoming_seqno;
        uint8_t *prev_sender;
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -2637,12 -2743,16 +2707,15 @@@ static bool ieee80211_assoc_success(str
        ieee80211_sta_rx_notify(sdata, (struct ieee80211_hdr *)mgmt);
        ieee80211_sta_reset_beacon_monitor(sdata);
  
-       return true;
+       ret = true;
+  out:
+       kfree(bss_ies);
+       return ret;
  }
  
 -static enum rx_mgmt_action __must_check
 -ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
 -                           struct ieee80211_mgmt *mgmt, size_t len,
 -                           struct cfg80211_bss **bss)
 +static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
 +                                       struct ieee80211_mgmt *mgmt,
 +                                       size_t len)
  {
        struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
        struct ieee80211_mgd_assoc_data *assoc_data = ifmgd->assoc_data;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1527,12 -1564,17 +1527,18 @@@ static int nl80211_dump_wiphy(struct sk
        struct cfg80211_registered_device *dev;
        s64 filter_wiphy = -1;
        bool split = false;
-       struct nlattr **tb = nl80211_fam.attrbuf;
+       struct nlattr **tb;
        int res;
  
 -      mutex_lock(&cfg80211_mutex);
+       /* will be zeroed in nlmsg_parse() */
+       tb = kmalloc(sizeof(*tb) * (NL80211_ATTR_MAX + 1), GFP_KERNEL);
+       if (!tb)
+               return -ENOMEM;
 +      rtnl_lock();
++
        res = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize,
-                         tb, nl80211_fam.maxattr, nl80211_policy);
+                         tb, NL80211_ATTR_MAX, nl80211_policy);
        if (res == 0) {
                split = tb[NL80211_ATTR_SPLIT_WIPHY_DUMP];
                if (tb[NL80211_ATTR_WIPHY])
                        int ifidx = nla_get_u32(tb[NL80211_ATTR_IFINDEX]);
  
                        netdev = dev_get_by_index(sock_net(skb->sk), ifidx);
-                       if (!netdev)
+                       if (!netdev) {
 -                              mutex_unlock(&cfg80211_mutex);
++                              rtnl_unlock();
+                               kfree(tb);
                                return -ENODEV;
+                       }
                        if (netdev->ieee80211_ptr) {
                                dev = wiphy_to_dev(
                                        netdev->ieee80211_ptr->wiphy);
                                    !skb->len &&
                                    cb->min_dump_alloc < 4096) {
                                        cb->min_dump_alloc = 4096;
 -                                      mutex_unlock(&cfg80211_mutex);
++                                      rtnl_unlock();
                                        return 1;
                                }
                                idx--;