From patchwork Fri Sep 25 12:48:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 263470 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=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, 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 3E60CC4741F for ; Fri, 25 Sep 2020 12:56:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E5AE22072E for ; Fri, 25 Sep 2020 12:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601038603; bh=fWYNtcngHJuvU1a3cM6H71y2c/P+qzD5aekwdd04quo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=16Cmoq8/ySrSHl2CB0EfMtJ9zInN0+HJKXdEb3mBdkkHY02UsIErzPzyJuHguD+9n ZL42TjK87CTxqFal8XK9lKWL6SqtvhywHhUKP70G4oVkBfBUqLWcd8raBuDKJDUCXT CE0QvT01LxMKhrU87rEKSiP6UpI0B1LV7oHzUBpU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729202AbgIYM4l (ORCPT ); Fri, 25 Sep 2020 08:56:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:56174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728796AbgIYMvn (ORCPT ); Fri, 25 Sep 2020 08:51:43 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C54F72072E; Fri, 25 Sep 2020 12:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601038302; bh=fWYNtcngHJuvU1a3cM6H71y2c/P+qzD5aekwdd04quo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fc7XFio1dcdrVbfUtcy87yRQgJj97W/PaKlWlqUG0NYzC8qebPNwGPHyOtKL765IC 3gWHXy4L29UtmNsXrI+0lmcUL3GpexU8xL3OkOA9QLNtbI2zneNAgSE5QbzJxi9bVu LrObbk42Di/K2w/DXxhmxsFIm3LJcTG56wKw4uwM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ido Schimmel , Vasundhara Volam , Jiri Pirko , Nikolay Aleksandrov , "David S. Miller" Subject: [PATCH 5.4 20/43] net: Fix bridge enslavement failure Date: Fri, 25 Sep 2020 14:48:32 +0200 Message-Id: <20200925124726.641830666@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200925124723.575329814@linuxfoundation.org> References: <20200925124723.575329814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ido Schimmel [ Upstream commit e1b9efe6baebe79019a2183176686a0e709388ae ] When a netdev is enslaved to a bridge, its parent identifier is queried. This is done so that packets that were already forwarded in hardware will not be forwarded again by the bridge device between netdevs belonging to the same hardware instance. The operation fails when the netdev is an upper of netdevs with different parent identifiers. Instead of failing the enslavement, have dev_get_port_parent_id() return '-EOPNOTSUPP' which will signal the bridge to skip the query operation. Other callers of the function are not affected by this change. Fixes: 7e1146e8c10c ("net: devlink: introduce devlink_compat_switch_id_get() helper") Signed-off-by: Ido Schimmel Reported-by: Vasundhara Volam Reviewed-by: Jiri Pirko Reviewed-by: Nikolay Aleksandrov Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/core/dev.c +++ b/net/core/dev.c @@ -8241,7 +8241,7 @@ int dev_get_port_parent_id(struct net_de if (!first.id_len) first = *ppid; else if (memcmp(&first, ppid, sizeof(*ppid))) - return -ENODATA; + return -EOPNOTSUPP; } return err;