1. 30 Sep, 2016 14 commits
  2. 28 Sep, 2016 1 commit
    • Johannes Berg's avatar
      cfg80211: wext: really don't store non-WEP keys · 8f7d99ba
      Johannes Berg authored
      Jouni reported that during (repeated) wext_pmf test runs (from the
      wpa_supplicant hwsim test suite) the kernel crashes. The reason is
      that after the key is set, the wext code still unnecessarily stores
      it into the key cache. Despite smatch pointing out an overflow, I
      failed to identify the possibility for this in the code and missed
      it during development of the earlier patch series.
      
      In order to fix this, simply check that we never store anything but
      WEP keys into the cache, adding a comment as to why that's enough.
      
      Also, since the cache is still allocated early even if it won't be
      used in many cases, add a comment explaining why - otherwise we'd
      have to roll back key settings to the driver in case of allocation
      failures, which is far more difficult.
      
      Fixes: 89b706fb
      
       ("cfg80211: reduce connect key caching struct size")
      Reported-by: default avatarJouni Malinen <j@w1.fi>
      Bisected-by: default avatarJouni Malinen <j@w1.fi>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      8f7d99ba
  3. 26 Sep, 2016 2 commits
  4. 19 Sep, 2016 9 commits
    • Eric Dumazet's avatar
      pkt_sched: fq: use proper locking in fq_dump_stats() · 695b4ec0
      Eric Dumazet authored
      When fq is used on 32bit kernels, we need to lock the qdisc before
      copying 64bit fields.
      
      Otherwise "tc -s qdisc ..." might report bogus values.
      
      Fixes: afe4fd06
      
       ("pkt_sched: fq: Fair Queue packet scheduler")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      695b4ec0
    • Thadeu Lima de Souza Cascardo's avatar
      openvswitch: use percpu flow stats · db74a333
      Thadeu Lima de Souza Cascardo authored
      
      
      Instead of using flow stats per NUMA node, use it per CPU. When using
      megaflows, the stats lock can be a bottleneck in scalability.
      
      On a E5-2690 12-core system, usual throughput went from ~4Mpps to
      ~15Mpps when forwarding between two 40GbE ports with a single flow
      configured on the datapath.
      
      This has been tested on a system with possible CPUs 0-7,16-23. After
      module removal, there were no corruption on the slab cache.
      Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@redhat.com>
      Cc: pravin shelar <pshelar@ovn.org>
      Acked-by: default avatarPravin B Shelar <pshelar@ovn.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      db74a333
    • Thadeu Lima de Souza Cascardo's avatar
      openvswitch: fix flow stats accounting when node 0 is not possible · 40773966
      Thadeu Lima de Souza Cascardo authored
      
      
      On a system with only node 1 as possible, all statistics is going to be
      accounted on node 0 as it will have a single writer.
      
      However, when getting and clearing the statistics, node 0 is not going
      to be considered, as it's not a possible node.
      
      Tested that statistics are not zero on a system with only node 1
      possible. Also compile-tested with CONFIG_NUMA off.
      Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@redhat.com>
      Acked-by: default avatarPravin B Shelar <pshelar@ovn.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      40773966
    • Xin Long's avatar
      sctp: not return ENOMEM err back in sctp_packet_transmit · 41001faf
      Xin Long authored
      
      
      As David and Marcelo's suggestion, ENOMEM err shouldn't return back to
      user in transmit path. Instead, sctp's retransmit would take care of
      the chunks that fail to send because of ENOMEM.
      
      This patch is only to do some release job when alloc_skb fails, not to
      return ENOMEM back any more.
      
      Besides, it also cleans up sctp_packet_transmit's err path, and fixes
      some issues in err path:
      
       - It didn't free the head skb in nomem: path.
       - No need to check nskb in no_route: path.
       - It should goto err: path if alloc_skb fails for head.
       - Not all the NOMEMs should free nskb.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41001faf
    • Xin Long's avatar
      sctp: make sctp_outq_flush/tail/uncork return void · 83dbc3d4
      Xin Long authored
      
      
      sctp_outq_flush return value is meaningless now, this patch is
      to make sctp_outq_flush return void, as well as sctp_outq_fail
      and sctp_outq_uncork.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      83dbc3d4
    • Xin Long's avatar
      sctp: save transmit error to sk_err in sctp_outq_flush · 64519440
      Xin Long authored
      
      
      Every time when sctp calls sctp_outq_flush, it sends out the chunks of
      control queue, retransmit queue and data queue. Even if some trunks are
      failed to transmit, it still has to flush all the transports, as it's
      the only chance to clean that transmit_list.
      
      So the latest transmit error here should be returned back. This transmit
      error is an internal error of sctp stack.
      
      I checked all the places where it uses the transmit error (the return
      value of sctp_outq_flush), most of them are actually just save it to
      sk_err.
      
      Except for sctp_assoc/endpoint_bh_rcv, they will drop the chunk if
      it's failed to send a REPLY, which is actually incorrect, as we can't
      be sure the error that sctp_outq_flush returns is from sending that
      REPLY.
      
      So it's meaningless for sctp_outq_flush to return error back.
      
      This patch is to save transmit error to sk_err in sctp_outq_flush, the
      new error can update the old value. Eventually, sctp_wait_for_* would
      check for it.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64519440
    • Xin Long's avatar
      sctp: free msg->chunks when sctp_primitive_SEND return err · b61c654f
      Xin Long authored
      Last patch "sctp: do not return the transmit err back to sctp_sendmsg"
      made sctp_primitive_SEND return err only when asoc state is unavailable.
      In this case, chunks are not enqueued, they have no chance to be freed if
      we don't take care of them later.
      
      This Patch is actually to revert commit 1cd4d5c4 ("sctp: remove the
      unused sctp_datamsg_free()"), commit 69b5777f ("sctp: hold the chunks
      only after the chunk is enqueued in outq") and commit 8b570dc9 ("sctp:
      only drop the reference on the datamsg after sending a msg"), to use
      sctp_datamsg_free to free the chunks of current msg.
      
      Fixes: 8b570dc9
      
       ("sctp: only drop the reference on the datamsg after sending a msg")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b61c654f
    • Xin Long's avatar
      sctp: do not return the transmit err back to sctp_sendmsg · 66388f2c
      Xin Long authored
      Once a chunk is enqueued successfully, sctp queues can take care of it.
      Even if it is failed to transmit (like because of nomem), it should be
      put into retransmit queue.
      
      If sctp report this error to users, it confuses them, they may resend
      that msg, but actually in kernel sctp stack is in charge of retransmit
      it already.
      
      Besides, this error probably is not from the failure of transmitting
      current msg, but transmitting or retransmitting another msg's chunks,
      as sctp_outq_flush just tries to send out all transports' chunks.
      
      This patch is to make sctp_cmd_send_msg return avoid, and not return the
      transmit err back to sctp_sendmsg
      
      Fixes: 8b570dc9
      
       ("sctp: only drop the reference on the datamsg after sending a msg")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      66388f2c
    • Xin Long's avatar
      sctp: remove the unnecessary state check in sctp_outq_tail · 2c89791e
      Xin Long authored
      
      
      Data Chunks are only sent by sctp_primitive_SEND, in which sctp checks
      the asoc's state through statetable before calling sctp_outq_tail. So
      there's no need to check the asoc's state again in sctp_outq_tail.
      
      Besides, sctp_do_sm is protected by lock_sock, even if sending msg is
      interrupted by timer events, the event's processes still need to acquire
      lock_sock first. It means no others CMDs can be enqueue into side effect
      list before CMD_SEND_MSG to change asoc->state, so it's safe to remove it.
      
      This patch is to remove redundant asoc->state check from sctp_outq_tail.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2c89791e
  5. 17 Sep, 2016 6 commits
  6. 16 Sep, 2016 7 commits
  7. 15 Sep, 2016 1 commit
    • Jamal Hadi Salim's avatar
      net_sched: Introduce skbmod action · 86da71b5
      Jamal Hadi Salim authored
      
      
      This action is intended to be an upgrade from a usability perspective
      from pedit (as well as operational debugability).
      Compare this:
      
      sudo tc filter add dev $ETH parent 1: protocol ip prio 10 \
      u32 match ip protocol 1 0xff flowid 1:2 \
      action pedit munge offset -14 u8 set 0x02 \
      munge offset -13 u8 set 0x15 \
      munge offset -12 u8 set 0x15 \
      munge offset -11 u8 set 0x15 \
      munge offset -10 u16 set 0x1515 \
      pipe
      
      to:
      
      sudo tc filter add dev $ETH parent 1: protocol ip prio 10 \
      u32 match ip protocol 1 0xff flowid 1:2 \
      action skbmod dmac 02:15:15:15:15:15
      
      Also try to do a MAC address swap with pedit or worse
      try to debug a policy with destination mac, source mac and
      etherype. Then make few rules out of those and you'll get my point.
      
      In the future common use cases on pedit can be migrated to this action
      (as an example different fields in ip v4/6, transports like tcp/udp/sctp
      etc). For this first cut, this allows modifying basic ethernet header.
      
      The most important ethernet use case at the moment is when redirecting or
      mirroring packets to a remote machine. The dst mac address needs a re-write
      so that it doesnt get dropped or confuse an interconnecting (learning) switch
      or dropped by a target machine (which looks at the dst mac). And at times
      when flipping back the packet a swap of the MAC addresses is needed.
      Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      86da71b5