Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5762358rwl; Tue, 4 Apr 2023 03:20:04 -0700 (PDT) X-Google-Smtp-Source: AKy350ZHvQtePUZkvNsGnd66gUpP4GHHa+qomFVZ7cdN2luZ3BG2vrNAv/E0Uv3FGDnCE3JARa1Q X-Received: by 2002:a17:90b:2249:b0:240:1010:d488 with SMTP id hk9-20020a17090b224900b002401010d488mr2308627pjb.36.1680603601818; Tue, 04 Apr 2023 03:20:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680603601; cv=none; d=google.com; s=arc-20160816; b=ud/i3AMZA+9oKVMEXB/C99LKwOp1o7uEA3bBS74vJfjTA7BvjSY4CrnFU0J+pz2EKL D3olVTh0/VZMkVaIjBfWd0kPSK+sptM6fPpAQu0dBln8C6Se/Us7fLtZzh1woNs2Pblk fDoOIgbcg7fKks4PlA6gEtJTD3aCq2evp4HafJfs6OXs7lQV193Fz0VSJgdU2jrOzHIL scC5Z3XpWnLLWNyYk2vQ9pE51iTR55VSf99MF8OiEopF//D4r5w/Lcb3COV5T32ONenP fJoMk+H5HZPB2UPd8fPCknroAyTrj0Ra4/idMRLPA/0uIvhkRuwxZhSBi4ZtUvdjlVRF pFFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8rJBsbAITBmImlRKbMGHOPApf1/+hUgnI0c2GVJW8T4=; b=PcSxFfFzMCPMLTaXAA3kXXHO27TBq/VzhLYfH9gaU0+H/+qXaNl3L5diPWMd5ma3NY orojneCoEh5U7XNChig9xXZAOlcY7/SpmrWqcwb7p1VzOABBmEZAt8OfuKdcHvfszJ8v sT5HHj9gsAUBiL02Biv8rf4IsxywWRSQvNpeLwUthbflAP+fO4C0FQNNaskFsJkOKk+d UwHptlpxa9Xo1exlXSYvmErdup45AVRyMsz9cgdOtZDFlugSesEmLNQkoky3EX0CdrAt gUJTsVbCiJAJzLIV+YcL/+gLEiiH5Jj+KKxnTP2Bd6IIQQL8SdLDBUQsvASeogRnNLJY +T8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me14-20020a17090b17ce00b0023c06116a1esi15650213pjb.36.2023.04.04.03.19.49; Tue, 04 Apr 2023 03:20:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234471AbjDDKTi (ORCPT + 99 others); Tue, 4 Apr 2023 06:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234410AbjDDKTd (ORCPT ); Tue, 4 Apr 2023 06:19:33 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E0663AA8 for ; Tue, 4 Apr 2023 03:18:53 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjdkU-000087-8E; Tue, 04 Apr 2023 12:18:46 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pjdkS-008tRe-No; Tue, 04 Apr 2023 12:18:44 +0200 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pjdkR-005nn5-LQ; Tue, 04 Apr 2023 12:18:43 +0200 From: Oleksij Rempel To: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Woojung Huh , Arun Ramadoss Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: [PATCH net-next v1 2/7] net: dsa: microchip: ksz8: Implement add/del_fdb and use static MAC table operations Date: Tue, 4 Apr 2023 12:18:37 +0200 Message-Id: <20230404101842.1382986-3-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230404101842.1382986-1-o.rempel@pengutronix.de> References: <20230404101842.1382986-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for add/del_fdb operations and utilize the refactored static MAC table code. This resolves kernel warnings caused by the lack of fdb add function support in the current driver. Signed-off-by: Oleksij Rempel --- drivers/net/dsa/microchip/ksz8.h | 4 ++++ drivers/net/dsa/microchip/ksz8795.c | 12 ++++++++++++ drivers/net/dsa/microchip/ksz_common.c | 2 ++ 3 files changed, 18 insertions(+) diff --git a/drivers/net/dsa/microchip/ksz8.h b/drivers/net/dsa/microchip/ksz8.h index 9bb19764fa33..ad2c3a72a576 100644 --- a/drivers/net/dsa/microchip/ksz8.h +++ b/drivers/net/dsa/microchip/ksz8.h @@ -32,6 +32,10 @@ void ksz8_freeze_mib(struct ksz_device *dev, int port, bool freeze); void ksz8_port_init_cnt(struct ksz_device *dev, int port); int ksz8_fdb_dump(struct ksz_device *dev, int port, dsa_fdb_dump_cb_t *cb, void *data); +int ksz8_fdb_add(struct ksz_device *dev, int port, const unsigned char *addr, + u16 vid, struct dsa_db db); +int ksz8_fdb_del(struct ksz_device *dev, int port, const unsigned char *addr, + u16 vid, struct dsa_db db); int ksz8_mdb_add(struct ksz_device *dev, int port, const struct switchdev_obj_port_mdb *mdb, struct dsa_db db); int ksz8_mdb_del(struct ksz_device *dev, int port, diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index 97a6c5516673..ee68e166fc44 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -1073,6 +1073,18 @@ int ksz8_mdb_del(struct ksz_device *dev, int port, return ksz8_del_sta_mac(dev, port, mdb->addr, mdb->vid); } +int ksz8_fdb_add(struct ksz_device *dev, int port, const unsigned char *addr, + u16 vid, struct dsa_db db) +{ + return ksz8_add_sta_mac(dev, port, addr, vid); +} + +int ksz8_fdb_del(struct ksz_device *dev, int port, const unsigned char *addr, + u16 vid, struct dsa_db db) +{ + return ksz8_del_sta_mac(dev, port, addr, vid); +} + int ksz8_port_vlan_filtering(struct ksz_device *dev, int port, bool flag, struct netlink_ext_ack *extack) { diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 93131347ad98..6e19ad70c671 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -200,6 +200,8 @@ static const struct ksz_dev_ops ksz8_dev_ops = { .freeze_mib = ksz8_freeze_mib, .port_init_cnt = ksz8_port_init_cnt, .fdb_dump = ksz8_fdb_dump, + .fdb_add = ksz8_fdb_add, + .fdb_del = ksz8_fdb_del, .mdb_add = ksz8_mdb_add, .mdb_del = ksz8_mdb_del, .vlan_filtering = ksz8_port_vlan_filtering, -- 2.39.2