summaryrefslogtreecommitdiffstats
path: root/sys/net/if.h
Commit message (Collapse)AuthorAgeFilesLines
* * Add SIOCGI2C driver ioctl used to retrieve i2c info.melifaro2014-08-291-0/+13
| | | | | | | | | * Convert ixgbe to use this ioctl * Convert ifconfig to use generic i2c handler for "ix" interfaces. Approved by: Eric Joyner (ixgbe part) MFC after: 2 weeks Sponsored by: Yandex LLC
* Garbage collect couple of unused fields from struct ifaddr:glebius2014-07-291-2/+2
| | | | | - ifa_claim_addr() unused since removal of NetAtalk - ifa_metric seems to be never utilized, always a copy of if_metric
* Since 32-bit if_baudrate isn't enough to describe a baud rate of a 10 Gbitglebius2014-03-131-25/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | interface, in the r241616 a crutch was provided. It didn't work well, and finally we decided that it is time to break ABI and simply make if_baudrate a 64-bit value. Meanwhile, the entire struct if_data was reviewed. o Remove the if_baudrate_pf crutch. o Make all fields of struct if_data fixed machine independent size. The notion of data (packet counters, etc) are by no means MD. And it is a bug that on amd64 we've got a 64-bit counters, while on i386 32-bit, which at modern speeds overflow within a second. This also removes quite a lot of COMPAT_FREEBSD32 code. o Give 16 bit for the ifi_datalen field. This field was provided to make future changes to if_data less ABI breaking. Unfortunately the 8 bit size of it had effectively limited sizeof if_data to 256 bytes. o Give 32 bits to ifi_mtu and ifi_metric. o Give 64 bits to the rest of fields, since they are counters. __FreeBSD_version bumped. Discussed with: emax Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Remove never used ioctls that originate from KAME. The proofglebius2013-11-111-12/+0
| | | | of their zero usage was exp-run from misc/183538.
* Provide compat layer for OSIOCAIFADDR.glebius2013-11-061-0/+8
|
* Axe IFF_SMART. Fortunately this layering violating flag was never used,glebius2013-11-051-2/+2
| | | | it was just declared.
* Drop support for historic ioctls and also undefine them, so that codeglebius2013-11-051-8/+0
| | | | | | that checks their presence via ifdef, won't use them. Bump __FreeBSD_version as safety measure.
* - Make the prophecy from 1997 happen and remove if_var.h inclusionglebius2013-10-281-12/+0
| | | | | | | | | | | | | | from if.h. - Remove unnecessary includes and declarations from if.h - Remove unnecessary includes and declarations from if_var.h [1] - Mark some declarations that are about to be removed in near future with comments, explaning why this declaration is still necessary. - Protect eventhandler declarations with #ifdef SYS_EVENTHANDLER_H. Obtained from: bdeBSD [1] Sponsored by: Netflix Sponsored by: Nginx, Inc.
* There are some high performance NICs that count statistics in hardware,glebius2013-10-091-0/+1
| | | | | | | | | | and there are ifnets, that do that via counter(9). Provide a flag that would skip cache line trashing '+=' operation in ether_input(). Sponsored by: Netflix Sponsored by: Nginx, Inc. Reviewed by: melifaro, adrian Approved by: re (marius)
* Restructure the mbuf pkthdr to make it fit for upcoming capabilities andandre2013-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | features. The changes in particular are: o Remove rarely used "header" pointer and replace it with a 64bit protocol/ layer specific union PH_loc for local use. Protocols can flexibly overlay their own 8 to 64 bit fields to store information while the packet is worked on. o Mechanically convert IP reassembly, IGMP/MLD and ATM to use pkthdr.PH_loc instead of pkthdr.header. o Extend csum_flags to 64bits to allow for additional future offload information to be carried (e.g. iSCSI, IPsec offload, and others). o Move the RSS hash type enumerator from abusing m_flags to its own 8bit rsstype field. Adjust accessor macros. o Add cosqos field to store Class of Service / Quality of Service information with the packet. It is not yet supported in any drivers but allows us to get on par with Cisco/Juniper in routing applications (plus MPLS QoS) with a modernized ALTQ. o Add four 8 bit fields l[2-5]hlen to store the relative header offsets from the start of the packet. This is important for various offload capabilities and to relieve the drivers from having to parse the packet and protocol headers to find out location of checksums and other information. Header parsing in drivers is a lot of copy-paste and unhandled corner cases which we want to avoid. o Add another flexible 64bit union to map various additional persistent packet information, like ether_vtag, tso_segsz and csum fields. Depending on the csum_flags settings some fields may have different usage making it very flexible and adaptable to future capabilities. o Restructure the CSUM flags to better signify their outbound (down the stack) and inbound (up the stack) use. The CSUM flags used to be a bit chaotic and rather poorly documented leading to incorrect use in many places. Bring clarity into their use through better naming. Compatibility mappings are provided to preserve the API. The drivers can be corrected one by one and MFC'd without issue. o The size of pkthdr stays the same at 48/56bytes (32/64bit architectures). Sponsored by: The FreeBSD Foundation
* provide helper if_initbaudrate() to set if_baudrate_pf and if_baudrate_pf.emax2012-10-171-1/+1
| | | | | | | again, use ixgbe(4) as an example of how to use new helper function. Reviewed by: jhb MFC after: 1 week
* introduce concept of ifi_baudrate power factor. the idea is to workemax2012-10-161-1/+1
| | | | | | | | | | | | | | | around the problem where high speed interfaces (such as ixgbe(4)) are not able to report real ifi_baudrate. bascially, take a spare byte from struct if_data and use it to store ifi_baudrate power factor. in other words, real ifi_baudrate = ifi_baudrate * 10 ^ ifi_baudrate power factor this should be backwards compatible with old binaries. use ixgbe(4) as an example on how drivers would set ifi_baudrate power factor Discussed with: kib, scottl, glebius MFC after: 1 week
* Hold GIF_LOCK() for almost all of gif_start(). It is required to be heldjhb2012-06-291-1/+0
| | | | | | | | | across in_gif_output() and in6_gif_output() anyway, and once it is held across those it might as well be held for the entire loop. This simplifies the code and removes the need for the custom IFF_GIF_WANTED flag (which belonged in the softc and not as an IFF_* flag anyway). Tested by: Vincent Hoffman vince unsane co uk
* Opps forgot to commit the flag.rrs2012-06-121-1/+1
|
* It turns out that too many drivers are not only parsing the L2/3/4bz2012-05-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | headers for TSO but also for generic checksum offloading. Ideally we would only have one common function shared amongst all drivers, and perhaps when updating them for IPv6 we should introduce that. Eventually we should provide the meta information along with mbufs to avoid (re-)parsing entirely. To not break IPv6 (checksums and offload) and to be able to MFC the changes without risking to hurt 3rd party drivers, duplicate the v4 framework, as other OSes have done as well. Introduce interface capability flags for TX/RX checksum offload with IPv6, to allow independent toggling (where possible). Add CSUM_*_IPV6 flags for UDP/TCP over IPv6, and reserve further for SCTP, and IPv6 fragmentation. Define CSUM_DELAY_DATA_IPV6 as we do for legacy IP and add an alias for CSUM_DATA_VALID_IPV6. This pretty much brings IPv6 handling in line with IPv4. TSO is still handled in a different way and not via if_hwassist. Update ifconfig to allow (un)setting of the new capability flags. Update loopback to announce the new capabilities and if_hwassist flags. Individual driver updates will have to follow, as will SCTP. Reported by: gallatin, dim, .. Reviewed by: gallatin (glanced at?) MFC after: 3 days X-MFC with: r235961,235959,235958
* Introduce a new NET_RT_IFLISTL API to query the address list. It worksbz2012-02-111-0/+54
| | | | | | | | | | | on extended and extensible structs if_msghdrl and ifa_msghdrl. This will allow us to extend both the msghdrl structs and eventually if_data in the future without breaking the ABI. Bump __FreeBSD_version to allow ports to more easily detect the new API. Reviewed by: glebius, brooks MFC after: 3 days
* Backout changes from r228571. Remove if_data from struct ifa_msghdr again.bz2012-02-111-2/+0
| | | | | | | While this breaks carp on HEAD temporary, it restores the upgrade path from stable, and head before 20111215. Reviewed by: glebius, brooks
* Provide ABI compatibility shim to enable configuring of addressesglebius2011-12-211-0/+8
| | | | | | with ifconfig(8) prior to r228571. Requested by: brooks
* A major overhaul of the CARP implementation. The ip_carp.c was startedglebius2011-12-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from scratch, copying needed functionality from the old implemenation on demand, with a thorough review of all code. The main change is that interface layer has been removed from the CARP. Now redundant addresses are configured exactly on the interfaces, they run on. The CARP configuration itself is, as before, configured and read via SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or SIOCAIFADDR_IN6 may now be configured to a particular virtual host id, which makes the prefix redundant. ifconfig(8) semantics has been changed too: now one doesn't need to clone carpXX interface, he/she should directly configure a vhid on a Ethernet interface. To supply vhid data from the kernel to an application the getifaddrs(8) function had been changed to pass ifam_data with each address. [1] The new implementation definitely closes all PRs related to carp(4) being an interface, and may close several others. It also allows to run a single redundant IP per interface. Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for idea on using ifam_data and for several rounds of reviewing! PR: kern/117000, kern/126945, kern/126714, kern/120130, kern/117448 Reviewed by: bz Submitted by: bz [1]
* Add missing #includes.ed2011-10-211-0/+2
| | | | | | | | | According to POSIX, these two header files should be able to be included by themselves, not depending on other headers. The <net/if.h> header uses struct sockaddr when __BSD_VISIBLE=1, while <netinet/tcp.h> uses integer datatypes (u_int32_t, u_short, etc). MFC after: 2 months
* Add infrastructure to allow all frames/packets received on an interfacebz2011-07-031-0/+2
| | | | | | | | | | | | | | to be assigned to a non-default FIB instance. You may need to recompile world or ports due to the change of struct ifnet. Submitted by: cjsp Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) (original versions) Reviewed by: julian Reviewed by: Alexander V. Chernikov (melifaro ipfw.ru) MFC after: 2 weeks X-MFC: use spare in struct ifnet
* Grab one of the ifcap bits for netmap, and enable printing in ifconfig.luigi2011-06-141-0/+10
| | | | | | | Document the fact that we might want an IFCAP_CANTCHANGE mask, even though the value is not yet used in sys/net/if.c (asked on -current a week ago, no feedback so i assume no objection).
* Adds IFF_CANTCONFIG to IFF_CANTCHANGE that it shouldn't happen throughweongyo2010-12-071-1/+1
| | | | ioctl(2).
* Introduces IFF_CANTCONFIG interface flag to point that the interfaceweongyo2010-12-071-1/+1
| | | | | | | | | isn't configurable in a meaningful way. This is for ifconfig(8) or other tools not to change code whenever IFT_USB-like interfaces are registered at the interface list. Reviewed by: brooks No objections: gavin, jkim
* Reshuffle SIOCGIFCONF32 handler from r155224.pluknet2010-10-211-10/+0
| | | | | | | | | | | | | - move all the chunks into one file, which allows to hide SIOCGIFCONF32 global definition as well. - replace __amd64__ with proper COMPAT_FREEBSD32 around. - handle 32bit capacity before going into the handler itself instead of doing internal 32bit specific changes within it (e.g. as it's done for SIOCGDEFIFACE32_IN6). - use explicitely sized types for ABI compat. Approved by: kib (mentor) MFC after: 2 weeks
* Verify interface up status using its link state onlyqingli2010-03-161-0/+1
| | | | | | | | | | | | | | if the interface has such capability. The interface capability flag indicates whether such capability exists. This approach is much more backward compatible. Physical device driver changes will be part of another commit. Also updated the ifconfig utility to show the LINKSTATE capability if present. Reviewed by: rwatson, imp, juli MFC after: 3 days
* Add TSO support on VLANs. Intentionally separated IFCAP_VLAN_HWTSOyongari2010-02-201-0/+1
| | | | | | | | from IFCAP_VLAN_HWTAGGING. I think some hardwares may be able to TSO over VLAN without VLAN hardware tagging. Driver changes and userland support will follow. Reviewed by: thompsa
* Revised revision 199201 (add interface description capability as inspireddelphij2010-01-271-0/+10
| | | | | | | | by OpenBSD), based on comments from many, including rwatson, jhb, brooks and others. Sponsored by: iXsystems, Inc. MFC after: 1 month
* Change vlan interfaces to cope more usefully with the parent interface beingjhb2009-12-291-0/+1
| | | | | | | | | | | | | | renamed. Previously the vlan interfaces would lose their configuration as if the parent interface had been physically removed. Now vlan interfaces ignore rename events. - Add a new ifnet flag (IFF_RENAMING) that is set while an ifnet is being renamed. This flag can be checked in ifnet departure/arrival event handlers to treat rename events differently. - Change the ifnet departure event handler in the if_vlan(4) driver to ignore departure events due to a trunk interface being renamed. Reviewed by: brooks, rwatson MFC after: 1 week
* Revert revision 199201 for now as it has introduced a kernel vulnerabilitydelphij2009-11-121-2/+0
| | | | and requires more polishing.
* Add interface description capability as inspired by OpenBSD.delphij2009-11-111-0/+2
| | | | MFC after: 3 months
* Manage vnets via the jail system. If a jail is given the booleanjamie2009-06-151-0/+2
| | | | | | | | | | | parameter "vnet" when it is created, a new vnet instance will be created along with the jail. Networks interfaces can be moved between prisons with an ioctl similar to the one that moves them between vimages. For now vnets will co-exist under both jails and vimages, but soon struct vimage will be going away. Reviewed by: zec, julian Approved by: bz (mentor)
* When user_frac in the polling subsystem is low it is going to busy theattilio2009-05-301-0/+1
| | | | | | | | | | | | | | | | | | | | | CPU for too long period than necessary. Additively, interfaces are kept polled (in the tick) even if no more packets are available. In order to avoid such situations a new generic mechanism can be implemented in proactive way, keeping track of the time spent on any packet and fragmenting the time for any tick, stopping the processing as soon as possible. In order to implement such mechanism, the polling handler needs to change, returning the number of packets processed. While the intended logic is not part of this patch, the polling KPI is broken by this commit, adding an int return value and the new flag IFCAP_POLLING_NOCOUNT (which will signal that the return value is meaningless for the installed handler and checking should be skipped). Bump __FreeBSD_version in order to signal such situation. Reviewed by: emaste Sponsored by: Sandvine Incorporated
* Add a new interface flag, IFF_DYING, which is set when a device driverrwatson2009-04-231-1/+3
| | | | | | | | | | | | | | calls if_free(), and remains set if the refcount is elevated. IF_DYING skips the bit in the if_flags bitmask previously used by IFF_NEEDSGIANT, so that an MFC can be done without changing which bit is used, as IFF_NEEDSGIANT is still present in 7.x. ifnet_byindex_ref() checks for IFF_DYING and returns NULL if it is set, preventing new references from by acquired by index, preventing monitoring sysctls from seeing it. Other lookup mechanisms currently do not check IFF_DYING, but may need to in the future. MFC after: 3 weeks
* Remove IFF_NEEDSGIANT interface flag: we no longer provide ifnet-layerrwatson2009-04-181-3/+1
| | | | infrastructure to support non-MPSAFE network device drivers.
* remove unnecessary forward declarationluigi2009-02-161-2/+0
|
* Fix to bug kern/126850. Only dispatch event hander if thejfv2008-08-281-16/+17
| | | | | | | interface had a parent (was attached). Reviewed by: EvilSam MFC after: 1 week
* Trim some noise from some #ifdef's. This had leaked into the compat32jhb2008-07-301-1/+1
| | | | | | | support for bpf(4) due to hacks in the Y! tree for a truss32 binary (since superseded by native support for 32-bit binaries in truss itself). MFC after: 1 week
* Add IFF_NEEDSGIANT to IFF_CANTCHANGE, to prevent user-level codeiedowse2008-03-271-1/+2
| | | | | | | | | | from clearing the IFF_NEEDSGIANT flag on Giant-locked interfaces. In particular, wpa_supplicant was doing this on USB interfaces, causing panics when Giant-locked code was then called without Giant. Submitted by: Alexey Popov Reviewed by: rwatson MFC after: 3 days
* fix bonehead cut and paste error in last commitkmacy2007-12-151-1/+1
|
* Create separate capability flags for TCP over IPv4 and TCP over IPv6kmacy2007-12-151-1/+3
|
* add interface capability for TOEkmacy2007-12-151-0/+1
|
* Wake On Lan (WOL) infrastructuresam2007-12-101-2/+6
| | | | | Submitted by: Stefan Sperling <stsp@stsp.name> Reviewed by: brooks
* Add IFCAP_LRO flag for drivers to announce their TCP Large Receive Offloadandre2007-06-111-0/+1
| | | | capabilities.
* The struct if_data members ifi_recvquota and ifi_xmitquota have beenbrooks2007-05-161-2/+2
| | | | | unused for ages. Rename them to ifi_spare_char1 and ifi_spare_char2 respectively to indicate this face.
* Fix a couple of typos in a comment.yar2007-05-021-2/+2
|
* First step of TSO (TCP segmentation offload) support in our network stack.andre2006-09-061-0/+3
| | | | | | | | | | | | o add IFCAP_TSO[46] for drivers to announce this capability for IPv4 and IPv6 o add CSUM_TSO flag to mbuf pkthdr csum_flags field o add tso_segsz field to mbuf pkthdr o enhance ip_output() packet length check to allow for large TSO packets o extend tcp_maxmtu[46]() with a flag pointer to pass interface capabilities o adjust all callers of tcp_maxmtu[46]() accordingly Discussed on: -current, -net Sponsored by: TCP/IP Optimization Fundraise 2005
* Improve description of if_capabilities, if_capenable and ifi_hwassist.andre2006-09-061-2/+19
| | | | Sponsored by: TCP/IP Optimization Fundraise 2005
* Import interface groups from OpenBSD. This allows to group interfaces inmlaier2006-06-191-0/+31
| | | | | | | | order to - for example - apply firewall rules to a whole group of interfaces. This is required for importing pf from OpenBSD 3.9 Obtained from: OpenBSD (with changes) Discussed on: -net (back in April)
* Remove various bits of conditional Alpha code and fixup a few comments.jhb2006-05-121-3/+0
|
OpenPOWER on IntegriCloud