summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2006-09-06 18:06:04 +0000
committerandre <andre@FreeBSD.org>2006-09-06 18:06:04 +0000
commitae5965062b9bbb95c18a0e4e157f2a1c1247263f (patch)
treeb6b05de762a2431b3158b729c7340f7aaf14cf62
parent9e3a82aacc8c031e76f2432575ec9887d35d0d98 (diff)
downloadFreeBSD-src-ae5965062b9bbb95c18a0e4e157f2a1c1247263f.zip
FreeBSD-src-ae5965062b9bbb95c18a0e4e157f2a1c1247263f.tar.gz
Improve description of if_capabilities, if_capenable and ifi_hwassist.
Sponsored by: TCP/IP Optimization Fundraise 2005
-rw-r--r--sys/net/if.h21
-rw-r--r--sys/net/if_var.h4
-rw-r--r--sys/sys/mbuf.h1
3 files changed, 22 insertions, 4 deletions
diff --git a/sys/net/if.h b/sys/net/if.h
index 1116d4b..b989890 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -101,7 +101,7 @@ struct if_data {
u_long ifi_omcasts; /* packets sent via multicast */
u_long ifi_iqdrops; /* dropped on input, this interface */
u_long ifi_noproto; /* destined for unsupported protocol */
- u_long ifi_hwassist; /* HW offload capabilities */
+ u_long ifi_hwassist; /* HW offload capabilities, see IFCAP */
time_t ifi_epoch; /* uptime at attach or stat reset */
struct timeval ifi_lastchange; /* time of last administrative change */
};
@@ -180,7 +180,24 @@ struct if_data {
#define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */
#define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */
-/* Capabilities that interfaces can advertise. */
+/*
+ * Capabilities that interfaces can advertise.
+ *
+ * struct ifnet.if_capabilities
+ * contains the optional features & capabilities a particular interface
+ * supports (not only the driver but also the detected hw revision).
+ * Capabilities are defined by IFCAP_* below.
+ * struct ifnet.if_capenabled
+ * contains the enabled (either by default or through ifconfig) optional
+ * features & capabilities on this interface.
+ * Capabilities are defined by IFCAP_* below.
+ * struct if_data.ifi_hwassist in mbuf CSUM_ flag form, controlled by above
+ * contains the enabled optional feature & capabilites that can be used
+ * individually per packet and are specified in the mbuf pkthdr.csum_flags
+ * field. IFCAP_* and CSUM_* do not match one to one and CSUM_* may be
+ * more detailed or differenciated that IFCAP_*.
+ * Hwassist features are defined CSUM_* in sys/mbuf.h
+ */
#define IFCAP_RXCSUM 0x0001 /* can offload checksum on RX */
#define IFCAP_TXCSUM 0x0002 /* can offload checksum on TX */
#define IFCAP_NETCONS 0x0004 /* can be a network console */
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 6d7601c..574bb72 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -137,8 +137,8 @@ struct ifnet {
short if_timer; /* time 'til if_watchdog called */
struct ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */
int if_flags; /* up/down, broadcast, etc. */
- int if_capabilities; /* interface capabilities */
- int if_capenable; /* enabled features */
+ int if_capabilities; /* interface features & capabilities */
+ int if_capenable; /* enabled features & capabilities */
void *if_linkmib; /* link-type-specific MIB data */
size_t if_linkmiblen; /* length of above data */
struct if_data if_data;
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 380bc1f..eb0ff1e8 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -209,6 +209,7 @@ struct mbuf {
/*
* Flags indicating hw checksum support and sw checksum requirements.
+ * This field can be directly tested against if_data.ifi_hwassist.
*/
#define CSUM_IP 0x0001 /* will csum IP */
#define CSUM_TCP 0x0002 /* will csum TCP */
OpenPOWER on IntegriCloud