From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com ([74.125.82.65]:52341 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbeB0WiX (ORCPT ); Tue, 27 Feb 2018 17:38:23 -0500 Received: by mail-wm0-f65.google.com with SMTP id t3so1512794wmc.2 for ; Tue, 27 Feb 2018 14:38:23 -0800 (PST) Subject: Re: [PATCH net-next 06/11] ipmr, ip6mr: Make mfc_cache a common structure To: Yuval Mintz , netdev@vger.kernel.org Cc: mlxsw@mellanox.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org References: <1519757908-32863-1-git-send-email-yuvalm@mellanox.com> <1519757908-32863-7-git-send-email-yuvalm@mellanox.com> From: Nikolay Aleksandrov Message-ID: <25be1f39-a85d-ee16-5f72-76f4b539f07f@cumulusnetworks.com> Date: Wed, 28 Feb 2018 00:38:20 +0200 MIME-Version: 1.0 In-Reply-To: <1519757908-32863-7-git-send-email-yuvalm@mellanox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On 27/02/18 20:58, Yuval Mintz wrote: > mfc_cache and mfc6_cache are almost identical - the main difference is > in the origin/group addresses and comparison-key. Make a common > structure encapsulating most of the multicast routing logic - mr_mfc > and convert both ipmr and ip6mr into using it. > > For easy conversion [casting, in this case] mr_mfc has to be the first > field inside every multicast routing abstraction utilizing it. > > Signed-off-by: Yuval Mintz > --- > drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c | 21 +- > include/linux/mroute.h | 45 +--- > include/linux/mroute6.h | 23 +-- > include/linux/mroute_base.h | 45 ++++ > net/ipv4/ipmr.c | 234 +++++++++++---------- > net/ipv6/ip6mr.c | 241 +++++++++++----------- > 6 files changed, 312 insertions(+), 297 deletions(-) > I feel uneasy about these casts all over the place, anyway functionally the patch looks fine. Acked-by: Nikolay Aleksandrov