@@ -178,13 +178,13 @@ type ResourceSliceSpec struct {
178
178
// the portion of counters it uses will no longer be available for use
179
179
// by other devices.
180
180
type CounterSet struct {
181
- // Name defines the name of the counter set.
182
- // It must be a DNS label .
181
+ // CounterSet is the name of the set from which the
182
+ // counters defined will be consumed .
183
183
//
184
184
// +required
185
185
Name string `json:"name" protobuf:"bytes,1,name=name"`
186
186
187
- // Counters defines the set of counters for this CounterSet
187
+ // Counters defines the counters that will be consumed by the device.
188
188
// The name of each counter must be unique in that set and must be a DNS label.
189
189
//
190
190
// To ensure this uniqueness, capacities defined by the vendor
@@ -284,20 +284,21 @@ type BasicDevice struct {
284
284
// +optional
285
285
Capacity map [QualifiedName ]resource.Quantity `json:"capacity,omitempty" protobuf:"bytes,2,rep,name=capacity"`
286
286
287
- // ConsumesCounter defines a list of references to sharedCounters
287
+ // ConsumesCounters defines a list of references to sharedCounters
288
288
// and the set of counters that the device will
289
289
// consume from those counter sets.
290
290
//
291
291
// There can only be a single entry per counterSet.
292
292
//
293
- // The maximum number of device counter consumption entries
294
- // is 32. This is the same as the maximum number of shared counters
295
- // allowed in a ResourceSlice.
293
+ // The total number of device counter consumption entries
294
+ // must be <= 32. In addition, the total number in the
295
+ // entire ResourceSlice must be <= 1024 (for example,
296
+ // 64 devices with 16 counters each).
296
297
//
297
298
// +optional
298
299
// +listType=atomic
299
300
// +featureGate=DRAPartitionableDevices
300
- ConsumesCounter []DeviceCounterConsumption `json:"consumesCounter ,omitempty" protobuf:"bytes,3,rep,name=consumesCounter "`
301
+ ConsumesCounters []DeviceCounterConsumption `json:"consumesCounters ,omitempty" protobuf:"bytes,3,rep,name=consumesCounters "`
301
302
302
303
// NodeName identifies the node where the device is available.
303
304
//
@@ -331,7 +332,7 @@ type BasicDevice struct {
331
332
332
333
// If specified, these are the driver-defined taints.
333
334
//
334
- // The maximum number of taints is 8 .
335
+ // The maximum number of taints is 4 .
335
336
//
336
337
// This is an alpha field and requires enabling the DRADeviceTaints
337
338
// feature gate.
@@ -345,17 +346,19 @@ type BasicDevice struct {
345
346
// DeviceCounterConsumption defines a set of counters that
346
347
// a device will consume from a CounterSet.
347
348
type DeviceCounterConsumption struct {
348
- // SharedCounter defines the shared counter from which the
349
+ // CounterSet defines the set from which the
349
350
// counters defined will be consumed.
350
351
//
351
352
// +required
352
- SharedCounter string `json:"sharedCounter " protobuf:"bytes,1,opt,name=sharedCounter "`
353
+ CounterSet string `json:"counterSet " protobuf:"bytes,1,opt,name=counterSet "`
353
354
354
355
// Counters defines the Counter that will be consumed by
355
356
// the device.
356
357
//
357
- //
358
- // The maximum number of Counters is 32.
358
+ // The maximum number counters in a device is 32.
359
+ // In addition, the maximum number of all counters
360
+ // in all devices is 1024 (for example, 64 devices with
361
+ // 16 counters each).
359
362
//
360
363
// +required
361
364
Counters map [string ]Counter `json:"counters,omitempty" protobuf:"bytes,2,opt,name=counters"`
@@ -364,6 +367,14 @@ type DeviceCounterConsumption struct {
364
367
// Limit for the sum of the number of entries in both attributes and capacity.
365
368
const ResourceSliceMaxAttributesAndCapacitiesPerDevice = 32
366
369
370
+ // Limit for the total number of counters in each device.
371
+ const ResourceSliceMaxCountersPerDevice = 32
372
+
373
+ // Limit for the total number of counters defined in devices in
374
+ // a ResourceSlice. We want to allow up to 64 devices to specify
375
+ // up to 16 counters, so the limit for the ResourceSlice will be 1024.
376
+ const ResourceSliceMaxDeviceCountersPerSlice = 1024 // 64 * 16
377
+
367
378
// QualifiedName is the name of a device attribute or capacity.
368
379
//
369
380
// Attributes and capacities are defined either by the owner of the specific
@@ -427,7 +438,7 @@ type DeviceAttribute struct {
427
438
const DeviceAttributeMaxValueLength = 64
428
439
429
440
// DeviceTaintsMaxLength is the maximum number of taints per device.
430
- const DeviceTaintsMaxLength = 8
441
+ const DeviceTaintsMaxLength = 4
431
442
432
443
// The device this taint is attached to has the "effect" on
433
444
// any claim which does not tolerate the taint and, through the claim,
@@ -784,7 +795,7 @@ type DeviceSubRequest struct {
784
795
// Allocation will fail if some devices are already allocated,
785
796
// unless adminAccess is requested.
786
797
//
787
- // If AlloctionMode is not specified, the default mode is ExactCount. If
798
+ // If AllocationMode is not specified, the default mode is ExactCount. If
788
799
// the mode is ExactCount and count is not specified, the default count is
789
800
// one. Any other requests must specify this field.
790
801
//
0 commit comments