/[base]/head/sys/netinet/udp_usrreq.c
ViewVC logotype

Log of /head/sys/netinet/udp_usrreq.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:


Revision 366813 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 18 17:15:47 2020 UTC (3 years, 8 months ago) by melifaro
File length: 45638 byte(s)
Diff to previous 365881
Implement flowid calculation for outbound connections to balance
 connections over multiple paths.

Multipath routing relies on mbuf flowid data for both transit
 and outbound traffic. Current code fills mbuf flowid from inp_flowid
 for connection-oriented sockets. However, inp_flowid is currently
 not calculated for outbound connections.

This change creates simple hashing functions and starts calculating hashes
 for TCP,UDP/UDP-Lite and raw IP if multipath routes are present in the
 system.

Reviewed by:	glebius (previous version),ae
Differential Revision:	https://reviews.freebsd.org/D26523


Revision 365881 - (view) (download) (annotate) - [select for diffs]
Modified Fri Sep 18 14:01:10 2020 UTC (3 years, 9 months ago) by mhorne
File length: 46084 byte(s)
Diff to previous 365071
Initialize some local variables earlier

Move the initialization of these variables to the beginning of their
respective functions.

On our end this creates a small amount of unneeded churn, as these
variables are properly initialized before their first use in all cases.
However, changing this benefits at least one downstream consumer
(NetApp) by allowing local and future modifications to these functions
to be made without worrying about where the initialization occurs.

Reviewed by:	melifaro, rscheff
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26454


Revision 365071 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 1 21:19:14 2020 UTC (3 years, 10 months ago) by mjg
File length: 46094 byte(s)
Diff to previous 364018
net: clean up empty lines in .c and .h files


Revision 364018 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 7 15:13:53 2020 UTC (3 years, 10 months ago) by bz
File length: 46095 byte(s)
Diff to previous 360292
IPV6_PKTINFO support for v4-mapped IPv6 sockets

When using v4-mapped IPv6 sockets with IPV6_PKTINFO we do not
respect the given v4-mapped src address on the IPv4 socket.
Implement the needed functionality. This allows single-socket
UDP applications (such as OpenVPN) to work better on FreeBSD.

Requested by:	Gert Doering (gert greenie.net), pfsense
Tested by:	Gert Doering (gert greenie.net)
Reviewed by:	melifaro
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24135


Revision 360292 - (view) (download) (annotate) - [select for diffs]
Modified Sat Apr 25 09:06:11 2020 UTC (4 years, 2 months ago) by melifaro
File length: 44627 byte(s)
Diff to previous 358333
Convert route caching to nexthop caching.

This change is build on top of nexthop objects introduced in r359823.

Nexthops are separate datastructures, containing all necessary information
 to perform packet forwarding such as gateway interface and mtu. Nexthops
 are shared among the routes, providing more pre-computed cache-efficient
 data while requiring less memory. Splitting the LPM code and the attached
 data solves multiple long-standing problems in the routing layer,
 drastically reduces the coupling with outher parts of the stack and allows
 to transparently introduce faster lookup algorithms.

Route caching was (re)introduced to minimise (slow) routing lookups, allowing
 for notably better performance for large TCP senders. Caching works by
 acquiring rtentry reference, which is protected by per-rtentry mutex.
 If the routing table is changed (checked by comparing the rtable generation id)
 or link goes down, cache record gets withdrawn.

Nexthops have the same reference counting interface, backed by refcount(9).
This change merely replaces rtentry with the actual forwarding nextop as a
 cached object, which is mostly mechanical. Other moving parts like cache
 cleanup on rtable change remains the same.

Differential Revision:	https://reviews.freebsd.org/D24340


Revision 358333 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 26 14:26:36 2020 UTC (4 years, 4 months ago) by kaktus
File length: 44594 byte(s)
Diff to previous 357818
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE.  All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by:	kib (mentor, blanket)
Commented by:	kib, gallatin, melifaro
Differential Revision:	https://reviews.freebsd.org/D23718


Revision 357818 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 12 13:31:36 2020 UTC (4 years, 4 months ago) by rrs
File length: 44548 byte(s)
Diff to previous 356983
White space cleanup -- remove trailing tab's or spaces
from any line.

Sponsored by:	Netflix Inc.


Revision 356983 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jan 22 06:10:41 2020 UTC (4 years, 5 months ago) by glebius
File length: 44551 byte(s)
Diff to previous 356527
Make in_pcbladdr() require network epoch entered by its callers.  Together
with this widen network epoch coverage up to tcp_connect() and udp_connect().

Revisions from r356974 and up to this revision cover D23187.

Differential Revision:	https://reviews.freebsd.org/D23187


Revision 356527 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jan 8 23:30:26 2020 UTC (4 years, 5 months ago) by bz
File length: 44482 byte(s)
Diff to previous 354484
vnet: virtualise more network stack sysctls.

Virtualise tcp_always_keepalive, TCP and UDP log_in_vain.  All three are
set in the netoptions startup script, which we would love to run for VNETs
as well [1].

While virtualising the log_in_vain sysctls seems pointles at first for as
long as the kernel message buffer is not virtualised, it at least allows
an administrator to debug the base system or an individual jail if needed
without turning the logging on for all jails running on a system.

PR:		243193 [1]
MFC after:	2 weeks


Revision 354484 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 7 21:27:32 2019 UTC (4 years, 7 months ago) by glebius
File length: 44440 byte(s)
Diff to previous 354481
Now that there is no R/W lock on PCB list the pcblist sysctls
handlers can be greatly simplified.  All the previous double
cycling and complex locking was added to avoid these functions
holding global PCB locks for extended period of time, preventing
addition of new entries.


Revision 354481 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 7 21:08:49 2019 UTC (4 years, 7 months ago) by glebius
File length: 45392 byte(s)
Diff to previous 354479
Remove unnecessary recursive epoch enter via INP_INFO_RLOCK
macro in udp_input().  It shall always run in the network epoch.


Revision 354479 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 7 21:01:36 2019 UTC (4 years, 7 months ago) by glebius
File length: 45502 byte(s)
Diff to previous 354477
Now with epoch synchronized PCB lookup tables we can greatly simplify
locking in udp_output() and udp6_output().

First, we select if we need read or write lock in PCB itself, we take
the lock and enter network epoch.  Then, we proceed for the rest of
the function.  In case if we need to modify PCB hash, we would take
write lock on it for a short piece of code.

We could exit the epoch before allocating an mbuf, but with this
patch we are keeping it all the way into ip_output()/ip6_output().
Today this creates an epoch recursion, since ip_output() enters epoch
itself.  However, once all protocols are reviewed, ip_output() and
ip6_output() would require epoch instead of entering it.

Note: I'm not 100% sure that in udp6_output() the epoch is required.
We don't do PCB hash lookup for a bound socket.  And all branches of
in6_select_src() don't require epoch, at least they lack assertions.
Today inet6 address list is protected by rmlock, although it is CKLIST.
AFAIU, the future plan is to protect it by network epoch.  That would
require epoch in in6_select_src().  Anyway, in future ip6_output()
would require epoch, udp6_output() would need to enter it.


Revision 354477 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 7 20:49:56 2019 UTC (4 years, 7 months ago) by glebius
File length: 48970 byte(s)
Diff to previous 354462
Since r353292 on input path we are always in network epoch, when
we lookup PCBs.  Thus, do not enter epoch recursively in
in_pcblookup_hash() and in6_pcblookup_hash().  Same applies to
tcp_ctlinput() and tcp6_ctlinput().

This leaves several sysctl(9) handlers that return PCB credentials
unprotected.  Add epoch enter/exit to all of them.

Differential Revision:	https://reviews.freebsd.org/D22197


Revision 354462 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 7 18:29:51 2019 UTC (4 years, 7 months ago) by bz
File length: 48901 byte(s)
Diff to previous 348494
netinet*: variable cleanup

In preparation for another change factor out various variable cleanups.
These mainly include:
(1) do not assign values to variables during declaration:  this makes
    the code more readable and does allow for better grouping of
    variable declarations,
(2) do not assign values to variables before need; e.g., if a variable
    is only used in the 2nd half of a function and we have multiple
    return paths before that, then do not set it before it is needed, and
(3) try to avoid assigning the same value multiple times.

MFC after:	3 weeks
Sponsored by:	Netflix


Revision 348494 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jun 1 14:57:42 2019 UTC (5 years, 1 month ago) by bz
File length: 48930 byte(s)
Diff to previous 348061
After parts of the locking fixes in r346595, syzkaller found
another one in udp_output(). This one is a race condition.
We do check on the laddr and lport without holding a lock in
order to determine whether we want a read or a write lock
(this is in the "sendto/sendmsg" cases where addr (sin) is given).

Instrumenting the kernel showed that after taking the lock, we
had bound to a local port from a parallel thread on the same socket.

If we find that case, unlock, and retry again. Taking the write
lock would not be a problem in first place (apart from killing some
parallelism). However the retry is needed as later on based on
similar condition checks we do acquire the pcbinfo lock and if the
conditions have changed, we might find ourselves with a lock
inconsistency, hence at the end of the function when trying to
unlock, hitting the KASSERT.

Reported by:	syzbot+bdf4caa36f3ceeac198f@syzkaller.appspotmail.com
Reviewed by:	markj
MFC after:	6 weeks
Event:		Waterloo Hackathon 2019


Revision 348061 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 21 19:23:56 2019 UTC (5 years, 1 month ago) by bz
File length: 48451 byte(s)
Diff to previous 348060
Massively blow up the locking-related KASSERTs used to make sure
that we end up in a consistent locking state at the end of
udp_output() in order to be able to see what the values are based
on which we once took a decision (note: some values may have changed).

This helped to debug a syzkaller report.

MFC after:	2 months
Event:		Waterloo Hackathon 2019


Revision 348060 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 21 19:18:55 2019 UTC (5 years, 1 month ago) by bz
File length: 47933 byte(s)
Diff to previous 346595
Similarly to r338257,338306 try to fold the two consecutive
#ifdef RSS section in udp_output() into one by moving a '}'
outside of the conditional block.

MFC after:	2 months
Event:		Waterloo Hackathon 2019


Revision 346595 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 23 10:12:33 2019 UTC (5 years, 2 months ago) by bz
File length: 47950 byte(s)
Diff to previous 346556
iFix udp_output() lock inconsistency.

In r297225 the initial INP_RLOCK() was replaced by an early
acquisition of an r- or w-lock depending on input variables
possibly extending the write locked area for reasons not entirely
clear but possibly to avoid a later case of unlock and relock
leading to a possible race condition and possibly in order to
allow the route cache to work for connected sockets.

Unfortunately the conditions were not 1:1 replicated (probably
because of the route cache needs). While this would not be a
problem the legacy IP code compared to IPv6 has an extra case
when dealing with IP_SENDSRCADDR. In a particular case we were
holding an exclusive inp lock and acquired the shared udbinfo
lock (now epoch).
When then running into an error case, the locking assertions
on release fired as the udpinfo and inp lock levels did not match.

Break up the special case and in that particular case acquire
and udpinfo lock depending on the exclusitivity of the inp lock.

MFC After:	9 days
Reported-by:	syzbot+1f5c6800e4f99bdb1a48@syzkaller.appspotmail.com
Reviewed by:	tuexen
Differential Revision:	https://reviews.freebsd.org/D19594


Revision 346556 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 22 14:53:53 2019 UTC (5 years, 2 months ago) by bz
File length: 47505 byte(s)
Diff to previous 346554
r297225 move the assignment of sin from add to the top of the function.
sin is not changed after the initial assignment, so no need to set it again.

MFC after:	10 days


Revision 346554 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 22 14:20:49 2019 UTC (5 years, 2 months ago) by bz
File length: 47540 byte(s)
Diff to previous 340783
Remove some excessive brackets.

No functional change.

MFC after:	10 days


Revision 340783 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 22 20:49:41 2018 UTC (5 years, 7 months ago) by markj
File length: 47563 byte(s)
Diff to previous 339339
Plug some networking sysctl leaks.

Various network protocol sysctl handlers were not zero-filling their
output buffers and thus would export uninitialized stack memory to
userland.  Fix a number of such handlers.

Reported by:	Thomas Barabosch, Fraunhofer FKIE
Reviewed by:	tuexen
MFC after:	3 days
Security:	kernel memory disclosure
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18301


Revision 339339 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 12 22:51:45 2018 UTC (5 years, 8 months ago) by bz
File length: 47536 byte(s)
Diff to previous 339327
In udp_input() when walking the pcblist we can come across
an inp marked FREED after the epoch(9) changes.
Check once we hold the lock and skip the inp if it is the case.

Contrary to IPv6 the locking of the inp is outside the multicast
section and hence a single check seems to suffice.

PR:		232192
Reviewed by:	mmacy, markj
Approved by:	re (kib)
Differential Revision:	https://reviews.freebsd.org/D17540


Revision 339327 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 12 11:30:46 2018 UTC (5 years, 8 months ago) by bz
File length: 47439 byte(s)
Diff to previous 339185
r217592 moved the check for imo in udp_input() into the conditional block
but leaving the variable assignment outside the block, where it is no longer
used. Move both the variable and the assignment one block further in.

This should result in no functional changes. It will however make upcoming
changes slightly easier to apply.

Reviewed by:		markj, jtl, tuexen
Approved by:		re (kib)
Differential Revision:	https://reviews.freebsd.org/D17525


Revision 339185 - (view) (download) (annotate) - [select for diffs]
Modified Thu Oct 4 22:03:58 2018 UTC (5 years, 8 months ago) by rstone
File length: 47435 byte(s)
Diff to previous 337018
Hold a write lock across udp_notify()

With the new route cache feature udp_notify() will modify the inp when it
needs to invalidate the route cache.  Ensure that we hold a write lock on
the inp before calling the function to ensure that multiple threads don't
race while trying to invalidate the cache (which previously lead to a page
fault).

Differential Revision: https://reviews.freebsd.org/D17246
Reviewed by: sbruno, bz, karels
Sponsored by: Dell EMC Isilon
Approved by:	re (gjb)


Revision 337018 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jul 31 22:56:03 2018 UTC (5 years, 11 months ago) by tuexen
File length: 47704 byte(s)
Diff to previous 336676
Add a dtrace provider for UDP-Lite.

The dtrace provider for UDP-Lite is modeled after the UDP provider.
This fixes the bug that UDP-Lite packets were triggering the UDP
provider.
Thanks to dteske@ for providing the dwatch module.

Reviewed by:		dteske@, markj@, rrs@
Relnotes:		yes
Differential Revision:	https://reviews.freebsd.org/D16377


Revision 336676 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jul 24 16:35:52 2018 UTC (5 years, 11 months ago) by andrew
File length: 47130 byte(s)
Diff to previous 336574
Use the new VNET_DEFINE_STATIC macro when we are defining static VNET
variables.

Reviewed by:	bz
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D16147


Revision 336574 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 21 02:14:13 2018 UTC (5 years, 11 months ago) by tuexen
File length: 47130 byte(s)
Diff to previous 336551
Set the IPv4 version in the IP header for UDP and UDPLite.


Revision 336551 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 20 15:32:20 2018 UTC (5 years, 11 months ago) by tuexen
File length: 47136 byte(s)
Diff to previous 335924
Add missing dtrace probes for received UDP packets.

Fire UDP receive probes when a packet is received and there is no
endpoint consuming it. Fire the probe also if the TTL of the
received packet is smaller than the minimum required by the endpoint.

Clarify also in the man page, when the probe fires.

Reviewed by:		dteske@, markj@, rrs@
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D16046


Revision 335924 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jul 4 02:47:16 2018 UTC (6 years ago) by mmacy
File length: 47042 byte(s)
Diff to previous 335856
epoch(9): allow preemptible epochs to compose

- Add tracker argument to preemptible epochs
- Inline epoch read path in kernel and tied modules
- Change in_epoch to take an epoch as argument
- Simplify tfb_tcp_do_segment to not take a ti_locked argument,
  there's no longer any benefit to dropping the pcbinfo lock
  and trying to do so just adds an error prone branchfest to
  these functions
- Remove cases of same function recursion on the epoch as
  recursing is no longer free.
- Remove the the TAILQ_ENTRY and epoch_section from struct
  thread as the tracker field is now stack or heap allocated
  as appropriate.

Tested by: pho and Limelight Networks
Reviewed by: kbowling at llnw dot com
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16066


Revision 335856 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 2 05:19:44 2018 UTC (6 years ago) by mmacy
File length: 46880 byte(s)
Diff to previous 335468
inpcb: don't gratuitously defer frees

Don't defer frees in sysctl handlers. It isn't necessary
and it just confuses things.
revert: r333911, r334104, and r334125

Requested by: jtl


Revision 335468 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 21 06:10:52 2018 UTC (6 years ago) by mmacy
File length: 46885 byte(s)
Diff to previous 335016
udp_ctlinput: don't refer to unpcb after we drop the lock

Reported by: pho@


Revision 335016 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jun 12 22:18:20 2018 UTC (6 years ago) by mmacy
File length: 46869 byte(s)
Diff to previous 334719
mechanical CK macro conversion of inpcbinfo lists

This is a dependency for converting the inpcbinfo hash and info rlocks
to epoch.


Revision 334719 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jun 6 15:45:57 2018 UTC (6 years ago) by sbruno
File length: 46860 byte(s)
Diff to previous 334125
Load balance sockets with new SO_REUSEPORT_LB option.

This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple
programs or threads to bind to the same port and incoming connections will be
load balanced using a hash function.

Most of the code was copied from a similar patch for DragonflyBSD.

However, in DragonflyBSD, load balancing is a global on/off setting and can not
be set per socket. This patch allows for simultaneous use of both the current
SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system.

Required changes to structures:
Globally change so_options from 16 to 32 bit value to allow for more options.
Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets.

Limitations:
As DragonflyBSD, a load balance group is limited to 256 pcbs (256 programs or
threads sharing the same socket).

This is a substantially different contribution as compared to its original
incarnation at svn r332894 and reverted at svn r332967.  Thanks to rwatson@
for the substantive feedback that is included in this commit.

Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Obtained from:	DragonflyBSD
Relnotes:	Yes
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D11003


Revision 334125 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 24 01:04:56 2018 UTC (6 years, 1 month ago) by mmacy
File length: 46844 byte(s)
Diff to previous 334116
convert allocations to INVARIANTS M_ZERO


Revision 334116 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 23 20:50:09 2018 UTC (6 years, 1 month ago) by mmacy
File length: 46837 byte(s)
Diff to previous 334104
udp: assign flowid to udp sockets round-robin

On a 2x8x2 SKL this increases measured throughput with 64
netperf -H $DUT -t UDP_STREAM -- -m 1

from 590kpps to 1.1Mpps
before:
https://people.freebsd.org/~mmacy/2018.05.11/udpsender.svg
after:
https://people.freebsd.org/~mmacy/2018.05.11/udpsender2.svg


Revision 334104 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 23 17:00:05 2018 UTC (6 years, 1 month ago) by mmacy
File length: 46712 byte(s)
Diff to previous 333911
epoch: allow for conditionally asserting that the epoch context fields
are unused by zeroing on INVARIANTS builds


Revision 333911 - (view) (download) (annotate) - [select for diffs]
Modified Sun May 20 02:27:58 2018 UTC (6 years, 1 month ago) by mmacy
File length: 46708 byte(s)
Diff to previous 332967
inpcb: consolidate possible deletion in pcblist functions in to epoch
deferred context.


Revision 332967 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 24 19:55:12 2018 UTC (6 years, 2 months ago) by sbruno
File length: 46714 byte(s)
Diff to previous 332894
Revert r332894 at the request of the submitter.

Submitted by:	Johannes Lundberg <johalun0_gmail.com>
Sponsored by:	Limelight Networks


Revision 332894 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 23 19:51:00 2018 UTC (6 years, 2 months ago) by sbruno
File length: 46730 byte(s)
Diff to previous 326023
Load balance sockets with new SO_REUSEPORT_LB option

This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple
programs or threads to bind to the same port and incoming connections will be
load balanced using a hash function.

Most of the code was copied from a similar patch for DragonflyBSD.

However, in DragonflyBSD, load balancing is a global on/off setting and can not
be set per socket. This patch allows for simultaneous use of both the current
SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system.

Required changes to structures
Globally change so_options from 16 to 32 bit value to allow for more options.
Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets.

Limitations
As DragonflyBSD, a load balance group is limited to 256 pcbs
(256 programs or threads sharing the same socket).

Submitted by:	Johannes Lundberg <johanlun0@gmail.com>
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D11003


Revision 326023 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 20 19:43:44 2017 UTC (6 years, 7 months ago) by pfg
File length: 46714 byte(s)
Diff to previous 318321
sys: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


Revision 318321 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 15 21:58:36 2017 UTC (7 years, 1 month ago) by glebius
File length: 46670 byte(s)
Diff to previous 316822
Reduce in_pcbinfo_init() by two params.  No users supply any flags to this
function (they used to say UMA_ZONE_NOFREE), so flag parameter goes away.
The zone_fini parameter also goes away.  Previously no protocols (except
divert) supplied zone_fini function, so inpcb locks were leaked with slabs.
This was okay while zones were allocated with UMA_ZONE_NOFREE flag, but now
this is a leak.  Fix that by suppling inpcb_fini() function as fini method
for all inpcb zones.


Revision 316822 - (view) (download) (annotate) - [select for diffs]
Modified Fri Apr 14 09:00:48 2017 UTC (7 years, 2 months ago) by ae
File length: 46693 byte(s)
Diff to previous 316770
Rework r316770 to make it protocol independent and general, like we
do for streaming sockets.

And do more cleanup in the sbappendaddr_locked_internal() to prevent
leak information from existing mbuf to the one, that will be possible
created later by netgraph.

Suggested by:	glebius
Tested by:	Irina Liakh <spell at itl ua>
MFC after:	1 week


Revision 316770 - (view) (download) (annotate) - [select for diffs]
Modified Thu Apr 13 17:03:57 2017 UTC (7 years, 2 months ago) by ae
File length: 46818 byte(s)
Diff to previous 316527
Clear h/w csum flags on mbuf handled by UDP.

When checksums of received IP and UDP header already checked, UDP uses
sbappendaddr_locked() to pass received data to the socket.
sbappendaddr_locked() uses given mbuf as is, and if NIC supports checksum
offloading, mbuf contains csum_data and csum_flags that were calculated
for already stripped headers. Some NICs support only limited checksums
offloading and do not use CSUM_PSEUDO_HDR flag, and csum_data contains
some value that UDP/TCP should use for pseudo header checksum calculation.

When L2TP is used for tunneling with mpd5, ng_ksocket receives mbuf with
filled csum_flags and csum_data, that were calculated for outer headers.
When L2TP header is stripped, a packet that was tunneled goes to the IP
layer and due to presence of csum_flags (without CSUM_PSEUDO_HDR) and
csum_data, the UDP/TCP checksum check fails for this packet.

Reported by:	Irina Liakh <spell at itl ua>
Tested by:	Irina Liakh <spell at itl ua>
MFC after:	1 week


Revision 316527 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 5 16:57:13 2017 UTC (7 years, 2 months ago) by rstone
File length: 46693 byte(s)
Diff to previous 315662
Revert the optimization from r304436

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.


Revision 315662 - (view) (download) (annotate) - [select for diffs]
Modified Tue Mar 21 06:39:49 2017 UTC (7 years, 3 months ago) by glebius
File length: 47066 byte(s)
Diff to previous 314722
Hide struct inpcb, struct tcpcb from the userland.

This is a painful change, but it is needed.  On the one hand, we avoid
modifying them, and this slows down some ideas, on the other hand we still
eventually modify them and tools like netstat(1) never work on next version of
FreeBSD.  We maintain a ton of spares in them, and we already got some ifdef
hell at the end of tcpcb.

Details:
- Hide struct inpcb, struct tcpcb under _KERNEL || _WANT_FOO.
- Make struct xinpcb, struct xtcpcb pure API structures, not including
  kernel structures inpcb and tcpcb inside.  Export into these structures
  the fields from inpcb and tcpcb that are known to be used, and put there
  a ton of spare space.
- Make kernel and userland utilities compilable after these changes.
- Bump __FreeBSD_version.

Reviewed by:	rrs, gnn
Differential Revision:	D10018


Revision 314722 - (view) (download) (annotate) - [select for diffs]
Modified Mon Mar 6 04:01:58 2017 UTC (7 years, 3 months ago) by eri
File length: 47283 byte(s)
Diff to previous 314436
The patch provides the same socket option as Linux IP_ORIGDSTADDR.
Unfortunately they will have different integer value due to Linux value being already assigned in FreeBSD.

The patch is similar to IP_RECVDSTADDR but also provides the destination port value to the application.

This allows/improves implementation of transparent proxies on UDP sockets due to having the whole information on forwarded packets.

Reviewed by:	adrian, aw
Approved by:	ae (mentor)
Sponsored by:	rsync.net
Differential Revision:	D9235


Revision 314436 - (view) (download) (annotate) - [select for diffs]
Modified Tue Feb 28 23:42:47 2017 UTC (7 years, 4 months ago) by imp
File length: 46762 byte(s)
Diff to previous 313675
Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96


Revision 313675 - (view) (download) (annotate) - [select for diffs]
Modified Sun Feb 12 06:56:33 2017 UTC (7 years, 4 months ago) by eri
File length: 46762 byte(s)
Diff to previous 313529
Committed without approval from mentor.

Reported by:	gnn


Revision 313529 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 10 06:01:47 2017 UTC (7 years, 4 months ago) by eri
File length: 47308 byte(s)
Diff to previous 313528
Fix build after r313524

Reported-by: ohartmann@walstatt.org


Revision 313528 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 10 05:58:16 2017 UTC (7 years, 4 months ago) by eri
File length: 47310 byte(s)
Diff to previous 313527
Revert r313527

Heh svn is not git


Revision 313527 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 10 05:51:39 2017 UTC (7 years, 4 months ago) by eri
File length: 47309 byte(s)
Diff to previous 313524
Correct missed variable name.

Reported-by: ohartmann@walstatt.org


Revision 313524 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 10 05:16:14 2017 UTC (7 years, 4 months ago) by eri
File length: 47310 byte(s)
Diff to previous 313401
The patch provides the same socket option as Linux IP_ORIGDSTADDR.
Unfortunately they will have different integer value due to Linux value being already assigned in FreeBSD.

The patch is similar to IP_RECVDSTADDR but also provides the destination port value to the application.

This allows/improves implementation of transparent proxies on UDP sockets due to having the whole information on forwarded packets.

Sponsored-by: rsync.net
Differential Revision: D9235
Reviewed-by: adrian


Revision 313401 - (view) (download) (annotate) - [select for diffs]
Modified Tue Feb 7 18:57:57 2017 UTC (7 years, 4 months ago) by vangyzen
File length: 46762 byte(s)
Diff to previous 313330
Fix garbage IP addresses in UDP log_in_vain messages

If multiple threads emit a UDP log_in_vain message concurrently,
the IP addresses could be garbage due to concurrent usage of a
single string buffer inside inet_ntoa().  Use inet_ntoa_r() with
two stack buffers instead.

Reported by:	Mark Martinec <Mark.Martinec+freebsd@ijs.si>
MFC after:	3 days
Relnotes:	yes
Sponsored by:	Dell EMC


Revision 313330 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 6 08:49:57 2017 UTC (7 years, 4 months ago) by ae
File length: 46738 byte(s)
Diff to previous 306559
Merge projects/ipsec into head/.

 Small summary
 -------------

o Almost all IPsec releated code was moved into sys/netipsec.
o New kernel modules added: ipsec.ko and tcpmd5.ko. New kernel
  option IPSEC_SUPPORT added. It enables support for loading
  and unloading of ipsec.ko and tcpmd5.ko kernel modules.
o IPSEC_NAT_T option was removed. Now NAT-T support is enabled by
  default. The UDP_ENCAP_ESPINUDP_NON_IKE encapsulation type
  support was removed. Added TCP/UDP checksum handling for
  inbound packets that were decapsulated by transport mode SAs.
  setkey(8) modified to show run-time NAT-T configuration of SA.
o New network pseudo interface if_ipsec(4) added. For now it is
  build as part of ipsec.ko module (or with IPSEC kernel).
  It implements IPsec virtual tunnels to create route-based VPNs.
o The network stack now invokes IPsec functions using special
  methods. The only one header file <netipsec/ipsec_support.h>
  should be included to declare all the needed things to work
  with IPsec.
o All IPsec protocols handlers (ESP/AH/IPCOMP protosw) were removed.
  Now these protocols are handled directly via IPsec methods.
o TCP_SIGNATURE support was reworked to be more close to RFC.
o PF_KEY SADB was reworked:
  - now all security associations stored in the single SPI namespace,
    and all SAs MUST have unique SPI.
  - several hash tables added to speed up lookups in SADB.
  - SADB now uses rmlock to protect access, and concurrent threads
    can do SA lookups in the same time.
  - many PF_KEY message handlers were reworked to reflect changes
    in SADB.
  - SADB_UPDATE message was extended to support new PF_KEY headers:
    SADB_X_EXT_NEW_ADDRESS_SRC and SADB_X_EXT_NEW_ADDRESS_DST. They
    can be used by IKE daemon to change SA addresses.
o ipsecrequest and secpolicy structures were cardinally changed to
  avoid locking protection for ipsecrequest. Now we support
  only limited number (4) of bundled SAs, but they are supported
  for both INET and INET6.
o INPCB security policy cache was introduced. Each PCB now caches
  used security policies to avoid SP lookup for each packet.
o For inbound security policies added the mode, when the kernel does
  check for full history of applied IPsec transforms.
o References counting rules for security policies and security
  associations were changed. The proper SA locking added into xform
  code.
o xform code was also changed. Now it is possible to unregister xforms.
  tdb_xxx structures were changed and renamed to reflect changes in
  SADB/SPDB, and changed rules for locking and refcounting.

Reviewed by:	gnn, wblock
Obtained from:	Yandex LLC
Relnotes:	yes
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D9352


Revision 306559 - (view) (download) (annotate) - [select for diffs]
Modified Sat Oct 1 19:39:09 2016 UTC (7 years, 9 months ago) by rmacklem
File length: 51556 byte(s)
Diff to previous 305824
r297225 broke udp_output() for the case where the "addr" argument
is NULL and the function jumps to the "release:" label.
For this case, the "inp" was write locked, but the code attempted to
read unlock it. This patch fixes the problem.
This case could occur for NFS over UDP mounts, where the server was
down for a few minutes under certain circumstances.

Reported by:	bde
Tested by:	bde
Reviewed by:	gnn
MFC after:	2 weeks


Revision 305824 - (view) (download) (annotate) - [select for diffs]
Modified Thu Sep 15 07:41:48 2016 UTC (7 years, 9 months ago) by kevlo
File length: 51306 byte(s)
Diff to previous 304606
Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead.

Reviewed by:	gnn
Differential Revision:	https://reviews.freebsd.org/D7878


Revision 304606 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 22 15:27:37 2016 UTC (7 years, 10 months ago) by rstone
File length: 51287 byte(s)
Diff to previous 304548
Temporarily disable the optimization from r304436

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


Revision 304548 - (view) (download) (annotate) - [select for diffs]
Modified Sat Aug 20 22:12:26 2016 UTC (7 years, 10 months ago) by zec
File length: 51287 byte(s)
Diff to previous 304436
Permit disabling net.inet.udp.require_l2_bcast in VIMAGE kernels.

The default value of the tunable introduced in r304436 couldn't be
effectively overrided on VIMAGE kernels, because instead of being
accessed via the appropriate VNET() accessor macro, it was accessed
via the VNET_NAME() macro, which resolves to the (should-be) read-only
master template of initial values of per-VNET data.  Hence, while the
value of udp_require_l2_bcast could be altered on per-VNET basis, the
code in udp_input() would ignore it as it would always read the default
value (one) from the VNET master template.

Silence from: rstone


Revision 304436 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 18 22:59:05 2016 UTC (7 years, 10 months ago) by rstone
File length: 51237 byte(s)
Diff to previous 301717
Don't check for broadcast IPs on non-bcast pkts

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


Revision 301717 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 9 05:48:34 2016 UTC (8 years ago) by ae
File length: 50914 byte(s)
Diff to previous 301114
Cleanup unneded include "opt_ipfw.h".

It was used for conditional build IPFIREWALL_FORWARD support.
But IPFIREWALL_FORWARD option was removed a long time ago.


Revision 301114 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jun 1 10:14:04 2016 UTC (8 years, 1 month ago) by bz
File length: 50936 byte(s)
Diff to previous 298747
The pr_destroy field does not allow us to run the teardown code in a
specific order.  VNET_SYSUNINITs however are doing exactly that.
Thus remove the VIMAGE conditional field from the domain(9) protosw
structure and replace it with VNET_SYSUNINITs.
This also allows us to change some order and to make the teardown functions
file local static.
Also convert divert(4) as it uses the same mechanism ip(4) and ip6(4) use
internally.

Slightly reshuffle the SI_SUB_* fields in kernel.h and add a new ones, e.g.,
for pfil consumers (firewalls), partially for this commit and for others
to come.

Reviewed by:		gnn, tuexen (sctp), jhb (kernel.h)
Obtained from:		projects/vnet
MFC after:		2 weeks
X-MFC:			do not remove pr_destroy
Sponsored by:		The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6652


Revision 298747 - (view) (download) (annotate) - [select for diffs]
Modified Thu Apr 28 15:53:10 2016 UTC (8 years, 2 months ago) by rrs
File length: 50720 byte(s)
Diff to previous 298066
Complete the UDP tunneling of ICMP msgs to those protocols
interested in having tunneled UDP and finding out about the
ICMP (tested by Michael Tuexen with SCTP.. soon to be using
this feature).

Differential Revision:	http://reviews.freebsd.org/D5875


Revision 298066 - (view) (download) (annotate) - [select for diffs]
Modified Fri Apr 15 15:46:41 2016 UTC (8 years, 2 months ago) by pfg
File length: 50262 byte(s)
Diff to previous 297234
netinet: for pointers replace 0 with NULL.

These are mostly cosmetical, no functional change.

Found with devel/coccinelle.

Reviewed by:	ae. tuexen


Revision 297234 - (view) (download) (annotate) - [select for diffs]
Modified Thu Mar 24 11:40:10 2016 UTC (8 years, 3 months ago) by bz
File length: 50256 byte(s)
Diff to previous 297225
Fix compile errors after r297225:

- properly V_irtualise variable access unbreaking VIMAGE kernels.
- remove the volatile from the function return type to make architecture
  using gcc happy [-Wreturn-type]
  "type qualifiers ignored on function return type"
  I am not entirely happy with this solution putting the u_int there
  but it will do for now.


Revision 297225 - (view) (download) (annotate) - [select for diffs]
Modified Thu Mar 24 07:54:56 2016 UTC (8 years, 3 months ago) by gnn
File length: 50254 byte(s)
Diff to previous 292689
FreeBSD previously provided route caching for TCP (and UDP). Re-add
route caching for TCP, with some improvements. In particular, invalidate
the route cache if a new route is added, which might be a better match.
The cache is automatically invalidated if the old route is deleted.

Submitted by:	Mike Karels
Reviewed by:	gnn
Differential Revision:	https://reviews.freebsd.org/D4306


Revision 292689 - (view) (download) (annotate) - [select for diffs]
Modified Thu Dec 24 13:57:43 2015 UTC (8 years, 6 months ago) by pluknet
File length: 49641 byte(s)
Diff to previous 287211
Fixed comment placement.

Before r12296, this comment described the udp_recvspace default value.

Spotted by:	ru
Sponsored by:	Nginx, Inc.


Revision 287211 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 27 15:27:41 2015 UTC (8 years, 10 months ago) by bz
File length: 49646 byte(s)
Diff to previous 285770
get_inpcbinfo() and get_pcblist() are UDP local functions and
do not do what one would expect by name. Prefix them with "udp_"
to at least obviously limit the scope.

This is a non-functional change.

Reviewed by:		gnn, rwatson
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D3505


Revision 285770 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jul 21 21:46:24 2015 UTC (8 years, 11 months ago) by eri
File length: 49606 byte(s)
Diff to previous 285740
IPSEC, remove variable argument function its already due.

Differential Revision:		https://reviews.freebsd.org/D3080
Reviewed by:	gnn, ae
Approved by:	gnn(mentor)


Revision 285740 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jul 21 09:54:31 2015 UTC (8 years, 11 months ago) by rrs
File length: 49567 byte(s)
Diff to previous 277331
When a tunneling protocol is being used with UDP we must release the
lock on the INP before calling the tunnel protocol, else a LOR
may occur (it does with SCTP for sure). Instead we must acquire a
ref count and release the lock, taking care to allow for the case
where the UDP socket has gone away and *not* unlocking since the
refcnt decrement on the inp will do the unlock in that case.

Reviewed by:	tuexen
MFC after:	3 weeks


Revision 277331 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jan 18 18:06:40 2015 UTC (9 years, 5 months ago) by adrian
File length: 48848 byte(s)
Diff to previous 275716
Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific
bits.

The motivation here is to eventually teach netisr and potentially
other networking subsystems a bit more about how RSS work queues / buckets
are configured so things have a hope of auto-configuring in the future.

* net/rss_config.[ch] takes care of the generic bits for doing
  configuration, hash function selection, etc;
* topelitz.[ch] is now in net/ rather than netinet/;
* (and would be in libkern if it didn't directly include RSS_KEYSIZE;
  that's a later thing to fix up.)
* netinet/in_rss.[ch] now just contains the IPv4 specific methods;
* and netinet/in6_rss.[ch] now just contains the IPv6 specific methods.

This should have no functional impact on anyone currently using
the RSS support.

Differential Revision:	D1383
Reviewed by:	gnn, jfv (intel driver bits)


Revision 275716 - (view) (download) (annotate) - [select for diffs]
Modified Thu Dec 11 19:20:13 2014 UTC (9 years, 6 months ago) by ae
File length: 48820 byte(s)
Diff to previous 275555
Do not count security policy violation twice.
ipsec*_in_reject() do this by their own.

Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC


Revision 275555 - (view) (download) (annotate) - [select for diffs]
Modified Sat Dec 6 02:59:59 2014 UTC (9 years, 6 months ago) by rodrigc
File length: 48852 byte(s)
Diff to previous 275358
MFp4: @181627

Allow UMA allocated memory to be freed when VNET jails are torn down.

Differential Revision: D1201
Submitted by: bz
Reviewed by: rwatson, gnn


Revision 275358 - (view) (download) (annotate) - [select for diffs]
Modified Mon Dec 1 11:45:24 2014 UTC (9 years, 7 months ago) by hselasky
File length: 48894 byte(s)
Diff to previous 274225
Start process of removing the use of the deprecated "M_FLOWID" flag
from the FreeBSD network code. The flag is still kept around in the
"sys/mbuf.h" header file, but does no longer have any users. Instead
the "m_pkthdr.rsstype" field in the mbuf structure is now used to
decide the meaning of the "m_pkthdr.flowid" field. To modify the
"m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX"
macros as defined in the "sys/mbuf.h" header file.

This patch introduces new behaviour in the transmit direction.
Previously network drivers checked if "M_FLOWID" was set in "m_flags"
before using the "m_pkthdr.flowid" field. This check has now now been
replaced by checking if "M_HASHTYPE_GET(m)" is different from
"M_HASHTYPE_NONE". In the future more hashtypes will be added, for
example hashtypes for hardware dedicated flows.

"M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is
valid and has no particular type. This change removes the need for an
"if" statement in TCP transmit code checking for the presence of a
valid flowid value. The "if" statement mentioned above is now a direct
variable assignment which is then later checked by the respective
network drivers like before.

Additional notes:
- The SCTP code changes will be committed as a separate patch.
- Removal of the "M_FLOWID" flag will also be done separately.
- The FreeBSD version has been bumped.

MFC after:	1 month
Sponsored by:	Mellanox Technologies


Revision 274225 - (view) (download) (annotate) - [select for diffs]
Modified Fri Nov 7 09:39:05 2014 UTC (9 years, 7 months ago) by glebius
File length: 48962 byte(s)
Diff to previous 272886
Remove SYSCTL_VNET_* macros, and simply put CTLFLAG_VNET where needed.

Sponsored by:	Nginx, Inc.


Revision 272886 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 10 06:08:59 2014 UTC (9 years, 8 months ago) by bryanv
File length: 48942 byte(s)
Diff to previous 272844
Add context pointer and source address to the UDP tunnel callback

These are needed for the forthcoming vxlan implementation. The context
pointer means we do not have to use a spare pointer field in the inpcb,
and the source address is required to populate vxlan's forwarding table.

While I highly doubt there is an out of tree consumer of the UDP
tunneling callback, this change may be a difficult to eventually MFC.

Phabricator:	https://reviews.freebsd.org/D383
Reviewed by:	gnn


Revision 272844 - (view) (download) (annotate) - [select for diffs]
Modified Thu Oct 9 22:36:21 2014 UTC (9 years, 8 months ago) by bryanv
File length: 48861 byte(s)
Diff to previous 272797
Add missing UDP multicast receive dtrace probes

Phabricator:	https://reviews.freebsd.org/D924
Reviewed by:	rpaulo markj
MFC after:	1 month


Revision 272797 - (view) (download) (annotate) - [select for diffs]
Modified Thu Oct 9 05:17:47 2014 UTC (9 years, 8 months ago) by bryanv
File length: 48753 byte(s)
Diff to previous 272347
Check for mbuf copy failure when there are multiple multicast sockets

This partitular case is the only path where the mbuf could be NULL.
udp_append() checked for a NULL mbuf only after invoking the tunneling
callback. Our only in tree tunneling callback - SCTP - assumed a non
NULL mbuf, and it is a bit odd to make the callbacks responsible for
checking this condition.

This also reduces the differences between the IPv4 and IPv6 code.

MFC after:	1 month


Revision 272347 - (view) (download) (annotate) - [select for diffs]
Modified Wed Oct 1 05:43:29 2014 UTC (9 years, 9 months ago) by tuexen
File length: 48748 byte(s)
Diff to previous 272326
The default for UDPLITE_RECV_CSCOV is zero. RFC 3828 recommend
that this means full checksum coverage for received packets.
If an application is willing to accept packets with partial
coverage, it is expected to use the socekt option and provice
the minimum coverage it accepts.

Reviewed by: kevlo
MFC after: 3 days


Revision 272326 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 30 20:29:58 2014 UTC (9 years, 9 months ago) by tuexen
File length: 48726 byte(s)
Diff to previous 272323
UDPLite requires a checksum. Therefore, discard a received packet if
the checksum is 0.

MFC after: 3 days


Revision 272323 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 30 18:17:28 2014 UTC (9 years, 9 months ago) by tuexen
File length: 48539 byte(s)
Diff to previous 272263
If the checksum coverage field in the UDPLITE header is the length
of the complete UDPLITE packet, the packet has full checksum coverage.
SO fix the condition.

Reviewed by: kevlo
MFC after: 3 days


Revision 272263 - (view) (download) (annotate) - [select for diffs]
Modified Sun Sep 28 17:22:45 2014 UTC (9 years, 9 months ago) by tuexen
File length: 48503 byte(s)
Diff to previous 271301
Checksum coverage values larger than 65535 for UDPLite are invalid.
Check for this when the user calls setsockopt using UDPLITE_{SEND,RECV}CSCOV.

Reviewed by: kevlo
MFC after: 3 days


Revision 271301 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 9 04:19:36 2014 UTC (9 years, 9 months ago) by adrian
File length: 48481 byte(s)
Diff to previous 271293
Calculate the RSS hash for outbound UDPv4 frames.

Differential Revision:	https://reviews.freebsd.org/D527
Reviewed by:	grehan


Revision 271293 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 9 01:45:39 2014 UTC (9 years, 9 months ago) by adrian
File length: 47041 byte(s)
Diff to previous 269699
Add support for receiving and setting flowtype, flowid and RSS bucket
information as part of recvmsg().

This is primarily used for debugging/verification of the various
processing paths in the IP, PCB and driver layers.

Unfortunately the current implementation of the control message path
results in a ~10% or so drop in UDP frame throughput when it's used.

Differential Revision:	https://reviews.freebsd.org/D527
Reviewed by:	grehan


Revision 269699 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 8 01:57:15 2014 UTC (9 years, 10 months ago) by kevlo
File length: 46032 byte(s)
Diff to previous 265909
Merge 'struct ip6protosw' and 'struct protosw' into one.  Now we have
only one protocol switch structure that is shared between ipv4 and ipv6.

Phabric:	D476
Reviewed by:	jhb


Revision 265909 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 12 09:46:48 2014 UTC (10 years, 1 month ago) by tuexen
File length: 45851 byte(s)
Diff to previous 265811
Disable TX checksum offload for UDP-Lite completely. It wasn't used for
partial checksum coverage, but even for full checksum coverage it doesn't
work.
This was discussed with Kevin Lo (kevlo@).


Revision 265811 - (view) (download) (annotate) - [select for diffs]
Modified Sat May 10 08:48:04 2014 UTC (10 years, 1 month ago) by tuexen
File length: 45789 byte(s)
Diff to previous 265776
Whitespace change.


Revision 265776 - (view) (download) (annotate) - [select for diffs]
Modified Fri May 9 14:15:48 2014 UTC (10 years, 1 month ago) by tuexen
File length: 45790 byte(s)
Diff to previous 264248
Fix a logic bug which prevented the sending of UDP packet with 0 checksum.
This bug was introduced in r264212 and should be X-MFCed with that
revision, if UDP-Lite support if MFCed.


Revision 264248 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 8 01:54:50 2014 UTC (10 years, 2 months ago) by kevlo
File length: 45726 byte(s)
Diff to previous 264213
Remove a bogus re-assignment.


Revision 264213 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 7 01:55:53 2014 UTC (10 years, 2 months ago) by kevlo
File length: 45741 byte(s)
Diff to previous 264212
Minor style cleanups.


Revision 264212 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 7 01:53:03 2014 UTC (10 years, 2 months ago) by kevlo
File length: 45738 byte(s)
Diff to previous 258541
Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks.
Tested with vlc and a test suite [1].

[1] http://www.erg.abdn.ac.uk/~gerrit/udp-lite/files/udplite_linux.tar.gz

Reviewed by:	jhb, glebius, adrian


Revision 258541 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 25 07:38:45 2013 UTC (10 years, 7 months ago) by attilio
File length: 41804 byte(s)
Diff to previous 257176
- For kernel compiled only with KDTRACE_HOOKS and not any lock debugging
  option, unbreak the lock tracing release semantic by embedding
  calls to LOCKSTAT_PROFILE_RELEASE_LOCK() direclty in the inlined
  version of the releasing functions for mutex, rwlock and sxlock.
  Failing to do so skips the lockstat_probe_func invokation for
  unlocking.
- As part of the LOCKSTAT support is inlined in mutex operation, for
  kernel compiled without lock debugging options, potentially every
  consumer must be compiled including opt_kdtrace.h.
  Fix this by moving KDTRACE_HOOKS into opt_global.h and remove the
  dependency by opt_kdtrace.h for all files, as now only KDTRACE_FRAMES
  is linked there and it is only used as a compile-time stub [0].

[0] immediately shows some new bug as DTRACE-derived support for debug
in sfxge is broken and it was never really tested.  As it was not
including correctly opt_kdtrace.h before it was never enabled so it
was kept broken for a while.  Fix this by using a protection stub,
leaving sfxge driver authors the responsibility for fixing it
appropriately [1].

Sponsored by:	EMC / Isilon storage division
Discussed with:	rstone
[0] Reported by:	rstone
[1] Discussed with:	philip


Revision 257176 - (view) (download) (annotate) - [select for diffs]
Modified Sat Oct 26 17:58:36 2013 UTC (10 years, 8 months ago) by glebius
File length: 41829 byte(s)
Diff to previous 254893
The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare
to this event, adding if_var.h to files that do need it. Also, include
all includes that now are included due to implicit pollution via if_var.h

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.


Revision 254893 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 26 00:28:57 2013 UTC (10 years, 10 months ago) by markj
File length: 41805 byte(s)
Diff to previous 254889
The second last argument of udp:::receive is supposed to contain the
connection state, not the IP header.

X-MFC with:	r254889


Revision 254889 - (view) (download) (annotate) - [select for diffs]
Modified Sun Aug 25 21:54:41 2013 UTC (10 years, 10 months ago) by markj
File length: 41804 byte(s)
Diff to previous 253571
Implement the ip, tcp, and udp DTrace providers. The probe definitions use
dynamic translation so that their arguments match the definitions for
these providers in Solaris and illumos. Thus, existing scripts for these
providers should work unmodified on FreeBSD.

Tested by:	gnn, hiren
MFC after:	1 month


Revision 253571 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jul 23 14:14:24 2013 UTC (10 years, 11 months ago) by ae
File length: 41597 byte(s)
Diff to previous 253084
Remove the large part of struct ipsecstat. Only few fields of this
structure is used, but they already have equal fields in the struct
newipsecstat, that was introduced with FAST_IPSEC and then was merged
together with old ipsecstat structure.

This fixes kernel stack overflow on some architectures after migration
ipsecstat to PCPU counters.

Reported by:	Taku YAMAMOTO, Maciej Milewski


Revision 253084 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jul 9 09:50:15 2013 UTC (10 years, 11 months ago) by ae
File length: 41581 byte(s)
Diff to previous 252026
Migrate structs arpstat, icmpstat, mrtstat, pimstat and udpstat to PCPU
counters.


Revision 252026 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 20 09:55:53 2013 UTC (11 years ago) by ae
File length: 41486 byte(s)
Diff to previous 244031
Use IPSECSTAT_INC() and IPSEC6STAT_INC() macros for ipsec statistics
accounting.

MFC after:	2 weeks


Revision 244031 - (view) (download) (annotate) - [select for diffs]
Modified Sat Dec 8 12:51:06 2012 UTC (11 years, 6 months ago) by pjd
File length: 41486 byte(s)
Diff to previous 243882
More warnings for zones that depend on the kern.ipc.maxsockets limit.

Obtained from:	WHEEL Systems


Revision 243882 - (view) (download) (annotate) - [select for diffs]
Modified Wed Dec 5 08:04:20 2012 UTC (11 years, 7 months ago) by glebius
File length: 41412 byte(s)
Diff to previous 242463
  Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags within sys.

Exceptions:

- sys/contrib not touched
- sys/mbuf.h edited manually


Revision 242463 - (view) (download) (annotate) - [select for diffs]
Added Fri Nov 2 01:20:55 2012 UTC (11 years, 8 months ago) by ae
File length: 41414 byte(s)
Diff to previous 242079
Remove the recently added sysctl variable net.pfil.forward.
Instead, add protocol specific mbuf flags M_IP_NEXTHOP and
M_IP6_NEXTHOP. Use them to indicate that the mbuf's chain
contains the PACKET_TAG_IPFORWARD tag. And do a tag lookup
only when this flag is set.

Suggested by:	andre



This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

  ViewVC Help
Powered by ViewVC 1.1.27