Commit b05d42e
xfrm: hold device only for the asynchronous decryption
The dev_hold() on skb->dev during packet reception was originally
added to prevent the device from being released prematurely during
asynchronous decryption operations.
As current hardware can offload decryption, this asynchronous path is
not always utilized. This often results in a pattern of dev_hold()
immediately followed by dev_put() for each packet, creating
unnecessary reference counting overhead detrimental to performance.
This patch optimizes this by skipping the dev_hold() and subsequent
dev_put() when asynchronous decryption is not being performed.
Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>1 parent 4f4040e commit b05d42e
1 file changed
+9
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
| 506 | + | |
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
| |||
649 | 650 | | |
650 | 651 | | |
651 | 652 | | |
652 | | - | |
653 | | - | |
654 | | - | |
| 653 | + | |
655 | 654 | | |
656 | | - | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
657 | 658 | | |
| 659 | + | |
| 660 | + | |
658 | 661 | | |
659 | | - | |
660 | | - | |
| 662 | + | |
| 663 | + | |
661 | 664 | | |
662 | | - | |
663 | | - | |
664 | 665 | | |
665 | 666 | | |
666 | 667 | | |
| |||
0 commit comments