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

Function what_advctx_update

dpdk/drivers/net/ixgbe/ixgbe_rxtx.c:495–522  ·  view source on GitHub ↗

* Check which hardware context can be used. Use the existing match * or create a new context descriptor. */

Source from the content-addressed store, hash-verified

493 * or create a new context descriptor.
494 */
495static inline uint32_t
496what_advctx_update(struct ixgbe_tx_queue *txq, uint64_t flags,
497 union ixgbe_tx_offload tx_offload)
498{
499 /* If match with the current used context */
500 if (likely((txq->ctx_cache[txq->ctx_curr].flags == flags) &&
501 (txq->ctx_cache[txq->ctx_curr].tx_offload.data[0] ==
502 (txq->ctx_cache[txq->ctx_curr].tx_offload_mask.data[0]
503 & tx_offload.data[0])) &&
504 (txq->ctx_cache[txq->ctx_curr].tx_offload.data[1] ==
505 (txq->ctx_cache[txq->ctx_curr].tx_offload_mask.data[1]
506 & tx_offload.data[1]))))
507 return txq->ctx_curr;
508
509 /* What if match with the next context */
510 txq->ctx_curr ^= 1;
511 if (likely((txq->ctx_cache[txq->ctx_curr].flags == flags) &&
512 (txq->ctx_cache[txq->ctx_curr].tx_offload.data[0] ==
513 (txq->ctx_cache[txq->ctx_curr].tx_offload_mask.data[0]
514 & tx_offload.data[0])) &&
515 (txq->ctx_cache[txq->ctx_curr].tx_offload.data[1] ==
516 (txq->ctx_cache[txq->ctx_curr].tx_offload_mask.data[1]
517 & tx_offload.data[1]))))
518 return txq->ctx_curr;
519
520 /* Mismatch, use the previous context */
521 return IXGBE_CTX_NUM;
522}
523
524static inline uint32_t
525tx_desc_cksum_flags_to_olinfo(uint64_t ol_flags)

Callers 1

ixgbe_xmit_pktsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected