summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/tc/tc-driver.c
blob: 16b5bae63c7490198ac07a0993603002cba8fb90 (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
 *	TURBOchannel driver services.
 *
 *	Copyright (c) 2005  James Simmons
 *	Copyright (c) 2006  Maciej W. Rozycki
 *
 *	Loosely based on drivers/dio/dio-driver.c and
 *	drivers/pci/pci-driver.c.
 *
 *	This file is subject to the terms and conditions of the GNU
 *	General Public License.  See the file "COPYING" in the main
 *	directory of this archive for more details.
 */

#include <linux/init.h>
#include <linux/module.h>
#include <linux/tc.h>

/**
 * tc_register_driver - register a new TC driver
 * @drv: the driver structure to register
 *
 * Adds the driver structure to the list of registered drivers
 * Returns a negative value on error, otherwise 0.
 * If no error occurred, the driver remains registered even if
 * no device was claimed during registration.
 */
int tc_register_driver(struct tc_driver *tdrv)
{
	return driver_register(&tdrv->driver);
}
EXPORT_SYMBOL(tc_register_driver);

/**
 * tc_unregister_driver - unregister a TC driver
 * @drv: the driver structure to unregister
 *
 * Deletes the driver structure from the list of registered TC drivers,
 * gives it a chance to clean up by calling its remove() function for
 * each device it was responsible for, and marks those devices as
 * driverless.
 */
void tc_unregister_driver(struct tc_driver *tdrv)
{
	driver_unregister(&tdrv->driver);
}
EXPORT_SYMBOL(tc_unregister_driver);

/**
 * tc_match_device - tell if a TC device structure has a matching
 *                   TC device ID structure
 * @tdrv: the TC driver to earch for matching TC device ID strings
 * @tdev: the TC device structure to match against
 *
 * Used by a driver to check whether a TC device present in the
 * system is in its list of supported devices.  Returns the matching
 * tc_device_id structure or %NULL if there is no match.
 */
const struct tc_device_id *tc_match_device(struct tc_driver *tdrv,
					   struct tc_dev *tdev)
{
	const struct tc_device_id *id = tdrv->id_table;

	if (id) {
		while (id->name[0] || id->vendor[0]) {
			if (strcmp(tdev->name, id->name) == 0 &&
			    strcmp(tdev->vendor, id->vendor) == 0)
				return id;
			id++;
		}
	}
	return NULL;
}
EXPORT_SYMBOL(tc_match_device);

/**
 * tc_bus_match - Tell if a device structure has a matching
 *                TC device ID structure
 * @dev: the device structure to match against
 * @drv: the device driver to search for matching TC device ID strings
 *
 * Used by a driver to check whether a TC device present in the
 * system is in its list of supported devices.  Returns 1 if there
 * is a match or 0 otherwise.
 */
static int tc_bus_match(struct device *dev, struct device_driver *drv)
{
	struct tc_dev *tdev = to_tc_dev(dev);
	struct tc_driver *tdrv = to_tc_driver(drv);
	const struct tc_device_id *id;

	id = tc_match_device(tdrv, tdev);
	if (id)
		return 1;

	return 0;
}

struct bus_type tc_bus_type = {
	.name	= "tc",
	.match	= tc_bus_match,
};
EXPORT_SYMBOL(tc_bus_type);

static int __init tc_driver_init(void)
{
	return bus_register(&tc_bus_type);
}

postcore_initcall(tc_driver_init);
shboard: http://130.211.154.108/grafana/dashboard/db/yardstick-main .. _NFV-TST001: https://docbox.etsi.org/ISG/NFV/Open/Drafts/TST001_-_Pre-deployment_Validation/ Abstract ======== This document compiles the release notes for the OPNFV Brahmaputra release for Yardstick framework as well as Yardstick_ Project deliverables. License ======= The *Yardstick framework*, the *Yardstick test cases* and the *ApexLake* experimental framework are opensource software, licensed under the terms of the Apache License, Version 2.0. Version History =============== +---------------+--------------------+---------------------------------+ | *Date* | *Version* | *Comment* | | | | | +---------------+--------------------+---------------------------------+ | Feb 25th,2016 | 1.0 | Brahmaputra release | | | | | +---------------+--------------------+---------------------------------+ Important Notes =============== The software delivered in the OPNFV Yardstick_ Project, comprising the *Yardstick framework*, the *Yardstick test cases* and the experimental framework *Apex Lake* is a realization of the methodology in ETSI-ISG NFV-TST001_. The *Yardstick* framework is *installer*, *infrastructure* and *application* independent. Summary ======= This Brahmaputra release provides *Yardstick* as a framework for NFVI testing and OPNFV feature testing, automated in the OPNFV CI pipeline, including: * Documentation generated with Sphinx * User Guide * Code Documentation * Release notes (this document) * Results * Automated Yardstick test suite (daily, weekly) * Jenkins Jobs for OPNFV community labs * Automated Yardstick test results visualization * Dashboard_ using Grafana (user:opnfv/password: opnfv), influxDB used as backend * Yardstick framework source code * Yardstick test cases yaml files For Brahmaputra release, the *Yardstick framework* is used for the following testing: * OPNFV platform testing - generic test cases to measure the categories: * Compute * Network * Storage * Test cases for the following OPNFV Projects: * High Availability * IPv6 * KVM * Parser The *Yardstick framework* is developed in the OPNFV community, by the Yardstick_ team. .. note:: The test case description template used for the Yardstick test cases is based on the document ETSI-ISG NFV-TST001_; the results report template used for the Yardstick results is based on the IEEE Std 829-2008. Release Data ============ +--------------------------------------+--------------------------------------+ | **Project** | Yardstick | | | | +--------------------------------------+--------------------------------------+ | **Repo/tag** | yardstick/brahmaputra.1.0 | | | | +--------------------------------------+--------------------------------------+ | **Yardstick Docker image tag** | brahmaputra.1.0 | | | | +--------------------------------------+--------------------------------------+ | **Release designation** | Brahmaputra | | | | +--------------------------------------+--------------------------------------+ | **Release date** | Feb 25th, 2016 | | | | +--------------------------------------+--------------------------------------+ | **Purpose of the delivery** | OPNFV Brahmaputra release | | | | +--------------------------------------+--------------------------------------+ Version Change -------------- Module Version Changes ~~~~~~~~~~~~~~~~~~~~~~ This is the first tracked release of Yardstick. It is based on following upstream versions: - OpenStack Liberty - OpenDaylight Beryllium Document Version Changes ~~~~~~~~~~~~~~~~~~~~~~~~ This is the first tracked version of the Yardstick framework in OPNFV. It includes the following documentation: - Yardstick User Guide - Yardstick Code Documentation - Yardstick Release Notes for Yardstick - Test Results report for Brahmaputra testing with Yardstick Reason for Version ------------------ Feature additions ~~~~~~~~~~~~~~~~~ This is the first tracked version of OPNFV Yardstick. Corrected Faults ~~~~~~~~~~~~~~~~ This is the first tracked version of OPNFV Yardstick. Known Faults ~~~~~~~~~~~~ +----------------------------+------------------------------------------------+ | **JIRA REFERENCE** | **SLOGAN** | | | | +----------------------------+------------------------------------------------+ | JIRA: YARDSTICK-175 | Running test suite, if a test cases running | | | failed, the test is stopped. | | | | +----------------------------+------------------------------------------------+ | JIRA: YARDSTICK-176 | Fix plotter bug since Output format has been | | | changed. | | | | +----------------------------+------------------------------------------------+ | JIRA: YARDSTICK-216 | ArgsAlreadyParsedError: arguments already | | | parsed: cannot register CLI option. | | | | +----------------------------+------------------------------------------------+ .. note:: The faults not related to *Yardstick* framework, addressing scenarios which were not fully verified, are listed in the OPNFV installer's release notes. Deliverables ------------ Software Deliverables ~~~~~~~~~~~~~~~~~~~~~ **Yardstick framework source code <brahmaputra.1.0>** +--------------------------------------+--------------------------------------+ | **Project** | Yardstick | | | | +--------------------------------------+--------------------------------------+ | **Repo/tag** | yardstick/brahmaputra.1.0 | | | | +--------------------------------------+--------------------------------------+ | **Yardstick Docker image tag** | brahmaputra.1.0 | | | | +--------------------------------------+--------------------------------------+ | **Release designation** | Brahmaputra | | | | +--------------------------------------+--------------------------------------+ | **Release date** | Feb 25th, 2016 | | | | +--------------------------------------+--------------------------------------+ | **Purpose of the delivery** | OPNFV Brahmaputra release | | | | +--------------------------------------+--------------------------------------+ **Contexts** +---------------------+-------------------------------------------------------+ | **Context** | **Description** | | | | +---------------------+-------------------------------------------------------+ | *Heat* | Models orchestration using OpenStack Heat | | | | +---------------------+-------------------------------------------------------+ | *Node* | Models Baremetal, Controller, Compute | | | | +---------------------+-------------------------------------------------------+ **Runners** +---------------------+-------------------------------------------------------+ | **Runner** | **Description** | | | | +---------------------+-------------------------------------------------------+ | *Arithmetic* | Steps every run arithmetically according to specified | | | input value | | | | +---------------------+-------------------------------------------------------+ | *Duration* | Runs for a specified period of time | | | | +---------------------+-------------------------------------------------------+ | *Iteration* | Runs for a specified number of iterations | | | | +---------------------+-------------------------------------------------------+ | *Sequence* | Selects input value to a scenario from an input file | | | and runs all entries sequentially | | | | +---------------------+-------------------------------------------------------+ **Scenarios** +---------------------+-------------------------------------------------------+ | **Category** | **Delivered** | | | | +---------------------+-------------------------------------------------------+ | *Availability* | Attacker: | | | | | | * baremetal, process | | | | | | HA tools: | | | | | | * check host, openstack, process, service | | | * kill process | | | * start/stop service | | | | | | Monitor: | | | | | | * command, process | | | | +---------------------+-------------------------------------------------------+ | *Compute* | * cpuload | | | | | | * cyclictest | | | | | | * lmbench | | | | | | * perf | | | | | | * unixbench | | | | +---------------------+-------------------------------------------------------+ | *Networking* | * iperf3 | | | | | | * netperf | | | | | | * ping | | | | | | * ping6 | | | | | | * pktgen | | | | | | * sfc | | | | | | * sfc with tacker | | | | | | * vtc instantion validation | | | | | | * vtc instantion validation with noisy neighbors | | | | | | * vtc throughput | | | | | | * vtc throughput in the presence of noisy neighbors | | | | +---------------------+-------------------------------------------------------+ | *Parser* | Tosca2Heat | | | | +---------------------+-------------------------------------------------------+ | *Storage* | fio | | | | +---------------------+-------------------------------------------------------+ **API to Other Frameworks** +---------------------+-------------------------------------------------------+ | **Framework** | **Description** | | | | +---------------------+-------------------------------------------------------+ | *ApexLake* | Experimental framework that enables the user to | | | validate NFVI from the perspective of a VNF. | | | A virtual Traffic Classifier is utilized as VNF. | | | Enables experiments with SR-IOV on Compute Node. | | | | +---------------------+-------------------------------------------------------+ **Test Results Output** +-----------------------------+-----------------------------------------------+ | **Dispatcher** | **Description** | | | | +-----------------------------+-----------------------------------------------+ | file | Log to a file. | | | | +-----------------------------+-----------------------------------------------+ | http | Post data to html. | | | | +-----------------------------+-----------------------------------------------+ | influxdb | Post data to influxdB. | | | | +-----------------------------+-----------------------------------------------+ Delivered Test cases ~~~~~~~~~~~~~~~~~~~~ * Generic NFVI test cases * OPNFV_YARDSTICK_TCOO1 - NW Performance * OPNFV_YARDSTICK_TCOO2 - NW Latency * OPNFV_YARDSTICK_TCOO5 - Storage Performance * OPNFV_YARDSTICK_TCOO8 - Packet Loss Extended Test * OPNFV_YARDSTICK_TCOO9 - Packet Loss * OPNFV_YARDSTICK_TCO10 - Memory Latency * OPNFV_YARDSTICK_TCO11 - Packet Delay Variation Between VMs * OPNFV_YARDSTICK_TCO12 - Memory Bandwidth * OPNFV_YARDSTICK_TCO14 - Processing Speed * OPNFV_YARDSTICK_TCO24 - CPU Load * OPNFV_YARDSTICK_TCO37 - Latency, CPU Load, Throughput, Packet Loss * OPNFV_YARDSTICK_TCO38 - Latency, CPU Load, Throughput, Packet Loss Extended Test * Test Cases for OPNFV HA Project: * OPNFV_YARDSTICK_TCO19 - HA: Control node Openstack service down * OPNFV_YARDSTICK_TC025 - HA: OpenStacK Controller Node abnormally down * Test Case for OPNFV IPv6 Project: * OPNFV_YARDSTICK_TCO27 - IPv6 connectivity * Test Case for OPNFV KVM Project: * OPNFV_YARDSTICK_TCO28 - KVM Latency measurements * Test Case for OPNFV Parser Project: * OPNFV_YARDSTICK_TCO40 - Verify Parser Yang-to-Tosca