summaryrefslogtreecommitdiffstats
path: root/net/dcb
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-04-12 08:34:07 -0400
committerDavid S. Miller <davem@davemloft.net>2017-04-13 13:58:22 -0400
commitfceb6435e85298f747fee938415057af837f5a8a (patch)
tree45bceaf19df703caa5e7ea839f7b35a7f9ebc332 /net/dcb
parentba0dc5f6e0ba5a5d2f575bcdb35e5d1960cf7c04 (diff)
netlink: pass extended ACK struct to parsing functions
Pass the new extended ACK reporting struct to all of the generic netlink parsing functions. For now, pass NULL in almost all callers (except for some in the core.) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dcb')
-rw-r--r--net/dcb/dcbnl.c57
1 files changed, 27 insertions, 30 deletions
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 3202d75329b5..3f5a5f710576 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -245,8 +245,7 @@ static int dcbnl_getpfccfg(struct net_device *netdev, struct nlmsghdr *nlh,
245 return -EOPNOTSUPP; 245 return -EOPNOTSUPP;
246 246
247 ret = nla_parse_nested(data, DCB_PFC_UP_ATTR_MAX, 247 ret = nla_parse_nested(data, DCB_PFC_UP_ATTR_MAX,
248 tb[DCB_ATTR_PFC_CFG], 248 tb[DCB_ATTR_PFC_CFG], dcbnl_pfc_up_nest, NULL);
249 dcbnl_pfc_up_nest);
250 if (ret) 249 if (ret)
251 return ret; 250 return ret;
252 251
@@ -304,7 +303,7 @@ static int dcbnl_getcap(struct net_device *netdev, struct nlmsghdr *nlh,
304 return -EOPNOTSUPP; 303 return -EOPNOTSUPP;
305 304
306 ret = nla_parse_nested(data, DCB_CAP_ATTR_MAX, tb[DCB_ATTR_CAP], 305 ret = nla_parse_nested(data, DCB_CAP_ATTR_MAX, tb[DCB_ATTR_CAP],
307 dcbnl_cap_nest); 306 dcbnl_cap_nest, NULL);
308 if (ret) 307 if (ret)
309 return ret; 308 return ret;
310 309
@@ -348,7 +347,7 @@ static int dcbnl_getnumtcs(struct net_device *netdev, struct nlmsghdr *nlh,
348 return -EOPNOTSUPP; 347 return -EOPNOTSUPP;
349 348
350 ret = nla_parse_nested(data, DCB_NUMTCS_ATTR_MAX, tb[DCB_ATTR_NUMTCS], 349 ret = nla_parse_nested(data, DCB_NUMTCS_ATTR_MAX, tb[DCB_ATTR_NUMTCS],
351 dcbnl_numtcs_nest); 350 dcbnl_numtcs_nest, NULL);
352 if (ret) 351 if (ret)
353 return ret; 352 return ret;
354 353
@@ -393,7 +392,7 @@ static int dcbnl_setnumtcs(struct net_device *netdev, struct nlmsghdr *nlh,
393 return -EOPNOTSUPP; 392 return -EOPNOTSUPP;
394 393
395 ret = nla_parse_nested(data, DCB_NUMTCS_ATTR_MAX, tb[DCB_ATTR_NUMTCS], 394 ret = nla_parse_nested(data, DCB_NUMTCS_ATTR_MAX, tb[DCB_ATTR_NUMTCS],
396 dcbnl_numtcs_nest); 395 dcbnl_numtcs_nest, NULL);
397 if (ret) 396 if (ret)
398 return ret; 397 return ret;
399 398
@@ -452,7 +451,7 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlmsghdr *nlh,
452 return -EINVAL; 451 return -EINVAL;
453 452
454 ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP], 453 ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP],
455 dcbnl_app_nest); 454 dcbnl_app_nest, NULL);
456 if (ret) 455 if (ret)
457 return ret; 456 return ret;
458 457
@@ -520,7 +519,7 @@ static int dcbnl_setapp(struct net_device *netdev, struct nlmsghdr *nlh,
520 return -EINVAL; 519 return -EINVAL;
521 520
522 ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP], 521 ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP],
523 dcbnl_app_nest); 522 dcbnl_app_nest, NULL);
524 if (ret) 523 if (ret)
525 return ret; 524 return ret;
526 525
@@ -577,8 +576,8 @@ static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
577 !netdev->dcbnl_ops->getpgbwgcfgrx) 576 !netdev->dcbnl_ops->getpgbwgcfgrx)
578 return -EOPNOTSUPP; 577 return -EOPNOTSUPP;
579 578
580 ret = nla_parse_nested(pg_tb, DCB_PG_ATTR_MAX, 579 ret = nla_parse_nested(pg_tb, DCB_PG_ATTR_MAX, tb[DCB_ATTR_PG_CFG],
581 tb[DCB_ATTR_PG_CFG], dcbnl_pg_nest); 580 dcbnl_pg_nest, NULL);
582 if (ret) 581 if (ret)
583 return ret; 582 return ret;
584 583
@@ -597,8 +596,8 @@ static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
597 data = pg_tb[DCB_PG_ATTR_TC_ALL]; 596 data = pg_tb[DCB_PG_ATTR_TC_ALL];
598 else 597 else
599 data = pg_tb[i]; 598 data = pg_tb[i];
600 ret = nla_parse_nested(param_tb, DCB_TC_ATTR_PARAM_MAX, 599 ret = nla_parse_nested(param_tb, DCB_TC_ATTR_PARAM_MAX, data,
601 data, dcbnl_tc_param_nest); 600 dcbnl_tc_param_nest, NULL);
602 if (ret) 601 if (ret)
603 goto err_pg; 602 goto err_pg;
604 603
@@ -735,8 +734,7 @@ static int dcbnl_setpfccfg(struct net_device *netdev, struct nlmsghdr *nlh,
735 return -EOPNOTSUPP; 734 return -EOPNOTSUPP;
736 735
737 ret = nla_parse_nested(data, DCB_PFC_UP_ATTR_MAX, 736 ret = nla_parse_nested(data, DCB_PFC_UP_ATTR_MAX,
738 tb[DCB_ATTR_PFC_CFG], 737 tb[DCB_ATTR_PFC_CFG], dcbnl_pfc_up_nest, NULL);
739 dcbnl_pfc_up_nest);
740 if (ret) 738 if (ret)
741 return ret; 739 return ret;
742 740
@@ -791,8 +789,8 @@ static int __dcbnl_pg_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
791 !netdev->dcbnl_ops->setpgbwgcfgrx) 789 !netdev->dcbnl_ops->setpgbwgcfgrx)
792 return -EOPNOTSUPP; 790 return -EOPNOTSUPP;
793 791
794 ret = nla_parse_nested(pg_tb, DCB_PG_ATTR_MAX, 792 ret = nla_parse_nested(pg_tb, DCB_PG_ATTR_MAX, tb[DCB_ATTR_PG_CFG],
795 tb[DCB_ATTR_PG_CFG], dcbnl_pg_nest); 793 dcbnl_pg_nest, NULL);
796 if (ret) 794 if (ret)
797 return ret; 795 return ret;
798 796
@@ -801,7 +799,7 @@ static int __dcbnl_pg_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
801 continue; 799 continue;
802 800
803 ret = nla_parse_nested(param_tb, DCB_TC_ATTR_PARAM_MAX, 801 ret = nla_parse_nested(param_tb, DCB_TC_ATTR_PARAM_MAX,
804 pg_tb[i], dcbnl_tc_param_nest); 802 pg_tb[i], dcbnl_tc_param_nest, NULL);
805 if (ret) 803 if (ret)
806 return ret; 804 return ret;
807 805
@@ -889,8 +887,8 @@ static int dcbnl_bcn_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
889 !netdev->dcbnl_ops->getbcncfg) 887 !netdev->dcbnl_ops->getbcncfg)
890 return -EOPNOTSUPP; 888 return -EOPNOTSUPP;
891 889
892 ret = nla_parse_nested(bcn_tb, DCB_BCN_ATTR_MAX, 890 ret = nla_parse_nested(bcn_tb, DCB_BCN_ATTR_MAX, tb[DCB_ATTR_BCN],
893 tb[DCB_ATTR_BCN], dcbnl_bcn_nest); 891 dcbnl_bcn_nest, NULL);
894 if (ret) 892 if (ret)
895 return ret; 893 return ret;
896 894
@@ -948,9 +946,8 @@ static int dcbnl_bcn_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
948 !netdev->dcbnl_ops->setbcnrp) 946 !netdev->dcbnl_ops->setbcnrp)
949 return -EOPNOTSUPP; 947 return -EOPNOTSUPP;
950 948
951 ret = nla_parse_nested(data, DCB_BCN_ATTR_MAX, 949 ret = nla_parse_nested(data, DCB_BCN_ATTR_MAX, tb[DCB_ATTR_BCN],
952 tb[DCB_ATTR_BCN], 950 dcbnl_pfc_up_nest, NULL);
953 dcbnl_pfc_up_nest);
954 if (ret) 951 if (ret)
955 return ret; 952 return ret;
956 953
@@ -1424,8 +1421,8 @@ static int dcbnl_ieee_set(struct net_device *netdev, struct nlmsghdr *nlh,
1424 if (!tb[DCB_ATTR_IEEE]) 1421 if (!tb[DCB_ATTR_IEEE])
1425 return -EINVAL; 1422 return -EINVAL;
1426 1423
1427 err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX, 1424 err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX, tb[DCB_ATTR_IEEE],
1428 tb[DCB_ATTR_IEEE], dcbnl_ieee_policy); 1425 dcbnl_ieee_policy, NULL);
1429 if (err) 1426 if (err)
1430 return err; 1427 return err;
1431 1428
@@ -1508,8 +1505,8 @@ static int dcbnl_ieee_del(struct net_device *netdev, struct nlmsghdr *nlh,
1508 if (!tb[DCB_ATTR_IEEE]) 1505 if (!tb[DCB_ATTR_IEEE])
1509 return -EINVAL; 1506 return -EINVAL;
1510 1507
1511 err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX, 1508 err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX, tb[DCB_ATTR_IEEE],
1512 tb[DCB_ATTR_IEEE], dcbnl_ieee_policy); 1509 dcbnl_ieee_policy, NULL);
1513 if (err) 1510 if (err)
1514 return err; 1511 return err;
1515 1512
@@ -1581,8 +1578,8 @@ static int dcbnl_getfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh,
1581 if (!tb[DCB_ATTR_FEATCFG]) 1578 if (!tb[DCB_ATTR_FEATCFG])
1582 return -EINVAL; 1579 return -EINVAL;
1583 1580
1584 ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, tb[DCB_ATTR_FEATCFG], 1581 ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX,
1585 dcbnl_featcfg_nest); 1582 tb[DCB_ATTR_FEATCFG], dcbnl_featcfg_nest, NULL);
1586 if (ret) 1583 if (ret)
1587 return ret; 1584 return ret;
1588 1585
@@ -1625,8 +1622,8 @@ static int dcbnl_setfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh,
1625 if (!tb[DCB_ATTR_FEATCFG]) 1622 if (!tb[DCB_ATTR_FEATCFG])
1626 return -EINVAL; 1623 return -EINVAL;
1627 1624
1628 ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, tb[DCB_ATTR_FEATCFG], 1625 ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX,
1629 dcbnl_featcfg_nest); 1626 tb[DCB_ATTR_FEATCFG], dcbnl_featcfg_nest, NULL);
1630 1627
1631 if (ret) 1628 if (ret)
1632 goto err; 1629 goto err;
@@ -1715,7 +1712,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh)
1715 return -EPERM; 1712 return -EPERM;
1716 1713
1717 ret = nlmsg_parse(nlh, sizeof(*dcb), tb, DCB_ATTR_MAX, 1714 ret = nlmsg_parse(nlh, sizeof(*dcb), tb, DCB_ATTR_MAX,
1718 dcbnl_rtnl_policy); 1715 dcbnl_rtnl_policy, NULL);
1719 if (ret < 0) 1716 if (ret < 0)
1720 return ret; 1717 return ret;
1721 1718