Skip to content

Commit 3d8d38d

Browse files
committed
Merge branch 'act_csum-get_fill_size'
Craig Dillabaugh says: ==================== Update csum tc action for batch operation. This patchset includes two patches the first updating act_csum.c to include the get_fill_size routine required for batch operation, and the second including updated TDC tests for the feature. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 5693ee4 + 2c785b3 commit 3d8d38d

File tree

2 files changed

+78
-2
lines changed

2 files changed

+78
-2
lines changed

net/sched/act_csum.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,11 @@ static int tcf_csum_search(struct net *net, struct tc_action **a, u32 index,
648648
return tcf_idr_search(tn, a, index);
649649
}
650650

651+
static size_t tcf_csum_get_fill_size(const struct tc_action *act)
652+
{
653+
return nla_total_size(sizeof(struct tc_csum));
654+
}
655+
651656
static struct tc_action_ops act_csum_ops = {
652657
.kind = "csum",
653658
.type = TCA_ACT_CSUM,
@@ -658,6 +663,7 @@ static struct tc_action_ops act_csum_ops = {
658663
.cleanup = tcf_csum_cleanup,
659664
.walk = tcf_csum_walker,
660665
.lookup = tcf_csum_search,
666+
.get_fill_size = tcf_csum_get_fill_size,
661667
.size = sizeof(struct tcf_csum),
662668
};
663669

tools/testing/selftests/tc-testing/tc-tests/actions/csum.json

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,13 +398,83 @@
398398
255
399399
]
400400
],
401-
"cmdUnderTest": "for i in `seq 1 32`; do cmd=\"action csum tcp continue index $i \"; args=\"$args$cmd\"; done && $TC actions add $args",
402-
"expExitCode": "255",
401+
"cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action csum tcp continue index \\$i \\\"; args=\"\\$args\\$cmd\"; done && $TC actions add \\$args\"",
402+
"expExitCode": "0",
403403
"verifyCmd": "$TC actions ls action csum",
404404
"matchPattern": "^[ \t]+index [0-9]* ref",
405405
"matchCount": "32",
406406
"teardown": [
407407
"$TC actions flush action csum"
408408
]
409+
},
410+
{
411+
"id": "b4e9",
412+
"name": "Delete batch of 32 csum actions",
413+
"category": [
414+
"actions",
415+
"csum"
416+
],
417+
"setup": [
418+
[
419+
"$TC actions flush action csum",
420+
0,
421+
1,
422+
255
423+
],
424+
"bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action csum tcp continue index \\$i \\\"; args=\"\\$args\\$cmd\"; done && $TC actions add \\$args\""
425+
],
426+
"cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action csum index \\$i \\\"; args=\"\\$args\\$cmd\"; done && $TC actions del \\$args\"",
427+
"expExitCode": "0",
428+
"verifyCmd": "$TC actions list action csum",
429+
"matchPattern": "^[ \t]+index [0-9]+ ref",
430+
"matchCount": "0",
431+
"teardown": []
432+
},
433+
{
434+
"id": "0015",
435+
"name": "Add batch of 32 csum tcp actions with large cookies",
436+
"category": [
437+
"actions",
438+
"csum"
439+
],
440+
"setup": [
441+
[
442+
"$TC actions flush action csum",
443+
0,
444+
1,
445+
255
446+
]
447+
],
448+
"cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action csum tcp continue index \\$i cookie aaabbbcccdddeee \\\"; args=\"\\$args\\$cmd\"; done && $TC actions add \\$args\"",
449+
"expExitCode": "0",
450+
"verifyCmd": "$TC actions ls action csum",
451+
"matchPattern": "^[ \t]+index [0-9]* ref",
452+
"matchCount": "32",
453+
"teardown": [
454+
"$TC actions flush action csum"
455+
]
456+
},
457+
{
458+
"id": "989e",
459+
"name": "Delete batch of 32 csum actions with large cookies",
460+
"category": [
461+
"actions",
462+
"csum"
463+
],
464+
"setup": [
465+
[
466+
"$TC actions flush action csum",
467+
0,
468+
1,
469+
255
470+
],
471+
"bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action csum tcp continue index \\$i cookie aaabbbcccdddeee \\\"; args=\"\\$args\\$cmd\"; done && $TC actions add \\$args\""
472+
],
473+
"cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action csum index \\$i \\\"; args=\"\\$args\\$cmd\"; done && $TC actions del \\$args\"",
474+
"expExitCode": "0",
475+
"verifyCmd": "$TC actions list action csum",
476+
"matchPattern": "^[ \t]+index [0-9]+ ref",
477+
"matchCount": "0",
478+
"teardown": []
409479
}
410480
]

0 commit comments

Comments
 (0)