同步操作将从 openEuler/opensource-intern 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The dcb module implements support for Data Center Bridging (DCB), which is a set of Ethernet enhancements that allow different types of network traffic with varying requirements (such as high reliability, no packet loss, and low latency) to coexist on the same Ethernet link. The main features of DCB include:
### dcbevent.c
Function Description The dcbevent.c file contains functions for managing event notifications related to DCB, allowing other kernel components to be notified of changes or events.
int register_dcbevent_notifier(struct notifier_block *nb)
{
return atomic_notifier_chain_register(&dcbevent_notif_chain, nb);
}
int unregister_dcbevent_notifier(struct notifier_block *nb)
{
return atomic_notifier_chain_unregister(&dcbevent_notif_chain, nb);
}
int call_dcbevent_notifiers(unsigned long val, void *v)
{
return atomic_notifier_call_chain(&dcbevent_notif_chain, val, v);
}
Open Capabilities - Custom Notifier Registration: Developers can create their own notifier_block structures and use register_dcbevent_notifier to receive notifications about DCB-related events. - Event Handling: By implementing the notifier_call function within the notifier_block, developers can define custom behavior in response to DCB events.
### dcbnl.c
Function Description The dcbnl.c file provides the rtnetlink interface for configuring DCB features, including setting and getting parameters for ETS, PFC, and application priorities.
static int dcbnl_getstate(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{
if (!netdev->dcbnl_ops->getstate)
return -EOPNOTSUPP;
return nla_put_u8(skb, DCB_ATTR_STATE, netdev->dcbnl_ops->getstate(netdev));
}
static int dcbnl_getpfccfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{
struct nlattr *data[DCB_PFC_UP_ATTR_MAX + 1], *nest;
u8 value;
int ret;
int i;
int getall = 0;
if (!tb[DCB_ATTR_PFC_CFG])
return -EINVAL;
if (!netdev->dcbnl_ops->getpfccfg)
return -EOPNOTSUPP;
ret = nla_parse_nested_deprecated(data, DCB_PFC_UP_ATTR_MAX,
tb[DCB_ATTR_PFC_CFG],
dcbnl_pfc_up_nest, NULL);
if (ret)
return ret;
nest = nla_nest_start_noflag(skb, DCB_ATTR_PFC_CFG);
if (!nest)
return -EMSGSIZE;
if (data[DCB_PFC_UP_ATTR_ALL])
getall = 1;
for (i = DCB_PFC_UP_ATTR_0; i <= DCB_PFC_UP_ATTR_7; i++) {
if (!getall && !data[i])
continue;
netdev->dcbnl_ops->getpfccfg(netdev, i - DCB_PFC_UP_ATTR_0, &value);
ret = nla_put_u8(skb, i, value);
if (ret)
//Part of the source code is omitted here
}
Open Capabilities - Configuration Access: Developers can access and modify the DCB configuration of network devices through the provided rtnetlink operations. - Custom Feature Support: By extending the dcbnl_ops structure, developers can add support for additional DCB features or customize existing ones.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。