1. 27 10月, 2017 5 次提交
  2. 26 10月, 2017 9 次提交
  3. 23 10月, 2017 1 次提交
    • F
      net: systemport: Guard against unmapped TX ring · e83b1715
      Florian Fainelli 提交于
      Because SYSTEMPORT is a (semi) normal network device, the stack may attempt to
      queue packets on it oustide of the DSA slave transmit path.  When that happens,
      the DSA layer has not had a chance to tag packets with the appropriate per-port
      and per-queue information, and if that happens and we don't have a port 0 queue
      0 available (e.g: on boards where this does not exist), we will hit a NULL
      pointer de-reference in bcm_sysport_select_queue().
      
      Guard against such cases by testing for the TX ring validity.
      
      Fixes: 84ff33eeb23d ("net: systemport: Establish DSA network device queue mapping")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e83b1715
  4. 21 10月, 2017 3 次提交
  5. 18 10月, 2017 1 次提交
    • K
      ethernet/broadcom: Convert timers to use timer_setup() · eb8c6b5b
      Kees Cook 提交于
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      helper to pass the timer pointer explicitly.
      
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: bcm-kernel-feedback-list@broadcom.com
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Jarod Wilson <jarod@redhat.com>
      Cc: netdev@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eb8c6b5b
  6. 17 10月, 2017 1 次提交
    • A
      net: systemport: add NET_DSA dependency · 00fb3a7c
      Arnd Bergmann 提交于
      The notifier cause a link error when NET_DSA is a loadable
      module:
      
      drivers/net/ethernet/broadcom/bcmsysport.o: In function `bcm_sysport_remove':
      bcmsysport.c:(.text+0x1582): undefined reference to `unregister_dsa_notifier'
      drivers/net/ethernet/broadcom/bcmsysport.o: In function `bcm_sysport_probe':
      bcmsysport.c:(.text+0x278d): undefined reference to `register_dsa_notifier'
      
      This adds a dependency that forces the systemport driver to be
      a loadable module as well when that happens, but otherwise
      allows it to be built normally when DSA is either built-in or
      completely disabled.
      
      Fixes: d1565763 ("net: systemport: Establish lower/upper queue mapping")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      00fb3a7c
  7. 15 10月, 2017 6 次提交
  8. 13 10月, 2017 3 次提交
    • R
      net: bgmac: enable master mode for BCM54210E and B50212E PHYs · 12acd136
      Rafał Miłecki 提交于
      There are 4 very similar PHYs:
      0x600d84a1: BCM54210E (rev B0)
      0x600d84a2: BCM54210E (rev B1)
      0x600d84a5: B50212E (rev B0)
      0x600d84a6: B50212E (rev B1)
      that need setting master mode manually. It's because they run in slave
      mode by default with Automatic Slave/Master configuration disabled which
      can lead to unreliable connection with massive ping loss.
      
      So far it was reported for a board with BCM47189 SoC and B50212E B1 PHY
      connected to the bgmac supported ethernet device. Telling PHY driver to
      setup PHY properly solves this issue.
      Signed-off-by: NRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12acd136
    • F
      net: systemport: Turn on ACB at the SYSTEMPORT level · 723934fb
      Florian Fainelli 提交于
      Now that we have established the queue mapping between the switch port
      egress queues and the SYSTEMPORT egress queues, we can turn on Advanced
      Congestion Buffering (ACB) at the SYSTEMPORT level. This enables the
      Ethernet MAC controller to get out of band flow control information
      directly from the switch port and queue that it monitors such that its
      internal TDMA can be appropriately backpressured.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      723934fb
    • F
      net: systemport: Establish lower/upper queue mapping · d1565763
      Florian Fainelli 提交于
      Establish a queue mapping between the DSA slave network device queues
      created that correspond to switch port queues, and the transmit queue
      that SYSTEMPORT manages.
      
      We need to configure the SYSTEMPORT transmit queue with the switch port number
      and switch port queue number in order for the switch and SYSTEMPORT hardware to
      utilize the out of band congestion notification. This hardware mechanism works
      by looking at the switch port egress queue and determines whether there is
      enough buffers for this queue, with that class of service for a successful
      transmission and if not, backpressures the SYSTEMPORT queue that is being used.
      
      For this to work, we implement a notifier which looks at the
      DSA_PORT_REGISTER event.  When DSA network devices are registered, the
      framework calls the DSA notifiers when that happens, extracts the number
      of queues for these devices and their associated port number, remembers
      that in the driver private structure and linearly maps those queues to
      TX rings/queues that we manage.
      
      This scheme works because DSA slave network deviecs always transmit
      through SYSTEMPORT so when DSA slave network devices are
      destroyed/brought down, the corresponding SYSTEMPORT queues are no
      longer used. Also, by design of the DSA framework, the master network
      device (SYSTEMPORT) is registered first.
      
      For faster lookups we use an array of up to DSA_MAX_PORTS * number of
      queues per port, and then map pointers to bcm_sysport_tx_ring such that
      our ndo_select_queue() implementation can just index into that array to
      locate the corresponding ring index.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d1565763
  9. 07 10月, 2017 2 次提交
  10. 02 10月, 2017 6 次提交
  11. 27 9月, 2017 3 次提交
    • D
      bpf: add meta pointer for direct access · de8f3a83
      Daniel Borkmann 提交于
      This work enables generic transfer of metadata from XDP into skb. The
      basic idea is that we can make use of the fact that the resulting skb
      must be linear and already comes with a larger headroom for supporting
      bpf_xdp_adjust_head(), which mangles xdp->data. Here, we base our work
      on a similar principle and introduce a small helper bpf_xdp_adjust_meta()
      for adjusting a new pointer called xdp->data_meta. Thus, the packet has
      a flexible and programmable room for meta data, followed by the actual
      packet data. struct xdp_buff is therefore laid out that we first point
      to data_hard_start, then data_meta directly prepended to data followed
      by data_end marking the end of packet. bpf_xdp_adjust_head() takes into
      account whether we have meta data already prepended and if so, memmove()s
      this along with the given offset provided there's enough room.
      
      xdp->data_meta is optional and programs are not required to use it. The
      rationale is that when we process the packet in XDP (e.g. as DoS filter),
      we can push further meta data along with it for the XDP_PASS case, and
      give the guarantee that a clsact ingress BPF program on the same device
      can pick this up for further post-processing. Since we work with skb
      there, we can also set skb->mark, skb->priority or other skb meta data
      out of BPF, thus having this scratch space generic and programmable
      allows for more flexibility than defining a direct 1:1 transfer of
      potentially new XDP members into skb (it's also more efficient as we
      don't need to initialize/handle each of such new members). The facility
      also works together with GRO aggregation. The scratch space at the head
      of the packet can be multiple of 4 byte up to 32 byte large. Drivers not
      yet supporting xdp->data_meta can simply be set up with xdp->data_meta
      as xdp->data + 1 as bpf_xdp_adjust_meta() will detect this and bail out,
      such that the subsequent match against xdp->data for later access is
      guaranteed to fail.
      
      The verifier treats xdp->data_meta/xdp->data the same way as we treat
      xdp->data/xdp->data_end pointer comparisons. The requirement for doing
      the compare against xdp->data is that it hasn't been modified from it's
      original address we got from ctx access. It may have a range marking
      already from prior successful xdp->data/xdp->data_end pointer comparisons
      though.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NJohn Fastabend <john.fastabend@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de8f3a83
    • H
      net: bcm63xx_enet: Use setup_timer and mod_timer · 3bd3b9ed
      Himanshu Jha 提交于
      Use setup_timer and mod_timer API instead of structure assignments.
      
      This is done using Coccinelle and semantic patch used
      for this as follows:
      
      @@
      expression x,y,z,a,b;
      @@
      
      -init_timer (&x);
      +setup_timer (&x, y, z);
      +mod_timer (&a, b);
      -x.function = y;
      -x.data = z;
      -x.expires = b;
      -add_timer(&a);
      Signed-off-by: NHimanshu Jha <himanshujha199640@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3bd3b9ed
    • T
      bnxt_en: Remove redundant unlikely() · 1fac4b2f
      Tobias Klauser 提交于
      IS_ERR() already implies unlikely(), so it can be omitted.
      Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1fac4b2f