From patchwork Tue Jul 21 20:34:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1333320 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pensando.io Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=pensando.io header.i=@pensando.io header.a=rsa-sha256 header.s=google header.b=CieJNtIw; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BB9LS0LDxz9sRN for ; Wed, 22 Jul 2020 06:34:24 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730470AbgGUUeS (ORCPT ); Tue, 21 Jul 2020 16:34:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbgGUUeQ (ORCPT ); Tue, 21 Jul 2020 16:34:16 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1E5DC061794 for ; Tue, 21 Jul 2020 13:34:16 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id q17so1465pfu.8 for ; Tue, 21 Jul 2020 13:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WQdUkEmMcEnpjVPZH0PDhLEmtlqqiKx49awEHX5jm18=; b=CieJNtIw9CQuA2INnJw3f811HWYaPF7yY+EiEb8KjrSRSWLDCw+ji5ZGFpuf0vg1bc 2cprPZ7ImV4wlmHATh06LzUuqdFO2tS2akNQfjZhCCYStYQsSCU9OxIOxVsd6DOUk8fC xG+wl8NXsG++581giQcJMUp/jsrvWv6s/HqSxZo4pTYWK7mIYnjAXT2Rtr9//5jE47Tw XYKHJiR4cY+lTLjHYMM/NijM7ZifKsPxkGmMytYt33ClbUAr6IAJmt8apEqJMAK+ptVI EQljA3J/R931tuAFzaeRnDBkR9GxmBi/MEHe/tBlocADBZVftHb25YyT9o3VzkcrDxg3 d+FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WQdUkEmMcEnpjVPZH0PDhLEmtlqqiKx49awEHX5jm18=; b=o0Y+yMiI3uKRonoexhcY83pe7D/19rP0zIY7rHRkfvaAUMUtLWm34mcmJuXdVPlBzc xA7sey+tYsKcQ3s8Spgw47xGUdlhL/PULNf9Calc9O0p+fGbCqu31qZBSovfjNHCEJKC J8h1XrnJzNMWDHD+hcroosuoKh8Eyasp8dcXPsi1sFDSMQIs/nXy94HaD010BqdRNDa2 HkhZQuGBEF9lsfY8DcS6Bg+KCmkEWdqLGliOwEjUjM9uOjqQrWydbjiU73iyE/OefdSf oI1UbXZXQoJgi6KpT2hV/jKeYv/RfWQf0jZzkTw8Mkp7hIoS2MRUCL3uRCRGLwgQAHn3 obEA== X-Gm-Message-State: AOAM5316RWrlT+W9Y5eAfyKGQlH49SSBee24ufYoNsnZNuU+xOQUZcZh QpbMM1BE8bRQiH1Lehw2uF2yaHBCL/0= X-Google-Smtp-Source: ABdhPJwgm3AM23ejDYpkYgkTCQbTArglq9qhbKL92oPYqp7r/rNEoKBb6+7D2lY5FarQTE/pK1BZyQ== X-Received: by 2002:a62:e712:: with SMTP id s18mr25731409pfh.224.1595363656030; Tue, 21 Jul 2020 13:34:16 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id p11sm4075107pjb.3.2020.07.21.13.34.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2020 13:34:15 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net Cc: Shannon Nelson Subject: [PATCH net-next 1/6] ionic: get MTU from lif identity Date: Tue, 21 Jul 2020 13:34:04 -0700 Message-Id: <20200721203409.3432-2-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200721203409.3432-1-snelson@pensando.io> References: <20200721203409.3432-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Change from using hardcoded MTU limits and instead use the firmware defined limits. The value from the LIF attributes is the frame size, so we take off the header size to convert to MTU size. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_dev.h | 2 -- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 17 ++++++++++++++--- drivers/net/ethernet/pensando/ionic/ionic_lif.h | 1 + 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h index 525434f10025..d5cba502abca 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h @@ -10,8 +10,6 @@ #include "ionic_if.h" #include "ionic_regs.h" -#define IONIC_MIN_MTU ETH_MIN_MTU -#define IONIC_MAX_MTU 9194 #define IONIC_MAX_TX_DESC 8192 #define IONIC_MAX_RX_DESC 16384 #define IONIC_MIN_TXRX_DESC 16 diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index f49486b6d04d..cfcef41b7b23 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -2022,11 +2023,16 @@ int ionic_reset_queues(struct ionic_lif *lif, ionic_reset_cb cb, void *arg) static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index) { struct device *dev = ionic->dev; + union ionic_lif_identity *lid; struct net_device *netdev; struct ionic_lif *lif; int tbl_sz; int err; + lid = kzalloc(sizeof(*lid), GFP_KERNEL); + if (!lid) + return ERR_PTR(-ENOMEM); + netdev = alloc_etherdev_mqs(sizeof(*lif), ionic->ntxqs_per_lif, ionic->ntxqs_per_lif); if (!netdev) { @@ -2045,8 +2051,12 @@ static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index netdev->watchdog_timeo = 2 * HZ; netif_carrier_off(netdev); - netdev->min_mtu = IONIC_MIN_MTU; - netdev->max_mtu = IONIC_MAX_MTU; + lif->identity = lid; + lif->lif_type = IONIC_LIF_TYPE_CLASSIC; + ionic_lif_identify(ionic, lif->lif_type, lif->identity); + lif->netdev->min_mtu = le32_to_cpu(lif->identity->eth.min_frame_size); + lif->netdev->max_mtu = + le32_to_cpu(lif->identity->eth.max_frame_size) - ETH_HLEN - VLAN_HLEN; lif->neqs = ionic->neqs_per_lif; lif->nxqs = ionic->ntxqs_per_lif; @@ -2113,6 +2123,7 @@ static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index err_out_free_netdev: free_netdev(lif->netdev); lif = NULL; + kfree(lid); return ERR_PTR(err); } @@ -2132,7 +2143,6 @@ int ionic_lifs_alloc(struct ionic *ionic) return -ENOMEM; } - lif->lif_type = IONIC_LIF_TYPE_CLASSIC; ionic_lif_queue_identify(lif); return 0; @@ -2243,6 +2253,7 @@ static void ionic_lif_free(struct ionic_lif *lif) ionic_lif_reset(lif); /* free lif info */ + kfree(lif->identity); dma_free_coherent(dev, lif->info_sz, lif->info, lif->info_pa); lif->info = NULL; lif->info_pa = 0; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index ed126dd74e01..949f96dc9cd8 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -184,6 +184,7 @@ struct ionic_lif { u16 lif_type; unsigned int nucast; + union ionic_lif_identity *identity; struct ionic_lif_info *info; dma_addr_t info_pa; u32 info_sz; From patchwork Tue Jul 21 20:34:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1333321 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pensando.io Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=pensando.io header.i=@pensando.io header.a=rsa-sha256 header.s=google header.b=liGVRFCA; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BB9LS4mZ5z9sSn for ; Wed, 22 Jul 2020 06:34:24 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730640AbgGUUeT (ORCPT ); Tue, 21 Jul 2020 16:34:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730434AbgGUUeS (ORCPT ); Tue, 21 Jul 2020 16:34:18 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03824C061794 for ; Tue, 21 Jul 2020 13:34:18 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id a9so2112005pjd.3 for ; Tue, 21 Jul 2020 13:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uCXEufMUDu8XZSJLfGXZ0f5ud7b9oLseRzNAct0iNYs=; b=liGVRFCA5A4Jp4wV5dNp+mql+GEHMSWAJkl25ZG2cKZuOSCELXQrIoBYizKTlVEYK+ T/pZ/u/8MYdnXNEGuCnai8zm5CHQdDPtuOBlalCPYO3v9xa9dqED1AYmyoWjzaz6a1s3 KRy2vLQ+5IUIbs/wuLEpd422Qz39Rqd0p9R49XQfAhNJEuj67U7a7PzagZRybw0mbjRC xMeyEjG08/USjYkJp5jTCM7YRxQ6ABmVeay5mE+qIi3K14v0EDQ7fUzy7v+9W9Gnb7E6 jmGGtK5q+h0lQ5hL6E2xXbjUNUU1tnP02Idxncrq7HdohjoFJtt8Mn3IRr+bcvQ+KqrS eOQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uCXEufMUDu8XZSJLfGXZ0f5ud7b9oLseRzNAct0iNYs=; b=rPTMW3d1gNKyTJHTp2hd27g6ep6n6lvoH8KvD2CuD2ZqgwCSs8guV2e5Fnt/W7B0nW +qg6fRYzslS13gmhUAA4soV5fsCEPfCaCACDhKqoUu7XM5cM3+6uJaXIdaFRvsWSVzH3 WQK1i5TIQUbJgF0NKZuEWirZbHgQ5FHiel33a7ZEOwQHebLVV0kzxQbywFHKIzXNegdu bx7nwz25A7qOQ9X6XHLxkxlbWlGz4jFOO3bZQsp0/cemdeib4KX3Zz8yUcULfC/hI0S9 /reT4nh6XyhZjyPTRBLfKw0gvsxB53805+bo4Bf6aEdS/iAhxb/DQ//wk+Xa4MEpdVsJ BYXg== X-Gm-Message-State: AOAM531f5QlE7YcpgkE15vF2c+nKt9SO52WeIvRP0MyLrQP49rKtjBfD Bn0lahM2a+U+BTFXykUUavdhaHhcn2Q= X-Google-Smtp-Source: ABdhPJwc3yJAuusQj3gxl2p/Yboyr1JJt8Pvp8+2elgBGDYwyVMEE/SQOWJzPt/86+XxbvmsLJ2RVw== X-Received: by 2002:a17:90a:2d7:: with SMTP id d23mr6658480pjd.57.1595363657303; Tue, 21 Jul 2020 13:34:17 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id p11sm4075107pjb.3.2020.07.21.13.34.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2020 13:34:16 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net Cc: Shannon Nelson Subject: [PATCH net-next 2/6] ionic: set netdev default name Date: Tue, 21 Jul 2020 13:34:05 -0700 Message-Id: <20200721203409.3432-3-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200721203409.3432-1-snelson@pensando.io> References: <20200721203409.3432-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If the host system's udev fails to set a new name for the network port, there is no NETDEV_CHANGENAME event to trigger the driver to send the name down to the firmware. It is safe to set the lif name multiple times, so we add a call early on to set the default netdev name to be sure the FW has something to use in its internal debug logging. Then when udev gets around to changing it we can update it to the actual name the system will be using. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index cfcef41b7b23..bbfa25cd3294 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2631,6 +2631,7 @@ int ionic_lifs_register(struct ionic *ionic) return err; } ionic->master_lif->registered = true; + ionic_lif_set_netdev_info(ionic->master_lif); return 0; } From patchwork Tue Jul 21 20:34:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1333322 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pensando.io Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=pensando.io header.i=@pensando.io header.a=rsa-sha256 header.s=google header.b=e8jZc6Rs; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BB9LT0ZCWz9sPB for ; Wed, 22 Jul 2020 06:34:25 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730857AbgGUUeV (ORCPT ); Tue, 21 Jul 2020 16:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730482AbgGUUeT (ORCPT ); Tue, 21 Jul 2020 16:34:19 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B280C061794 for ; Tue, 21 Jul 2020 13:34:19 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id p3so13725pgh.3 for ; Tue, 21 Jul 2020 13:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=L8T7hdDCmaxYXiC5V2hOLLpYbtzwS9t4Z6YDnWGQMxQ=; b=e8jZc6Rs6/UHv6ZbQ5p0n71QJ2Hr6PTs5pAE187GX48hv8F9HednISIB5qF7EvwA/C TyfcpHPu4epnDOcaxodCHMFl3J2Unzs5SS+FS7ImHj0O7rcIUUrKdn1ZgaDazaWHySHP qURAaSfFCo4IMd+Qh8KreG08sEg/8cvHxHpJNpXF2VPQegaAnlZ01AezpGmvaJQ0ZG8v tN0Z67qqCQhM2pWd+R/qjP6etWduseUbHJdyBDorn7Cdap0JWkStQkxmIM3BAL/LraPg n9JRoXzuIgxJZ/KpEWHJlJjiK0gRBvKPG9r7b5qFZ5USgVglAvqV4RDq9zJYnNKsbCPN Ws5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=L8T7hdDCmaxYXiC5V2hOLLpYbtzwS9t4Z6YDnWGQMxQ=; b=a5JNgqmFWyUYqVs3ndV2TbNcFMux0UAKsULuVT4Tjsyvbf4hQiJR/nv/LMbAHlMrYy NoU/gN0m8dTSvcErov1izX9vsJY4V9BuM+0p3PHNTRKLGVnkYQK+0QZiZfHAevLH3EYP pUqCp3cPYj1N6FzDmz8EPe26WAByL+acmnA+FIUwEWz3ePSxt51f6bq38g9De23HDx4k BG8AD1Trn3L5ohjhjcaL+8f9KOD/KTOQmYGahNu7FMSoHeO73tQ2/bSlxEqisPzOV+Qt AHVL4c5DGlEk6TTZvs/WKoWL5I2gPf0GCKs6QgIoS6HKE78JPsgXVTmqL8BRN4htZzlp vRMw== X-Gm-Message-State: AOAM533vLqQttOAV8dsCwji4a9M2iO8dAqvutDlNSk2UaARZikabl+Ea GH/vggNPtop738WX78JMwVxfeSiDPx8= X-Google-Smtp-Source: ABdhPJwVn0KKpaK3OohNwRyC3/gkErIoUWzAmiMrfZFKbSgLK0hrvAzlcKQYwciAGpsaUQVghYaqGg== X-Received: by 2002:aa7:9422:: with SMTP id y2mr26404874pfo.211.1595363658341; Tue, 21 Jul 2020 13:34:18 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id p11sm4075107pjb.3.2020.07.21.13.34.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2020 13:34:17 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net Cc: Shannon Nelson Subject: [PATCH net-next 3/6] ionic: remove unused ionic_coal_hw_to_usec Date: Tue, 21 Jul 2020 13:34:06 -0700 Message-Id: <20200721203409.3432-4-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200721203409.3432-1-snelson@pensando.io> References: <20200721203409.3432-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Clean up some unused code. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index 949f96dc9cd8..f1e7d3ef1c58 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -236,19 +236,6 @@ static inline u32 ionic_coal_usec_to_hw(struct ionic *ionic, u32 usecs) return (usecs * mult) / div; } -static inline u32 ionic_coal_hw_to_usec(struct ionic *ionic, u32 units) -{ - u32 mult = le32_to_cpu(ionic->ident.dev.intr_coal_mult); - u32 div = le32_to_cpu(ionic->ident.dev.intr_coal_div); - - /* Div-by-zero should never be an issue, but check anyway */ - if (!div || !mult) - return 0; - - /* Convert from device units to usec */ - return (units * div) / mult; -} - typedef void (*ionic_reset_cb)(struct ionic_lif *lif, void *arg); void ionic_link_status_check_request(struct ionic_lif *lif); From patchwork Tue Jul 21 20:34:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1333325 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pensando.io Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=pensando.io header.i=@pensando.io header.a=rsa-sha256 header.s=google header.b=UVnHdJAZ; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BB9LZ3GRpz9sPB for ; Wed, 22 Jul 2020 06:34:30 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730975AbgGUUe2 (ORCPT ); Tue, 21 Jul 2020 16:34:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730434AbgGUUeT (ORCPT ); Tue, 21 Jul 2020 16:34:19 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCB08C061794 for ; Tue, 21 Jul 2020 13:34:19 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id k27so16106pgm.2 for ; Tue, 21 Jul 2020 13:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SYYO7N9ip/SgkV9r389TblDeOHwHXYcZZ/zsFY0lPOI=; b=UVnHdJAZNydw+HRqu8iX6J8nWXly9NJtxgGmzddLngUiuq8fD/9D7WKioevjJ1JzD9 PIWdkF5IBq2hl+4sqJITFhJGaRJ6Aml8llOLNEJw6broQeJfAxbQX/WQ919Aw9uKVUIx VJi6gbVIHYvjERZu6SJxXt4hZG2ADgkhFhW6yCCM07r7iBE5zImA48ylec6FUJ+y+j/Z RJLFcPGoIn4aXNVjAAp6SrZrOQLoUr4Bfysk1wYZofafEvoM3r6O+TJ58ZtXpS2bRVZE MxnJvCPBod7uNZvxvdMkC6PLWFOPWCGHVq8TG+poBNTEprOCnK8KDLp8zdbc0bT/5/0e /sbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SYYO7N9ip/SgkV9r389TblDeOHwHXYcZZ/zsFY0lPOI=; b=O9Bt6tftLoIGVpiTQSXwo+Exh5tVuWRSl7bGqJGRbSVM4uZtP7TmjXnkmnjdn/6P52 6u1qL2r0ZupmTm6pOu8C3pWPgBggXtmZO7NFausz72+5odFJwdG067ez4ikAPRAF8wK7 mwgW9XOz0uW7Cy7NjM/X45NvF5YZLr7GclUc0LC0a70yfcIdWpyvx9Hqhmr/rA0Je1Rx gp5PQkDj+0M84ShiDLqKh2oFru6S0AxDq3a1sCDHUoSCUCoY6pQmzF1L0QrN/aNi9z6L 9a9B0ZyRuS+L7h/XAUvqdRqHbTiAT2Q8hhdDB2qHwz00mGMdcxX0djbYHhmCslO3M0Ox UAyA== X-Gm-Message-State: AOAM533mnkBn8p68NO2gtCGjgGjOEiXfvWg4sWTB8BUHSktSAM/0KCpp yNl3gStmzjYTrXlSERwDJEa4/HStSY8= X-Google-Smtp-Source: ABdhPJxlLQ5nCwH+byTwDh0Saz4iaE3ehkw/X9ho9aAMQ+/S78HP0Rt5DUWhEFvA8G+Lrz7xHfN22Q== X-Received: by 2002:a63:3e09:: with SMTP id l9mr24730409pga.235.1595363659208; Tue, 21 Jul 2020 13:34:19 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id p11sm4075107pjb.3.2020.07.21.13.34.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2020 13:34:18 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net Cc: Shannon Nelson Subject: [PATCH net-next 4/6] ionic: update eid test for overflow Date: Tue, 21 Jul 2020 13:34:07 -0700 Message-Id: <20200721203409.3432-5-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200721203409.3432-1-snelson@pensando.io> References: <20200721203409.3432-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix up our comparison to better handle a potential (but largely unlikely) wrap around. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index bbfa25cd3294..db60c5405a58 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -719,7 +719,7 @@ static bool ionic_notifyq_service(struct ionic_cq *cq, eid = le64_to_cpu(comp->event.eid); /* Have we run out of new completions to process? */ - if (eid <= lif->last_eid) + if ((s64)(eid - lif->last_eid) <= 0) return false; lif->last_eid = eid; From patchwork Tue Jul 21 20:34:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1333323 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pensando.io Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=pensando.io header.i=@pensando.io header.a=rsa-sha256 header.s=google header.b=Z8O50KOx; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BB9LW1xwMz9sPB for ; Wed, 22 Jul 2020 06:34:27 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730903AbgGUUeX (ORCPT ); Tue, 21 Jul 2020 16:34:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730830AbgGUUeU (ORCPT ); Tue, 21 Jul 2020 16:34:20 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF78BC061794 for ; Tue, 21 Jul 2020 13:34:20 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id q17so1553pfu.8 for ; Tue, 21 Jul 2020 13:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bb4/u6aH3Ltg2xV3fnnX4+gNGBdiu9JP2ZbDXCCeFtc=; b=Z8O50KOxKDVEq5jAWsseGsYOi5Mqt4BgtDbbheLdYqS+dxDAsITyELX4YsKnx/o+OO TR7FAhmTjf1p98I6KZnv71VHzq6G0AlvqqIG0YEmXHY3M2b2k1LamV2eQXFxBPd1a1+R 5eC5EkPE1qpByIxp8J89unx1hONP2LAlpgFMFCVQfZ7l6r5EW2DRBpIhOTHYgyRWkaLt L7jKZL8Q1N/W41ephXLRvbuJ1/CySpPqoXJVzNl2KpEk7wWyzSooEYMoMeJGD29xkzML MtH1vyw9kCZOOmPXT+Uy/LOEmqIIgdRzMuSAXGBds6dRTCSF/WsIqsJHx2q+xDeld4ya pyCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bb4/u6aH3Ltg2xV3fnnX4+gNGBdiu9JP2ZbDXCCeFtc=; b=YhSzsHUBNm1qse1SZSIPqBM2UuB+zKSy6uhzluPWW8N/ClRWtLiEzp3HQodnI2ATWE PO9Krb3ecZj3Y400ri7UIt1H1VQZzl74VAHT0ZrwObKOqSpevPTz1C1b4so5XI98Rjy2 m2irjqUsyMb0myGKATD591TgtFL8ekUYDLB4EDw2XZay2GT2MhjpzrM8397NKBNM367k hhzYjFYhTgqat0e4ACX2VOdXWX2qAsJNPHV6FEKbVZ+rv/WZdJYucs1t1/N81atpFg9Q Mt60sCEOahAfLlnq+GZKDbjVVU3WrTUlu93hAQuu/rFo3/usBR/bX/elJzbgkApKCzr2 EMkw== X-Gm-Message-State: AOAM530rS3Vt2wbQ8KshQgahjQ/FINy1z56a4QX10BXwpIoygXv9JUFU xb5HCL+QXWj1ZOG7IIRplxcZXo8v9Bw= X-Google-Smtp-Source: ABdhPJzaVkUUZwRIJv+Cqjw2vjMKFV/2QFPMEgCzoFo+sC4uTisv2yXCkXuOehgWDFbZR35pAvfMIQ== X-Received: by 2002:a65:63c8:: with SMTP id n8mr23975092pgv.232.1595363660123; Tue, 21 Jul 2020 13:34:20 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id p11sm4075107pjb.3.2020.07.21.13.34.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2020 13:34:19 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net Cc: Shannon Nelson Subject: [PATCH net-next 5/6] ionic: rearrange reset and bus-master control Date: Tue, 21 Jul 2020 13:34:08 -0700 Message-Id: <20200721203409.3432-6-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200721203409.3432-1-snelson@pensando.io> References: <20200721203409.3432-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We can prevent potential incorrect DMA access attempts from the NIC by enabling bus-master after the reset, and by disabling bus-master earlier in cleanup. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index 2924cde440aa..85c686c16741 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -247,12 +247,11 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_out_pci_disable_device; } - pci_set_master(pdev); pcie_print_link_status(pdev); err = ionic_map_bars(ionic); if (err) - goto err_out_pci_clear_master; + goto err_out_pci_disable_device; /* Configure the device */ err = ionic_setup(ionic); @@ -260,6 +259,7 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) dev_err(dev, "Cannot setup device: %d, aborting\n", err); goto err_out_unmap_bars; } + pci_set_master(pdev); err = ionic_identify(ionic); if (err) { @@ -350,6 +350,7 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ionic_reset(ionic); err_out_teardown: ionic_dev_teardown(ionic); + pci_clear_master(pdev); /* Don't fail the probe for these errors, keep * the hw interface around for inspection */ @@ -358,8 +359,6 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err_out_unmap_bars: ionic_unmap_bars(ionic); pci_release_regions(pdev); -err_out_pci_clear_master: - pci_clear_master(pdev); err_out_pci_disable_device: pci_disable_device(pdev); err_out_debugfs_del_dev: @@ -389,9 +388,9 @@ static void ionic_remove(struct pci_dev *pdev) ionic_port_reset(ionic); ionic_reset(ionic); ionic_dev_teardown(ionic); + pci_clear_master(pdev); ionic_unmap_bars(ionic); pci_release_regions(pdev); - pci_clear_master(pdev); pci_disable_device(pdev); ionic_debugfs_del_dev(ionic); mutex_destroy(&ionic->dev_cmd_lock); From patchwork Tue Jul 21 20:34:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1333324 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pensando.io Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=pensando.io header.i=@pensando.io header.a=rsa-sha256 header.s=google header.b=bxCineDm; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BB9LW5CqPz9sRN for ; Wed, 22 Jul 2020 06:34:27 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730939AbgGUUeZ (ORCPT ); Tue, 21 Jul 2020 16:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730482AbgGUUeW (ORCPT ); Tue, 21 Jul 2020 16:34:22 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12148C061794 for ; Tue, 21 Jul 2020 13:34:22 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id s189so12453976pgc.13 for ; Tue, 21 Jul 2020 13:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Cq9IndfYDBrYLmUddjgBx0Nvzf74FXIb0izEIR6F5XI=; b=bxCineDmwjONHrNxQBJ4xeBSE07627YigMR77xskFdqp3PTng9Vwc32NiIEQQCHnWg qv7csO4RAZyIIKIUt5Ai6onBNDlAMntPibggGl8uxL3fSEvDN3uJOQF4ymWEUEK1zgeX e1Md+yWx0wGn91dbwBV6JNhWrAvxA6Y5bU+jF11CMkvByc+wCo+WxKF4wF62qcd3xKjo krAbLLwsNEp5Bosa54HWciHLR4oMhAI5Kzp3jsvDIbLTN1Xhw70xXkoPVJCpe7PCIxj7 gvKs3c9TdyVYf5b/CuvO9xwyd0da1dEBxWGfea6qxha14xR3skpt+lxVdYVeq1Keur/J SCww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Cq9IndfYDBrYLmUddjgBx0Nvzf74FXIb0izEIR6F5XI=; b=DFqBHuHiDAGDN5rrnVffFIwgVwAqaR69YsnsJlvOzE2Qr+W7kLjAOaMZ+JUNEoQ6uI 7jnk+R1PmWhTIgeYXXEXyv+pNKeJmlUxgfN/yh/g08Snx1981TLa0GO0ql/rm9K3yGC9 zXSn74GJvi5HcZ1QKuCqMzTMIsMQG5tyXHnpkaw+SHmTRhkMzONiHawPhDZwOFmv806y ADWxSo5CVYWYepvNs7tPYwk6VnCGvfbyyLq0ngys64IQSu6zj6rGbr/mDJk+X8ccW9tb 8Ez+bTO8v+C/hYy7l+GM2/Qg+Lz8MSidQYoYxqJ9ZmCh6cyNTuLcpQE6bzYdRscg+rbR drCg== X-Gm-Message-State: AOAM533HbOYzteQszEORSOaGDmbOO4TFBaqEU4Ai4CGPi+EXynRmf1jr +R18QatwB/d7uk2vhGgles5bLSD3l2Y= X-Google-Smtp-Source: ABdhPJy1m54k3mCX0cBmTybX95V+DqOAUB7PuOjTJznugzQlklcnEV/N+RPu4Fg5VpzhcnS+SsvMFQ== X-Received: by 2002:a63:6744:: with SMTP id b65mr24466014pgc.42.1595363661102; Tue, 21 Jul 2020 13:34:21 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id p11sm4075107pjb.3.2020.07.21.13.34.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2020 13:34:20 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net Cc: Shannon Nelson Subject: [PATCH net-next 6/6] ionic: interface file updates Date: Tue, 21 Jul 2020 13:34:09 -0700 Message-Id: <20200721203409.3432-7-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200721203409.3432-1-snelson@pensando.io> References: <20200721203409.3432-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add some new interface values and update a few more descriptions. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_if.h | 88 ++++++++++++++----- 1 file changed, 68 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h index 7e22ba4ed915..acc94b244cf3 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_if.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h @@ -59,6 +59,8 @@ enum ionic_cmd_opcode { IONIC_CMD_QOS_CLASS_INIT = 241, IONIC_CMD_QOS_CLASS_RESET = 242, IONIC_CMD_QOS_CLASS_UPDATE = 243, + IONIC_CMD_QOS_CLEAR_STATS = 244, + IONIC_CMD_QOS_RESET = 245, /* Firmware commands */ IONIC_CMD_FW_DOWNLOAD = 254, @@ -90,8 +92,8 @@ enum ionic_status_code { IONIC_RC_DEV_CMD = 18, /* Device cmd attempted on AdminQ */ IONIC_RC_ENOSUPP = 19, /* Operation not supported */ IONIC_RC_ERROR = 29, /* Generic error */ - IONIC_RC_ERDMA = 30, /* Generic RDMA error */ + IONIC_RC_EVFID = 31, /* VF ID does not exist */ }; enum ionic_notifyq_opcode { @@ -103,7 +105,7 @@ enum ionic_notifyq_opcode { }; /** - * struct cmd - General admin command format + * struct ionic_admin_cmd - General admin command format * @opcode: Opcode for the command * @lif_index: LIF index * @cmd_data: Opcode-specific command bytes @@ -167,7 +169,7 @@ struct ionic_dev_init_cmd { }; /** - * struct init_comp - Device init command completion + * struct ionic_dev_init_comp - Device init command completion * @status: Status of the command (enum ionic_status_code) */ struct ionic_dev_init_comp { @@ -185,7 +187,7 @@ struct ionic_dev_reset_cmd { }; /** - * struct reset_comp - Reset command completion + * struct ionic_dev_reset_comp - Reset command completion * @status: Status of the command (enum ionic_status_code) */ struct ionic_dev_reset_comp { @@ -357,12 +359,12 @@ struct ionic_lif_logical_qtype { * enum ionic_lif_state - LIF state * @IONIC_LIF_DISABLE: LIF disabled * @IONIC_LIF_ENABLE: LIF enabled - * @IONIC_LIF_HANG_RESET: LIF hung, being reset + * @IONIC_LIF_QUIESCE: LIF Quiesced */ enum ionic_lif_state { - IONIC_LIF_DISABLE = 0, + IONIC_LIF_QUIESCE = 0, IONIC_LIF_ENABLE = 1, - IONIC_LIF_HANG_RESET = 2, + IONIC_LIF_DISABLE = 2, }; /** @@ -371,6 +373,7 @@ enum ionic_lif_state { * @name: LIF name * @mtu: MTU * @mac: Station MAC address + * @vlan: Default Vlan ID * @features: Features (enum ionic_eth_hw_features) * @queue_count: Queue counts per queue-type */ @@ -381,7 +384,7 @@ union ionic_lif_config { char name[IONIC_IFNAMSIZ]; __le32 mtu; u8 mac[6]; - u8 rsvd2[2]; + __le16 vlan; __le64 features; __le32 queue_count[IONIC_QTYPE_MAX]; } __packed; @@ -489,13 +492,13 @@ struct ionic_lif_init_comp { u8 rsvd2[12]; }; - /** - * struct ionic_q_identify_cmd - queue identify command - * @opcode: opcode - * @lif_type: LIF type (enum ionic_lif_type) - * @type: Logical queue type (enum ionic_logical_qtype) - * @ver: Highest queue type version that the driver supports - */ +/** + * struct ionic_q_identify_cmd - queue identify command + * @opcode: opcode + * @lif_type: LIF type (enum ionic_lif_type) + * @type: Logical queue type (enum ionic_logical_qtype) + * @ver: Highest queue type version that the driver supports + */ struct ionic_q_identify_cmd { u8 opcode; u8 rsvd; @@ -983,6 +986,14 @@ enum ionic_pkt_type { IONIC_PKT_TYPE_IPV6 = 0x008, IONIC_PKT_TYPE_IPV6_TCP = 0x018, IONIC_PKT_TYPE_IPV6_UDP = 0x028, + /* below types are only used if encap offloads are enabled on lif */ + IONIC_PKT_TYPE_ENCAP_NON_IP = 0x40, + IONIC_PKT_TYPE_ENCAP_IPV4 = 0x41, + IONIC_PKT_TYPE_ENCAP_IPV4_TCP = 0x43, + IONIC_PKT_TYPE_ENCAP_IPV4_UDP = 0x45, + IONIC_PKT_TYPE_ENCAP_IPV6 = 0x48, + IONIC_PKT_TYPE_ENCAP_IPV6_TCP = 0x58, + IONIC_PKT_TYPE_ENCAP_IPV6_UDP = 0x68, }; enum ionic_eth_hw_features { @@ -1003,6 +1014,9 @@ enum ionic_eth_hw_features { IONIC_ETH_HW_TSO_IPXIP6 = BIT(14), IONIC_ETH_HW_TSO_UDP = BIT(15), IONIC_ETH_HW_TSO_UDP_CSUM = BIT(16), + IONIC_ETH_HW_RX_CSUM_GENEVE = BIT(17), + IONIC_ETH_HW_TX_CSUM_GENEVE = BIT(18), + IONIC_ETH_HW_TSO_GENEVE = BIT(19) }; /** @@ -1011,7 +1025,7 @@ enum ionic_eth_hw_features { * @type: Queue type * @lif_index: LIF index * @index: Queue index - * @oper: Operation (enum q_control_oper) + * @oper: Operation (enum ionic_q_control_oper) */ struct ionic_q_control_cmd { u8 opcode; @@ -1172,7 +1186,7 @@ enum ionic_port_loopback_mode { * struct ionic_xcvr_status - Transceiver Status information * @state: Transceiver status (enum ionic_xcvr_state) * @phy: Physical connection type (enum ionic_phy_type) - * @pid: Transceiver link mode (enum pid) + * @pid: Transceiver link mode (enum ionic_xcvr_pid) * @sprom: Transceiver sprom contents */ struct ionic_xcvr_status { @@ -1186,7 +1200,7 @@ struct ionic_xcvr_status { * union ionic_port_config - Port configuration * @speed: port speed (in Mbps) * @mtu: mtu - * @state: port admin state (enum port_admin_state) + * @state: port admin state (enum ionic_port_admin_state) * @an_enable: autoneg enable * @fec_type: fec type (enum ionic_port_fec_type) * @pause_type: pause type (enum ionic_port_pause_type) @@ -1874,12 +1888,14 @@ struct ionic_qos_identify_comp { }; #define IONIC_QOS_TC_MAX 8 +#define IONIC_QOS_ALL_TC 0xFF /* Capri max supported, should be renamed. */ #define IONIC_QOS_CLASS_MAX 7 #define IONIC_QOS_PCP_MAX 8 #define IONIC_QOS_CLASS_NAME_SZ 32 #define IONIC_QOS_DSCP_MAX 64 #define IONIC_QOS_ALL_PCP 0xFF +#define IONIC_DSCP_BLOCK_SIZE 8 /** * enum ionic_qos_class @@ -1923,6 +1939,7 @@ enum ionic_qos_sched_type { * IONIC_QOS_CONFIG_F_NO_DROP drop/nodrop * IONIC_QOS_CONFIG_F_RW_DOT1Q_PCP enable dot1q pcp rewrite * IONIC_QOS_CONFIG_F_RW_IP_DSCP enable ip dscp rewrite + * IONIC_QOS_CONFIG_F_NON_DISRUPTIVE Non-disruptive TC update * @sched_type: QoS class scheduling type (enum ionic_qos_sched_type) * @class_type: QoS class type (enum ionic_qos_class_type) * @pause_type: QoS pause type (enum ionic_qos_pause_type) @@ -1944,6 +1961,8 @@ union ionic_qos_config { /* Used to rewrite PCP or DSCP value. */ #define IONIC_QOS_CONFIG_F_RW_DOT1Q_PCP BIT(2) #define IONIC_QOS_CONFIG_F_RW_IP_DSCP BIT(3) +/* Non-disruptive TC update */ +#define IONIC_QOS_CONFIG_F_NON_DISRUPTIVE BIT(4) u8 flags; u8 sched_type; u8 class_type; @@ -2019,6 +2038,16 @@ struct ionic_qos_reset_cmd { u8 rsvd[62]; }; +/** + * struct ionic_qos_clear_port_stats_cmd - Qos config reset command + * @opcode: Opcode + */ +struct ionic_qos_clear_stats_cmd { + u8 opcode; + u8 group_bitmap; + u8 rsvd[62]; +}; + typedef struct ionic_admin_comp ionic_qos_reset_comp; /** @@ -2164,7 +2193,7 @@ struct ionic_notifyq_event { * struct ionic_link_change_event - Link change event notification * @eid: event number * @ecode: event code = IONIC_EVENT_LINK_CHANGE - * @link_status: link up or down, with error bits (enum port_status) + * @link_status: link up/down, with error bits (enum ionic_port_status) * @link_speed: speed of the network link * * Sent when the network link state changes between UP and DOWN @@ -2377,6 +2406,16 @@ enum ionic_pb_buffer_drop_stats { IONIC_BUFFER_DROP_MAX, }; +enum ionic_oflow_drop_stats { + IONIC_OFLOW_OCCUPANCY_DROP, + IONIC_OFLOW_EMERGENCY_STOP_DROP, + IONIC_OFLOW_WRITE_BUFFER_ACK_FILL_UP_DROP, + IONIC_OFLOW_WRITE_BUFFER_ACK_FULL_DROP, + IONIC_OFLOW_WRITE_BUFFER_FULL_DROP, + IONIC_OFLOW_CONTROL_FIFO_FULL_DROP, + IONIC_OFLOW_DROP_MAX, +}; + /** * struct port_pb_stats - packet buffers system stats * uses ionic_pb_buffer_drop_stats for drop_counts[] @@ -2390,12 +2429,20 @@ struct ionic_port_pb_stats { __le64 input_queue_buffer_occupancy[IONIC_QOS_TC_MAX]; __le64 input_queue_port_monitor[IONIC_QOS_TC_MAX]; __le64 output_queue_port_monitor[IONIC_QOS_TC_MAX]; + __le64 oflow_drop_counts[IONIC_OFLOW_DROP_MAX]; + __le64 input_queue_good_pkts_in[IONIC_QOS_TC_MAX]; + __le64 input_queue_good_pkts_out[IONIC_QOS_TC_MAX]; + __le64 input_queue_err_pkts_in[IONIC_QOS_TC_MAX]; + __le64 input_queue_fifo_depth[IONIC_QOS_TC_MAX]; + __le64 input_queue_max_fifo_depth[IONIC_QOS_TC_MAX]; + __le64 input_queue_peak_occupancy[IONIC_QOS_TC_MAX]; + __le64 output_queue_buffer_occupancy[IONIC_QOS_TC_MAX]; }; /** * struct ionic_port_identity - port identity structure * @version: identity structure version - * @type: type of port (enum port_type) + * @type: type of port (enum ionic_port_type) * @num_lanes: number of lanes for the port * @autoneg: autoneg supported * @min_frame_size: minimum frame size supported @@ -2637,6 +2684,7 @@ union ionic_dev_cmd { struct ionic_qos_identify_cmd qos_identify; struct ionic_qos_init_cmd qos_init; struct ionic_qos_reset_cmd qos_reset; + struct ionic_qos_clear_stats_cmd qos_clear_stats; struct ionic_q_identify_cmd q_identify; struct ionic_q_init_cmd q_init;