From patchwork Wed Apr 9 12:53:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yegor Yefremov X-Patchwork-Id: 337839 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EBA6F140165 for ; Wed, 9 Apr 2014 22:54:16 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933109AbaDIMyM (ORCPT ); Wed, 9 Apr 2014 08:54:12 -0400 Received: from hhlx01.visionsystems.de ([62.145.30.242]:50056 "EHLO mail.visionsystems.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932597AbaDIMyK (ORCPT ); Wed, 9 Apr 2014 08:54:10 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.visionsystems.de (Postfix) with ESMTP id 492EA2E31A4; Wed, 9 Apr 2014 14:54:08 +0200 (CEST) Received: from mail.visionsystems.de ([127.0.0.1]) by localhost (mail.visionsystems.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03775-07; Wed, 9 Apr 2014 14:53:54 +0200 (CEST) Received: from visionsystems.de (kallisto.visionsystems.local [192.168.1.3]) by mail.visionsystems.de (Postfix) with ESMTP id C2E0E2E31A3; Wed, 9 Apr 2014 14:53:54 +0200 (CEST) Received: from development1.visionsystems.local ([192.168.1.36]) by visionsystems.de with Microsoft SMTPSVC(6.0.3790.4675); Wed, 9 Apr 2014 14:53:54 +0200 From: yegorslists@googlemail.com To: netdev@vger.kernel.org Cc: Yegor Yefremov , Mugunthan V N Subject: [PATCH v2] net: cpsw: fix dual_emac VLAN issue Date: Wed, 9 Apr 2014 14:53:43 +0200 Message-Id: <1397048023-10522-1-git-send-email-yegorslists@googlemail.com> X-Mailer: git-send-email 1.7.7 X-OriginalArrivalTime: 09 Apr 2014 12:53:54.0731 (UTC) FILETIME=[C3AFE7B0:01CF53F2] X-Virus-Scanned: amavisd-new at visionsystems.de Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Yegor Yefremov dual_emac mode was first introduced in TI's PSP kernel 3.2. See repository git://arago-project.org/git/projects/linux-am33x.git commit 6afa003a0b06a0376c941436b38204ba2edc4a98. Since commit d9ba8f9e6298af71ec1c1fd3d88c3ef68abd0ec3 dual_emac feature was upstreamed, but with some changes compared to the original source, that led to following behavior: Some stations in LAN don't answer CPSW's ARP request. PSP kernel 3.2 could talk to all stations in the same LAN. Use the same cpsw_ale_add_vlan procedure as in PSP kernel 3.2 to fix this regression. Signed-off-by: Yegor Yefremov CC: Mugunthan V N --- Changes: v2: make more detailed description drivers/net/ethernet/ti/cpsw.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 5d5fec6..aa06370 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1040,11 +1040,13 @@ static inline void cpsw_add_dual_emac_def_ale_entries( else slave_write(slave, slave->port_vlan, CPSW2_PORT_VLAN); cpsw_ale_add_vlan(priv->ale, slave->port_vlan, port_mask, - port_mask, port_mask, 0); + 0, port_mask, port_mask); cpsw_ale_add_mcast(priv->ale, priv->ndev->broadcast, port_mask, ALE_VLAN, slave->port_vlan, 0); cpsw_ale_add_ucast(priv->ale, priv->mac_addr, priv->host_port, ALE_VLAN, slave->port_vlan); + cpsw_ale_add_vlan(priv->ale, 0, ALE_ALL_PORTS << priv->host_port, + ALE_ALL_PORTS << priv->host_port, priv->host_port, 0); } static void soft_reset_slave(struct cpsw_slave *slave)