From patchwork Tue Jun 30 12:02:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Cree X-Patchwork-Id: 216804 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACD3DC433DF for ; Tue, 30 Jun 2020 12:02:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B20A20702 for ; Tue, 30 Jun 2020 12:02:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733285AbgF3MCk (ORCPT ); Tue, 30 Jun 2020 08:02:40 -0400 Received: from dispatch1-us1.ppe-hosted.com ([148.163.129.52]:35550 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729647AbgF3MCj (ORCPT ); Tue, 30 Jun 2020 08:02:39 -0400 Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.60]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id DD92860081; Tue, 30 Jun 2020 12:02:38 +0000 (UTC) Received: from us4-mdac16-46.ut7.mdlocal (unknown [10.7.66.13]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id DC300200A0; Tue, 30 Jun 2020 12:02:38 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.66.39]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 6DDB71C0057; Tue, 30 Jun 2020 12:02:38 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 2735F8007A; Tue, 30 Jun 2020 12:02:38 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 13:02:33 +0100 From: Edward Cree Subject: [PATCH net-next 01/14] sfc: move NIC-specific mcdi_port declarations out of common header To: , CC: References: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Message-ID: Date: Tue, 30 Jun 2020 13:02:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25512.003 X-TM-AS-Result: No-1.958700-8.000000-10 X-TMASE-MatchedRID: YwWjki3vT3U5NXlWWXBFjkjBb8q+S/OCL3CpqoxHGN4KQo6lRC5cFa6P KQSZCnDq8XVI39JCRnSjfNAVYAJRAs11iH9zkl9ET7O/YHJhINBLXPA26IG0hN9RlPzeVuQQIg8 BFa7OCtzWOjFTe37S5JTGiAZtLnco+Dh1wKIt5dAHtOpEBhWiFpKLNrbpy/A0RwQM92B8ku7i0n VT9rWZ+SKq+ucuBo9XbOo++6sx6CR09yt1Yp3gnw97mDMXdNW381hDEI6KFM2/md2adk3dRD/IJ /33MGoxv9iQKTTStm13oCF5IgP2qU1+zyfzlN7ygxsfzkNRlfLdB/CxWTRRuwihQpoXbuXFNYSs j5NFs1pOV74QZful4OGVC4YQOuzF7LBrvg6H4rA/0NltFWkF3useU1RrPGHwtZW33XObJNA1KL9 7I8kLu8nchi6+KxM7WswIoFcXV3ojZU2CAxYkI/guCCuaxGC9PA0H4ETs+eWeqD9WtJkSIw== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--1.958700-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25512.003 X-MDID: 1593518558-aLUVXWPt5EfM Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org These functions are implemented in mcdi_port.c, which will not be linked into the EF100 driver; thus their prototypes should not be visible in common header files. Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/ef10.c | 1 + drivers/net/ethernet/sfc/mcdi.h | 4 ---- drivers/net/ethernet/sfc/mcdi_port.c | 1 + drivers/net/ethernet/sfc/mcdi_port.h | 18 ++++++++++++++++++ drivers/net/ethernet/sfc/siena.c | 1 + 5 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 drivers/net/ethernet/sfc/mcdi_port.h diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index efc49869320f..a3bf9d8023d7 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c @@ -10,6 +10,7 @@ #include "io.h" #include "mcdi.h" #include "mcdi_pcol.h" +#include "mcdi_port.h" #include "mcdi_port_common.h" #include "mcdi_functions.h" #include "nic.h" diff --git a/drivers/net/ethernet/sfc/mcdi.h b/drivers/net/ethernet/sfc/mcdi.h index db9746a751d4..10f064f761a5 100644 --- a/drivers/net/ethernet/sfc/mcdi.h +++ b/drivers/net/ethernet/sfc/mcdi.h @@ -354,15 +354,11 @@ int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out); int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id); int efx_mcdi_wol_filter_reset(struct efx_nic *efx); int efx_mcdi_flush_rxqs(struct efx_nic *efx); -int efx_mcdi_port_probe(struct efx_nic *efx); -void efx_mcdi_port_remove(struct efx_nic *efx); int efx_mcdi_port_reconfigure(struct efx_nic *efx); -u32 efx_mcdi_phy_get_caps(struct efx_nic *efx); void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev); void efx_mcdi_mac_start_stats(struct efx_nic *efx); void efx_mcdi_mac_stop_stats(struct efx_nic *efx); void efx_mcdi_mac_pull_stats(struct efx_nic *efx); -bool efx_mcdi_mac_check_fault(struct efx_nic *efx); enum reset_type efx_mcdi_map_reset_reason(enum reset_type reason); int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method); int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled, diff --git a/drivers/net/ethernet/sfc/mcdi_port.c b/drivers/net/ethernet/sfc/mcdi_port.c index b807871d8f69..212ff80e923b 100644 --- a/drivers/net/ethernet/sfc/mcdi_port.c +++ b/drivers/net/ethernet/sfc/mcdi_port.c @@ -10,6 +10,7 @@ #include #include "efx.h" +#include "mcdi_port.h" #include "mcdi.h" #include "mcdi_pcol.h" #include "nic.h" diff --git a/drivers/net/ethernet/sfc/mcdi_port.h b/drivers/net/ethernet/sfc/mcdi_port.h new file mode 100644 index 000000000000..07863ddbe740 --- /dev/null +++ b/drivers/net/ethernet/sfc/mcdi_port.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/**************************************************************************** + * Driver for Solarflare network controllers and boards + * Copyright 2008-2013 Solarflare Communications Inc. + * Copyright 2019-2020 Xilinx Inc. + */ + +#ifndef EFX_MCDI_PORT_H +#define EFX_MCDI_PORT_H + +#include "net_driver.h" + +u32 efx_mcdi_phy_get_caps(struct efx_nic *efx); +bool efx_mcdi_mac_check_fault(struct efx_nic *efx); +int efx_mcdi_port_probe(struct efx_nic *efx); +void efx_mcdi_port_remove(struct efx_nic *efx); + +#endif /* EFX_MCDI_PORT_H */ diff --git a/drivers/net/ethernet/sfc/siena.c b/drivers/net/ethernet/sfc/siena.c index 6462bbe2448a..ffe193f03352 100644 --- a/drivers/net/ethernet/sfc/siena.c +++ b/drivers/net/ethernet/sfc/siena.c @@ -21,6 +21,7 @@ #include "workarounds.h" #include "mcdi.h" #include "mcdi_pcol.h" +#include "mcdi_port.h" #include "mcdi_port_common.h" #include "selftest.h" #include "siena_sriov.h" From patchwork Tue Jun 30 12:03:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Cree X-Patchwork-Id: 216803 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A38C2C433DF for ; Tue, 30 Jun 2020 12:03:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80D1020702 for ; Tue, 30 Jun 2020 12:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733304AbgF3MDc (ORCPT ); Tue, 30 Jun 2020 08:03:32 -0400 Received: from dispatch1-us1.ppe-hosted.com ([148.163.129.52]:45124 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729647AbgF3MDc (ORCPT ); Tue, 30 Jun 2020 08:03:32 -0400 Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.61]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 6A1F46006F; Tue, 30 Jun 2020 12:03:31 +0000 (UTC) Received: from us4-mdac16-62.ut7.mdlocal (unknown [10.7.66.61]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 68860800A4; Tue, 30 Jun 2020 12:03:31 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.66.37]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 086BF8005B; Tue, 30 Jun 2020 12:03:31 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id A242FB40060; Tue, 30 Jun 2020 12:03:30 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 13:03:25 +0100 From: Edward Cree Subject: [PATCH net-next 03/14] sfc: add missing licence info to mcdi_filters.c To: , CC: References: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Message-ID: Date: Tue, 30 Jun 2020 13:03:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25512.003 X-TM-AS-Result: No-7.718200-8.000000-10 X-TMASE-MatchedRID: QvGus8ISmXNsr21evzoLzeQoIU4rAATMeouvej40T4gd0WOKRkwsh3lo OvA4aBJJrdoLblq9S5oZhhkmdi0+GYH/9PEJqVb6yZHnIMmQ+Dh5ybkwtj/jvu+uPZ9E4AOJhGG v93k4VVJksaYFr1elzgTM3L6p7JLEoYAeIqRSPipNo8Hgr5FnYX0tCKdnhB58vqq8s2MNhPCZMP CnTMzfOiq2rl3dzGQ1cYLo134C0x0/sxWzYog+LQQ74tCT6bqDMK2U2Tn3MQov7aSy4fORGA== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--7.718200-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25512.003 X-MDID: 1593518611-b9FUEDmTig06 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Both the licence notice and the SPDX tag were missing from this file. Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/mcdi_filters.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/sfc/mcdi_filters.c b/drivers/net/ethernet/sfc/mcdi_filters.c index 7b39a3aa3a1a..74ee06fe0996 100644 --- a/drivers/net/ethernet/sfc/mcdi_filters.c +++ b/drivers/net/ethernet/sfc/mcdi_filters.c @@ -1,3 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0-only +/**************************************************************************** + * Driver for Solarflare network controllers and boards + * Copyright 2005-2018 Solarflare Communications Inc. + * Copyright 2019-2020 Xilinx Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation, incorporated herein by reference. + */ + #include "mcdi_filters.h" #include "mcdi.h" #include "nic.h" From patchwork Tue Jun 30 12:11:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Cree X-Patchwork-Id: 216802 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B059C433E0 for ; Tue, 30 Jun 2020 12:11:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DF0820774 for ; Tue, 30 Jun 2020 12:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387453AbgF3MLq (ORCPT ); Tue, 30 Jun 2020 08:11:46 -0400 Received: from dispatch1-us1.ppe-hosted.com ([67.231.154.164]:52552 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387448AbgF3MLp (ORCPT ); Tue, 30 Jun 2020 08:11:45 -0400 Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.150]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 26969200B5; Tue, 30 Jun 2020 12:11:44 +0000 (UTC) Received: from us4-mdac16-52.at1.mdlocal (unknown [10.110.48.101]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 1C9D4800A3; Tue, 30 Jun 2020 12:11:44 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.49.30]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id AB2EA10004F; Tue, 30 Jun 2020 12:11:43 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 70099140087; Tue, 30 Jun 2020 12:11:43 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 13:11:39 +0100 From: Edward Cree Subject: [PATCH net-next 05/14] sfc: commonise some MAC configuration code To: , CC: References: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Message-ID: <34c4ed3c-8e71-8eb6-fe9f-9f1ed6099e73@solarflare.com> Date: Tue, 30 Jun 2020 13:11:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25512.003 X-TM-AS-Result: No-2.593100-8.000000-10 X-TMASE-MatchedRID: PCFkxA7eE67CpGfpWZNAso9BVqQOQlT5eouvej40T4gd0WOKRkwsh1ym Rv3NQjsEfGzuoVn0Vs6PQi9XuOWoOHI/MxNRI7UkCWlWR223da4w6FEHkL/wj66vUcPaplaYtLM efGorMlXHE4B47ECvKx5pG1lPrPh872C1bZnMeokHwuCWPSIIAKLwP+jjbL9Kx6C6dcifNxjgcJ c1hBF7dqfUF50ckaWqkZOl7WKIImrvXOvQVlExsDXJPZYaymc4xEHRux+uk8hxKpvEGAbTDlbPN gTs5YtKoxoIf9fi1inST5uaTCzfjT54V4TOatpPfXonvbik6q3hNctnRRPCkexHQTnv6/Tfmffk ZST0kK8gMKS8hKuNuBoQVhcDKUH1JRIzmbBpwaQgJCm6ypGLZ4kFmqDGAwWm X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--2.593100-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25512.003 X-MDID: 1593519104-7-VMV001CBYU Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Refactor it a little as we go, and introduce efx_mcdi_set_mtu() which we will later use for ef100 to change MTU without touching other MAC settings. Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/mcdi_port.c | 13 -------- drivers/net/ethernet/sfc/mcdi_port_common.c | 36 +++++++++++++++++++-- drivers/net/ethernet/sfc/mcdi_port_common.h | 1 + 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/sfc/mcdi_port.c b/drivers/net/ethernet/sfc/mcdi_port.c index 133f8b8ec3b3..98eeb404f68d 100644 --- a/drivers/net/ethernet/sfc/mcdi_port.c +++ b/drivers/net/ethernet/sfc/mcdi_port.c @@ -176,19 +176,6 @@ static int efx_mcdi_phy_probe(struct efx_nic *efx) return rc; } -int efx_mcdi_port_reconfigure(struct efx_nic *efx) -{ - struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; - u32 caps = (efx->link_advertising[0] ? - ethtool_linkset_to_mcdi_cap(efx->link_advertising) : - phy_cfg->forced_cap); - - caps |= ethtool_fec_caps_to_mcdi(efx->fec_config); - - return efx_mcdi_set_link(efx, caps, efx_get_mcdi_phy_flags(efx), - efx->loopback_mode, 0); -} - static void efx_mcdi_phy_remove(struct efx_nic *efx) { struct efx_mcdi_phy_data *phy_data = efx->phy_data; diff --git a/drivers/net/ethernet/sfc/mcdi_port_common.c b/drivers/net/ethernet/sfc/mcdi_port_common.c index e0608d0d961b..56af8b54a864 100644 --- a/drivers/net/ethernet/sfc/mcdi_port_common.c +++ b/drivers/net/ethernet/sfc/mcdi_port_common.c @@ -476,6 +476,24 @@ int efx_mcdi_phy_test_alive(struct efx_nic *efx) return 0; } +int efx_mcdi_port_reconfigure(struct efx_nic *efx) +{ + struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; + u32 caps = (efx->link_advertising[0] ? + ethtool_linkset_to_mcdi_cap(efx->link_advertising) : + phy_cfg->forced_cap); + + caps |= ethtool_fec_caps_to_mcdi(efx->fec_config); + + return efx_mcdi_set_link(efx, caps, efx_get_mcdi_phy_flags(efx), + efx->loopback_mode, 0); +} + +static unsigned int efx_calc_mac_mtu(struct efx_nic *efx) +{ + return EFX_MAX_FRAME_LEN(efx->net_dev->mtu); +} + int efx_mcdi_set_mac(struct efx_nic *efx) { u32 fcntl; @@ -487,8 +505,7 @@ int efx_mcdi_set_mac(struct efx_nic *efx) ether_addr_copy(MCDI_PTR(cmdbytes, SET_MAC_IN_ADDR), efx->net_dev->dev_addr); - MCDI_SET_DWORD(cmdbytes, SET_MAC_IN_MTU, - EFX_MAX_FRAME_LEN(efx->net_dev->mtu)); + MCDI_SET_DWORD(cmdbytes, SET_MAC_IN_MTU, efx_calc_mac_mtu(efx)); MCDI_SET_DWORD(cmdbytes, SET_MAC_IN_DRAIN, 0); /* Set simple MAC filter for Siena */ @@ -521,6 +538,21 @@ int efx_mcdi_set_mac(struct efx_nic *efx) NULL, 0, NULL); } +int efx_mcdi_set_mtu(struct efx_nic *efx) +{ + MCDI_DECLARE_BUF(inbuf, MC_CMD_SET_MAC_EXT_IN_LEN); + + BUILD_BUG_ON(MC_CMD_SET_MAC_OUT_LEN != 0); + + MCDI_SET_DWORD(inbuf, SET_MAC_EXT_IN_MTU, efx_calc_mac_mtu(efx)); + + MCDI_POPULATE_DWORD_1(inbuf, SET_MAC_EXT_IN_CONTROL, + SET_MAC_EXT_IN_CFG_MTU, 1); + + return efx_mcdi_rpc(efx, MC_CMD_SET_MAC, inbuf, sizeof(inbuf), + NULL, 0, NULL); +} + enum efx_stats_action { EFX_STATS_ENABLE, EFX_STATS_DISABLE, diff --git a/drivers/net/ethernet/sfc/mcdi_port_common.h b/drivers/net/ethernet/sfc/mcdi_port_common.h index 54c0acf8e243..f6f81cbeb07e 100644 --- a/drivers/net/ethernet/sfc/mcdi_port_common.h +++ b/drivers/net/ethernet/sfc/mcdi_port_common.h @@ -51,6 +51,7 @@ int efx_mcdi_phy_get_fecparam(struct efx_nic *efx, struct ethtool_fecparam *fec); int efx_mcdi_phy_test_alive(struct efx_nic *efx); int efx_mcdi_set_mac(struct efx_nic *efx); +int efx_mcdi_set_mtu(struct efx_nic *efx); int efx_mcdi_mac_init_stats(struct efx_nic *efx); void efx_mcdi_mac_fini_stats(struct efx_nic *efx); int efx_mcdi_port_get_number(struct efx_nic *efx); From patchwork Tue Jun 30 12:12:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Cree X-Patchwork-Id: 216801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A86C5C433E0 for ; Tue, 30 Jun 2020 12:12:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BF072073E for ; Tue, 30 Jun 2020 12:12:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387491AbgF3MM2 (ORCPT ); Tue, 30 Jun 2020 08:12:28 -0400 Received: from dispatch1-us1.ppe-hosted.com ([67.231.154.164]:56870 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387472AbgF3MM1 (ORCPT ); Tue, 30 Jun 2020 08:12:27 -0400 Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.137]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id D2F07200AC; Tue, 30 Jun 2020 12:12:25 +0000 (UTC) Received: from us4-mdac16-50.at1.mdlocal (unknown [10.110.50.133]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id D10136009B; Tue, 30 Jun 2020 12:12:25 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.49.32]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 705DD220078; Tue, 30 Jun 2020 12:12:25 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 35DF228007B; Tue, 30 Jun 2020 12:12:25 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 13:12:20 +0100 From: Edward Cree Subject: [PATCH net-next 07/14] sfc: commonise TSO fallback code To: , CC: References: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Message-ID: <2a94b533-79de-646a-8038-5d2ddd22816d@solarflare.com> Date: Tue, 30 Jun 2020 13:12:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25512.003 X-TM-AS-Result: No-6.922600-8.000000-10 X-TMASE-MatchedRID: qQUFOL0tEEFJhDcRXZUUxqiUivh0j2Pv6VTG9cZxEjJwGpdgNQ0JrHIo zGa69omdrdoLblq9S5ra/g/NGTW3MjmzjEr3tKb/k3rl+MaNgxDUIkoTEP0J+UkrZ4mFjTbDS1J WS+txB/9gQfB04A8o2U+A1TkNxPExROB90vNXRhrykdOisNw8yrfHCp+e+coekaEC8FJraL9vAl nua0Nm7c5dU83Z+Lu0kZOl7WKIImrvXOvQVlExsAtuKBGekqUpI/NGWt0UYPAUCKGKnUyAIpvk2 F+OwpbyhfORTzTn8nVRMZmpY155jmioXxLS6UzT X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--6.922600-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25512.003 X-MDID: 1593519145-7q7DNRRhQIVu Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org ef100 will need this if it gets GSO skbs it can't handle (e.g. too long header length). Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/tx.c | 28 ---------------------------- drivers/net/ethernet/sfc/tx_common.c | 27 +++++++++++++++++++++++++++ drivers/net/ethernet/sfc/tx_common.h | 2 +- 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c index 19b58563cb78..ed20f6aef435 100644 --- a/drivers/net/ethernet/sfc/tx.c +++ b/drivers/net/ethernet/sfc/tx.c @@ -268,34 +268,6 @@ static int efx_enqueue_skb_pio(struct efx_tx_queue *tx_queue, } #endif /* EFX_USE_PIO */ -/* - * Fallback to software TSO. - * - * This is used if we are unable to send a GSO packet through hardware TSO. - * This should only ever happen due to per-queue restrictions - unsupported - * packets should first be filtered by the feature flags. - * - * Returns 0 on success, error code otherwise. - */ -static int efx_tx_tso_fallback(struct efx_tx_queue *tx_queue, - struct sk_buff *skb) -{ - struct sk_buff *segments, *next; - - segments = skb_gso_segment(skb, 0); - if (IS_ERR(segments)) - return PTR_ERR(segments); - - dev_consume_skb_any(skb); - - skb_list_walk_safe(segments, skb, next) { - skb_mark_not_on_list(skb); - efx_enqueue_skb(tx_queue, skb); - } - - return 0; -} - /* * Add a socket buffer to a TX queue * diff --git a/drivers/net/ethernet/sfc/tx_common.c b/drivers/net/ethernet/sfc/tx_common.c index 70876df1da69..9a005e7c2c68 100644 --- a/drivers/net/ethernet/sfc/tx_common.c +++ b/drivers/net/ethernet/sfc/tx_common.c @@ -405,3 +405,30 @@ unsigned int efx_tx_max_skb_descs(struct efx_nic *efx) return max_descs; } + +/* + * Fallback to software TSO. + * + * This is used if we are unable to send a GSO packet through hardware TSO. + * This should only ever happen due to per-queue restrictions - unsupported + * packets should first be filtered by the feature flags. + * + * Returns 0 on success, error code otherwise. + */ +int efx_tx_tso_fallback(struct efx_tx_queue *tx_queue, struct sk_buff *skb) +{ + struct sk_buff *segments, *next; + + segments = skb_gso_segment(skb, 0); + if (IS_ERR(segments)) + return PTR_ERR(segments); + + dev_consume_skb_any(skb); + + skb_list_walk_safe(segments, skb, next) { + skb_mark_not_on_list(skb); + efx_enqueue_skb(tx_queue, skb); + } + + return 0; +} diff --git a/drivers/net/ethernet/sfc/tx_common.h b/drivers/net/ethernet/sfc/tx_common.h index 99cf7ce2f36c..82e2e291317d 100644 --- a/drivers/net/ethernet/sfc/tx_common.h +++ b/drivers/net/ethernet/sfc/tx_common.h @@ -38,5 +38,5 @@ int efx_tx_map_data(struct efx_tx_queue *tx_queue, struct sk_buff *skb, unsigned int segment_count); unsigned int efx_tx_max_skb_descs(struct efx_nic *efx); - +int efx_tx_tso_fallback(struct efx_tx_queue *tx_queue, struct sk_buff *skb); #endif From patchwork Tue Jun 30 12:13:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Cree X-Patchwork-Id: 216800 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9844C433E0 for ; Tue, 30 Jun 2020 12:13:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D7C32073E for ; Tue, 30 Jun 2020 12:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387514AbgF3MN0 (ORCPT ); Tue, 30 Jun 2020 08:13:26 -0400 Received: from dispatch1-us1.ppe-hosted.com ([67.231.154.164]:33488 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387509AbgF3MNZ (ORCPT ); Tue, 30 Jun 2020 08:13:25 -0400 Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.150]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id E78B820081; Tue, 30 Jun 2020 12:13:24 +0000 (UTC) Received: from us4-mdac16-74.at1.mdlocal (unknown [10.110.50.192]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id E4C0B800A3; Tue, 30 Jun 2020 12:13:24 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.49.108]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 8B03B100076; Tue, 30 Jun 2020 12:13:24 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 543A4140055; Tue, 30 Jun 2020 12:13:24 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 13:13:19 +0100 From: Edward Cree Subject: [PATCH net-next 09/14] sfc: factor out efx_tx_tso_header_length() and understand encapsulation To: , CC: References: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Message-ID: Date: Tue, 30 Jun 2020 13:13:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25512.003 X-TM-AS-Result: No-8.029800-8.000000-10 X-TMASE-MatchedRID: llTo18AJfvGXC3sMAGu+n6iUivh0j2Pv6VTG9cZxEjJwGpdgNQ0JrHIo zGa69omdrdoLblq9S5rB034o9aD3zF09rZAYZpfOkr0W/BDHWEVfAXPuWnqbj7lmMfLNiukavIf NMqvY8HmjkoEn/gUJLYpv+QMT5WBbSODTO7sFJpYuOya45qyEYn0tCKdnhB58vqq8s2MNhPAir3 kOMJmHTHYJEUfDojP/33fj+sMArfNSleqDFXU3qVu5RcffncpltOPVz3csprQ3pLcnMlHWhctgD gNJ6UqhoVfkLFAzcgJ+3BndfXUhXQ== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--8.029800-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25512.003 X-MDID: 1593519205-6MMMTCKC_ThT Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org ef100 will need to check this against NIC limits. Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/tx_common.c | 17 +++++++++++++++-- drivers/net/ethernet/sfc/tx_common.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sfc/tx_common.c b/drivers/net/ethernet/sfc/tx_common.c index 6ac19daa891a..2a058b76d1f0 100644 --- a/drivers/net/ethernet/sfc/tx_common.c +++ b/drivers/net/ethernet/sfc/tx_common.c @@ -311,6 +311,20 @@ struct efx_tx_buffer *efx_tx_map_chunk(struct efx_tx_queue *tx_queue, return buffer; } +int efx_tx_tso_header_length(struct sk_buff *skb) +{ + size_t header_len; + + if (skb->encapsulation) + header_len = skb_inner_transport_header(skb) - + skb->data + + (inner_tcp_hdr(skb)->doff << 2u); + else + header_len = skb_transport_header(skb) - skb->data + + (tcp_hdr(skb)->doff << 2u); + return header_len; +} + /* Map all data from an SKB for DMA and create descriptors on the queue. */ int efx_tx_map_data(struct efx_tx_queue *tx_queue, struct sk_buff *skb, unsigned int segment_count) @@ -339,8 +353,7 @@ int efx_tx_map_data(struct efx_tx_queue *tx_queue, struct sk_buff *skb, /* For TSO we need to put the header in to a separate * descriptor. Map this separately if necessary. */ - size_t header_len = skb_transport_header(skb) - skb->data + - (tcp_hdr(skb)->doff << 2u); + size_t header_len = efx_tx_tso_header_length(skb); if (header_len != len) { tx_queue->tso_long_headers++; diff --git a/drivers/net/ethernet/sfc/tx_common.h b/drivers/net/ethernet/sfc/tx_common.h index 82e2e291317d..cbe995b024a6 100644 --- a/drivers/net/ethernet/sfc/tx_common.h +++ b/drivers/net/ethernet/sfc/tx_common.h @@ -34,6 +34,7 @@ void efx_enqueue_unwind(struct efx_tx_queue *tx_queue, struct efx_tx_buffer *efx_tx_map_chunk(struct efx_tx_queue *tx_queue, dma_addr_t dma_addr, size_t len); +int efx_tx_tso_header_length(struct sk_buff *skb); int efx_tx_map_data(struct efx_tx_queue *tx_queue, struct sk_buff *skb, unsigned int segment_count); From patchwork Tue Jun 30 12:14:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Cree X-Patchwork-Id: 216799 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0C74C433E0 for ; Tue, 30 Jun 2020 12:14:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9F3E2073E for ; Tue, 30 Jun 2020 12:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387536AbgF3MOY (ORCPT ); Tue, 30 Jun 2020 08:14:24 -0400 Received: from dispatch1-us1.ppe-hosted.com ([67.231.154.164]:57170 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732036AbgF3MOX (ORCPT ); Tue, 30 Jun 2020 08:14:23 -0400 Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.137]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 2641320099; Tue, 30 Jun 2020 12:14:22 +0000 (UTC) Received: from us4-mdac16-8.at1.mdlocal (unknown [10.110.49.190]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 246306009B; Tue, 30 Jun 2020 12:14:22 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.49.6]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 88AFB220072; Tue, 30 Jun 2020 12:14:21 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 4FBB3B00073; Tue, 30 Jun 2020 12:14:21 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 13:14:16 +0100 From: Edward Cree Subject: [PATCH net-next 11/14] sfc: initialise max_[tx_]channels in efx_init_channels() To: , CC: References: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Message-ID: Date: Tue, 30 Jun 2020 13:14:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25512.003 X-TM-AS-Result: No-0.080800-8.000000-10 X-TMASE-MatchedRID: W4G0h3GCi0mh9oPbMj7PPPCoOvLLtsMhqnabhLgnhmgHZBaLwEXlKIpb wG9fIuITKtCISd3FwWPiBiWevqr/K01+zyfzlN7ygxsfzkNRlfJIWseC5HlebfoLR4+zsDTtjoc zmuoPCq2/hDV1Ro5VjYzhTWNdiCGtjigZi9VFYyB8D7zXRcjU4tOW6P+GCI8NQymOaJ0F/dZPlr UHVdLgcK3gpxfal3zW9vyLK0+GYKoXxY6mau8LG3IJh4dBcU42f4hpTpoBF9JqxGCSzFD9MrDMW vXXz1lrlExlQIQeRG0= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--0.080800-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25512.003 X-MDID: 1593519262-a3P04ZB388fP Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/efx_channels.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/sfc/efx_channels.c b/drivers/net/ethernet/sfc/efx_channels.c index 2c3510b0524a..2f9db219513a 100644 --- a/drivers/net/ethernet/sfc/efx_channels.c +++ b/drivers/net/ethernet/sfc/efx_channels.c @@ -566,6 +566,9 @@ int efx_init_channels(struct efx_nic *efx) efx->interrupt_mode = min(efx->type->min_interrupt_mode, interrupt_mode); + efx->max_channels = EFX_MAX_CHANNELS; + efx->max_tx_channels = EFX_MAX_CHANNELS; + return 0; } From patchwork Tue Jun 30 12:15:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Cree X-Patchwork-Id: 216798 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 571CEC433DF for ; Tue, 30 Jun 2020 12:15:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37A8A2073E for ; Tue, 30 Jun 2020 12:15:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387573AbgF3MPW (ORCPT ); Tue, 30 Jun 2020 08:15:22 -0400 Received: from dispatch1-us1.ppe-hosted.com ([67.231.154.164]:43540 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387554AbgF3MPT (ORCPT ); Tue, 30 Jun 2020 08:15:19 -0400 Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.143]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 0DCD620052; Tue, 30 Jun 2020 12:15:19 +0000 (UTC) Received: from us4-mdac16-1.at1.mdlocal (unknown [10.110.49.147]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 0F2C58009B; Tue, 30 Jun 2020 12:15:19 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.49.109]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 93BA340058; Tue, 30 Jun 2020 12:15:18 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 5ADDDB40063; Tue, 30 Jun 2020 12:15:18 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 13:15:13 +0100 From: Edward Cree Subject: [PATCH net-next 13/14] sfc: commonise initialisation of efx->vport_id To: , CC: References: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Message-ID: <12334d73-7797-c638-7602-aaa66917d569@solarflare.com> Date: Tue, 30 Jun 2020 13:15:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <14a93b71-3d4e-4663-82be-a2281cd1105e@solarflare.com> Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25512.003 X-TM-AS-Result: No-7.507600-8.000000-10 X-TMASE-MatchedRID: BwBVF9uPMIrjtwtQtmXE5bsHVDDM5xAP1JP9NndNOkUGmHr1eMxt2UAc 6DyoS2rIj6kCfX0Edc4mQHxxqFX9+R1pRstOIPc+52cbj4/WmPtC61vu00HIv7ytS1u1Z7z6QDo v87hVw1IbRhC5hIy4iEOkSEpTIJCMjJBSOECLn6o3KH0bqm8JUjGk13qHn7yc0SxMhOhuA0S7im J4LbFoqcrqJH3Kw4BAXx8nA3I3SFQEL+qFx24Qup4CIKY/Hg3AtOt1ofVlaoLWRN8STJpl3PoLR 4+zsDTtqFhHt/jREamAYNL5iXeLvCIm2a0d56FIW5Qw786owOiIR1hxvHZVXFZca9RSYo/b X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--7.507600-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25512.003 X-MDID: 1593519319-DJ40tDCK4KRi Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/ef10.c | 2 -- drivers/net/ethernet/sfc/efx_common.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index a3bf9d8023d7..5faf2f0e4d62 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c @@ -554,8 +554,6 @@ static int efx_ef10_probe(struct efx_nic *efx) efx->rss_context.context_id = EFX_MCDI_RSS_CONTEXT_INVALID; - efx->vport_id = EVB_PORT_ID_ASSIGNED; - /* In case we're recovering from a crash (kexec), we want to * cancel any outstanding request by the previous user of this * function. We send a special message using the least diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c index 822e9e147404..a2f744377aaa 100644 --- a/drivers/net/ethernet/sfc/efx_common.c +++ b/drivers/net/ethernet/sfc/efx_common.c @@ -1018,6 +1018,7 @@ int efx_init_struct(struct efx_nic *efx, efx->type->rx_ts_offset - efx->type->rx_prefix_size; INIT_LIST_HEAD(&efx->rss_context.list); mutex_init(&efx->rss_lock); + efx->vport_id = EVB_PORT_ID_ASSIGNED; spin_lock_init(&efx->stats_lock); efx->vi_stride = EFX_DEFAULT_VI_STRIDE; efx->num_mac_stats = MC_CMD_MAC_NSTATS;