Added missing DCB(Data Center Bridging) settings according to :
https://developer.gnome.org/NetworkManager/stable/settings-dcb.html
Details
- Reviewers
jgrulich - Commits
- R282:4332597370b8: Added DCB settings
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
src/settings/dcbsetting.cpp | ||
---|---|---|
32 | You can initialize also all the lists here, because they have default values as well. | |
198 | If you initialize the list at the beginning, you will not need to have this check and also do this weird thing below. Simply have the first check and otherwise you can do just d->priorityFlowControl[userPriority] = enabled. | |
213 | Check just if userPriority is < 8. | |
225 | Same as for setPriorityFlowControl() | |
240 | Same as for priorityFlowControl() | |
252 | Same here. | |
267 | Same here. | |
278 | Here. | |
295 | Here. | |
305 | Also here. | |
321 | Also here. | |
331 | Also here. | |
348 | And last one. | |
357 | Remove comments. | |
394 | You can directly assign whole UintList. Same for the rest of options below. | |
428 | Remove comments. | |
429 | Shouldn't it save appFcoeMode() instead? | |
448 | You can probably insert flags all the time. | |
465 | You can directly push the list there. Same for the lists below. | |
src/settings/dcbsetting.h | ||
50 | You are missing Q_DECLARE_FLAGS() | |
84 | Here it would probably make more sense to accept second parameter as bool. | |
96 | Make second parameter as bool. | |
src/settings/dcbsetting_p.h | ||
47 | You can use our "UintList" defined data type for these. |
src/settings/dcbsetting.cpp | ||
---|---|---|
32 | how do i do that? | |
198 | I think it is better to have this as a safety measure, and initialising so many values manually wold take 8*6=48 lines in the beginning of the file | |
213 | that may lead to a malloc assertion error sometimes, and thus a crash which is confusing to understand | |
394 | I get a type casting error | |
428 | oops, i was debugging it | |
429 | yeah, i uploaded some unfinished code | |
465 | How? | |
src/settings/dcbsetting.h | ||
50 | I tried to do it in the same way as in ipv6 settings, so should i add Q_DECLARE_FLAGS() ? |
src/settings/dcbsetting.cpp | ||
---|---|---|
32 | something like priorityFlowControl({0, 0, 0, 0, 0, 0, 0, 0, 0}) should work, or not? Same for othe lists. | |
198 | It should simple by just: Q_D(DcbSetting) if (userPriority < 8) { d->priorityFlowControl[userPriority] = enabled; } | |
213 | Not if you initialize it at the beginning as it should be. | |
394 | You can have Q_D(DcbSetting) at the beginning of fromMap() function and then instead of setFoo() have d->foo = list. | |
465 | Oh, right, you don't have methods for that. In that case you can again use Q_D(const DcbSetting) and push there d->priorityFlowControl and others. | |
53 ↗ | (On Diff #47243) | Not this way. |
src/settings/dcbsetting.cpp | ||
---|---|---|
465 | I can use Q_D in fromMap, but i get this error in toMap: error: invalid conversion from ‘const NetworkManager::DcbSettingPrivate*’ to ‘NetworkManager::DcbSettingPrivate*’ [-fpermissive] Q_D(DcbSetting); so, changed frommap, but keeping this as is. |
src/settings/dcbsetting.cpp | ||
---|---|---|
59 | Yeah, that would help. |
src/settings/dcbsetting.cpp | ||
---|---|---|
59 | Yes please. |
src/settings/dcbsetting.cpp | ||
---|---|---|
59 | Okay, im on it |
src/settings/dcbsetting.h | ||
---|---|---|
107 ↗ | (On Diff #47243) | Move them please among the rest of methods, so all related methods are next to each other. Also use please "const UintList &list" and do not name the method as setFooList(), they can be just setFoo(). |
autotests/settings/dcbsettingtest.cpp | ||
---|---|---|
29 ↗ | (On Diff #47243) | Include not needed. |
src/settings/dcbsetting.cpp | ||
221 ↗ | (On Diff #47243) | You can remove the else branch and have just return false. |
255 ↗ | (On Diff #47243) | You can remove the else branch and have just return 0. |
289 ↗ | (On Diff #47243) | You can remove the else branch and have just return 0. |
323 ↗ | (On Diff #47243) | You can remove the else branch and have just return 0. |
357 ↗ | (On Diff #47243) | You can remove the else branch and have just return false. |
391 ↗ | (On Diff #47243) | You can remove the else branch and have just return 0. |
This was last round, otherwise it's ready to go, just fix the remaining issues. Thanks.
Please keep the Repository settings. Additionally, please format the title and description according to https://community.kde.org/Infrastructure/Phabricator#Formatting_your_patch
src/settings/dcbsetting.cpp | ||
---|---|---|
492 ↗ | (On Diff #47243) | I think all those should be added all the time, checking whether the last one is higher can sometime avoid adding them to the map when one of previous ones is set to non-default value. |
528 ↗ | (On Diff #47243) | You don't print priorityBandwith, priororityGroupBandwidth and others. |
src/settings/dcbsetting.h | ||
44 ↗ | (On Diff #47243) | Rename to DcbFlagType |
125 ↗ | (On Diff #47243) | Please also add Q_DECLARE_OPERATORS_FOR_FLAGS(DcbSetting::DcbFlags) |
src/settings/setting.h | ||
97 ↗ | (On Diff #47243) | Remove trailing spaces. They are not visible here, but once I apply this patch, I see them in KDevelop. |