From patchwork Mon Jun 15 10:48:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hiroshi Shimamoto X-Patchwork-Id: 484220 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 9DB75140216 for ; Mon, 15 Jun 2015 20:51:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D5F7B32933; Mon, 15 Jun 2015 10:51:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gf9+F0G8QTRT; Mon, 15 Jun 2015 10:51:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id C442832912; Mon, 15 Jun 2015 10:51:30 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 552081C1567 for ; Mon, 15 Jun 2015 10:51:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4DD69A2996 for ; Mon, 15 Jun 2015 10:51:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p6VNc_Ofr1w6 for ; Mon, 15 Jun 2015 10:51:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [210.143.35.52]) by fraxinus.osuosl.org (Postfix) with ESMTPS id A44D7A28CC for ; Mon, 15 Jun 2015 10:51:22 +0000 (UTC) Received: from mailgate3.nec.co.jp ([10.7.69.192]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id t5FAod30008205; Mon, 15 Jun 2015 19:50:39 +0900 (JST) Received: from mailsv4.nec.co.jp (imss61.nec.co.jp [10.7.69.156]) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) with ESMTP id t5FAoct10712; Mon, 15 Jun 2015 19:50:39 +0900 (JST) Received: from mail03.kamome.nec.co.jp (mail03.kamome.nec.co.jp [10.25.43.7]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id t5FAocKo022007; Mon, 15 Jun 2015 19:50:38 +0900 (JST) Received: from bpxc99gp.gisp.nec.co.jp ([10.38.151.145] [10.38.151.145]) by mail01b.kamome.nec.co.jp with ESMTP id BT-MMP-674971; Mon, 15 Jun 2015 19:48:58 +0900 Received: from BPXM14GP.gisp.nec.co.jp ([169.254.1.74]) by BPXC17GP.gisp.nec.co.jp ([10.38.151.145]) with mapi id 14.03.0224.002; Mon, 15 Jun 2015 19:48:57 +0900 From: Hiroshi Shimamoto To: "Skidmore, Donald C" , "Rose, Gregory V" , "Kirsher, Jeffrey T" , "intel-wired-lan@lists.osuosl.org" Thread-Topic: [PATCH 3/3] ixgbe: ping to reset on changing trust status Thread-Index: AdCnWMsXM9qNPgwOQI2OeVAbYdNsLg== Date: Mon, 15 Jun 2015 10:48:57 +0000 Message-ID: <7F861DC0615E0C47A872E6F3C5FCDDBD05EDEFDD@BPXM14GP.gisp.nec.co.jp> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.205.5.123] MIME-Version: 1.0 Cc: "nhorman@redhat.com" , "jogreene@redhat.com" , Linux Netdev List , "Choi, Sy Jong" , Rony Efraim , Or Gerlitz , Edward Cree , David Miller , "sassmann@redhat.com" Subject: [Intel-wired-lan] [PATCH 3/3] ixgbe: ping to reset on changing trust status X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" From: Hiroshi Shimamoto Send a ping to reset VF on changing the status of trusting. VF driver will reconfigure its features on reset. Signed-off-by: Hiroshi Shimamoto --- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c index 5eb3108..7bb9926 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c @@ -1212,18 +1212,23 @@ void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter) IXGBE_WRITE_REG(hw, IXGBE_VFRE(1), 0); } -void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter) +static void ixgbe_ping_vf(struct ixgbe_adapter *adapter, int vf) { struct ixgbe_hw *hw = &adapter->hw; u32 ping; + + ping = IXGBE_PF_CONTROL_MSG; + if (adapter->vfinfo[vf].clear_to_send) + ping |= IXGBE_VT_MSGTYPE_CTS; + ixgbe_write_mbx(hw, &ping, 1, vf); +} + +void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter) +{ int i; - for (i = 0 ; i < adapter->num_vfs; i++) { - ping = IXGBE_PF_CONTROL_MSG; - if (adapter->vfinfo[i].clear_to_send) - ping |= IXGBE_VT_MSGTYPE_CTS; - ixgbe_write_mbx(hw, &ping, 1, i); - } + for (i = 0 ; i < adapter->num_vfs; i++) + ixgbe_ping_vf(adapter, i); } int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) @@ -1517,7 +1522,11 @@ int ixgbe_ndo_set_vf_trust(struct net_device *netdev, int vf, bool setting) adapter->vfinfo[vf].trusted = setting; - /* TODO: reset to reconfigure features */ + /* reset VF to reconfigure features */ + adapter->vfinfo[vf].clear_to_send = false; + ixgbe_ping_vf(adapter, vf); + + e_info(drv, "VF %u is %strusted\n", vf, setting ? "" : "not "); return 0; }