Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3214687imm; Fri, 10 Aug 2018 05:49:21 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw3fGgZXQlZz0yEE5fxo829Z3c/uxVYHjJmSyH4Hd7sI3CJTxO21VPqILvpAXEFiPDD4As6 X-Received: by 2002:a17:902:a713:: with SMTP id w19-v6mr6006594plq.271.1533905361358; Fri, 10 Aug 2018 05:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533905361; cv=none; d=google.com; s=arc-20160816; b=aEMJ9EJiJH+Q6tjtKqVs4F00q5NLlTBlsqH+LNC1eHhrcR1pSX4cbxQM4p507KMkZh FrNCf9xKHl5Lby9jkezGzffUUWgKkqpisSehNIRNfAtvSlXK3BBIBFhKvBzrUFWBXREs Oxt6xoAi+KkYTrlSCNJsiGQNpq7UXmif5R/GDmLEMBooo9TZwGX0FLEfng5YYvw5nLU1 F4g+KuF3+iK9/hEkX/vmSb+FnfuS/Hn7TXQzKrY2JHV+Mi5xIRMyp3fOPh2wQNsRPIHz se8qtaJ/YzGXaDuRGlo9QQrBbcnH4ORmwCWPf53U3TMK9Ov3wnLJZ9DQjGs9JRDce7Mv daxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=V6hmd09XYpCGXiuhvOsp9DvV/Bv2s+eIOM1qddmcKlA=; b=VNHQA5Xgb0D+RZqfuihDuBGAzV7PkQ1i7fYNLwdQqexGomMLiikMoxXa1jSVv6qCxS pHidv6+7loCW/xg9+wvNYlgvdpX00LqTlo+xzFUGWMhK2MwoI2beEbEcsTpKWrQmE0Wv RCXilQNk8IeV9dFQDqEeDixgDJlaqqXVAxtyT0BZ6ToKNDcxVgb5Xesh3b/YxNRiWiz5 N83vXZJUgcjIZnfk3ofyOCFvA5zxjTdAg8Qz/skE/Mw84UXyLSmW/uZ2gMyuW41kW+O6 SPridr5R69/S1lLHzwJpzfdGFPo0nYkE18CvUm7z0rYo8W+orG8L4bFodV0Bon/MzEG8 VRzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="FFp/WRu+"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1-v6si7193921pfh.63.2018.08.10.05.49.06; Fri, 10 Aug 2018 05:49:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="FFp/WRu+"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728214AbeHJPRJ (ORCPT + 99 others); Fri, 10 Aug 2018 11:17:09 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:34885 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728083AbeHJPRJ (ORCPT ); Fri, 10 Aug 2018 11:17:09 -0400 Received: by mail-lj1-f195.google.com with SMTP id p10-v6so7112348ljg.2 for ; Fri, 10 Aug 2018 05:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=V6hmd09XYpCGXiuhvOsp9DvV/Bv2s+eIOM1qddmcKlA=; b=FFp/WRu+t+oYQsOuluFJ1lNh743K69Nyj2sGogRbZEY//48Lk92pasBpLUbkujQcp2 YXGV36K9+aPkTb1//CchS6jdiJ4skHp5VfbyphKKW6V0H2wsCg2AYRZWgQ/fOSXpwFPK 2hsMwDwiE+kGZyhO58WEKVq9DKTNYzEN4d7Mo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=V6hmd09XYpCGXiuhvOsp9DvV/Bv2s+eIOM1qddmcKlA=; b=nK6S6H+7RsC0SqabjFsYNuPhCwtC6OYyKhJB3DskO+iNrfupidcn8XyGcTkwemuisA TPjdwmAHRDYx408ohRezDAFSD9Rb8myL8IiI1pJyMWuaOJgbRBxGba9djtb5+WqYcn4h HRuuzLon6/V/gzYcQ0uRfHmOpB3Hv9CCQ0yj8h9MLgqWcFNZ/AEk4RYqWJGSjlGC0lcw iyYfRWUFzca8ysaXvEmOWrxcPX/F81x5CciHEXXI84hIgh+wFZi4no4u6LodLSPIwkvF YMIV6kDZEL8mUakfzLRnFHzsugbW7qEQCmvoH/mKiAWqRAnc9z8IL3YwJj0sxbf8+CFU dgtg== X-Gm-Message-State: AOUpUlGN4grKWUdJo/nIyOD6c77T41S7VLdsy9HzJlkiKXjViHluN4Zn yCLb28XvrD0XRllRfuinQzWybA== X-Received: by 2002:a2e:8617:: with SMTP id a23-v6mr4985207lji.43.1533905241225; Fri, 10 Aug 2018 05:47:21 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id 84-v6sm1626382lje.48.2018.08.10.05.47.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 05:47:20 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com, davem@davemloft.net Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH 1/2] net: ethernet: ti: cpsw: clear all entries when delete vid Date: Fri, 10 Aug 2018 15:47:08 +0300 Message-Id: <20180810124709.25089-2-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180810124709.25089-1-ivan.khoronzhuk@linaro.org> References: <20180810124709.25089-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In cases if some of the entries were not found in forwarding table while killing vlan, the rest not needed entries still left in the table. No need to stop, as entry was deleted anyway. So fix this by returning error only after all was cleaned. To implement this, return -ENOENT in cpsw_ale_del_mcast() as it's supposed to be. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 14 ++++---------- drivers/net/ethernet/ti/cpsw_ale.c | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 358edab9e72e..9edac671f276 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -2125,16 +2125,10 @@ static int cpsw_ndo_vlan_rx_kill_vid(struct net_device *ndev, dev_info(priv->dev, "removing vlanid %d from vlan filter\n", vid); ret = cpsw_ale_del_vlan(cpsw->ale, vid, 0); - if (ret != 0) - return ret; - - ret = cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr, - HOST_PORT_NUM, ALE_VLAN, vid); - if (ret != 0) - return ret; - - ret = cpsw_ale_del_mcast(cpsw->ale, priv->ndev->broadcast, - 0, ALE_VLAN, vid); + ret |= cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr, + HOST_PORT_NUM, ALE_VLAN, vid); + ret |= cpsw_ale_del_mcast(cpsw->ale, priv->ndev->broadcast, + 0, ALE_VLAN, vid); pm_runtime_put(cpsw->dev); return ret; } diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c index 93dc05c194d3..5766225a4ce1 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.c +++ b/drivers/net/ethernet/ti/cpsw_ale.c @@ -394,7 +394,7 @@ int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask, idx = cpsw_ale_match_addr(ale, addr, (flags & ALE_VLAN) ? vid : 0); if (idx < 0) - return -EINVAL; + return -ENOENT; cpsw_ale_read(ale, idx, ale_entry); -- 2.17.1