From patchwork Wed Oct 8 21:23:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 397809 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 AC7771400B5 for ; Thu, 9 Oct 2014 08:28:39 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755350AbaJHVXc (ORCPT ); Wed, 8 Oct 2014 17:23:32 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57829 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755280AbaJHVXa (ORCPT ); Wed, 8 Oct 2014 17:23:30 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B6B67AD35; Wed, 8 Oct 2014 21:23:27 +0000 (UTC) From: Alexander Graf To: Jeff Kirsher Cc: "David S. Miller" , netdev@vger.kernel.org, Mitch Williams , Andy Gospodarek , Stefan Assmann , Aaron Brown , Greg Rose , John Ronciak Subject: [PATCH] igb: Indicate failure on vf reset for empty mac address Date: Wed, 8 Oct 2014 23:23:27 +0200 Message-Id: <1412803407-10621-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.8.1.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit 5ac6f91d changed the igb driver to expose a zero (empty) mac address to the VF on reset rather than a random one. However, that behavioral change also requires igbvf driver changes which can be hard especially when we want to talk to proprietary guest OSs. Looking at the code previous to the commit in Linux that made igbvf work with empty mac addresses (8d56b6d), we can see that on reset failure the driver will try to generate a new mac address with both the old and the new code. Furthermore, ixgbe does send reset failure when it detects an empty mac address (35055928c). So I think it's safe to make igb behave the same. With this patch I can successfully run a Windows 8.1 guest with an empty mac address and an assigned igbvf device that has no mac address set by the host. If anyone is aware of a guest driver that chokes on NACK returns of VF RESET commands, please speak up. Signed-off-by: Alexander Graf --- drivers/net/ethernet/intel/igb/igb_main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index cb14bbd..e8c53b6 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -6024,8 +6024,12 @@ static void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf) adapter->vf_data[vf].flags |= IGB_VF_FLAG_CTS; /* reply to reset with ack and vf mac address */ - msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_ACK; - memcpy(addr, vf_mac, ETH_ALEN); + if (!is_zero_ether_addr(vf_mac)) { + msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_ACK; + memcpy(addr, vf_mac, ETH_ALEN); + } else { + msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_NACK; + } igb_write_mbx(hw, msgbuf, 3, vf); }