Permalink
Switch branches/tags
Nothing to show
Commits on Dec 14, 2017
  1. Plug an ifaddr leak when changing a route's src

    rysto32 committed Dec 14, 2017
    If a route is modified in a way that changes the route's source
    address (i.e. the address used to access the gateway), then a
    reference on the ifaddr representing the old source address will
    be leaked if the address type does not have an ifa_rtrequest
    method defined.  Plug the leak by releasing the reference in
    all cases.
    
    Differential Revision:	https://reviews.freebsd.org/D13417
    Reviewed by:	ae
    MFC after:	3 weeks
    Sponsored by:	Dell
Commits on Sep 12, 2017
  1. Fix incorrect error message in iovctl

    rysto32 committed Sep 12, 2017
    If the iovctl command was invoked with only the -C flag, the user would
    receive a message claiming that they needed to also supply either the
    -d flag or the -f flag.  However, in the case of the -C mode, only the
    -f flag is acceptable.  Correct this error message in this case.
    
    PR:		222050
    Submitted by:	Heinz N. Gies
    Reported by:	Heinz N. Gies
    MFC after:	1 week
Commits on Aug 2, 2017
  1. Add my birthdate to the calendar

    rysto32 committed Aug 2, 2017
    Requested by:	mckusick
Commits on Apr 5, 2017
  1. Revert the optimization from r304436

    rysto32 committed Apr 5, 2017
    r304436 attempted to optimize the handling of incoming UDP packet by only
    making an expensive call to in_broadcast() if the mbuf was marked as an
    broadcast packet.  Unfortunately, this cannot work in the case of point-to-
    point L2 protocols like PPP, which have no notion of "broadcast".  The
    optimization has been disabled for several months now with no progress
    towards fixing it, so it needs to go.
Commits on Feb 16, 2017
  1. Revert r313814 and r313816

    rysto32 committed Feb 16, 2017
    Something evidently got mangled in my git tree in between testing and
    review, as an old and broken version of the patch was apparently submitted
    to svn.  Revert this while I work out what went wrong.
    
    Reported by:	tuexen
    Pointy hat to:	rstone
  2. Fix a typo in my previous commit

    rysto32 committed Feb 16, 2017
    Somehow in the late stages of testing my sched_ule patch, a character was
    accidentally deleted from the file.  Correct this.
    
    While I'm committing anyway, the previous commit message requires some
    clarification: in the normal case of unlending priority after releasing
    a mutex, the thread that was doing the lending will be woken up and
    immediately become the highest-priority thread, and in that case no
    priority inversion would take place.  However, if that thread is pinned
    to a different CPU, then the currently running thread that just had its
    priority lowered will not be preempted and then priority inversion can
    occur.
    
    Reported by:	O. Hartmann (typo), jhb (scheduler clarification)
    MFC after:	1 month
    Pointy hat to:	rstone
  3. Check for preemption after lowering a thread's priority

    rysto32 committed Feb 16, 2017
    When a high-priority thread is waiting for a mutex held by a
    low-priority thread, it temporarily lends its priority to the
    low-priority thread to prevent priority inversion.  When the mutex
    is released, the lent priority is revoked and the low-priority
    thread goes back to its original priority.
    
    When the priority of that thread is lowered (through a call to
    sched_priority()), the schedule was not checking whether
    there is now a high-priority thread in the run queue.  This can
    cause threads with real-time priority to be starved in the run
    queue while the low-priority thread finishes its quantum.
    
    Fix this by explicitly checking whether preemption is necessary
    when a thread's priority is lowered.
    
    Sponsored by: Dell EMC Isilon
    Obtained from: Sandvine Inc
    Differential Revision:	https://reviews.freebsd.org/D9518
    Reviewed by: Jeff Roberson (ule)
    MFC after: 1 month
Commits on Feb 11, 2017
  1. Don't zero out srtt after excess retransmits

    rysto32 committed Feb 11, 2017
    If the TCP stack has retransmitted more than 1/4 of the total
    number of retransmits before a connection drop, it decides that
    its current RTT estimate is hopelessly out of date and decides
    to recalculate it from scratch starting with the next ACK.
    
    Unfortunately, it implements this by zeroing out the current RTT
    estimate.  Drop this hack entirely, as it makes it significantly more
    difficult to debug connection issues.  Instead check for excessive
    retransmits at the point where srtt is updated from an ACK being
    received.  If we've exceeded 1/4 of the maximum retransmits,
    discard the previous srtt estimate and replace it with the latest
    rtt measurement.
    
    Differential Revision:	https://reviews.freebsd.org/D9519
    Reviewed by:	gnn
    Sponsored by:	Dell EMC Isilon
Commits on Jan 20, 2017
  1. Fix reference to free memory in ixgbe/if_media.c

    rysto32 committed Jan 20, 2017
    When ixgbe receives an interrupt indicating that a new optical module
    may have been inserted, it discards all of its current media types
    by calling ifmedia_removeall() and then creates a new set of media
    types for the supported media on the new module.  However,
    ifmedia_removeall() was maintaining a pointer to whatever the
    current media type was before the call to ifmedia_removealL().
    The result of this was that any attempt to read the current media
    type of the interface (e.g. via ifconfig) would return potentially
    garbage data from free memory (or if one were particularly unlucky
    on an architecture that does not malloc() from a direct map, page
    fault the kernel).
    
    Fix this by NULL'ing out the current media field in if_media.c,
    and have ixgbe update the current media type after recreating
    them.
    
    Submitted by:	Matt Joras <matt.joras AT gmail DOT com>
    Reviewed by:	sbruno, erj
    MFC after:	1 week
    Sponsored by:	Dell EMC Isilon
    Differential Revision:	https://reviews.freebsd.org/D9164
Commits on Dec 2, 2016
  1. Revert r309372

    rysto32 committed Dec 2, 2016
    The bug intended to be fixed by r309372 was already addressed by r296178,
    so revert my change.
    
    Reported by:	seph
Commits on Dec 1, 2016
  1. Fix a false positive in a buf_ring assert

    rysto32 committed Dec 1, 2016
    buf_ring contains an assert that checks whether an item being
    enqueued already exists on the ring.  There is a subtle bug in
    this assert.  An item can be returned by a peek() function and
    freed, and then the consumer thread can be preempted before
    calling advance().  If this happens the item appears to still be
    on the queue, but another thread may allocate the item from the
    free pool and wind up trying to enqueue it again, causing the
    assert to trigger incorrectly.
    
    Fix this by skipping the head of the consumer's portion of the
    ring, as this index is what will be returned by peek().
    
    Sponsored by:	Dell EMC Isilon
    MFC After:	1 week
    Differential Revision:	https://reviews.freebsd.org/D8685
    Reviewed by:	hselasky
Commits on Nov 18, 2016
Commits on Nov 12, 2016
  1. Don't read if_counters with if_addr_lock held

    rysto32 committed Nov 12, 2016
    Calling into an ifnet implementation with the if_addr_lock already
    held can cause a LOR and potentially a deadlock, as ifnet
    implementations typically can take the if_addr_lock after their
    own locks during configuration.  Refactor a sysctl handler that
    was violating this to read if_counter data in a temporary buffer
    before the if_addr_lock is taken, and then copying the data
    in its final location later, when the if_addr_lock is held.
    
    PR: 194109
    Reported by: Jean-Sebastien Pedron
    MFC after: 2 weeks
    Differential Revision:	https://reviews.freebsd.org/D8498
    Reviewed by: sbruno
Commits on Nov 11, 2016
  1. Fix git tools when run against a worktree

    rysto32 committed Nov 11, 2016
    In a git worktree, the gitdir is in an entirely different location.
    In arcgit, use git rev-parse --git-dir to get the correct path to it
    always.
    
    When running git from outside of the work tree, as in importgit,
    the path provided by git rev-parse --git-dir can be either a
    relative or absolute path depending on the work tree.  Rather
    than trying to deal with that, just use git -C.
    
    Differential Revision:	https://reviews.freebsd.org/D8501
    Reviewed by: markj
Commits on Oct 24, 2016
  1. Fix ip_output() on point-to-point links

    rysto32 committed Oct 24, 2016
    In r304435, ip_output() was changed to use the result of the route
    lookup to decide whether the outgoing packet was a broadcast or
    not.  This introduced a regression on interfaces where
    IFF_BROADCAST was not set (e.g. point-to-point links), as the
    algorithm could incorrectly treat the destination address as a
    broadcast address, and ip_output() would subsequently drop the
    packet as broadcasting on a non-IFF_BROADCAST interface is not
    allowed.
    
    Differential Revision:	https://reviews.freebsd.org/D8303
    Reviewed by:	jtl
    Reported by:	ambrisko
    MFC after:	2 weeks
    X-MFC-With:	r304435
    Sponsored by:	Dell EMC Isilon
Commits on Oct 20, 2016
  1. Set the executable bit on arcgit and importgit

    rysto32 committed Oct 20, 2016
    Make it possible to run these scripts directly out of svn by setting
    the executable property on them.
  2. Add some tools to simplify the use of git

    rysto32 committed Oct 20, 2016
    Add some scripts that wraps some FreeBSD Project infrastructure
    and simplifies using them with git.  The scripts are:
    
     - arcgit, which creates a series of reviews in Differential
     - importgit, which applies a series of git commits to svn
    
    Differential Revision:      https://reviews.freebsd.org/D2071
Commits on Aug 22, 2016
  1. Temporarily disable the optimization from r304436

    rysto32 committed Aug 22, 2016
    r304436 attempted to optimize the handling of incoming UDP packet by only
    making an expensive call to in_broadcast() if the mbuf was marked as an
    broadcast packet.  Unfortunately, this cannot work in the case of point-to-
    point L2 protocols like PPP, which have no notion of "broadcast".
    
    Discussions on how to properly fix r304436 are ongoing, but in the meantime
    disable the optimization to ensure that no existing network setups are broken.
    
    Reported by:	bms
Commits on Aug 18, 2016
  1. Fix unlocked access to ifnet address list

    rysto32 committed Aug 18, 2016
    in_broadcast() was iterating over the ifnet address list without
    first taking an IF_ADDR_RLOCK.  This could cause a panic if a
    concurrent operation modified the list.
    
    Reviewed by: bz
    MFC after: 2 months
    Sponsored by: EMC / Isilon Storage Division
    Differential Revision: https://reviews.freebsd.org/D7227
  2. Don't check for broadcast IPs on non-bcast pkts

    rysto32 committed Aug 18, 2016
    in_broadcast() can be quite expensive, so skip calling it if the
    incoming mbuf wasn't sent to a broadcast L2 address in the first
    place.
    
    Reviewed by: gnn
    MFC after: 2 months
    Sponsored by: EMC / Isilon Storage Division
    Differential Revision: https://reviews.freebsd.org/D7309
  3. Don't iterate over the ifnet addr list in ip_output()

    rysto32 committed Aug 18, 2016
    For almost every packet that is transmitted through ip_output(),
    a call to in_broadcast() was made to decide if the destination
    IP was a broadcast address.  in_broadcast() iterates over the
    ifnet's address to find a source IP matching the subnet of the
    destination IP, and then checks if the IP is a broadcast in that
    subnet.
    
    This is completely redundant as we have already performed the
    route lookup, so the source IP is already known.  Just use that
    address to directly check whether the destination IP is a
    broadcast address or not.
    
    MFC after:	2 months
    Sponsored By:	EMC / Isilon Storage Division
    Differential Revision: https://reviews.freebsd.org/D7266
Commits on Aug 8, 2016
  1. Don't enqueue NULL on a drbr

    rysto32 committed Aug 8, 2016
    In one corner case in the bxe TX path, a NULL mbuf could be enqueued onto
    a drbr queue.  This could case a KASSERT to fire with INVARIANTS enabled,
    or the processing of packets from the queue to be prematurely ended later
    on.
    
    Submitted by:	Matt Joras (matt.joras AT isilon.com)
    Reviewed by:	davidcs
    MFC after:	3 days
    Sponsored by:	EMC / Isilon Storage Division
    Differential Revision:	https://reviews.freebsd.org/D7041
Commits on Mar 14, 2016
Commits on Jan 5, 2016
  1. MFC r287920:

    rysto32 committed Jan 5, 2016
      Fix /sbin/route to never look up (invalid) interface names through DNS
    
      /sbin/route has a bug where if it is passed an interface name that does
      not exist, it falls through and winds up interpreting it as a hostname.
      It fails out eventually, but on a system where DNS lookup is broken you
      can end up waiting for up to 60 seconds waiting for the DNS lookup to
      timeout.  I'm not quite sure what happens if the DNS lookup somehow
      succeeds but I doubt that can end well.
    
      Reviewed by:  markj, cem
      MFC after:    2 weeks
      Sponsored by: EMC/Isilon Storage Division
Commits on Sep 17, 2015
  1. MFC r280957

    rysto32 committed Sep 17, 2015
      Fix integer truncation bug in malloc(9)
    
      A couple of internal functions used by malloc(9) and uma truncated
      a size_t down to an int.  This could cause any number of issues
      (e.g. indefinite sleeps, memory corruption) if any kernel
      subsystem tried to allocate 2GB or more through malloc.  zfs would
      attempt such an allocation when run on a system with 2TB or more
      of RAM.
  2. MFC r279410:

    rysto32 committed Sep 17, 2015
      Correct the use of an unitialized variable in sendfind_getobj()
    
      When sendfile_getobj() is called on a DTYPE_SHM file, it never
      initializes error, which is eventually returned to the caller.
  3. MFC r279413:

    rysto32 committed Sep 17, 2015
      Add a missing include of an options header.
    
      watchdog.c does an #ifdef DDB but does not #include "opt_ddb.h".
      Fixing this turned up a missing include file.
  4. MFC r263109

    rysto32 committed Sep 17, 2015
      Add MSI support to puc(9)
    
      Add support for MSI interrupts in the puc(9) driver.  By default the driver
      will prefer MSI interrupts to legacy interrupts.  A tunable,
      hw.puc.msi_disable, has been added to force the allocation of legacy
      interrupts.
    
      Reviewed by:  jhb@
      MFC after:    2 weeks
      Sponsored by: Sandvine Inc.
  5. MFC r286970:

    rysto32 committed Sep 17, 2015
      Prevent ticks rollover from preventing vm_lowmem event
    
      Currently vm_pageout_scan() uses a ticks-based scheme to rate-limit
      the number of times that the vm_lowmem event will happen.  However
      if no events happen for long enough for ticks to roll over, this
      leaves us in a long window in which vm_lowmem events will not
      happen.
    
      Replace the use of ticks with time_t to prevent rollover from ever
      being an issue.
    
      Reviewed by:  ian
      MFC after:    3 weeks
      Sponsored by: EMC / Isilon Storage Division
      Differential Revision:        https://reviews.freebsd.org/D3439
  6. Fix /sbin/route to never look up (invalid) interface names through DNS

    rysto32 committed Sep 17, 2015
    /sbin/route has a bug where if it is passed an interface name that does
    not exist, it falls through and winds up interpreting it as a hostname.
    It fails out eventually, but on a system where DNS lookup is broken you
    can end up waiting for up to 60 seconds waiting for the DNS lookup to
    timeout.  I'm not quite sure what happens if the DNS lookup somehow
    succeeds but I doubt that can end well.
    
    Reviewed by:	markj, cem
    MFC after:	2 weeks
    Sponsored by:	EMC/Isilon Storage Division
Commits on Aug 20, 2015
  1. Prevent ticks rollover from preventing vm_lowmem event

    rysto32 committed Aug 20, 2015
    Currently vm_pageout_scan() uses a ticks-based scheme to rate-limit
    the number of times that the vm_lowmem event will happen.  However
    if no events happen for long enough for ticks to roll over, this
    leaves us in a long window in which vm_lowmem events will not
    happen.
    
    Replace the use of ticks with time_t to prevent rollover from ever
    being an issue.
    
    Reviewed by:	ian
    MFC after:	3 weeks
    Sponsored by:	EMC / Isilon Storage Division
    Differential Revision:	https://reviews.freebsd.org/D3439
Commits on Apr 1, 2015
  1. Fix integer truncation bug in malloc(9)

    rysto32 committed Apr 1, 2015
    A couple of internal functions used by malloc(9) and uma truncated
    a size_t down to an int.  This could cause any number of issues
    (e.g. indefinite sleeps, memory corruption) if any kernel
    subsystem tried to allocate 2GB or more through malloc.  zfs would
    attempt such an allocation when run on a system with 2TB or more
    of RAM.
    
    Note to self: When this is MFCed, sparc64 needs the same fix.
    
    Differential revision:	https://reviews.freebsd.org/D2106
    Reviewed by:	kib
    Reported by:	Michael Fuckner <michael@fuckner.net>
    Tested by:	Michael Fuckner <michael@fuckner.net>
    MFC after:	2 weeks
Commits on Mar 12, 2015
  1. hwpmc: Fix event number to match enum name

    rysto32 committed Mar 12, 2015
    Differential revision:	https://reviews.freebsd.org/D1592
    Reviewed by:	Joseph Kong
    MFC after:	1 month
Commits on Mar 10, 2015
  1. Fix SR-IOV passthrough devices to allow ppt to attach

    rysto32 committed Mar 10, 2015
    A late change to the SR-IOV infrastructure broke passthrough of
    VFs.  device_set_devclass() was being used to try to force the
    ppt driver to attach to the device, but this didn't work because
    the DF_FIXEDCLASS flag wasn't being set on the device, so the
    ppt driver probe routine would not match when it returned
    BUS_NOWILDCARD.  Fix this by adding a new device function that
    both sets the devclass and sets the DF_FIXEDCLASS flag, and use
    that to force the ppt driver to attach to VFs.
    
    Differential Revision: https://reviews.freebsd.org/D2041
    Reviewed by:	jhb
    MFC after:	3 weeks
  2. Add missing counter definitions

    rysto32 committed Mar 10, 2015
    Differential Revision:	https://reviews.freebsd.org/D1591
    MFC after:	1 month
    Sponsored by:	Sandvine Inc