Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44762C433EF for ; Mon, 6 Dec 2021 16:44:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232991AbhLFQsW (ORCPT ); Mon, 6 Dec 2021 11:48:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29257 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232427AbhLFQsV (ORCPT ); Mon, 6 Dec 2021 11:48:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638809092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0lgY0HVFZeOXKmCy6byafdaHTQFAJuWUaBogLAJPCPQ=; b=CVacVWx1urLT3Nip2ETtmhLC6Dxf3i0te8vZNp2sCraKBfbDcClK5XOp4Q281fjzKCxLwe FOfvq7oEyPruBG+0zoMmmMAUycDFBsF5T7sillGcRxwxldi0VLkFSFkje2t9o+I4/vdGsw 8yJiuUWqAxcRUH/hY3v0bfCf2/Jge1s= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-292-cTIAJPAUMo2jaFtpUIEpjQ-1; Mon, 06 Dec 2021 11:44:51 -0500 X-MC-Unique: cTIAJPAUMo2jaFtpUIEpjQ-1 Received: by mail-ed1-f72.google.com with SMTP id p4-20020aa7d304000000b003e7ef120a37so8782106edq.16 for ; Mon, 06 Dec 2021 08:44:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:date:mime-version:user-agent:cc :subject:content-language:to:references:in-reply-to :content-transfer-encoding; bh=0lgY0HVFZeOXKmCy6byafdaHTQFAJuWUaBogLAJPCPQ=; b=0BqfyRHJkt+bS5UkHWIxOJzoZfAERaLU30sW/sVtNVZjLwXc06uM/hzLG4OnVPfbz1 o+RLuszY68UulVnB2egBp0uw0EHU+bgo/pyJoQJhhiTgLWIP2lYFfH6fPd9Wc8h2jtaS aD3FfgVq3nTcVSeughSb5GEAMFjlGtxm5xs/Axb39WbdJv1d/+zF5vrkimOs7rm2TXo6 ffM7JMKt2cRDpMqWz7flSaHD2EA+o5AJe70hMs4AKCpFCbvfBVknturFp0kSHL2KQtWg ljMH9CV7O6+Y5fXpg+ZU2koZWRUs4Hw8CeOkHBQU5Nd4oCKNucxYiq8R5gOTPuuRbude XP/A== X-Gm-Message-State: AOAM531rGdLNG5XQLPvwI3BIUi6Ef0cxwDLIk6GTiXnte7s8kJ7ITLPz N1NpVCBmmZ+rTrH6F+TvI3K9d62qDY6tfalv+/plAHQLDpGPFext5lG0svmjKkhqFcpMjuNci/f cPPwRmdtfGn7MENkmjFkUNxAL X-Received: by 2002:a17:907:7da0:: with SMTP id oz32mr45896853ejc.176.1638809090273; Mon, 06 Dec 2021 08:44:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyw7d9z2kId4Cz9cF1J22OiD9Y+cMhaFzCclOQCnPX81VauO2rCY/xrJ6GffWV09i5l93Rpww== X-Received: by 2002:a17:907:7da0:: with SMTP id oz32mr45896819ejc.176.1638809090061; Mon, 06 Dec 2021 08:44:50 -0800 (PST) Received: from [192.168.2.13] (3-14-107-185.static.kviknet.dk. [185.107.14.3]) by smtp.gmail.com with ESMTPSA id qz24sm6912817ejc.29.2021.12.06.08.44.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Dec 2021 08:44:49 -0800 (PST) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Message-ID: <58a75230-917d-709d-074a-7553f8e76307@redhat.com> Date: Mon, 6 Dec 2021 17:44:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Cc: brouer@redhat.com, Emmanuel Deloget , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH RESEND 1/1] net: mvpp2: fix XDP rx queues registering Content-Language: en-US To: Louis Amas , Marcin Wojtas , Russell King , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Matteo Croce References: <20211206162051.565724-1-louis.amas@eho.link> In-Reply-To: <20211206162051.565724-1-louis.amas@eho.link> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/12/2021 17.20, Louis Amas wrote: > The registration of XDP queue information is incorrect because the > RX queue id we use is invalid. When port->id == 0 it appears to works > as expected yet it's no longer the case when port->id != 0. > > When we register the XDP rx queue information (using > xdp_rxq_info_reg() in function mvpp2_rxq_init()) we tell them to use > rxq->id as the queue id. This value iscomputed as: > rxq->id = port->id * max_rxq_count + queue_id > > where max_rxq_count depends on the device version. In the MB case, > this value is 32, meaning that rx queues on eth2 are numbered from > 32 to 35 - there are four of them. > > Clearly, this is not the per-port queue id that XDP is expecting: > it wants a value in the range [0..3]. It shall directly use queue_id > which is stored in rxq->logic_rxq -- so let's use that value instead. > > This is consistent with the remaining part of the code in > mvpp2_rxq_init(). > > Fixes: b27db2274ba8 ("mvpp2: use page_pool allocator") > Signed-off-by: Louis Amas > Signed-off-by: Emmanuel Deloget > Reviewed-by: Marcin Wojtas Acked-by: Jesper Dangaard Brouer Instead of "RESEND" please add a version number, so we can keep track which is the latest patch, IMHO this should have "V3". You also forgot to mention in subj what git-tree this is targeted towards. See netdev-FAQ[0] Track your patch progress here: https://patchwork.kernel.org/project/netdevbpf/list/?series=590985 In what I consider "V2" you also got an ACK from John: Acked-by: John Fastabend > --- > drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > index 6480696c979b..6da8a595026b 100644 > --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > @@ -2960,11 +2960,11 @@ static int mvpp2_rxq_init(struct mvpp2_port *port, > mvpp2_rxq_status_update(port, rxq->id, 0, rxq->size); > > if (priv->percpu_pools) { > - err = xdp_rxq_info_reg(&rxq->xdp_rxq_short, port->dev, rxq->id, 0); > + err = xdp_rxq_info_reg(&rxq->xdp_rxq_short, port->dev, rxq->logic_rxq, 0); > if (err < 0) > goto err_free_dma; > > - err = xdp_rxq_info_reg(&rxq->xdp_rxq_long, port->dev, rxq->id, 0); > + err = xdp_rxq_info_reg(&rxq->xdp_rxq_long, port->dev, rxq->logic_rxq, 0); > if (err < 0) > goto err_unregister_rxq_short; [0] https://www.kernel.org/doc/html/latest/networking/netdev-FAQ.html