From patchwork Sat Dec 23 02:55:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 182898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1462804dyi; Fri, 22 Dec 2023 19:09:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0kTKHPBejnEIo0ONWSKqS7E+1hUojiXADMO8OzNaSNz4fnzZYJ6o3D9NF2kVeYT4ovSTh X-Received: by 2002:a05:6a20:4290:b0:190:c386:3eb6 with SMTP id o16-20020a056a20429000b00190c3863eb6mr3008064pzj.101.1703300967633; Fri, 22 Dec 2023 19:09:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703300967; cv=none; d=google.com; s=arc-20160816; b=zPhZElwYBb9LzCeql+7qBPId4UvWYTvkMyo0kbg3UOomkWL2bv0zYwDC/eAeWda+8y eCGmd5P8ZopbvdrBLO3nLkOBKLbG5osFQ7g43Z0aHcs4HhTx7MmqwEFtnkC8LuRuJTYX zVGtBzP+c5ldH4dflR8k9wJRm9W7MgsUY0yKrqjY0vwXEE0vWcvszIrtfljPZLcxXkaa 40s9qoXeVPiuRW1Pc1UsEVzxGed8seALSm0d3ywywhzlUs0RsntOFmiY9WHDjYitm69N Tssd0IjOir7hpwRMN5H08tea7HNs3sNEg3DWI8ZYgXuUDHk8/QQq3zGUHhDak/fxbwUB FjRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MXZcmWtwxPlnXaSZNKau+96pXIIXiNn0GvZBsjpPjjU=; fh=J3H3jkZRTdH/CD0R7uXO8r43FYFiJ1FqB2ouoqeBxmQ=; b=zlydww4+LVtUmbqYoUb3GOJRRl6XWBt2G84B22lToCYVqYYZCbD6I1c/Jh9W3RQ2co KokUNgZAaa6kJ+GFnQnbZZACv8OJ1Mx6Kj1TgEt/duObeuksEE8yaafgUkWxcSPdUHtq pqi325X5OYCXff9ixXV+9J1FlPwljxOnRMK9k7fJLi0aAvOgIkGbgdtvOuZli91ntNZn oSRNInrko+y+kGbwmJl6qA+5fVkPFFEMutHrtFtyjrQ+LP9LyEipNILjjpOp9nrxpTd0 6ZTH9FaEyY2d+fKfiVptNEYDglIdhwjLg//JuA16QHCXXRvg6gcbgFt1v26u3J+l9eg3 3jTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z7U6cbn7; spf=pass (google.com: domain of linux-kernel+bounces-10244-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10244-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h184-20020a6383c1000000b005cdfd6c1a12si1232952pge.431.2023.12.22.19.09.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 19:09:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10244-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z7U6cbn7; spf=pass (google.com: domain of linux-kernel+bounces-10244-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10244-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 16D32B21FC7 for ; Sat, 23 Dec 2023 03:08:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 198E53BB41; Sat, 23 Dec 2023 02:59:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Z7U6cbn7" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 461603A8EF; Sat, 23 Dec 2023 02:59:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703300393; x=1734836393; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iIBWKyIWEBkirTUyFRzlT8kDZ54sFD3qq2HToLFVqMI=; b=Z7U6cbn73RX3JgTSbztC91KjkplTW/3AIFA3gepFZNeXLjZZKdMTduGU hmqgCLQksrK6QPCnpkUnhd65jZwoCSEf0n1+mAFvg3mA6MiEePWXRILf1 zmcPkKCeFYrn6P2NFQ2VAaCpJ+GyIQqRiAspLujdyQbtdg89ObayxBM6T suL0snSROuhvBN2GkeGfRe05Q9r2alR6oVks4+mkKE1KATZ44QMVYstkG MPT1Bi7kQUfDQ8r4akxTxJWE8oFRyMeM+6lnroGNHLWAz3IPhhNcjIgIh Pk60YPK7RHu6gIuyUDlXUCdfB1nZkhKDGSKYLsFnYNx3L5foufAb7t0IA Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10932"; a="386611059" X-IronPort-AV: E=Sophos;i="6.04,298,1695711600"; d="scan'208";a="386611059" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2023 18:59:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,298,1695711600"; d="scan'208";a="25537655" Received: from newjersey.igk.intel.com ([10.102.20.203]) by orviesa001.jf.intel.com with ESMTP; 22 Dec 2023 18:59:50 -0800 From: Alexander Lobakin To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexander Lobakin , Maciej Fijalkowski , Michal Kubiak , Larysa Zaremba , Alexei Starovoitov , Daniel Borkmann , Willem de Bruijn , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RFC net-next 28/34] idpf: add relative queue id member to idpf_queue Date: Sat, 23 Dec 2023 03:55:48 +0100 Message-ID: <20231223025554.2316836-29-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231223025554.2316836-1-aleksander.lobakin@intel.com> References: <20231223025554.2316836-1-aleksander.lobakin@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786040515240866799 X-GMAIL-MSGID: 1786040515240866799 From: Michal Kubiak Relative queue id is one of the required fields of the Tx queue description in VC 2.0 for splitq mode. In the current VC implementation all Tx queues are configured together, so the relative queue id (the index of the Tx queue in the queue group) can be computed on the fly. However, such a solution is not flexible because it is not easy to configure a single Tx queue. So, instead, introduce a new structure member in 'idpf_queue' dedicated to storing the relative queue id. Then send that value over the VC. This patch is the first step in making the existing VC API more flexible to allow configuration of single queues. Signed-off-by: Michal Kubiak Signed-off-by: Alexander Lobakin --- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 1 + drivers/net/ethernet/intel/idpf/idpf_txrx.h | 2 ++ drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c index 99c9b889507b..3dc21731df2f 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c @@ -1276,6 +1276,7 @@ static int idpf_txq_group_alloc(struct idpf_vport *vport, u16 num_txq) q->tx_min_pkt_len = idpf_get_min_tx_pkt_len(adapter); q->vport = vport; q->txq_grp = tx_qgrp; + q->relative_q_id = j; if (!flow_sch_en) continue; diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.h b/drivers/net/ethernet/intel/idpf/idpf_txrx.h index fa21feddd204..f32d854fe850 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.h +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.h @@ -665,6 +665,8 @@ struct idpf_queue { dma_addr_t dma; unsigned int size; + + u32 relative_q_id; } ____cacheline_internodealigned_in_smp; /** diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c index 59b8bbebead7..49a96af52343 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c @@ -1491,7 +1491,8 @@ static int idpf_send_config_tx_queues_msg(struct idpf_vport *vport) qi[k].tx_compl_queue_id = cpu_to_le16(tx_qgrp->complq->q_id); - qi[k].relative_queue_id = cpu_to_le16(j); + qi[k].relative_queue_id = + cpu_to_le16(q->relative_q_id); if (test_bit(__IDPF_Q_FLOW_SCH_EN, q->flags)) qi[k].sched_mode =