From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by dpdk.org (Postfix) with ESMTP id 0793CB0AE for ; Sat, 7 Jun 2014 01:51:04 +0200 (CEST) Received: by mail-pb0-f50.google.com with SMTP id ma3so3092164pbc.9 for ; Fri, 06 Jun 2014 16:51:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:user-agent:date:from:to:cc:subject :references:mime-version:content-type:content-disposition; bh=SYeOif/UF0ISLxP0ic4SHRMvR/FDrHk2aAeSlnVdKLA=; b=TCc778vsXR/1oAm7BB6iGUTvF7XVhMz2B0ZBxM0bRowJHZ1q07u0LVu6qUEMnfUVNc gtazYATRmnqiZKT4UETphzgQCtLmBKwtQvH8NQBpLwL8hSoHrRzuqrDmAWMBjMxa53+R 4KX2nAbBJn7Lf78hcY8ts1F7WjbVZOUmqq02lzvmGt0xgsu7FwZjdqK0xEDBAqMXRuue ZYSK52/zDSZjnG93OPJ0rMrPq2Nuiowo8fF+ZelOL2DAjsAR5ybEaO+4oIPBDFrVmcMR alVOxiwzljQtvny/33I+gXKvEcuVYZIw5mf9ho2Oeh5o/rE0X9UOWUVrWZZAwR3GZ/Qd 2P7g== X-Gm-Message-State: ALoCoQm2jGl5nrDInmwO1l3MSYo74kJ84abDYkTkg4o6L6bk5uAQNcaWXb3Lq522AjHEK6I5vLKX X-Received: by 10.69.25.69 with SMTP id io5mr6258375pbd.22.1402098678326; Fri, 06 Jun 2014 16:51:18 -0700 (PDT) Received: from localhost (static-50-53-83-51.bvtn.or.frontiernet.net. [50.53.83.51]) by mx.google.com with ESMTPSA id fv2sm40936016pbd.11.2014.06.06.16.51.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jun 2014 16:51:17 -0700 (PDT) Message-Id: <20140606235116.841557340@networkplumber.org> User-Agent: quilt/0.63-1 Date: Fri, 06 Jun 2014 16:50:38 -0700 From: Stephen Hemminger To: Alan Carew References: <20140606235028.189345212@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=igb_uio-mode-param-table.patch Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH v2 10/10] igbuio: use mode string for module param 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: Fri, 06 Jun 2014 23:51:05 -0000 Since we now have a list of interrupt modes for sysfs, use that to match module param values. This also allows msi to be selected as a preferred mode. Signed-off-by: Stephen Hemminger --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -605,21 +605,24 @@ static int igbuio_config_intr_mode(char *intr_str) { + unsigned int i; + if (!intr_str) { pr_info("Use MSIX interrupt by default\n"); return 0; } - if (!strcmp(intr_str, "msix")) { - igbuio_intr_mode_preferred = IGBUIO_MSIX_INTR_MODE; - pr_info("Use MSIX interrupt\n"); - } else if (!strcmp(intr_str, "legacy")) { - igbuio_intr_mode_preferred = IGBUIO_LEGACY_INTR_MODE; - pr_info("Use legacy interrupt\n"); - } else { - pr_info("Error: bad parameter - %s\n", intr_str); - return -EINVAL; - } + for (i = 0; i < ARRAY_SIZE(igbuio_intr_modes); i++) { + const char *mode = igbuio_intr_modes[i]; + if (!strcmp(intr_str, mode)) { + pr_info("Use %s interrupt mode\n", mode); + igbuio_intr_mode_preferred = i; + return 0; + } + } + + pr_warn("bad interrupt mode parameter %s\n", intr_str); + return -EINVAL; return 0; } @@ -656,6 +659,7 @@ MODULE_PARM_DESC(intr_mode, "igb_uio interrupt mode (default=msix):\n" " msix Use MSIX interrupt\n" +" msi Use MSI interrupt\n" " legacy Use Legacy interrupt\n" "\n");