Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1134037lqs; Fri, 14 Jun 2024 17:06:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWHz35VzYvI2uF8u6Ug+KS262NJZTmNlo4tkKifM2R9Es0PGTEisUzo3suf2/P5iqrwc6ddHkHzNx6iBlg4FhTYc9XxMMBokIi4RWZ4ZQ== X-Google-Smtp-Source: AGHT+IG8hWHbOAHiHkxqrDTgWhVdTKg1umaLzlakmEQOvGtHEp3XlXn3PKE5UCHYhbf5ckViVJAT X-Received: by 2002:a17:906:33da:b0:a6f:1445:9de8 with SMTP id a640c23a62f3a-a6f60dc4f22mr323686766b.54.1718409967166; Fri, 14 Jun 2024 17:06:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718409967; cv=pass; d=google.com; s=arc-20160816; b=0htG5JLTmHKFfFzCfjD9Te5mW0bCwcFaTokOjmdPWt3cLqLUU82iDV9nQoUsKi2Cli rzfdsT3dQ1bB3oQmADK05NpMoYbszsrvKWsp3nHL1pHuJJQLx94uoW5tRhUKgHp38yQj FUdoXzKPKIoTI0NrkeOjLfoGSURKicxls/wp8gHnrvjnrrCC9h/idy+aKnV2j9I99sbA JJ1PNIBbvONnFRvnkBwtZSP7cbSSb9wM/98z3BPEB/gJ0TslWltJUrt1l6ocbv3oOR2u x1r8D5OQmyxFSefjWRlCFE9Kt7UhCq5LTHNn/NdeaGI3SYCeNCnPyKM/USG7GTJ3MfT8 96Zw== ARC-Message-Signature: i=2; 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 :subject:cc:to:from:date:dkim-signature; bh=c21Xnr26mF4XhO4v24lG8CYkDryUnaevoVevI7wRSgQ=; fh=N0oSx7g7MGqzcj6jzEYv16BYGHMx2xR+0hSvozunbVg=; b=ZUjBhb+0va9Kjz0AJT1xIPyFIXx8jmf4WLHZieyZlHnu7MIzfhNoSD6R+Dx39LORqP /4DjwD68n/ZXUpulY8kic6OQjHREx4s9MZtp1D63vS6/i6Yr/2BZ3xzFeDLhGYjAsg0k YD0H5x0ZelaLR/hjTImB9x31J3QONJ8Hjr7+AVL68DPleaYnjmEBx9UiW6HfJpdwBspm I5c69w+W2SC+AbUQOs9ejBwMDqo5+Az0EpuJIyHjBtmvi7PERCl4oKfWSxV8C4ZKtHOQ jvaThfr9R1A0g4+ztmx0VlUSlxI0fbyYh/IJSX/bJtQ7Oi3NRb8uOpSuU/Cpd5DpBi1B 2QeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@networkplumber-org.20230601.gappssmtp.com header.s=20230601 header.b=0MSXZg8C; arc=pass (i=1 spf=pass spfdomain=networkplumber.org dkim=pass dkdomain=networkplumber-org.20230601.gappssmtp.com dmarc=pass fromdomain=networkplumber.org); spf=pass (google.com: domain of linux-kernel+bounces-215616-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215616-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=networkplumber.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56e3b49dsi212169466b.823.2024.06.14.17.06.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 17:06:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215616-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20230601.gappssmtp.com header.s=20230601 header.b=0MSXZg8C; arc=pass (i=1 spf=pass spfdomain=networkplumber.org dkim=pass dkdomain=networkplumber-org.20230601.gappssmtp.com dmarc=pass fromdomain=networkplumber.org); spf=pass (google.com: domain of linux-kernel+bounces-215616-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215616-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=networkplumber.org 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 B184F1F22428 for ; Sat, 15 Jun 2024 00:06:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6220C33C8; Sat, 15 Jun 2024 00:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20230601.gappssmtp.com header.i=@networkplumber-org.20230601.gappssmtp.com header.b="0MSXZg8C" Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A47DC624 for ; Sat, 15 Jun 2024 00:05:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718409953; cv=none; b=CeY3YtWTyKrslus2aMdYZdruowL3zZFysf/c+CbB/jgC+v1/F3bwTACI3UpcjHhtune1FWgfzx9xhrQQY9YWApdoKOXjjhUOfCC6w8n0poLCFS9AnIz4+7kpU59EaeJx4/2QZkdL2kBYryohh7U4n3f4KA6NykXHqoMW7HfZ9Is= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718409953; c=relaxed/simple; bh=f6AoYhX2XyzT+ZH0EktrmSnDM4D3zhudlPqVu/nrjns=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YtsGowp6eaT9osFh2Qqk7NbZuSS6HUYfQ9rjIrp5vxQP4PuAgPF8I6bXU2gXe/WlhUZs9boo73EXdxeSuRNxPvzByvmpEsTkOfPNOBtTjknoQFIyA+QKKUwXQB3GsieLVJGXGcvf0BVvlBgnbwSINothFHEw1Ix/6j0+EsPmOLw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org; spf=pass smtp.mailfrom=networkplumber.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20230601.gappssmtp.com header.i=@networkplumber-org.20230601.gappssmtp.com header.b=0MSXZg8C; arc=none smtp.client-ip=209.85.215.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=networkplumber.org Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-6c4926bf9baso2267551a12.2 for ; Fri, 14 Jun 2024 17:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1718409951; x=1719014751; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=c21Xnr26mF4XhO4v24lG8CYkDryUnaevoVevI7wRSgQ=; b=0MSXZg8CqtR1DAOlvKfLZM5qykyu832wLgqtz53yfABK2/qNcNy6klqSu/6+KihLGe SEF/F1BThMGlrBM8bkr/I5yEYHprNTwNzugD+WoXvVzuFeDMf4NX/CeaIuRajcheefX8 MHthXF23rggit3Hgox1mW1VqqIHg5nsW4F4RcOLSY8b3F6JdGtJ5GnkQitlZhuj3AmBD 3BcRExcb09vADiQtEQert2rhbC5dPW7o3RequLC3g/3J32QxmHs52WAwB9FATzIuAjLc Sx1cXqpyQ/ICGkpn/jfoC2CbTI76TOgCqupwT7mjZugX8fwJbi55l9NbA4kHtZ2S+AoS 3yGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718409951; x=1719014751; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c21Xnr26mF4XhO4v24lG8CYkDryUnaevoVevI7wRSgQ=; b=Hvma+gNRB83KB5iKovtQu3Ga0nrQWhGl7bPYvENXVPUOs6m9xcKk82HYrrfelCpEKj 14UxBNoXzqhtgJ3erTzTpTOKFAV81DfYsLJVQ0W7AI2npBlXDsxev0eLMCe5nVs/5lki xzjNwQJMhChSJhyKpLzkjigbOFX+HZRmxe9HfWA609bB8cyjGOhJwwZw5nHYzWOxDt9p 50HNalCRaJTjd/NrqAKR0/JSNRXwhwAiZlUy0N8fxeXiAtzWcW2mD9epux69JE06rk/+ GzTav2gv0bZTkDE4TqWQFPGoJO0EPVcUI9jN4qdbuiiJcuu7JTpJh+PK8RujB/K5h76L dOqA== X-Gm-Message-State: AOJu0YwU35TQvknD/bM791AJlEPXhhjZo8Wz4pYw2Lq+nxvNwUx9GBiW 7DkQAFod5XiKzcVXkmFJ8M/JRnvNvphM7Qn0attjYziwlGjkUQ6DgStI49Tk8Vo= X-Received: by 2002:a17:903:1250:b0:1f7:2050:9a76 with SMTP id d9443c01a7336-1f8625c0d68mr49770465ad.8.1718409950685; Fri, 14 Jun 2024 17:05:50 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855f17f92sm37976575ad.221.2024.06.14.17.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 17:05:50 -0700 (PDT) Date: Fri, 14 Jun 2024 17:05:48 -0700 From: Stephen Hemminger To: Omer Shpigelman Cc: linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, ogabbay@kernel.org, zyehudai@habana.ai Subject: Re: [PATCH 01/15] net: hbl_cn: add habanalabs Core Network driver Message-ID: <20240614170548.188ead0d@hermes.local> In-Reply-To: <20240613082208.1439968-2-oshpigelman@habana.ai> References: <20240613082208.1439968-1-oshpigelman@habana.ai> <20240613082208.1439968-2-oshpigelman@habana.ai> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > +#define HBL_AUX2NIC(aux_dev) \ > + ({ \ > + struct hbl_aux_dev *__aux_dev = (aux_dev); \ > + ((__aux_dev)->type == HBL_AUX_DEV_ETH) ? \ > + container_of(__aux_dev, struct hbl_cn_device, en_aux_dev) : \ > + container_of(__aux_dev, struct hbl_cn_device, ib_aux_dev); \ > + }) > + > +#define RAND_STAT_CNT(cnt) \ > + do { \ > + u32 __cnt = get_random_u32(); \ > + (cnt) = __cnt; \ > + dev_info(hdev->dev, "port %d, %s: %u\n", port, #cnt, __cnt); \ > + } while (0) > + > +struct hbl_cn_stat hbl_cn_mac_fec_stats[] = { > + {"correctable_errors", 0x2, 0x3}, > + {"uncorrectable_errors", 0x4, 0x5} > +}; > + These tables should be marked const? > +struct hbl_cn_stat hbl_cn_mac_stats_rx[] = { > + {"Octets", 0x0}, > + {"OctetsReceivedOK", 0x4}, > + {"aAlignmentErrors", 0x8}, > + {"aPAUSEMACCtrlFramesReceived", 0xC}, > + {"aFrameTooLongErrors", 0x10}, > + {"aInRangeLengthErrors", 0x14}, > + {"aFramesReceivedOK", 0x18}, > + {"aFrameCheckSequenceErrors", 0x1C}, > + {"VLANReceivedOK", 0x20}, > + {"ifInErrors", 0x24}, > + {"ifInUcastPkts", 0x28}, > + {"ifInMulticastPkts", 0x2C}, > + {"ifInBroadcastPkts", 0x30}, > + {"DropEvents", 0x34}, > + {"Pkts", 0x38}, > + {"UndersizePkts", 0x3C}, > + {"Pkts64Octets", 0x40}, > + {"Pkts65to127Octets", 0x44}, > + {"Pkts128to255Octets", 0x48}, > + {"Pkts256to511Octets", 0x4C}, > + {"Pkts512to1023Octets", 0x50}, > + {"Pkts1024to1518Octets", 0x54}, > + {"Pkts1519toMaxOctets", 0x58}, > + {"OversizePkts", 0x5C}, > + {"Jabbers", 0x60}, > + {"Fragments", 0x64}, > + {"aCBFCPAUSERx0", 0x68}, > + {"aCBFCPAUSERx1", 0x6C}, > + {"aCBFCPAUSERx2", 0x70}, > + {"aCBFCPAUSERx3", 0x74}, > + {"aCBFCPAUSERx4", 0x78}, > + {"aCBFCPAUSERx5", 0x7C}, > + {"aCBFCPAUSERx6", 0x80}, > + {"aCBFCPAUSERx7", 0x84}, > + {"aMACControlFramesReceived", 0x88} > +}; > + > +struct hbl_cn_stat hbl_cn_mac_stats_tx[] = { > + {"Octets", 0x0}, > + {"OctetsTransmittedOK", 0x4}, > + {"aPAUSEMACCtrlFramesTransmitted", 0x8}, > + {"aFramesTransmittedOK", 0xC}, > + {"VLANTransmittedOK", 0x10}, > + {"ifOutErrors", 0x14}, > + {"ifOutUcastPkts", 0x18}, > + {"ifOutMulticastPkts", 0x1C}, > + {"ifOutBroadcastPkts", 0x20}, > + {"Pkts64Octets", 0x24}, > + {"Pkts65to127Octets", 0x28}, > + {"Pkts128to255Octets", 0x2C}, > + {"Pkts256to511Octets", 0x30}, > + {"Pkts512to1023Octets", 0x34}, > + {"Pkts1024to1518Octets", 0x38}, > + {"Pkts1519toMaxOctets", 0x3C}, > + {"aCBFCPAUSETx0", 0x40}, > + {"aCBFCPAUSETx1", 0x44}, > + {"aCBFCPAUSETx2", 0x48}, > + {"aCBFCPAUSETx3", 0x4C}, > + {"aCBFCPAUSETx4", 0x50}, > + {"aCBFCPAUSETx5", 0x54}, > + {"aCBFCPAUSETx6", 0x58}, > + {"aCBFCPAUSETx7", 0x5C}, > + {"aMACControlFramesTx", 0x60}, > + {"Pkts", 0x64} > +}; > + > +static const char pcs_counters_str[][ETH_GSTRING_LEN] = { > + {"pcs_local_faults"}, > + {"pcs_remote_faults"}, > + {"pcs_remote_fault_reconfig"}, > + {"pcs_link_restores"}, > + {"pcs_link_toggles"}, > +}; > + > +static size_t pcs_counters_str_len = ARRAY_SIZE(pcs_counters_str); > +size_t hbl_cn_mac_fec_stats_len = ARRAY_SIZE(hbl_cn_mac_fec_stats); > +size_t hbl_cn_mac_stats_rx_len = ARRAY_SIZE(hbl_cn_mac_stats_rx); > +size_t hbl_cn_mac_stats_tx_len = ARRAY_SIZE(hbl_cn_mac_stats_tx); > + > +static void qps_stop(struct hbl_cn_device *hdev); > +static void qp_destroy_work(struct work_struct *work); > +static int __user_wq_arr_unset(struct hbl_cn_ctx *ctx, struct hbl_cn_port *cn_port, u32 type); > +static void user_cq_destroy(struct kref *kref); > +static void set_app_params_clear(struct hbl_cn_device *hdev); > +static int hbl_cn_ib_cmd_ctrl(struct hbl_aux_dev *aux_dev, void *cn_ib_ctx, u32 op, void *input, > + void *output); > +static int hbl_cn_ib_query_mem_handle(struct hbl_aux_dev *ib_aux_dev, u64 mem_handle, > + struct hbl_ib_mem_info *info); > + > +static void hbl_cn_reset_stats_counters_port(struct hbl_cn_device *hdev, u32 port); > +static void hbl_cn_late_init(struct hbl_cn_device *hdev); > +static void hbl_cn_late_fini(struct hbl_cn_device *hdev); > +static int hbl_cn_sw_init(struct hbl_cn_device *hdev); > +static void hbl_cn_sw_fini(struct hbl_cn_device *hdev); > +static void hbl_cn_spmu_init(struct hbl_cn_port *cn_port, bool full); > +static int hbl_cn_cmd_port_check(struct hbl_cn_device *hdev, u32 port, u32 flags); > +static void hbl_cn_qps_stop(struct hbl_cn_port *cn_port); Can you reorder code so forward declarations are not required?