From patchwork Fri Jan 5 20:38:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinas Rasheed X-Patchwork-Id: 18776 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6457675dyb; Fri, 5 Jan 2024 12:38:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaCEJ40w85O5rDHa81NIiLW8Yh2Z0aBaeE+TsOhq05giSlmdXY5g6Gvrdji4Si+GFLbTro X-Received: by 2002:a17:906:c384:b0:a28:5d9b:2384 with SMTP id t4-20020a170906c38400b00a285d9b2384mr1042278ejz.152.1704487136732; Fri, 05 Jan 2024 12:38:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704487136; cv=none; d=google.com; s=arc-20160816; b=FcHnGVVvRmqy5UqyMqKgItnS4nwyPss7PadvTs6ybMLAl5qAMBfZhTdIWuMPzMNHyo mIAeYbc+wgYjmJL9RSs6bax53dmelASsYxQj9d7koZmp39nqpVJuCA4KrVHRtIOlLqE3 Sgm0u001SWbvL/nZOqRd8316lxiT/P9G5/u4Nlbw2Ak6sdeGqntgABOHkDVbibtZV29x ws3hfbnQE1MA3NqA23gmQLvUHvjCOuBGXpAk9Gi498C6IekzOyAGGNx/CjeOf/hKnjd9 h5GNPijCXRZVEoUcUXj1FUQjKNe9RYECgBlM9eCSJHd3bjk6XpQ1PazNZmjSBvemGjfN djYQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=oWOk6dgpyFQWjWnJKMsVT0AdrIkhUuXOktAonFhNCck=; fh=VEmtmbrSMAf7klXCiVn/miqlL6KvgVnlb9qrYPH8GrU=; b=DhuP6RIq8WSQzXWaPrdArJDfwxFnOAeG2XE65qJX6XrMr4+P0JxX1UV2fLYdeIAo61 k4JqXBTgh2ROY6OoGC5HHYYdOX1E9qpvXh9aVhQwVZgmFs9heYkH00OmlZsUCWUQ0wNt 65wMVcg8UxTtRK4HdK/0NmzT2EbsRkKZ/U/su5jcegZr0rV5K1ILV4vqbCcVgS1HmNIg B7io6Y4XdLNxx066xnbJIBt3RMZmzJzrCybRXcwxsoN7WYqttPKdJnqCPcurCtuKRDDw iP9ssK2yQDgDwa9uK9o3asPBWW20a1VFth4LRznFiaGJ2GiO66CoMHIF0J9ZJX6C//Di twpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="Et/EqkUj"; spf=pass (google.com: domain of linux-kernel+bounces-18332-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18332-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o24-20020a17090611d800b00a279f98f69bsi868197eja.792.2024.01.05.12.38.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 12:38:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18332-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="Et/EqkUj"; spf=pass (google.com: domain of linux-kernel+bounces-18332-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18332-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 368261F24606 for ; Fri, 5 Jan 2024 20:38:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B48622306; Fri, 5 Jan 2024 20:38:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="Et/EqkUj" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (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 E4F8120300; Fri, 5 Jan 2024 20:38:33 +0000 (UTC) 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 (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 405K6uqN003544; Fri, 5 Jan 2024 12:38:28 -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-transfer-encoding:content-type; s=pfpt0220; bh=oWOk6dgp yFQWjWnJKMsVT0AdrIkhUuXOktAonFhNCck=; b=Et/EqkUjW2U2nUigDMfJRdO5 GkIGnoav1m5ajdMTWMn2ha7SSAYrGSOVADzb/iadUHZ1BofBYthixMXAFVHqjfpN v6B4cNZbLN3tkvAjM1XmPwH7Udh8yHua23DHoomOIzDoW6TSCUYxbmGyp3Tq8XF8 P4eIhPJoXN0qJz15lcOZAXHf6qawmwphr/OiSVY/eZzMdPTyH95NxuXQId/ShDqN VTdOWF+Sjiv9CpZM+vWk5vXQTvSHIg1hHpJaJKSRAfHn6N6x2nf9lSffDjWvF7NX 252I34ENRJjYLF0NomDc3kYY+gltZcvkxqwL9VH9+Or9vtw1rPs1ogV73coiNA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3veaw02pq2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 05 Jan 2024 12:38:28 -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; Fri, 5 Jan 2024 12:38:26 -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; Fri, 5 Jan 2024 12:38:26 -0800 Received: from ubuntu-PowerEdge-T110-II.sclab.marvell.com (unknown [10.106.27.86]) by maili.marvell.com (Postfix) with ESMTP id C62A83F707B; Fri, 5 Jan 2024 12:38:25 -0800 (PST) From: Shinas Rasheed To: , CC: , , , , , , , , , , , Subject: [PATCH net-next v3 0/8] add octeon_ep_vf driver Date: Fri, 5 Jan 2024 12:38:15 -0800 Message-ID: <20240105203823.2953604-1-srasheed@marvell.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: LaRKrQ_8zGioyOysEd6q9lRA48GGJiTw X-Proofpoint-ORIG-GUID: LaRKrQ_8zGioyOysEd6q9lRA48GGJiTw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787284303870316945 X-GMAIL-MSGID: 1787284303870316945 This driver implements networking functionality of Marvell's Octeon PCI Endpoint NIC VF. This driver support following devices: * Network controller: Cavium, Inc. Device b203 * Network controller: Cavium, Inc. Device b403 * Network controller: Cavium, Inc. Device b103 * Network controller: Cavium, Inc. Device b903 * Network controller: Cavium, Inc. Device ba03 * Network controller: Cavium, Inc. Device bc03 * Network controller: Cavium, Inc. Device bd03 Changes: V3: - Removed UINT64_MAX, which is unused - Replaced masks and ULL declarations with GENMASK_ULL(), ULL() and other linux/bits.h macros, corrected declarations to conform to xmas tree format in patch [2/8] - Moved vfree and vzalloc null pointer casting corrections to patch [3/8], and corrected return values to follow standard kernel error codes in same - Set static budget of 64 for tx completion processing in NAPI - Replaces napi_complete and build_skb APIs to napi_complete_done and napi_build_skb APIs respectively - Replaced code with helper from net/netdev_queues.h to wake queues in TX completion processing - Removed duplicate reporting of TX/RX packets/bytes, which is already done during ndo_get_stats64 V2: https://lore.kernel.org/all/20231223134000.2906144-1-srasheed@marvell.com/ - Removed linux/version.h header file from inclusion in octep_vf_main.c - Corrected Makefile entry to include building octep_vf_mbox.c in [6/8] patch. - Removed redundant vzalloc pointer cast and vfree pointer check in [6/8] patch. V1: https://lore.kernel.org/all/20231221092844.2885872-1-srasheed@marvell.com/ Shinas Rasheed (8): octeon_ep_vf: Add driver framework and device initialization octeon_ep_vf: add hardware configuration APIs octeon_ep_vf: add VF-PF mailbox communication. octeon_ep_vf: add Tx/Rx ring resource setup and cleanup octeon_ep_vf: add support for ndo ops octeon_ep_vf: add Tx/Rx processing and interrupt support octeon_ep_vf: add ethtool support octeon_ep_vf: update MAINTAINERS .../device_drivers/ethernet/index.rst | 1 + .../ethernet/marvell/octeon_ep_vf.rst | 24 + MAINTAINERS | 9 + drivers/net/ethernet/marvell/Kconfig | 1 + drivers/net/ethernet/marvell/Makefile | 1 + .../net/ethernet/marvell/octeon_ep_vf/Kconfig | 19 + .../ethernet/marvell/octeon_ep_vf/Makefile | 10 + .../marvell/octeon_ep_vf/octep_vf_cn9k.c | 491 +++++++ .../marvell/octeon_ep_vf/octep_vf_cnxk.c | 502 +++++++ .../marvell/octeon_ep_vf/octep_vf_config.h | 160 +++ .../marvell/octeon_ep_vf/octep_vf_ethtool.c | 284 ++++ .../marvell/octeon_ep_vf/octep_vf_main.c | 1232 +++++++++++++++++ .../marvell/octeon_ep_vf/octep_vf_main.h | 334 +++++ .../marvell/octeon_ep_vf/octep_vf_mbox.c | 430 ++++++ .../marvell/octeon_ep_vf/octep_vf_mbox.h | 166 +++ .../marvell/octeon_ep_vf/octep_vf_regs_cn9k.h | 154 +++ .../marvell/octeon_ep_vf/octep_vf_regs_cnxk.h | 162 +++ .../marvell/octeon_ep_vf/octep_vf_rx.c | 510 +++++++ .../marvell/octeon_ep_vf/octep_vf_rx.h | 224 +++ .../marvell/octeon_ep_vf/octep_vf_tx.c | 330 +++++ .../marvell/octeon_ep_vf/octep_vf_tx.h | 276 ++++ 21 files changed, 5320 insertions(+) create mode 100644 Documentation/networking/device_drivers/ethernet/marvell/octeon_ep_vf.rst create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/Kconfig create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/Makefile create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_cn9k.c create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_cnxk.c create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_config.h create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.h create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_mbox.c create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_mbox.h create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_regs_cn9k.h create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_regs_cnxk.h create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.c create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.h create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_tx.c create mode 100644 drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_tx.h