-
Notifications
You must be signed in to change notification settings - Fork 3
/
group.go
52 lines (47 loc) · 1.53 KB
/
group.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) 2023, Intel Corporation.
// SPDX-License-Identifier: BSD-3-Clause
package config
// Group represents a group of devices managed by a device.
type Group struct {
// Device is the device that manages the group.
Device *Device `json:"-"`
// ID is the ID of the group.
ID int
// Path is the path to the group.
Path string
// NumaNode is the NUMA node the group belongs to.
NumaNode int
// GroupID is the ID of the group.
GroupID int
// Engines is the list of engines in the group.
Engines string `binding:""`
// WorkQueues is the list of work queues in the group.
WorkQueues string `binding:""`
// ReadBuffersReserved is the number of read buffers reserved.
ReadBuffersReserved uint64 `binding:""`
// ReadBufferAllowed is the number of read buffers allowed.
ReadBufferAllowed uint64 `binding:""`
// UseReadBufferLimit is the number of read buffers to use.
UseReadBufferLimit uint64 `binding:""`
// TrafficClassA is the number of traffic class A messages.
TrafficClassA uint64 `binding:""`
// TrafficClassB is the number of traffic class B messages.
TrafficClassB uint64 `binding:""`
// GroupedEngines is the list of engines in the group.
GroupedEngines []*Engine
// GroupedWorkQueues is the list of work queues in the group.
GroupedWorkQueues []*WorkQueue
}
// addGroup adds a new group to the device.
func (d *Device) addGroup(id int, path string) (err error) {
var g Group
g.Device = d
g.ID = id
g.Path = path
err = bindSysfs(&g, path)
if err != nil {
return err
}
d.Groups = append(d.Groups, &g)
return nil
}