summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
AgeCommit message (Expand)AuthorFilesLines
2019-09-20session: fix msg freeing on errorNathan Skrzypczak2-13/+7
2019-09-19session: builtin app rx notifications regardless of stateFlorin Coras1-3/+5
2019-09-17session: limit pacer bucket sizeFlorin Coras2-2/+4
2019-09-13session: add session enable option in config fileNathan Skrzypczak1-0/+2
2019-09-10tcp: enable gso in tcp hoststackSimon Zhang1-3/+4
2019-09-10session: fix session filter rangeFlorin Coras1-1/+1
2019-09-04session: improve cliFlorin Coras5-145/+343
2019-09-04session: avoid bihash list for session tablesFlorin Coras1-12/+38
2019-09-03api: enforce vla is last and fixed string typeOle Troan1-1/+1
2019-08-30session: move svm_fifo_clear_deq_ntf to before calling the app callbackVladimir Kropylev1-2/+2
2019-08-30session : make sure session layer is enabled when cli operate the sessions.Guanghua Zhang1-0/+4
2019-08-29svm: fix fifo hdr freelist allocationFlorin Coras1-0/+2
2019-08-28session: fix unbind coverity warningFlorin Coras1-0/+7
2019-08-27session: move ctrl messages from bapi to mqFlorin Coras9-106/+675
2019-08-19session: add explicit reset apiFlorin Coras5-6/+59
2019-08-13session: fix enqueue notification on 32bit systemsFlorin Coras1-3/+10
2019-08-09session: allow closed transports to sendFlorin Coras1-4/+16
2019-08-09tls: mark as no lookup transportFlorin Coras1-1/+1
2019-08-08udp: fix connections moveAloys Augustin1-0/+28
2019-08-05session: cache align transport base classFlorin Coras4-19/+20
2019-08-01session: session pool migration notificationFlorin Coras6-0/+43
2019-08-01vppinfra: refactor clib_rwlock_t to use single condition variablejaszha031-1/+0
2019-07-29session: fix vpp to app msg generationFlorin Coras2-66/+28
2019-07-27session: define connection id lengthFlorin Coras1-3/+10
2019-07-26session: separate ctrl, new and old eventsFlorin Coras3-89/+88
2019-07-26session tcp: handle rxt and acks as custom eventsFlorin Coras6-8/+71
2019-07-25session: add transport deleted stateFlorin Coras3-10/+14
2019-07-23api: binary api cleanupDave Barach1-1/+2
2019-07-23session: reorganize dispatch logicFlorin Coras3-153/+141
2019-07-23session: avoid postponing closeFlorin Coras1-14/+0
2019-07-19session: improve event loggingFlorin Coras4-60/+49
2019-07-19session: Use parent_handle instead of transport_optsNathan Skrzypczak4-6/+6
2019-07-17session: move constants definitionFlorin Coras2-2/+3
2019-07-17session: use llist in session node evt handlingFlorin Coras3-66/+145
2019-07-17session: grab mq lock until ctrl event is enqueuedFlorin Coras1-2/+1
2019-07-16session: fix node enable sequenceVladimir Kropylev1-1/+1
2019-07-15session: allow transports to generate closed notificationsFlorin Coras5-27/+42
2019-07-12quic: fix show session verboseAloys Augustin1-1/+2
2019-07-12session: add thread index to all formattersAloys Augustin2-2/+3
2019-07-09session: notify app of session and transport cleanupFlorin Coras5-3/+39
2019-07-09tcp: remove warning for multi-seg scnario.Simon Zhang1-1/+0
2019-07-08session: add flag to disable session lookupNathan Skrzypczak5-5/+15
2019-07-08session: target app.fib_index in unbind_uriNathan Skrzypczak1-3/+6
2019-07-03quic: fifo notifications fixAloys Augustin1-0/+1
2019-06-29svm: rename fifo tx notifications to reflect useFlorin Coras2-3/+3
2019-06-28session: add half_open_has_fifos for UDPCNathan Skrzypczak4-6/+31
2019-06-27session: Add transport vft protocol optionsNathan Skrzypczak5-13/+23
2019-06-25tcp: delivery rate estimatorFlorin Coras2-0/+27
2019-06-24session: full lock on session_send_evt_to_threadNathan Skrzypczak1-10/+2
2019-06-20quic: remove session flags identifying Q/S sessionsNathan Skrzypczak1-1/+0
="gi">+ tso_header_sz = buf->l2_len + vlan_sz + + buf->l3_len + buf->l4_len; + + if (unlikely(tso_header_sz > + MLX5_MAX_TSO_HEADER)) + break; + copy_b = tso_header_sz - pkt_inline_sz; + /* First seg must contain all headers. */ + assert(copy_b <= length); + raw += MLX5_WQE_DWORD_SIZE; + if (copy_b && + ((end - (uintptr_t)raw) > copy_b)) { + uint16_t n = (MLX5_WQE_DS(copy_b) - + 1 + 3) / 4; + + if (unlikely(max_wqe < n)) + break; + max_wqe -= n; + rte_memcpy((void *)raw, + (void *)addr, copy_b); + addr += copy_b; + length -= copy_b; + pkt_inline_sz += copy_b; + /* + * Another DWORD will be added + * in the inline part. + */ + raw += MLX5_WQE_DS(copy_b) * + MLX5_WQE_DWORD_SIZE - + MLX5_WQE_DWORD_SIZE; + } else { + /* NOP WQE. */ + wqe->ctrl = (rte_v128u32_t){ + htonl(txq->wqe_ci << 8), + htonl(txq->qp_num_8s | 1), + 0, + 0, + }; + ds = 1; + total_length = 0; + pkts--; + pkts_n++; + elts_head = (elts_head - 1) & + (elts_n - 1); + k++; + goto next_wqe; + } + } + } /* Inline if enough room. */ - if (txq->max_inline) { + if (txq->inline_en || tso) { uintptr_t end = (uintptr_t) (((uintptr_t)txq->wqes) + (1 << txq->wqe_n) * MLX5_WQE_SIZE); unsigned int max_inline = txq->max_inline * RTE_CACHE_LINE_SIZE - - MLX5_WQE_DWORD_SIZE; + (pkt_inline_sz - 2); uintptr_t addr_end = (addr + max_inline) & ~(RTE_CACHE_LINE_SIZE - 1); unsigned int copy_b = (addr_end > addr) ? @@ -491,6 +554,18 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) if (unlikely(max_wqe < n)) break; max_wqe -= n; + if (tso) { + uint32_t inl = + htonl(copy_b | MLX5_INLINE_SEG); + + pkt_inline_sz = + MLX5_WQE_DS(tso_header_sz) * + MLX5_WQE_DWORD_SIZE; + rte_memcpy((void *)raw, + (void *)&inl, sizeof(inl)); + raw += sizeof(inl); + pkt_inline_sz += sizeof(inl); + } rte_memcpy((void *)raw, (void *)addr, copy_b); addr += copy_b; length -= copy_b; @@ -591,18 +666,34 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) next_pkt: ++i; /* Initialize known and common part of the WQE structure. */ - wqe->ctrl = (rte_v128u32_t){ - htonl((txq->wqe_ci << 8) | MLX5_OPCODE_SEND), - htonl(txq->qp_num_8s | ds), - 0, - 0, - }; - wqe->eseg = (rte_v128u32_t){ - 0, - cs_flags, - 0, - (ehdr << 16) | htons(pkt_inline_sz), - }; + if (tso) { + wqe->ctrl = (rte_v128u32_t){ + htonl((txq->wqe_ci << 8) | MLX5_OPCODE_TSO), + htonl(txq->qp_num_8s | ds), + 0, + 0, + }; + wqe->eseg = (rte_v128u32_t){ + 0, + cs_flags | (htons(buf->tso_segsz) << 16), + 0, + (ehdr << 16) | htons(tso_header_sz), + }; + } else { + wqe->ctrl = (rte_v128u32_t){ + htonl((txq->wqe_ci << 8) | MLX5_OPCODE_SEND), + htonl(txq->qp_num_8s | ds), + 0, + 0, + }; + wqe->eseg = (rte_v128u32_t){ + 0, + cs_flags, + 0, + (ehdr << 16) | htons(pkt_inline_sz), + }; + } +next_wqe: txq->wqe_ci += (ds + 3) / 4; #ifdef MLX5_PMD_SOFT_COUNTERS /* Increment sent bytes counter. */ @@ -610,10 +701,10 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) #endif } while (pkts_n); /* Take a shortcut if nothing must be sent. */ - if (unlikely(i == 0)) + if (unlikely((i + k) == 0)) return 0; /* Check whether completion threshold has been reached. */ - comp = txq->elts_comp + i + j; + comp = txq->elts_comp + i + j + k; if (comp >= MLX5_TX_COMP_THRESH) { volatile struct mlx5_wqe_ctrl *w = (volatile struct mlx5_wqe_ctrl *)wqe; diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 41a34d7..6b328cf 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -254,6 +254,8 @@ struct txq { uint16_t cqe_n:4; /* Number of CQ elements (in log2). */ uint16_t wqe_n:4; /* Number of of WQ elements (in log2). */ uint16_t max_inline; /* Multiple of RTE_CACHE_LINE_SIZE to inline. */ + uint16_t inline_en:1; /* When set inline is enabled. */ + uint16_t tso_en:1; /* When set hardware TSO is enabled. */ uint32_t qp_num_8s; /* QP number shifted by 8. */ volatile struct mlx5_cqe (*cqes)[]; /* Completion queue. */ volatile void *wqes; /* Work queue (use volatile to write into). */ diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 949035b..995b763 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -342,6 +342,19 @@ txq_ctrl_setup(struct rte_eth_dev *dev, struct txq_ctrl *txq_ctrl, RTE_CACHE_LINE_SIZE); attr.init.cap.max_inline_data = tmpl.txq.max_inline * RTE_CACHE_LINE_SIZE; + tmpl.txq.inline_en = 1; + } + if (priv->tso) { + uint16_t max_tso_inline = ((MLX5_MAX_TSO_HEADER + + (RTE_CACHE_LINE_SIZE - 1)) / + RTE_CACHE_LINE_SIZE); + + attr.init.max_tso_header = + max_tso_inline * RTE_CACHE_LINE_SIZE; + attr.init.comp_mask |= IBV_EXP_QP_INIT_ATTR_MAX_TSO_HEADER; + tmpl.txq.max_inline = RTE_MAX(tmpl.txq.max_inline, + max_tso_inline); + tmpl.txq.tso_en = 1; } tmpl.qp = ibv_exp_create_qp(priv->ctx, &attr.init); if (tmpl.qp == NULL) { -- 2.7.4