aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h180
1 files changed, 92 insertions, 88 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c6e427ab65fe..45f00b61c096 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -117,99 +117,101 @@ struct ethtool_eeprom {
117 __u8 data[0]; 117 __u8 data[0];
118}; 118};
119 119
120/* for configuring coalescing parameters of chip */ 120/**
121 * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
122 * @cmd: ETHTOOL_{G,S}COALESCE
123 * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after
124 * a packet arrives.
125 * @rx_max_coalesced_frames: Maximum number of packets to receive
126 * before an RX interrupt.
127 * @rx_coalesce_usecs_irq: Same as @rx_coalesce_usecs, except that
128 * this value applies while an IRQ is being serviced by the host.
129 * @rx_max_coalesced_frames_irq: Same as @rx_max_coalesced_frames,
130 * except that this value applies while an IRQ is being serviced
131 * by the host.
132 * @tx_coalesce_usecs: How many usecs to delay a TX interrupt after
133 * a packet is sent.
134 * @tx_max_coalesced_frames: Maximum number of packets to be sent
135 * before a TX interrupt.
136 * @tx_coalesce_usecs_irq: Same as @tx_coalesce_usecs, except that
137 * this value applies while an IRQ is being serviced by the host.
138 * @tx_max_coalesced_frames_irq: Same as @tx_max_coalesced_frames,
139 * except that this value applies while an IRQ is being serviced
140 * by the host.
141 * @stats_block_coalesce_usecs: How many usecs to delay in-memory
142 * statistics block updates. Some drivers do not have an
143 * in-memory statistic block, and in such cases this value is
144 * ignored. This value must not be zero.
145 * @use_adaptive_rx_coalesce: Enable adaptive RX coalescing.
146 * @use_adaptive_tx_coalesce: Enable adaptive TX coalescing.
147 * @pkt_rate_low: Threshold for low packet rate (packets per second).
148 * @rx_coalesce_usecs_low: How many usecs to delay an RX interrupt after
149 * a packet arrives, when the packet rate is below @pkt_rate_low.
150 * @rx_max_coalesced_frames_low: Maximum number of packets to be received
151 * before an RX interrupt, when the packet rate is below @pkt_rate_low.
152 * @tx_coalesce_usecs_low: How many usecs to delay a TX interrupt after
153 * a packet is sent, when the packet rate is below @pkt_rate_low.
154 * @tx_max_coalesced_frames_low: Maximum nuumber of packets to be sent before
155 * a TX interrupt, when the packet rate is below @pkt_rate_low.
156 * @pkt_rate_high: Threshold for high packet rate (packets per second).
157 * @rx_coalesce_usecs_high: How many usecs to delay an RX interrupt after
158 * a packet arrives, when the packet rate is above @pkt_rate_high.
159 * @rx_max_coalesced_frames_high: Maximum number of packets to be received
160 * before an RX interrupt, when the packet rate is above @pkt_rate_high.
161 * @tx_coalesce_usecs_high: How many usecs to delay a TX interrupt after
162 * a packet is sent, when the packet rate is above @pkt_rate_high.
163 * @tx_max_coalesced_frames_high: Maximum number of packets to be sent before
164 * a TX interrupt, when the packet rate is above @pkt_rate_high.
165 * @rate_sample_interval: How often to do adaptive coalescing packet rate
166 * sampling, measured in seconds. Must not be zero.
167 *
168 * Each pair of (usecs, max_frames) fields specifies this exit
169 * condition for interrupt coalescing:
170 * (usecs > 0 && time_since_first_completion >= usecs) ||
171 * (max_frames > 0 && completed_frames >= max_frames)
172 * It is illegal to set both usecs and max_frames to zero as this
173 * would cause interrupts to never be generated. To disable
174 * coalescing, set usecs = 0 and max_frames = 1.
175 *
176 * Some implementations ignore the value of max_frames and use the
177 * condition:
178 * time_since_first_completion >= usecs
179 * This is deprecated. Drivers for hardware that does not support
180 * counting completions should validate that max_frames == !rx_usecs.
181 *
182 * Adaptive RX/TX coalescing is an algorithm implemented by some
183 * drivers to improve latency under low packet rates and improve
184 * throughput under high packet rates. Some drivers only implement
185 * one of RX or TX adaptive coalescing. Anything not implemented by
186 * the driver causes these values to be silently ignored.
187 *
188 * When the packet rate is below @pkt_rate_high but above
189 * @pkt_rate_low (both measured in packets per second) the
190 * normal {rx,tx}_* coalescing parameters are used.
191 */
121struct ethtool_coalesce { 192struct ethtool_coalesce {
122 __u32 cmd; /* ETHTOOL_{G,S}COALESCE */ 193 __u32 cmd;
123
124 /* How many usecs to delay an RX interrupt after
125 * a packet arrives. If 0, only rx_max_coalesced_frames
126 * is used.
127 */
128 __u32 rx_coalesce_usecs; 194 __u32 rx_coalesce_usecs;
129
130 /* How many packets to delay an RX interrupt after
131 * a packet arrives. If 0, only rx_coalesce_usecs is
132 * used. It is illegal to set both usecs and max frames
133 * to zero as this would cause RX interrupts to never be
134 * generated.
135 */
136 __u32 rx_max_coalesced_frames; 195 __u32 rx_max_coalesced_frames;
137
138 /* Same as above two parameters, except that these values
139 * apply while an IRQ is being serviced by the host. Not
140 * all cards support this feature and the values are ignored
141 * in that case.
142 */
143 __u32 rx_coalesce_usecs_irq; 196 __u32 rx_coalesce_usecs_irq;
144 __u32 rx_max_coalesced_frames_irq; 197 __u32 rx_max_coalesced_frames_irq;
145
146 /* How many usecs to delay a TX interrupt after
147 * a packet is sent. If 0, only tx_max_coalesced_frames
148 * is used.
149 */
150 __u32 tx_coalesce_usecs; 198 __u32 tx_coalesce_usecs;
151
152 /* How many packets to delay a TX interrupt after
153 * a packet is sent. If 0, only tx_coalesce_usecs is
154 * used. It is illegal to set both usecs and max frames
155 * to zero as this would cause TX interrupts to never be
156 * generated.
157 */
158 __u32 tx_max_coalesced_frames; 199 __u32 tx_max_coalesced_frames;
159
160 /* Same as above two parameters, except that these values
161 * apply while an IRQ is being serviced by the host. Not
162 * all cards support this feature and the values are ignored
163 * in that case.
164 */
165 __u32 tx_coalesce_usecs_irq; 200 __u32 tx_coalesce_usecs_irq;
166 __u32 tx_max_coalesced_frames_irq; 201 __u32 tx_max_coalesced_frames_irq;
167
168 /* How many usecs to delay in-memory statistics
169 * block updates. Some drivers do not have an in-memory
170 * statistic block, and in such cases this value is ignored.
171 * This value must not be zero.
172 */
173 __u32 stats_block_coalesce_usecs; 202 __u32 stats_block_coalesce_usecs;
174
175 /* Adaptive RX/TX coalescing is an algorithm implemented by
176 * some drivers to improve latency under low packet rates and
177 * improve throughput under high packet rates. Some drivers
178 * only implement one of RX or TX adaptive coalescing. Anything
179 * not implemented by the driver causes these values to be
180 * silently ignored.
181 */
182 __u32 use_adaptive_rx_coalesce; 203 __u32 use_adaptive_rx_coalesce;
183 __u32 use_adaptive_tx_coalesce; 204 __u32 use_adaptive_tx_coalesce;
184
185 /* When the packet rate (measured in packets per second)
186 * is below pkt_rate_low, the {rx,tx}_*_low parameters are
187 * used.
188 */
189 __u32 pkt_rate_low; 205 __u32 pkt_rate_low;
190 __u32 rx_coalesce_usecs_low; 206 __u32 rx_coalesce_usecs_low;
191 __u32 rx_max_coalesced_frames_low; 207 __u32 rx_max_coalesced_frames_low;
192 __u32 tx_coalesce_usecs_low; 208 __u32 tx_coalesce_usecs_low;
193 __u32 tx_max_coalesced_frames_low; 209 __u32 tx_max_coalesced_frames_low;
194
195 /* When the packet rate is below pkt_rate_high but above
196 * pkt_rate_low (both measured in packets per second) the
197 * normal {rx,tx}_* coalescing parameters are used.
198 */
199
200 /* When the packet rate is (measured in packets per second)
201 * is above pkt_rate_high, the {rx,tx}_*_high parameters are
202 * used.
203 */
204 __u32 pkt_rate_high; 210 __u32 pkt_rate_high;
205 __u32 rx_coalesce_usecs_high; 211 __u32 rx_coalesce_usecs_high;
206 __u32 rx_max_coalesced_frames_high; 212 __u32 rx_max_coalesced_frames_high;
207 __u32 tx_coalesce_usecs_high; 213 __u32 tx_coalesce_usecs_high;
208 __u32 tx_max_coalesced_frames_high; 214 __u32 tx_max_coalesced_frames_high;
209
210 /* How often to do adaptive coalescing packet rate sampling,
211 * measured in seconds. Must not be zero.
212 */
213 __u32 rate_sample_interval; 215 __u32 rate_sample_interval;
214}; 216};
215 217
@@ -444,7 +446,7 @@ struct ethtool_flow_ext {
444}; 446};
445 447
446/** 448/**
447 * struct ethtool_rx_flow_spec - specification for RX flow filter 449 * struct ethtool_rx_flow_spec - classification rule for RX flows
448 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW 450 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
449 * @h_u: Flow fields to match (dependent on @flow_type) 451 * @h_u: Flow fields to match (dependent on @flow_type)
450 * @h_ext: Additional fields to match 452 * @h_ext: Additional fields to match
@@ -454,7 +456,9 @@ struct ethtool_flow_ext {
454 * includes the %FLOW_EXT flag. 456 * includes the %FLOW_EXT flag.
455 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC 457 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
456 * if packets should be discarded 458 * if packets should be discarded
457 * @location: Index of filter in hardware table 459 * @location: Location of rule in the table. Locations must be
460 * numbered such that a flow matching multiple rules will be
461 * classified according to the first (lowest numbered) rule.
458 */ 462 */
459struct ethtool_rx_flow_spec { 463struct ethtool_rx_flow_spec {
460 __u32 flow_type; 464 __u32 flow_type;
@@ -473,9 +477,9 @@ struct ethtool_rx_flow_spec {
473 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS 477 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
474 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW 478 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
475 * @data: Command-dependent value 479 * @data: Command-dependent value
476 * @fs: Flow filter specification 480 * @fs: Flow classification rule
477 * @rule_cnt: Number of rules to be affected 481 * @rule_cnt: Number of rules to be affected
478 * @rule_locs: Array of valid rule indices 482 * @rule_locs: Array of used rule locations
479 * 483 *
480 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating 484 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
481 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following 485 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following
@@ -487,23 +491,20 @@ struct ethtool_rx_flow_spec {
487 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined 491 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
488 * rules on return. 492 * rules on return.
489 * 493 *
490 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the index of an 494 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an
491 * existing filter rule on entry and @fs contains the rule on return. 495 * existing rule on entry and @fs contains the rule on return.
492 * 496 *
493 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the 497 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
494 * user buffer for @rule_locs on entry. On return, @data is the size 498 * user buffer for @rule_locs on entry. On return, @data is the size
495 * of the filter table and @rule_locs contains the indices of the 499 * of the rule table, @rule_cnt is the number of defined rules, and
496 * defined rules. 500 * @rule_locs contains the locations of the defined rules. Drivers
501 * must use the second parameter to get_rxnfc() instead of @rule_locs.
497 * 502 *
498 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the filter rule to add or 503 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
499 * update. @fs.@location specifies the index to use and must not be 504 * @fs.@location specifies the location to use and must not be ignored.
500 * ignored.
501 * 505 *
502 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the index of an 506 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an
503 * existing filter rule on entry. 507 * existing rule on entry.
504 *
505 * Implementation of indexed classification rules generally requires a
506 * TCAM.
507 */ 508 */
508struct ethtool_rxnfc { 509struct ethtool_rxnfc {
509 __u32 cmd; 510 __u32 cmd;
@@ -726,6 +727,9 @@ enum ethtool_sfeatures_retval_bits {
726/* needed by dev_disable_lro() */ 727/* needed by dev_disable_lro() */
727extern int __ethtool_set_flags(struct net_device *dev, u32 flags); 728extern int __ethtool_set_flags(struct net_device *dev, u32 flags);
728 729
730extern int __ethtool_get_settings(struct net_device *dev,
731 struct ethtool_cmd *cmd);
732
729/** 733/**
730 * enum ethtool_phys_id_state - indicator state for physical identification 734 * enum ethtool_phys_id_state - indicator state for physical identification
731 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated 735 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
@@ -936,7 +940,7 @@ struct ethtool_ops {
936 int (*set_priv_flags)(struct net_device *, u32); 940 int (*set_priv_flags)(struct net_device *, u32);
937 int (*get_sset_count)(struct net_device *, int); 941 int (*get_sset_count)(struct net_device *, int);
938 int (*get_rxnfc)(struct net_device *, 942 int (*get_rxnfc)(struct net_device *,
939 struct ethtool_rxnfc *, void *); 943 struct ethtool_rxnfc *, u32 *rule_locs);
940 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); 944 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
941 int (*flash_device)(struct net_device *, struct ethtool_flash *); 945 int (*flash_device)(struct net_device *, struct ethtool_flash *);
942 int (*reset)(struct net_device *, u32 *); 946 int (*reset)(struct net_device *, u32 *);