/* * This file is part of the Chelsio T4 Ethernet driver for Linux. * * Copyright (c) 2016 Chelsio Communications, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include <linux/module.h> #include <linux/netdevice.h> #include "cxgb4.h" #include "sched.h" static int t4_sched_class_fw_cmd(struct port_info *pi, struct ch_sched_params *p, enum sched_fw_ops op) { … } static int t4_sched_bind_unbind_op(struct port_info *pi, void *arg, enum sched_bind_type type, bool bind) { … } static void *t4_sched_entry_lookup(struct port_info *pi, enum sched_bind_type type, const u32 val) { … } struct sched_class *cxgb4_sched_queue_lookup(struct net_device *dev, struct ch_sched_queue *p) { … } static int t4_sched_queue_unbind(struct port_info *pi, struct ch_sched_queue *p) { … } static int t4_sched_queue_bind(struct port_info *pi, struct ch_sched_queue *p) { … } static int t4_sched_flowc_unbind(struct port_info *pi, struct ch_sched_flowc *p) { … } static int t4_sched_flowc_bind(struct port_info *pi, struct ch_sched_flowc *p) { … } static void t4_sched_class_unbind_all(struct port_info *pi, struct sched_class *e, enum sched_bind_type type) { … } static int t4_sched_class_bind_unbind_op(struct port_info *pi, void *arg, enum sched_bind_type type, bool bind) { … } /** * cxgb4_sched_class_bind - Bind an entity to a scheduling class * @dev: net_device pointer * @arg: Entity opaque data * @type: Entity type (Queue) * * Binds an entity (queue) to a scheduling class. If the entity * is bound to another class, it will be unbound from the other class * and bound to the class specified in @arg. */ int cxgb4_sched_class_bind(struct net_device *dev, void *arg, enum sched_bind_type type) { … } /** * cxgb4_sched_class_unbind - Unbind an entity from a scheduling class * @dev: net_device pointer * @arg: Entity opaque data * @type: Entity type (Queue) * * Unbinds an entity (queue) from a scheduling class. */ int cxgb4_sched_class_unbind(struct net_device *dev, void *arg, enum sched_bind_type type) { … } /* If @p is NULL, fetch any available unused class */ static struct sched_class *t4_sched_class_lookup(struct port_info *pi, const struct ch_sched_params *p) { … } static struct sched_class *t4_sched_class_alloc(struct port_info *pi, struct ch_sched_params *p) { … } /** * cxgb4_sched_class_alloc - allocate a scheduling class * @dev: net_device pointer * @p: new scheduling class to create. * * Returns pointer to the scheduling class created. If @p is NULL, then * it allocates and returns any available unused scheduling class. If a * scheduling class with matching @p is found, then the matching class is * returned. */ struct sched_class *cxgb4_sched_class_alloc(struct net_device *dev, struct ch_sched_params *p) { … } /** * cxgb4_sched_class_free - free a scheduling class * @dev: net_device pointer * @classid: scheduling class id to free * * Frees a scheduling class if there are no users. */ void cxgb4_sched_class_free(struct net_device *dev, u8 classid) { … } static void t4_sched_class_free(struct net_device *dev, struct sched_class *e) { … } struct sched_table *t4_init_sched(unsigned int sched_size) { … } void t4_cleanup_sched(struct adapter *adap) { … }