From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id EA5B5C36E for ; Sat, 6 Jun 2015 01:15:46 +0200 (CEST) Received: by wgv5 with SMTP id 5so66802344wgv.1 for ; Fri, 05 Jun 2015 16:15:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Gn81Zeo/NY5xKwjoDV6ZH5ft5oqfs9wTT+DlxbWO6Z4=; b=YOhrNW17mgFKIThk1kSMSwqzqHgq5wfR2G0WFAMDku6Cs7/axB7+rfoVRiPzLEuscO hP9/54H1cdQyDum6SpikVjb4ty0dCuRDyw5Ghpfomc7TNaIB2o04ax2U3VjV34jskjT+ wyI2uUkM6THQXCC6wnkSDxz1jRP6ebxmPDL9uAOoCj52aEo0ROy7Bd2d5W0xYNRuDL11 DCkb7nnonK8EKDndEZAK3KgONxZwOqBBSDpIxdcN4/iy1XOsd07rmElT4DL8hTkdy4Lp 45JfIjHizV9PtU5zmJSwm+wJuLZ0vouzEV+4yBZcFx2FKmtVr13QwziJUyJgLV9hosnC XB8Q== X-Gm-Message-State: ALoCoQmP5vgT5YAY9hO9G9vyn1AWAcd7qb+QfTfQSqbcUQiLorl0b3TLM/1l2YpzYtivGXvso473 X-Received: by 10.180.210.171 with SMTP id mv11mr907050wic.61.1433546146847; Fri, 05 Jun 2015 16:15:46 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id gs7sm5427579wib.10.2015.06.05.16.15.44 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 05 Jun 2015 16:15:45 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Sat, 6 Jun 2015 01:15:06 +0200 Message-Id: <1433546120-2254-3-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1433546120-2254-1-git-send-email-adrien.mazarguil@6wind.com> References: <1433546120-2254-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH 02/16] mlx4: use experimental verbs for polling and completions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2015 23:15:47 -0000 This API implements additional flags in work completions that are required to support checksum offloads. Signed-off-by: Gilad Berman Signed-off-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 648b210..b77fb22 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -914,7 +914,7 @@ txq_complete(struct txq *txq) unsigned int elts_comp = txq->elts_comp; unsigned int elts_tail; const unsigned int elts_n = txq->elts_n; - struct ibv_wc wcs[elts_comp]; + struct ibv_exp_wc wcs[elts_comp]; int wcs_n; if (unlikely(elts_comp == 0)) @@ -923,11 +923,11 @@ txq_complete(struct txq *txq) DEBUG("%p: processing %u work requests completions", (void *)txq, elts_comp); #endif - wcs_n = ibv_poll_cq(txq->cq, elts_comp, wcs); + wcs_n = ibv_exp_poll_cq(txq->cq, elts_comp, wcs, sizeof(wcs[0])); if (unlikely(wcs_n == 0)) return 0; if (unlikely(wcs_n < 0)) { - DEBUG("%p: ibv_poll_cq() failed (wcs_n=%d)", + DEBUG("%p: ibv_exp_poll_cq() failed (wcs_n=%d)", (void *)txq, wcs_n); return -1; } @@ -2317,7 +2317,7 @@ mlx4_rx_burst_sp(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) { struct rxq *rxq = (struct rxq *)dpdk_rxq; struct rxq_elt_sp (*elts)[rxq->elts_n] = rxq->elts.sp; - struct ibv_wc wcs[pkts_n]; + struct ibv_exp_wc wcs[pkts_n]; struct ibv_recv_wr head; struct ibv_recv_wr **next = &head.next; struct ibv_recv_wr *bad_wr; @@ -2329,18 +2329,18 @@ mlx4_rx_burst_sp(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) return mlx4_rx_burst(dpdk_rxq, pkts, pkts_n); if (unlikely(elts == NULL)) /* See RTE_DEV_CMD_SET_MTU. */ return 0; - wcs_n = ibv_poll_cq(rxq->cq, pkts_n, wcs); + wcs_n = ibv_exp_poll_cq(rxq->cq, pkts_n, wcs, sizeof(wcs[0])); if (unlikely(wcs_n == 0)) return 0; if (unlikely(wcs_n < 0)) { - DEBUG("rxq=%p, ibv_poll_cq() failed (wc_n=%d)", + DEBUG("rxq=%p, ibv_exp_poll_cq() failed (wc_n=%d)", (void *)rxq, wcs_n); return 0; } assert(wcs_n <= (int)pkts_n); /* For each work completion. */ for (i = 0; (i != wcs_n); ++i) { - struct ibv_wc *wc = &wcs[i]; + struct ibv_exp_wc *wc = &wcs[i]; uint64_t wr_id = wc->wr_id; uint32_t len = wc->byte_len; struct rxq_elt_sp *elt = &(*elts)[wr_id]; @@ -2509,7 +2509,7 @@ mlx4_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) { struct rxq *rxq = (struct rxq *)dpdk_rxq; struct rxq_elt (*elts)[rxq->elts_n] = rxq->elts.no_sp; - struct ibv_wc wcs[pkts_n]; + struct ibv_exp_wc wcs[pkts_n]; struct ibv_recv_wr head; struct ibv_recv_wr **next = &head.next; struct ibv_recv_wr *bad_wr; @@ -2519,18 +2519,18 @@ mlx4_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) if (unlikely(rxq->sp)) return mlx4_rx_burst_sp(dpdk_rxq, pkts, pkts_n); - wcs_n = ibv_poll_cq(rxq->cq, pkts_n, wcs); + wcs_n = ibv_exp_poll_cq(rxq->cq, pkts_n, wcs, sizeof(wcs[0])); if (unlikely(wcs_n == 0)) return 0; if (unlikely(wcs_n < 0)) { - DEBUG("rxq=%p, ibv_poll_cq() failed (wc_n=%d)", + DEBUG("rxq=%p, ibv_exp_poll_cq() failed (wc_n=%d)", (void *)rxq, wcs_n); return 0; } assert(wcs_n <= (int)pkts_n); /* For each work completion. */ for (i = 0; (i != wcs_n); ++i) { - struct ibv_wc *wc = &wcs[i]; + struct ibv_exp_wc *wc = &wcs[i]; uint64_t wr_id = wc->wr_id; uint32_t len = wc->byte_len; struct rxq_elt *elt = &(*elts)[WR_ID(wr_id).id]; -- 2.1.0