Skip to content

Commit 542f8bb

Browse files
committed
sync to upstream 8066e388be48 ("net: add UAPI to the header guard in various network headers")
Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 83ebd6e commit 542f8bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+19384
-199
lines changed

Makefile.deps

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ CFLAGS_ethtool:=$(call get_hdr_inc,_LINUX_ETHTOOL_H,ethtool.h) \
2020
$(call get_hdr_inc,_LINUX_ETHTOOL_NETLINK_H_,ethtool_netlink.h) \
2121
$(call get_hdr_inc,_LINUX_ETHTOOL_NETLINK_GENERATED_H,ethtool_netlink_generated.h)
2222
CFLAGS_handshake:=$(call get_hdr_inc,_LINUX_HANDSHAKE_H,handshake.h)
23+
CFLAGS_lockd_netlink:=$(call get_hdr_inc,_LINUX_LOCKD_NETLINK_H,lockd_netlink.h)
2324
CFLAGS_mptcp_pm:=$(call get_hdr_inc,_LINUX_MPTCP_PM_H,mptcp_pm.h)
2425
CFLAGS_net_shaper:=$(call get_hdr_inc,_LINUX_NET_SHAPER_H,net_shaper.h)
2526
CFLAGS_netdev:=$(call get_hdr_inc,_LINUX_NETDEV_H,netdev.h)
27+
CFLAGS_nl80211:=$(call get_hdr_inc,__LINUX_NL802121_H,nl80211.h)
2628
CFLAGS_nlctrl:=$(call get_hdr_inc,__LINUX_GENERIC_NETLINK_H,genetlink.h)
2729
CFLAGS_nfsd:=$(call get_hdr_inc,_LINUX_NFSD_NETLINK_H,nfsd_netlink.h)
30+
CFLAGS_ovpn:=$(call get_hdr_inc,_LINUX_OVPN,ovpn.h)
2831
CFLAGS_ovs_datapath:=$(call get_hdr_inc,__LINUX_OPENVSWITCH_H,openvswitch.h)
2932
CFLAGS_ovs_flow:=$(call get_hdr_inc,__LINUX_OPENVSWITCH_H,openvswitch.h)
3033
CFLAGS_ovs_vport:=$(call get_hdr_inc,__LINUX_OPENVSWITCH_H,openvswitch.h)
34+
CFLAGS_rt-addr:=$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \
35+
$(call get_hdr_inc,__LINUX_IF_ADDR_H,if_addr.h)
36+
CFLAGS_rt-route:=$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h)
3137
CFLAGS_tcp_metrics:=$(call get_hdr_inc,_LINUX_TCP_METRICS_H,tcp_metrics.h)

generated/devlink-user.c

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4952,10 +4952,10 @@ int devlink_region_del(struct ynl_sock *ys, struct devlink_region_del_req *req)
49524952

49534953
/* ============== DEVLINK_CMD_REGION_READ ============== */
49544954
/* DEVLINK_CMD_REGION_READ - dump */
4955-
int devlink_region_read_rsp_dump_parse(const struct nlmsghdr *nlh,
4956-
struct ynl_parse_arg *yarg)
4955+
int devlink_region_read_rsp_parse(const struct nlmsghdr *nlh,
4956+
struct ynl_parse_arg *yarg)
49574957
{
4958-
struct devlink_region_read_rsp_dump *dst;
4958+
struct devlink_region_read_rsp *dst;
49594959
const struct nlattr *attr;
49604960

49614961
dst = yarg->data;
@@ -5007,19 +5007,17 @@ int devlink_region_read_rsp_dump_parse(const struct nlmsghdr *nlh,
50075007
return YNL_PARSE_CB_OK;
50085008
}
50095009

5010-
void
5011-
devlink_region_read_req_dump_free(struct devlink_region_read_req_dump *req)
5010+
void devlink_region_read_req_free(struct devlink_region_read_req *req)
50125011
{
50135012
free(req->bus_name);
50145013
free(req->dev_name);
50155014
free(req->region_name);
50165015
free(req);
50175016
}
50185017

5019-
void
5020-
devlink_region_read_rsp_list_free(struct devlink_region_read_rsp_list *rsp)
5018+
void devlink_region_read_list_free(struct devlink_region_read_list *rsp)
50215019
{
5022-
struct devlink_region_read_rsp_list *next = rsp;
5020+
struct devlink_region_read_list *next = rsp;
50235021

50245022
while ((void *)next != YNL_LIST_END) {
50255023
rsp = next;
@@ -5032,9 +5030,9 @@ devlink_region_read_rsp_list_free(struct devlink_region_read_rsp_list *rsp)
50325030
}
50335031
}
50345032

5035-
struct devlink_region_read_rsp_list *
5033+
struct devlink_region_read_list *
50365034
devlink_region_read_dump(struct ynl_sock *ys,
5037-
struct devlink_region_read_req_dump *req)
5035+
struct devlink_region_read_req *req)
50385036
{
50395037
struct ynl_dump_state yds = {};
50405038
struct nlmsghdr *nlh;
@@ -5043,8 +5041,8 @@ devlink_region_read_dump(struct ynl_sock *ys,
50435041
yds.yarg.ys = ys;
50445042
yds.yarg.rsp_policy = &devlink_nest;
50455043
yds.yarg.data = NULL;
5046-
yds.alloc_sz = sizeof(struct devlink_region_read_rsp_list);
5047-
yds.cb = devlink_region_read_rsp_dump_parse;
5044+
yds.alloc_sz = sizeof(struct devlink_region_read_list);
5045+
yds.cb = devlink_region_read_rsp_parse;
50485046
yds.rsp_cmd = DEVLINK_CMD_REGION_READ;
50495047

50505048
nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_REGION_READ, 1);
@@ -5074,7 +5072,7 @@ devlink_region_read_dump(struct ynl_sock *ys,
50745072
return yds.first;
50755073

50765074
free_list:
5077-
devlink_region_read_rsp_list_free(yds.first);
5075+
devlink_region_read_list_free(yds.first);
50785076
return NULL;
50795077
}
50805078

@@ -5275,6 +5273,7 @@ void devlink_info_get_rsp_free(struct devlink_info_get_rsp *rsp)
52755273
for (i = 0; i < rsp->n_info_version_stored; i++)
52765274
devlink_dl_info_version_free(&rsp->info_version_stored[i]);
52775275
free(rsp->info_version_stored);
5276+
free(rsp->info_board_serial_number);
52785277
free(rsp);
52795278
}
52805279

@@ -5352,6 +5351,17 @@ int devlink_info_get_rsp_parse(const struct nlmsghdr *nlh,
53525351
n_info_version_running++;
53535352
} else if (type == DEVLINK_ATTR_INFO_VERSION_STORED) {
53545353
n_info_version_stored++;
5354+
} else if (type == DEVLINK_ATTR_INFO_BOARD_SERIAL_NUMBER) {
5355+
unsigned int len;
5356+
5357+
if (ynl_attr_validate(yarg, attr))
5358+
return YNL_PARSE_CB_ERROR;
5359+
5360+
len = strnlen(ynl_attr_get_str(attr), ynl_attr_data_len(attr));
5361+
dst->_present.info_board_serial_number_len = len;
5362+
dst->info_board_serial_number = malloc(len + 1);
5363+
memcpy(dst->info_board_serial_number, ynl_attr_get_str(attr), len);
5364+
dst->info_board_serial_number[len] = 0;
53555365
}
53565366
}
53575367

@@ -5458,6 +5468,7 @@ void devlink_info_get_list_free(struct devlink_info_get_list *rsp)
54585468
for (i = 0; i < rsp->obj.n_info_version_stored; i++)
54595469
devlink_dl_info_version_free(&rsp->obj.info_version_stored[i]);
54605470
free(rsp->obj.info_version_stored);
5471+
free(rsp->obj.info_board_serial_number);
54615472
free(rsp);
54625473
}
54635474
}
@@ -5781,10 +5792,10 @@ int devlink_health_reporter_diagnose(struct ynl_sock *ys,
57815792

57825793
/* ============== DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET ============== */
57835794
/* DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET - dump */
5784-
int devlink_health_reporter_dump_get_rsp_dump_parse(const struct nlmsghdr *nlh,
5785-
struct ynl_parse_arg *yarg)
5795+
int devlink_health_reporter_dump_get_rsp_parse(const struct nlmsghdr *nlh,
5796+
struct ynl_parse_arg *yarg)
57865797
{
5787-
struct devlink_health_reporter_dump_get_rsp_dump *dst;
5798+
struct devlink_health_reporter_dump_get_rsp *dst;
57885799
const struct nlattr *attr;
57895800
struct ynl_parse_arg parg;
57905801

@@ -5810,7 +5821,7 @@ int devlink_health_reporter_dump_get_rsp_dump_parse(const struct nlmsghdr *nlh,
58105821
}
58115822

58125823
void
5813-
devlink_health_reporter_dump_get_req_dump_free(struct devlink_health_reporter_dump_get_req_dump *req)
5824+
devlink_health_reporter_dump_get_req_free(struct devlink_health_reporter_dump_get_req *req)
58145825
{
58155826
free(req->bus_name);
58165827
free(req->dev_name);
@@ -5819,9 +5830,9 @@ devlink_health_reporter_dump_get_req_dump_free(struct devlink_health_reporter_du
58195830
}
58205831

58215832
void
5822-
devlink_health_reporter_dump_get_rsp_list_free(struct devlink_health_reporter_dump_get_rsp_list *rsp)
5833+
devlink_health_reporter_dump_get_list_free(struct devlink_health_reporter_dump_get_list *rsp)
58235834
{
5824-
struct devlink_health_reporter_dump_get_rsp_list *next = rsp;
5835+
struct devlink_health_reporter_dump_get_list *next = rsp;
58255836

58265837
while ((void *)next != YNL_LIST_END) {
58275838
rsp = next;
@@ -5832,9 +5843,9 @@ devlink_health_reporter_dump_get_rsp_list_free(struct devlink_health_reporter_du
58325843
}
58335844
}
58345845

5835-
struct devlink_health_reporter_dump_get_rsp_list *
5846+
struct devlink_health_reporter_dump_get_list *
58365847
devlink_health_reporter_dump_get_dump(struct ynl_sock *ys,
5837-
struct devlink_health_reporter_dump_get_req_dump *req)
5848+
struct devlink_health_reporter_dump_get_req *req)
58385849
{
58395850
struct ynl_dump_state yds = {};
58405851
struct nlmsghdr *nlh;
@@ -5843,8 +5854,8 @@ devlink_health_reporter_dump_get_dump(struct ynl_sock *ys,
58435854
yds.yarg.ys = ys;
58445855
yds.yarg.rsp_policy = &devlink_nest;
58455856
yds.yarg.data = NULL;
5846-
yds.alloc_sz = sizeof(struct devlink_health_reporter_dump_get_rsp_list);
5847-
yds.cb = devlink_health_reporter_dump_get_rsp_dump_parse;
5857+
yds.alloc_sz = sizeof(struct devlink_health_reporter_dump_get_list);
5858+
yds.cb = devlink_health_reporter_dump_get_rsp_parse;
58485859
yds.rsp_cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET;
58495860

58505861
nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET, 1);
@@ -5866,7 +5877,7 @@ devlink_health_reporter_dump_get_dump(struct ynl_sock *ys,
58665877
return yds.first;
58675878

58685879
free_list:
5869-
devlink_health_reporter_dump_get_rsp_list_free(yds.first);
5880+
devlink_health_reporter_dump_get_list_free(yds.first);
58705881
return NULL;
58715882
}
58725883

generated/dpll-user.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,7 @@ int dpll_pin_set(struct ynl_sock *ys, struct dpll_pin_set_req *req)
10851085
{
10861086
struct ynl_req_state yrs = { .yarg = { .ys = ys, }, };
10871087
struct nlmsghdr *nlh;
1088+
unsigned int i;
10881089
int err;
10891090

10901091
nlh = ynl_gemsg_start_req(ys, ys->family_id, DPLL_CMD_PIN_SET, 1);
@@ -1100,9 +1101,9 @@ int dpll_pin_set(struct ynl_sock *ys, struct dpll_pin_set_req *req)
11001101
ynl_attr_put_u32(nlh, DPLL_A_PIN_PRIO, req->prio);
11011102
if (req->_present.state)
11021103
ynl_attr_put_u32(nlh, DPLL_A_PIN_STATE, req->state);
1103-
for (unsigned int i = 0; i < req->n_parent_device; i++)
1104+
for (i = 0; i < req->n_parent_device; i++)
11041105
dpll_pin_parent_device_put(nlh, DPLL_A_PIN_PARENT_DEVICE, &req->parent_device[i]);
1105-
for (unsigned int i = 0; i < req->n_parent_pin; i++)
1106+
for (i = 0; i < req->n_parent_pin; i++)
11061107
dpll_pin_parent_pin_put(nlh, DPLL_A_PIN_PARENT_PIN, &req->parent_pin[i]);
11071108
if (req->_present.phase_adjust)
11081109
ynl_attr_put_s32(nlh, DPLL_A_PIN_PHASE_ADJUST, req->phase_adjust);

generated/ethtool-user.c

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ const struct ynl_policy_attr ethtool_tsconfig_policy[ETHTOOL_A_TSCONFIG_MAX + 1]
907907
[ETHTOOL_A_TSCONFIG_HWTSTAMP_PROVIDER] = { .name = "hwtstamp-provider", .type = YNL_PT_NEST, .nest = &ethtool_ts_hwtstamp_provider_nest, },
908908
[ETHTOOL_A_TSCONFIG_TX_TYPES] = { .name = "tx-types", .type = YNL_PT_NEST, .nest = &ethtool_bitset_nest, },
909909
[ETHTOOL_A_TSCONFIG_RX_FILTERS] = { .name = "rx-filters", .type = YNL_PT_NEST, .nest = &ethtool_bitset_nest, },
910-
[ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS] = { .name = "hwtstamp-flags", .type = YNL_PT_U32, },
910+
[ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS] = { .name = "hwtstamp-flags", .type = YNL_PT_NEST, .nest = &ethtool_bitset_nest, },
911911
};
912912

913913
const struct ynl_policy_nest ethtool_tsconfig_nest = {
@@ -1530,9 +1530,10 @@ int ethtool_profile_put(struct nlmsghdr *nlh, unsigned int attr_type,
15301530
struct ethtool_profile *obj)
15311531
{
15321532
struct nlattr *nest;
1533+
unsigned int i;
15331534

15341535
nest = ynl_attr_nest_start(nlh, attr_type);
1535-
for (unsigned int i = 0; i < obj->n_irq_moderation; i++)
1536+
for (i = 0; i < obj->n_irq_moderation; i++)
15361537
ethtool_irq_moderation_put(nlh, ETHTOOL_A_PROFILE_IRQ_MODERATION, &obj->irq_moderation[i]);
15371538
ynl_attr_nest_end(nlh, nest);
15381539

@@ -1634,9 +1635,10 @@ int ethtool_bitset_bits_put(struct nlmsghdr *nlh, unsigned int attr_type,
16341635
struct ethtool_bitset_bits *obj)
16351636
{
16361637
struct nlattr *nest;
1638+
unsigned int i;
16371639

16381640
nest = ynl_attr_nest_start(nlh, attr_type);
1639-
for (unsigned int i = 0; i < obj->n_bit; i++)
1641+
for (i = 0; i < obj->n_bit; i++)
16401642
ethtool_bitset_bit_put(nlh, ETHTOOL_A_BITSET_BITS_BIT, &obj->bit[i]);
16411643
ynl_attr_nest_end(nlh, nest);
16421644

@@ -1696,9 +1698,10 @@ int ethtool_strings_put(struct nlmsghdr *nlh, unsigned int attr_type,
16961698
struct ethtool_strings *obj)
16971699
{
16981700
struct nlattr *nest;
1701+
unsigned int i;
16991702

17001703
nest = ynl_attr_nest_start(nlh, attr_type);
1701-
for (unsigned int i = 0; i < obj->n_string; i++)
1704+
for (i = 0; i < obj->n_string; i++)
17021705
ethtool_string_put(nlh, ETHTOOL_A_STRINGS_STRING, &obj->string[i]);
17031706
ynl_attr_nest_end(nlh, nest);
17041707

@@ -1842,13 +1845,14 @@ int ethtool_stringset_put(struct nlmsghdr *nlh, unsigned int attr_type,
18421845
struct ethtool_stringset_ *obj)
18431846
{
18441847
struct nlattr *nest;
1848+
unsigned int i;
18451849

18461850
nest = ynl_attr_nest_start(nlh, attr_type);
18471851
if (obj->_present.id)
18481852
ynl_attr_put_u32(nlh, ETHTOOL_A_STRINGSET_ID, obj->id);
18491853
if (obj->_present.count)
18501854
ynl_attr_put_u32(nlh, ETHTOOL_A_STRINGSET_COUNT, obj->count);
1851-
for (unsigned int i = 0; i < obj->n_strings; i++)
1855+
for (i = 0; i < obj->n_strings; i++)
18521856
ethtool_strings_put(nlh, ETHTOOL_A_STRINGSET_STRINGS, &obj->strings[i]);
18531857
ynl_attr_nest_end(nlh, nest);
18541858

@@ -1982,9 +1986,10 @@ int ethtool_stringsets_put(struct nlmsghdr *nlh, unsigned int attr_type,
19821986
struct ethtool_stringsets *obj)
19831987
{
19841988
struct nlattr *nest;
1989+
unsigned int i;
19851990

19861991
nest = ynl_attr_nest_start(nlh, attr_type);
1987-
for (unsigned int i = 0; i < obj->n_stringset; i++)
1992+
for (i = 0; i < obj->n_stringset; i++)
19881993
ethtool_stringset_put(nlh, ETHTOOL_A_STRINGSETS_STRINGSET, &obj->stringset[i]);
19891994
ynl_attr_nest_end(nlh, nest);
19901995

@@ -7270,6 +7275,7 @@ void ethtool_tsconfig_get_rsp_free(struct ethtool_tsconfig_get_rsp *rsp)
72707275
ethtool_ts_hwtstamp_provider_free(&rsp->hwtstamp_provider);
72717276
ethtool_bitset_free(&rsp->tx_types);
72727277
ethtool_bitset_free(&rsp->rx_filters);
7278+
ethtool_bitset_free(&rsp->hwtstamp_flags);
72737279
free(rsp);
72747280
}
72757281

@@ -7326,7 +7332,11 @@ int ethtool_tsconfig_get_rsp_parse(const struct nlmsghdr *nlh,
73267332
if (ynl_attr_validate(yarg, attr))
73277333
return YNL_PARSE_CB_ERROR;
73287334
dst->_present.hwtstamp_flags = 1;
7329-
dst->hwtstamp_flags = ynl_attr_get_u32(attr);
7335+
7336+
parg.rsp_policy = &ethtool_bitset_nest;
7337+
parg.data = &dst->hwtstamp_flags;
7338+
if (ethtool_bitset_parse(&parg, attr))
7339+
return YNL_PARSE_CB_ERROR;
73307340
}
73317341
}
73327342

@@ -7384,6 +7394,7 @@ void ethtool_tsconfig_get_list_free(struct ethtool_tsconfig_get_list *rsp)
73847394
ethtool_ts_hwtstamp_provider_free(&rsp->obj.hwtstamp_provider);
73857395
ethtool_bitset_free(&rsp->obj.tx_types);
73867396
ethtool_bitset_free(&rsp->obj.rx_filters);
7397+
ethtool_bitset_free(&rsp->obj.hwtstamp_flags);
73877398
free(rsp);
73887399
}
73897400
}
@@ -7428,6 +7439,7 @@ void ethtool_tsconfig_set_req_free(struct ethtool_tsconfig_set_req *req)
74287439
ethtool_ts_hwtstamp_provider_free(&req->hwtstamp_provider);
74297440
ethtool_bitset_free(&req->tx_types);
74307441
ethtool_bitset_free(&req->rx_filters);
7442+
ethtool_bitset_free(&req->hwtstamp_flags);
74317443
free(req);
74327444
}
74337445

@@ -7437,6 +7449,7 @@ void ethtool_tsconfig_set_rsp_free(struct ethtool_tsconfig_set_rsp *rsp)
74377449
ethtool_ts_hwtstamp_provider_free(&rsp->hwtstamp_provider);
74387450
ethtool_bitset_free(&rsp->tx_types);
74397451
ethtool_bitset_free(&rsp->rx_filters);
7452+
ethtool_bitset_free(&rsp->hwtstamp_flags);
74407453
free(rsp);
74417454
}
74427455

@@ -7493,7 +7506,11 @@ int ethtool_tsconfig_set_rsp_parse(const struct nlmsghdr *nlh,
74937506
if (ynl_attr_validate(yarg, attr))
74947507
return YNL_PARSE_CB_ERROR;
74957508
dst->_present.hwtstamp_flags = 1;
7496-
dst->hwtstamp_flags = ynl_attr_get_u32(attr);
7509+
7510+
parg.rsp_policy = &ethtool_bitset_nest;
7511+
parg.data = &dst->hwtstamp_flags;
7512+
if (ethtool_bitset_parse(&parg, attr))
7513+
return YNL_PARSE_CB_ERROR;
74977514
}
74987515
}
74997516

@@ -7521,7 +7538,7 @@ ethtool_tsconfig_set(struct ynl_sock *ys, struct ethtool_tsconfig_set_req *req)
75217538
if (req->_present.rx_filters)
75227539
ethtool_bitset_put(nlh, ETHTOOL_A_TSCONFIG_RX_FILTERS, &req->rx_filters);
75237540
if (req->_present.hwtstamp_flags)
7524-
ynl_attr_put_u32(nlh, ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS, req->hwtstamp_flags);
7541+
ethtool_bitset_put(nlh, ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS, &req->hwtstamp_flags);
75257542

75267543
rsp = calloc(1, sizeof(*rsp));
75277544
yrs.yarg.data = rsp;

generated/handshake-user.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ int handshake_done(struct ynl_sock *ys, struct handshake_done_req *req)
296296
{
297297
struct ynl_req_state yrs = { .yarg = { .ys = ys, }, };
298298
struct nlmsghdr *nlh;
299+
unsigned int i;
299300
int err;
300301

301302
nlh = ynl_gemsg_start_req(ys, ys->family_id, HANDSHAKE_CMD_DONE, 1);
@@ -305,7 +306,7 @@ int handshake_done(struct ynl_sock *ys, struct handshake_done_req *req)
305306
ynl_attr_put_u32(nlh, HANDSHAKE_A_DONE_STATUS, req->status);
306307
if (req->_present.sockfd)
307308
ynl_attr_put_s32(nlh, HANDSHAKE_A_DONE_SOCKFD, req->sockfd);
308-
for (unsigned int i = 0; i < req->n_remote_auth; i++)
309+
for (i = 0; i < req->n_remote_auth; i++)
309310
ynl_attr_put_u32(nlh, HANDSHAKE_A_DONE_REMOTE_AUTH, req->remote_auth[i]);
310311

311312
err = ynl_exec(ys, nlh, &yrs);

0 commit comments

Comments
 (0)