From patchwork Sat Sep 26 19:32:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 260116 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 751EAC2D0A8 for ; Sat, 26 Sep 2020 19:33:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 39AFC21D7F for ; Sat, 26 Sep 2020 19:33:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="io+rlo3P" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730199AbgIZTdH (ORCPT ); Sat, 26 Sep 2020 15:33:07 -0400 Received: from mail-eopbgr130053.outbound.protection.outlook.com ([40.107.13.53]:17545 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730191AbgIZTdH (ORCPT ); Sat, 26 Sep 2020 15:33:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UbI3y4QIVZTbs5rWCy+YzxJRY0CetLHDJfaKdLP+Gk6nmrpwF9AFfdQghQv7WqW0hCJW1Y1uppLmylLcPrwxwiMvi9DoPT4SsuLRr4CVlREecGt4x5P7IbYENDribFBbnHgkbSKeNf5aeMTDUj7JRuOyxoK9+A68NNcF35cUub7gEbmPSbF1C0ko/Gex9UEMd0hpipN1sxU6NHC4qvKqbiYlSF4dW8AdtrsPPQ/lYip/STufklvxw6MoEFBEb1lCqSljTuUAjzMY0RzAhUizohd+3lqdlcj6/Io9nDYmJAWQvHUnqK7ma9xpUx0/Yqwm9Jc0SNgzIcr5rENgjqZHzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KvFmdyeWZwcpBJZWaUnVkddJr3JiUvbc3DYc0Ilu81E=; b=dLnq6VLUq+/ayvQcn0jcAlK4KmgEcPbslBREjQHiTahyy9xKkGyQ71Kbrlkyw//U5d4QZqv9A4v+sWtQQ2aB9Lq5tdm3f6vIQu9RFf+aPLdHvBFZc1wzx+87kdFIhbfno4IjPn+SrcgAcWlvOQDazybIrzafH5K81ARd5N8Dkhoezt9qwiWVgKEz2bzgIAEbHSyhjKYOFdsZnD8Ati1BrYx3HuyOBXbAthUw/E+tqYPg7iZsPm7cqJV+1aOy31j9LM5ypELeFMXiu3383RtUDT/UXy9n546muMmZhRCg1MGEetF+chBbBIgXQUsGZ/p8OKDcZNvX+ZLMCsQk3VaIYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KvFmdyeWZwcpBJZWaUnVkddJr3JiUvbc3DYc0Ilu81E=; b=io+rlo3PR4HJ0/UVUp8OpgnEAGP58w2qctTvqv3ONrQfYBw1zojbXBAfGmj11cyQ489LuEFh6VY7wBagg7sUyaIA3bO6JdQH3RBvZQG6EokUbEuDM95jFDItYjHwYO7vYY1QmW7gitEXqkLBS5aCZtyBurLebHdvE6bcWAntk9U= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR04MB5295.eurprd04.prod.outlook.com (2603:10a6:803:59::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Sat, 26 Sep 2020 19:32:59 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3412.024; Sat, 26 Sep 2020 19:32:59 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org, davem@davemloft.net Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Horatiu Vultur , Alexandre Belloni , UNGLinuxDriver Subject: [PATCH v3 net-next 01/15] net: mscc: ocelot: move NPI port configuration to DSA Date: Sat, 26 Sep 2020 22:32:01 +0300 Message-Id: <20200926193215.1405730-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200926193215.1405730-1-vladimir.oltean@nxp.com> References: <20200926193215.1405730-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.217.212) by AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21 via Frontend Transport; Sat, 26 Sep 2020 19:32:58 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [188.25.217.212] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 47d5abc4-b921-4010-8a08-08d86252f9cd X-MS-TrafficTypeDiagnostic: VI1PR04MB5295: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +EIB9XZdyNcEPd/ZZ9dsp7yBUFdcQFU/VZ3N1RAmjGbu/GrAM8lfYUjI5eD6WQD33SQWWqloICZoWYEhXPWlBs2CoJhEMCalqUBat9O/veVKzYVVopi7FbHqpDGP/aAqjHrbFt/z5FGfgg3vMNlECdHdOviDT8JHsgKrH0Uj4pkjjTo4y7mqm30+GKlwRJr2fkYhwv9l3VLW+vOTmRX3IWjyz08e+P7ZUilGNN0JgdwqN2F8vOq3lSjlGy4OxLCTfBf8p7/Lx0NXiHR1GymaIDBhUwkXVx5WjupBtNLRxLrPp0K5Qgd83vfi/9h+vGfszM0P/24bh1XyUL4FY03Y3K/h9dMdsYBbm0MFYGcH1ZBEl4gumZVd1SqdHxNJfhLqqpVaJCMNCLz5UoKseYhcFqhu8nSXLF3eAIOJsb0jpx1NG7qUKF0ij9/iPHnDaTGE X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(366004)(376002)(346002)(136003)(66476007)(6486002)(52116002)(66556008)(2616005)(956004)(8676002)(44832011)(6512007)(26005)(2906002)(478600001)(16526019)(186003)(6506007)(36756003)(86362001)(8936002)(1076003)(83380400001)(54906003)(4326008)(69590400008)(66946007)(6666004)(316002)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 2R6FfGbmf2XNybt4MXuaGX8bVPzqjYsiIkkLMYrwdtiHBI/w6ZTzzJf2pDcMSvxhyUmAZjZi9SPRFs2JUl8Z9ZS8dq4n4UIV1tofZqnk8M8b2aSgGfwDOfUfU9CH/ERBTL/fddOLSetXmd3FSJwbpA6M3/tAkaH6BFufo8n0QnuQ/2jsiefX+Ta37dyV2xgdxoOYCN4oHAhYIKKd2yQudtWgSAICw9BbZ7DD4433oGMol6zXLrGDl6hqEuzxzmSq37J60ReqB7J1jm9cJ9dIHW69F8yCHLy33extsQIh/X3DhQnOq3poB51u/Fqtne3nlnEI68/TPdv/y09l/elUqvaXzenPzBxNyypNbHvdqm2MxOc+pyNoG/F5TY61ouiESO4UsScIX2iJ2S2AnMmic5boEsWg2/hbk617b9EZkLgyqmNyoyLr1OMSIV4xkfCgEJyJzCnIuE3adimLg/NESma4dBaw6dlYwfkqLgaBOrL+Qo4j1vt1s2vWK4JAunVPQqMa38eZwcJr9T1xf+lp1kDcdONNMDPwpfu4XRdLep+MvQy2SGf2SRVjGBBUNcdcSExA4csLvkRX6yOZLSoMCfNYmoU8UWEBQNOYTOS+nnkXokJeeOxg5YBsm98HmuTBPF42JQ3NnajSMReSOz7Raw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47d5abc4-b921-4010-8a08-08d86252f9cd X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2020 19:32:59.2801 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: svXAGO8GuCjIap1WkDgD1UNmmdg9lQYngdSAtvENxFZo35ITfzBPMuk4FdDMdGPqEPGWCKd2j+saZ6HoJVw15A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5295 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Remove the ocelot_configure_cpu() function, which was in fact bringing up 2 ports: the CPU port module, which both switchdev and DSA have, and the NPI port, which only DSA has. The (non-Ethernet) CPU port module is at a fixed index in the analyzer, whereas the NPI port is selected through the "ethernet" property in the device tree. Therefore, the function to set up an NPI port is DSA-specific, so we move it there, simplifying the ocelot switch library a little bit. Cc: Horatiu Vultur Cc: Alexandre Belloni Cc: UNGLinuxDriver Signed-off-by: Vladimir Oltean --- Changes in v3: Actually copied the people from cc to the patch. drivers/net/dsa/ocelot/felix.c | 29 +++++++++++++--- drivers/net/ethernet/mscc/ocelot.c | 40 ++++------------------ drivers/net/ethernet/mscc/ocelot_vsc7514.c | 7 ++-- include/soc/mscc/ocelot.h | 3 -- 4 files changed, 35 insertions(+), 44 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index a56fc50f5be4..b8e192374a32 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -439,6 +439,8 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports) ocelot->vcap_is2_actions= felix->info->vcap_is2_actions; ocelot->vcap = felix->info->vcap; ocelot->ops = felix->info->ops; + ocelot->inj_prefix = OCELOT_TAG_PREFIX_NONE; + ocelot->xtr_prefix = OCELOT_TAG_PREFIX_LONG; port_phy_modes = kcalloc(num_phys_ports, sizeof(phy_interface_t), GFP_KERNEL); @@ -538,6 +540,28 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports) return 0; } +/* The CPU port module is connected to the Node Processor Interface (NPI). This + * is the mode through which frames can be injected from and extracted to an + * external CPU, over Ethernet. + */ +static void felix_npi_port_init(struct ocelot *ocelot, int port) +{ + ocelot->npi = port; + + ocelot_write(ocelot, QSYS_EXT_CPU_CFG_EXT_CPUQ_MSK_M | + QSYS_EXT_CPU_CFG_EXT_CPU_PORT(port), + QSYS_EXT_CPU_CFG); + + /* NPI port Injection/Extraction configuration */ + ocelot_fields_write(ocelot, port, SYS_PORT_MODE_INCL_XTR_HDR, + ocelot->xtr_prefix); + ocelot_fields_write(ocelot, port, SYS_PORT_MODE_INCL_INJ_HDR, + ocelot->inj_prefix); + + /* Disable transmission of pause frames */ + ocelot_fields_write(ocelot, port, SYS_PAUSE_CFG_PAUSE_ENA, 0); +} + /* Hardware initialization done here so that we can allocate structures with * devm without fear of dsa_register_switch returning -EPROBE_DEFER and causing * us to allocate structures twice (leak memory) and map PCI memory twice @@ -570,11 +594,8 @@ static int felix_setup(struct dsa_switch *ds) for (port = 0; port < ds->num_ports; port++) { ocelot_init_port(ocelot, port); - /* Bring up the CPU port module and configure the NPI port */ if (dsa_is_cpu_port(ds, port)) - ocelot_configure_cpu(ocelot, port, - OCELOT_TAG_PREFIX_NONE, - OCELOT_TAG_PREFIX_LONG); + felix_npi_port_init(ocelot, port); /* Set the default QoS Classification based on PCP and DEI * bits of vlan tag. diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index 0445c5ee5551..b9375d96cdbc 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -1346,22 +1346,14 @@ void ocelot_init_port(struct ocelot *ocelot, int port) } EXPORT_SYMBOL(ocelot_init_port); -/* Configure and enable the CPU port module, which is a set of queues. - * If @npi contains a valid port index, the CPU port module is connected - * to the Node Processor Interface (NPI). This is the mode through which - * frames can be injected from and extracted to an external CPU, - * over Ethernet. +/* Configure and enable the CPU port module, which is a set of queues + * accessible through register MMIO, frame DMA or Ethernet (in case + * NPI mode is used). */ -void ocelot_configure_cpu(struct ocelot *ocelot, int npi, - enum ocelot_tag_prefix injection, - enum ocelot_tag_prefix extraction) +static void ocelot_cpu_port_init(struct ocelot *ocelot) { int cpu = ocelot->num_phys_ports; - ocelot->npi = npi; - ocelot->inj_prefix = injection; - ocelot->xtr_prefix = extraction; - /* The unicast destination PGID for the CPU port module is unused */ ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, cpu); /* Instead set up a multicast destination PGID for traffic copied to @@ -1373,31 +1365,13 @@ void ocelot_configure_cpu(struct ocelot *ocelot, int npi, ANA_PORT_PORT_CFG_PORTID_VAL(cpu), ANA_PORT_PORT_CFG, cpu); - if (npi >= 0 && npi < ocelot->num_phys_ports) { - ocelot_write(ocelot, QSYS_EXT_CPU_CFG_EXT_CPUQ_MSK_M | - QSYS_EXT_CPU_CFG_EXT_CPU_PORT(npi), - QSYS_EXT_CPU_CFG); - - /* Enable NPI port */ - ocelot_fields_write(ocelot, npi, - QSYS_SWITCH_PORT_MODE_PORT_ENA, 1); - /* NPI port Injection/Extraction configuration */ - ocelot_fields_write(ocelot, npi, SYS_PORT_MODE_INCL_XTR_HDR, - extraction); - ocelot_fields_write(ocelot, npi, SYS_PORT_MODE_INCL_INJ_HDR, - injection); - - /* Disable transmission of pause frames */ - ocelot_fields_write(ocelot, npi, SYS_PAUSE_CFG_PAUSE_ENA, 0); - } - /* Enable CPU port module */ ocelot_fields_write(ocelot, cpu, QSYS_SWITCH_PORT_MODE_PORT_ENA, 1); /* CPU port Injection/Extraction configuration */ ocelot_fields_write(ocelot, cpu, SYS_PORT_MODE_INCL_XTR_HDR, - extraction); + ocelot->xtr_prefix); ocelot_fields_write(ocelot, cpu, SYS_PORT_MODE_INCL_INJ_HDR, - injection); + ocelot->inj_prefix); /* Configure the CPU port to be VLAN aware */ ocelot_write_gix(ocelot, ANA_PORT_VLAN_CFG_VLAN_VID(0) | @@ -1405,7 +1379,6 @@ void ocelot_configure_cpu(struct ocelot *ocelot, int npi, ANA_PORT_VLAN_CFG_VLAN_POP_CNT(1), ANA_PORT_VLAN_CFG, cpu); } -EXPORT_SYMBOL(ocelot_configure_cpu); int ocelot_init(struct ocelot *ocelot) { @@ -1445,6 +1418,7 @@ int ocelot_init(struct ocelot *ocelot) ocelot_mact_init(ocelot); ocelot_vlan_init(ocelot); ocelot_vcap_init(ocelot); + ocelot_cpu_port_init(ocelot); for (port = 0; port < ocelot->num_phys_ports; port++) { /* Clear all counters (5 groups) */ diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index dfb1535f26f2..d7aef2fb9848 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -930,10 +930,6 @@ static int mscc_ocelot_init_ports(struct platform_device *pdev, if (!ocelot->ports) return -ENOMEM; - /* No NPI port */ - ocelot_configure_cpu(ocelot, -1, OCELOT_TAG_PREFIX_NONE, - OCELOT_TAG_PREFIX_NONE); - for_each_available_child_of_node(ports, portnp) { struct ocelot_port_private *priv; struct ocelot_port *ocelot_port; @@ -1120,6 +1116,9 @@ static int mscc_ocelot_probe(struct platform_device *pdev) ocelot->vcap_is2_keys = vsc7514_vcap_is2_keys; ocelot->vcap_is2_actions = vsc7514_vcap_is2_actions; ocelot->vcap = vsc7514_vcap_props; + ocelot->inj_prefix = OCELOT_TAG_PREFIX_NONE; + ocelot->xtr_prefix = OCELOT_TAG_PREFIX_NONE; + ocelot->npi = -1; err = ocelot_init(ocelot); if (err) diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index 3105bbb6cdcf..349e839c4c18 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -672,9 +672,6 @@ void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg, int ocelot_regfields_init(struct ocelot *ocelot, const struct reg_field *const regfields); struct regmap *ocelot_regmap_init(struct ocelot *ocelot, struct resource *res); -void ocelot_configure_cpu(struct ocelot *ocelot, int npi, - enum ocelot_tag_prefix injection, - enum ocelot_tag_prefix extraction); int ocelot_init(struct ocelot *ocelot); void ocelot_deinit(struct ocelot *ocelot); void ocelot_init_port(struct ocelot *ocelot, int port); From patchwork Sat Sep 26 19:32:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 260115 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 21FB5C2D0A8 for ; Sat, 26 Sep 2020 19:33:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B73F521531 for ; Sat, 26 Sep 2020 19:33:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="BBsxKsp5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730214AbgIZTdO (ORCPT ); Sat, 26 Sep 2020 15:33:14 -0400 Received: from mail-eopbgr130057.outbound.protection.outlook.com ([40.107.13.57]:60485 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730184AbgIZTdM (ORCPT ); Sat, 26 Sep 2020 15:33:12 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kvGQGlJ3jF/v3gxHP+LNGvvoiP3fQjdLxDTfj1RRd9WzCxCpfzGs0F27p+KHAKqJL8BApVD9l4eOrYqnQJ8Rl6y+1LEt9CsOq94FcCS8Hs7eFerDxuwmEin0liBzLpBTsgw8Fp0TZ0yL6Pj9PQSbezf5nGjo08jlAy3eqOD9hmaoqoVCS1huyyuCKp28zOeM+mKwWuUOHilnNWR9t/QYx4FRFH8GYAw2oIhE96CEi4L6P3gj8AL0Y/EQ+WQhKDhroYukacgv/VIrhHh7tQoneyp9XpkxdQnhYEH07aReuKY/+HOD2XKfN+O3fQ6E1Sci6GHLyRSDhOxrF/BxV0X/jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dtp8z1ZislxVZrBgOgqO/XBH86iahfxyQrq93zBH2zI=; b=g6FXBxK4kj1aoTNG9UJtZfw/5uopYI1zIYqiU0oODgP1CrUuQannbe4O85ozOCHT4PxwNLZDeFtL6VIzFQidlP6AU/7oo4P6etM9DYHf+BPCLUYh2p3KD6NmZVp2yQAWXojCeS+M4vP3e4icoASTkxn4SMJSCJTBKKU1A3KgPr2sBOqXieWzgJHOnWhq60z54FJ9S4FabmQZTNvw0sx+bBrf23UPSrLrBTXCaEb3Y/foTUk3fov/90ZKmoJ8GbiYdpKdmvd4BoWoDlP+dIYlxTGbn7KaYMBt0CJYk/r825Xes4xgdxkCRfTWiIeK9rt/xK1EM81LO/PYLb3+yJHihA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dtp8z1ZislxVZrBgOgqO/XBH86iahfxyQrq93zBH2zI=; b=BBsxKsp5bT2oR/5owMQCAYcwUYhwIvWE3hBMT11eMs9vIkUUOmQJzqH4X+jw4n6yIwFq+7cXEXHeVVYFqW6QD0wSfbwficYTGRc80+qxz4Bpu9jywZTlBZY7suF+CUeQBtpK1mA7jJVhzcn6XFXnrAwPv9svkXF6+v8v/SiQnR8= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR04MB5295.eurprd04.prod.outlook.com (2603:10a6:803:59::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Sat, 26 Sep 2020 19:33:01 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3412.024; Sat, 26 Sep 2020 19:33:01 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org, davem@davemloft.net Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org Subject: [PATCH v3 net-next 03/15] net: dsa: tag_sja1105: request promiscuous mode for master Date: Sat, 26 Sep 2020 22:32:03 +0300 Message-Id: <20200926193215.1405730-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200926193215.1405730-1-vladimir.oltean@nxp.com> References: <20200926193215.1405730-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.217.212) by AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21 via Frontend Transport; Sat, 26 Sep 2020 19:33:00 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [188.25.217.212] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4c4d5dc6-0d98-4d76-6d14-08d86252fafa X-MS-TrafficTypeDiagnostic: VI1PR04MB5295: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /UtNwnOtcnEzXi7Md+fllJRVtuohysW2Iz2WGYhES+oQbnCFxzVe9RQsxkaCP2oyAZzbhR/C/PbYuyLTYict8tn3VNXWhyUjxYfa1AHRUo75MDP3pvw3WIkm4PyDk8negWF8oN/eCa7Hps/SVf/bbPG7ZN8PN4LMLLgplkP3GoZLP5Zzq+RPK5ePtrn39LOaxVmDg8JeASC14IGc1DzJ3NmQTBmy3z5GcM8QYVHEx4iuQyNz99h0pgtgFz9yAbE4qSvKZH28L9APcck627Epq+wd2PcD/3NZaFbZEr4Cze2wRpY/Q8LBY+ZsrilIrUD6ZMR0Gyd1toCVS6XcIjCeqYpzGt0FN6Vv2Ijs3Ph40n7qo52wHY5yNzbQ71tBRHkhA7LXdsCpT2Kd/0NKqe7pAxegqGlJa/E36gaimFP3WgSV8wqQLJD++7YJ/PW1LOsQ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(366004)(376002)(346002)(136003)(66476007)(6486002)(52116002)(66556008)(2616005)(956004)(8676002)(44832011)(6512007)(26005)(2906002)(478600001)(16526019)(186003)(6506007)(36756003)(86362001)(8936002)(1076003)(83380400001)(4326008)(69590400008)(66946007)(316002)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: skEjSWT2i+w7sRUyibu7LDvn7usUjU//RHqAlceijrdiD3Vkke30zgi7NvNEf1V4juoUuhP32LA0ZnmeqHeWmmFpBC6YHh/glPimxi6VeMwlU7hf7Boog7q1DOWRjk9SqJl/v8JG0F2mimujLIC9UujAIdf+da3x1oVSNxGyKcSjX41kIVJMbORBskgBlTO9S6fqJhv47Poq95kaPU+UWAuQdjhXsndMhq/FTxVB+fPlCWpDqMICy/5ste2edqQsZ2HOcxBCjdoqvmHJyJotfns7fGGOJp32IupleukCqnTqNUVE/IMCe+aK4v7R3mS5Ru20BOQ7TrVWdOvEh/YPcQahnzUJrQzf0XLYMdF6lL+PYczMStKFpB5pvxUY9fG5zHjdYDiWhggVcd6BcCQo+ANayTYEzlTXYHTW/XxymMIM+VBIVe7j/B61FaQti/wL3n8Mk3OVY9sgtWvnqG4UdAVTe47HmkKtgjk3QxqffHTHdUZlYXorrnLprjP+U7AAUOvHjjftHHYhhANpPb92dDYVf33glkxYJ5SOx4Wat8BfOGUyUrK0LQIYPEetJ4PK2qPGW3uMc7Tn2UoqPebuzMMW1xi9kdEXNYfo0ayr1YuW/c83eAgjFBQLQBarJX64eb7NceXipCv87zeyoWPiww== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c4d5dc6-0d98-4d76-6d14-08d86252fafa X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2020 19:33:01.2720 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: J7f9BUQW0BDjxlYtDS/A7db2lMLjZLIHJocfaK78moySRu4wIjmLLEV4nQ15EODsrXV2zIWYxwJ5ASbsl5kYvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5295 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently PTP is broken when ports are in standalone mode (the tagger keeps printing this message): sja1105 spi0.1: Expected meta frame, is 01-80-c2-00-00-0e in the DSA master multicast filter? Sure, one might say "simply add 01-80-c2-00-00-0e to the master's RX filter" but things become more complicated because: - Actually all frames in the 01-80-c2-xx-xx-xx and 01-1b-19-xx-xx-xx range are trapped to the CPU automatically - The switch mangles bytes 3 and 4 of the MAC address via the incl_srcpt ("include source port [in the DMAC]") option, which is how source port and switch id identification is done for link-local traffic on RX. But this means that an address installed to the RX filter would, at the end of the day, not correspond to the final address seen by the DSA master. Assume RX filtering lists on DSA masters are typically too small to include all necessary addresses for PTP to work properly on sja1105, and just request promiscuous mode unconditionally. Just an example: Assuming the following addresses are trapped to the CPU: 01-80-c2-00-00-00 to 01-80-c2-00-00-ff 01-1b-19-00-00-00 to 01-1b-19-00-00-ff These are 512 addresses. Now let's say this is a board with 3 switches, and 4 ports per switch. The 512 addresses become 6144 addresses that must be managed by the DSA master's RX filtering lists. This may be refined in the future, but for now, it is simply not worth it to add the additional addresses to the master's RX filter, so simply request it to become promiscuous as soon as the driver probes. Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn --- Changes in v3: Move this setting from the driver code to the tagger code. net/dsa/tag_sja1105.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c index 3710f9daa46d..36ebd5878061 100644 --- a/net/dsa/tag_sja1105.c +++ b/net/dsa/tag_sja1105.c @@ -353,6 +353,7 @@ static const struct dsa_device_ops sja1105_netdev_ops = { .rcv = sja1105_rcv, .filter = sja1105_filter, .overhead = VLAN_HLEN, + .promisc_on_master = true, }; MODULE_LICENSE("GPL v2"); From patchwork Sat Sep 26 19:32:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 260114 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 A54E6C4727D for ; Sat, 26 Sep 2020 19:33:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 55A29207EA for ; Sat, 26 Sep 2020 19:33:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="CllOJXGy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730230AbgIZTdT (ORCPT ); Sat, 26 Sep 2020 15:33:19 -0400 Received: from mail-eopbgr130053.outbound.protection.outlook.com ([40.107.13.53]:17545 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730184AbgIZTdR (ORCPT ); Sat, 26 Sep 2020 15:33:17 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BKP07KOqYRKGQdTaSTwvB8pJwI4cZkKu0JAFXTDMhX1J/Fm2MttS5JISd23alnyzO7ZOVKSWWrjEG5SsmHD5o5fitHt+qEqFVfQswgzC/45LOA4OLK3nldEJW6UwghIB6T5oxZcaMmoIS1gj1yoGJMKKzprb40yizUvVdMlD5IbGua+h2VFj+PBxAI6XcdUfh+jNQ6OlfoS4WRblY5eKQ0W6feenJGb3t3baNXEmpnQEmTbsELZFWCHyuJhY4AWTmtubWXFAEexedhb1gv83wj3ENPKMRXziDmr3l6tUWPOabQVvph7FRjOra0yG+rQ66SbFM3HS7uVtFh3W3ZQxsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/TuL/a9+USuXclhSunkPCUv8+bJ+z6YOv0dk217C6FQ=; b=ioimrYPPLgb2nabtZn2uMvoe0EdwNJbwbJDFapd3V7e3bYVhePIeyVFOPIgltloIKbX/fwvKL2vpMlyMT0ehibOBF3RTY/KsJQDXV+Rv3j18mFq0SMlIHvpuWH3QKlNMwoJfDObnbJJflac6sXqGUzLeG/+Veleh4EPztpCaas2Zl+N2V2PxK592kq+QYljhAgAIQEGRpJV8Z0IbrycWO16mw7JSz4Z3g9HzzAv6AnlD9LJIe3UZ2KuXDKLsOIHDsfOkf2K23NdMb95VesBV+IIOA3saLU0Jonq/CBmxuTOddTM0lD95ezuC2g15RPrzkU19DtE4mkKSQR/0wPGUYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/TuL/a9+USuXclhSunkPCUv8+bJ+z6YOv0dk217C6FQ=; b=CllOJXGyisw+jSl56HGynK1x05jXJkt11sH3b50MwvNNShzS2dEyCpypSaerTiZgqt7VceLfSUnqDUEAF1hIZ5iqAp3Sx9RewqRC6wrGWi64Rt5xYRrNBEc0Z3lErYUGJpTx+EM3BnaJP4D5iQ55/V0Vb52nwDO7zx2f4DM6Xx4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR04MB5295.eurprd04.prod.outlook.com (2603:10a6:803:59::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Sat, 26 Sep 2020 19:33:05 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3412.024; Sat, 26 Sep 2020 19:33:05 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org, davem@davemloft.net Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org Subject: [PATCH v3 net-next 07/15] net: dsa: point out the tail taggers Date: Sat, 26 Sep 2020 22:32:07 +0300 Message-Id: <20200926193215.1405730-8-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200926193215.1405730-1-vladimir.oltean@nxp.com> References: <20200926193215.1405730-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.217.212) by AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21 via Frontend Transport; Sat, 26 Sep 2020 19:33:04 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [188.25.217.212] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 531eef2b-5f7e-423a-cac8-08d86252fd56 X-MS-TrafficTypeDiagnostic: VI1PR04MB5295: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wbmPmwXwKZWLLBf6lKI9eTZocElyyHr7fJzqBJSPVSBafGHB/d8oGhMCDrYmUp2NMEZTx6npHlOdmhEqELmrZEYxMRbTcxeeXjUri/p4ZuWle4PI1V7fZ9xvUsl7CmRCWJdH2pzvxJRsZKU7XVdUMsCc6slUDiyJb/Zk0P0vgVIvyK4E0TQPyb7kWtg4tmfMy6416/replnUIKmVniUEpa4+IgZqblFouLYAKPMpZS4U/CiVpYkWa9fTIBXzaN+S8y02koCuMTnsHccHVUkHQ+SpbBXoLFrrep2dknZS16juWdRpykkK7iGBwZspGcCI7nltBaQOWxP9JNvLcQwexBiwifQx8oiIx74YmoTPTe0sx3tQgcvI+pWG9TvsitWFORoFu3inbxSVXUAnCIg1Pv9jUnbqPOdHkvgW5RXkx9294K7cHooVQspFRnRv7t5W X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(366004)(376002)(346002)(136003)(66476007)(6486002)(52116002)(66556008)(2616005)(956004)(8676002)(44832011)(6512007)(26005)(2906002)(478600001)(16526019)(186003)(6506007)(36756003)(86362001)(8936002)(1076003)(4326008)(69590400008)(66946007)(316002)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: F6ykQXpadTWCvwb886mXNNNitpL56EWv1Ny0gqk+gBceWXANXQhuWG/VB4N7okxPMyUiRy6O+Xpj62fanuFx77PV9LCjmW7ZZgz8f2JIp6geLsXLMH597Rr+CKTSch3b8PisvvgxhzaKjB9WwIR8R3uPAq2m4Yk2r6XYO+1KtTgLzOAuoM7OFE6NzVHEDtNFqm1bBluTwPgAkqXJsFDijrsYHkBn9C+pgof4G4pWceCFR57/g5xdrp2bMB5zkAeplMu29lgoDdfHQgmXc6vYPln2QHqwXkctnzLwWiC3hbbEY+Iv6GtIRVp9FUBkl88TLMsMVkl236xKWrBKT6GGItDlWKjBknPY8EUb21GVqyEPmALFR1aKokqx/Dg3i6BoA7m8TBZr/E4mPaj3E67+nD9uEPtCTz3zkteXDLcZS7ZrMJjC1M7pWoiKxG5FQHxhIVmmjiTrQxaody4MjC6LsNjtUkDoxXiR5uhOcAyynhKML7mSOAxXVw3ddTjGOnkazmPowEgPG1OiMnfJA5UnzLr2f+PHbL6SP1W9bBOtH/tTK+TZiiaKhV9rvKK64w4fxnRFD55g5nKzJqYuI3FUJHC4Dm4t2b/4qk7gYuxNWjreqZzelyCs4N1KPV6E6lcCDczkL7p6/oqlBuMQWBStnQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 531eef2b-5f7e-423a-cac8-08d86252fd56 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2020 19:33:05.2018 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: C28ziKergLWE6Y+o+VQCRiaNRS3XaGRXRzI3JwRzED4lvQMYCqoj6gZ9CftJx/8qdXLcf9pWkEk27N6zgNNf2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5295 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The Marvell 88E6060 uses tag_trailer.c and the KSZ8795, KSZ9477 and KSZ9893 switches also use tail tags. Tell that to the DSA core, since this makes a difference for the flow dissector. Most switches break the parsing of frame headers, but these ones don't, so no flow dissector adjustment needs to be done for them. Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn --- Changes in v3: Patch is new. include/net/dsa.h | 1 + net/dsa/tag_ksz.c | 1 + net/dsa/tag_trailer.c | 1 + 3 files changed, 3 insertions(+) diff --git a/include/net/dsa.h b/include/net/dsa.h index 817fab5e2c21..b502a63d196e 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -90,6 +90,7 @@ struct dsa_device_ops { * its RX filter. */ bool promisc_on_master; + bool tail_tag; }; /* This structure defines the control interfaces that are overlayed by the diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index bd1a3158d79a..945a9bd5ba35 100644 --- a/net/dsa/tag_ksz.c +++ b/net/dsa/tag_ksz.c @@ -237,6 +237,7 @@ static const struct dsa_device_ops ksz9893_netdev_ops = { .xmit = ksz9893_xmit, .rcv = ksz9477_rcv, .overhead = KSZ_INGRESS_TAG_LEN, + .tail_tag = true, }; DSA_TAG_DRIVER(ksz9893_netdev_ops); diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c index 4f8ab62f0208..3a1cc24a4f0a 100644 --- a/net/dsa/tag_trailer.c +++ b/net/dsa/tag_trailer.c @@ -83,6 +83,7 @@ static const struct dsa_device_ops trailer_netdev_ops = { .xmit = trailer_xmit, .rcv = trailer_rcv, .overhead = 4, + .tail_tag = true, }; MODULE_LICENSE("GPL"); From patchwork Sat Sep 26 19:32:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 260113 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 E44B4C2D0A8 for ; Sat, 26 Sep 2020 19:33:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A93C721531 for ; Sat, 26 Sep 2020 19:33:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ohev18b5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730234AbgIZTdZ (ORCPT ); Sat, 26 Sep 2020 15:33:25 -0400 Received: from mail-eopbgr130041.outbound.protection.outlook.com ([40.107.13.41]:63047 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730222AbgIZTdU (ORCPT ); Sat, 26 Sep 2020 15:33:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c/oL4xXbA01gynlYiVsR/iimitVklBYKFqyLHvyhPIyVhHq2wUSQ5TRTp3YT1bV5e+dpzfVVJ3FS2blfy+NrSQoamyrwXLpI4ccnI5hd+nf+QZCVNeTrEr/SkKXm2CL50vTvGD2X3hbmfeqZaKENsTTIjkCweaao96yVmdPcZWBlDb+/gU/Pgp5wZFzTs/vKtBGfO4PFhNRS1tYzwv/kEfG/J/irnnPzJlOHLkNMCMz+DIGujPZyGyuwCJPvY9zq9zB9IanEtu5GLFx8FmF4z1/faTsdOM5jR7gAivKIeMH+x+qE0l5CqdO+3tM2ELu6juotpdFAO+nPwJazlO5XrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UclgL1A6XNDQKFQWZf35aspVvfsbEgz6oWB2qNL0bSo=; b=keI23d2Q8X9IFmwfAvso63vVjsek+YP41jp+wKeX3No/bQe6zK3XXaGquCgXGIw1ElD0M1pBhzxYKMTh/BV+eWX/8E8jhVzDgLWG4HvlX4ifhH6JiChd4jNNEwV65M0WXPY7UmejBDnQkhUQFMOwmbDT3JqQjmrQRF330vje2HGcDpTdw2n2Hso1KVOWGePfiwv6zgCMotIEtr/SJQxnfWNCJct4TbnKZjDKR0rywxPTQ1+zfZ26k5w4dFFqzWlEris49lADJpQ53zbmuzm5uhTzBKtM6zDiLBdICvnB926FkWrJmTSOqY3yJNPrWLJ1LQxxy/LIDTLx7bMXin5U7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UclgL1A6XNDQKFQWZf35aspVvfsbEgz6oWB2qNL0bSo=; b=ohev18b5v2ZrmkwpnHaM5XAUMvrswdlQMJ8f68wSar990V4I6S6RFRrcgFA8Z4qnKN9QfDEF7DRmoXl92EsFCP2l5U8KMDHLO8higXVqWb7CQVQWXPkFVaNFAt6SAcLji87mKJgED+DhfabIER+u0gvzADV6buEOEhO/w22jmNU= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR04MB5295.eurprd04.prod.outlook.com (2603:10a6:803:59::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Sat, 26 Sep 2020 19:33:07 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3412.024; Sat, 26 Sep 2020 19:33:07 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org, davem@davemloft.net Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org Subject: [PATCH v3 net-next 09/15] net: dsa: tag_brcm: use generic flow dissector procedure Date: Sat, 26 Sep 2020 22:32:09 +0300 Message-Id: <20200926193215.1405730-10-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200926193215.1405730-1-vladimir.oltean@nxp.com> References: <20200926193215.1405730-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.217.212) by AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21 via Frontend Transport; Sat, 26 Sep 2020 19:33:06 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [188.25.217.212] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1135b93e-1fee-43a2-5b41-08d86252fe85 X-MS-TrafficTypeDiagnostic: VI1PR04MB5295: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XPHg2qZSDyA6WzAN2Zk7hERAgsOIv7MYb0Q9rHNKLuAG11IdzXagLGEV0pVm3oL5AiMvZzpZy6JWCvYa/JAqakAPz/93Dj4AEOFlWVFpShIu8Ia/okapdWqTafwBc4VwUPxAeN8BhLu+QQIskB7U0WerZu4+IAP3NX2y9bWHfu6Q5+kVk0TBEK9TaEv5bqq7a3Kj56qjsfF10HPyoCwgdzGFOFsj3nA98apVLxwcLgggSFLOvxFMey29+PBkMbHfo1Ryj4m4W6Cs1tEqy2+r+y9fN1naedrdYNLLsATJM6ctLNMJ6uqHFn2kX+ne1n2Sq4qRvcRB8H6QFxmQuSkyPrDZKhxI7Ghh4yC23m8EfwXHjnXGokcikz3kLya2egl4ZvSyPRZhNfBsJxhT9WH4v2CICxG0Ce0RmevjZJVtJui8qQKfWrFaKa4hBTBqS8Hxkzi3OQSO5SBO9anDEeiu7Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(366004)(376002)(346002)(136003)(66476007)(6486002)(52116002)(66556008)(2616005)(956004)(8676002)(44832011)(6512007)(26005)(2906002)(478600001)(16526019)(186003)(6506007)(36756003)(86362001)(8936002)(1076003)(83380400001)(4326008)(69590400008)(66946007)(316002)(5660300002)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: UWv27nOnpT6LzSD//DkzI6aHsKom1BJYklVjjlxmLifjbJmyQJi8/XG/iqwdwzr12Lsr7hxVrlhdrMzutVUaTylYvGNJoj4f8ggmSrhS0lSXQneaIj473CkSJGYEWD3UC56R6CnVhnJ1KKqWyhT4Oeu/URKzDjNgYj0owopHWy+wx4IqA8CnSrNwFqSFAVv3kp1vmiYkpz4+/KY28UuCcXE8m1c9w3h3jOiy9rFidL1vK9oScYGryu4nR0yts5H+p/P2I7nR7h3y2jykZc8/6QPh1+/kfCfJ+/FLWeTh/nc/fBFeRZOilqjwMNztYRgw+aqKwrWFFiZ4H8CFg4DrE1DlXKPomWpSOB6Eys7Xz4bYRt3Jn2Bddb6Pq959VdVhbWQTb+KTuhTkvJeMgVnHej2lTitDRi/F2Ce7Hn+HZdRxmZ4tNYafCB9wio2O9ZFwXhotiPBrDkIzPVSQGQ/vcU3283EQtXFFaUMGTK/GIgCLq18EQ6dkIG5rur4V7r1/e6mV7PIyalltJKHYncwbVA2ZIr41248DUF38YFIb+iBmFbyqJW6LGHgCnf9z9QyvVo+XiAjv8I2fV6+HF9RP/Y0fwIM1OAmMtNVrg8IKJFjLAzE0/ZCEjwGl4wC4v/DVhY2bnrt7tohP+q34gxS7aQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1135b93e-1fee-43a2-5b41-08d86252fe85 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2020 19:33:07.2236 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m5xZyC2u23fPSgXhcL72zp3bntFL+R7uZpcosoJ9LeAET0p18VCWvFco0p5ws7KhYxXyDLN/0ZCPSsCS7XO+DQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5295 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There are 2 Broadcom tags in use, one places the DSA tag before the Ethernet destination MAC address, and the other before the EtherType. Nonetheless, both displace the rest of the headers, so this tagger can use the generic flow dissector procedure which accounts for that. The ASCII art drawing is a good reference though, so keep it but move it somewhere else. Cc: Florian Fainelli Signed-off-by: Vladimir Oltean --- Changes in v3: Remove the .flow_dissect callback altogether. Actually copy the people from cc to the patch. net/dsa/tag_brcm.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c index 610bc7469667..69d6b8c597a9 100644 --- a/net/dsa/tag_brcm.c +++ b/net/dsa/tag_brcm.c @@ -107,6 +107,18 @@ static struct sk_buff *brcm_tag_xmit_ll(struct sk_buff *skb, return skb; } +/* Frames with this tag have one of these two layouts: + * ----------------------------------- + * | MAC DA | MAC SA | 4b tag | Type | DSA_TAG_PROTO_BRCM + * ----------------------------------- + * ----------------------------------- + * | 4b tag | MAC DA | MAC SA | Type | DSA_TAG_PROTO_BRCM_PREPEND + * ----------------------------------- + * In both cases, at receive time, skb->data points 2 bytes before the actual + * Ethernet type field and we have an offset of 4bytes between where skb->data + * and where the payload starts. So the same low-level receive function can be + * used. + */ static struct sk_buff *brcm_tag_rcv_ll(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, @@ -149,26 +161,6 @@ static struct sk_buff *brcm_tag_rcv_ll(struct sk_buff *skb, return skb; } - -static void brcm_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, - int *offset) -{ - /* We have been called on the DSA master network device after - * eth_type_trans() which pulled the Ethernet header already. - * Frames have one of these two layouts: - * ----------------------------------- - * | MAC DA | MAC SA | 4b tag | Type | DSA_TAG_PROTO_BRCM - * ----------------------------------- - * ----------------------------------- - * | 4b tag | MAC DA | MAC SA | Type | DSA_TAG_PROTO_BRCM_PREPEND - * ----------------------------------- - * skb->data points 2 bytes before the actual Ethernet type field and - * we have an offset of 4bytes between where skb->data and where the - * payload starts. - */ - *offset = BRCM_TAG_LEN; - *proto = ((__be16 *)skb->data)[1]; -} #endif #if IS_ENABLED(CONFIG_NET_DSA_TAG_BRCM) @@ -204,7 +196,6 @@ static const struct dsa_device_ops brcm_netdev_ops = { .xmit = brcm_tag_xmit, .rcv = brcm_tag_rcv, .overhead = BRCM_TAG_LEN, - .flow_dissect = brcm_tag_flow_dissect, }; DSA_TAG_DRIVER(brcm_netdev_ops); @@ -239,7 +230,6 @@ static const struct dsa_device_ops brcm_prepend_netdev_ops = { .xmit = brcm_tag_xmit_prepend, .rcv = brcm_tag_rcv_prepend, .overhead = BRCM_TAG_LEN, - .flow_dissect = brcm_tag_flow_dissect, }; DSA_TAG_DRIVER(brcm_prepend_netdev_ops); From patchwork Sat Sep 26 19:32:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 260112 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 624F0C2D0A8 for ; Sat, 26 Sep 2020 19:33:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D40F21531 for ; Sat, 26 Sep 2020 19:33:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="IxuJNrIh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730248AbgIZTdb (ORCPT ); Sat, 26 Sep 2020 15:33:31 -0400 Received: from mail-eopbgr130053.outbound.protection.outlook.com ([40.107.13.53]:17545 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730046AbgIZTd0 (ORCPT ); Sat, 26 Sep 2020 15:33:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FuDAqPmXUZ458NYvepueLmysI754h/ccUv1GxxCRDqU3Vs4d6hYdwyYYMtwhOCK/e0qQ9wqYwthfBE5l+l5gm+YU5vquxVxEHbjK640xVYGniNO2C63nNF2hEmrtphcviFks57lQlWc1+7rVUnpPSZESibdfjsc/TUUIL4Vo4Sbu3Aep5gkNaBjsCIfPVBfab/8zOKmc2BN9acM3cRGh8OPW9+f1JyNWgRK0iDjWjGmTERUWK2AJ70YsVZgUYIgUnb+LG8RQW8Okw+bJPkqlcFORQbUHJAxnLI8nugeIMCrgJh7dXZ2XiGl0atXeVW+OwaYGgPQC+5MWbZo6dXOhYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ytUzIwREFY2NerL5lKbB+haA4NC+6oyyeYc0dAtK3es=; b=iozs0LG8Yqlc9cOlL7n3lkpomP1OlM/i0M7tEDAFsbYyskyOfyjo4+jldgNRmjHRSMPS6zNHsH7lOmu4aNJZzaaJ8Orz0/1JibSItQ0etXj52YEjZqS4KDzwXsaSulCkkejVP6R3xlIYBuCLZaV4aPTwVtrdSnxvfKHn8MuhUqjllpQ6Y/0V4+gV4/3nmQgrdIWhSu4V8xkMfKXWHtBL0lNxEi2CuEBwnJqS7FsSCz+8jZvLladDYtO/bHrPR9j6yP1QkRyyBPcwAa8R4xckgp+SIpJzQ4UmL4L/aoTvdm9f6S6V0MchYmuiZk5A+7qDoELp9fYhhlMZiSJsOnfdbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ytUzIwREFY2NerL5lKbB+haA4NC+6oyyeYc0dAtK3es=; b=IxuJNrIhpg+Lu/fF8sBSECRQpd6zRMmKiwDCm/cR42bMIwNQFx4/Zzf3imbkWpdzu49Dxvk6pJId++AdpT3MupcxJD0W1jTTf46rtrXLTH2gNZkU0vfQBnUmL7ffP3dOdJJt+G+Sodi07UG+G5J+pviealxDJYLYJZN2Bh5L1Zs= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR04MB5295.eurprd04.prod.outlook.com (2603:10a6:803:59::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Sat, 26 Sep 2020 19:33:08 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3412.024; Sat, 26 Sep 2020 19:33:08 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org, davem@davemloft.net Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org Subject: [PATCH v3 net-next 10/15] net: dsa: tag_dsa: use the generic flow dissector procedure Date: Sat, 26 Sep 2020 22:32:10 +0300 Message-Id: <20200926193215.1405730-11-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200926193215.1405730-1-vladimir.oltean@nxp.com> References: <20200926193215.1405730-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.217.212) by AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21 via Frontend Transport; Sat, 26 Sep 2020 19:33:07 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [188.25.217.212] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1bbecafa-e679-4b1a-b042-08d86252ff1f X-MS-TrafficTypeDiagnostic: VI1PR04MB5295: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ymFWAHEyxLBGJ79BuGadMouo2cmxqmz0cYigvuDJ8Eg9YGhm5Ia1ufeDGM68M+/pwttUkGuvm5ci12rjq8O8usDkEpOrvIg45fSffgpqCeEB80Euf0IQ3H/4y4gPlX4ETtaKystuM9Pd4tA1VXThFTVQO60kr8h8aziGMzU/rhNsxU9Kj3EYfFDXMFbRK1AR+yPTbvYAPLWjcHTO6L/xQX8IbH/Prvi+xIcWuUmSqn5h8gbeJAmQDTYFMMQ24BM0jWoOHwkIaGmh/fDY08WRiGN5QCgbYbPxsqArNCxDVpO0jcCs9QJqedVIA4dcqGYVNFX5ucaazO/JtskBRZ6+OtT/JCAs+KYtCTZmI7k3kncAYC/IgYb3oFWZFnvbo5iRx0iJnrEETlJOrJYjq0NMEdFUqx3/W3YQu5BeaSeuOJRCB25sjwRPWT66Vku/Rwz4+AZAMnBHF55vbqhsFSZkZw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(366004)(376002)(346002)(136003)(4744005)(66476007)(6486002)(52116002)(66556008)(2616005)(956004)(8676002)(44832011)(6512007)(26005)(2906002)(478600001)(16526019)(186003)(6506007)(36756003)(86362001)(8936002)(1076003)(83380400001)(4326008)(69590400008)(66946007)(6666004)(316002)(5660300002)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: piVVZKMKFFhiy7y8kK2GVp67l5tWLRC+LzxwKjeq1CeH9x0bP1aB3K1f/jV3OHepS9eebE5YZwGYdpT3C/3ianYpKUxeCKRMo++S/DEX8PkxVYZc2ATchW2wY7PauVurDtJ4FTRyqdtQKcI0GezjWvAryzMF7zAlIvKDViqS4CkmUF/SFfcohf4NAJQm04TOAcz8fnDeqkY1JnEVfFumHU+iIcIfOzxPvTj4coWVm7TeQBN8KVWy/38rI1fHfmj8eG157RMRAhTScnH35pp5AJNKzvTdcNMt3VEZiICjG4gY2/IIHRJHDX96pRFdApep3vtG65nMewxyof5cD0q1jftjaZ6pMvWqo92EcDbE/lwQ6NEnSk9QUAPcGpaMUuiYX1xKDQfWN2BwC+2VUIU2ezswWnvvZe5tTz/z88S3y2IkxzW5UhHkcYE9Mk6S8qx3ITUEVHkd+qS1v2thWCSq1/6jmwegJeqSuGiLbq8p0H54882gwyspeWfF976uW2WSkUJ3UU9WkC6YDZCRNaWmVzIgQrWiwuo37TXhQp0Q9Z6tmMNKTr8GU2bGvu6rvn2l0/hwmwPFFcEdVsYmiHGH78Plaas5wLFhxUkKsVRt5sc96Qmt3at9P2x6opbLMGDC1RRcHTICrtajzgV3eMJtTg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bbecafa-e679-4b1a-b042-08d86252ff1f X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2020 19:33:08.2171 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RZ5A27TSdEbj436vuR4sLpCjbPN4pyAtHhyKKIlfIPYPydeq61HJH4BUuTqBM3l0CrJGUfwNRH2NPpthBo+gUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5295 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Remove the .flow_dissect procedure, so the flow dissector will call the generic variant which works for this tagging protocol. Cc: Andrew Lunn Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn --- Changes in v3: Remove the .flow_dissect callback altogether. Actually copy the people from cc to the patch. net/dsa/tag_dsa.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c index ef15aee58dfc..0b756fae68a5 100644 --- a/net/dsa/tag_dsa.c +++ b/net/dsa/tag_dsa.c @@ -142,19 +142,11 @@ static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev, return skb; } -static void dsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, - int *offset) -{ - *offset = 4; - *proto = ((__be16 *)skb->data)[1]; -} - static const struct dsa_device_ops dsa_netdev_ops = { .name = "dsa", .proto = DSA_TAG_PROTO_DSA, .xmit = dsa_xmit, .rcv = dsa_rcv, - .flow_dissect = dsa_tag_flow_dissect, .overhead = DSA_HLEN, }; From patchwork Sat Sep 26 19:32:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 260111 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 E08F1C2D0A8 for ; Sat, 26 Sep 2020 19:33:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8D8821531 for ; Sat, 26 Sep 2020 19:33:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ord4+P69" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730258AbgIZTdj (ORCPT ); Sat, 26 Sep 2020 15:33:39 -0400 Received: from mail-eopbgr130041.outbound.protection.outlook.com ([40.107.13.41]:63047 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730240AbgIZTdc (ORCPT ); Sat, 26 Sep 2020 15:33:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SM5FVlVXGGCDoOm/s21d3Ik9oI7wTflgrciEHzzjiAoaDoHpBe1a/hilvHrRw3gzBi+2g7w/ITehMcXH1UvevlcGn/+eWPnkWsMIt4D/VDOEsY8Ql9whUOuqZmLDM8iaZPh/bFKv/gxxjpOGHBZ+ztjwq30LJkiHLnA2QOpRkbwB7J4eKVs+KEWHH/1Ag+5500mGswfb3yi2e7Dja859Srlpw541n/MwOaaDGXgYHeyzmPtg6YUTiEBX+xUjE9d3Rhmb759TH7z/65xSTSFm/ERqINXxQzqyNUMRPrIPiRXNLsV4IWgg1zOlqsFoO4SePspVWIPySwp+rsuOj0NVVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QsSEC2QldRrUBCVYkOpsBQuCNSOezYoEozNjExhbPAQ=; b=LyA1v3D3L7cHZJmQ3yAO+VBpZgy/E95HaTX3W64aYw2hNvkbHAbJKpwA5JgQJzqKoK5yCo0GpsOST9KsE4XwZSUyeXKSSEGYSpk/fBqbNlOffWFiZjFtqMFV7O3qYSQ+P/aiTWXc2rbaRcF1oh8mdCU5M9HnotcNB5IJytKpWodTVwkLqgOw2IT+NfYmTNtZJ5yEhmrkp2AtqhaQ0HNCrtm7cvjyrzAWTQ5MDRAoGksuuBDRnLwRUsYo+qHgDwgnX11LIOuPnoyhJvvrUef6O921bJmlqVEoMcbwF1K/faAq7vdqRKRxfzqvN1ACeB1BnDJkVz6KeRUxW79bYqYnmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QsSEC2QldRrUBCVYkOpsBQuCNSOezYoEozNjExhbPAQ=; b=ord4+P69U5i9OGumJED/q8poPl08pMKc8aVMiisSK9TX2O1FSum/wcvZQH+fdd/bsKH0s1MvTnZE1koJXGQxaxDnKe70CM+H72mR/sNpLBj21lxruHZQj5pSiVfALReScSoUQzYyk1c8/68K+u51fQNrjN7sAV9JFRcS52Rhlfs= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR04MB5295.eurprd04.prod.outlook.com (2603:10a6:803:59::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Sat, 26 Sep 2020 19:33:11 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3412.024; Sat, 26 Sep 2020 19:33:11 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org, davem@davemloft.net Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, John Crispin , Alexander Lobakin Subject: [PATCH v3 net-next 13/15] net: dsa: tag_qca: use the generic flow dissector procedure Date: Sat, 26 Sep 2020 22:32:13 +0300 Message-Id: <20200926193215.1405730-14-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200926193215.1405730-1-vladimir.oltean@nxp.com> References: <20200926193215.1405730-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.217.212) by AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21 via Frontend Transport; Sat, 26 Sep 2020 19:33:10 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [188.25.217.212] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b958a43b-a951-4f76-e801-08d86253012c X-MS-TrafficTypeDiagnostic: VI1PR04MB5295: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IC3QQXt2LBJD+wc50PSBbZxMDKXFs9HncGIYwE+f1bBkR9Drg04c1XV4nV4eSv5djyWh4CMZYXlM4Oaiznux8Yf2kQ0HGgkLeY9FWx+ujCK2gyIKUGOUsn8a3snoie53IS0+ygHu8r8TB5muY+w4YX4pJ3hieZwTHV86WZlnsHO6SA/xbAqByUCZQwDC+fZxcMFvDLmMwUptp9qfaZLjS+Onj6VIy2nC74I1m5YTUkVRMBtIV5/SRuVQ4JmjSqi8YtvnKgHSI3Kd7rK7y9Ek9dul4I26+mIqBz2hpKuXKe9O9/XEC2cDEFmekThv5b9Zlrn9vzM0uKASi5rjuZydfZGSrsfCJpLJ6x2tyF3T4MSjXP31D4KNVM5LlLLWJHTqtyhzdlXjZ0RgAhR+rwC+AeU6FKcYjH/o7mm62b1HA5xaY3pcGOgIcDSUsX9Try2Nm/ah97UCZQBSzJCgZTLfjQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(366004)(376002)(346002)(136003)(66476007)(6486002)(52116002)(66556008)(2616005)(956004)(8676002)(44832011)(6512007)(26005)(2906002)(478600001)(16526019)(186003)(6506007)(36756003)(86362001)(8936002)(1076003)(83380400001)(54906003)(4326008)(69590400008)(66946007)(316002)(5660300002)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: m4s+VE9ep7skpWPgDVaBT7DARmd++Tzi7g+A0kGRl5T3lcujQio8CkSnOZE8tUO2Eewix7KY35kHOVU4qcXPLxNJla7mHsXzAtFVbUdH1/Bpk28yLgsDN8vH8ocPg/QyHPDLVJqLQn4R9fswoelNvSs67AvyrRBfSF+S/nUSGyhf+yPV5/Sliqd/N7XctsTjItH6Y1pzlJOmBQfDftLcFGuQs3pbdxX3G7B+DP9z+0+vAZtTjdsNdeP36rx41xU525auc+d+cY9xC6Yy5qpy1hK1d8T3xWapp5gnmggIVMYAzvpsBhn3Yq3qjCUUcI268ZCUJIxqrom3VnIaZ0K+BckKuUBThryuoEwS7cC7jK3uU+Ydt4gdUL98CiB41PKcXnKvUZfjjaeveWPSv9HrFWFrh+HHZIqqVxJP2Z/pRKSc+604PzowdSXHFhUxnD+Kb7TEsMc86BL0WIX8QrS3JNN5S4HQ5DUIivsPZsoNL09s0qE0b9U41CLN4MpwwHF1oPErypOL6nRLgy3ugULuwxcZiNutfAAVep8TPdFq5LWhGst1IUidrhZjWfN2tiO9GWnIL4Hzkx1Ct0CmxIY8nrFgeFEaaWBw4jmNrG446f4S2GHKL0wwY4s9rJwP0yvutnbNPxq/iQek8AUCPm3niw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b958a43b-a951-4f76-e801-08d86253012c X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2020 19:33:11.6501 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TQn40lVFjtnp+29nSU+KQMC+NORvnTGBSzk3mSAwhYwXaFrTaBC2SJgclh8028rVmQIbMBvmN7bRdjBsHPHB6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5295 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Remove the .flow_dissect procedure, so the flow dissector will call the generic variant which works for this tagging protocol. Cc: John Crispin Cc: Alexander Lobakin Signed-off-by: Vladimir Oltean --- Changes in v3: Remove the .flow_dissect callback altogether. Actually copy the people from cc to the patch. net/dsa/tag_qca.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c index a75c6b20c215..1b9e8507112b 100644 --- a/net/dsa/tag_qca.c +++ b/net/dsa/tag_qca.c @@ -89,19 +89,11 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev, return skb; } -static void qca_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, - int *offset) -{ - *offset = QCA_HDR_LEN; - *proto = ((__be16 *)skb->data)[0]; -} - static const struct dsa_device_ops qca_netdev_ops = { .name = "qca", .proto = DSA_TAG_PROTO_QCA, .xmit = qca_tag_xmit, .rcv = qca_tag_rcv, - .flow_dissect = qca_tag_flow_dissect, .overhead = QCA_HDR_LEN, }; From patchwork Sat Sep 26 19:32:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 260110 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 89808C2D0A8 for ; Sat, 26 Sep 2020 19:33:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 432AB207EA for ; Sat, 26 Sep 2020 19:33:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="iGWs64k4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730266AbgIZTdq (ORCPT ); Sat, 26 Sep 2020 15:33:46 -0400 Received: from mail-eopbgr130041.outbound.protection.outlook.com ([40.107.13.41]:63047 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730249AbgIZTdl (ORCPT ); Sat, 26 Sep 2020 15:33:41 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m2MP+9MI9Ruy/bHQSQ1U2x4qFK3y5T9ju9Qv3GcecPR+WRq3bhdIg4fv4FyvhJ9xCiWBukiOafw10W/7tWn+rRxxFt10uFuofJTdxR/7qzYWhQEmJpOSjfVqMrTvKoH8A7GMMX0/PPPPLF3R0/KGaXeS2kmb79Ytzhz7/ssz9LlPaIcGxxkM7NFPZ99o9zsgSTv9Gzwt7LshDa+TqmC1qtJnYIZP3QpQ1s2/tNL9FYZl8vVphM8/ukNcbbqy1cgBgdJ9mL1aM4lndofWi7IqGf4adh0JLEu0xwQ6k/+CGcKcaiR/1NxsFcasJCEJjnHpc0R+VMCmHU4TnkveuK2KEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DQ6/+vTV6+zysM2+/JoneOH0ogXQKGmbbAxK7UBdIvU=; b=UW8Gk7o3lGwHniywlHcfk5/Rrp6lDDey5cUQYb5dPKA6OL32KYgPYWKd48DHE++LBOf9IOb5XAMt3BhmmaR469JGxT+bGS09PtPXZrDfeBLiXIfcDbwwV2QP+gE3DEFmfVYECx2oERbTOYffVymg7l9Wateu/OJcF7HDSrMMf6/dNi+7U9ABsypEP5hSjM/N22vv4q38WZQf2mX2MTLauIHp3IYkMGBYdz8EbLIbHSPQVJY9B6EQr9WwEDsWAlsv+So2ZKjHLswBLiJcb0BKbqUvAGXEFpkIlzXa1pW80R4/ZXSE0GgSqDjVd93GQroOfL3ra90fLJPlql6JxTlCeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DQ6/+vTV6+zysM2+/JoneOH0ogXQKGmbbAxK7UBdIvU=; b=iGWs64k4buoKg3M+ez7J653to/jyJP/3qcZ8ilB5TTQ0OY6Xt2LIZhWrWIfo3mO24N1oRJnqzmydUafe6OJLdh14HDXdWw+QLzdB+AX6KTHTZlV+Fwb2jdT/N82qO8Q9xIodPL0dZWvWxRhjD6+yKVHBe6OuY1zaNrfRiQPurg8= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR04MB5295.eurprd04.prod.outlook.com (2603:10a6:803:59::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Sat, 26 Sep 2020 19:33:13 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::983b:73a7:cc93:e63d%3]) with mapi id 15.20.3412.024; Sat, 26 Sep 2020 19:33:13 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org, davem@davemloft.net Cc: andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, kuba@kernel.org, Linus Walleij , DENG Qingfang , Mauri Sandberg Subject: [PATCH v3 net-next 15/15] net: dsa: tag_rtl4_a: use the generic flow dissector procedure Date: Sat, 26 Sep 2020 22:32:15 +0300 Message-Id: <20200926193215.1405730-16-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200926193215.1405730-1-vladimir.oltean@nxp.com> References: <20200926193215.1405730-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.217.212) by AM4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21 via Frontend Transport; Sat, 26 Sep 2020 19:33:12 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [188.25.217.212] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 419fe9a1-112b-480c-949d-08d86253027a X-MS-TrafficTypeDiagnostic: VI1PR04MB5295: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yrFLMBfskkFZtfHfJXIh5LdLdcQd2D8miINV9x6i7GhLLnX6i3BP6KzeucUqtITGQTbha+V4kOBdVE0XpsYKVkYaugQGbh7n8a0mi7ZqMmDoK5WpSv16RssOvfFuOXOVl2kIyfybP2Nhcw+4sgTkgxOR8BA1zSbyfXoXs1mggw/b7yMCC07B7DpaOjC2yTpJnU2r4f8TROnZd0nYyoxT36HYBTMzo2wS04gZzi84brZOVqDgzdf80RGmW1pDb+6+zIW0gMGeUHCuG8HIvS0bNbuhO/QI4vw6+4tFdDLgSxawj4yOIEW61LerGZVpkTx/0XOuPAt2xDoLgSiePA5UCiXQ5XeUSpQKKI7tn2RvBlVX3NrsO2lO4mqOJ+GzEhfyEHGyW6cY1lHFhVgZyYv987JadWoWmWc0ycuxjU/U10+SngfhUTKxIjtuPdA8YzOPMNXPyIWDO4ubCLn1mx/zsA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5696.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(366004)(376002)(346002)(136003)(66476007)(6486002)(52116002)(66556008)(2616005)(956004)(8676002)(44832011)(6512007)(26005)(2906002)(478600001)(16526019)(186003)(6506007)(36756003)(86362001)(8936002)(1076003)(83380400001)(54906003)(4326008)(69590400008)(66946007)(316002)(5660300002)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CWZ5PDzYrM1ET9lJ8u9FOLhqtaS6+MjShtoEbExSE55dczDanO/Lm10rtpWKGYDsinqMFWNGNKgLmVI+jOE8v6WzYtfxG7Bqb4fG+ONs1y00WbuGvXW9/mQS0QSqHB2jTUoeAHPCrhRuxo4cvliEjqj+5bas9HBgd8kjVXQeeLYWHPp3F6vBSSycQFUuAKC4R+LfLudt4Fz1nboXi53xqz8Vv3YX6+LNucyABKS43Rr3M4Som5DUoGZGDi5li04rqvHulGVWpajHvdlzE3mtuQ439I4scBKYRYWeqNwNeczZnJrhzOTqXWyHv+jFdrTifWB9W/4qbDj5SgNh1UvzB1mGHsef0+9UrVBg1Kb3jGRYldhaGhFjl0lUOkeQOFTmVlYUlxz4XKeepMmGn6YZ3rWKJ3QRAyYJe+61iMuZ2GxnrOjJwJao6ajHjm8QiMSzL/M+DIhwTAWcsW6QumpaG4f3YHJp1E2dRleFsTHbvcalwTCNJKDYJBr/pk92XBNEK0GxOG91ZUv6T7oE92Oq5kZ3nyOp49EeDWqjvRQeNWfFCzavev/cX06pDShYC6MVapXetg+KOHGleG9K/0qkyzNX18AXqAo0TZPzP6Mx9WbCt8U3hI2nqqiblRt85OWs6xnITHUQj10h5r/cRdzVwg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 419fe9a1-112b-480c-949d-08d86253027a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2020 19:33:13.8459 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: V2ivPew7IedKWBxuIvTon49crylg39qKd2AO3gPz838z4i1hQwA5dKq+u14kWrimWs+/3yp6WbTpmTAC0z42MA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5295 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Remove the .flow_dissect procedure, so the flow dissector will call the generic variant which works for this tagging protocol. Cc: Linus Walleij Cc: DENG Qingfang Cc: Mauri Sandberg Signed-off-by: Vladimir Oltean Reviewed-by: Linus Walleij --- Changes in v3: Remove the .flow_dissect callback altogether. Actually copy the people from cc to the patch. net/dsa/tag_rtl4_a.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/net/dsa/tag_rtl4_a.c b/net/dsa/tag_rtl4_a.c index 868980ba1fcd..2646abe5a69e 100644 --- a/net/dsa/tag_rtl4_a.c +++ b/net/dsa/tag_rtl4_a.c @@ -106,20 +106,11 @@ static struct sk_buff *rtl4a_tag_rcv(struct sk_buff *skb, return skb; } -static void rtl4a_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, - int *offset) -{ - *offset = RTL4_A_HDR_LEN; - /* Skip past the tag and fetch the encapsulated Ethertype */ - *proto = ((__be16 *)skb->data)[1]; -} - static const struct dsa_device_ops rtl4a_netdev_ops = { .name = "rtl4a", .proto = DSA_TAG_PROTO_RTL4_A, .xmit = rtl4a_tag_xmit, .rcv = rtl4a_tag_rcv, - .flow_dissect = rtl4a_tag_flow_dissect, .overhead = RTL4_A_HDR_LEN, }; module_dsa_tag_driver(rtl4a_netdev_ops);