Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1137734lqs; Fri, 14 Jun 2024 17:16:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWppbOMOoAQNB/pntvcBfKjvzZ2momqx4/80oeuksaNZUFASVZlwGF4IxfiQBmwCqKDRqJ12Bw+leouz17Kn6MaGdZt/bAOThQgsDGJnw== X-Google-Smtp-Source: AGHT+IHFYs0z3NLTm83Rf5mZlDa7x2q+Dfl3pe+OlC8z6fGdRpKQCrowRpGST7PkmtgFZHnc4EF3 X-Received: by 2002:a05:6102:4a2:b0:48d:96a4:a65d with SMTP id ada2fe7eead31-48dae3d7399mr4159717137.23.1718410595130; Fri, 14 Jun 2024 17:16:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718410595; cv=pass; d=google.com; s=arc-20160816; b=YOy8kbllfYSDem8Cpv43bQ7rZzS+S24j5ahkLo6SKf7PUdaZz4M0gAzisaFEsRebDC 1Gua13rBJcZhY2dIW6Wgr6Wn55YsH3+pe3+hFcH0fXCrzFGOgF05Tx81/i58Hp/iEYd1 AwcHocd7cD5IC6DswYVNWdZEakXN8vwfWMruIDCpOrGQDD/XiS2R/qQKKAenVhkhrZvX atdemLew5lvuAtP+zjQERDnClTc4RYus2bsHOpJtix2l9LI6tAw1tNL5zo/i6L7rU456 /EtQNgUqiQFJDzeOO0OcPtEM/k4Aq8o2WmzCaxPYh0pm6Nkw/SQIFPg8ADcnvBYkPpQN dakA== 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=dbQfy6Bm8n8TNDG5hBa+dXfTA5IW7C1pPdTr7l75iCw=; fh=N0oSx7g7MGqzcj6jzEYv16BYGHMx2xR+0hSvozunbVg=; b=szCeAYekxwIQmXplSipIBIcfSZtIy2Dd7+trFrWEUizs9836/SEMprp7sEic3oDSxQ WQrn1wfTrroQF2s6R/JQYYLDBheoVXzWg5aeulaviRETmI8IGgzBLn3bD34O7CiydJOG LR2HeLNVF7bvIdfQurddG+gDlaQArmQXBtgx0FHFwO2/fTbXQCNEQv60wejohyDXLadz Zc1adcel2rQWOSQ6H5Xr4e/Bzy53zxpT3b58EmASxsa9DRd2K1+uGuRiYWKPD6/jA5At W1XMNRsU8N+ym6x7Tci51YRTaer+YemRAf4irULDq3b0+XuQ4ywsHu5go1kKvJbyhRIL f6hA==; 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=UTUX4AJr; 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-215619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215619-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=networkplumber.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-798abd166f7si369644185a.432.2024.06.14.17.16.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 17:16:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20230601.gappssmtp.com header.s=20230601 header.b=UTUX4AJr; 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-215619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215619-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BBA611C212AD for ; Sat, 15 Jun 2024 00:16:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50F244683; Sat, 15 Jun 2024 00:16:23 +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="UTUX4AJr" Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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 2EFC9623 for ; Sat, 15 Jun 2024 00:16:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718410582; cv=none; b=JBnLhcpm8In5DL+uRIpfCJVzbZH5eZ7o2tQLqohuER34MUSBbP53FsrmSC34sbLaCswTgHrhaANNA8fCwfMPaQ1p6eBbLjXWgNfNS8QyaWhmlA5w4KjJVObcrccfg84gD+7iORUuYqM7lLN2cwVwPlxQ6IOT631HcW/sCcYLBks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718410582; c=relaxed/simple; bh=Ah9XF3VhfC6uL+Y7yxuXm+X0XsWWOB0OHtRfi0aa7Tk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KtEBEjXw8QimtfgkMwlqHHNUuAdMfxf8ZcyJp5iB/26IFI5i+qHJNzL7V+HCAeYG+QV+E5jsO2qKo3fSW0rA/juStWRtujDafLz6xfWgI/2/BUlrLbAA9wzDTXUB5nJ9vj9M6XPrzXk2J0dnHTkhU7+pJFwY3j3Rhw6+Oo19UKg= 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=UTUX4AJr; arc=none smtp.client-ip=209.85.210.172 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-pf1-f172.google.com with SMTP id d2e1a72fcca58-70423e8e6c9so2476536b3a.0 for ; Fri, 14 Jun 2024 17:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1718410580; x=1719015380; 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=dbQfy6Bm8n8TNDG5hBa+dXfTA5IW7C1pPdTr7l75iCw=; b=UTUX4AJrJlz2ePVxj+nYvXt1eBakA5iu62o7NvcvIYyuz0Xi72kSsRU/1pAPTwIXGB 591lsNDTVTOR6KPj39/hPWN5GrDCF+H7Q7uwctOv2iaLZEno6LJz/s6mfn9QQpOx/X+3 9g61QqesRNB++i5VFJTjDMGuWAeSeW1sFRS+tLHyOr+xPGHEPcoXjVM6sE4OQA2DTH1J du52YAW2SP1yCtNpQBX2Cr9EHewQYq4VDR7o2kokOY0cHtzVsEszRieqsaKeb9lUzd6S 3lt4mTDtVH7PPqpQmZcsXss6kbjtYX29YvbmuNsbt2WmCp6Gxxo4gurLXYlwMlhOTz8y Tkcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718410580; x=1719015380; 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=dbQfy6Bm8n8TNDG5hBa+dXfTA5IW7C1pPdTr7l75iCw=; b=Ib1FnjmLhu0XEbvKxG4fZL+cZYIoEolJsYfqnp2JpWNTMFY+xaKJ5D4cRpm8MfQUox CcwGphV+A8dl+ASL9Q8gzPGZHXiqW/Im45huFfy7uYsOwC12IHCPWPOqQpzJ7P4pRUJc Ti7bS1PpRz8oPuTPOXRA/nXas2TSGn8kUnNmxHjqh1LKWMx+XPGcSyvzJ0F0AMfIpVK4 0WD1Aav2jx2j0sPG9Dk73OqAJ4tXjSK3WETrCKxsev8fASvOv14td9nEHodk8FZkO9le YPWeGfzpRr/OekaHMndOGeebm7aybuqpDHgTEXvCBiJMwxK/83WNarYVHmlw3H+i647J Q42g== X-Gm-Message-State: AOJu0YwXG0QWRLEk3I+E0gg75gs55yyv+p4IMiH+LvKVpkL8iloSRNaA x0+p0DSlE0EDiAPYOtGgFPVzDUYGXyhSFHZIPk0EGmJrdXOu6gKloajEOjsrwMc= X-Received: by 2002:a05:6a20:d80d:b0:1b2:cf6c:d5ae with SMTP id adf61e73a8af0-1bae844443cmr4560825637.59.1718410580416; Fri, 14 Jun 2024 17:16:20 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc967334sm3638921b3a.57.2024.06.14.17.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 17:16:20 -0700 (PDT) Date: Fri, 14 Jun 2024 17:16:18 -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 09/15] net: hbl_en: add habanalabs Ethernet driver Message-ID: <20240614171618.3b65b3c9@hermes.local> In-Reply-To: <20240613082208.1439968-10-oshpigelman@habana.ai> References: <20240613082208.1439968-1-oshpigelman@habana.ai> <20240613082208.1439968-10-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 > + > +/* get the src IP as it is done in devinet_ioctl() */ > +static int hbl_en_get_src_ip(struct hbl_aux_dev *aux_dev, u32 port_idx, u32 *src_ip) > +{ > + struct hbl_en_port *port = HBL_EN_PORT(aux_dev, port_idx); > + struct net_device *ndev = port->ndev; > + struct in_device *in_dev; > + struct in_ifaddr *ifa; > + int rc = 0; > + > + /* for the case where no src IP is configured */ > + *src_ip = 0; > + > + /* rtnl lock should be acquired in relevant flows before taking configuration lock */ > + if (!rtnl_is_locked()) { > + netdev_err(port->ndev, "Rtnl lock is not acquired, can't proceed\n"); > + rc = -EFAULT; > + goto out; > + } > + > + in_dev = __in_dev_get_rtnl(ndev); > + if (!in_dev) { > + netdev_err(port->ndev, "Failed to get IPv4 struct\n"); > + rc = -EFAULT; > + goto out; > + } > + > + ifa = rtnl_dereference(in_dev->ifa_list); > + > + while (ifa) { > + if (!strcmp(ndev->name, ifa->ifa_label)) { > + /* convert the BE to native and later on it will be > + * written to the HW as LE in QPC_SET > + */ > + *src_ip = be32_to_cpu(ifa->ifa_local); > + break; > + } > + ifa = rtnl_dereference(ifa->ifa_next); > + } > +out: > + return rc; > +} Does this device require IPv4? What about users and infrastructures that use IPv6 only? IPv4 is legacy at this point.