28 Dec, 2017

8 commits

  • Commit f10b4cff98c6 ("rds: tcp: atomically purge entries from
    rds_tcp_conn_list during netns delete") adds the field t_tcp_detached,
    but this needs to be initialized explicitly to false.

    Signed-off-by: Sowmini Varadhan
    Acked-by: Santosh Shilimkar
    Signed-off-by: David S. Miller

    Sowmini Varadhan
     
  • If the rds_sock is not added to the bind_hash_table, we must
    reset rs_bound_addr so that rds_remove_bound will not trip on
    this rds_sock.

    rds_add_bound() does a rds_sock_put() in this failure path, so
    failing to reset rs_bound_addr will result in a socket refcount
    bug, and will trigger a WARN_ON with the stack shown below when
    the application subsequently tries to close the PF_RDS socket.

    WARNING: CPU: 20 PID: 19499 at net/rds/af_rds.c:496 \
    rds_sock_destruct+0x15/0x30 [rds]
    :
    __sk_destruct+0x21/0x190
    rds_remove_bound.part.13+0xb6/0x140 [rds]
    rds_release+0x71/0x120 [rds]
    sock_release+0x1a/0x70
    sock_close+0xe/0x20
    __fput+0xd5/0x210
    task_work_run+0x82/0xa0
    do_exit+0x2ce/0xb30
    ? syscall_trace_enter+0x1cc/0x2b0
    do_group_exit+0x39/0xa0
    SyS_exit_group+0x10/0x10
    do_syscall_64+0x61/0x1a0

    Signed-off-by: Sowmini Varadhan
    Acked-by: Santosh Shilimkar
    Signed-off-by: David S. Miller

    Sowmini Varadhan
     
  • The build of mips bcm47xx_defconfig is failing with the error:
    net/sched/sch_fq_codel.c: In function 'fq_codel_init':
    net/sched/sch_fq_codel.c:487:8: error:
    too many arguments to function 'tcf_block_get'

    While adding the extack support, the commit missed adding it in the
    headers when CONFIG_NET_CLS is not defined.

    Fixes: 8d1a77f974ca ("net: sch: api: add extack support in tcf_block_get")
    Signed-off-by: Sudip Mukherjee
    Signed-off-by: David S. Miller

    Sudip Mukherjee
     
  • Lorenzo Bianconi says:

    ====================
    l2tp: fix offset/peer_offset conf parameters

    This patchset add peer_offset configuration parameter in order to
    specify two different values for payload offset on tx/rx side.
    Moreover fix missing print session offset info
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Introduce peer_offset parameter in order to add the capability
    to specify two different values for payload offset on tx/rx side.
    If just offset is provided by userspace use it for rx side as well
    in order to maintain compatibility with older l2tp versions

    Signed-off-by: Lorenzo Bianconi
    Signed-off-by: David S. Miller

    Lorenzo Bianconi
     
  • Report offset parameter in L2TP_CMD_SESSION_GET command if
    it has been configured by userspace

    Fixes: 309795f4bec ("l2tp: Add netlink control API for L2TP")
    Reported-by: Jianlin Shi
    Signed-off-by: Hangbin Liu
    Signed-off-by: Lorenzo Bianconi
    Signed-off-by: David S. Miller

    Hangbin Liu
     
  • Steffen Klassert says:

    ====================
    pull request (net-next): ipsec-next 2017-12-22

    1) Separate ESP handling from segmentation for GRO packets.
    This unifies the IPsec GSO and non GSO codepath.

    2) Add asynchronous callbacks for xfrm on layer 2. This
    adds the necessary infrastructure to core networking.

    3) Allow to use the layer2 IPsec GSO codepath for software
    crypto, all infrastructure is there now.

    4) Also allow IPsec GSO with software crypto for local sockets.

    5) Don't require synchronous crypto fallback on IPsec offloading,
    it is not needed anymore.

    6) Check for xdo_dev_state_free and only call it if implemented.
    From Shannon Nelson.

    7) Check for the required add and delete functions when a driver
    registers xdo_dev_ops. From Shannon Nelson.

    8) Define xfrmdev_ops only with offload config.
    From Shannon Nelson.

    9) Update the xfrm stats documentation.
    From Shannon Nelson.

    Please pull or let me know if there are problems.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • As suggested by Rob Herring [1] rename the previously introduced
    reset-{,post-}delay-us bindings to the clearer reset-{,de}assert-us

    [1] https://patchwork.kernel.org/patch/10104905/

    Signed-off-by: Richard Leitner
    Reviewed-by: Rob Herring
    Signed-off-by: David S. Miller

    Richard Leitner
     

27 Dec, 2017

26 commits

  • Peng Li says:

    ====================
    add some features and fix some bugs for HNS3 driver

    This patchset adds some new feature support and fixes some bugs:
    [Patch 1/17 - 5/17] add the support to modify/query the tqp number
    through ethtool -L/l command, and also fix some related bugs for
    change tqp number.
    [Patch 6/17 - 9-17] add support vlan tag offload on tx&&rx direction
    for pf, and fix some related bugs.
    [patch 10/17 - 11/17] fix bugs for auto negotiation.
    [patch 12/17] adds support for ethtool command set_pauseparam.
    [patch 13/17 - 14/17] add support to update flow control settings after
    autoneg.
    [patch 15/17 - 17/17] fix some other bugs in net-next.

    ---
    Change Log:
    V4 -> V5:
    1. change the name spelling of Peng Li.

    V3 -> V4:
    1. change the name spelling of Mingguang Qu and Jian Shen.

    V2 -> V3:
    1. order local variables requested by David Miller.
    2. use "int" for index iteration loops requested by David Miller.

    V1 -> V2:
    1. fix the comments from Sergei Shtylyov.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • TC-based sched mode supports SRIOV enabled and SRIOV disabled. This
    patch change the TM sched mode to TC-based mode in initialization
    process.

    Fixes: cc9bb43ab394 ("net: hns3: Add tc-based TM support for sriov enabled port")
    Signed-off-by: Peng Li
    Signed-off-by: David S. Miller

    Peng Li
     
  • Burstiness of a flow is determined by the depth of a bucket, When the
    upper rate of shaper is large, the current depth of a bucket is not
    enough.

    The default upper rate of shaper is 100G, so increase the depth of
    a bucket according to UM.

    Signed-off-by: Peng Li
    Signed-off-by: Yunsheng Lin
    Signed-off-by: David S. Miller

    Peng Li
     
  • This patch adds support for querying advertised pause frame by using
    ethtool command(ethtool ethx).

    Fixes: 496d03e960ae ("net: hns3: Add Ethtool support to HNS3 driver")
    Signed-off-by: Peng Li
    Signed-off-by: Fuyun Liang
    Signed-off-by: David S. Miller

    Peng Li
     
  • commit c4fb2cdf575d ("net: hns3: fix a bug for phy supported feature
    initialization") adds default supported features for phy, but our hardware
    also supports Asym Pause. This patch adds Asym Pause support to phy
    default features to prevent Asym Pause can not be advertised when the phy
    negotiates flow control.

    Fixes: c4fb2cdf575d ("net: hns3: fix a bug for phy supported feature initialization")
    Signed-off-by: Fuyun Liang
    Signed-off-by: Peng Li
    Signed-off-by: David S. Miller

    Fuyun Liang
     
  • When auto-negotiation is enabled, the MAC flow control settings is
    based on the flow control negotiation result. And it should be configured
    after a valid link has been established. This patch adds support to update
    flow control settings after auto-negotiation has completed.

    Signed-off-by: Peng Li
    Signed-off-by: Fuyun Liang
    Signed-off-by: David S. Miller

    Peng Li
     
  • This patch adds set_pauseparam support for ethtool cmd.

    Signed-off-by: Peng Li
    Signed-off-by: Fuyun Liang
    Signed-off-by: David S. Miller

    Peng Li
     
  • When phy exists, we use the value of phydev.autoneg to represent the
    auto-negotiation state of hardware. Otherwise, we use the value of
    mac.autoneg to represent it.

    This patch fixes for getting a error value of auto-negotiation state in
    hclge_get_autoneg().

    Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
    Signed-off-by: Fuyun Liang
    Signed-off-by: Peng Li
    Signed-off-by: David S. Miller

    Fuyun Liang
     
  • When checking whether auto-negotiation is on, driver only needs to
    check the value of mac.autoneg(SW) directly, and does not need to
    query it from hardware. Because this value is always synchronized
    with the auto-negotiation state of hardware.

    This patch removes the mac auto-negotiation state query.

    Signed-off-by: Fuyun Liang
    Signed-off-by: Peng Li
    Signed-off-by: David S. Miller

    Fuyun Liang
     
  • This patch deals with the vlan tag information between
    sk_buff and rx/tx bd.

    Signed-off-by: Peng Li
    Signed-off-by: Jian Shen
    Signed-off-by: David S. Miller

    Peng Li
     
  • This patch adds offload command related to "ethtool -K".

    Signed-off-by: Peng Li
    Signed-off-by: Jian Shen
    Signed-off-by: David S. Miller

    Peng Li
     
  • This patch adds vlan offload config commands, initializes
    the rules of tx/rx vlan tag handle for hw.

    Signed-off-by: Peng Li
    Signed-off-by: Jian Shen
    Signed-off-by: David S. Miller

    Peng Li
     
  • This patch sets vlan masked, in order to avoid the received
    packets being filtered.

    Signed-off-by: Peng Li
    Signed-off-by: Jian Shen
    Signed-off-by: David S. Miller

    Peng Li
     
  • Add configuration for rss_size_max in hdev but not hardcode it.

    Signed-off-by: Peng Li
    Signed-off-by: Mingguang Qu
    Signed-off-by: David S. Miller

    Peng Li
     
  • This patch fixes a memory leak problems in change tqps process,
    the function hns3_uninit_all_ring and hns3_init_all_ring
    may be called many times.

    Signed-off-by: Peng Li
    Signed-off-by: Mingguang Qu
    Signed-off-by: David S. Miller

    Peng Li
     
  • This patch modifies the return data of get_rxnfc, it will return
    the current handle's rss_size but not the total tqp number.
    because the tc_size has been change to the log2 of roundup
    power of two of rss_size.

    Signed-off-by: Peng Li
    Signed-off-by: Mingguang Qu
    Signed-off-by: David S. Miller

    Peng Li
     
  • This patch adds the support to change tqps number for PF driver
    by using ehtool -L command.

    Signed-off-by: Peng Li
    Signed-off-by: Mingguang Qu
    Signed-off-by: David S. Miller

    Peng Li
     
  • This patch adds the support to query tqps number for PF driver
    by using ehtool -l command.

    Signed-off-by: Peng Li
    Signed-off-by: Mingguang Qu
    Signed-off-by: David S. Miller

    Peng Li
     
  • The 'md' is allocated from 'tun_dst = ip_tun_rx_dst' and
    since we've checked 'tun_dst', 'md' will never be NULL.
    The patch removes it at both ipv4 and ipv6 erspan.

    Fixes: afb4c97d90e6 ("ip6_gre: fix potential memory leak in ip6erspan_rcv")
    Fixes: 50670b6ee9bc ("ip_gre: fix potential memory leak in erspan_rcv")
    Cc: Haishuang Yan
    Signed-off-by: William Tu
    Signed-off-by: David S. Miller

    William Tu
     
  • Dereference tp->md5sig_info in tcp_v4_destroy_sock() the same way it is
    done in the adjacent call to tcp_clear_md5_list().

    Resolves this sparse warning:

    net/ipv4/tcp_ipv4.c:1914:17: warning: incorrect type in argument 1 (different address spaces)
    net/ipv4/tcp_ipv4.c:1914:17: expected struct callback_head *head
    net/ipv4/tcp_ipv4.c:1914:17: got struct callback_head [noderef] *

    Signed-off-by: Mat Martineau
    Acked-by: Christoph Paasch
    Signed-off-by: David S. Miller

    Mat Martineau
     
  • Non-functional cleanups in lan9303_csr_reg_wait():
    - Change type of param 'mask' from int to u32.
    - Remove param 'value' (will probably never be used)
    - Reduced retries from 1000 to 25, consistent with lan9303_read_wait.
    - Removed comments

    Signed-off-by: Egil Hjelmeland

    Changes v1 -> v2:
    - Removed comments
    Signed-off-by: David S. Miller

    Egil Hjelmeland
     
  • If SNAT modifies the source address the resulting packet might match
    an IPsec policy, reinject the packet if that's the case.

    The exact same thing is already done for IPv4.

    Signed-off-by: Tobias Brunner
    Acked-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Tobias Brunner
     
  • In case of tx clean up, we set '-1' as budget. This means clean up until
    wq is empty or till (1 << 32) pkts are cleaned. Under heavy load this
    will run for long time and cause
    "watchdog: BUG: soft lockup - CPU#25 stuck for 21s!" warning.

    This patch sets wq clean up budget to 256.

    Signed-off-by: Govindarajulu Varadarajan
    Signed-off-by: David S. Miller

    Govindarajulu Varadarajan
     
  • ASSERT_RTNL() macro is actual open-coded variant of WARN_ONCE() with
    two exceptions. First, it prints stack for multiple hits and not only
    once as WARN_ONCE() does. Second, the user can disable prints of
    WARN_ONCE by setting CONFIG_BUG to N.

    The multiple prints of dump stack are actually not needed, because calls
    without rtnl lock are programming errors and user can't do anything
    about them except to complain to the mailing list after first occurrence
    of such failure.

    The user who disabled BUG/WARN prints did it explicitly because by default
    in upstream kernel and distributions this option is enabled. It means
    that user doesn't want to see prints about missing locks too.

    This patch replaces open-coded variant in favor of already existing
    macro and change error prints to be once only.

    Reviewed-by: Mark Bloch
    Signed-off-by: Leon Romanovsky
    Signed-off-by: David S. Miller

    Leon Romanovsky
     
  • Remove superfluous pin setup to get out of accessing invalid I/O pin
    registers because the way for pin configuring tends to be different from
    various SoCs and thus it should be better being managed and controlled by
    the pinctrl driver which MT7622 already can support.

    Signed-off-by: Sean Wang
    Signed-off-by: David S. Miller

    Sean Wang
     
  • The property "mediatek,pctl" is only required for SoCs such as MT2701 and
    MT7623, so adding a few words for stating the condition.

    Signed-off-by: Sean Wang
    Reviewed-by: Rob Herring
    Signed-off-by: David S. Miller

    Sean Wang
     

23 Dec, 2017

1 commit

  • Lots of overlapping changes. Also on the net-next side
    the XDP state management is handled more in the generic
    layers so undo the 'net' nfp fix which isn't applicable
    in net-next.

    Include a necessary change by Jakub Kicinski, with log message:

    ====================
    cls_bpf no longer takes care of offload tracking. Make sure
    netdevsim performs necessary checks. This fixes a warning
    caused by TC trying to remove a filter it has not added.

    Signed-off-by: Jakub Kicinski
    Reviewed-by: Quentin Monnet
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

22 Dec, 2017

5 commits

  • Add a couple of stats that aren't in the documentation file
    and rework the top description to be a little more readable.

    Signed-off-by: Shannon Nelson
    Signed-off-by: Steffen Klassert

    Shannon Nelson
     
  • Pull networking fixes from David Miller"
    "What's a holiday weekend without some networking bug fixes? [1]

    1) Fix some eBPF JIT bugs wrt. SKB pointers across helper function
    calls, from Daniel Borkmann.

    2) Fix regression from errata limiting change to marvell PHY driver,
    from Zhao Qiang.

    3) Fix u16 overflow in SCTP, from Xin Long.

    4) Fix potential memory leak during bridge newlink, from Nikolay
    Aleksandrov.

    5) Fix BPF selftest build on s390, from Hendrik Brueckner.

    6) Don't append to cfg80211 automatically generated certs file,
    always write new ones from scratch. From Thierry Reding.

    7) Fix sleep in atomic in mac80211 hwsim, from Jia-Ju Bai.

    8) Fix hang on tg3 MTU change with certain chips, from Brian King.

    9) Add stall detection to arc emac driver and reset chip when this
    happens, from Alexander Kochetkov.

    10) Fix MTU limitng in GRE tunnel drivers, from Xin Long.

    11) Fix stmmac timestamping bug due to mis-shifting of field. From
    Fredrik Hallenberg.

    12) Fix metrics match when deleting an ipv4 route. The kernel sets
    some internal metrics bits which the user isn't going to set when
    it makes the delete request. From Phil Sutter.

    13) mvneta driver loop over RX queues limits on "txq_number" :-) Fix
    from Yelena Krivosheev.

    14) Fix double free and memory corruption in get_net_ns_by_id, from
    Eric W. Biederman.

    15) Flush ipv4 FIB tables in the reverse order. Some tables can share
    their actual backing data, in particular this happens for the MAIN
    and LOCAL tables. We have to kill the LOCAL table first, because
    it uses MAIN's backing memory. Fix from Ido Schimmel.

    16) Several eBPF verifier value tracking fixes, from Edward Cree, Jann
    Horn, and Alexei Starovoitov.

    17) Make changes to ipv6 autoflowlabel sysctl really propagate to
    sockets, unless the socket has set the per-socket value
    explicitly. From Shaohua Li.

    18) Fix leaks and double callback invocations of zerocopy SKBs, from
    Willem de Bruijn"

    [1] Is this a trick question? "Relaxing"? "Quiet"? "Fine"? - Linus.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (77 commits)
    skbuff: skb_copy_ubufs must release uarg even without user frags
    skbuff: orphan frags before zerocopy clone
    net: reevalulate autoflowlabel setting after sysctl setting
    openvswitch: Fix pop_vlan action for double tagged frames
    ipv6: Honor specified parameters in fibmatch lookup
    bpf: do not allow root to mangle valid pointers
    selftests/bpf: add tests for recent bugfixes
    bpf: fix integer overflows
    bpf: don't prune branches when a scalar is replaced with a pointer
    bpf: force strict alignment checks for stack pointers
    bpf: fix missing error return in check_stack_boundary()
    bpf: fix 32-bit ALU op verification
    bpf: fix incorrect tracking of register size truncation
    bpf: fix incorrect sign extension in check_alu_op()
    bpf/verifier: fix bounds calculation on BPF_RSH
    ipv4: Fix use-after-free when flushing FIB tables
    s390/qeth: fix error handling in checksum cmd callback
    tipc: remove joining group member from congested list
    selftests: net: Adding config fragment CONFIG_NUMA=y
    nfp: bpf: keep track of the offloaded program
    ...

    Linus Torvalds
     
  • Sven Eckelmann says:

    ====================
    flow_dissector: Provide basic batman-adv unicast handling

    we are currently starting to use batman-adv as mesh protocol on multicore
    embedded devices. These usually don't have a lot of CPU power per core but
    are reasonable fast when using multiple cores.

    It was noticed that sending was working very well but receiving was
    basically only using on CPU core per neighbor. The reason for that is
    format of the (normal) incoming packet:

    +--------------------+
    | ip(v6)hdr |
    +--------------------+
    | inner ethhdr |
    +--------------------+
    | batadv unicast hdr |
    +--------------------+
    | outer ethhdr |
    +--------------------+

    The flow dissector will therefore stop after parsing the outer ethernet
    header and will not parse the actual ipv(4|6)/... header of the packet. Our
    assumption was now that it would help us to add minimal support to the flow
    dissector to jump over the batman-adv unicast and inner ethernet header
    (like in gre ETH_P_TEB). The patch was implemented in a slightly hacky
    way [1] and the results looked quite promising.

    I didn't get any feedback how the files should actually be named. So I am
    now just using the names from RFC v3

    The discussion of the RFC v3 can be found in the related patches of
    https://patchwork.ozlabs.org/cover/849345/

    The discussion of the RFC v2 can be found in the related patches of
    https://patchwork.ozlabs.org/cover/844783/

    Changes in v4:
    ==============

    * added patch to change the u8/u16 to __u8/__u16 in
    include/uapi/linux/batadv_packet.h
    - requested by Willem de Bruijn

    Changes in v3:
    ==============

    * removed change of uapi/linux/batman_adv.h to uapi/linux/batadv_genl.h
    - requested by Willem de Bruijn
    * removed naming fixes for enums/defines in uapi/linux/batadv_genl.h
    - requested by Willem de Bruijn
    * renamed uapi/linux/batadv.h to uapi/linux/batadv_packet.h
    * moved batadv dissector functionality in own function
    - requested by Tom Herbert
    * added support for flags FLOW_DISSECTOR_F_STOP_AT_ENCAP and
    FLOW_DIS_ENCAPSULATION
    - requested by Willem de Bruijn

    Changes in v2:
    ==============

    * removed the batman-adv unicast packet header definition from flow_dissector.c
    * moved the batman-adv packet.h/uapi headers around to provide the correct
    definitions to flow_dissector.c
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The batman-adv unicast packets contain a full layer 2 frame in encapsulated
    form. The flow dissector must therefore be able to parse the batman-adv
    unicast header to reach the layer 2+3 information.

    +--------------------+
    | ip(v6)hdr |
    +--------------------+
    | inner ethhdr |
    +--------------------+
    | batadv unicast hdr |
    +--------------------+
    | outer ethhdr |
    +--------------------+

    The obtained information from the upper layer can then be used by RPS to
    schedule the processing on separate cores. This allows better distribution
    of multiple flows from the same neighbor to different cores.

    Signed-off-by: Sven Eckelmann
    Reviewed-by: Jiri Pirko
    Acked-by: Willem de Bruijn
    Signed-off-by: David S. Miller

    Sven Eckelmann
     
  • The header file is used by different userspace programs to inject packets
    or to decode sniffed packets. It should therefore be available to them as
    userspace header.

    Also other components in the kernel (like the flow dissector) require
    access to the packet definitions to be able to decode ETH_P_BATMAN ethernet
    packets.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: David S. Miller

    Sven Eckelmann