919d1c98fe
Currently, StarlingX uses a version of the SR-IOV CNI and device plugin container images that are based on a certain commit reference. This is done to ensure reliable and predicable behaviour until the images can be locked down on a stable release version. It is desirable to move to a later version of these images for a couple of reasons (aside from bug fixes, etc): 1. The SR-IOV CNI image now uses an alpine base, rather than a Redhat base. 2. The SR-IOV device plugin allows a DPDK enabled pod with Mellanox NICs to run unprivileged. This commit makes the necessary changes to handle the change to the SR-IOV device plugin configuration file. An example of the new format is as follows: { "resourceList": [{ "resourceName": "pci_sriov_net_network1", "selectors": { "vendors": ["8086"], "devices": ["154c", "10ed"], "drivers": ["i40evf", "ixgbevf"], "pfNames": ["ens802f0", "ens801f0"] } }] } As such, it can be seen that the vendor and device ids must be read, rather than the old format which just needed the PCI root device address(es). To achieve this, the sysinv agent must read and store any SR-IOV virtual function device ids. The vendor id can be read from the existing pvendor id field of the port with the addition of the -nn flag to the lspci command. Change-Id: Id73eaa1cf8ff39643c113d4787417f3b44b1560f Depends-on: https://review.opendev.org/685498 Partial-Bug: 1835020 Signed-off-by: Steven Webster <steven.webster@windriver.com>
57 lines
1.8 KiB
Python
57 lines
1.8 KiB
Python
#
|
|
# Copyright (c) 2013-2016 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
|
# coding=utf-8
|
|
#
|
|
|
|
from sysinv.db import api as db_api
|
|
from sysinv.objects import base
|
|
from sysinv.objects import utils
|
|
|
|
|
|
class Port(base.SysinvObject):
|
|
|
|
dbapi = db_api.get_instance()
|
|
|
|
fields = {
|
|
'id': int,
|
|
'uuid': utils.str_or_none,
|
|
'host_id': utils.int_or_none,
|
|
'host_uuid': utils.str_or_none,
|
|
'node_id': utils.int_or_none,
|
|
'node_uuid': utils.str_or_none,
|
|
'interface_id': utils.int_or_none,
|
|
'interface_uuid': utils.str_or_none,
|
|
'type': utils.str_or_none,
|
|
'name': utils.str_or_none,
|
|
'namedisplay': utils.str_or_none,
|
|
'pciaddr': utils.str_or_none,
|
|
'dev_id': utils.int_or_none,
|
|
'pclass': utils.str_or_none,
|
|
'pvendor': utils.str_or_none,
|
|
'pdevice': utils.str_or_none,
|
|
'psvendor': utils.str_or_none,
|
|
'dpdksupport': utils.bool_or_none,
|
|
'psdevice': utils.str_or_none,
|
|
'numa_node': utils.int_or_none,
|
|
'sriov_totalvfs': utils.int_or_none,
|
|
'sriov_numvfs': utils.int_or_none,
|
|
'sriov_vfs_pci_address': utils.str_or_none,
|
|
'sriov_vf_driver': utils.str_or_none,
|
|
'sriov_vf_pdevice_id': utils.str_or_none,
|
|
'driver': utils.str_or_none,
|
|
'capabilities': utils.dict_or_none,
|
|
}
|
|
|
|
_foreign_fields = {'host_uuid': 'host:uuid',
|
|
'node_uuid': 'node:uuid',
|
|
'interface_uuid': 'interface:uuid'}
|
|
|
|
@base.remotable_classmethod
|
|
def get_by_uuid(cls, context, uuid):
|
|
return cls.dbapi.port_get(uuid)
|