From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nbfkord-smmo01.seg.att.com (nbfkord-smmo01.seg.att.com [209.65.160.76]) by dpdk.org (Postfix) with ESMTP id 2BD574CC5 for ; Tue, 29 Nov 2016 17:20:52 +0100 (CET) Received: from unknown [12.187.104.26] (EHLO nbfkord-smmo01.seg.att.com) by nbfkord-smmo01.seg.att.com(mxl_mta-7.2.4-7) with ESMTP id 4eaad385.2b3ec6ab0940.83575.00-2495.173887.nbfkord-smmo01.seg.att.com (envelope-from ); Tue, 29 Nov 2016 16:20:52 +0000 (UTC) X-MXL-Hash: 583daae4139b6e3b-1947a77589b5472eef26f2f234a497a9eef831a6 Received: from unknown [12.187.104.26] by nbfkord-smmo01.seg.att.com(mxl_mta-7.2.4-7) with SMTP id fdaad385.0.83424.00-2380.173784.nbfkord-smmo01.seg.att.com (envelope-from ); Tue, 29 Nov 2016 16:20:48 +0000 (UTC) X-MXL-Hash: 583daae01bc81216-668a9e458897af71a821e9578c8a8df399ba54fb Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Tue, 29 Nov 2016 08:20:25 -0800 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25 via Frontend Transport; Tue, 29 Nov 2016 08:20:25 -0800 Received: from uklogin.uk.solarflarecom.com (uklogin.uk.solarflarecom.com [10.17.10.10]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id uATGKO7H029991; Tue, 29 Nov 2016 16:20:24 GMT Received: from uklogin.uk.solarflarecom.com (localhost.localdomain [127.0.0.1]) by uklogin.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id uATGKM1f021233; Tue, 29 Nov 2016 16:20:24 GMT From: Andrew Rybchenko To: CC: Date: Tue, 29 Nov 2016 16:19:05 +0000 Message-ID: <1480436367-20749-34-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1480436367-20749-1-git-send-email-arybchenko@solarflare.com> References: <1479740470-6723-1-git-send-email-arybchenko@solarflare.com> <1480436367-20749-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-AnalysisOut: [v=2.1 cv=UoJlQrEB c=1 sm=1 tr=0 a=8BlWFWvVlq5taO8ncb8nKg==] X-AnalysisOut: [:17 a=L24OOQBejmoA:10 a=zRKbQ67AAAAA:8 a=XGGawuPn1W7cvlOXp] X-AnalysisOut: [WkA:9 a=PA03WX8tBzeizutn5_OT:22] X-Spam: [F=0.3581424011; CM=0.500; S=0.358(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [12.187.104.26] Subject: [dpdk-dev] [PATCH v2 33/55] net/sfc: add device configuration checks 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, 29 Nov 2016 16:20:53 -0000 Manual link speed/duplex configuration is not supported yet. Loopback is not supported yet. Flow Director is not supported. Link status change notification using interrupt is not supported yet. Receive data notification using interrupts is not supported yet. Reviewed-by: Andy Moreton Signed-off-by: Andrew Rybchenko --- doc/guides/nics/sfc_efx.rst | 14 ++++++++++++ drivers/net/sfc/sfc.c | 55 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst index 2eebcd7..31e86a7 100644 --- a/doc/guides/nics/sfc_efx.rst +++ b/doc/guides/nics/sfc_efx.rst @@ -37,6 +37,20 @@ More information can be found at `Solarflare Communications website `_. +Non-supported Features +---------------------- + +The features not yet supported include: + +- Link status change interrupt + +- Receive queue interupts + +- Priority-based flow control + +- Loopback + + Supported NICs -------------- diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c index cbb14d7..befe68d 100644 --- a/drivers/net/sfc/sfc.c +++ b/drivers/net/sfc/sfc.c @@ -82,9 +82,55 @@ sfc_dma_free(const struct sfc_adapter *sa, efsys_mem_t *esmp) memset(esmp, 0, sizeof(*esmp)); } +/* + * Check requested device level configuration. + * Receive and transmit configuration is checked in corresponding + * modules. + */ +static int +sfc_check_conf(struct sfc_adapter *sa) +{ + const struct rte_eth_conf *conf = &sa->eth_dev->data->dev_conf; + int rc = 0; + + if (conf->link_speeds != ETH_LINK_SPEED_AUTONEG) { + sfc_err(sa, "Manual link speed/duplex choice not supported"); + rc = EINVAL; + } + + if (conf->lpbk_mode != 0) { + sfc_err(sa, "Loopback not supported"); + rc = EINVAL; + } + + if (conf->dcb_capability_en != 0) { + sfc_err(sa, "Priority-based flow control not supported"); + rc = EINVAL; + } + + if (conf->fdir_conf.mode != RTE_FDIR_MODE_NONE) { + sfc_err(sa, "Flow Director not supported"); + rc = EINVAL; + } + + if (conf->intr_conf.lsc != 0) { + sfc_err(sa, "Link status change interrupt not supported"); + rc = EINVAL; + } + + if (conf->intr_conf.rxq != 0) { + sfc_err(sa, "Receive queue interrupt not supported"); + rc = EINVAL; + } + + return rc; +} + int sfc_configure(struct sfc_adapter *sa) { + int rc; + sfc_log_init(sa, "entry"); SFC_ASSERT(sfc_adapter_is_locked(sa)); @@ -92,9 +138,18 @@ sfc_configure(struct sfc_adapter *sa) SFC_ASSERT(sa->state == SFC_ADAPTER_INITIALIZED); sa->state = SFC_ADAPTER_CONFIGURING; + rc = sfc_check_conf(sa); + if (rc != 0) + goto fail_check_conf; + sa->state = SFC_ADAPTER_CONFIGURED; sfc_log_init(sa, "done"); return 0; + +fail_check_conf: + sa->state = SFC_ADAPTER_INITIALIZED; + sfc_log_init(sa, "failed %d", rc); + return rc; } void -- 2.5.5