2019-11-07 21:29:06 +05:30
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/* Copyright (C) 2019 Chelsio Communications. All rights reserved. */
|
|
|
|
|
|
|
|
#ifndef __CXGB4_TC_MQPRIO_H__
|
|
|
|
#define __CXGB4_TC_MQPRIO_H__
|
|
|
|
|
2023-02-04 15:52:57 +02:00
|
|
|
#include <net/pkt_sched.h>
|
2019-11-07 21:29:06 +05:30
|
|
|
|
|
|
|
#define CXGB4_EOSW_TXQ_DEFAULT_DESC_NUM 128
|
|
|
|
|
2019-11-07 21:29:07 +05:30
|
|
|
#define CXGB4_EOHW_TXQ_DEFAULT_DESC_NUM 1024
|
|
|
|
|
|
|
|
#define CXGB4_EOHW_RXQ_DEFAULT_DESC_NUM 1024
|
|
|
|
#define CXGB4_EOHW_RXQ_DEFAULT_DESC_SIZE 64
|
|
|
|
#define CXGB4_EOHW_RXQ_DEFAULT_INTR_USEC 5
|
|
|
|
#define CXGB4_EOHW_RXQ_DEFAULT_PKT_CNT 8
|
|
|
|
|
|
|
|
#define CXGB4_EOHW_FLQ_DEFAULT_DESC_NUM 72
|
|
|
|
|
cxgb4: add FLOWC based QoS offload
Rework SCHED API to allow offloading TC-MQPRIO QoS configuration.
The existing QUEUE based rate limiting throttles all queues sharing
a traffic class, to the specified max rate limit value. So, if
multiple queues share a traffic class, then all the queues get
the aggregate specified max rate limit.
So, introduce the new FLOWC based rate limiting, where multiple
queues can share a traffic class with each queue getting its own
individual specified max rate limit.
For example, if 2 queues are bound to class 0, which is rate limited
to 1 Gbps, then 2 queues using QUEUE based rate limiting, get the
aggregate output of 1 Gbps only. In FLOWC based rate limiting, each
queue gets its own output of max 1 Gbps each; i.e. 2 queues * 1 Gbps
rate limit = 2 Gbps.
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-11-07 21:29:09 +05:30
|
|
|
#define CXGB4_FLOWC_WAIT_TIMEOUT (5 * HZ)
|
|
|
|
|
2019-11-07 21:29:06 +05:30
|
|
|
enum cxgb4_mqprio_state {
|
|
|
|
CXGB4_MQPRIO_STATE_DISABLED = 0,
|
|
|
|
CXGB4_MQPRIO_STATE_ACTIVE,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct cxgb4_tc_port_mqprio {
|
|
|
|
enum cxgb4_mqprio_state state; /* Current MQPRIO offload state */
|
|
|
|
struct tc_mqprio_qopt_offload mqprio; /* MQPRIO offload params */
|
|
|
|
struct sge_eosw_txq *eosw_txq; /* Netdev SW Tx queue array */
|
cxgb4: add FLOWC based QoS offload
Rework SCHED API to allow offloading TC-MQPRIO QoS configuration.
The existing QUEUE based rate limiting throttles all queues sharing
a traffic class, to the specified max rate limit value. So, if
multiple queues share a traffic class, then all the queues get
the aggregate specified max rate limit.
So, introduce the new FLOWC based rate limiting, where multiple
queues can share a traffic class with each queue getting its own
individual specified max rate limit.
For example, if 2 queues are bound to class 0, which is rate limited
to 1 Gbps, then 2 queues using QUEUE based rate limiting, get the
aggregate output of 1 Gbps only. In FLOWC based rate limiting, each
queue gets its own output of max 1 Gbps each; i.e. 2 queues * 1 Gbps
rate limit = 2 Gbps.
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-11-07 21:29:09 +05:30
|
|
|
u8 tc_hwtc_map[TC_QOPT_MAX_QUEUE]; /* MQPRIO tc to hardware tc map */
|
2019-11-07 21:29:06 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
struct cxgb4_tc_mqprio {
|
2019-11-07 21:29:07 +05:30
|
|
|
refcount_t refcnt; /* Refcount for adapter-wide resources */
|
2020-05-15 22:41:05 +05:30
|
|
|
struct mutex mqprio_mutex; /* Lock for accessing MQPRIO info */
|
2019-11-07 21:29:06 +05:30
|
|
|
struct cxgb4_tc_port_mqprio *port_mqprio; /* Per port MQPRIO info */
|
|
|
|
};
|
|
|
|
|
|
|
|
int cxgb4_setup_tc_mqprio(struct net_device *dev,
|
|
|
|
struct tc_mqprio_qopt_offload *mqprio);
|
2020-04-01 01:17:01 +05:30
|
|
|
void cxgb4_mqprio_stop_offload(struct adapter *adap);
|
2019-11-07 21:29:06 +05:30
|
|
|
int cxgb4_init_tc_mqprio(struct adapter *adap);
|
|
|
|
void cxgb4_cleanup_tc_mqprio(struct adapter *adap);
|
|
|
|
#endif /* __CXGB4_TC_MQPRIO_H__ */
|