From patchwork Fri Mar 30 11:59:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Lomovtsev X-Patchwork-Id: 10317641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9D5EA60212 for ; Fri, 30 Mar 2018 12:03:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B83B2A31A for ; Fri, 30 Mar 2018 12:03:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8026A2A50E; Fri, 30 Mar 2018 12:03:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E32ED2A31A for ; Fri, 30 Mar 2018 12:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Kd7zFK7665tZIOk+/7XemC++PlIwdkhkLOfZ8vlFL9w=; b=qd9rOaonlqVMMh gycehpRdEN70cs0qQsP6Rz1KhNW64rjkHnaMlsmZfzJ2Pz9mOv/ZfV1swp6Mn+RGcxg+Vetts2KoL S670MbFeQEsSKtAJPqieSX9qsA9LSE6HpxvORRTDwZqVKnyrvbv51P2jAvmh/+mCm43C7XzFQIAaU 334aZksFBMQ1wKTrr8bdHXsCE577yHGlhW9sbpnoe1bYOxFKxwCIgIBp19XuDjwhECOQeZMpPvMqE F9iie4cn9pedpF6lbDTbqhQhc2nKGfwALkLrPr3EYenqSkSXOzxkp3M2KKLQ+hY27IGaLxqDIKV40 shmyl0a6iGxYfMxFa+FA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f1sks-0003EP-Lj; Fri, 30 Mar 2018 12:03:38 +0000 Received: from mail-by2nam01on0631.outbound.protection.outlook.com ([2a01:111:f400:fe42::631] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f1si1-0001Sb-GZ for linux-arm-kernel@lists.infradead.org; Fri, 30 Mar 2018 12:00:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=9aqnP25m6wf305EbxzI/J+YGb45ANP1kBZf29yajHmU=; b=fIfUDr+FVjoMQ9ppXkynpI48EKdR6D/VUnVYVL6/r5Fbe73A1CKaanofqwHXWdeOjjSgoxUMyIY4Ao/tcnbDc//19033grMl6rzzDKoqRFZXNTNKMsIZ1nIhGz3AHauHLxSj5tzfRYS346yXaEK2r0XSptxngCrXkQWwVR/TySo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Vadim.Lomovtsev@cavium.com; Received: from localhost.localdomain.com (50.233.148.156) by CY4PR07MB2997.namprd07.prod.outlook.com (2603:10b6:903:d0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Fri, 30 Mar 2018 12:00:28 +0000 From: Vadim Lomovtsev To: sgoutham@cavium.com, sunil.kovvuri@gmail.com, rric@kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net Subject: [PATCH v2 4/7] net: thunderx: add new messages for handle ndo_set_rx_mode callback Date: Fri, 30 Mar 2018 04:59:50 -0700 Message-Id: <20180330115953.17154-5-Vadim.Lomovtsev@caviumnetworks.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180330115953.17154-1-Vadim.Lomovtsev@caviumnetworks.com> References: <20180327150736.10718-1-Vadim.Lomovtsev@caviumnetworks.com> <20180330115953.17154-1-Vadim.Lomovtsev@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: CO2PR04CA0006.namprd04.prod.outlook.com (2603:10b6:102:1::16) To CY4PR07MB2997.namprd07.prod.outlook.com (2603:10b6:903:d0::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d3bbef28-86c5-4c31-369a-08d59635d490 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603328)(7153060)(7193020); SRVR:CY4PR07MB2997; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB2997; 3:bin9r6jcTnZa42qY6O6fVCjTgky5offzGQOp3W7kXYpjBsFEygF2rpJTSGO0ofvN82CIfGN+7kevwKyv/l1OzqbUsyZVAAA0fRKfrtutbEHdqT2GZfNDsKqRT/+4u0qx8eFhPzfpL9jDK9eKygXs67iOe7OU/OPWVUKJcSVCc9F50T/HtHD3m2U1SEdl0KWJDlE2epNnGMLQ/h4PhJxblLUtH3F/BcMt1VtQH46erN9/xMX0G2XZQ9kH2NIjreSd; 25:KT95iZmKd/xSDPSWz77PDQgadLlEBunYrCp92YLY2bTPazI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v9EDVfYqzrDyxrnVWf3CAoLGNT+2d0cUX3VAoMHv3Lkq2rV38JInM2cyMjshR56GV76B2OQdlQOfrXlwzbf/XkjZifIdzKD6EIfx+vbQAJo+YGFeNsrH20j7PrwZ3M2DplZPFNcXPYXJhSCTSdVf9mZVC33EH5HcA=; 4:UiWwZ54aL0jwuDuB17pQ42PwInPuONC/YDwpzMEzBtygP1MO1ijwyfXZ/mtFRMZWO1Y0D9P6PLJl3SOO9oePxhz3DPaC0K/Rm7XUp5zVWGXBrJBk+n3BQOtTIKeBkkq+OBc4Jg4yKWmwes6NBQHfk/slCAB/UTL5VEq0XzGkdeDwPgAUTjlhGsfool/Ua1vGnhIySK8nF+ut6ecsJTlEjx1RrIxpjuPJrDM5Qag+k+KvLHNsXyyHu9IU7RBdXJWg/R5iACqlNWhPxmyWjl3EUQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(10201501046)(3002001)(3231221)(944501327)(52105095)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:CY4PR07MB2997; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB2997; X-Forefront-PRVS: 06274D1C43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(376002)(39380400002)(346002)(366004)(39850400004)(189003)(199004)(3846002)(6116002)(1076002)(105586002)(81156014)(81166006)(8676002)(48376002)(50466002)(53416004)(5660300001)(52116002)(97736004)(51416003)(6506007)(8936002)(76176011)(386003)(69596002)(2906002)(6486002)(6512007)(72206003)(39060400002)(6666003)(47776003)(316002)(7736002)(16586007)(106356001)(486005)(486005)(476003)(107886003)(446003)(305945005)(53936002)(11346002)(2616005)(66066001)(16526019)(15650500001)(956004)(478600001)(68736007)(36756003)(50226002)(26005)(4326008)(42882007)(25786009)(227083002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB2997; H:localhost.localdomain.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB2997; 23:5xofPDRQob2NKAt1BcV3jHctUV7IZtY85CDwrSgmI?= =?us-ascii?Q?i0MC1eX3PgBzuIPokkYxu3pMzgHzYx/vlP1kiX1xVjtkk0pH/mrM+zL10Flf?= =?us-ascii?Q?jAGBf3pFgGd7XsFpsQmzzBrUIMxCJ6Dgn7ANHz8TETtXJOKUdfJuu28KVgJQ?= =?us-ascii?Q?pmBtDda5qZAZlLjxUdo9C2p5B1JodjFJeR0VHEt//zqcYgPsZE8UI2ZuHmKn?= =?us-ascii?Q?bUbBhPh7POsGq9fTVD6F4Uzt5U3dr0LunKhGKecsGsZ0CLVNjLi+exVkSIJ+?= =?us-ascii?Q?cjKU1vb9aRpAdr+7iPF4hTNe5ErlcGTmBmYfwU2C8HX249FbaWjjf6uHXI2l?= =?us-ascii?Q?X7H3OClPHUVTJRxLZ/MSoWiycU6uoms2ktY9yLOb+4y1IcfEOhv1oHNunBxG?= =?us-ascii?Q?ia3XqiR0TMWsbUfORWJ6j5bXw7kkMmRWP8rI5zVcJDQEK6Lfs7UE0LnX6Edl?= =?us-ascii?Q?1N2kTw2qtNvWYWFOojGCTU5i6itpx7bEEY64Nc5mhoMdgT0VYG7VN+gjosIq?= =?us-ascii?Q?ewbDJQhfvgABC4HkqHO9zDb2CeGQHZo3LPGqmJ4QsU38i/AIi0eSiBfIKP21?= =?us-ascii?Q?VmC5CPyboIlRWW/fy+BhztC3Dzj+1k2AZxQQvaHnuOwgCwm90DA6p2FLAfuA?= =?us-ascii?Q?y+ev0u4+n3OST8Y6F0mT7VA4rtl0UZgzt26+XWM6qxWsll/ZDZ3gUSOySUNj?= =?us-ascii?Q?aJeW7hJggT0WWwfqM1wEg8O5JuNihWmQ/8Nc5kYtSIjhnSM7Bi8OyL1RswnE?= =?us-ascii?Q?oFHcuKN7Z7zBy63DQDIHWhmcdc57vHDXmeRnk3W83GXzwn0tSG2nUFllHoIw?= =?us-ascii?Q?KS+5ghdpHapZl/0Sa4PZpVwa9p5ZrVwkVHqwBijNHY/qUDPtqkMc1E2FFMYS?= =?us-ascii?Q?evTOw2+ZyZLfXCSucHOorz2xZIg4yqUx1Zox3T1teIVbqdCbA7Ywge/tw8qu?= =?us-ascii?Q?nWqp5+GwkdWkhU4SZgy7uFVR8EZ33GhcowSA0ako2EG9OX4MEB1o2d1mEExV?= =?us-ascii?Q?XEAiYsrzao2/E1wwqoiawGVV7fz+DE1oJS/XYg5SCeMvqTBSYGSmausRoddt?= =?us-ascii?Q?gOgsFGv14nAcpc5dfJAR3XvPX7j6G680bzlxB3pv8O8jJ4RbzrtzphSR77cP?= =?us-ascii?Q?viRXUqEx79utebzyg/pwqL1lQQhmVBIRW4uIUi4BSWNCVTP4n5Bus9v4bimt?= =?us-ascii?Q?dbT9DMerej6MMtM5cnyRFDtGEm/nSyzdq+5babxzhIxhqr/jw3XwaTUpbP2N?= =?us-ascii?Q?AWJblTIJXLW8X9mhr7aMe0YZwAAJ5FjmEu27jajSFOl3eLPTlPvrQ5ApDciS?= =?us-ascii?Q?Sf0qvZodS2r4A64L2AlVKDn5AJHxtGFzPei3CWRzb/5kbAunUt7LD89Fdl/x?= =?us-ascii?Q?in2QA=3D=3D?= X-Microsoft-Antispam-Message-Info: ixIr9v7qeZOhir9dwqSV4eHcKUwyAJzxNeHaF0gyejs67SanvzbfOFugy6YvFW7K7r4EI4hDZcGfnnt/9kMr2n7dyZqfYy65zwEPF9E/G48fj5dtpPPiV1ciOgaIo+hAg41sEov8u/ym3GirzvDEjIDiJgPOlys4SSBw+owjB6IxPnDETbPzBkO/niN50zSb X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB2997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T2lL63NLG X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2018 12:00:28.0822 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3bbef28-86c5-4c31-369a-08d59635d490 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB2997 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180330_050041_569800_E665C318 X-CRM114-Status: UNSURE ( 6.96 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dnelson@redhat.com, ynorov@caviumnetworks.com, Vadim Lomovtsev Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vadim Lomovtsev The kernel calls ndo_set_rx_mode() callback supplying it will all necessary info, such as device state flags, multicast mac addresses list and so on. Since we have only 128 bits to communicate with PF we need to initiate several requests to PF with small/short operation each based on input data. So this commit implements following PF messages codes along with new data structures for them: NIC_MBOX_MSG_RESET_XCAST to flush all filters configured for this particular network interface (VF) NIC_MBOX_MSG_ADD_MCAST to add new MAC address to DMAC filter registers for this particular network interface (VF) NIC_MBOX_MSG_SET_XCAST to apply filtering configuration to filter control register Signed-off-by: Vadim Lomovtsev --- drivers/net/ethernet/cavium/thunder/nic.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/cavium/thunder/nic.h b/drivers/net/ethernet/cavium/thunder/nic.h index 4cacce5d2b16..069289b4f968 100644 --- a/drivers/net/ethernet/cavium/thunder/nic.h +++ b/drivers/net/ethernet/cavium/thunder/nic.h @@ -403,6 +403,9 @@ struct nicvf { #define NIC_MBOX_MSG_PTP_CFG 0x19 /* HW packet timestamp */ #define NIC_MBOX_MSG_CFG_DONE 0xF0 /* VF configuration done */ #define NIC_MBOX_MSG_SHUTDOWN 0xF1 /* VF is being shutdown */ +#define NIC_MBOX_MSG_RESET_XCAST 0xF2 /* Reset DCAM filtering mode */ +#define NIC_MBOX_MSG_ADD_MCAST 0xF3 /* Add MAC to DCAM filters */ +#define NIC_MBOX_MSG_SET_XCAST 0xF4 /* Set MCAST/BCAST RX mode */ struct nic_cfg_msg { u8 msg; @@ -556,6 +559,14 @@ struct set_ptp { bool enable; }; +struct xcast { + u8 msg; + union { + u8 mode; + u64 mac; + } data; +}; + /* 128 bit shared memory between PF and each VF */ union nic_mbx { struct { u8 msg; } msg; @@ -576,6 +587,7 @@ union nic_mbx { struct reset_stat_cfg reset_stat; struct pfc pfc; struct set_ptp ptp; + struct xcast xcast; }; #define NIC_NODE_ID_MASK 0x03