History

cfg80211/nl80211: Add packet coalesce support

In most cases, host that receives IPv4 and IPv6 multicast/broadcast packets does not do anything with these packets. Therefore the reception of these unwanted packets causes unnecessary processing and power consumption. Packet coalesce feature helps to reduce number of received interrupts to host by buffering these packets in firmware/hardware for some predefined time. Received interrupt will be generated when one of the following events occur. a) Expiration of hardware timer whose expiration time is set to maximum coalescing delay of matching coalesce rule. b) Coalescing buffer in hardware reaches it's limit. c) Packet doesn't match any of the configured coalesce rules. This patch adds set/get configuration support for packet coalesce. User needs to configure following parameters for creating a coalesce rule. a) Maximum coalescing delay b) List of packet patterns which needs to be matched c) Condition for coalescence. pattern 'match' or 'no match' Multiple such rules can be created. This feature needs to be advertised during driver initialization. Drivers are supposed to do required firmware/hardware settings based on user configuration.

Amitkumar Karwar committed 13 years ago

Commit be29b991 parent a144f376 files · +463 −2Browse files

Showing the changes to include/uapi/linux (1 of 6 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+88−2
@@ -125,6 +125,31 @@ · 124 unmodified lines
125125 * interfaces that a given device supports.
126126 */
127127
128+/**
129+ * DOC: packet coalesce support
130+ *
131+ * In most cases, host that receives IPv4 and IPv6 multicast/broadcast
132+ * packets does not do anything with these packets. Therefore the
133+ * reception of these unwanted packets causes unnecessary processing
134+ * and power consumption.
135+ *
136+ * Packet coalesce feature helps to reduce number of received interrupts
137+ * to host by buffering these packets in firmware/hardware for some
138+ * predefined time. Received interrupt will be generated when one of the
139+ * following events occur.
140+ * a) Expiration of hardware timer whose expiration time is set to maximum
141+ * coalescing delay of matching coalesce rule.
142+ * b) Coalescing buffer in hardware reaches it's limit.
143+ * c) Packet doesn't match any of the configured coalesce rules.
144+ *
145+ * User needs to configure following parameters for creating a coalesce
146+ * rule.
147+ * a) Maximum coalescing delay
148+ * b) List of packet patterns which needs to be matched
149+ * c) Condition for coalescence. pattern 'match' or 'no match'
150+ * Multiple such rules can be created.
151+ */
152+
128153 /**
129154 * enum nl80211_commands - supported nl80211 commands
130155 *
@@ -648,6 +673,9 @@ · 517 unmodified lines
648673 * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can
649674 * return back to normal.
650675 *
676+ * @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules.
677+ * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules.
678+ *
651679 * @NL80211_CMD_MAX: highest used command number
652680 * @__NL80211_CMD_AFTER_LAST: internal use
653681 */
@@ -810,6 +838,9 @@ enum nl80211_commands { · 156 unmodified lines
810838 NL80211_CMD_CRIT_PROTOCOL_START,
811839 NL80211_CMD_CRIT_PROTOCOL_STOP,
812840
841+ NL80211_CMD_GET_COALESCE,
842+ NL80211_CMD_SET_COALESCE,
843+
813844 /* add new commands above here */
814845
815846 /* used to define NL80211_CMD_MAX below */
@@ -1436,6 +1467,8 @@ enum nl80211_commands { · 620 unmodified lines
14361467 * allowed to be used with the first @NL80211_CMD_SET_STATION command to
14371468 * update a TDLS peer STA entry.
14381469 *
1470+ * @NL80211_ATTR_COALESCE_RULE: Coalesce rule information.
1471+ *
14391472 * @NL80211_ATTR_MAX: highest attribute number currently defined
14401473 * @__NL80211_ATTR_AFTER_LAST: internal use
14411474 */
@@ -1736,6 +1769,8 @@ enum nl80211_attrs { · 294 unmodified lines
17361769
17371770 NL80211_ATTR_PEER_AID,
17381771
1772+ NL80211_ATTR_COALESCE_RULE,
1773+
17391774 /* add attributes here, update the policy in nl80211.c */
17401775
17411776 __NL80211_ATTR_AFTER_LAST,
@@ -3098,8 +3133,10 @@ enum nl80211_packet_pattern_attr { · 1356 unmodified lines
30983133 * @max_pkt_offset: maximum Rx packet offset
30993134 *
31003135 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
3101− * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the
3102− * capability information given by the kernel to userspace.
3136+ * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED or in
3137+ * %NL80211_ATTR_COALESCE_RULE_PKT_PATTERN when that is part of
3138+ * %NL80211_ATTR_COALESCE_RULE in the capability information given
3139+ * by the kernel to userspace.
31033140 */
31043141 struct nl80211_pattern_support {
31053142 __u32 max_patterns;
@@ -3317,6 +3354,55 @@ enum nl80211_wowlan_tcp_attrs { · 211 unmodified lines
33173354 MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1
33183355 };
33193356
3357+/**
3358+ * struct nl80211_coalesce_rule_support - coalesce rule support information
3359+ * @max_rules: maximum number of rules supported
3360+ * @pat: packet pattern support information
3361+ * @max_delay: maximum supported coalescing delay in msecs
3362+ *
3363+ * This struct is carried in %NL80211_ATTR_COALESCE_RULE in the
3364+ * capability information given by the kernel to userspace.
3365+ */
3366+struct nl80211_coalesce_rule_support {
3367+ __u32 max_rules;
3368+ struct nl80211_pattern_support pat;
3369+ __u32 max_delay;
3370+} __attribute__((packed));
3371+
3372+/**
3373+ * enum nl80211_attr_coalesce_rule - coalesce rule attribute
3374+ * @__NL80211_COALESCE_RULE_INVALID: invalid number for nested attribute
3375+ * @NL80211_ATTR_COALESCE_RULE_DELAY: delay in msecs used for packet coalescing
3376+ * @NL80211_ATTR_COALESCE_RULE_CONDITION: condition for packet coalescence,
3377+ * see &enum nl80211_coalesce_condition.
3378+ * @NL80211_ATTR_COALESCE_RULE_PKT_PATTERN: packet offset, pattern is matched
3379+ * after these fixed number of bytes of received packet
3380+ * @NUM_NL80211_ATTR_COALESCE_RULE: number of attributes
3381+ * @NL80211_ATTR_COALESCE_RULE_MAX: max attribute number
3382+ */
3383+enum nl80211_attr_coalesce_rule {
3384+ __NL80211_COALESCE_RULE_INVALID,
3385+ NL80211_ATTR_COALESCE_RULE_DELAY,
3386+ NL80211_ATTR_COALESCE_RULE_CONDITION,
3387+ NL80211_ATTR_COALESCE_RULE_PKT_PATTERN,
3388+
3389+ /* keep last */
3390+ NUM_NL80211_ATTR_COALESCE_RULE,
3391+ NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1
3392+};
3393+
3394+/**
3395+ * enum nl80211_coalesce_condition - coalesce rule conditions
3396+ * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns
3397+ * in a rule are matched.
3398+ * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns
3399+ * in a rule are not matched.
3400+ */
3401+enum nl80211_coalesce_condition {
3402+ NL80211_COALESCE_CONDITION_MATCH,
3403+ NL80211_COALESCE_CONDITION_NO_MATCH
3404+};
3405+
33203406 /**
33213407 * enum nl80211_iface_limit_attrs - limit attributes
33223408 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t