aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
...
| * Chunk IDs are 8 bit entities, not 16 bit.Michael Tuexen2014-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | Thanks to Peter Kasting from Google for drawing my attention to it. MFC after: 3 days Notes: svn path=/head/; revision=271643
| * Use generic SYSCTL_* macro instead of deprecated SYSCTL_VNET_*.Hiroki Sato2014-09-151-5/+5
| | | | | | | | | | | | | | Suggested by: glebius Notes: svn path=/head/; revision=271628
| * Make net.inet.ip.sourceroute, net.inet.ip.accept_sourceroute, andHiroki Sato2014-09-153-18/+22
| | | | | | | | | | | | | | | | | | net.inet.ip.process_options vnet-aware. Revert changes in r271545. Suggested by: bz Notes: svn path=/head/; revision=271610
| * Revert r271504. A new patch to solve this issue will be made.Hans Petter Selasky2014-09-131-74/+3
| | | | | | | | | | | | | | Suggested by: adrian @ Notes: svn path=/head/; revision=271551
| * Improve transmit sending offload, TSO, algorithm in general.Hans Petter Selasky2014-09-131-3/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current TSO limitation feature only takes the total number of bytes in an mbuf chain into account and does not limit by the number of mbufs in a chain. Some kinds of hardware is limited by two factors. One is the fragment length and the second is the fragment count. Both of these limits need to be taken into account when doing TSO. Else some kinds of hardware might have to drop completely valid mbuf chains because they cannot loaded into the given hardware's DMA engine. The new way of doing TSO limitation has been made backwards compatible as input from other FreeBSD developers and will use defaults for values not set. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=271504
| * Revisions 264905 and 266860 added a "int fib" argument to ifa_ifwithnet andAlan Somers2014-09-113-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ifa_ifwithdstaddr. For the sake of backwards compatibility, the new arguments were added to new functions named ifa_ifwithnet_fib and ifa_ifwithdstaddr_fib, while the old functions became wrappers around the new ones that passed RT_ALL_FIBS for the fib argument. However, the backwards compatibility is not desired for FreeBSD 11, because there are numerous other incompatible changes to the ifnet(9) API. We therefore decided to remove it from head but leave it in place for stable/9 and stable/10. In addition, this commit adds the fib argument to ifa_ifwithbroadaddr for consistency's sake. sys/sys/param.h Increment __FreeBSD_version sys/net/if.c sys/net/if_var.h sys/net/route.c Add fibnum argument to ifa_ifwithbroadaddr, and remove the _fib versions of ifa_ifwithdstaddr, ifa_ifwithnet, and ifa_ifwithroute. sys/net/route.c sys/net/rtsock.c sys/netinet/in_pcb.c sys/netinet/ip_options.c sys/netinet/ip_output.c sys/netinet6/nd6.c Fixup calls of modified functions. share/man/man9/ifnet.9 Document changed API. CR: https://reviews.freebsd.org/D458 MFC after: Never Sponsored by: Spectra Logic Notes: svn path=/head/; revision=271438
| * Add scope zone id to the in_endpoints and hc_metrics structures.Andrey V. Elsukov2014-09-103-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A non-global IPv6 address can be used in more than one zone of the same scope. This zone index is used to identify to which zone a non-global address belongs. Also we can have many foreign hosts with equal non-global addresses, but from different zones. So, they can have different metrics in the host cache. Obtained from: Yandex LLC Sponsored by: Yandex LLC Notes: svn path=/head/; revision=271400
| * Make in6_pcblookup_hash_locked and in6_pcbladdr static.Andrey V. Elsukov2014-09-101-37/+4
| | | | | | | | | | | | | | | | Obtained from: Yandex LLC Sponsored by: Yandex LLC Notes: svn path=/head/; revision=271391
| * Introduce INP6_PCBHASHKEY macro. Replace usage of hardcoded part ofAndrey V. Elsukov2014-09-103-3/+4
| | | | | | | | | | | | | | | | | | IPv6 address as hash key in all places. Obtained from: Yandex LLC Notes: svn path=/head/; revision=271386
| * Calculate the RSS hash for outbound UDPv4 frames.Adrian Chadd2014-09-091-0/+45
| | | | | | | | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D527 Reviewed by: grehan Notes: svn path=/head/; revision=271301
| * Update the IPv4 input path to handle reassembled frames and incoming framesAdrian Chadd2014-09-092-0/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with no RSS hash. When doing RSS: * Create a new IPv4 netisr which expects the frames to have been verified; it just directly dispatches to the IPv4 input path. * Once IPv4 reassembly is done, re-calculate the RSS hash with the new IP and L3 header; then reinject it as appropriate. * Update the IPv4 netisr to be a CPU affinity netisr with the RSS hash function (rss_soft_m2cpuid) - this will do a software hash if the hardware doesn't provide one. NICs that don't implement hardware RSS hashing will now benefit from RSS distribution - it'll inject into the correct destination netisr. Note: the netisr distribution doesn't work out of the box - netisr doesn't query RSS for how many CPUs and the affinity setup. Yes, netisr likely shouldn't really be doing CPU stuff anymore and should be "some kind of 'thing' that is a workqueue that may or may not have any CPU affinity"; that's for a later commit. Differential Revision: https://reviews.freebsd.org/D527 Reviewed by: grehan Notes: svn path=/head/; revision=271300
| * Implement IPv4 RSS software hash functions to use during packet ingressAdrian Chadd2014-09-092-8/+294
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and egress. * rss_mbuf_software_hash_v4 - look at the IPv4 mbuf to fetch the IPv4 details + direction to calculate a hash. * rss_proto_software_hash_v4 - hash the given source/destination IPv4 address, port and direction. * rss_soft_m2cpuid - map the given mbuf to an RSS CPU ("bucket" for now) These functions are intended to be used by the stack to support the following: * Not all NICs do RSS hashing, so we should support some way of doing a hash in software; * The NIC / driver may not hash frames the way we want (eg UDP 4-tuple hashing when the stack is only doing 2-tuple hashing for UDP); so we may need to re-hash frames; * .. same with IPv4 fragments - they will need to be re-hashed after reassembly; * .. and same with things like IP tunneling and such; * The transmit path for things like UDP, RAW and ICMP don't currently have any RSS information attached to them - so they'll need an RSS calculation performed before transmit. TODO: * Counters! Everywhere! * Add a debug mode that software hashes received frames and compares them to the hardware hash provided by the hardware to ensure they match. The IPv6 part of this is missing - I'm going to do some re-juggling of where various parts of the RSS framework live before I add the IPv6 code (read: the IPv6 code is going to go into netinet6/in6_rss.[ch], rather than living here.) Note: This API is still fluid. Please keep that in mind. Differential Revision: https://reviews.freebsd.org/D527 Reviewed by: grehan Notes: svn path=/head/; revision=271297
| * Add support for receiving and setting flowtype, flowid and RSS bucketAdrian Chadd2014-09-095-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=271293
| * Add a flag to ip_output() - IP_NODEFAULTFLOWID - which prevents it fromAdrian Chadd2014-09-092-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | overriding an existing flowid/flowtype field in the outbound mbuf with the inp_flowid/inp_flowtype details. The upcoming RSS UDP support calculates a valid RSS value for outbound mbufs and since it may change per send, it doesn't cache it in the inpcb. So overriding it here would be wrong. Differential Revision: https://reviews.freebsd.org/D527 Reviewed by: grehan Notes: svn path=/head/; revision=271291
| * Address warnings generated by the clang analyzer.Michael Tuexen2014-09-073-5/+4
| | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=271230
| * Address another warnings reported by Patrick Laimbock when compilingMichael Tuexen2014-09-072-29/+15
| | | | | | | | | | | | | | | | | | in userspace. While there, improve consistency. MFC after: 1 week Notes: svn path=/head/; revision=271228
| * Use union sctp_sockstore instead of struct sockaddr_storage. ThisMichael Tuexen2014-09-077-107/+75
| | | | | | | | | | | | | | | | | | | | | | | | eliminiates some warnings when building in userland. Thanks to Patrick Laimbock for reporting this issue. Remove also some unnecessary casts. There should be no functional change. MFC after: 1 week Notes: svn path=/head/; revision=271221
| * Use SYSCTL_PROC instead of SYSCTL_VNET_PROC.Michael Tuexen2014-09-071-9/+9
| | | | | | | | | | | | | | | | Suggested by: glebius@ MFC after: 1 week Notes: svn path=/head/; revision=271219
| * Fix a leak of an address, if the address is scheduled for removalMichael Tuexen2014-09-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | and the stack is torn down. Thanks to Peter Bostroem and Jiayang Liu from Google for reporting the issue. MFC after: 1 week Notes: svn path=/head/; revision=271209
| * Fix the handling of sysctl variables when used with VIMAGE.Michael Tuexen2014-09-064-501/+188
| | | | | | | | | | | | | | | | | | While there do some cleanup of the code. MFC after: 1 week Notes: svn path=/head/; revision=271204
* | Make ipfw_nat module use IP_FW3 codes.Alexander V. Chernikov2014-09-071-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel changes: * Split kernel/userland nat structures eliminating IPFW_INTERNAL hack. * Add IP_FW_NAT44_* codes resemblin old ones. * Assume that instances can be named (no kernel support currently). * Use both UH+WLOCK locks for all configuration changes. * Provide full ABI support for old sockopts. Userland changes: * Use IP_FW_NAT44_* codes for nat operations. * Remove undocumented ability to show ranges of nat "log" entries. Notes: svn path=/projects/ipfw/; revision=271231
* | Sync to HEAD@r271160.Alexander V. Chernikov2014-09-059-45/+48
|\| | | | | | | Notes: svn path=/projects/ipfw/; revision=271164
| * Satisfy assertion in m_demote().Gleb Smirnoff2014-09-041-0/+1
| | | | | | | | | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=271123
| * In tcp_input(), don't acquire the pcbinfo global write lock for SYNJohn Baldwin2014-09-042-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | packets targeting a listening socket. Permit to reduce TCP input processing starvation in context of high SYN load (e.g. short-lived TCP connections or SYN flood). Submitted by: Julien Charbon <jcharbon@verisign.com> Reviewed by: adrian, hiren, jhb, Mike Bentkofsky Notes: svn path=/head/; revision=271119
| * Fixes for tcp_respond() comment.Gleb Smirnoff2014-09-041-3/+3
| | | | | | | | Notes: svn path=/head/; revision=271107
| * Improve r265338. When inserting mbufs into TCP reassembly queue,Gleb Smirnoff2014-09-041-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | try to collapse adjacent pieces using m_catpkt(). In best case scenario it copies data and frees mbufs, making mbuf exhaustion attack harder. Suggested by: Jonathan Looney <jonlooney gmail.com> Security: Hardens against remote mbuf exhaustion attack. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=271089
| * Clean up unused CSUM_FRAGMENT.Gleb Smirnoff2014-09-032-4/+2
| | | | | | | | | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=271006
| * Make SOCK_RAW sockets to be truly raw, not modifying received and sentGleb Smirnoff2014-09-011-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | packets at all. Swapping byte order on SOCK_RAW was actually a bug, an artifact from the BSD network stack, that used to convert a packet to native byte order once it is received by kernel. Other operating systems didn't follow this, and later other BSD descendants fixed this, leaving us alone with the bug. Now it is clear that we should fix the bug. In collaboration with: Olivier Cochard-Labbé <olivier cochard.me> See also: https://wiki.freebsd.org/SOCK_RAW Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=270929
| * Use macros instead of referencing struct if_data that resides in ifnet.Gleb Smirnoff2014-08-311-2/+2
| | | | | | | | | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=270869
| * Announce SCTP support in the kern.features sysctl variables.Michael Tuexen2014-08-261-0/+3
| | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=270673
* | Add support for multi-field values inside ipfw tables.Alexander V. Chernikov2014-08-311-10/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the last major change in given branch. Kernel changes: * Use 64-bytes structures to hold multi-value variables. * Use shared array to hold values from all tables (assume each table algo is capable of holding 32-byte variables). * Add some placeholders to support per-table value arrays in future. * Use simple eventhandler-style API to ease the process of adding new table items. Currently table addition may required multiple UH drops/ acquires which is quite tricky due to atomic table modificatio/swap support, shared array resize, etc. Deal with it by calling special notifier capable of rolling back state before actually performing swap/resize operations. Original operation then restarts itself after acquiring UH lock. * Bump all objhash users default values to at least 64 * Fix custom hashing inside objhash. Userland changes: * Add support for dumping shared value array via "vlist" internal cmd. * Some small print/fill_flags dixes to support u32 values. * valtype is now bitmask of <skipto|pipe|fib|nat|dscp|tag|divert|netgraph|limit|ipv4|ipv6>. New values can hold distinct values for each of this types. * Provide special "legacy" type which assumes all values are the same. * More helpers/docs following.. Some examples: 3:41 [1] zfscurr0# ipfw table mimimi create valtype skipto,limit,ipv4,ipv6 3:41 [1] zfscurr0# ipfw table mimimi info +++ table(mimimi), set(0) +++ kindex: 2, type: addr references: 0, valtype: skipto,limit,ipv4,ipv6 algorithm: addr:radix items: 0, size: 296 3:42 [1] zfscurr0# ipfw table mimimi add 10.0.0.5 3000,10,10.0.0.1,2a02:978:2::1 added: 10.0.0.5/32 3000,10,10.0.0.1,2a02:978:2::1 3:42 [1] zfscurr0# ipfw table mimimi list +++ table(mimimi), set(0) +++ 10.0.0.5/32 3000,0,10.0.0.1,2a02:978:2::1 Notes: svn path=/projects/ipfw/; revision=270906
* | Sync to HEAD@r270409.Alexander V. Chernikov2014-08-2314-14/+204
|\| | | | | | | Notes: svn path=/projects/ipfw/; revision=270410
| * Restore historical behavior of in_control, which, when no matching addressXin LI2014-08-221-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | is found, the first usable address is returned for legacy ioctls like SIOCGIFBRDADDR, SIOCGIFDSTADDR, SIOCGIFNETMASK and SIOCGIFADDR. While there also fix a subtle issue that a caller from a jail asking for INADDR_ANY may get the first IP of the host that do not belong to the jail. Submitted by: glebius Differential Revision: https://reviews.freebsd.org/D667 Notes: svn path=/head/; revision=270347
| * Destroy the "qdiffsample_zone" UMA zone on unload to avoid a use-after-unloadLawrence Stewart2014-08-191-1/+11
| | | | | | | | | | | | | | | | | | | | panic easily triggered by running "sysctl -a" after unload. Reported and tested by: Grenville Armitage <garmitage@swin.edu.au> MFC after: 1 week Notes: svn path=/head/; revision=270160
| * Change pr_output's prototype to avoid the need for explicit casts.Kevin Lo2014-08-155-6/+13
| | | | | | | | | | | | | | | | | | | | This is a follow up to r269699. Phabric: D564 Reviewed by: jhb Notes: svn path=/head/; revision=270008
| * Add support for the SCTP_PR_STREAM_STATUS and SCTP_PR_ASSOC_STATUSMichael Tuexen2014-08-137-3/+169
| | | | | | | | | | | | | | | | | | | | | | | | socket options. This includes managing the correspoing stat counters. Add the SCTP_DETAILED_STR_STATS kernel option to control per policy counters on every stream. The default is off and only an aggregated counter is available. This is sufficient for the RTCWeb usecase. MFC after: 1 week Notes: svn path=/head/; revision=269945
* | Make room for multi-type values in struct tentry.Alexander V. Chernikov2014-08-151-3/+5
| | | | | | | | Notes: svn path=/projects/ipfw/; revision=270021
* | Replace "cidr" table type with "addr" type.Alexander V. Chernikov2014-08-141-2/+4
| | | | | | | | | | | | | | Suggested by: luigi Notes: svn path=/projects/ipfw/; revision=270003
* | * Fix displaying dynamic rules for large rulesets.Alexander V. Chernikov2014-08-141-28/+1
| | | | | | | | | | | | | | * Clean up some comments. Notes: svn path=/projects/ipfw/; revision=269965
* | Sync to HEAD@r269943.Alexander V. Chernikov2014-08-1358-866/+2110
|\| | | | | | | Notes: svn path=/projects/ipfw/; revision=269947
| * Change SCTP sysctl from auth_disable to auth_enable. This isMichael Tuexen2014-08-123-22/+18
| | | | | | | | | | | | | | consistent with other similar sysctl variable used in SCTP. Notes: svn path=/head/; revision=269874
| * Add support for the SCTP_AUTH_SUPPORTED and SCTP_ASCONF_SUPPORTEDMichael Tuexen2014-08-1214-164/+388
| | | | | | | | | | | | | | | | | | socket options. Add also a sysctl to control the support of ASCONF. MFC after: 1 week Notes: svn path=/head/; revision=269858
| * Fix string length argument passed to "sysctl_handle_string()" so thatHans Petter Selasky2014-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | the complete string is returned by the function and not just only one byte. PR: 192544 MFC after: 2 weeks Notes: svn path=/head/; revision=269777
| * Improve comments by listing a criteria for automatic increment of receive socketHiren Panchasara2014-08-091-3/+5
| | | | | | | | | | | | | | | | | | buffer. Reviewed by: jmg Notes: svn path=/head/; revision=269766
| * Small modification of the sctp_input() cleanup to avoid havingMichael Tuexen2014-08-091-7/+7
| | | | | | | | | | | | | | code between declariations. Notes: svn path=/head/; revision=269753
| * Fix one more compiler warning, m is not initialized.Konstantin Belousov2014-08-081-1/+1
| | | | | | | | Notes: svn path=/head/; revision=269726
| * Fix argument to KTR after r269699 to unbreak LINT builds.Bjoern A. Zeeb2014-08-081-1/+1
| | | | | | | | Notes: svn path=/head/; revision=269705
| * Merge 'struct ip6protosw' and 'struct protosw' into one. Now we haveKevin Lo2014-08-0824-158/+220
| | | | | | | | | | | | | | | | | | | | only one protocol switch structure that is shared between ipv4 and ipv6. Phabric: D476 Reviewed by: jhb Notes: svn path=/head/; revision=269699
| * Add support for the SCTP_RECONFIG_SUPPORTED and the correspondingMichael Tuexen2014-08-0411-14/+94
| | | | | | | | | | | | | | | | | | sysctl controlling the negotiation of the RE-CONFIG extension. MFC after: 3 days Notes: svn path=/head/; revision=269527
| * Add a comment for easier code understanding.Hiren Panchasara2014-08-041-0/+5
| | | | | | | | Notes: svn path=/head/; revision=269526