From patchwork Tue Mar 3 04:15:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1248049 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=AzdN1oCg; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48WkGF3tvzz9sQt for ; Tue, 3 Mar 2020 15:16:05 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727250AbgCCEQE (ORCPT ); Mon, 2 Mar 2020 23:16:04 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45229 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727073AbgCCEQE (ORCPT ); Mon, 2 Mar 2020 23:16:04 -0500 Received: by mail-pf1-f193.google.com with SMTP id 2so769322pfg.12 for ; Mon, 02 Mar 2020 20:16:01 -0800 (PST) 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=6BJD4y/MJKY4TduWGLVqWk4PWDU4OuLSC5J4NWYa63U=; b=AzdN1oCgX/h23JucRvoxwnb4gJeYu0LG+eC9jMwXh5ygVUgNh/Uyjz1IouSIIa7y31 XDKKPdS0N6BFYULcNApLp12ocxdmlB6tw310r4dPHPDqDpdxCs4rHG838LT6Q/4Py/N0 fWE4zM+3/l5R0iYdLxlhdtpHWL5QRwEP50GpNciLBTj75fUkxn2YA+pNzpC5pedaBCI+ b76XZa3Yrx2+gMqK5XE2BfZ98012OrFSv/CkdY6XpWL6VcWYMXbftUcg2CYhyMKwJUHX DiA1lHdPknYHA/I8UMbhfG0rHxQz3pEjKRqGu5wGJA5FGmucUjOognKy9k1ZMQFC/uon 7Txg== 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=6BJD4y/MJKY4TduWGLVqWk4PWDU4OuLSC5J4NWYa63U=; b=tbMV6dvhuMXSBNh8j2EMpTgBsEytr0WCZp0Owum7ZokvJootVi02k5b2q8QH+QRzeP HU0C8epSgTpO1gIhVFRqn1zxyevDqNHMtwMlZjx9PWeMhtrfx1Icx2RV58B0vRA6et0/ dRvk2cEaphwty1mcCFpSpXrmu+CcLZgWx+QgeKxqWhceLP5fwVy2oXFp5flMxVh04wes C1fkOq26u2m8grNQ6mdCAHF5zfPXITUA5+tjg7SICtNNXbhUSy1Ba6uSvFulG2lcV/T9 Gu0P1CHKf0y6uEOyj4Hm0ZcnmGxAbzpnvJEO1VcFLq08TEI88i8WGPvveZiNsO1Lig5b 40jA== X-Gm-Message-State: ANhLgQ1ZHdI0XMRSjTB2Kl3X+gJZCjtqnZJD2JMXcLZAlx3aqHu6xDWG TAH/BIE8I8+149joTsTFwj/5IA== X-Google-Smtp-Source: ADFU+vu/uwvH42bCe5JPxXu4/WW7hic7J8+Gb8j4UgQaVcRUQ+TyGIMKTSs9E0KpYBzAPesX5MOLWw== X-Received: by 2002:a63:2a02:: with SMTP id q2mr2202212pgq.198.1583208961283; Mon, 02 Mar 2020 20:16:01 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id t7sm396682pjy.1.2020.03.02.20.16.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2020 20:16:00 -0800 (PST) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 1/8] ionic: keep ionic dev on lif init fail Date: Mon, 2 Mar 2020 20:15:38 -0800 Message-Id: <20200303041545.1611-2-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200303041545.1611-1-snelson@pensando.io> References: <20200303041545.1611-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If the basic ionic interface works but the lif creation fails, don't fail the probe. This will allow us to use the driver to help inspect the hw/fw/pci interface for debugging purposes. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 8 ++++++++ drivers/net/ethernet/pensando/ionic/ionic_lif.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index 448d7b23b2f7..554bafac1147 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -37,6 +37,9 @@ int ionic_bus_alloc_irq_vectors(struct ionic *ionic, unsigned int nintrs) void ionic_bus_free_irq_vectors(struct ionic *ionic) { + if (!ionic->nintrs) + return; + pci_free_irq_vectors(ionic->pdev); } @@ -346,6 +349,11 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ionic_reset(ionic); err_out_teardown: ionic_dev_teardown(ionic); + /* Don't fail the probe for these errors, keep + * the hw interface around for inspection + */ + return 0; + err_out_unmap_bars: ionic_unmap_bars(ionic); pci_release_regions(pdev); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 191271f6260d..1b7e18fe83db 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2408,6 +2408,9 @@ void ionic_lifs_unregister(struct ionic *ionic) * current model, so don't bother searching the * ionic->lif for candidates to unregister */ + if (!ionic->master_lif) + return; + cancel_work_sync(&ionic->master_lif->deferred.work); cancel_work_sync(&ionic->master_lif->tx_timeout_work); if (ionic->master_lif->netdev->reg_state == NETREG_REGISTERED) From patchwork Tue Mar 3 04:15:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1248048 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=l0pHfgCM; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48WkGD4NbPz9sPg for ; Tue, 3 Mar 2020 15:16:04 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727226AbgCCEQD (ORCPT ); Mon, 2 Mar 2020 23:16:03 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40947 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726910AbgCCEQD (ORCPT ); Mon, 2 Mar 2020 23:16:03 -0500 Received: by mail-pl1-f195.google.com with SMTP id y1so706178plp.7 for ; Mon, 02 Mar 2020 20:16:02 -0800 (PST) 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=KKBKvNcJGY1TZuV+ovrL2wWJl2GnYYxVCVyMuW9EBv0=; b=l0pHfgCMYFjdDNe8Y66X/pNIBOj4kUM6DBx04nOMq/4qbtdsR4eLpe3XKTbnvtnhJf SWCNVGW/TAODFqfSHUvDgUoVa1XuwoTsMaB6+bx9J7CQxzSjCRnp2DsMujj8eWdhVln0 AokMT1YM/j4oyCKmc5h2ewWW5BLYsXrZ04rxxEPss76ykL9bwdMW/1B3VBQySrUAKWdp OQr48ama4954bEQK3h+fHTJkBHyNFeuAW2Sm9rRjvO7TgvT4WukWRiQK89Twp50+W1vS aWSGj92used5JXF2I96wLUY0gdCo2zmJhhfvcq32CDWJM/G0sEeBgLnIJh7qi37Jb3Ny /5+Q== 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=KKBKvNcJGY1TZuV+ovrL2wWJl2GnYYxVCVyMuW9EBv0=; b=MtDYMweOiB957gS9+sxPRipfVxJnxqW+d9XxfgoH8VjoR3ryxR7Yn7J0287iaQ2Evv tXnnkU1o+mMJ4ZE98E3Jly7G3B8v3gkU80uph2PNxYTeA2h+yMyLH0wl0WLqdCwxbDBJ RkGdAdIZQuAONsic46aZ8YoXFmmPphGozAMzJ2Z8SWfF0ppeZhJ45kXUDDjo2Wp9RCJy 7AKj5huAm+9FRTIlSk8vPojpqyrzOGAVoBhQW6aFY7C3ikTWR6r2tlRiB9zDRGhEyjYB SMJ6qemusXZMgFMhohoqiq3rSc0KCDns6ikFBU28fSgvNDJu4VTK88LgW5oeneK3scUV pFDA== X-Gm-Message-State: ANhLgQ3zUO/2Qs9YI6mDW7sy87qBSLUhTpueapyiLzUE/MWQUU+VepsN igsjNKAExNCeFd04OpRSO5oFkBPomsI= X-Google-Smtp-Source: ADFU+vssapIwkWJq3chMgyunv9X86ccnIPn96+jOyEBVJu2wUJrR2qp1LAyEDqvrg/FNtqFp6bWIXw== X-Received: by 2002:a17:902:6b07:: with SMTP id o7mr2310874plk.141.1583208962188; Mon, 02 Mar 2020 20:16:02 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id t7sm396682pjy.1.2020.03.02.20.16.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2020 20:16:01 -0800 (PST) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 2/8] ionic: remove pragma packed Date: Mon, 2 Mar 2020 20:15:39 -0800 Message-Id: <20200303041545.1611-3-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200303041545.1611-1-snelson@pensando.io> References: <20200303041545.1611-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Replace the misguided "#pragma packed" with tags on each struct/union definition that actually needs it. This is safer and more efficient on the various compilers and architectures. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_if.h | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h index ce07c2931a72..74697c25cd40 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_if.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h @@ -4,8 +4,6 @@ #ifndef _IONIC_IF_H_ #define _IONIC_IF_H_ -#pragma pack(push, 1) - #define IONIC_DEV_INFO_SIGNATURE 0x44455649 /* 'DEVI' */ #define IONIC_DEV_INFO_VERSION 1 #define IONIC_IFNAMSIZ 16 @@ -366,7 +364,7 @@ union ionic_lif_config { u8 rsvd2[2]; __le64 features; __le32 queue_count[IONIC_QTYPE_MAX]; - }; + } __attribute__((packed)); __le32 words[64]; }; @@ -417,7 +415,7 @@ union ionic_lif_identity { __le32 max_frame_size; u8 rsvd2[106]; union ionic_lif_config config; - } eth; + } __attribute__((packed)) eth; struct { u8 version; @@ -439,8 +437,8 @@ union ionic_lif_identity { struct ionic_lif_logical_qtype rq_qtype; struct ionic_lif_logical_qtype cq_qtype; struct ionic_lif_logical_qtype eq_qtype; - } rdma; - }; + } __attribute((packed)) rdma; + } __attribute((packed)); __le32 words[512]; }; @@ -526,7 +524,7 @@ struct ionic_q_init_cmd { __le64 sg_ring_base; __le32 eq_index; u8 rsvd2[16]; -}; +} __attribute__((packed)); /** * struct ionic_q_init_comp - Queue init command completion @@ -1095,7 +1093,7 @@ struct ionic_port_status { u8 status; u8 rsvd[51]; struct ionic_xcvr_status xcvr; -}; +} __attribute((packed)); /** * struct ionic_port_identify_cmd - Port identify command @@ -1251,7 +1249,7 @@ struct ionic_port_getattr_comp { u8 pause_type; u8 loopback_mode; u8 rsvd2[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -1319,7 +1317,7 @@ struct ionic_dev_setattr_cmd { char name[IONIC_IFNAMSIZ]; __le64 features; u8 rsvd2[60]; - }; + } __attribute__((packed)); }; /** @@ -1334,7 +1332,7 @@ struct ionic_dev_setattr_comp { union { __le64 features; u8 rsvd2[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -1361,7 +1359,7 @@ struct ionic_dev_getattr_comp { union { __le64 features; u8 rsvd2[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -1426,7 +1424,7 @@ struct ionic_lif_setattr_cmd { } rss; u8 stats_ctl; u8 rsvd[60]; - }; + } __attribute__((packed)); }; /** @@ -1444,7 +1442,7 @@ struct ionic_lif_setattr_comp { union { __le64 features; u8 rsvd2[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -1483,7 +1481,7 @@ struct ionic_lif_getattr_comp { u8 mac[6]; __le64 features; u8 rsvd2[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -1688,7 +1686,7 @@ struct ionic_vf_setattr_cmd { u8 linkstate; __le64 stats_pa; u8 pad[60]; - }; + } __attribute__((packed)); }; struct ionic_vf_setattr_comp { @@ -1726,7 +1724,7 @@ struct ionic_vf_getattr_comp { u8 linkstate; __le64 stats_pa; u8 pad[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -2471,7 +2469,7 @@ union ionic_dev_cmd_regs { union ionic_dev_cmd_comp comp; u8 rsvd[48]; u32 data[478]; - }; + } __attribute__((packed)); u32 words[512]; }; @@ -2484,7 +2482,7 @@ union ionic_dev_regs { struct { union ionic_dev_info_regs info; union ionic_dev_cmd_regs devcmd; - }; + } __attribute__((packed)); __le32 words[1024]; }; @@ -2574,6 +2572,4 @@ struct ionic_identity { union ionic_qos_identity qos; }; -#pragma pack(pop) - #endif /* _IONIC_IF_H_ */ From patchwork Tue Mar 3 04:15:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1248050 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=wX1qU0Ug; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48WkGH2b3tz9sPg for ; Tue, 3 Mar 2020 15:16:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727306AbgCCEQG (ORCPT ); Mon, 2 Mar 2020 23:16:06 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43242 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727234AbgCCEQF (ORCPT ); Mon, 2 Mar 2020 23:16:05 -0500 Received: by mail-pf1-f194.google.com with SMTP id s1so772559pfh.10 for ; Mon, 02 Mar 2020 20:16:03 -0800 (PST) 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=omLW27ISR6OibziXSfi5be6HG4rkQoni8p1KLgyQoXg=; b=wX1qU0Ug9ctQy389QGAKR4/lOXQIWJCvCTBvwXGwqGZuwbvEVYYeHmg9h51vgjmPfs 5nrEOe7DF3lGtwl85tNTKr3783YhtyQ9Krj4WKHQ5OknYn/tHREgN5WYFgAMQF9imX+/ IaUdY4QYyjpv3yZ4aFIHN+OJDL5HUm9amJ1zN/RWcpk2lmWsnuesjs3cJUtDchIyDCaE gt1miVRP7HNgoAjZHznMDd1e1YdjS7lZST2aQDTFRl7/71drMV5NyFsJjMkU3nJBylre gDqSq3KS2zWWVNtK8pJsrKORV42DoER1/dFzg2x9dDd3I3H9YG25T8bQnitv+PxTiDXJ dc2g== 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=omLW27ISR6OibziXSfi5be6HG4rkQoni8p1KLgyQoXg=; b=kkcW8UuudBmFxljFhwoAwpd987hcLCv2SSYAW6jyY1kkbirJhWV3xnDMM3DuD24c3V 1+BSEH7Kc7juFHb+cN/4XWbosKVHirhPN6J2F/hj9JWGHP6zsvLt4uGX4OcGiIvFXujN Iaam7/yNlq4/nYRqZaYcINM8z28Rz2721Znrj9h47DGN22BJ+GRkGYUinCs9CyBw17Dq iDiHuih3Kn4fzwJ96tMxknkh9qzydxNfO8kriAzlpCslVqdpuspqkOh+rizuMeJYJwAt pJclrKke/1m7RgeytV5XZ0ivxhqvEFA0N6yn9ZZqy+9Io8x5dGhpU5/5i9NzS5et5S8B 4WTw== X-Gm-Message-State: ANhLgQ0Dz+oJdXzH8KnhSCYFVZpIiH+o8SLfYkkvWWQCK/D/SRP9A1h9 5FBWA6AD/aaHbcbNKDQOtSXI4Q== X-Google-Smtp-Source: ADFU+vshPKfPxtpbpy1h1pJDrk60gYbWYzhUizKphG+PXP7ZjUZvW6XsKQv12zFgaSQbyeEj4iKSLA== X-Received: by 2002:a63:5c4:: with SMTP id 187mr2328542pgf.348.1583208962941; Mon, 02 Mar 2020 20:16:02 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id t7sm396682pjy.1.2020.03.02.20.16.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2020 20:16:02 -0800 (PST) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 3/8] ionic: improve irq numa locality Date: Mon, 2 Mar 2020 20:15:40 -0800 Message-Id: <20200303041545.1611-4-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200303041545.1611-1-snelson@pensando.io> References: <20200303041545.1611-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Spreading the interrupts across the CPU cores is good for load balancing, but not necessarily as good when using a CPU/core that is not part of the NUMA local CPU. If it can be localized, the kernel's cpumask_local_spread() service will pick a core that is on the node close to the PCI device. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 1b7e18fe83db..7df49b433ae5 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -424,8 +424,9 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, ionic_intr_mask_assert(idev->intr_ctrl, new->intr.index, IONIC_INTR_MASK_SET); - new->intr.cpu = new->intr.index % num_online_cpus(); - if (cpu_online(new->intr.cpu)) + new->intr.cpu = cpumask_local_spread(new->intr.index, + dev_to_node(dev)); + if (new->intr.cpu != -1) cpumask_set_cpu(new->intr.cpu, &new->intr.affinity_mask); } else { From patchwork Tue Mar 3 04:15:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1248054 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=Ga7aCmB2; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48WkGQ5LdTz9sPg for ; Tue, 3 Mar 2020 15:16:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727399AbgCCEQN (ORCPT ); Mon, 2 Mar 2020 23:16:13 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39687 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727237AbgCCEQF (ORCPT ); Mon, 2 Mar 2020 23:16:05 -0500 Received: by mail-pg1-f196.google.com with SMTP id s2so889368pgv.6 for ; Mon, 02 Mar 2020 20:16:04 -0800 (PST) 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=n+tX6FtoNy0xqtHkylnOj8rDMvnTHLoC+mNlcDwGY+A=; b=Ga7aCmB2HOp+e2ND1DEHQwKgGddigYXVlhVxisCjOFmfbNyXTMahg0DiqUofpIuzNq Gm2uDWjOuy9v5SsZ3YsJkbJ+X3r45uvEgItMp1u2syCvcBEEriJ5FeWFdAzVc3twWA6t rtIwOcG1K8w+VSJSRA63mhxCauCXYY5ih9oILyXLh1P0V0FrTfv4Cl34Tt8OZfP07gii pyGlpkHo1XFxOQxMlVR9rTWKyzoHV28MPzAWsILu3nmoLcauAjiBRRszuPmMe+QxqWUh RjxQIEPHHX1Ca1F2lAtNOpwdPz9QXwypobsh8NjqRNmEfBTx6RLrtcEJvO1cIhBkKYnX ErdA== 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=n+tX6FtoNy0xqtHkylnOj8rDMvnTHLoC+mNlcDwGY+A=; b=XDpyt6Nd+mJEvnI06Au24JZ7ptjZggpbTECvGo04sEgqS56UU9OV7jcS2gLKa2SFUL 6UjTKBm69FmfKJ8eGhBLhHwc+80e+4dlVrFLQ5LVikeS8uksP+UTzsZjlH2Hefv/5taE DVx2n70vU3OcBWNQM1L+759RCh4oVNwEVPxvvflAGASSRAUq0DElNBNB+H3FUyPAkVR5 SUIklwFLBhjHGcvWH54XcjjU+j5FtHICiXzaT/czKlqeUIphWxHS/WlXVTkT62VXfdu0 ChB0o6975zTLqFCf6txnAD0SjEvU/R3HffWViB1E3nfAR2CMy21qdHGBgQX344gnn+qh Tawg== X-Gm-Message-State: ANhLgQ2I0bz6tQyfYv9eEd1QeCgbHFvqZgTAssznKYAa15YP9SU8j2xx uPqwixHCRf7vFYDRVY3ZICrJHfiOgro= X-Google-Smtp-Source: ADFU+vvtcXj3r3X2zHj5stnGEKl61IArmz4RdkMC68CPljst2A+OxvNiz0EOyK4XBgiRm4SGJKywDg== X-Received: by 2002:a63:f10c:: with SMTP id f12mr2302995pgi.386.1583208963790; Mon, 02 Mar 2020 20:16:03 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id t7sm396682pjy.1.2020.03.02.20.16.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2020 20:16:03 -0800 (PST) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 4/8] ionic: clean up bitflag usage Date: Mon, 2 Mar 2020 20:15:41 -0800 Message-Id: <20200303041545.1611-5-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200303041545.1611-1-snelson@pensando.io> References: <20200303041545.1611-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Remove the unused flags field and and fix the bitflag names to include the _F_ flag hint. Signed-off-by: Shannon Nelson --- .../ethernet/pensando/ionic/ionic_ethtool.c | 24 ++++++++----------- .../net/ethernet/pensando/ionic/ionic_lif.c | 24 +++++++++---------- .../net/ethernet/pensando/ionic/ionic_lif.h | 15 ++++++------ .../net/ethernet/pensando/ionic/ionic_stats.c | 20 ++++++++-------- .../net/ethernet/pensando/ionic/ionic_txrx.c | 4 ++-- 5 files changed, 41 insertions(+), 46 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c index f778fff034f5..acd53e27d1ec 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c @@ -462,7 +462,7 @@ static int ionic_set_coalesce(struct net_device *netdev, if (coal != lif->rx_coalesce_hw) { lif->rx_coalesce_hw = coal; - if (test_bit(IONIC_LIF_UP, lif->state)) { + if (test_bit(IONIC_LIF_F_UP, lif->state)) { for (i = 0; i < lif->nxqs; i++) { qcq = lif->rxqcqs[i].qcq; ionic_intr_coal_init(lif->ionic->idev.intr_ctrl, @@ -509,11 +509,11 @@ static int ionic_set_ringparam(struct net_device *netdev, ring->rx_pending == lif->nrxq_descs) return 0; - err = ionic_wait_for_bit(lif, IONIC_LIF_QUEUE_RESET); + err = ionic_wait_for_bit(lif, IONIC_LIF_F_QUEUE_RESET); if (err) return err; - running = test_bit(IONIC_LIF_UP, lif->state); + running = test_bit(IONIC_LIF_F_UP, lif->state); if (running) ionic_stop(netdev); @@ -522,7 +522,7 @@ static int ionic_set_ringparam(struct net_device *netdev, if (running) ionic_open(netdev); - clear_bit(IONIC_LIF_QUEUE_RESET, lif->state); + clear_bit(IONIC_LIF_F_QUEUE_RESET, lif->state); return 0; } @@ -553,11 +553,11 @@ static int ionic_set_channels(struct net_device *netdev, if (ch->combined_count == lif->nxqs) return 0; - err = ionic_wait_for_bit(lif, IONIC_LIF_QUEUE_RESET); + err = ionic_wait_for_bit(lif, IONIC_LIF_F_QUEUE_RESET); if (err) return err; - running = test_bit(IONIC_LIF_UP, lif->state); + running = test_bit(IONIC_LIF_F_UP, lif->state); if (running) ionic_stop(netdev); @@ -565,7 +565,7 @@ static int ionic_set_channels(struct net_device *netdev, if (running) ionic_open(netdev); - clear_bit(IONIC_LIF_QUEUE_RESET, lif->state); + clear_bit(IONIC_LIF_F_QUEUE_RESET, lif->state); return 0; } @@ -575,7 +575,7 @@ static u32 ionic_get_priv_flags(struct net_device *netdev) struct ionic_lif *lif = netdev_priv(netdev); u32 priv_flags = 0; - if (test_bit(IONIC_LIF_SW_DEBUG_STATS, lif->state)) + if (test_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state)) priv_flags |= PRIV_F_SW_DBG_STATS; return priv_flags; @@ -584,14 +584,10 @@ static u32 ionic_get_priv_flags(struct net_device *netdev) static int ionic_set_priv_flags(struct net_device *netdev, u32 priv_flags) { struct ionic_lif *lif = netdev_priv(netdev); - u32 flags = lif->flags; - clear_bit(IONIC_LIF_SW_DEBUG_STATS, lif->state); + clear_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state); if (priv_flags & PRIV_F_SW_DBG_STATS) - set_bit(IONIC_LIF_SW_DEBUG_STATS, lif->state); - - if (flags != lif->flags) - lif->flags = flags; + set_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state); return 0; } diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 7df49b433ae5..d1567e477b1f 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -84,7 +84,7 @@ static void ionic_link_status_check(struct ionic_lif *lif) netdev_info(netdev, "Link up - %d Gbps\n", le32_to_cpu(lif->info->status.link_speed) / 1000); - if (test_bit(IONIC_LIF_UP, lif->state)) { + if (test_bit(IONIC_LIF_F_UP, lif->state)) { netif_tx_wake_all_queues(lif->netdev); netif_carrier_on(netdev); } @@ -93,12 +93,12 @@ static void ionic_link_status_check(struct ionic_lif *lif) /* carrier off first to avoid watchdog timeout */ netif_carrier_off(netdev); - if (test_bit(IONIC_LIF_UP, lif->state)) + if (test_bit(IONIC_LIF_F_UP, lif->state)) netif_tx_stop_all_queues(netdev); } link_out: - clear_bit(IONIC_LIF_LINK_CHECK_REQUESTED, lif->state); + clear_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state); } static void ionic_link_status_check_request(struct ionic_lif *lif) @@ -106,7 +106,7 @@ static void ionic_link_status_check_request(struct ionic_lif *lif) struct ionic_deferred_work *work; /* we only need one request outstanding at a time */ - if (test_and_set_bit(IONIC_LIF_LINK_CHECK_REQUESTED, lif->state)) + if (test_and_set_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state)) return; if (in_interrupt()) { @@ -1579,7 +1579,7 @@ int ionic_open(struct net_device *netdev) netif_set_real_num_tx_queues(netdev, lif->nxqs); netif_set_real_num_rx_queues(netdev, lif->nxqs); - set_bit(IONIC_LIF_UP, lif->state); + set_bit(IONIC_LIF_F_UP, lif->state); ionic_link_status_check_request(lif); if (netif_carrier_ok(netdev)) @@ -1599,13 +1599,13 @@ int ionic_stop(struct net_device *netdev) struct ionic_lif *lif = netdev_priv(netdev); int err = 0; - if (!test_bit(IONIC_LIF_UP, lif->state)) { + if (!test_bit(IONIC_LIF_F_UP, lif->state)) { dev_dbg(lif->ionic->dev, "%s: %s state=DOWN\n", __func__, lif->name); return 0; } dev_dbg(lif->ionic->dev, "%s: %s state=UP\n", __func__, lif->name); - clear_bit(IONIC_LIF_UP, lif->state); + clear_bit(IONIC_LIF_F_UP, lif->state); /* carrier off before disabling queues to avoid watchdog timeout */ netif_carrier_off(netdev); @@ -1872,7 +1872,7 @@ int ionic_reset_queues(struct ionic_lif *lif) /* Put off the next watchdog timeout */ netif_trans_update(lif->netdev); - err = ionic_wait_for_bit(lif, IONIC_LIF_QUEUE_RESET); + err = ionic_wait_for_bit(lif, IONIC_LIF_F_QUEUE_RESET); if (err) return err; @@ -1882,7 +1882,7 @@ int ionic_reset_queues(struct ionic_lif *lif) if (!err && running) ionic_open(lif->netdev); - clear_bit(IONIC_LIF_QUEUE_RESET, lif->state); + clear_bit(IONIC_LIF_F_QUEUE_RESET, lif->state); return err; } @@ -2049,10 +2049,10 @@ void ionic_lifs_free(struct ionic *ionic) static void ionic_lif_deinit(struct ionic_lif *lif) { - if (!test_bit(IONIC_LIF_INITED, lif->state)) + if (!test_bit(IONIC_LIF_F_INITED, lif->state)) return; - clear_bit(IONIC_LIF_INITED, lif->state); + clear_bit(IONIC_LIF_F_INITED, lif->state); ionic_rx_filters_deinit(lif); ionic_lif_rss_deinit(lif); @@ -2288,7 +2288,7 @@ static int ionic_lif_init(struct ionic_lif *lif) lif->rx_copybreak = IONIC_RX_COPYBREAK_DEFAULT; - set_bit(IONIC_LIF_INITED, lif->state); + set_bit(IONIC_LIF_F_INITED, lif->state); INIT_WORK(&lif->tx_timeout_work, ionic_tx_timeout_work); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index 9c5a7dd45f9d..7c0c6fef8c0b 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -121,14 +121,14 @@ struct ionic_lif_sw_stats { }; enum ionic_lif_state_flags { - IONIC_LIF_INITED, - IONIC_LIF_SW_DEBUG_STATS, - IONIC_LIF_UP, - IONIC_LIF_LINK_CHECK_REQUESTED, - IONIC_LIF_QUEUE_RESET, + IONIC_LIF_F_INITED, + IONIC_LIF_F_SW_DEBUG_STATS, + IONIC_LIF_F_UP, + IONIC_LIF_F_LINK_CHECK_REQUESTED, + IONIC_LIF_F_QUEUE_RESET, /* leave this as last */ - IONIC_LIF_STATE_SIZE + IONIC_LIF_F_STATE_SIZE }; #define IONIC_LIF_NAME_MAX_SZ 32 @@ -136,7 +136,7 @@ struct ionic_lif { char name[IONIC_LIF_NAME_MAX_SZ]; struct list_head list; struct net_device *netdev; - DECLARE_BITMAP(state, IONIC_LIF_STATE_SIZE); + DECLARE_BITMAP(state, IONIC_LIF_F_STATE_SIZE); struct ionic *ionic; bool registered; unsigned int index; @@ -179,7 +179,6 @@ struct ionic_lif { u32 rx_coalesce_usecs; /* what the user asked for */ u32 rx_coalesce_hw; /* what the hw is using */ - u32 flags; struct work_struct tx_timeout_work; }; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_stats.c b/drivers/net/ethernet/pensando/ionic/ionic_stats.c index a1e9796a660a..8f2a8fb029f1 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_stats.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_stats.c @@ -118,8 +118,8 @@ static u64 ionic_sw_stats_get_count(struct ionic_lif *lif) /* rx stats */ total += MAX_Q(lif) * IONIC_NUM_RX_STATS; - if (test_bit(IONIC_LIF_UP, lif->state) && - test_bit(IONIC_LIF_SW_DEBUG_STATS, lif->state)) { + if (test_bit(IONIC_LIF_F_UP, lif->state) && + test_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state)) { /* tx debug stats */ total += MAX_Q(lif) * (IONIC_NUM_DBG_CQ_STATS + IONIC_NUM_TX_Q_STATS + @@ -151,8 +151,8 @@ static void ionic_sw_stats_get_strings(struct ionic_lif *lif, u8 **buf) *buf += ETH_GSTRING_LEN; } - if (test_bit(IONIC_LIF_UP, lif->state) && - test_bit(IONIC_LIF_SW_DEBUG_STATS, lif->state)) { + if (test_bit(IONIC_LIF_F_UP, lif->state) && + test_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state)) { for (i = 0; i < IONIC_NUM_TX_Q_STATS; i++) { snprintf(*buf, ETH_GSTRING_LEN, "txq_%d_%s", @@ -190,8 +190,8 @@ static void ionic_sw_stats_get_strings(struct ionic_lif *lif, u8 **buf) *buf += ETH_GSTRING_LEN; } - if (test_bit(IONIC_LIF_UP, lif->state) && - test_bit(IONIC_LIF_SW_DEBUG_STATS, lif->state)) { + if (test_bit(IONIC_LIF_F_UP, lif->state) && + test_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state)) { for (i = 0; i < IONIC_NUM_DBG_CQ_STATS; i++) { snprintf(*buf, ETH_GSTRING_LEN, "rxq_%d_cq_%s", @@ -247,8 +247,8 @@ static void ionic_sw_stats_get_values(struct ionic_lif *lif, u64 **buf) (*buf)++; } - if (test_bit(IONIC_LIF_UP, lif->state) && - test_bit(IONIC_LIF_SW_DEBUG_STATS, lif->state)) { + if (test_bit(IONIC_LIF_F_UP, lif->state) && + test_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state)) { txqcq = lif_to_txqcq(lif, q_num); for (i = 0; i < IONIC_NUM_TX_Q_STATS; i++) { **buf = IONIC_READ_STAT64(&txqcq->q, @@ -281,8 +281,8 @@ static void ionic_sw_stats_get_values(struct ionic_lif *lif, u64 **buf) (*buf)++; } - if (test_bit(IONIC_LIF_UP, lif->state) && - test_bit(IONIC_LIF_SW_DEBUG_STATS, lif->state)) { + if (test_bit(IONIC_LIF_F_UP, lif->state) && + test_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state)) { rxqcq = lif_to_rxqcq(lif, q_num); for (i = 0; i < IONIC_NUM_DBG_CQ_STATS; i++) { **buf = IONIC_READ_STAT64(&rxqcq->cq, diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c index e452f4242ba0..a268cead9f50 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -158,7 +158,7 @@ static void ionic_rx_clean(struct ionic_queue *q, struct ionic_desc_info *desc_i } /* no packet processing while resetting */ - if (unlikely(test_bit(IONIC_LIF_QUEUE_RESET, q->lif->state))) { + if (unlikely(test_bit(IONIC_LIF_F_QUEUE_RESET, q->lif->state))) { stats->dropped++; return; } @@ -1026,7 +1026,7 @@ netdev_tx_t ionic_start_xmit(struct sk_buff *skb, struct net_device *netdev) int ndescs; int err; - if (unlikely(!test_bit(IONIC_LIF_UP, lif->state))) { + if (unlikely(!test_bit(IONIC_LIF_F_UP, lif->state))) { dev_kfree_skb(skb); return NETDEV_TX_OK; } From patchwork Tue Mar 3 04:15:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1248055 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=eaRZ0JUd; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48WkGR6Q6mz9sQt for ; Tue, 3 Mar 2020 15:16:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727392AbgCCEQN (ORCPT ); Mon, 2 Mar 2020 23:16:13 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:37060 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbgCCEQF (ORCPT ); Mon, 2 Mar 2020 23:16:05 -0500 Received: by mail-pg1-f193.google.com with SMTP id z12so894273pgl.4 for ; Mon, 02 Mar 2020 20:16:05 -0800 (PST) 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=7Fanemj7lqCOtUtHai5n5mSddCSmoi8i8DsjH04odmA=; b=eaRZ0JUdyUdP+oyaqzc4uTP5fJsbACR3hPGrhJY0K1HaFBB8MqqE1VoaHBFsulyyli dcT0fr/n147qWWSjaGAOT1TkAAqQ7g1Ulv+oxOi4r7su0PXX9uVZTeK40tQO8ySNu7GT d4ix1QArm8XhLm/f/eIL+FYnbg3W9pyB9O7n30td7zJaQsYPs+81jkVa8ILuL9Y+doHm q6S5SzxTJ/VbEdBHKfqB9/yX3N4FtbBMBxf/zZBMTryK7O5+LY9Dt8bCxzEbNqnl9cPC 3+Vi4addpwrp46zHiQexlPp4qqqTV+aq704lCZCfGvzyKBlTP2My3RXIOfgDA3u784mJ 6veg== 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=7Fanemj7lqCOtUtHai5n5mSddCSmoi8i8DsjH04odmA=; b=fzzM6KCv+Rh234UvrdigZXl/Ivd5kCKJKuPA7OeYqxXlzol58XOgjxR7/yzO33lffa f0w1Qeotd+JyttTdZb3mWEKYhd1ILsg4t6ZCMJhwJrBtzEwA+YzDcfNezR0oT/uocq42 modHL47OckNgzTB8nEZhU1MsTQsT/fvbRuee+ltOp2HB5l5soFpGIUZ1Me5wSFgHTkOm LxNXWAuYBQkFa8+/AZjAr6XnlYoZYnFYot2H4gHxbUaLZv5v5Nlgw+QZTe6g160Utm7D YhUwHjO7wYk1n9lc+6hHdZaYQG7C8EGCpLYlHsInvDgJQCwX/LgnPJYlBmZ7688rHMZS LXhQ== X-Gm-Message-State: ANhLgQ2ykvpCXW55tyNtqMt8sPtLJn/Vyn8TD55sKBEU1VCWQRM0Xvqp gPbhNEvpvw2jupuceiRUgKtIcA== X-Google-Smtp-Source: ADFU+vvtLxx7oZQ2OlDOYnv48Z/xV/rpg5UkQ6+J7KfPikxlYitF8Xu2ymj2ub+/znZ8KvLrlvSDng== X-Received: by 2002:a62:64d5:: with SMTP id y204mr2395646pfb.90.1583208964589; Mon, 02 Mar 2020 20:16:04 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id t7sm396682pjy.1.2020.03.02.20.16.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2020 20:16:04 -0800 (PST) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 5/8] ionic: support ethtool rxhash disable Date: Mon, 2 Mar 2020 20:15:42 -0800 Message-Id: <20200303041545.1611-6-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200303041545.1611-1-snelson@pensando.io> References: <20200303041545.1611-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We can disable rxhashing by setting rss_types to 0. The user can toggle this with "ethtool -K rxhash off|on", which calls into the .ndo_set_features callback with the NETIF_F_RXHASH feature bit set or cleared. This patch adds a check for that bit and updates the FW if necessary. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index d1567e477b1f..4b953f9e9084 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1094,6 +1094,7 @@ static int ionic_set_nic_features(struct ionic_lif *lif, u64 vlan_flags = IONIC_ETH_HW_VLAN_TX_TAG | IONIC_ETH_HW_VLAN_RX_STRIP | IONIC_ETH_HW_VLAN_RX_FILTER; + u64 old_hw_features; int err; ctx.cmd.lif_setattr.features = ionic_netdev_features_to_nic(features); @@ -1101,9 +1102,13 @@ static int ionic_set_nic_features(struct ionic_lif *lif, if (err) return err; + old_hw_features = lif->hw_features; lif->hw_features = le64_to_cpu(ctx.cmd.lif_setattr.features & ctx.comp.lif_setattr.features); + if ((old_hw_features ^ lif->hw_features) & IONIC_ETH_HW_RX_HASH) + ionic_lif_rss_config(lif, lif->rss_types, NULL, NULL); + if ((vlan_flags & features) && !(vlan_flags & le64_to_cpu(ctx.comp.lif_setattr.features))) dev_info_once(lif->ionic->dev, "NIC is not supporting vlan offload, likely in SmartNIC mode\n"); @@ -1357,13 +1362,15 @@ int ionic_lif_rss_config(struct ionic_lif *lif, const u16 types, .cmd.lif_setattr = { .opcode = IONIC_CMD_LIF_SETATTR, .attr = IONIC_LIF_ATTR_RSS, - .rss.types = cpu_to_le16(types), .rss.addr = cpu_to_le64(lif->rss_ind_tbl_pa), }, }; unsigned int i, tbl_sz; - lif->rss_types = types; + if (lif->hw_features & IONIC_ETH_HW_RX_HASH) { + lif->rss_types = types; + ctx.cmd.lif_setattr.rss.types = cpu_to_le16(types); + } if (key) memcpy(lif->rss_hash_key, key, IONIC_RSS_HASH_KEY_SIZE); From patchwork Tue Mar 3 04:15:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1248053 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=Jepfb/08; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48WkGN0pw3z9sPg for ; Tue, 3 Mar 2020 15:16:12 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727384AbgCCEQL (ORCPT ); Mon, 2 Mar 2020 23:16:11 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40769 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727073AbgCCEQG (ORCPT ); Mon, 2 Mar 2020 23:16:06 -0500 Received: by mail-pf1-f196.google.com with SMTP id l184so780203pfl.7 for ; Mon, 02 Mar 2020 20:16:05 -0800 (PST) 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=s5+2M55qCyjMNWRRfZa1qww5IAjEysQ2sF63nol+NPk=; b=Jepfb/088kvGsck2bouaP+Mj2+rl5+Qk7/228uH/qhYMQE1b3vsCLNpqxDfbt4FHtZ CTjZ48yd/K1I1WZ2V/X3pFjwi8nbjayfuJ/yG0F0TWn+xRX0bIaLM1OX12EeYbz4pD2U J1lWMQt7Su34dy4v9McjkAiuWDGQYhA8QAx7w6+eevzpzzuHT3I+dzfjT6hagAmKRRyO mg5DZv2DfsCMdXkxaWGzzbWxc4Ypp6+A9dldw+1Xo2s/7UxcTy3sP1SL8/+3E+WKseW5 +jmBWX4iPIGz/AGfMsJmkBqe3DuZ4cY1IyJnWOEcqru6KfXYTC4ZPQL51L7QCcy1K2Ec lWyw== 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=s5+2M55qCyjMNWRRfZa1qww5IAjEysQ2sF63nol+NPk=; b=FEnf5xaZnhO56gtgoHhYjlz++PII1rYV2JpqNlZaS6qv/YJBYnxOkhxky2R8UANwEa Bk52zEw7r8UpSI3plB1amlFlG+qURe7qB7rfWPgZXwrFpKuKESmN2QAhJqjOQgsyBn2p 298jnbqEsUeZF1dYFMtvNuUBFaQTsd/QgnvBozc3okBpJ0G/VX5PBjKCZOxRHYXy3VJi P/TeYnrmojBRscRe9MsG1i+qalJTbsxmjvwNjSK88uJYvZoXjiIQTd/5ebpJwD3pO9bn Pr0zG6DWkude6BjaZ3QBYNIvy+XaAXI7pm0tPbWGkj/W5XTXA8p7Z6LjhTomrZ/jd5ds 0Uvg== X-Gm-Message-State: ANhLgQ3tmIe5MuVci518Hf3pABe6mdBYO7yfnc+tf2/UNaKevrAt/aFZ EP9d5H57EVI0I0Srbs14dnWptKLUP3c= X-Google-Smtp-Source: ADFU+vvFA0pulPXSCBsB+tOO0HGq+LVO1BY11VkygPMPPKHX20K2UrsoW1mBd4I5xGPfCO5wn+uyCQ== X-Received: by 2002:a62:cdc6:: with SMTP id o189mr2392167pfg.254.1583208965371; Mon, 02 Mar 2020 20:16:05 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id t7sm396682pjy.1.2020.03.02.20.16.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2020 20:16:04 -0800 (PST) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 6/8] ionic: print pci bus lane info Date: Mon, 2 Mar 2020 20:15:43 -0800 Message-Id: <20200303041545.1611-7-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200303041545.1611-1-snelson@pensando.io> References: <20200303041545.1611-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Print the PCI bus lane information so people can keep an eye out for poor configurations that might not support the advertised speed. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index 554bafac1147..59b0091146e6 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -248,6 +248,7 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } pci_set_master(pdev); + pcie_print_link_status(pdev); err = ionic_map_bars(ionic); if (err) From patchwork Tue Mar 3 04:15:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1248051 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=zhWC6hXv; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48WkGK6HGVz9sPg for ; Tue, 3 Mar 2020 15:16:09 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727331AbgCCEQJ (ORCPT ); Mon, 2 Mar 2020 23:16:09 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42622 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727312AbgCCEQH (ORCPT ); Mon, 2 Mar 2020 23:16:07 -0500 Received: by mail-pl1-f196.google.com with SMTP id u3so702852plr.9 for ; Mon, 02 Mar 2020 20:16:06 -0800 (PST) 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=61gZ4SQN/1tdeU8RQk3DcrIUxl3TSrJNCIjlf4zlDM0=; b=zhWC6hXvgVFhJox8jDMudwzy1sy3dbQZv05ipC1JoLkK9k8i3Gxca9qAIxnvEkotcf 3ve/9ggTh8T+0gc9Fxnn9NoWO/Ddoy1Tnn1LNHy0QnZBMRd9W99cRpiQm+IxsZENtmqe dTgC6n5oO94jCRzUlnZsRvyyzZ16aoy8yidWNYoEaBLtEcCnHmScrYrgOAkYa6KT0Ga9 zfzpt3W1HARN3kCAZ5xh2OQgukbCvAlAc+ncqGnXqa4apInVilwC69kEYnMqSLpf4/LA KhX/AmGYoGl75GgQxyrANaKCua1RPqP5M0dgZXVVbmLBd/mKcSHw61Ef4OfowFOL5CeR cI1w== 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=61gZ4SQN/1tdeU8RQk3DcrIUxl3TSrJNCIjlf4zlDM0=; b=LCGFwDOOia/ssFIIKwkUgJXYbF/Zq17tg5MbkLq7oBPEXR42+qNCOh5YUBcpBgOY/g bdJ66BMCr6mCN6g8PmB1+rnryNWNaD8NjRisSC9IdkD3AiSfnTMVGREgs+WakGyiNxUC ievKViulyZQCmRi30UxaLrLXyCghiTa0PSK/tAADtjycn8bUnF0sV9Lo4cLNHWwSx8ll 2qAf2oALy9hS6VwLAut6PGFe60vnOenS5dilgLKfG/I0HjXCFv4GdARnVECRzjzRw871 38wk9suHK54Mzoz6G6//FOagVHZdLqD3pqDL6CAOeCgXhzSRmWFdFiXnLyc+Okjkv15l aIiw== X-Gm-Message-State: ANhLgQ0dE/GTxvjOmVi8JrqX9PjmUWVu/HwdUagt/aoV0KeHs/1K7V/O +OdyDfyv5bZdUTVxRphCJInnQQ== X-Google-Smtp-Source: ADFU+vs/HdSszhqT2AKn4rsIvceaqJ5/Sg4+OvdWfHV1ljabfzOlEJPP5QUe6glYGyQxNDmb4XGDgQ== X-Received: by 2002:a17:90a:348a:: with SMTP id p10mr2080285pjb.120.1583208966244; Mon, 02 Mar 2020 20:16:06 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id t7sm396682pjy.1.2020.03.02.20.16.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2020 20:16:05 -0800 (PST) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 7/8] ionic: add support for device id 0x1004 Date: Mon, 2 Mar 2020 20:15:44 -0800 Message-Id: <20200303041545.1611-8-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200303041545.1611-1-snelson@pensando.io> References: <20200303041545.1611-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add support for an additional device id. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic.h | 1 + drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic.h b/drivers/net/ethernet/pensando/ionic/ionic.h index bb106a32f416..c8ff33da243a 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic.h +++ b/drivers/net/ethernet/pensando/ionic/ionic.h @@ -18,6 +18,7 @@ struct ionic_lif; #define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF 0x1002 #define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF 0x1003 +#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_MGMT 0x1004 #define DEVCMD_TIMEOUT 10 diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index 59b0091146e6..3dc985cae391 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -15,6 +15,7 @@ static const struct pci_device_id ionic_id_table[] = { { PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF) }, { PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF) }, + { PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_MGMT) }, { 0, } /* end of table */ }; MODULE_DEVICE_TABLE(pci, ionic_id_table); From patchwork Tue Mar 3 04:15:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1248052 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=JZR5u2Y6; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48WkGL5dFJz9sQt for ; Tue, 3 Mar 2020 15:16:10 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727366AbgCCEQJ (ORCPT ); Mon, 2 Mar 2020 23:16:09 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:41667 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726954AbgCCEQI (ORCPT ); Mon, 2 Mar 2020 23:16:08 -0500 Received: by mail-pg1-f193.google.com with SMTP id b1so886547pgm.8 for ; Mon, 02 Mar 2020 20:16:07 -0800 (PST) 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=cYfFRo4ChYawbVcRRzolQp332s8pe0/gWlieRE1m/lU=; b=JZR5u2Y6fqmP7ch3VGyLnAnUswlQ0Bg57IAlQfcMwA80m+FmaEXGFDaqq6OfFgzvDd W7N9fu0WkXFrOKhU7Hhsnonbwb260Pv/1GUkxhXOxXcerdYeOe6HOnSBEnp25RKKjVtr yQslbDQC0LXTav5MJGYcEP90x1+Se91mms8UCA+zaEKWS7z5RYLPkLweszgV0E1+oyl6 s9/2hqMvuY9sZzH55WhPNtqoqIZ5lZZNPPqKzSFj9l4g6IhnJ/nwDVvN7Gbn/DMpcmtw i29usucRuY3mkjhcGYK/yfSBs9w8D5A6xkdDANsu6LP3FsiAIICguEXmNOJjuUProNth TnWg== 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=cYfFRo4ChYawbVcRRzolQp332s8pe0/gWlieRE1m/lU=; b=ovK8BuNWp5r6mOY6GI1Vy1II6SqDiICSO+MW/MCvZ/Th/VQ1+yIto7mZtqdf8Dfe3e j2Xydx5dkHNO9DSJlbQHkR3yTKCYT/23JwADqzmqlz0Bhqf4VIpWLFvzWaJhltcb1GiH 6itpbK6S8L6vb9JiMbS5reLT6Mwqlr2DkH71g24xkaEkJ+WouPcpOKgsm0Z4dAs+bvi3 DOBbwM+8sFGKs9vMl5DVYUwEKZI2PxJLUSzaTA7OpCqQKK1ojq+xpnBVRqcpuQQwASoN pWwk6o9MJZ7ARpjWCwkBWgBTU6dwQqKbnyv/aV9KxAr/BfxQ9anDeNkDJyyy67K7qwC3 /wBA== X-Gm-Message-State: ANhLgQ1LMw+FxUByg+S1gmmRhio6htss/9bI/OtkxCtczqFA4NEIGcQp ///f7mdYpGc6z6UbGF0aUQ9dnU5nTuM= X-Google-Smtp-Source: ADFU+vusifx1gRjcMODhaFC7ym0j91+rY4AclRfPAB3/K9JA4iORBQI1wnut8Ci3BHZhJ/mRtiwb0A== X-Received: by 2002:aa7:8b17:: with SMTP id f23mr2296541pfd.197.1583208967123; Mon, 02 Mar 2020 20:16:07 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id t7sm396682pjy.1.2020.03.02.20.16.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2020 20:16:06 -0800 (PST) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org Cc: Shannon Nelson , Leon Romanovsky Subject: [PATCH net-next 8/8] ionic: drop ethtool driver version Date: Mon, 2 Mar 2020 20:15:45 -0800 Message-Id: <20200303041545.1611-9-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200303041545.1611-1-snelson@pensando.io> References: <20200303041545.1611-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use the default kernel version in ethtool drv_info output and drop the module version. Cc: Leon Romanovsky Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic.h | 1 - drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 1 - drivers/net/ethernet/pensando/ionic/ionic_main.c | 7 +++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic.h b/drivers/net/ethernet/pensando/ionic/ionic.h index c8ff33da243a..1c720759fd80 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic.h +++ b/drivers/net/ethernet/pensando/ionic/ionic.h @@ -12,7 +12,6 @@ struct ionic_lif; #define IONIC_DRV_NAME "ionic" #define IONIC_DRV_DESCRIPTION "Pensando Ethernet NIC Driver" -#define IONIC_DRV_VERSION "0.20.0-k" #define PCI_VENDOR_ID_PENSANDO 0x1dd8 diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c index acd53e27d1ec..bea9b78e0189 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c @@ -86,7 +86,6 @@ static void ionic_get_drvinfo(struct net_device *netdev, struct ionic *ionic = lif->ionic; strlcpy(drvinfo->driver, IONIC_DRV_NAME, sizeof(drvinfo->driver)); - strlcpy(drvinfo->version, IONIC_DRV_VERSION, sizeof(drvinfo->version)); strlcpy(drvinfo->fw_version, ionic->idev.dev_info.fw_version, sizeof(drvinfo->fw_version)); strlcpy(drvinfo->bus_info, ionic_bus_info(ionic), diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index a8e3fb73b465..5428af885fa7 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "ionic.h" #include "ionic_bus.h" @@ -15,7 +16,6 @@ MODULE_DESCRIPTION(IONIC_DRV_DESCRIPTION); MODULE_AUTHOR("Pensando Systems, Inc"); MODULE_LICENSE("GPL"); -MODULE_VERSION(IONIC_DRV_VERSION); static const char *ionic_error_to_str(enum ionic_status_code code) { @@ -414,7 +414,7 @@ int ionic_identify(struct ionic *ionic) memset(ident, 0, sizeof(*ident)); ident->drv.os_type = cpu_to_le32(IONIC_OS_TYPE_LINUX); - strncpy(ident->drv.driver_ver_str, IONIC_DRV_VERSION, + strncpy(ident->drv.driver_ver_str, UTS_RELEASE, sizeof(ident->drv.driver_ver_str) - 1); mutex_lock(&ionic->dev_cmd_lock); @@ -558,8 +558,7 @@ int ionic_port_reset(struct ionic *ionic) static int __init ionic_init_module(void) { - pr_info("%s %s, ver %s\n", - IONIC_DRV_NAME, IONIC_DRV_DESCRIPTION, IONIC_DRV_VERSION); + pr_info("%s %s\n", IONIC_DRV_NAME, IONIC_DRV_DESCRIPTION); ionic_debugfs_create(); return ionic_bus_register_driver(); }