1. 14 2月, 2020 27 次提交
    • R
      netdevice.h: fix all kernel-doc and Sphinx warnings · a1fa83bd
      Randy Dunlap 提交于
      Eliminate all kernel-doc and Sphinx warnings in
      <linux/netdevice.h>.  Fixes these warnings:
      
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'gso_partial_features' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'tlsdev_ops' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'name_assign_type' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'mpls_ptr' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'xdp_prog' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'xdp_bulkq' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'xps_cpus_map' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'xps_rxqs_map' not described in 'net_device'
      ../include/linux/netdevice.h:2100: warning: Function parameter or member 'qdisc_hash' not described in 'net_device'
      ../include/linux/netdevice.h:3552: WARNING: Inline emphasis start-string without end-string.
      ../include/linux/netdevice.h:3552: WARNING: Inline emphasis start-string without end-string.
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a1fa83bd
    • D
      Merge branch 'dsa-headroom' · 3ea89fa7
      David S. Miller 提交于
      Per Forlin says:
      
      ====================
      net: dsa: Make sure there is headroom for tag
      
      Sorry for re-posting yet another time....
      I manage to include multiple email-senders and forgot to include cover-letter.
      Let's hope everyhthing is in order this time.
      
      Fix two tag drivers to make sure there is headroom for the tag data.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3ea89fa7
    • P
      net: dsa: tag_ar9331: Make sure there is headroom for tag · ddc9abaf
      Per Forlin 提交于
      Passing tag size to skb_cow_head will make sure
      there is enough headroom for the tag data.
      This change does not introduce any overhead in case there
      is already available headroom for tag.
      Signed-off-by: NPer Forlin <perfn@axis.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ddc9abaf
    • P
      net: dsa: tag_qca: Make sure there is headroom for tag · 04fb9124
      Per Forlin 提交于
      Passing tag size to skb_cow_head will make sure
      there is enough headroom for the tag data.
      This change does not introduce any overhead in case there
      is already available headroom for tag.
      Signed-off-by: NPer Forlin <perfn@axis.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      04fb9124
    • W
      net, ip6_tunnel: enhance tunnel locate with link check · 5fdcce21
      William Dauchy 提交于
      With ipip, it is possible to create an extra interface explicitly
      attached to a given physical interface:
      
        # ip link show tunl0
        4: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
          link/ipip 0.0.0.0 brd 0.0.0.0
        # ip link add tunl1 type ipip dev eth0
        # ip link show tunl1
        6: tunl1@eth0: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
          link/ipip 0.0.0.0 brd 0.0.0.0
      
      But it is not possible with ip6tnl:
      
        # ip link show ip6tnl0
        5: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group default qlen 1000
            link/tunnel6 :: brd ::
        # ip link add ip6tnl1 type ip6tnl dev eth0
        RTNETLINK answers: File exists
      
      This patch aims to make it possible by adding link comparaison in both
      tunnel locate and lookup functions; we also modify mtu calculation when
      attached to an interface with a lower mtu.
      
      This permits to make use of x-netns communication by moving the newly
      created tunnel in a given netns.
      Signed-off-by: NWilliam Dauchy <w.dauchy@criteo.com>
      Reviewed-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5fdcce21
    • D
      Merge tag 'mac80211-for-net-2020-02-14' of... · b32cb6fc
      David S. Miller 提交于
      Merge tag 'mac80211-for-net-2020-02-14' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
      
      Johannes Berg says:
      
      ====================
      Just a few fixes:
       * avoid running out of tracking space for frames that need
         to be reported to userspace by using more bits
       * fix beacon handling suppression by adding some relevant
         elements to the CRC calculation
       * fix quiet mode in action frames
       * fix crash in ethtool for virt_wifi and similar
       * add a missing policy entry
       * fix 160 & 80+80 bandwidth to take local capabilities into
         account
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b32cb6fc
    • D
      Merge branch 'smc-fixes' · 907e51e4
      David S. Miller 提交于
      Karsten Graul says:
      
      ====================
      net/smc: fixes for -net
      
      Fix a syzbot finding and a problem with the CLC handshake content.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      907e51e4
    • U
      net/smc: no peer ID in CLC decline for SMCD · 369537c9
      Ursula Braun 提交于
      Just SMCR requires a CLC Peer ID, but not SMCD. The field should be
      zero for SMCD.
      
      Fixes: c758dfdd ("net/smc: add SMC-D support in CLC messages")
      Signed-off-by: NUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: NKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      369537c9
    • U
      net/smc: transfer fasync_list in case of fallback · 67f562e3
      Ursula Braun 提交于
      SMC does not work together with FASTOPEN. If sendmsg() is called with
      flag MSG_FASTOPEN in SMC_INIT state, the SMC-socket switches to
      fallback mode. To handle the previous ioctl FIOASYNC call correctly
      in this case, it is necessary to transfer the socket wait queue
      fasync_list to the internal TCP socket.
      
      Reported-by: syzbot+4b1fe8105f8044a26162@syzkaller.appspotmail.com
      Fixes: ee9dfbef ("net/smc: handle sockopts forcing fallback")
      Signed-off-by: NUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: NKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      67f562e3
    • D
      Merge branch 'hns3-fixes' · dc221a28
      David S. Miller 提交于
      Huazhong Tan says:
      
      ====================
      net: hns3: fixes for -net
      
      This series includes three bugfixes for the HNS3 ethernet driver.
      
      [patch 1] fixes a management table lost issue after IMP reset.
      [patch 2] fixes a VF bandwidth configuration not work problem.
      [patch 3] fixes a problem related to IPv6 address copying.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dc221a28
    • G
      net: hns3: fix a copying IPv6 address error in hclge_fd_get_flow_tuples() · 47327c93
      Guangbin Huang 提交于
      The IPv6 address defined in struct in6_addr is specified as
      big endian, but there is no specified endian in struct
      hclge_fd_rule_tuples, so it  will cause a problem if directly
      use memcpy() to copy ipv6 address between these two structures
      since this field in struct hclge_fd_rule_tuples is little endian.
      
      This patch fixes this problem by using be32_to_cpu() to convert
      endian of IPv6 address of struct in6_addr before copying.
      
      Fixes: d93ed94f ("net: hns3: add aRFS support for PF")
      Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      47327c93
    • Y
      net: hns3: fix VF bandwidth does not take effect in some case · 19eb1123
      Yonglong Liu 提交于
      When enabling 4 TC after setting the bandwidth of VF, the bandwidth
      of VF will resume to default value, because of the qset resources
      changed in this case.
      
      This patch fixes it by using a fixed VF's qset resources according to
      HNAE3_MAX_TC macro.
      
      Fixes: ee9e4424 ("net: hns3: add support for configuring bandwidth of VF on the host")
      Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      19eb1123
    • Y
      net: hns3: add management table after IMP reset · d0db7ed3
      Yufeng Mo 提交于
      In the current process, the management table is missing after the
      IMP reset. This patch adds the management table to the reset process.
      
      Fixes: f5aac71c ("net: hns3: add manager table initialization for hardware")
      Signed-off-by: NYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0db7ed3
    • S
      mac80211: fix wrong 160/80+80 MHz setting · 33181ea7
      Shay Bar 提交于
      Before this patch, STA's would set new width of 160/80+80 MHz based on AP capability only.
      This is wrong because STA may not support > 80MHz BW.
      Fix is to verify STA has 160/80+80 MHz capability before increasing its width to > 80MHz.
      
      The "support_80_80" and "support_160" setting is based on:
      "Table 9-272 — Setting of the Supported Channel Width Set subfield and Extended NSS BW
      Support subfield at a STA transmitting the VHT Capabilities Information field"
      From "Draft P802.11REVmd_D3.0.pdf"
      Signed-off-by: NAviad Brikman <aviad.brikman@celeno.com>
      Signed-off-by: NShay Bar <shay.bar@celeno.com>
      Link: https://lore.kernel.org/r/20200210130728.23674-1-shay.bar@celeno.comSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      33181ea7
    • S
      cfg80211: add missing policy for NL80211_ATTR_STATUS_CODE · ea750801
      Sergey Matyukevich 提交于
      The nl80211_policy is missing for NL80211_ATTR_STATUS_CODE attribute.
      As a result, for strictly validated commands, it's assumed to not be
      supported.
      Signed-off-by: NSergey Matyukevich <sergey.matyukevich.os@quantenna.com>
      Link: https://lore.kernel.org/r/20200213131608.10541-2-sergey.matyukevich.os@quantenna.comSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      ea750801
    • D
      Merge branch 'icmp-account-for-NAT-when-sending-icmps-from-ndo-layer' · 803381f9
      David S. Miller 提交于
      Jason A. Donenfeld says:
      
      ====================
      icmp: account for NAT when sending icmps from ndo layer
      
      The ICMP routines use the source address for two reasons:
      
      1. Rate-limiting ICMP transmissions based on source address, so
         that one source address cannot provoke a flood of replies. If
         the source address is wrong, the rate limiting will be
         incorrectly applied.
      
      2. Choosing the interface and hence new source address of the
         generated ICMP packet. If the original packet source address
         is wrong, ICMP replies will be sent from the wrong source
         address, resulting in either a misdelivery, infoleak, or just
         general network admin confusion.
      
      Most of the time, the icmp_send and icmpv6_send routines can just reach
      down into the skb's IP header to determine the saddr. However, if
      icmp_send or icmpv6_send is being called from a network device driver --
      there are a few in the tree -- then it's possible that by the time
      icmp_send or icmpv6_send looks at the packet, the packet's source
      address has already been transformed by SNAT or MASQUERADE or some other
      transformation that CONNTRACK knows about. In this case, the packet's
      source address is most certainly the *wrong* source address to be used
      for the purpose of ICMP replies.
      
      Rather, the source address we want to use for ICMP replies is the
      original one, from before the transformation occurred.
      
      Fortunately, it's very easy to just ask CONNTRACK if it knows about this
      packet, and if so, how to fix it up. The saddr is the only field in the
      header we need to fix up, for the purposes of the subsequent processing
      in the icmp_send and icmpv6_send functions, so we do the lookup very
      early on, so that the rest of the ICMP machinery can progress as usual.
      
      Changes v3->v4:
      - Add back the skb_shared checking, since the previous assumption isn't
        actually true [Eric]. This implies dropping the additional patches v3 had
        for removing skb_share_check from various drivers. We can revisit that
        general set of ideas later, but that's probably better suited as a net-next
        patchset rather than this stable one which is geared at fixing bugs. So,
        this implements things in the safe conservative way.
      
      Changes v2->v3:
      - Add selftest to ensure this actually does what we want and never regresses.
      - Check the size of the skb header before operating on it.
      - Use skb_ensure_writable to ensure we can modify the cloned skb [Florian].
      - Conditionalize this on IPS_SRC_NAT so we don't do anything unnecessarily
        [Florian].
      - It turns out that since we're calling these from the xmit path,
        skb_share_check isn't required, so remove that [Florian]. This simplifes the
        code a bit too. **The supposition here is that skbs passed to ndo_start_xmit
        are _never_ shared. If this is not correct NOW IS THE TIME TO PIPE UP, for
        doom awaits us later.**
      - While investigating the shared skb business, several drivers appeared to be
        calling it incorrectly in the xmit path, so this series also removes those
        unnecessary calls, based on the supposition mentioned in the previous point.
      
      Changes v1->v2:
      - icmpv6 takes subtly different types than icmpv4, like u32 instead of be32,
        u8 instead of int.
      - Since we're technically writing to the skb, we need to make sure it's not
        a shared one [Dave, 2017].
      - Restore the original skb data after icmp_send returns. All current users
        are freeing the packet right after, so it doesn't matter, but future users
        might not.
      - Remove superfluous route lookup in sunvnet [Dave].
      - Use NF_NAT instead of NF_CONNTRACK for condition [Florian].
      - Include this cover letter [Dave].
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      803381f9
    • J
      xfrm: interface: use icmp_ndo_send helper · 45942ba8
      Jason A. Donenfeld 提交于
      Because xfrmi is calling icmp from network device context, it should use
      the ndo helper so that the rate limiting applies correctly.
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      45942ba8
    • J
      wireguard: device: use icmp_ndo_send helper · a12d7f3c
      Jason A. Donenfeld 提交于
      Because wireguard is calling icmp from network device context, it should
      use the ndo helper so that the rate limiting applies correctly.  This
      commit adds a small test to the wireguard test suite to ensure that the
      new functions continue doing the right thing in the context of
      wireguard. It does this by setting up a condition that will definately
      evoke an icmp error message from the driver, but along a nat'd path.
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a12d7f3c
    • J
      sunvnet: use icmp_ndo_send helper · 67c9a7e1
      Jason A. Donenfeld 提交于
      Because sunvnet is calling icmp from network device context, it should use
      the ndo helper so that the rate limiting applies correctly. While we're
      at it, doing the additional route lookup before calling icmp_ndo_send is
      superfluous, since this is the job of the icmp code in the first place.
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      Cc: Shannon Nelson <shannon.nelson@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      67c9a7e1
    • J
      gtp: use icmp_ndo_send helper · e0fce6f9
      Jason A. Donenfeld 提交于
      Because gtp is calling icmp from network device context, it should use
      the ndo helper so that the rate limiting applies correctly.
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      Cc: Harald Welte <laforge@gnumonks.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0fce6f9
    • J
      icmp: introduce helper for nat'd source address in network device context · 0b41713b
      Jason A. Donenfeld 提交于
      This introduces a helper function to be called only by network drivers
      that wraps calls to icmp[v6]_send in a conntrack transformation, in case
      NAT has been used. We don't want to pollute the non-driver path, though,
      so we introduce this as a helper to be called by places that actually
      make use of this, as suggested by Florian.
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      Cc: Florian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0b41713b
    • D
      Merge branch 'skip_sw-skip_hw-validation' · 07134cf6
      David S. Miller 提交于
      Davide Caratti says:
      
      ====================
      add missing validation of 'skip_hw/skip_sw'
      
      ensure that all classifiers currently supporting HW offload
      validate the 'flags' parameter provided by user:
      
      - patch 1/2 fixes cls_matchall
      - patch 2/2 fixes cls_flower
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      07134cf6
    • D
      net/sched: flower: add missing validation of TCA_FLOWER_FLAGS · e2debf08
      Davide Caratti 提交于
      unlike other classifiers that can be offloaded (i.e. users can set flags
      like 'skip_hw' and 'skip_sw'), 'cls_flower' doesn't validate the size of
      netlink attribute 'TCA_FLOWER_FLAGS' provided by user: add a proper entry
      to fl_policy.
      
      Fixes: 5b33f488 ("net/flower: Introduce hardware offload support")
      Signed-off-by: NDavide Caratti <dcaratti@redhat.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e2debf08
    • D
      net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS · 1afa3cc9
      Davide Caratti 提交于
      unlike other classifiers that can be offloaded (i.e. users can set flags
      like 'skip_hw' and 'skip_sw'), 'cls_matchall' doesn't validate the size
      of netlink attribute 'TCA_MATCHALL_FLAGS' provided by user: add a proper
      entry to mall_policy.
      
      Fixes: b87f7936 ("net/sched: Add match-all classifier hw offloading.")
      Signed-off-by: NDavide Caratti <dcaratti@redhat.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1afa3cc9
    • H
      net/flow_dissector: remove unexist field description · 6ee2deb6
      Hangbin Liu 提交于
      @thoff has moved to struct flow_dissector_key_control.
      
      Fixes: 42aecaa9 ("net: Get skb hash over flow_keys structure")
      Signed-off-by: NHangbin Liu <liuhangbin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6ee2deb6
    • L
      page_pool: refill page when alloc.count of pool is zero · 304db6cb
      Li RongQing 提交于
      "do {} while" in page_pool_refill_alloc_cache will always
      refill page once whether refill is true or false, and whether
      alloc.count of pool is less than PP_ALLOC_CACHE_REFILL or not
      this is wrong, and will cause overflow of pool->alloc.cache
      
      the caller of __page_pool_get_cached should provide guarantee
      that pool->alloc.cache is safe to access, so in_serving_softirq
      should be removed as suggested by Jesper Dangaard Brouer in
      https://patchwork.ozlabs.org/patch/1233713/
      
      so fix this issue by calling page_pool_refill_alloc_cache()
      only when pool->alloc.count is zero
      
      Fixes: 44768dec ("page_pool: handle page recycle for NUMA_NO_NODE condition")
      Signed-off-by: NLi RongQing <lirongqing@baidu.com>
      Suggested-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Acked-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Acked-by: NIlias Apalodimas <ilias.apalodimas@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      304db6cb
    • D
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue · 89e960b5
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2020-02-12
      
      This series contains fixes to only the ice driver.
      
      Dave fixes logic flaws in the DCB rebuild function which is used after a
      reset.  Also fixed a configuration issue when switching between firmware
      and software LLDP mode where the number of TLV's configured was getting
      out of sync with what lldpad thinks is configured.
      
      Paul fixes how the driver displayed all the supported and advertised
      link modes by basing it on the PHY capabilities, and in the process
      cleaned up a lot of code.
      
      Brett fixes duplicate receive tail bumps by comparing the value we are
      writing to tail with the previously written tail value.  Also cleaned up
      workarounds that are no longer needed with the latest NVM images.
      
      Anirudh cleaned up unnecessary CONFIG_PCI_IOV wrappers.  Updated the
      driver to use ice_pf_to_dev() instead of &pf->pdev->dev or
      &vsi->back->pdev->dev.  Cleaned up the string format in print function
      calls to remove newlines where applicable.
      
      Akeem updates the link message logging to include "Full Duplex" and
      "Negotiated", to help distinguish from "Requested" for FEC.
      
      Bruce fixes and consolidates the logging of firmware/NVM information
      during driver load, since the information is duplicate of what is
      available via ethtool.  Fixed the checking of the Unit Load Status bits
      after reset to ensure they are 0x7FF before continuing, by updating the
      mask.  Cleanup up possible NULL dereferences that were created by a
      previous commit.
      
      Ben fixes the driver to use the correct netif_msg_tx/rx_error() to
      determine whether to print the MDD event type.
      
      Tony provides several trivial fixes, which include whitespace, typos,
      function header comments, reverse Christmas tree issues.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      89e960b5
  2. 13 2月, 2020 13 次提交