1. 29 May, 2018 40 commits
    • Vaibhav Murkute's avatar
      Bluetooth: hci_serdev: Removed unnecessary curly braces · 0c0c09ff
      Vaibhav Murkute authored
      checkpatch.pl shows a warning for these unnecessary curly braces.
      so just removed those curly braces.
      Signed-off-by: default avatarVaibhav Murkute <vaibhavmurkute88@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      0c0c09ff
    • Arend van Spriel's avatar
      Bluetooth: btmrvl: support sysfs initiated firmware coredump · 45650499
      Arend van Spriel authored
      Since commit 3c47d19f ("drivers: base: add coredump driver ops")
      it is possible to initiate a device coredump from user-space. This
      patch adds support for it in btmrvl_sdio adding the .coredump()
      driver callback. This makes dump through debugfs obsolete so removing
      it.
      Signed-off-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      45650499
    • Takashi Iwai's avatar
      Bluetooth: btusb: Apply QCA Rome patches for some ATH3012 models · 803cdb8c
      Takashi Iwai authored
      In commit f44cb4b1 ("Bluetooth: btusb: Fix quirk for Atheros
      1525/QCA6174") we tried to address the non-working Atheros BT devices
      by changing the quirk from BTUSB_ATH3012 to BTUSB_QCA_ROME.  This made
      such devices working while it turned out to break other existing chips
      with the very same USB ID, hence it was reverted afterwards.
      
      This is another attempt to tackle the issue.  The essential point to
      use BTUSB_QCA_ROME is to apply the btusb_setup_qca() and do RAM-
      patching.  And the previous attempt failed because btusb_setup_qca()
      returns -ENODEV if the ROM version doesn't match with the expected
      ones.  For some devices that have already the "correct" ROM versions,
      we may just skip the setup procedure and continue the rest.
      
      So, the first fix we'll need is to add a check of the ROM version in
      the function to skip the setup if the ROM version looks already sane,
      so that it can be applied for all ath devices.
      
      However, the world is a bit more complex than that simple solution.
      Since BTUSB_ATH3012 quirk checks the bcdDevice and bails out when it's
      0x0001 at the beginning of probing, so the device probe always aborts
      here.
      
      In this patch, we add another check of ROM version again, and if the
      device needs patching, the probe continues.  For that, a slight
      refactoring of btusb_qca_send_vendor_req() was required so that the
      probe function can pass usb_device pointer directly before allocating
      hci_dev stuff.
      
      Fixes: commit f44cb4b1 ("Bluetooth: btusb: Fix quirk for Atheros 1525/QCA6174")
      Bugzilla: http://bugzilla.opensuse.org/show_bug.cgi?id=1082504Tested-by: default avatarIvan Levshin <ivan.levshin@microfocus.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      803cdb8c
    • Jian-Hong Pan's avatar
      Bluetooth: btusb: Add a new Realtek 8723DE ID 2ff8:b011 · 66d9975c
      Jian-Hong Pan authored
      Without this patch we cannot turn on the Bluethooth adapter on ASUS
      E406MA.
      
      T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=2ff8 ProdID=b011 Rev= 2.00
      S:  Manufacturer=Realtek
      S:  Product=802.11n WLAN Adapter
      S:  SerialNumber=00e04c000001
      C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      Signed-off-by: default avatarJian-Hong Pan <jian-hong@endlessm.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      66d9975c
    • David S. Miller's avatar
      Merge tag 'mlx5e-updates-2018-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 874fcf1d
      David S. Miller authored
      Saeed Mahameed says:
      
      ====================
      mlx5e-updates-2018-05-25
      
      This series includes updates for mlx5e netdev driver.
      
      1) Allowr flow based VF vport mirroring under sriov switchdev scheme,
      added support for offloading the TC mirred mirror sub-action, from
      Chris Mi.
      
      =================
      From: Or Gerlitz <ogerlitz@mellanox.com>
      
      The user will typically set the actions order such that the mirror
      port (mirror VF) sees packets as the original port (VF under
      mirroring) sent them or as it will receive them. In the general case,
      it means that packets are potentially sent to the mirror port before
      or after some actions were applied on them.
      
      To properly do that, we follow on the exact action order as set for
      the flow and make sure this will also be the case when we program the
      HW offload.
      
      If all the actions should apply before forwarding to the mirror and dest port,
      mirroring is just multicasting to the two vports. Otherwise, we split
      the TC flow to two HW rules, where the 1st applies only the actions
      needed up to the mirror (if there are such) and the 2nd the rest of
      the actions plus the forwarding to the dest vport.
      =================
      
      2) Move to order-0 only allocations (using fragmented work queues) for all
      work queues used by the driver, RX and TX descriptor rings
      (RQs, SQs and Completion Queues (CQs)), from Tariq Toukan.
      
      3) Avoid resetting netdevice statistics on netdevice
      state changes, from Eran Ben Elisha.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      874fcf1d
    • Arnd Bergmann's avatar
      bpfilter: fix building without CONFIG_INET · d71dbdaa
      Arnd Bergmann authored
      bpfilter_process_sockopt is a callback that gets called from
      ip_setsockopt() and ip_getsockopt(). However, when CONFIG_INET is
      disabled, it never gets called at all, and assigning a function to the
      callback pointer results in a link failure:
      
      net/bpfilter/bpfilter_kern.o: In function `__stop_umh':
      bpfilter_kern.c:(.text.unlikely+0x3): undefined reference to `bpfilter_process_sockopt'
      net/bpfilter/bpfilter_kern.o: In function `load_umh':
      bpfilter_kern.c:(.init.text+0x73): undefined reference to `bpfilter_process_sockopt'
      
      Since there is no caller in this configuration, I assume we can
      simply make the assignment conditional.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d71dbdaa
    • David S. Miller's avatar
      Merge branch 'hns3-next' · f0332962
      David S. Miller authored
      Salil Mehta says:
      
      ====================
      Misc. bug fixes & some minor additions to HNS3 driver
      
      This patch-set provides some bug fixes figured out during testing
      and review. It also provides some additions due to running of the
      existing code on the new revision of the HNS3 hardware.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f0332962
    • Lijun Ou's avatar
      net: hns3: Fixes initalization of RoCE handle and makes it conditional · 544a7bcd
      Lijun Ou authored
      When register a RoCE client with hnae3vf device, it needs to judge
      the device whether support RoCE vf function. Otherwise, it will
      lead to calltrace when RoCE is not support vf function and remove
      roce device.
      
      The calltrace as follows:
      [   93.156614] Unable to handle kernel NULL pointer dereference at virtual address 00000015
       <SNIP>
      [   93.278784] Call trace:
      [   93.278788]  hnae3_match_n_instantiate+0x24/0xd8 [hnae3]
      [   93.278790]  hnae3_register_client+0xcc/0x150 [hnae3]
      [   93.278801]  hns_roce_hw_v2_init+0x18/0x1000 [hns_roce_hw_v2]
      [   93.278805]  do_one_initcall+0x58/0x160
      [   93.278807]  do_init_module+0x64/0x1d8
      [   93.278809]  load_module+0x135c/0x15c8
      [   93.278811]  SyS_finit_module+0x100/0x118
      [   93.278816]  __sys_trace_return+0x0/0x4
      [   93.278827] Code: aa0003f5 12001c56 aa1e03e0 d503201f (b9402660)
      
      Fixes: e2cb1dec ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
      Reported-by: default avatarXinwei Kong <kong.kongxinwei@hisilicon.com>
      Reported-by: default avatarZhou Wang <wangzhou1@hisilicon.com>
      Signed-off-by: default avatarLijun Ou <oulijun@huawei.com>
      Signed-off-by: default avatarZhou Wang <wangzhou1@hisilicon.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      544a7bcd
    • Jian Shen's avatar
      net: hns3: Adds support for led locate command for copper port · f6f75abc
      Jian Shen authored
      Firmware now supports control of all leds. Existing HNS3 driver code
      only supported led locate command over SFP Fibre ports. But now it
      is also supported over copper port.
      This patch removes existing not needed code for the led locate
      command and updates the led control command between driver and
      firmware.
      Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f6f75abc
    • Jian Shen's avatar
      net: hns3: Remove unused led control code · 16b496fd
      Jian Shen authored
      In the previous implementation of led control for fibre port , parses the
      port speed configuration, checks the link status and traffic status per
      second, and updates the blink status of link led, traffic led and speed
      led.
      
      Now, the firmware takes responsibility to handle the led, the dirver just
      needs to deal with locate command.
      
      So the codes for link led, traffic led and speed led are useless now. This
      patch removes these redundant codes.
      Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16b496fd
    • Fuyun Liang's avatar
      net: hns3: Clear TX/RX rings when stopping port & un-initializing client · 7b763f3f
      Fuyun Liang authored
      When we down the port, some packets are left in TX/RX buffer. When we
      up the port again, these old packets are forwarded to protocol stack
      or are sent to internet. It will make some problem. TX/RX buffer should
      be cleared when stopping port. This patch adds some function to ensure
      the buffer is clean when port is started. We should clear the rings
      when clients are being un-initialized as well.
      
      Fixes: 76ad4f0e ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
      Signed-off-by: default avatarFuyun Liang <liangfuyun1@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b763f3f
    • Fuyun Liang's avatar
      net: hns3: Removes unnecessary check when clearing TX/RX rings · 6986df96
      Fuyun Liang authored
      Our code will ensure that hns3_clear_tx_ring is not used to cleared
      RX rings and hns3_clear_rx_ring is not used to cleared TX rings. So
      the ring type check is unnecessary.
      
      Fixes: 76ad4f0e ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
      Signed-off-by: default avatarFuyun Liang <liangfuyun1@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6986df96
    • Fuyun Liang's avatar
      net: hns3: Fixes the init of the VALID BD info in the descriptor · 7d0b130c
      Fuyun Liang authored
      RX Buffer Descriptor contains a VALID bit which indicates if the BD
      is valid and has some data. This field is set by HNS3 hardware to
      intimate the driver of some valid data present in the BD. nd should
      be reset by the driver when BD is being used again. In the existing
      code this bit was not being (re-)initialized properly and hence was
      causing problems.
      
      Fixes: 76ad4f0e ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
      Signed-off-by: default avatarFuyun Liang <liangfuyun1@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d0b130c
    • Peng Li's avatar
      net: hns3: Fixes the state to indicate client-type initialization · 90b99b09
      Peng Li authored
      HNAE3 module supports kernel nic driver, user nic driver and roce driver,
      and there are 3 client types. Driver uses one bit(HNAE3_CLIENT_INITED_B)
      to indicate the client initialization state, it will cause confusion
      for 3 client types. This patch fixes it by use 3 bits to indicate the
      initialization state.
      
      Fixes: 38caee9d ("net: hns3: Add support of the HNAE3 framework")
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      90b99b09
    • Xi Wang's avatar
      net: hns3: Fix for PF mailbox receving unknown message · 7c4bfcb0
      Xi Wang authored
      Before the firmware updates the crq's tail pointer, if the PF driver
      reads the data in the crq, the data may be incomplete at this time,
      which will lead to the driver read an unknown message.
      
      This patch fixes it by checking if crq is not empty before reading the
      message.
      
      Fixes: c1a81619 ("net: hns3: Add mailbox interrupt handling to PF driver")
      Signed-off-by: default avatarXi Wang <wangxi11@huawei.com>
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c4bfcb0
    • Peng Li's avatar
      net: hns3: Add support to enable TX/RX promisc mode for H/W rev(0x21) · 96c0e861
      Peng Li authored
      HCLGE_PROMISC_TX_EN_B and HCLGE_PROMISC_RX_EN_B are not supported
      on pdev revision(0x20), new revision(0x21) supports them.
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      96c0e861
    • Peng Li's avatar
      net: hns3: Add STRP_TAGP field support for hardware revision 0x21 · 5b5455a9
      Peng Li authored
      Hardware Revision(0x21) Buffer Descriptor adds a field STRP_TAGP
      for vlan stripped processed indication. STRP_TAGP field has 2 bits,
      bit 0 is stripped indication of the vlan tag in outer vlan tag
      field, bit 1 is stripped indication of the vlan tag in inner vlan
      tag field. For each bit, 0 indicates the tag is not stripped and
      1 indicates the tag is stripped.
      
      This patch adds STRP_TAGP support for revision(0x21), and does not
      change the revision(0x20) action.
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b5455a9
    • Peng Li's avatar
      net: hns3: Add support for tx_accept_tag2 and tx_accept_untag2 config · dcb35cce
      Peng Li authored
      HNS3 Hardware can support up to two VLAN tags in transmit leg, the PPP
      module can handle the packets based on the tag1 and tag2 config. This
      patch adds support for tag2 config for vlan handling
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dcb35cce
    • Peng Li's avatar
      net: hns3: Updates RX packet info fetch in case of multi BD · 846fcc83
      Peng Li authored
      In the latest revision of the hardware, if a packet is spanning
      across multiple BDs then only VLD bit and current data size info
      is valid in each BD, and rest of the information is only valid
      in the last BD of the packet. In such case we should make sure
      we are fetching RX packet size from the first descriptor and
      information like VLAN should be fetched from last BD.
      Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
      Reviewed-by: default avatarYisen Zhuang <yisen.zhuang@huawei.com>
      Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      846fcc83
    • Paolo Abeni's avatar
      net: sched: shrink struct Qdisc · e9be0e99
      Paolo Abeni authored
      The struct Qdisc has a lot of holes, especially after commit
      a53851e2 ("net: sched: explicit locking in gso_cpu fallback"),
      which as a side effect, moved the fields just after 'busylock'
      on a new cacheline.
      
      Since both 'padded' and 'refcnt' are not updated frequently, and
      there is a hole before 'gso_skb', we can move such fields there,
      saving a cacheline without any performance side effect.
      
      Before this commit:
      
      pahole -C Qdisc net/sche/sch_generic.o
      	# ...
              /* size: 384, cachelines: 6, members: 25 */
              /* sum members: 236, holes: 3, sum holes: 92 */
              /* padding: 56 */
      
      After this commit:
      pahole -C Qdisc net/sche/sch_generic.o
      	# ...
      	/* size: 320, cachelines: 5, members: 25 */
      	/* sum members: 236, holes: 2, sum holes: 28 */
      	/* padding: 56 */
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9be0e99
    • Bjørn Mork's avatar
      qmi_wwan: apply SET_DTR quirk to the SIMCOM shared device ID · 102cd909
      Bjørn Mork authored
      SIMCOM are reusing a single device ID for many (all of their?)
      different modems, based on different chipsets and firmwares. Newer
      Qualcomm chipset generations require setting DTR to wake the QMI
      function.  The SIM7600E modem is using such a chipset, making it
      fail to work with this driver despite the device ID match.
      
      Fix by unconditionally enabling the SET_DTR quirk for all SIMCOM
      modems using this specific device ID.  This is similar to what
      we already have done for another case of device IDs recycled over
      multiple chipset generations: 14cf4a77 ("drivers: net: usb:
      qmi_wwan: add QMI_QUIRK_SET_DTR for Telit PID 0x1201")
      
      Initial testing on an older SIM7100 modem shows no immediate side
      effects.
      Reported-by: default avatarSebastian Sjoholm <sebastian.sjoholm@gmail.com>
      Cc: Reinhard Speyerer <rspmn@arcor.de>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      102cd909
    • David S. Miller's avatar
      Merge branch 'stmmac-add-support-for-stm32mp1' · 7e80cb4f
      David S. Miller authored
      Christophe Roullier says:
      
      ====================
      net: ethernet: stmmac: add support for stm32mp1
      
      Patches to have Ethernet support on stm32mp1
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7e80cb4f
    • Christophe Roullier's avatar
      dt-bindings: stm32: add compatible for syscon · 1f809b47
      Christophe Roullier authored
      This patch describes syscon DT bindings.
      Signed-off-by: default avatarChristophe Roullier <christophe.roullier@st.com>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f809b47
    • Christophe Roullier's avatar
      net: stmmac: add dwmac-4.20a compatible · 026e5758
      Christophe Roullier authored
      Manage dwmac-4.20a version from synopsys
      Signed-off-by: default avatarChristophe Roullier <christophe.roullier@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      026e5758
    • Christophe Roullier's avatar
      dt-bindings: stm32-dwmac: add support of MPU families · 1f3feacb
      Christophe Roullier authored
      Add description for Ethernet MPU families fields
      Signed-off-by: default avatarChristophe Roullier <christophe.roullier@st.com>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f3feacb
    • Christophe Roullier's avatar
      net: ethernet: stmmac: add adaptation for stm32mp157c. · 6528e02c
      Christophe Roullier authored
      Glue codes to support stm32mp157c device and stay
      compatible with stm32 mcu familly
      Signed-off-by: default avatarChristophe Roullier <christophe.roullier@st.com>
      Acked-by: default avatarAlexandre TORGUE <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6528e02c
    • Yangbo Lu's avatar
      dt-bindings: ptp: add ptp-qoriq.txt · a98ac8bd
      Yangbo Lu authored
      This patch is to add a documentation for ptp_qoriq dt-bindings.
      The description for ptp_qoriq dt-bindings was actually moved
      from Documentation/devicetree/bindings/net/fsl-tsec-phy.txt,
      since gianfar_ptp driver was moved to ptp_qoriq driver.
      Signed-off-by: default avatarYangbo Lu <yangbo.lu@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a98ac8bd
    • Yangbo Lu's avatar
      net: ethernet: gianfar_ethtool: get phc index through drvdata · 7349a74e
      Yangbo Lu authored
      Global variable gfar_phc_index was used to get and store
      phc index through gianfar_ptp driver. However gianfar_ptp
      had been renamed as ptp_qoriq for QorIQ common PTP driver.
      This gfar_phc_index doesn't work any more, and the phc index
      is stored in drvdata now. This patch is to support getting
      phc index through ptp_qoriq drvdata.
      Signed-off-by: default avatarYangbo Lu <yangbo.lu@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7349a74e
    • Yangbo Lu's avatar
      ptp_qoriq: move some definitions to header file · 6c50c1ed
      Yangbo Lu authored
      This patch is to move some definitions in ptp_qoriq.c
      to the header file.
      Signed-off-by: default avatarYangbo Lu <yangbo.lu@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c50c1ed
    • Yangbo Lu's avatar
      ptp: rework gianfar_ptp as QorIQ common PTP driver · ceefc71d
      Yangbo Lu authored
      gianfar_ptp was the PTP clock driver for 1588 timer
      module of Freescale QorIQ eTSEC (Enhanced Three-Speed
      Ethernet Controllers) platforms. Actually QorIQ DPAA
      (Data Path Acceleration Architecture) platforms is
      also using the same 1588 timer module in hardware.
      
      This patch is to rework gianfar_ptp as QorIQ common
      PTP driver to support both DPAA and eTSEC. Moved
      gianfar_ptp.c to drivers/ptp/, renamed it as
      ptp_qoriq.c, and renamed many variables. There were
      not any function changes.
      Signed-off-by: default avatarYangbo Lu <yangbo.lu@nxp.com>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ceefc71d
    • Jon Maxwell's avatar
      ifb: fix packets checksum · b1d2e4e0
      Jon Maxwell authored
      Fixup the checksum for CHECKSUM_COMPLETE when pulling skbs on RX path.
      Otherwise we get splats when tc mirred is used to redirect packets to ifb.
      
      Before fix:
      
      nic: hw csum failure
      Signed-off-by: default avatarJon Maxwell <jmaxwell37@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b1d2e4e0
    • Heiner Kallweit's avatar
      net: phy: realtek: add suspend/resume callbacks for RTL8211B · 049ff57a
      Heiner Kallweit authored
      Add RTL8211B suspend / resume callbacks.
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      049ff57a
    • David S. Miller's avatar
      Merge branch 'Enable-virtio_net-to-act-as-a-standby-for-a-passthru-device' · deeaf1f8
      David S. Miller authored
      Sridhar Samudrala says:
      
      ====================
      Enable virtio_net to act as a standby for a passthru device
      
      The main motivation for this patch is to enable cloud service providers
      to provide an accelerated datapath to virtio-net enabled VMs in a
      transparent manner with no/minimal guest userspace changes. This also
      enables hypervisor controlled live migration to be supported with VMs that
      have direct attached SR-IOV VF devices.
      
      Patch 1 introduces a failover module that provides a generic interface for
      paravirtual drivers to listen for netdev register/unregister/link change
      events from pci ethernet devices with the same MAC and takeover their
      datapath. The notifier and event handling code is based on the existing
      netvsc implementation.
      
      Patch 2 refactors netvsc to use the registration/notification framework
      introduced by failover module.
      
      Patch 3 introduces a net_failover driver that provides an automated
      failover mechanism to paravirtual drivers via APIs to create and destroy
      a failover master netdev and mananges a primary and standby slave netdevs
      that get registered via the generic failover infrastructure.
      
      Patch 4 introduces a new feature bit VIRTIO_NET_F_STANDBY to virtio-net
      that can be used by hypervisor to indicate that virtio_net interface
      should act as a standby for another device with the same MAC address.
      
      Patch 5 extends virtio_net to use alternate datapath when available and
      registered. When STANDBY feature is enabled, virtio_net driver uese the
      net_failover API to create an additional 'failover' netdev that acts as
      a master device and controls 2 slave devices.  The original virtio_net
      netdev is registered as 'standby' netdev and a passthru/vf device with
      the same MAC gets registered as 'primary' netdev. Both 'standby' and
      'failover' netdevs are associated with the same 'pci' device.  The user
      accesses the network interface via 'failover' netdev. The 'failover'
      netdev chooses 'primary' netdev as default for transmits when it is
      available with link up and running.
      
      As this patch series is initially focusing on usecases where hypervisor
      fully controls the VM networking and the guest is not expected to directly
      configure any hardware settings, it doesn't expose all the ndo/ethtool ops
      that are supported by virtio_net at this time. To support additional usecases,
      it should be possible to enable additional ops later by caching the state
      in failover netdev and replaying when the 'primary' netdev gets registered.
      
      At the time of live migration, the hypervisor needs to unplug the VF device
      from the guest on the source host and reset the MAC filter of the VF to
      initiate failover of datapath to virtio before starting the migration. After
      the migration is completed, the destination hypervisor sets the MAC filter
      on the VF and plugs it back to the guest to switch over to VF datapath.
      
      This patch is based on the discussion initiated by Jesse on this thread.
      https://marc.info/?l=linux-virtualization&m=151189725224231&w=2
      
      v12:
      - Tested live migration with virtio-net/AVF(i40evf) configured in failover
        mode while running iperf in background. Tried static ip and dhcp
        configurations using 'network' scripts and Network Manager.
      - Build tested netvsc module.
      Updates:
      - Extended generic failover module to do common functions like setting
        FAILOVER_SLAVE flag, registering rx-handler and linking to upper dev in
        the generic register/unregister handlers.
        This required adding 3 additional failover ops pre_register, pre_unregister
        and handle_frame.  netvsc and net_failover drivers are updated to support
        these ops.
      
      v11:
      - Split net_failover module into 2 components.
        1. 'failover' module that provides generic failover infrastructure
        to register a failover instance and listen for slave events.
        2. 'net_failover' driver that provides APIs to create/destroy upper
        netdev and supports 3-netdev model used by virtio-net.
      - Added documentation
      
      v10:
      - fix net_failover_open() to update failover CARRIER correctly based on
        standby and primary states.
      - fix net_failover_handle_frame() to handle frames received on standby
        when primary is present.
      - replace netdev_upper_dev_link with netdev_master_upper_dev_link and
        handle lower dev state changes.
      - fix net_failver_create() and net_failover_register() interfaces to
        use ERR_PTR and avoid arg **
      - disable setting mac address when virtio-net in STANDBY mode
      - document exported symbols
      - added entry to MAINTAINERS file
      
      v9:
      Select NET_FAILOVER automatically when VIRTIO_NET/HYPERV_NET
      are enabled. (stephen)
      
      v8:
      - Made the failover managment routines more robust by updating the feature
        bits/other fields in the failover netdev when slave netdevs are
        registered/unregistered. (mst)
      - added support for handling vlans.
      - Limited the changes in netvsc to only use the notifier/event/lookups
        from the failover module. The slave register/unregister/link-change
        handlers are only updated to use the getbymac routine to get the
        upper netdev. There is no change in their functionality. (stephen)
      - renamed structs/function/file names to use net_failover prefix. (mst)
      
      v7
      - Rename 'bypass/active/backup' terminology with 'failover/primary/standy'
        (jiri, mst)
      - re-arranged dev_open() and dev_set_mtu() calls in the register routines
        so that they don't get called for 2-netdev model. (stephen)
      - fixed select_queue() routine to do queue selection based on VF if it is
        registered as primary. (stephen)
      -  minor bugfixes
      
      v6 RFC:
        Simplified virtio_net changes by moving all the ndo_ops of the
        bypass_netdev and create/destroy of bypass_netdev to 'bypass' module.
        avoided 2 phase registration(driver + instances).
        introduced IFF_BYPASS/IFF_BYPASS_SLAVE dev->priv_flags
        replaced mutex with a spinlock
      
      v5 RFC:
        Based on Jiri's comments, moved the common functionality to a 'bypass'
        module so that the same notifier and event handlers to handle child
        register/unregister/link change events can be shared between virtio_net
        and netvsc.
        Improved error handling based on Siwei's comments.
      v4:
      - Based on the review comments on the v3 version of the RFC patch and
        Jakub's suggestion for the naming issue with 3 netdev solution,
        proposed 3 netdev in-driver bonding solution for virtio-net.
      v3 RFC:
      - Introduced 3 netdev model and pointed out a couple of issues with
        that model and proposed 2 netdev model to avoid these issues.
      - Removed broadcast/multicast optimization and only use virtio as
        backup path when VF is unplugged.
      v2 RFC:
      - Changed VIRTIO_NET_F_MASTER to VIRTIO_NET_F_BACKUP (mst)
      - made a small change to the virtio-net xmit path to only use VF datapath
        for unicasts. Broadcasts/multicasts use virtio datapath. This avoids
        east-west broadcasts to go over the PCI link.
      - added suppport for the feature bit in qemu
      ====================
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      deeaf1f8
    • Sridhar Samudrala's avatar
      virtio_net: Extend virtio to use VF datapath when available · ba5e4426
      Sridhar Samudrala authored
      This patch enables virtio_net to switch over to a VF datapath when STANDBY
      feature is enabled and a VF netdev is present with the same MAC address.
      It allows live migration of a VM with a direct attached VF without the need
      to setup a bond/team between a VF and virtio net device in the guest.
      
      It uses the API that is exported by the net_failover driver to create and
      and destroy a master failover netdev. When STANDBY feature is enabled, an
      additional netdev(failover netdev) is created that acts as a master device
      and tracks the state of the 2 lower netdevs. The original virtio_net netdev
      is marked as 'standby' netdev and a passthru device with the same MAC is
      registered as 'primary' netdev.
      
      The hypervisor needs to unplug the VF device from the guest on the source
      host and reset the MAC filter of the VF to initiate failover of datapath
      to virtio before starting the migration. After the migration is completed,
      the destination hypervisor sets the MAC filter on the VF and plugs it back
      to the guest to switch over to VF datapath.
      
      This patch is based on the discussion initiated by Jesse on this thread.
      https://marc.info/?l=linux-virtualization&m=151189725224231&w=2Signed-off-by: default avatarSridhar Samudrala <sridhar.samudrala@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ba5e4426
    • Sridhar Samudrala's avatar
      virtio_net: Introduce VIRTIO_NET_F_STANDBY feature bit · 9805069d
      Sridhar Samudrala authored
      This feature bit can be used by hypervisor to indicate virtio_net device to
      act as a standby for another device with the same MAC address.
      
      VIRTIO_NET_F_STANDBY is defined as bit 62 as it is a device feature bit.
      Signed-off-by: default avatarSridhar Samudrala <sridhar.samudrala@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9805069d
    • Sridhar Samudrala's avatar
      net: Introduce net_failover driver · cfc80d9a
      Sridhar Samudrala authored
      The net_failover driver provides an automated failover mechanism via APIs
      to create and destroy a failover master netdev and manages a primary and
      standby slave netdevs that get registered via the generic failover
      infrastructure.
      
      The failover netdev acts a master device and controls 2 slave devices. The
      original paravirtual interface gets registered as 'standby' slave netdev and
      a passthru/vf device with the same MAC gets registered as 'primary' slave
      netdev. Both 'standby' and 'failover' netdevs are associated with the same
      'pci' device. The user accesses the network interface via 'failover' netdev.
      The 'failover' netdev chooses 'primary' netdev as default for transmits when
      it is available with link up and running.
      
      This can be used by paravirtual drivers to enable an alternate low latency
      datapath. It also enables hypervisor controlled live migration of a VM with
      direct attached VF by failing over to the paravirtual datapath when the VF
      is unplugged.
      Signed-off-by: default avatarSridhar Samudrala <sridhar.samudrala@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cfc80d9a
    • Sridhar Samudrala's avatar
      netvsc: refactor notifier/event handling code to use the failover framework · 1ff78076
      Sridhar Samudrala authored
      Use the registration/notification framework supported by the generic
      failover infrastructure.
      Signed-off-by: default avatarSridhar Samudrala <sridhar.samudrala@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ff78076
    • Sridhar Samudrala's avatar
      net: Introduce generic failover module · 30c8bd5a
      Sridhar Samudrala authored
      The failover module provides a generic interface for paravirtual drivers
      to register a netdev and a set of ops with a failover instance. The ops
      are used as event handlers that get called to handle netdev register/
      unregister/link change/name change events on slave pci ethernet devices
      with the same mac address as the failover netdev.
      
      This enables paravirtual drivers to use a VF as an accelerated low latency
      datapath. It also allows migration of VMs with direct attached VFs by
      failing over to the paravirtual datapath when the VF is unplugged.
      Signed-off-by: default avatarSridhar Samudrala <sridhar.samudrala@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      30c8bd5a
    • Davide Caratti's avatar
      vrf: add CRC32c offload to device features · cb160394
      Davide Caratti authored
      SCTP sockets originated in a VRF can improve their performance if CRC32c
      computation is delegated to underlying devices: update device features,
      setting NETIF_F_SCTP_CRC. Iterating the following command in the topology
      proposed with [1],
      
       # ip vrf exec vrf-h2 netperf -H 192.0.2.1 -t SCTP_STREAM -- -m 10K
      
      the measured throughput in Mbit/s improved from 2395 ± 1% to 2720 ± 1%.
      
      [1] https://www.spinics.net/lists/netdev/msg486007.htmlSigned-off-by: default avatarDavide Caratti <dcaratti@redhat.com>
      Reviewed-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Acked-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb160394
    • Thierry Reding's avatar
      net: stmmac: Use mutex instead of spinlock · 29555fa3
      Thierry Reding authored
      Some drivers, such as DWC EQOS on Tegra, need to perform operations that
      can sleep under this lock (clk_set_rate() in tegra_eqos_fix_speed()) for
      proper operation. Since there is no need for this lock to be a spinlock,
      convert it to a mutex instead.
      
      Fixes: e6ea2d16 ("net: stmmac: dwc-qos: Add Tegra186 support")
      Reported-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Tested-by: default avatarBhadram Varka <vbhadram@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      29555fa3