Skip to content

Commit 88f4b9d

Browse files
committed
Merge: CNB101: xfrm: Support ESN context update to hardware for TX
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/700 JIRA: https://issues.redhat.com/browse/RHEL-86505 ``` commit 373b79a Author: Jianbo Liu <[email protected]> Date: Thu Dec 19 14:37:29 2024 +0200 xfrm: Support ESN context update to hardware for TX Previously xfrm_dev_state_advance_esn() was added for RX only. But it's possible that ESN context also need to be synced to hardware for TX, so call it for outbound in this patch. Signed-off-by: Jianbo Liu <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Steffen Klassert <[email protected]> ``` Signed-off-by: CKI Backport Bot <[email protected]> --- <small>Created 2025-04-08 12:50 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12334433&issuetype=1&priority=4&summary=backporter+webhook+issue&components=kernel-workflow+/+backporter)</small> Approved-by: Ivan Vecera <[email protected]> Approved-by: José Ignacio Tornos Martínez <[email protected]> Approved-by: Sabrina Dubroca <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Julio Faracco <[email protected]>
2 parents 1736dce + 8d2e1d7 commit 88f4b9d

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

Documentation/networking/xfrm_device.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ the stack in xfrm_input().
169169

170170
hand the packet to napi_gro_receive() as usual
171171

172-
In ESN mode, xdo_dev_state_advance_esn() is called from xfrm_replay_advance_esn().
172+
In ESN mode, xdo_dev_state_advance_esn() is called from
173+
xfrm_replay_advance_esn() for RX, and xfrm_replay_overflow_offload_esn for TX.
173174
Driver will check packet seq number and update HW ESN state machine if needed.
174175

175176
Packet offload mode:

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6571,6 +6571,9 @@ static void cxgb4_advance_esn_state(struct xfrm_state *x)
65716571
{
65726572
struct adapter *adap = netdev2adap(x->xso.dev);
65736573

6574+
if (x->xso.dir != XFRM_DEV_OFFLOAD_IN)
6575+
return;
6576+
65746577
if (!mutex_trylock(&uld_mutex)) {
65756578
dev_dbg(adap->pdev_dev,
65766579
"crypto uld critical resource is under use\n");

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,9 @@ static void mlx5e_xfrm_advance_esn_state(struct xfrm_state *x)
980980
struct mlx5e_ipsec_sa_entry *sa_entry_shadow;
981981
bool need_update;
982982

983+
if (x->xso.dir != XFRM_DEV_OFFLOAD_IN)
984+
return;
985+
983986
need_update = mlx5e_ipsec_update_esn_state(sa_entry);
984987
if (!need_update)
985988
return;

net/xfrm/xfrm_replay.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ static int xfrm_replay_overflow_offload_esn(struct xfrm_state *x, struct sk_buff
731731
}
732732

733733
replay_esn->oseq = oseq;
734+
xfrm_dev_state_advance_esn(x);
734735

735736
if (xfrm_aevent_is_on(net))
736737
xfrm_replay_notify(x, XFRM_REPLAY_UPDATE);

0 commit comments

Comments
 (0)