Skip to content

Commit 4b04836

Browse files
committed
sync to upstream cf6d9fe09185 (tc: fix typo probabilty in tc.yaml doc, 2024-11-08)
Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 034218a commit 4b04836

File tree

9 files changed

+459
-15
lines changed

9 files changed

+459
-15
lines changed

generated/dpll-user.c

+19
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,24 @@ const char *dpll_lock_status_error_str(enum dpll_lock_status_error value)
7474
return dpll_lock_status_error_strmap[value];
7575
}
7676

77+
static const char * const dpll_clock_quality_level_strmap[] = {
78+
[1] = "itu-opt1-prc",
79+
[2] = "itu-opt1-ssu-a",
80+
[3] = "itu-opt1-ssu-b",
81+
[4] = "itu-opt1-eec1",
82+
[5] = "itu-opt1-prtc",
83+
[6] = "itu-opt1-eprtc",
84+
[7] = "itu-opt1-eeec",
85+
[8] = "itu-opt1-eprc",
86+
};
87+
88+
const char *dpll_clock_quality_level_str(enum dpll_clock_quality_level value)
89+
{
90+
if (value < 0 || value >= (int)YNL_ARRAY_SIZE(dpll_clock_quality_level_strmap))
91+
return NULL;
92+
return dpll_clock_quality_level_strmap[value];
93+
}
94+
7795
static const char * const dpll_type_strmap[] = {
7896
[1] = "pps",
7997
[2] = "eec",
@@ -185,6 +203,7 @@ const struct ynl_policy_attr dpll_policy[DPLL_A_MAX + 1] = {
185203
[DPLL_A_TEMP] = { .name = "temp", .type = YNL_PT_U32, },
186204
[DPLL_A_TYPE] = { .name = "type", .type = YNL_PT_U32, },
187205
[DPLL_A_LOCK_STATUS_ERROR] = { .name = "lock-status-error", .type = YNL_PT_U32, },
206+
[DPLL_A_CLOCK_QUALITY_LEVEL] = { .name = "clock-quality-level", .type = YNL_PT_U32, },
188207
};
189208

190209
const struct ynl_policy_nest dpll_nest = {

generated/ethtool-user.c

+46
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ static const char * const ethtool_op_strmap[] = {
6060
[43] = "mm-ntf",
6161
[44] = "module-fw-flash-ntf",
6262
[ETHTOOL_MSG_PHY_GET] = "phy-get",
63+
[46] = "phy-ntf",
6364
};
6465

6566
const char *ethtool_op_str(int op)
@@ -341,6 +342,8 @@ const struct ynl_policy_attr ethtool_bitset_policy[ETHTOOL_A_BITSET_MAX + 1] = {
341342
[ETHTOOL_A_BITSET_NOMASK] = { .name = "nomask", .type = YNL_PT_FLAG, },
342343
[ETHTOOL_A_BITSET_SIZE] = { .name = "size", .type = YNL_PT_U32, },
343344
[ETHTOOL_A_BITSET_BITS] = { .name = "bits", .type = YNL_PT_NEST, .nest = &ethtool_bitset_bits_nest, },
345+
[ETHTOOL_A_BITSET_VALUE] = { .name = "value", .type = YNL_PT_BINARY,},
346+
[ETHTOOL_A_BITSET_MASK] = { .name = "mask", .type = YNL_PT_BINARY,},
344347
};
345348

346349
const struct ynl_policy_nest ethtool_bitset_nest = {
@@ -1598,6 +1601,8 @@ int ethtool_strings_parse(struct ynl_parse_arg *yarg,
15981601
void ethtool_bitset_free(struct ethtool_bitset *obj)
15991602
{
16001603
ethtool_bitset_bits_free(&obj->bits);
1604+
free(obj->value);
1605+
free(obj->mask);
16011606
}
16021607

16031608
int ethtool_bitset_put(struct nlmsghdr *nlh, unsigned int attr_type,
@@ -1612,6 +1617,10 @@ int ethtool_bitset_put(struct nlmsghdr *nlh, unsigned int attr_type,
16121617
ynl_attr_put_u32(nlh, ETHTOOL_A_BITSET_SIZE, obj->size);
16131618
if (obj->_present.bits)
16141619
ethtool_bitset_bits_put(nlh, ETHTOOL_A_BITSET_BITS, &obj->bits);
1620+
if (obj->_present.value_len)
1621+
ynl_attr_put(nlh, ETHTOOL_A_BITSET_VALUE, obj->value, obj->_present.value_len);
1622+
if (obj->_present.mask_len)
1623+
ynl_attr_put(nlh, ETHTOOL_A_BITSET_MASK, obj->mask, obj->_present.mask_len);
16151624
ynl_attr_nest_end(nlh, nest);
16161625

16171626
return 0;
@@ -1647,6 +1656,26 @@ int ethtool_bitset_parse(struct ynl_parse_arg *yarg,
16471656
parg.data = &dst->bits;
16481657
if (ethtool_bitset_bits_parse(&parg, attr))
16491658
return YNL_PARSE_CB_ERROR;
1659+
} else if (type == ETHTOOL_A_BITSET_VALUE) {
1660+
unsigned int len;
1661+
1662+
if (ynl_attr_validate(yarg, attr))
1663+
return YNL_PARSE_CB_ERROR;
1664+
1665+
len = ynl_attr_data_len(attr);
1666+
dst->_present.value_len = len;
1667+
dst->value = malloc(len);
1668+
memcpy(dst->value, ynl_attr_data(attr), len);
1669+
} else if (type == ETHTOOL_A_BITSET_MASK) {
1670+
unsigned int len;
1671+
1672+
if (ynl_attr_validate(yarg, attr))
1673+
return YNL_PARSE_CB_ERROR;
1674+
1675+
len = ynl_attr_data_len(attr);
1676+
dst->_present.mask_len = len;
1677+
dst->mask = malloc(len);
1678+
memcpy(dst->mask, ynl_attr_data(attr), len);
16501679
}
16511680
}
16521681

@@ -7038,6 +7067,17 @@ ethtool_phy_get_dump(struct ynl_sock *ys, struct ethtool_phy_get_req_dump *req)
70387067
return NULL;
70397068
}
70407069

7070+
/* ETHTOOL_MSG_PHY_GET - notify */
7071+
void ethtool_phy_get_ntf_free(struct ethtool_phy_get_ntf *rsp)
7072+
{
7073+
ethtool_header_free(&rsp->obj.header);
7074+
free(rsp->obj.drvname);
7075+
free(rsp->obj.name);
7076+
free(rsp->obj.upstream_sfp_name);
7077+
free(rsp->obj.downstream_sfp_name);
7078+
free(rsp);
7079+
}
7080+
70417081
/* ETHTOOL_MSG_CABLE_TEST_NTF - event */
70427082
int ethtool_cable_test_ntf_rsp_parse(const struct nlmsghdr *nlh,
70437083
struct ynl_parse_arg *yarg)
@@ -7299,6 +7339,12 @@ static const struct ynl_ntf_info ethtool_ntf_info[] = {
72997339
.policy = &ethtool_module_fw_flash_nest,
73007340
.free = (void *)ethtool_module_fw_flash_ntf_free,
73017341
},
7342+
[ETHTOOL_MSG_PHY_NTF] = {
7343+
.alloc_sz = sizeof(struct ethtool_phy_get_ntf),
7344+
.cb = ethtool_phy_get_rsp_parse,
7345+
.policy = &ethtool_phy_nest,
7346+
.free = (void *)ethtool_phy_get_ntf_free,
7347+
},
73027348
};
73037349

73047350
const struct ynl_family ynl_ethtool_family = {

generated/netdev-user.c

+43
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ static const char * const netdev_op_strmap[] = {
2626
[NETDEV_CMD_NAPI_GET] = "napi-get",
2727
[NETDEV_CMD_QSTATS_GET] = "qstats-get",
2828
[NETDEV_CMD_BIND_RX] = "bind-rx",
29+
[NETDEV_CMD_NAPI_SET] = "napi-set",
2930
};
3031

3132
const char *netdev_op_str(int op)
@@ -192,6 +193,8 @@ const struct ynl_policy_attr netdev_napi_policy[NETDEV_A_NAPI_MAX + 1] = {
192193
[NETDEV_A_NAPI_ID] = { .name = "id", .type = YNL_PT_U32, },
193194
[NETDEV_A_NAPI_IRQ] = { .name = "irq", .type = YNL_PT_U32, },
194195
[NETDEV_A_NAPI_PID] = { .name = "pid", .type = YNL_PT_U32, },
196+
[NETDEV_A_NAPI_DEFER_HARD_IRQS] = { .name = "defer-hard-irqs", .type = YNL_PT_U32, },
197+
[NETDEV_A_NAPI_GRO_FLUSH_TIMEOUT] = { .name = "gro-flush-timeout", .type = YNL_PT_UINT, },
195198
};
196199

197200
const struct ynl_policy_nest netdev_napi_nest = {
@@ -940,6 +943,16 @@ int netdev_napi_get_rsp_parse(const struct nlmsghdr *nlh,
940943
return YNL_PARSE_CB_ERROR;
941944
dst->_present.pid = 1;
942945
dst->pid = ynl_attr_get_u32(attr);
946+
} else if (type == NETDEV_A_NAPI_DEFER_HARD_IRQS) {
947+
if (ynl_attr_validate(yarg, attr))
948+
return YNL_PARSE_CB_ERROR;
949+
dst->_present.defer_hard_irqs = 1;
950+
dst->defer_hard_irqs = ynl_attr_get_u32(attr);
951+
} else if (type == NETDEV_A_NAPI_GRO_FLUSH_TIMEOUT) {
952+
if (ynl_attr_validate(yarg, attr))
953+
return YNL_PARSE_CB_ERROR;
954+
dst->_present.gro_flush_timeout = 1;
955+
dst->gro_flush_timeout = ynl_attr_get_uint(attr);
943956
}
944957
}
945958

@@ -1205,6 +1218,36 @@ netdev_bind_rx(struct ynl_sock *ys, struct netdev_bind_rx_req *req)
12051218
return NULL;
12061219
}
12071220

1221+
/* ============== NETDEV_CMD_NAPI_SET ============== */
1222+
/* NETDEV_CMD_NAPI_SET - do */
1223+
void netdev_napi_set_req_free(struct netdev_napi_set_req *req)
1224+
{
1225+
free(req);
1226+
}
1227+
1228+
int netdev_napi_set(struct ynl_sock *ys, struct netdev_napi_set_req *req)
1229+
{
1230+
struct ynl_req_state yrs = { .yarg = { .ys = ys, }, };
1231+
struct nlmsghdr *nlh;
1232+
int err;
1233+
1234+
nlh = ynl_gemsg_start_req(ys, ys->family_id, NETDEV_CMD_NAPI_SET, 1);
1235+
ys->req_policy = &netdev_napi_nest;
1236+
1237+
if (req->_present.id)
1238+
ynl_attr_put_u32(nlh, NETDEV_A_NAPI_ID, req->id);
1239+
if (req->_present.defer_hard_irqs)
1240+
ynl_attr_put_u32(nlh, NETDEV_A_NAPI_DEFER_HARD_IRQS, req->defer_hard_irqs);
1241+
if (req->_present.gro_flush_timeout)
1242+
ynl_attr_put_uint(nlh, NETDEV_A_NAPI_GRO_FLUSH_TIMEOUT, req->gro_flush_timeout);
1243+
1244+
err = ynl_exec(ys, nlh, &yrs);
1245+
if (err < 0)
1246+
return -1;
1247+
1248+
return 0;
1249+
}
1250+
12081251
static const struct ynl_ntf_info netdev_ntf_info[] = {
12091252
[NETDEV_CMD_DEV_ADD_NTF] = {
12101253
.alloc_sz = sizeof(struct netdev_dev_get_ntf),

include/linux/dpll.h

+24
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,29 @@ enum dpll_lock_status_error {
7979
DPLL_LOCK_STATUS_ERROR_MAX = (__DPLL_LOCK_STATUS_ERROR_MAX - 1)
8080
};
8181

82+
/*
83+
* level of quality of a clock device. This mainly applies when the dpll
84+
* lock-status is DPLL_LOCK_STATUS_HOLDOVER. The current list is defined
85+
* according to the table 11-7 contained in ITU-T G.8264/Y.1364 document. One
86+
* may extend this list freely by other ITU-T defined clock qualities, or
87+
* different ones defined by another standardization body (for those, please
88+
* use different prefix).
89+
*/
90+
enum dpll_clock_quality_level {
91+
DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_PRC = 1,
92+
DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_SSU_A,
93+
DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_SSU_B,
94+
DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EEC1,
95+
DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_PRTC,
96+
DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EPRTC,
97+
DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EEEC,
98+
DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EPRC,
99+
100+
/* private: */
101+
__DPLL_CLOCK_QUALITY_LEVEL_MAX,
102+
DPLL_CLOCK_QUALITY_LEVEL_MAX = (__DPLL_CLOCK_QUALITY_LEVEL_MAX - 1)
103+
};
104+
82105
#define DPLL_TEMP_DIVIDER 1000
83106

84107
/**
@@ -180,6 +203,7 @@ enum dpll_a {
180203
DPLL_A_TEMP,
181204
DPLL_A_TYPE,
182205
DPLL_A_LOCK_STATUS_ERROR,
206+
DPLL_A_CLOCK_QUALITY_LEVEL,
183207

184208
__DPLL_A_MAX,
185209
DPLL_A_MAX = (__DPLL_A_MAX - 1)

include/linux/ethtool.h

+18-15
Original file line numberDiff line numberDiff line change
@@ -2511,21 +2511,24 @@ enum ethtool_reset_flags {
25112511
* autonegotiation; 0 if unknown or not applicable. Read-only.
25122512
*/
25132513
struct ethtool_link_settings {
2514-
__u32 cmd;
2515-
__u32 speed;
2516-
__u8 duplex;
2517-
__u8 port;
2518-
__u8 phy_address;
2519-
__u8 autoneg;
2520-
__u8 mdio_support;
2521-
__u8 eth_tp_mdix;
2522-
__u8 eth_tp_mdix_ctrl;
2523-
__s8 link_mode_masks_nwords;
2524-
__u8 transceiver;
2525-
__u8 master_slave_cfg;
2526-
__u8 master_slave_state;
2527-
__u8 rate_matching;
2528-
__u32 reserved[7];
2514+
/* New members MUST be added within the __struct_group() macro below. */
2515+
__struct_group(ethtool_link_settings_hdr, hdr, /* no attrs */,
2516+
__u32 cmd;
2517+
__u32 speed;
2518+
__u8 duplex;
2519+
__u8 port;
2520+
__u8 phy_address;
2521+
__u8 autoneg;
2522+
__u8 mdio_support;
2523+
__u8 eth_tp_mdix;
2524+
__u8 eth_tp_mdix_ctrl;
2525+
__s8 link_mode_masks_nwords;
2526+
__u8 transceiver;
2527+
__u8 master_slave_cfg;
2528+
__u8 master_slave_state;
2529+
__u8 rate_matching;
2530+
__u32 reserved[7];
2531+
);
25292532
__u32 link_mode_masks[];
25302533
/* layout of link_mode_masks fields:
25312534
* __u32 map_supported[link_mode_masks_nwords];

include/linux/netdev.h

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ enum {
122122
NETDEV_A_NAPI_ID,
123123
NETDEV_A_NAPI_IRQ,
124124
NETDEV_A_NAPI_PID,
125+
NETDEV_A_NAPI_DEFER_HARD_IRQS,
126+
NETDEV_A_NAPI_GRO_FLUSH_TIMEOUT,
125127

126128
__NETDEV_A_NAPI_MAX,
127129
NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1)
@@ -199,6 +201,7 @@ enum {
199201
NETDEV_CMD_NAPI_GET,
200202
NETDEV_CMD_QSTATS_GET,
201203
NETDEV_CMD_BIND_RX,
204+
NETDEV_CMD_NAPI_SET,
202205

203206
__NETDEV_CMD_MAX,
204207
NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1)

include/ynl-c/dpll.h

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const char *dpll_op_str(int op);
2020
const char *dpll_mode_str(enum dpll_mode value);
2121
const char *dpll_lock_status_str(enum dpll_lock_status value);
2222
const char *dpll_lock_status_error_str(enum dpll_lock_status_error value);
23+
const char *dpll_clock_quality_level_str(enum dpll_clock_quality_level value);
2324
const char *dpll_type_str(enum dpll_type value);
2425
const char *dpll_pin_type_str(enum dpll_pin_type value);
2526
const char *dpll_pin_direction_str(enum dpll_pin_direction value);

0 commit comments

Comments
 (0)