From patchwork Sun May 23 03:29:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Feldman X-Patchwork-Id: 53299 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 3FC2DB7D45 for ; Sun, 23 May 2010 13:30:05 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754347Ab0EWD37 (ORCPT ); Sat, 22 May 2010 23:29:59 -0400 Received: from sj-iport-4.cisco.com ([171.68.10.86]:4913 "EHLO sj-iport-4.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754166Ab0EWD36 (ORCPT ); Sat, 22 May 2010 23:29:58 -0400 Authentication-Results: sj-iport-4.cisco.com; dkim=neutral (message not signed) header.i=none X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhoFAJ89+EurR7Ht/2dsb2JhbACDF45ljBVxoxiIe49jgSWDBGoEg0E X-IronPort-AV: E=Sophos;i="4.53,284,1272844800"; d="scan'208";a="133602386" Received: from sj-core-1.cisco.com ([171.71.177.237]) by sj-iport-4.cisco.com with ESMTP; 23 May 2010 03:29:58 +0000 Received: from savbu-pc100.cisco.com (savbu-pc100.cisco.com [10.193.164.29]) by sj-core-1.cisco.com (8.13.8/8.14.3) with ESMTP id o4N3Tw4a007709; Sun, 23 May 2010 03:29:58 GMT From: Scott Feldman Subject: [net-next-2.6 PATCH 2/2] enic: Use random mac addr when associating port-profile To: davem@davemloft.net Cc: netdev@vger.kernel.org, chrisw@redhat.com Date: Sat, 22 May 2010 20:29:58 -0700 Message-ID: <20100523032957.20200.59700.stgit@savbu-pc100.cisco.com> In-Reply-To: <20100523032952.20200.30148.stgit@savbu-pc100.cisco.com> References: <20100523032952.20200.30148.stgit@savbu-pc100.cisco.com> User-Agent: StGIT/0.12.1 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Scott Feldman Use random mac addr for interface when associating port-profile to dynamic enic device, in the case no mac addr was previous assigned. Signed-off-by: Scott Feldman --- drivers/net/enic/enic_main.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 7e97323..6586b5c 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -1132,6 +1132,14 @@ static int enic_set_vf_port(struct net_device *netdev, int vf, switch (request) { case PORT_REQUEST_ASSOCIATE: + /* If the interface mac addr hasn't been assigned, + * assign a random mac addr before setting port- + * profile. + */ + + if (is_zero_ether_addr(netdev->dev_addr)) + random_ether_addr(netdev->dev_addr); + if (port[IFLA_PORT_PROFILE]) name = nla_data(port[IFLA_PORT_PROFILE]);