From patchwork Wed Jul 13 05:59:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 9226867 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 E6FC860868 for ; Wed, 13 Jul 2016 06:05:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7C262787D for ; Wed, 13 Jul 2016 06:05:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC50627C38; Wed, 13 Jul 2016 06:05:28 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 8B6BD2787D for ; Wed, 13 Jul 2016 06:05:28 +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 1bNDH9-0006dC-VF; Wed, 13 Jul 2016 06:04:03 +0000 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bNDEI-0002Q0-Mc for linux-arm-kernel@lists.infradead.org; Wed, 13 Jul 2016 06:01:10 +0000 Received: by mail-pa0-x242.google.com with SMTP id ib6so2396078pad.3 for ; Tue, 12 Jul 2016 23:00:46 -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=wmGot1WtcLZyF7FAMGFQeJZusRU2GIFA09KH+rFG1Dk=; b=EG89bd47wi2sDBuQfhsWDIQ1/H0aY7ZjqK0jcCcuJ2mf63EcxmgVs5Wt9eeisPEOW2 D/fC05vOtAgZM2sTtCLpndwSsMMaZ8oHvSMX/+YipIg4sqNeYSJQSWb+hDS3KV42LCvW luRLvUhiJgOdEJXC+NAMxDx/g2EO/2ydvHsFx2eFxpvgPJvGmIRJZWOq4b2+j0pPNtHJ vH/lmTOaNtFIm6tpu2TH8IpRbDPgZvyd+CToE7Y1kbtNFTcSMwBIaJvKwFR/wfJkrjwy 5wuUgJLMaOlCwUUqIR7h9DKRgVXCvH1K4qJVZWSMDvUu5XJn0nmkTiZRh9QMhr4fsuN2 5iRw== 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=wmGot1WtcLZyF7FAMGFQeJZusRU2GIFA09KH+rFG1Dk=; b=BuDa8ppNNhZxdxMFQStorysRN5i4tCoux9XOEDMtLHbJbHSLy4jPEkRXfsF5mZ65FY K/Ii/tV16Ix/27aLT1IoXm6GvpVp+V0Ds5VokjRhl63muyEUFjXIicPJDJgGLXj48kmk k1AzTT0+iMTlDe4Wcllyw4FBEEA1cEYq6BR2Lj+wX4Y9urWKf34wgEAMm/WXsi/kiVpw tjAT2MTls4+edP8oLfCnbTQZJUZDbUCf1WnAF38K03+m74Mh3JR1+d5WJD3amAbkJQOJ R3AZF3GCepylECnLQ0h1ZH42omLrilnNdX/ZW4A6ZuoIGJBnFSDwBXnMP49Kptxr21AN Z66g== X-Gm-Message-State: ALyK8tIFNUYYcBhN3GD5z5mG1fj7o7qnZUhxbbuYOC0+Y31vgj4oXrmFY/tJ/aBP1QWZEg== X-Received: by 10.66.255.7 with SMTP id am7mr10672138pad.75.1468389646235; Tue, 12 Jul 2016 23:00:46 -0700 (PDT) Received: from machine421.in.caveonetworks.com ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id su7sm1634700pab.44.2016.07.12.23.00.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jul 2016 23:00:45 -0700 (PDT) From: sunil.kovvuri@gmail.com To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 15/15] net: thunderx: Don't set mac address for secondary Qset VFs Date: Wed, 13 Jul 2016 11:29:39 +0530 Message-Id: <1468389579-482-16-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468389579-482-1-git-send-email-sunil.kovvuri@gmail.com> References: <1468389579-482-1-git-send-email-sunil.kovvuri@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160712_230107_098518_BBA5710F X-CRM114-Status: GOOD ( 12.97 ) 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 255821d..dfa27de 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); }