From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) by dpdk.org (Postfix) with ESMTP id 747A32C60 for ; Tue, 9 Aug 2016 23:43:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1905; q=dns/txt; s=iport; t=1470778987; x=1471988587; h=from:to:cc:subject:date:message-id; bh=Cq2nczxRiG6ftDkBMi3RTPDwVjhS8HgXZuHoZMIWTPE=; b=ZMTUQX8bkyVH/mKMKEAU1MiLGNIyMrlAEU1Na0geE8dNw3On/gHEjlAt n0ufoqKm2ccDjJ2qYJQA3xPbabZ4UEwqga+HaSREDKT2H0HCwLtOYZ15C qgIGRYdZ62G9qCIme6NUpR/CJeOnh8vcuIkt2L3tdVcLkewi1Y9P1Mugh 8=; X-IronPort-AV: E=Sophos;i="5.28,496,1464652800"; d="scan'208";a="135931850" Received: from alln-core-7.cisco.com ([173.36.13.140]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Aug 2016 21:43:06 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-7.cisco.com (8.14.5/8.14.5) with ESMTP id u79Lh6GL023093; Tue, 9 Aug 2016 21:43:06 GMT Received: by cisco.com (Postfix, from userid 412739) id 374AC3FAAE2F; Tue, 9 Aug 2016 14:43:06 -0700 (PDT) From: Nelson Escobar To: dev@dpdk.org Cc: bruce.richardson@intel.com, Nelson Escobar Date: Tue, 9 Aug 2016 14:42:04 -0700 Message-Id: <1470778924-6794-1-git-send-email-neescoba@cisco.com> X-Mailer: git-send-email 2.7.0 Subject: [dpdk-dev] [PATCH] net/enic: move link checking init to probe time X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2016 21:43:07 -0000 The enic DMAs link status information to the host and this requires a little setup. This setup was being done as a result of calling rte_eth_dev_start(). But applications expect to be able to check link status before calling rte_eth_dev_start(). This patch moves he link status setup to enic_init() which is called at device probe time so that link status can be checked anytime. Fixes: fefed3d1e62c ("enic: new driver") Signed-off-by: Nelson Escobar Reviewed-by: John Daley --- drivers/net/enic/enic_main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index b4ca371..eb32ac1 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -430,7 +430,6 @@ int enic_enable(struct enic *enic) eth_dev->data->dev_link.link_speed = vnic_dev_port_speed(enic->vdev); eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX; - vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */ if (enic_clsf_init(enic)) dev_warning(enic, "Init of hash table for clsf failed."\ @@ -820,7 +819,6 @@ int enic_disable(struct enic *enic) } vnic_dev_set_reset_flag(enic->vdev, 1); - vnic_dev_notify_unset(enic->vdev); for (i = 0; i < enic->wq_count; i++) vnic_wq_clean(&enic->wq[i], enic_free_wq_buf); @@ -1022,6 +1020,9 @@ static void enic_dev_deinit(struct enic *enic) { struct rte_eth_dev *eth_dev = enic->rte_dev; + /* stop link status checking */ + vnic_dev_notify_unset(enic->vdev); + rte_free(eth_dev->data->mac_addrs); } @@ -1137,6 +1138,9 @@ static int enic_dev_init(struct enic *enic) vnic_dev_set_reset_flag(enic->vdev, 0); + /* set up link status checking */ + vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */ + return 0; } -- 2.7.0