Blame pqos/alloc.h

Packit bcb633
/*
Packit bcb633
 * BSD LICENSE
Packit bcb633
 *
Packit bcb633
 * Copyright(c) 2014-2017 Intel Corporation. All rights reserved.
Packit bcb633
 * All rights reserved.
Packit bcb633
 *
Packit bcb633
 * Redistribution and use in source and binary forms, with or without
Packit bcb633
 * modification, are permitted provided that the following conditions
Packit bcb633
 * are met:
Packit bcb633
 *
Packit bcb633
 *   * Redistributions of source code must retain the above copyright
Packit bcb633
 *     notice, this list of conditions and the following disclaimer.
Packit bcb633
 *   * Redistributions in binary form must reproduce the above copyright
Packit bcb633
 *     notice, this list of conditions and the following disclaimer in
Packit bcb633
 *     the documentation and/or other materials provided with the
Packit bcb633
 *     distribution.
Packit bcb633
 *   * Neither the name of Intel Corporation nor the names of its
Packit bcb633
 *     contributors may be used to endorse or promote products derived
Packit bcb633
 *     from this software without specific prior written permission.
Packit bcb633
 *
Packit bcb633
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Packit bcb633
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Packit bcb633
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Packit bcb633
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
Packit bcb633
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Packit bcb633
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Packit bcb633
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Packit bcb633
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Packit bcb633
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Packit bcb633
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit bcb633
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit bcb633
 */
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * Allocation module
Packit bcb633
 */
Packit bcb633
Packit bcb633
#include <stdint.h>
Packit bcb633
#include <stdio.h>
Packit bcb633
#include "pqos.h"
Packit bcb633
Packit bcb633
#ifndef __ALLOCATION_H__
Packit bcb633
#define __ALLOCATION_H__
Packit bcb633
Packit bcb633
#ifdef __cplusplus
Packit bcb633
extern "C" {
Packit bcb633
#endif
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Defines allocation class of service
Packit bcb633
 *
Packit bcb633
 * @param [in] arg string passed to -e command line option
Packit bcb633
 */
Packit bcb633
void selfn_allocation_class(const char *arg);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Associates cores with selected class of service
Packit bcb633
 *
Packit bcb633
 * @param [in] arg string passed to -a command line option
Packit bcb633
 */
Packit bcb633
void selfn_allocation_assoc(const char *arg);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Prints information about cache allocation settings in the system
Packit bcb633
 *
Packit bcb633
 * @param [in] cap_mon monitoring capability structure
Packit bcb633
 * @param [in] cap_l3ca L3 CAT capability structures
Packit bcb633
 * @param [in] cap_l2ca L2 CAT capability structures
Packit bcb633
 * @param [in] cap_mba MBA capability structures
Packit bcb633
 * @param [in] sock_count number of detected CPU sockets
Packit bcb633
 * @param [in] sockets arrays with detected CPU socket id's
Packit bcb633
 * @param [in] cpu_info cpu information structure
Packit bcb633
 * @param [in] verbose verbose mode flag
Packit bcb633
 */
Packit bcb633
void alloc_print_config(const struct pqos_capability *cap_mon,
Packit bcb633
                        const struct pqos_capability *cap_l3ca,
Packit bcb633
                        const struct pqos_capability *cap_l2ca,
Packit bcb633
                        const struct pqos_capability *cap_mba,
Packit bcb633
                        const unsigned sock_count,
Packit bcb633
                        const unsigned *sockets,
Packit bcb633
                        const struct pqos_cpuinfo *cpu_info,
Packit bcb633
                        const int verbose);
Packit bcb633
Packit bcb633
/**
Packit bcb633
 * @brief Applies allocation settings previously selected via
Packit bcb633
 *        selfn_xxxx() functions
Packit bcb633
 *
Packit bcb633
 * @param [in] cap_l3ca CAT capability structures
Packit bcb633
 * @param [in] cap_l2ca CAT capability structures
Packit bcb633
 * @param [in] cap_mba MBA capability structures
Packit bcb633
 * @param [in] cpu cpu information structure
Packit bcb633
 *
Packit bcb633
 * @return Operation status
Packit bcb633
 * @retval 0 there was no new config to apply
Packit bcb633
 * @retavl 1 there was new config to apply and it went smoothly
Packit bcb633
 * @retval -1 an error occurred when applying new config
Packit bcb633
 */
Packit bcb633
int alloc_apply(const struct pqos_capability *cap_l3ca,
Packit bcb633
                const struct pqos_capability *cap_l2ca,
Packit bcb633
                const struct pqos_capability *cap_mba,
Packit bcb633
                const struct pqos_cpuinfo *cpu);
Packit bcb633
Packit bcb633
Packit bcb633
#ifdef __cplusplus
Packit bcb633
}
Packit bcb633
#endif
Packit bcb633
Packit bcb633
#endif /* __ALLOCATION_H__ */