2019-05-28 17:10:04 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2008-11-21 04:52:10 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2008, Intel Corporation.
|
|
|
|
*
|
|
|
|
* Author: Lucy Liu <lucy.liu@intel.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __NET_DCBNL_H__
|
|
|
|
#define __NET_DCBNL_H__
|
|
|
|
|
2010-12-30 09:25:46 +00:00
|
|
|
#include <linux/dcbnl.h>
|
|
|
|
|
2010-12-30 09:26:31 +00:00
|
|
|
struct dcb_app_type {
|
2011-10-06 08:52:33 +00:00
|
|
|
int ifindex;
|
2010-12-30 09:26:31 +00:00
|
|
|
struct dcb_app app;
|
|
|
|
struct list_head list;
|
2011-10-06 08:52:38 +00:00
|
|
|
u8 dcbx;
|
2010-12-30 09:26:31 +00:00
|
|
|
};
|
|
|
|
|
2011-06-21 07:34:58 +00:00
|
|
|
int dcb_setapp(struct net_device *, struct dcb_app *);
|
2010-12-30 09:26:31 +00:00
|
|
|
u8 dcb_getapp(struct net_device *, struct dcb_app *);
|
2011-06-21 07:34:42 +00:00
|
|
|
int dcb_ieee_setapp(struct net_device *, struct dcb_app *);
|
2011-06-21 07:34:48 +00:00
|
|
|
int dcb_ieee_delapp(struct net_device *, struct dcb_app *);
|
2011-06-21 07:34:53 +00:00
|
|
|
u8 dcb_ieee_getapp_mask(struct net_device *, struct dcb_app *);
|
2010-12-30 09:26:31 +00:00
|
|
|
|
2018-07-27 12:26:56 +00:00
|
|
|
struct dcb_ieee_app_prio_map {
|
|
|
|
u64 map[IEEE_8021QAZ_MAX_TCS];
|
|
|
|
};
|
|
|
|
void dcb_ieee_getapp_prio_dscp_mask_map(const struct net_device *dev,
|
|
|
|
struct dcb_ieee_app_prio_map *p_map);
|
|
|
|
|
|
|
|
struct dcb_ieee_app_dscp_map {
|
|
|
|
u8 map[64];
|
|
|
|
};
|
|
|
|
void dcb_ieee_getapp_dscp_prio_mask_map(const struct net_device *dev,
|
|
|
|
struct dcb_ieee_app_dscp_map *p_map);
|
|
|
|
u8 dcb_ieee_getapp_default_prio_mask(const struct net_device *dev);
|
|
|
|
|
2011-07-05 06:16:25 +00:00
|
|
|
int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd,
|
|
|
|
u32 seq, u32 pid);
|
|
|
|
int dcbnl_cee_notify(struct net_device *dev, int event, int cmd,
|
|
|
|
u32 seq, u32 pid);
|
2011-06-21 07:34:37 +00:00
|
|
|
|
2008-11-21 04:52:10 +00:00
|
|
|
/*
|
|
|
|
* Ops struct for the netlink callbacks. Used by DCB-enabled drivers through
|
|
|
|
* the netdevice struct.
|
|
|
|
*/
|
|
|
|
struct dcbnl_rtnl_ops {
|
2010-12-30 09:25:46 +00:00
|
|
|
/* IEEE 802.1Qaz std */
|
|
|
|
int (*ieee_getets) (struct net_device *, struct ieee_ets *);
|
|
|
|
int (*ieee_setets) (struct net_device *, struct ieee_ets *);
|
2012-04-04 21:33:30 +00:00
|
|
|
int (*ieee_getmaxrate) (struct net_device *, struct ieee_maxrate *);
|
|
|
|
int (*ieee_setmaxrate) (struct net_device *, struct ieee_maxrate *);
|
2015-03-05 18:16:11 +00:00
|
|
|
int (*ieee_getqcn) (struct net_device *, struct ieee_qcn *);
|
|
|
|
int (*ieee_setqcn) (struct net_device *, struct ieee_qcn *);
|
|
|
|
int (*ieee_getqcnstats) (struct net_device *, struct ieee_qcn_stats *);
|
2010-12-30 09:25:46 +00:00
|
|
|
int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *);
|
|
|
|
int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *);
|
|
|
|
int (*ieee_getapp) (struct net_device *, struct dcb_app *);
|
|
|
|
int (*ieee_setapp) (struct net_device *, struct dcb_app *);
|
2011-06-21 07:34:48 +00:00
|
|
|
int (*ieee_delapp) (struct net_device *, struct dcb_app *);
|
2011-02-27 05:04:31 +00:00
|
|
|
int (*ieee_peer_getets) (struct net_device *, struct ieee_ets *);
|
|
|
|
int (*ieee_peer_getpfc) (struct net_device *, struct ieee_pfc *);
|
2010-12-30 09:25:46 +00:00
|
|
|
|
|
|
|
/* CEE std */
|
2008-11-21 04:52:10 +00:00
|
|
|
u8 (*getstate)(struct net_device *);
|
2008-12-22 04:09:50 +00:00
|
|
|
u8 (*setstate)(struct net_device *, u8);
|
2008-11-21 04:52:10 +00:00
|
|
|
void (*getpermhwaddr)(struct net_device *, u8 *);
|
|
|
|
void (*setpgtccfgtx)(struct net_device *, int, u8, u8, u8, u8);
|
|
|
|
void (*setpgbwgcfgtx)(struct net_device *, int, u8);
|
|
|
|
void (*setpgtccfgrx)(struct net_device *, int, u8, u8, u8, u8);
|
|
|
|
void (*setpgbwgcfgrx)(struct net_device *, int, u8);
|
|
|
|
void (*getpgtccfgtx)(struct net_device *, int, u8 *, u8 *, u8 *, u8 *);
|
|
|
|
void (*getpgbwgcfgtx)(struct net_device *, int, u8 *);
|
|
|
|
void (*getpgtccfgrx)(struct net_device *, int, u8 *, u8 *, u8 *, u8 *);
|
|
|
|
void (*getpgbwgcfgrx)(struct net_device *, int, u8 *);
|
|
|
|
void (*setpfccfg)(struct net_device *, int, u8);
|
|
|
|
void (*getpfccfg)(struct net_device *, int, u8 *);
|
|
|
|
u8 (*setall)(struct net_device *);
|
2008-11-21 05:05:08 +00:00
|
|
|
u8 (*getcap)(struct net_device *, int, u8 *);
|
2012-02-10 03:19:41 +00:00
|
|
|
int (*getnumtcs)(struct net_device *, int, u8 *);
|
|
|
|
int (*setnumtcs)(struct net_device *, int, u8);
|
2008-11-21 05:09:23 +00:00
|
|
|
u8 (*getpfcstate)(struct net_device *);
|
|
|
|
void (*setpfcstate)(struct net_device *, u8);
|
2008-11-21 05:10:23 +00:00
|
|
|
void (*getbcncfg)(struct net_device *, int, u32 *);
|
|
|
|
void (*setbcncfg)(struct net_device *, int, u32);
|
|
|
|
void (*getbcnrp)(struct net_device *, int, u8 *);
|
|
|
|
void (*setbcnrp)(struct net_device *, int, u8);
|
2014-07-17 05:32:39 +00:00
|
|
|
int (*setapp)(struct net_device *, u8, u16, u8);
|
|
|
|
int (*getapp)(struct net_device *, u8, u16);
|
2010-12-30 06:26:55 +00:00
|
|
|
u8 (*getfeatcfg)(struct net_device *, int, u8 *);
|
|
|
|
u8 (*setfeatcfg)(struct net_device *, int, u8);
|
2010-12-30 06:26:48 +00:00
|
|
|
|
|
|
|
/* DCBX configuration */
|
|
|
|
u8 (*getdcbx)(struct net_device *);
|
|
|
|
u8 (*setdcbx)(struct net_device *, u8);
|
|
|
|
|
2011-02-27 05:04:31 +00:00
|
|
|
/* peer apps */
|
|
|
|
int (*peer_getappinfo)(struct net_device *, struct dcb_peer_app_info *,
|
|
|
|
u16 *);
|
|
|
|
int (*peer_getapptable)(struct net_device *, struct dcb_app *);
|
2010-12-30 06:26:55 +00:00
|
|
|
|
2011-02-27 05:04:38 +00:00
|
|
|
/* CEE peer */
|
|
|
|
int (*cee_peer_getpg) (struct net_device *, struct cee_pg *);
|
|
|
|
int (*cee_peer_getpfc) (struct net_device *, struct cee_pfc *);
|
net/dcb: Add dcbnl buffer attribute
In this patch, we add dcbnl buffer attribute to allow user
change the NIC's buffer configuration such as priority
to buffer mapping and buffer size of individual buffer.
This attribute combined with pfc attribute allows advanced user to
fine tune the qos setting for specific priority queue. For example,
user can give dedicated buffer for one or more priorities or user
can give large buffer to certain priorities.
The dcb buffer configuration will be controlled by lldptool.
lldptool -T -i eth2 -V BUFFER prio 0,2,5,7,1,2,3,6
maps priorities 0,1,2,3,4,5,6,7 to receive buffer 0,2,5,7,1,2,3,6
lldptool -T -i eth2 -V BUFFER size 87296,87296,0,87296,0,0,0,0
sets receive buffer size for buffer 0,1,2,3,4,5,6,7 respectively
After discussion on mailing list with Jakub, Jiri, Ido and John, we agreed to
choose dcbnl over devlink interface since this feature is intended to set
port attributes which are governed by the netdev instance of that port, where
devlink API is more suitable for global ASIC configurations.
We present an use case scenario where dcbnl buffer attribute configured
by advance user helps reduce the latency of messages of different sizes.
Scenarios description:
On ConnectX-5, we run latency sensitive traffic with
small/medium message sizes ranging from 64B to 256KB and bandwidth sensitive
traffic with large messages sizes 512KB and 1MB. We group small, medium,
and large message sizes to their own pfc enables priorities as follow.
Priorities 1 & 2 (64B, 256B and 1KB)
Priorities 3 & 4 (4KB, 8KB, 16KB, 64KB, 128KB and 256KB)
Priorities 5 & 6 (512KB and 1MB)
By default, ConnectX-5 maps all pfc enabled priorities to a single
lossless fixed buffer size of 50% of total available buffer space. The
other 50% is assigned to lossy buffer. Using dcbnl buffer attribute,
we create three equal size lossless buffers. Each buffer has 25% of total
available buffer space. Thus, the lossy buffer size reduces to 25%. Priority
to lossless buffer mappings are set as follow.
Priorities 1 & 2 on lossless buffer #1
Priorities 3 & 4 on lossless buffer #2
Priorities 5 & 6 on lossless buffer #3
We observe improvements in latency for small and medium message sizes
as follows. Please note that the large message sizes bandwidth performance is
reduced but the total bandwidth remains the same.
256B message size (42 % latency reduction)
4K message size (21% latency reduction)
64K message size (16% latency reduction)
CC: Ido Schimmel <idosch@idosch.org>
CC: Jakub Kicinski <jakub.kicinski@netronome.com>
CC: Jiri Pirko <jiri@resnulli.us>
CC: Or Gerlitz <gerlitz.or@gmail.com>
CC: Parav Pandit <parav@mellanox.com>
CC: Aron Silverton <aron.silverton@oracle.com>
Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2018-02-22 17:57:10 +00:00
|
|
|
|
|
|
|
/* buffer settings */
|
|
|
|
int (*dcbnl_getbuffer)(struct net_device *, struct dcbnl_buffer *);
|
|
|
|
int (*dcbnl_setbuffer)(struct net_device *, struct dcbnl_buffer *);
|
2008-11-21 04:52:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __NET_DCBNL_H__ */
|