From patchwork Wed Jan 31 07:54:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geetha sowjanya X-Patchwork-Id: 19710 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1743797dyb; Wed, 31 Jan 2024 00:22:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFMpr1jvPRaxArOF0cEiKDcyQKpOHJPwQaxJMo2YtfdNdAZSyv4HpVjpUIAfuSo6jRXlpAE X-Received: by 2002:a05:6870:e09:b0:218:5527:2b67 with SMTP id mp9-20020a0568700e0900b0021855272b67mr1131040oab.5.1706689356681; Wed, 31 Jan 2024 00:22:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706689356; cv=pass; d=google.com; s=arc-20160816; b=eO3Oa5eDJhX6k407mbFiC3dU3ahOq390c9QnqjYOj9efbs+QbQDS+SImj0aM5giGLg zqmjGcuZON/J1AW3nVGqjuxd/HJCX1kA9abThD/KK52agTpxv1X1IguuxTaRp79ps0wW g1CJy6paNRFNGzxtJLwHPSDw2X/LoEUJq8RbVHVqA3CwLGtb/Lad314fYbeeV+Ym5RcN nf1HF1nyJ0Bp+hAQTAKXcksMgsSiovMTRSiD65GE39hvA7KIR/0npO+FyTVeeYk0ghGr zm6v8wFPIKOgoScqH/lJVE5oGMuUTuxxaE0DJba0JDcyq6Kqy9uGsZLY5l7B16LmAW55 KPLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=ddK/t4zmxUxGOtboW7SIg6Tqsmf8tZCG4JAxK5QM2fE=; fh=J8Xx+8MxNleZHCs0kAJrQnVysDlGzyRT2eKMB7BdNzk=; b=kVcTvAl+OwkZJy7PWKkHKqmA9X9z8B97WkJwhJU0XecgwNBvN+qT79f+VCL5dngO6D TQbk3H7HV3wMyyL4DgHePRMump7K/hqBhsWL+cg2gWirhhXA2IgfaUg4SBgz0vS8Dl/P PBmgNLQoWRC6tpIfmWdWtBpj/p77p32LT2N1IrQ6XRMq3DEn2rp5YsQVDhmei+JCbUju 2VZn/kdTpdAj5OPFhIJnsXjQVQOHbtvRtwLBN+iLOIO3lzhiYo5wKvICf+rNWFAT41Bz fpPoT6jPHx+vgOz0JC1AVMpGqvR9ZPA4HxUkzZItr/6CoggklHzSZb/9kAQfTBjfX3r+ Zu6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=cw8YYKqN; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-45983-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45983-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com X-Forwarded-Encrypted: i=1; AJvYcCVTpOStaG4eT3fVgGjeFfZiBmR6rztTPW6EIreQp4+/dE4/MUMhI8o5WvHWN8q+rDjD+6Ajh+N3kMPURJLEZGAfUb/s8Q== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id f28-20020a63381c000000b005cde3cc04c5si9048444pga.821.2024.01.31.00.22.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 00:22:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45983-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=cw8YYKqN; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-45983-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45983-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.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 060F4B2488C for ; Wed, 31 Jan 2024 08:20:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41BF95B5DB; Wed, 31 Jan 2024 08:19:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="cw8YYKqN" Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (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 ECA1B5D739; Wed, 31 Jan 2024 08:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706689183; cv=none; b=hr6Rx34ZnCLBTNHFAaV4vT5j3mqhaBAHF4JMW+Y0ce9+DRnwaKEL3YMmC+IiFcMdJLQ1LR5eVGhlA+eEHJue46eGM7pJWJC6CiFUCClDJpp1zSxu6ECm1csc0BcXXE1NKvR8SSn0j8sAHRW0+A32M/WVKcTXv1I8l2YVO8NtVtw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706689183; c=relaxed/simple; bh=roonl72rZoCY0eRCPNI1fFfaZaXU4SJaWKrmE9lbXwk=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=pdCCt6DGxK8PHNYfFfz342stInc/AGARE8rgIj9fp33uTDrOruzwdviYEKHIbc0Trtx+vYIU7tyGq071ZdsLLUv1g8ZiNWzN7juXiPYD2qtIx0X+61UEU9TAMWPQGD4MlVx1G1vAiaMOBfQMnCZkk3E53feF48yyu8+N/TjgRxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=cw8YYKqN; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40V5BJEn005588; Tue, 30 Jan 2024 23:54:47 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= pfpt0220; bh=ddK/t4zmxUxGOtboW7SIg6Tqsmf8tZCG4JAxK5QM2fE=; b=cw8 YYKqNyUhXdOYA7Qjp2mPYh5bKzsRJDX4BCq2fyKstYvGE9Kltwas/7EaoEiLwpxL YMYrB+A8Ana9ZGVsqJ/rA6dut1E6vGMOxsYCLqFyTMYujdYPvklzDXgeQsSwiOqk I4/JRIwcDNw+RkeDFGxjajvm6rsCrOooisEylvPXnZPux8db8txvMoNdtlNXgUuy 02iWv3iZCaEQAA6feQ65FvQZ6E05WCKtPgnv37QmtPug7/tu7OAUCvHfyjJO6k/6 MuzEwFo/bbbiH8BePda+XgBh6jav5oPIzVJUHmT6RaB+g1oMmpEN0ERmwZJt3HGn S8muNXelSqnOondhN+A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3vy64ka98x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jan 2024 23:54:47 -0800 (PST) Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 30 Jan 2024 23:54:45 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 30 Jan 2024 23:54:45 -0800 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id 398525B694D; Tue, 30 Jan 2024 23:54:41 -0800 (PST) From: Geetha sowjanya To: , CC: , , , , , , , Subject: [PATCH v2 0/2] Dynamically allocate BPIDs for LBK Date: Wed, 31 Jan 2024 13:24:39 +0530 Message-ID: <20240131075441.17227-1-gakula@marvell.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: -Log7YDWi1FvVNTg10i6h1ki5MJTJ8hp X-Proofpoint-ORIG-GUID: -Log7YDWi1FvVNTg10i6h1ki5MJTJ8hp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-31_03,2024-01-30_01,2023-05-22_02 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789593498549313422 X-GMAIL-MSGID: 1789593498549313422 In current driver 64 BPIDs are reserved for LBK interfaces. These bpids are 1-to-1 mapped to LBK interface channel numbers. In some usecases one LBK interface required more than one bpids and in some case they may not require at all. These usescas can't be address with the current implementation as it always reserves only one bpid per LBK channel. This patch addresses this issue by creating free bpid pool from these 64 bpids instead of 1-to-1 mapping to the lbk channel. Now based on usecase LBK interface can request a bpid using (bp_enable()). v1 -> v2: - Modified commit message. - Dropped patch2, as for now rvu netdev have no usecase. Will be upstream along with the CPT driver. - Addressed review comments by Simon Horman. Geetha sowjanya (2): octeontx2-af: Create BPIDs free pool octeontx2-af: Cleanup loopback device checks .../net/ethernet/marvell/octeontx2/af/mbox.h | 2 + .../net/ethernet/marvell/octeontx2/af/rvu.c | 14 +- .../net/ethernet/marvell/octeontx2/af/rvu.h | 21 +- .../ethernet/marvell/octeontx2/af/rvu_nix.c | 179 ++++++++++++++---- .../ethernet/marvell/octeontx2/af/rvu_npc.c | 8 +- .../ethernet/marvell/octeontx2/af/rvu_reg.h | 3 + .../ethernet/marvell/octeontx2/af/rvu_sdp.c | 6 +- 7 files changed, 181 insertions(+), 52 deletions(-) Reviewed-by: Jiri Pirko