From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: Re: [bpf-next V1-RFC PATCH 02/14] xdp/mlx5: setup xdp_rxq_info and extend with qtype Date: Thu, 14 Dec 2017 07:46:12 +0100 Message-ID: <20171214074612.2afda1d0@redhat.com> References: <151316391502.14967.13292358380181773729.stgit@firesoul> <151316397109.14967.10661226040285486466.stgit@firesoul> <20171213144439.2036c59b@redhat.com> <19c7c7f3-2db5-6f90-648f-78e8da92d862@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Tariq Toukan , Daniel Borkmann , Alexei Starovoitov , netdev@vger.kernel.org, dsahern@gmail.com, Matan Barak , gospo@broadcom.com, bjorn.topel@intel.com, michael.chan@broadcom.com, brouer@redhat.com To: Saeed Mahameed Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45224 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750873AbdLNGqV (ORCPT ); Thu, 14 Dec 2017 01:46:21 -0500 In-Reply-To: <19c7c7f3-2db5-6f90-648f-78e8da92d862@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 13 Dec 2017 15:03:33 -0800 Saeed Mahameed wrote: > >>> @@ -707,6 +714,8 @@ static void mlx5e_free_rq(struct mlx5e_rq *rq) > >>> if (rq->xdp_prog) > >>> bpf_prog_put(rq->xdp_prog); > >>> > >>> + xdp_rxq_info_unreg(&rq->xdp_rxq); > >>> + > >>> switch (rq->wq_type) { > >>> case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ: > >>> mlx5e_rq_free_mpwqe_info(rq); > >>> @@ -2768,6 +2777,11 @@ static int mlx5e_alloc_drop_rq(struct > >>> mlx5_core_dev *mdev, if (err) > >>> return err; > >>> > >>> + /* XDP RX-queue info for "Drop-RQ", packets never reach > >>> XDP */ > >>> + xdp_rxq_info_init(&rq->xdp_rxq); > >>> + xdp_rxq_info_type(&rq->xdp_rxq, RXQ_TYPE_SINK); > >>> + xdp_rxq_info_reg(&rq->xdp_rxq); > >>> + > > I don't see why you need this, This RQ is not even assigned to any > netdev_rxq! it is a pure HW object that drops traffic in HW when netdev > is down, it even has no buffers or napi handling, just ignore it's > existence for the sake of mlx5 xdp_rxq_info reg/unreg stuff and remove > RXQ_TYPE_SINK, bottom line it is not a real RQ and for sure XDP has > nothing to do with it. I need it here, because the take-down/free code-path is the same for these two types of RQ's. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer