summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* Properly set curvnet context in lagg_port_setlladdr() task handler.trociny2013-06-071-0/+2
| | | | | | | Reported by: Nikos Vassiliadis <nvass gmx.com> Submitted by: zec Tested by: Nikos Vassiliadis <nvass gmx.com> MFC after: 1 week
* Fix build with both INET and INET6 disabled.jhb2013-06-041-0/+2
|
* Allow drivers to specify a maximum TSO length in bytes if they areandre2013-06-032-6/+18
| | | | | | | | | | | | | | | | | | | | | | | limited in the amount of data they can handle at once. Drivers can set ifp->if_hw_tsomax before calling ether_ifattach() to change the limit. The lowest allowable size is IP_MAXPACKET / 8 (8192 bytes) as anything less wouldn't be very useful anymore. The upper limit is still at IP_MAXPACKET (65536 bytes). Raising it requires further auditing of the IPv4/v6 code path's as the length field in the IP header would overflow leading to confusion in firewalls and others packet handler on the real size of the packet. The placement into "struct ifnet" is a bit hackish but the best place that was found. When the stack/driver boundary is updated it should be handled in a better way. Submitted by: cperciva (earlier version) Reviewed by: cperciva Tested by: cperciva MFC after: 1 week (using spare struct members to preserve ABI)
* Bring in a number of new features, mostly implemented by Michio Honda:luigi2013-05-301-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | - the VALE switch now support up to 254 destinations per switch, unicast or broadcast (multicast goes to all ports). - we can attach hw interfaces and the host stack to a VALE switch, which means we will be able to use it more or less as a native bridge (minor tweaks still necessary). A 'vale-ctl' program is supplied in tools/tools/netmap to attach/detach ports the switch, and list current configuration. - the lookup function in the VALE switch can be reassigned to something else, similar to the pf hooks. This will enable attaching the firewall, or other processing functions (e.g. in-kernel openvswitch) directly on the netmap port. The internal API used by device drivers does not change. Userspace applications should be recompiled because we bump NETMAP_API as we now use some fields in the struct nmreq that were previously ignored -- otherwise, data structures are the same. Manpages will be committed separately.
* clarify usage of NETMAP_BUFluigi2013-05-301-2/+2
|
* While waiting for the bpf hold buffer to become idle, checkghelmer2013-05-231-2/+7
| | | | | | | the return value from mtx_sleep() and exit bpfread() on errors such as EINTR. Reviewed by: jhb
* Allow certain headers to be included more easily.ed2013-05-211-3/+5
| | | | Spotted by: http://hacks.owlfolio.org/header-survey/
* Use separate function to update mbuf checksum flags instead ofmelifaro2013-05-181-24/+19
| | | | | | duplicating the same code in different places. MFC after: 2 weeks
* Fix rte leak introduced in r248070.melifaro2013-05-181-1/+1
| | | | MFC after: 2 weeks
* Finally change the mbuf to have its own fib field instead of stealingjulian2013-05-161-11/+3
| | | | | | 4 flag bits. This was supposed to happen in 8.0, and again in 2012.. MFC after: never
* Add IFF_MONITOR support to gre(4).hrs2013-05-111-0/+6
| | | | | Tested by: Chip Marshall MFC after: 1 week
* Back out r249318, r249320 and r249327 due to a heisenbug mostandre2013-05-064-6/+6
| | | | | likely related to a race condition in the ipi_hash_lock with the exact cause currently unknown but under investigation.
* Correct a few sizeof()seadler2013-05-011-1/+1
| | | | | Submitted by: swildner@DragonFlyBSD.org Reviewed by: alfred
* remove $Id$ (whitespace change)luigi2013-04-302-2/+0
|
* Add const qualifier to the dst parameter of the ifnet if_output method.glebius2013-04-2626-150/+124
|
* Recover missing arp_ifinit() call.oleg2013-04-181-0/+6
| | | | MFC after: 2 weeks
* Switch lagg(4) statistics to counter(9).glebius2013-04-152-6/+43
| | | | | | | | | | | | | | The lagg(4) is often used to bond high speed links, so basic per-packet += on statistics cause cache misses and statistics loss. Perfect solution would be to convert ifnet(9) to counters(9), but this requires much more work, and unfortunately ABI change, so temporarily patch lagg(4) manually. We store counters in the softc, and once per second push their values to legacy ifnet counters. Sponsored by: Nginx, Inc.
* Fix build.glebius2013-04-102-2/+2
|
* Change certain heavily used network related mutexes and rwlocks toandre2013-04-093-4/+4
| | | | | | | | | | reside on their own cache line to prevent false sharing with other nearby structures, especially for those in the .bss segment. NB: Those mutexes and rwlocks with variables next to them that get changed on every invocation do not benefit from their own cache line. Actually it may be net negative because two cache misses would be incurred in those cases.
* Use IP6STAT_INC/IP6STAT_DEC macros to update ip6 stats.ae2013-04-091-3/+3
| | | | MFC after: 1 week
* Ignore interface renames instead of removing the interface from the bridgemarkj2013-03-281-0/+3
| | | | | | | | | group. Reviewed by: rstone Approved by: rstone (co-mentor) Sponsored by: Sandvine Incorporated MFC after: 1 week
* Remove __FreeBSD_version ifdefs.glebius2013-03-223-12/+0
|
* Fix style and comments.ae2013-03-192-12/+19
|
* Use m_get/m_gethdr instead of compat macros.glebius2013-03-152-4/+3
| | | | Sponsored by: Nginx, Inc.
* - Use m_getcl() instead of hand allocating.glebius2013-03-151-11/+8
| | | | | | | | - Convert panic() to KASSERT. - Remove superfluous cleaning of mbuf fields after allocation. - Add comment on possible use of m_get2() here. Sponsored by: Nginx, Inc.
* Functions m_getm2() and m_get2() have different order of arguments,glebius2013-03-121-1/+1
| | | | | | | and that can drive someone crazy. While m_get2() is young and not documented yet, change its order of arguments to match m_getm2(). Sorry for churn, but better now than later.
* Reinitialize eh after pfil(9) processing.glebius2013-03-111-0/+1
| | | | | PR: 176764 Submitted by: adri
* Fix long-standing issue with interface routes being unprotected:melifaro2013-03-083-4/+41
| | | | | | | | | | Use RTM_PINNED flag to mark route as immutable. Forbid deleting immutable routes without special rtrequest1_fib() flag. Adding interface address with prefix already in route table is handled by atomically deleting old prefix and adding interface one. Discussed with: andre, eri MFC after: 3 weeks
* Write lock is not required for find&compare operation.melifaro2013-03-051-2/+2
| | | | MFC after: 2 weeks
* Finish the r244185. This fixes ever growing counter of pfsync badglebius2013-02-151-12/+0
| | | | | | | | | | length packets, which was actually harmless. Note that peers with different version of head/ may grow this counter, but it is harmless - all pfsync data is processed. Reported & tested by: Anton Yuzhaninov <citrin citrin.ru> Sponsored by: Nginx, Inc
* Resolve source address selection in presense of CARP. Add a coupleglebius2013-02-112-4/+22
| | | | | | | | | | | | | | | | | | of helper functions: - carp_master() - boolean function which is true if an address is in the MASTER state. - ifa_preferred() - boolean function that compares two addresses, and is aware of CARP. Utilize ifa_preferred() in ifa_ifwithnet(). The previous version of patch also changed source address selection logic in jails using carp_master(), but we failed to negotiate this part with Bjoern. May be we will approach this problem again later. Reported & tested by: Anton Yuzhaninov <citrin citrin.ru> Sponsored by: Nginx, Inc
* This fixes a out-of-order problem with severalrrs2013-02-071-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the newer drivers. The basic problem was that the driver was pulling the mbuf off the drbr ring and then when sending with xmit(), encounting a full transmit ring. Thus the lower layer xmit() function would return an error, and the drivers would then append the data back on to the ring. For TCP this is a horrible scenario sure to bring on a fast-retransmit. The fix is to use drbr_peek() to pull the data pointer but not remove it from the ring. If it fails then we either call the new drbr_putback or drbr_advance method. Advance moves it forward (we do this sometimes when the xmit() function frees the mbuf). When we succeed we always call advance. The putback will always copy the mbuf back to the top of the ring. Note that the putback *cannot* be used with a drbr_dequeue() only with drbr_peek(). We most of the time, in putback, would not need to copy it back since most likey the mbuf is still the same, but sometimes xmit() functions will change the mbuf via a pullup or other call. So the optimial case for the single consumer is to always copy it back. If we ever do a multiple_consumer (for lagg?) we will need a test and atomic in the put back possibly a seperate putback_mc() in the ring buf. Reviewed by: jhb@freebsd.org, jlv@freebsd.org
* Retire struct sockaddr_inarp.glebius2013-01-312-29/+5
| | | | | | | | | | | | | | | Since ARP and routing are separated, "proxy only" entries don't have any meaning, thus we don't need additional field in sockaddr to pass SIN_PROXY flag. New kernel is binary compatible with old tools, since sizes of sockaddr_inarp and sockaddr_in match, and sa_family are filled with same value. The structure declaration is left for compatibility with third party software, but in tree code no longer use it. Reviewed by: ru, andre, net@
* route_output() always supplies info with RTAX_GATEWAY member thatglebius2013-01-291-4/+3
| | | | | points to a sockaddr of AF_LINK family. Assert this instead of checking.
* Move lle_event to if_llatbl.hnp2013-01-251-0/+10
| | | | | | | | | | | | lle_event replaced arp_update_event after the ARP rewrite and ended up in if_ether.h simply because arp_update_event used to be there too. IPv6 neighbor discovery is going to grow lle_event support and this is a good time to move it to if_llatbl.h. The two in-tree consumers of this event - OFED and toecore - are not affected. Reviewed by: bz@
* - Utilize m_get2(), accidentially fixing some signedness bugs.glebius2013-01-241-20/+3
| | | | | - Return EMSGSIZE in both cases if uio_resid is oversized or undersized. - No need to clear rcvif.
* leftover from r245579... flags for semi transparent mode and directluigi2013-01-231-8/+41
| | | | forwarding through a VALE switch
* If lagg(4) can't forward a packet due to underlying port problems,glebius2013-01-211-2/+2
| | | | return much more meaningful ENETDOWN to the stack, instead of EBUSY.
* - Add dashes before copyright notices.glebius2013-01-071-18/+8
| | | | | - Add $FreeBSD$. - Remove unused define.
* Juggle some internal symbols from our antique zlib (that originally camepeter2013-01-062-2/+9
| | | | | | | in from kernel-pppd which is long gone) so that ZFS and DTRACE play nice. This is a horrible hack to get freefall to compile, and is in dire need of reconciliation. This antique zlib-1.04 code needs to go away.
* Add an ability to set net.link.stf.permit_rfc1918 from the loader.ae2012-12-271-1/+2
| | | | MFC after: 2 weeks
* Add net.link.stf.permit_rfc1918 sysctl variable. It can be used to allowae2012-12-271-2/+7
| | | | | | the use of private IPv4 addresses with stf(4). MFC after: 2 weeks
* Fix typo in comment.kevlo2012-12-181-1/+1
| | | | Reviewed by: thompsa
* Fix problem in r238990. The LLE_LINKED flag should be tested prior toglebius2012-12-131-6/+0
| | | | | | | | | entering llentry_free(), and in case if we lose the race, we should simply perform LLE_FREE_LOCKED(). Otherwise, if the race is lost by the thread performing arptimer(), it will remove two references from the lle instead of one. Reported by: Ian FREISLICH <ianf clue.co.za>
* Changes to resolve races in bpfread() and catchpacket() that, at worst,ghelmer2012-12-104-12/+38
| | | | | | | | | | | | cause kernel panics. Add a flag to the bpf descriptor to indicate whether the hold buffer is in use. In bpfread(), set the "hold buffer in use" flag before dropping the descriptor lock during the call to bpf_uiomove(). Everywhere else the hold buffer is used or changed, wait while the hold buffer is in use by bpfread(). Add a KASSERT in bpfread() after re-acquiring the descriptor lock to assist uncovering any additional hold buffer races.
* - Move definition of V_deembed_scopeid to scope6_var.h.hrs2012-12-051-63/+51
| | | | | | - Deembed scope id in L3 address in in6_lltable_dump(). - Simplify scope id recovery in rtsock routines. - Remove embedded scope id handling in ndp(8) and route(8) completely.
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-0518-56/+56
| | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually
* - Fix LOR in sa6_recoverscope() in rt_msg2()[1].hrs2012-12-041-39/+32
| | | | | | | - Check V_deembed_scopeid before checking if sa_family == AF_INET6. - Fix scope id handing in route(8)[2] and ifconfig(8). Reported by: rpaulo[1], Mateusz Guzik[1], peter[2]
* Fix bpf_if structure leak introduced in r235745.melifaro2012-12-021-52/+66
| | | | | | | Move all such structures to delayed-free lists and delete all matching on interface departure event. MFC after: 1 week
* - Use more appropriate loop (do { } while()) when generating ethernet addresspjd2012-11-291-3/+5
| | | | | | | | | for bridge interface. - If we found a collision we can break the loop - only one collision is possible and one is exactly enough to need to renegerate. Obtained from: WHEEL Systems MFC after: 1 week
OpenPOWER on IntegriCloud