1. 06 10月, 2020 23 次提交
  2. 05 10月, 2020 17 次提交
    • J
      net: phy: marvell: Use phy_read_paged() instead of open coding it · f4f9dcc3
      Jisheng Zhang 提交于
      Convert m88e1318_get_wol() to use the well implemented phy_read_paged()
      instead of open coding it.
      Signed-off-by: NJisheng Zhang <Jisheng.Zhang@synaptics.com>
      Reviewed-by: NMarek Behún <kabel@kernel.org>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f4f9dcc3
    • V
      net: dsa: propagate switchdev vlan_filtering prepare phase to drivers · 2e554a7a
      Vladimir Oltean 提交于
      A driver may refuse to enable VLAN filtering for any reason beyond what
      the DSA framework cares about, such as:
      - having tc-flower rules that rely on the switch being VLAN-aware
      - the particular switch does not support VLAN, even if the driver does
        (the DSA framework just checks for the presence of the .port_vlan_add
        and .port_vlan_del pointers)
      - simply not supporting this configuration to be toggled at runtime
      
      Currently, when a driver rejects a configuration it cannot support, it
      does this from the commit phase, which triggers various warnings in
      switchdev.
      
      So propagate the prepare phase to drivers, to give them the ability to
      refuse invalid configurations cleanly and avoid the warnings.
      
      Since we need to modify all function prototypes and check for the
      prepare phase from within the drivers, take that opportunity and move
      the existing driver restrictions within the prepare phase where that is
      possible and easy.
      
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Cc: Woojung Huh <woojung.huh@microchip.com>
      Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
      Cc: Sean Wang <sean.wang@mediatek.com>
      Cc: Landen Chao <Landen.Chao@mediatek.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Jonathan McDowell <noodles@earth.li>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Claudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e554a7a
    • A
      platform/x86: thinkpad_acpi: re-initialize ACPI buffer size when reuse · 720ef73d
      Aaron Ma 提交于
      Evaluating ACPI _BCL could fail, then ACPI buffer size will be set to 0.
      When reuse this ACPI buffer, AE_BUFFER_OVERFLOW will be triggered.
      
      Re-initialize buffer size will make ACPI evaluate successfully.
      
      Fixes: 46445b6b ("thinkpad-acpi: fix handle locate for video and query of _BCL")
      Signed-off-by: NAaron Ma <aaron.ma@canonical.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      720ef73d
    • D
      Merge branch 'net-Constify-struct-genl_small_ops' · c2568c8c
      David S. Miller 提交于
      Rikard Falkeborn says:
      
      ====================
      net: Constify struct genl_small_ops
      
      Make a couple of static struct genl_small_ops const to allow the compiler
      to put them in read-only memory. Patches are independent.
      
      v2: Rebase on net-next, genl_ops -> genl_small_ops
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c2568c8c
    • R
      net: openvswitch: Constify static struct genl_small_ops · b980b313
      Rikard Falkeborn 提交于
      The only usage of these is to assign their address to the small_ops field
      in the genl_family struct, which is a const pointer, and applying
      ARRAY_SIZE() on them. Make them const to allow the compiler to put them
      in read-only memory.
      Signed-off-by: NRikard Falkeborn <rikard.falkeborn@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b980b313
    • R
      mptcp: Constify mptcp_pm_ops · 674d3ab9
      Rikard Falkeborn 提交于
      The only usages of mptcp_pm_ops is to assign its address to the small_ops
      field of the genl_family struct, which is a const pointer, and applying
      ARRAY_SIZE() on it. Make it const to allow the compiler to put it in
      read-only memory.
      Signed-off-by: NRikard Falkeborn <rikard.falkeborn@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      674d3ab9
    • L
      Linux 5.9-rc8 · 549738f1
      Linus Torvalds 提交于
      549738f1
    • X
      drivers/net/wan/hdlc_fr: Improvements to the code of pvc_xmit · f5083d0c
      Xie He 提交于
      1. Keep the code for the normal (non-error) flow at the lowest
      indentation level. And use "goto drop" for all error handling.
      
      2. Replace code that pads short Ethernet frames with a "__skb_pad" call.
      
      3. Change "dev_kfree_skb" to "kfree_skb" in error handling code.
      "kfree_skb" is the correct function to call when dropping an skb due to
      an error. "dev_kfree_skb", which is an alias of "consume_skb", is for
      dropping skbs normally (not due to an error).
      
      Cc: Krzysztof Halasa <khc@pm.waw.pl>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NXie He <xie.he.0141@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f5083d0c
    • G
      net/core: check length before updating Ethertype in skb_mpls_{push,pop} · 4296adc3
      Guillaume Nault 提交于
      Openvswitch allows to drop a packet's Ethernet header, therefore
      skb_mpls_push() and skb_mpls_pop() might be called with ethernet=true
      and mac_len=0. In that case the pointer passed to skb_mod_eth_type()
      doesn't point to an Ethernet header and the new Ethertype is written at
      unexpected locations.
      
      Fix this by verifying that mac_len is big enough to contain an Ethernet
      header.
      
      Fixes: fa4e0f88 ("net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions")
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Acked-by: NDavide Caratti <dcaratti@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4296adc3
    • T
      net: mvneta: fix double free of txq->buf · f4544e53
      Tom Rix 提交于
      clang static analysis reports this problem:
      
      drivers/net/ethernet/marvell/mvneta.c:3465:2: warning:
        Attempt to free released memory
              kfree(txq->buf);
              ^~~~~~~~~~~~~~~
      
      When mvneta_txq_sw_init() fails to alloc txq->tso_hdrs,
      it frees without poisoning txq->buf.  The error is caught
      in the mvneta_setup_txqs() caller which handles the error
      by cleaning up all of the txqs with a call to
      mvneta_txq_sw_deinit which also frees txq->buf.
      
      Since mvneta_txq_sw_deinit is a general cleaner, all of the
      partial cleaning in mvneta_txq_sw_deinit()'s error handling
      is not needed.
      
      Fixes: 2adb719d ("net: mvneta: Implement software TSO")
      Signed-off-by: NTom Rix <trix@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f4544e53
    • C
      net_sched: check error pointer in tcf_dump_walker() · 580e4273
      Cong Wang 提交于
      Although we take RTNL on dump path, it is possible to
      skip RTNL on insertion path. So the following race condition
      is possible:
      
      rtnl_lock()		// no rtnl lock
      			mutex_lock(&idrinfo->lock);
      			// insert ERR_PTR(-EBUSY)
      			mutex_unlock(&idrinfo->lock);
      tc_dump_action()
      rtnl_unlock()
      
      So we have to skip those temporary -EBUSY entries on dump path
      too.
      
      Reported-and-tested-by: syzbot+b47bc4f247856fb4d9e1@syzkaller.appspotmail.com
      Fixes: 0fedc63f ("net_sched: commit action insertions together")
      Cc: Vlad Buslov <vladbu@mellanox.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      580e4273
    • A
      net: team: fix memory leak in __team_options_register · 9a9e7749
      Anant Thazhemadam 提交于
      The variable "i" isn't initialized back correctly after the first loop
      under the label inst_rollback gets executed.
      
      The value of "i" is assigned to be option_count - 1, and the ensuing
      loop (under alloc_rollback) begins by initializing i--.
      Thus, the value of i when the loop begins execution will now become
      i = option_count - 2.
      
      Thus, when kfree(dst_opts[i]) is called in the second loop in this
      order, (i.e., inst_rollback followed by alloc_rollback),
      dst_optsp[option_count - 2] is the first element freed, and
      dst_opts[option_count - 1] does not get freed, and thus, a memory
      leak is caused.
      
      This memory leak can be fixed, by assigning i = option_count (instead of
      option_count - 1).
      
      Fixes: 80f7c668 ("team: add support for per-port options")
      Reported-by: syzbot+69b804437cfec30deac3@syzkaller.appspotmail.com
      Tested-by: syzbot+69b804437cfec30deac3@syzkaller.appspotmail.com
      Signed-off-by: NAnant Thazhemadam <anant.thazhemadam@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a9e7749
    • D
      Merge branch 'bnxt_en-net-next-updates' · 3e233cac
      David S. Miller 提交于
      Michael Chan says:
      
      ====================
      bnxt_en: net-next updates.
      
      This series starts off with the usual update of the firmware interface
      spec.  A new firmware status bit in the interface will be used in patch
      add the infrastructure to read the firmware status very early during
      driver probe and this will allow patch #4 to do the recovery if needed.
      
      The rest of the patches add improvements to the current RX reset
      logic by localizing the reset to the affected RX ring only and to
      reset only if firmware has determined that the RX ring is in permanent
      error state.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3e233cac
    • M
      bnxt_en: Eliminate unnecessary RX resets. · 8d4bd96b
      Michael Chan 提交于
      Currently, the driver will schedule RX ring reset when we get a buffer
      error in the RX completion record.  These RX buffer errors can be due
      to normal out-of-buffer conditions or a permanent error in the RX
      ring.  Because the driver cannot distinguish between these 2
      conditions, we assume all these buffer errors require reset.
      
      This is very disruptive when it is just a normal out-of-buffer
      condition.  Newer firmware will now monitor the rings for the permanent
      failure and will send a notification to the driver when it happens.
      This allows the driver to reset only when such a notification is
      received.  In environments where we have predominently out-of-buffer
      conditions, we now can avoid these unnecessary resets.
      Reviewed-by: NEdwin Peer <edwin.peer@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d4bd96b
    • M
      bnxt_en: Reduce unnecessary message log during RX errors. · 1b5c8b63
      Michael Chan 提交于
      There is logic in the RX path to detect unexpected handles in the
      RX completion.  We'll print a warning and schedule a reset.  The
      next expected handle is then set to 0xffff which is guaranteed to
      not match any valid handle.  This will force all remaining packets in
      the ring to be discarded before the reset.  There can be hundreds of
      these packets remaining in the ring and there is no need to print the
      warnings for these forced errors.
      Reviewed-by: NPavan Chebbi <pavan.chebbi@broadcom.com>
      Reviewed-by: NEdwin Peer <edwin.peer@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b5c8b63
    • M
      bnxt_en: Add a software counter for RX ring reset. · 8a27d4b9
      Michael Chan 提交于
      Add a per ring rx_resets counter to count these RX resets.
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a27d4b9
    • M
      bnxt_en: Implement RX ring reset in response to buffer errors. · 8fbf58e1
      Michael Chan 提交于
      On some older chips, it is necessary to do a reset when we get buffer
      errors associated with an RX ring.  These buffer errors may become
      frequent if the RX ring underruns under heavy traffic.  The current
      code does a global reset of all reasources when this happens.  This
      works but creates a big disruption of all rings when one RX ring is
      having problem.  This patch implements a localized RX ring reset of
      just the RX ring having the issue.  All other rings including all
      TX rings will not be affected by this single RX ring reset.
      
      Only the older chips prior to the P5 class supports this reset.
      Because it is not a global reset, packets may still be arriving
      while we are calling firmware to reset that ring.  We need to be
      sure that we don't post any buffers during this time while the
      ring is undergoing reset.  After firmware completes successfully,
      the ring will be in the reset state with no buffers and we can start
      filling it with new buffers and posting them.
      Reviewed-by: NPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: NEdwin Peer <edwin.peer@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8fbf58e1