| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | package ethtool |
| 4 | |
| 5 | import ( |
| 6 | "strings" |
| 7 | ) |
| 8 | |
| 9 | func (c *Collector) collect() (map[string]int64, error) { |
| 10 | mx := make(map[string]int64) |
| 11 | |
| 12 | for iface := range strings.FieldsSeq(c.OpticInterfaces) { |
| 13 | if c.ignoredOpticIfaces[iface] { |
| 14 | continue |
| 15 | } |
| 16 | |
| 17 | if err := c.collectModuleEeprom(mx, iface); err != nil { |
| 18 | c.ignoredOpticIfaces[iface] = true |
| 19 | c.Errorf("failed to collect ddm info for %s: %v", iface, err) |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | return mx, nil |
| 24 | } |