From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <tomaszx.kulasek@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id A1CADC56C
 for <dev@dpdk.org>; Wed, 24 Jun 2015 10:51:56 +0200 (CEST)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by fmsmga102.fm.intel.com with ESMTP; 24 Jun 2015 01:51:55 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.13,671,1427785200"; d="scan'208";a="752272964"
Received: from unknown (HELO Sent) ([10.217.248.134])
 by orsmga002.jf.intel.com with SMTP; 24 Jun 2015 01:51:53 -0700
Received: by Sent (sSMTP sendmail emulation); Wed, 24 Jun 2015 10:50:49 +0200
From: Tomasz Kulasek <tomaszx.kulasek@intel.com>
To: dev@dpdk.org
Date: Wed, 24 Jun 2015 10:50:45 +0200
Message-Id: <1435135845-7060-1-git-send-email-tomaszx.kulasek@intel.com>
X-Mailer: git-send-email 2.1.4
Subject: [dpdk-dev] [PATCH] bond: fix check initial link status of slave
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 24 Jun 2015 08:51:57 -0000

On Fortville NIC, link status change interrupt callback is not executed when
slave in bonding is (re-)started. It causes that slave's NIC is inactive even
if its link status is up on the start.

This patch invokes lsc callback, just after port's start, to check its initial
link status and manage properly. 

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 8bad2e1..277b310 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1357,6 +1357,11 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 		return -1;
 	}
 
+	/* If lsc interrupt is set, check initial slave's link status */
+	if (slave_eth_dev->driver->pci_drv.drv_flags & RTE_PCI_DRV_INTR_LSC)
+		bond_ethdev_lsc_event_callback(slave_eth_dev->data->port_id,
+				RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id);
+
 	return 0;
 }
 
-- 
1.7.9.5