Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2571020yba; Mon, 6 May 2019 08:09:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRal9DkScqiW5oQtEMXVhX9+TJ6hfrThMBfYInLZyWOCPuvd3rTwIqFFBGIByrlWq625tK X-Received: by 2002:aa7:8092:: with SMTP id v18mr33582129pff.35.1557155380243; Mon, 06 May 2019 08:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557155380; cv=none; d=google.com; s=arc-20160816; b=mEAPoCGfiQ936UHFTE2L1IK4HSgVClT0xcx4/zgyIR1l+HRwKjLh6fFiPLlrDQCNdn J756B/mxSsWuQH48WQhBaknmK1lSW8P4tf0tmMhTqpcbURcR93KyP52YVmX0pNHNkcUF 20pEnOeoPnNRKcnE8AmSMBzWlwrscV4BbNtPc+aCHTnaN3P8+tbSuyIJhhynPb8hwh/6 LnJvKWdJ+zPdlDOtFsOqCCdB2yjXZ64/WaY7PBXTpFzmUHz42iZtDMxWR7w2J9AjlVII 0GcqLNlAwcXEg6cWOzRBoGfOGO3VCpImzAp1KvckCMbYyiHn4c0jR69oS9KYgsOhAvve Cibg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+zu9DTSFgEkw5mbyvIJkko6ZxbmNveul0yUyRWDMO3A=; b=raczkXHAHRWv3ADu8mNIGMILDg3HDLE86x47aXKxah/g11mh4c+9Nad3QFoGRWgjUp Y6Kii+PZXXy+pJbygBDXP4+64jIokc1e4BPoX7wddMH/wkh8vIBdNhWhHwl+KOKvYS+A 5JzW9CgmIeZqVPQuKQvDMM/FSG2Sx3dCBN8rIDep3XnZisgPxiEwLGoIQOeuI/3+V0Je oAGviQQy6iQDEZaatiXFIxQkL9TjDAWBU3NJykUZ7LM8wayHreOe8hZqBCxfgg2xEc2Y bYyZq7Cju5uUUDDlDpcxht5ajtj6q+N7tBwlXwsWrX0+sIwYEX7Cn+ac7fXMyh4l8Of1 7b4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bhpOug18; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b18si15719258pgb.162.2019.05.06.08.09.23; Mon, 06 May 2019 08:09:40 -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=@kernel.org header.s=default header.b=bhpOug18; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727203AbfEFOgi (ORCPT + 99 others); Mon, 6 May 2019 10:36:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:56938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727178AbfEFOgd (ORCPT ); Mon, 6 May 2019 10:36:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 2E4E5204EC; Mon, 6 May 2019 14:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153392; bh=uRb8ykUe4lfq9vzpe4eOUZS8zfUF0zSisKB5pGNPltA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bhpOug18DdQw51jcxux5rX/Cp6R9t4PYYlI8TVBZCmOP2MEBvMTymLxeExVLC1m8c 5Ds7fvF6IP+UsCVNeMyAVf4fAMo93faj4Vd5DYJcH77uPBZ5JQP6S2HwWxdAyX+Om5 iR2ovtdU2u18Umyn7CspnBryN5jb6yBL5Cyd5TNY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yonglong Liu , "David S. Miller" , "Sasha Levin (Microsoft)" Subject: [PATCH 5.0 071/122] net: hns: fix ICMP6 neighbor solicitation messages discard problem Date: Mon, 6 May 2019 16:32:09 +0200 Message-Id: <20190506143101.315991526@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit f058e46855dcbc28edb2ed4736f38a71fd19cadb ] ICMP6 neighbor solicitation messages will be discard by the Hip06 chips, because of not setting forwarding pool. Enable promisc mode has the same problem. This patch fix the wrong forwarding table configs for the multicast vague matching when enable promisc mode, and add forwarding pool for the forwarding table. Signed-off-by: Yonglong Liu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin (Microsoft) --- .../ethernet/hisilicon/hns/hns_dsaf_main.c | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c index ac55db065f16..f5ff07cb2b72 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c @@ -2750,6 +2750,17 @@ int hns_dsaf_get_regs_count(void) return DSAF_DUMP_REGS_NUM; } +static int hns_dsaf_get_port_id(u8 port) +{ + if (port < DSAF_SERVICE_NW_NUM) + return port; + + if (port >= DSAF_BASE_INNER_PORT_NUM) + return port - DSAF_BASE_INNER_PORT_NUM + DSAF_SERVICE_NW_NUM; + + return -EINVAL; +} + static void set_promisc_tcam_enable(struct dsaf_device *dsaf_dev, u32 port) { struct dsaf_tbl_tcam_ucast_cfg tbl_tcam_ucast = {0, 1, 0, 0, 0x80}; @@ -2815,23 +2826,33 @@ static void set_promisc_tcam_enable(struct dsaf_device *dsaf_dev, u32 port) memset(&temp_key, 0x0, sizeof(temp_key)); mask_entry.addr[0] = 0x01; hns_dsaf_set_mac_key(dsaf_dev, &mask_key, mask_entry.in_vlan_id, - port, mask_entry.addr); + 0xf, mask_entry.addr); tbl_tcam_mcast.tbl_mcast_item_vld = 1; tbl_tcam_mcast.tbl_mcast_old_en = 0; - if (port < DSAF_SERVICE_NW_NUM) { - mskid = port; - } else if (port >= DSAF_BASE_INNER_PORT_NUM) { - mskid = port - DSAF_BASE_INNER_PORT_NUM + DSAF_SERVICE_NW_NUM; - } else { + /* set MAC port to handle multicast */ + mskid = hns_dsaf_get_port_id(port); + if (mskid == -EINVAL) { dev_err(dsaf_dev->dev, "%s,pnum(%d)error,key(%#x:%#x)\n", dsaf_dev->ae_dev.name, port, mask_key.high.val, mask_key.low.val); return; } + dsaf_set_bit(tbl_tcam_mcast.tbl_mcast_port_msk[mskid / 32], + mskid % 32, 1); + /* set pool bit map to handle multicast */ + mskid = hns_dsaf_get_port_id(port_num); + if (mskid == -EINVAL) { + dev_err(dsaf_dev->dev, + "%s, pool bit map pnum(%d)error,key(%#x:%#x)\n", + dsaf_dev->ae_dev.name, port_num, + mask_key.high.val, mask_key.low.val); + return; + } dsaf_set_bit(tbl_tcam_mcast.tbl_mcast_port_msk[mskid / 32], mskid % 32, 1); + memcpy(&temp_key, &mask_key, sizeof(mask_key)); hns_dsaf_tcam_mc_cfg_vague(dsaf_dev, entry_index, &tbl_tcam_data_mc, (struct dsaf_tbl_tcam_data *)(&mask_key), -- 2.20.1