From patchwork Fri Jul 15 12:58:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 9232033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7948B6075D for ; Fri, 15 Jul 2016 13:07:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69DED27FA4 for ; Fri, 15 Jul 2016 13:07:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57D6C28324; Fri, 15 Jul 2016 13:07:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EADA127FA4 for ; Fri, 15 Jul 2016 13:07:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bO2oi-0007d8-AH; Fri, 15 Jul 2016 13:06:08 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bO2j2-000076-CO for linux-arm-kernel@lists.infradead.org; Fri, 15 Jul 2016 13:00:17 +0000 Received: by mail-pf0-x241.google.com with SMTP id g202so6371635pfb.1 for ; Fri, 15 Jul 2016 06:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9ot6qwWoKqRvD2jldAhejVuIKkv0cNVVZhPzwRjeVzw=; b=W+gQZ4PplfE5mFHJGVilBHJO6FJG/JJGYIfWk5od5fl5UJM8uy6YlUAzBwVc3NPsO7 KcCnruRaE+aTCShuDH6d5y1KjqK4qW697ohtWBDIkZJZ+BwzFCfWYz504cseQQVNV9yj B5jfGK5TGj9prvns94YlJ7Ar0xmHuUBTc8Swv3orUGo7IKkT6yycfxkBAUpmmKEdd7EC c7qaGT78VDwe9ziP7h5Dz3fWq+ftnH/sUlx3mMrFx6Kllg0FErw1zeTbIy1ww/mkJCFW hQMXpDMcJO6j8kOROa47VKZh6UgOVVemCbhgl/lXDU+auPK0HhWNYJfMTuGGKHLT2BVO PN7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9ot6qwWoKqRvD2jldAhejVuIKkv0cNVVZhPzwRjeVzw=; b=acI3JG+9WrwPbl7EcL6lYuK9aRBxQYtVL0Z8WB9e0WJCTYdQUH+jiSIoICXL7f5Xkj UNlEorD2+Mc8Po9q0hRdgbK1cOWtn0q11TJsatVJrp/luKTC8Ldnt2F4oQLHRriLMEc8 6GHH0U8EPRR8Z/VvrOG6UdUhDM+0r+gBTq3nxW56dKKWlIYRwbAx2m4pevAP+YvrW8rf ZWAHaqQfDZEMv65ZWz2P9+TjqgfWf47rnW6dyu2NQDX/lrKLjBmKsp6vOvazCjT4Za5b NHPxqrnHVb7AgMkpGEt3SE1FmTt2nJtMJIDFCTdT2E/lPIgW1CxX/ZeHZgscNcaA+dyl kZ1g== X-Gm-Message-State: ALyK8tL7f5p9fz4SeUTBYYLC4whNCpipp1vhmCa2GCo7YrqrG8HoiPpyCWdmRpIUYLfA6Q== X-Received: by 10.98.130.137 with SMTP id w131mr21387091pfd.5.1468587600013; Fri, 15 Jul 2016 06:00:00 -0700 (PDT) Received: from machine421.in.caveonetworks.com ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id t80sm5365880pfj.38.2016.07.15.05.59.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Jul 2016 05:59:59 -0700 (PDT) From: sunil.kovvuri@gmail.com To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 15/15] net: thunderx: Don't set mac address for secondary Qset VFs Date: Fri, 15 Jul 2016 18:28:20 +0530 Message-Id: <1468587500-32103-16-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468587500-32103-1-git-send-email-sunil.kovvuri@gmail.com> References: <1468587500-32103-1-git-send-email-sunil.kovvuri@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160715_060016_520203_7848AEC8 X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sunil Goutham MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sunil Goutham Set MAC addresses only for primary VF's and don't for secondary VFs. Signed-off-by: Sunil Goutham --- drivers/net/ethernet/cavium/thunder/nic_main.c | 2 +- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/nic_main.c b/drivers/net/ethernet/cavium/thunder/nic_main.c index 476eaea..74bb811 100644 --- a/drivers/net/ethernet/cavium/thunder/nic_main.c +++ b/drivers/net/ethernet/cavium/thunder/nic_main.c @@ -174,7 +174,7 @@ static void nic_mbx_send_ready(struct nicpf *nic, int vf) mbx.nic_cfg.tns_mode = NIC_TNS_BYPASS_MODE; - if (vf < MAX_LMAC) { + if (vf < nic->num_vf_en) { bgx_idx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]); lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]); diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index 300416a..4a084ab 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -1209,7 +1209,7 @@ int nicvf_open(struct net_device *netdev) } /* Check if we got MAC address from PF or else generate a radom MAC */ - if (is_zero_ether_addr(netdev->dev_addr)) { + if (!nic->sqs_mode && is_zero_ether_addr(netdev->dev_addr)) { eth_hw_addr_random(netdev); nicvf_hw_set_mac_addr(nic, netdev); }