* Check which hardware context can be used. Use the existing match * or create a new context descriptor. */
| 493 | * or create a new context descriptor. |
| 494 | */ |
| 495 | static inline uint32_t |
| 496 | what_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 | |
| 524 | static inline uint32_t |
| 525 | tx_desc_cksum_flags_to_olinfo(uint64_t ol_flags) |