From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0EABEA034E; Tue, 22 Feb 2022 06:57:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9523940DF4; Tue, 22 Feb 2022 06:57:40 +0100 (CET) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by mails.dpdk.org (Postfix) with ESMTP id 1E09E4068C for ; Tue, 22 Feb 2022 06:57:40 +0100 (CET) Received: by mail-io1-f47.google.com with SMTP id t11so12991075ioi.7 for ; Mon, 21 Feb 2022 21:57:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2vWYM8GKZqD7Byi8nl8BFEAY/101WKKDBWM7jwRTBc4=; b=QuvhQmRsoEhWwiooh/u+570/lEYYxZRtG5K9WPShP2wM+oQSMCbaGkEvfDq3wKdJ7g L6LqjqK+JO93Ny7lWXuNK2EDBDenz2Vw91DKo9TGLmTHGvi6Jw0cu61OzYhh0zHzGm9s bX+UY+vql0GqdO8NiND+liT4dHIduE0DEbaE15hWOEXr4O+8BJVBoCLZl4i6GlOTly8l HEFyrRpxVem10nT+CZZnN57TaeydHVspUnESFrow+eE+++GxCP50qApVBu8K1Dm/dAL0 NdZBgZFcTfcC5Zjp5ZdU6KhQbTtO6vE6VYJAIY6aUDmgcJW+WodwglKR9hp2avZhxOJp 440Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2vWYM8GKZqD7Byi8nl8BFEAY/101WKKDBWM7jwRTBc4=; b=lBxKDBltvkn8vzMzQ1ANXR4W5TbZeknKDSn8JTiN88+efjdIBcEhawLhuzM94/hzo7 Rt1zouL9chhMj598SfE3+QjD+XkopASRwLiBAv0GziHzBrR6WG4xD0ktf92BO0e6Wicw tCVYJcZw38lxCT4cIULrXL/8dnRkM5nwAbjPYTEovG5QGNDeGUm7kUFdOJ1vFJgcN0LW YuAHX6qLhG6sCtIAEEVP34MhLa+YlgH9Esd0UYl1HvtngMZRD43aLFvt7MLh8Kqpaufj w9soIx45Os8dkzgy+JJ8lVpGnQanzNBDEz5NEBNxmx/KSEHrKZOyxCbrcku8yUU6npjX mFTw== X-Gm-Message-State: AOAM530iNLi4NZ8TSAt/DwwG5sBSr9qsY2rLJrPEYEljUbzbbp2db9sE HMY/G9KI+4ZhZMQSzQKwBqOTJ3yVm3PYglcoplE= X-Google-Smtp-Source: ABdhPJyDFJX2zHAvExkWty5WxhINLf/fCsz/N/0tqUugzCDgek5ik5X1CxeVtshlZlwa5KKDEynYbuj8kzBKAgLAtrY= X-Received: by 2002:a02:69c2:0:b0:311:b65e:388b with SMTP id e185-20020a0269c2000000b00311b65e388bmr17549040jac.123.1645509459336; Mon, 21 Feb 2022 21:57:39 -0800 (PST) MIME-Version: 1.0 References: <20220216193827.2908858-1-timothy.mcdaniel@intel.com> In-Reply-To: <20220216193827.2908858-1-timothy.mcdaniel@intel.com> From: Jerin Jacob Date: Tue, 22 Feb 2022 11:27:13 +0530 Message-ID: Subject: Re: [PATCH 1/2] event/dlb2: update rolling mask used for dequeue To: Timothy McDaniel Cc: Jerin Jacob , dpdk-dev Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Feb 17, 2022 at 1:09 AM Timothy McDaniel wrote: > > Update the rolling mask used in dequeue operations. Fixes > vector optimized dequeue. > > Fixes: 000a7b8e7582 ("event/dlb2: optimize dequeue operation") > > Signed-off-by: Timothy McDaniel Series applied to dpdk-next-net-eventdev/for-main. Thanks > --- > drivers/event/dlb2/dlb2.c | 28 +++++++++++++++++++++------- > 1 file changed, 21 insertions(+), 7 deletions(-) > > diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c > index d75f12e382..09abdd1660 100644 > --- a/drivers/event/dlb2/dlb2.c > +++ b/drivers/event/dlb2/dlb2.c > @@ -3897,31 +3897,45 @@ dlb2_hw_dequeue_sparse(struct dlb2_eventdev *dlb2, > while (num < max_num) { > struct dlb2_dequeue_qe qes[DLB2_NUM_QES_PER_CACHE_LINE]; > int num_avail; > + > if (use_scalar) { > + int n_iter = 0; > + uint64_t m_rshift, m_lshift, m2_rshift, m2_lshift; > + > num_avail = dlb2_recv_qe_sparse(qm_port, qes); > num_avail = RTE_MIN(num_avail, max_num - num); > dlb2_inc_cq_idx(qm_port, num_avail << 2); > if (num_avail == DLB2_NUM_QES_PER_CACHE_LINE) > - num += dlb2_process_dequeue_four_qes(ev_port, > - qm_port, > - &events[num], > - &qes[0]); > + n_iter = dlb2_process_dequeue_four_qes(ev_port, > + qm_port, > + &events[num], > + &qes[0]); > else if (num_avail) > - num += dlb2_process_dequeue_qes(ev_port, > + n_iter = dlb2_process_dequeue_qes(ev_port, > qm_port, > &events[num], > &qes[0], > num_avail); > + num += n_iter; > + /* update rolling_mask for vector code support */ > + m_rshift = qm_port->cq_rolling_mask >> n_iter; > + m_lshift = qm_port->cq_rolling_mask << (64 - n_iter); > + m2_rshift = qm_port->cq_rolling_mask_2 >> n_iter; > + m2_lshift = qm_port->cq_rolling_mask_2 << > + (64 - n_iter); > + qm_port->cq_rolling_mask = (m_rshift | m2_lshift); > + qm_port->cq_rolling_mask_2 = (m2_rshift | m_lshift); > } else { /* !use_scalar */ > num_avail = dlb2_recv_qe_sparse_vec(qm_port, > &events[num], > max_num - num); > - num += num_avail; > dlb2_inc_cq_idx(qm_port, num_avail << 2); > + num += num_avail; > DLB2_INC_STAT(ev_port->stats.traffic.rx_ok, num_avail); > } > if (!num_avail) { > - if (num > 0) > + if ((timeout == 0) || (num > 0)) > + /* Not waiting in any form or 1+ events recd */ > break; > else if (dlb2_dequeue_wait(dlb2, ev_port, qm_port, > timeout, start_ticks)) > -- > 2.23.0 >