MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rsn_update_start

Function rsn_update_start

dpdk/lib/ipsec/ipsec_sqn.h:265–287  ·  view source on GitHub ↗

* Start RSN update. */

Source from the content-addressed store, hash-verified

263 * Start RSN update.
264 */
265static inline struct replay_sqn *
266rsn_update_start(struct rte_ipsec_sa *sa)
267{
268 uint32_t k, n;
269 struct replay_sqn *rsn;
270
271 n = sa->sqn.inb.wridx;
272
273 /* no active writers */
274 RTE_ASSERT(n == sa->sqn.inb.rdidx);
275
276 if (!SQN_ATOMIC(sa))
277 return sa->sqn.inb.rsn[n];
278
279 k = REPLAY_SQN_NEXT(n);
280 sa->sqn.inb.wridx = k;
281
282 rsn = sa->sqn.inb.rsn[k];
283 rte_rwlock_write_lock(&rsn->rwl);
284 rsn_copy(sa, k, n);
285
286 return rsn;
287}
288
289/**
290 * Finish RSN update.

Callers 1

esp_inb_rsn_updateFunction · 0.85

Calls 1

rsn_copyFunction · 0.85

Tested by

no test coverage detected