From patchwork Mon Jun 15 10:47:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hiroshi Shimamoto X-Patchwork-Id: 484216 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 53A281401AD for ; Mon, 15 Jun 2015 20:49:51 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 996B3916CA; Mon, 15 Jun 2015 10:49:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ef+3l73vamdK; Mon, 15 Jun 2015 10:49:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id D930E9165E; Mon, 15 Jun 2015 10:49:49 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AA73D1C1567 for ; Mon, 15 Jun 2015 10:49:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9952291685 for ; Mon, 15 Jun 2015 10:49:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1fhH2Zw-svYT for ; Mon, 15 Jun 2015 10:49:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [210.143.35.51]) by whitealder.osuosl.org (Postfix) with ESMTPS id CAE3A9165E for ; Mon, 15 Jun 2015 10:49:47 +0000 (UTC) Received: from mailgate3.nec.co.jp ([10.7.69.192]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id t5FAnbw9010919; Mon, 15 Jun 2015 19:49:37 +0900 (JST) Received: from mailsv3.nec.co.jp (imss63.nec.co.jp [10.7.69.158]) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) with ESMTP id t5FAnbt10105; Mon, 15 Jun 2015 19:49:37 +0900 (JST) Received: from mail01b.kamome.nec.co.jp (mail01b.kamome.nec.co.jp [10.25.43.2]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id t5FAnbeO012193; Mon, 15 Jun 2015 19:49:37 +0900 (JST) Received: from bpxc99gp.gisp.nec.co.jp ([10.38.151.146] [10.38.151.146]) by mail01b.kamome.nec.co.jp with ESMTP id BT-MMP-674947; Mon, 15 Jun 2015 19:47:38 +0900 Received: from BPXM14GP.gisp.nec.co.jp ([169.254.1.74]) by BPXC18GP.gisp.nec.co.jp ([10.38.151.146]) with mapi id 14.03.0224.002; Mon, 15 Jun 2015 19:47:37 +0900 From: Hiroshi Shimamoto To: "Skidmore, Donald C" , "Rose, Gregory V" , "Kirsher, Jeffrey T" , "intel-wired-lan@lists.osuosl.org" Thread-Topic: [PATCH 1/3] ixgbevf: refactor ixgbevf_update_mc_addr_list_vf Thread-Index: AdCnWJ3y71L32+YKQneR6kw1T1rSEQ== Date: Mon, 15 Jun 2015 10:47:36 +0000 Message-ID: <7F861DC0615E0C47A872E6F3C5FCDDBD05EDEFA0@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 1/3] ixgbevf: refactor ixgbevf_update_mc_addr_list_vf 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 Add ixgbevf_request_mc_promisc_vf which is for request VF multicast promiscuous mode, and move the codes from ixgbevf_update_mc_addr_list_vf. Signed-off-by: Hiroshi Shimamoto --- drivers/net/ethernet/intel/ixgbevf/vf.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c index b5aac76..89aecd0 100644 --- a/drivers/net/ethernet/intel/ixgbevf/vf.c +++ b/drivers/net/ethernet/intel/ixgbevf/vf.c @@ -426,6 +426,24 @@ static void ixgbevf_write_msg_read_ack(struct ixgbe_hw *hw, mbx->ops.read_posted(hw, retmsg, size); } +static s32 ixgbevf_request_mc_promisc_vf(struct ixgbe_hw *hw) +{ + struct ixgbevf_adapter *adapter = hw->back; + u32 msgbuf[IXGBE_VFMAILBOX_SIZE]; + + dev_info(&adapter->pdev->dev, "Request MC PROMISC\n"); + + memset(msgbuf, 0, sizeof(msgbuf)); + + /* enabling multicast promiscuous */ + msgbuf[0] = IXGBE_VF_SET_MC_PROMISC; + msgbuf[1] = 1; + + ixgbevf_write_msg_read_ack(hw, msgbuf, 2); + + return 0; +} + /** * ixgbevf_update_mc_addr_list_vf - Update Multicast addresses * @hw: pointer to the HW structure @@ -457,18 +475,9 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, */ if (hw->api_version == ixgbe_mbox_api_12) { if (!hw->mac.mc_promisc) { - struct ixgbevf_adapter *adapter = hw->back; - - dev_info(&adapter->pdev->dev, "Request MC PROMISC\n"); - - /* enabling multicast promiscuous */ - msgbuf[0] = IXGBE_VF_SET_MC_PROMISC; - msgbuf[1] = 1; - ixgbevf_write_msg_read_ack(hw, msgbuf, 2); - + ixgbevf_request_mc_promisc_vf(hw); hw->mac.mc_promisc = true; } - return 0; } cnt = 30;