From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by dpdk.org (Postfix) with ESMTP id DE598590F for ; Fri, 18 Jul 2014 13:48:27 +0200 (CEST) Received: by mail-wi0-f176.google.com with SMTP id bs8so720798wib.3 for ; Fri, 18 Jul 2014 04:49:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=3CEUeJZVGtBcU02IwOUuoT7her1a8Q/Bh8e39umyOaE=; b=PnX99UhwPuvdPOmae0xJhvs4JQdUqT8YiC/ZXmjXvqZd44MmxJ9DgCxiGdJr+VTX3N FvRzPiGXrdEMilCV9/cX1JZyXITM2+YHk0FxBN4egC9rQvpWMYmWuCozsRTQIw7YKmn7 kHdWKNLoKNW1jSzag5vo84ITyeoTWt/q2XuBqoBJYLWWyFEpXQOnBiyNV2xHlJ80yDFv CPnFYHyRXfmM6YApzua5WsBm5Hq61xKvu6uoTGoao8fekM38xFb+pBUfQbPJEmOnFyoY QizQKP4bO9tDuZhZzqWMdbQe5gQCmErAmagaAwqB9DhVmitsxtc+5/QuOFBhRKkmu+fl vl5A== X-Gm-Message-State: ALoCoQlbOYxjwTli3MJAujd92DA5FSrfvjh+vJg/Ojj0+OjKh+hGQd+Z3j+p/9HlDeRAQKouiKNd X-Received: by 10.180.94.166 with SMTP id dd6mr6727669wib.33.1405684167737; Fri, 18 Jul 2014 04:49:27 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id a13sm13672501wjs.12.2014.07.18.04.49.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jul 2014 04:49:27 -0700 (PDT) From: Thomas Monjalon To: Stephen Hemminger Date: Fri, 18 Jul 2014 13:49:19 +0200 Message-ID: <2492608.JgTHGoTi8P@xps13> Organization: 6WIND User-Agent: KMail/4.13.2 (Linux/3.15.5-1-ARCH; KDE/4.13.2; x86_64; ; ) In-Reply-To: <20140606235113.600528535@networkplumber.org> References: <20140606235028.189345212@networkplumber.org> <20140606235113.600528535@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2 08/10] igb_uio: fix IRQ mode handling 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, 18 Jul 2014 11:48:28 -0000 Hi Stephen, I cannot merge this part because some lines were removed from the context. I think I just have to add them but I would like confirmation. See below. > @@ -512,36 +499,36 @@ > #endif > udev->info.priv = udev; > udev->pdev = dev; > - udev->mode = 0; /* set the default value for interrupt mode */ > - spin_lock_init(&udev->lock); > > - /* check if it need to try msix first */ > - if (igbuio_intr_mode_preferred == IGBUIO_MSIX_INTR_MODE) { > - /* only one MSIX vector needed */ > - struct msix_entry msix_entry = { > - .entry = 0, > - }; > - > - if (pci_enable_msix(udev->pdev, &msix_entry, 1) == 0) { > + switch (igbuio_intr_mode_preferred) { > + case IGBUIO_MSIX_INTR_MODE: > + /* Only 1 msi-x vector needed */ > + msix_entry.entry = 0; > + if (pci_enable_msix(dev, &msix_entry, 1) == 0) { > + dev_dbg(&dev->dev, "using MSI-X"); > + udev->info.irq = msix_entry.vector; > udev->mode = IGBUIO_MSIX_INTR_MODE; > - } else { > - pr_err("failed to enable pci msix, or not enough msix entries\n"); > - udev->mode = IGBUIO_LEGACY_INTR_MODE; > + break; > } > - } > - switch (udev->mode) { > - case IGBUIO_MSIX_INTR_MODE: > - udev->info.irq_flags = 0; > - udev->info.irq = udev->msix_entries[0].vector; > - break; > + /* fall back to MSI */ > case IGBUIO_MSI_INTR_MODE: > - break; > + if (pci_enable_msi(dev) == 0) { > + dev_dbg(&dev->dev, "using MSI"); > + udev->info.irq = dev->irq; > + udev->mode = IGBUIO_MSI_INTR_MODE; > + break; > + } > + /* fall back to INTX */ > case IGBUIO_LEGACY_INTR_MODE: > - udev->info.irq_flags = IRQF_SHARED; > - udev->info.irq = dev->irq; > - break; > - default: > - break; > + if (pci_intx_mask_supported(dev)) { > + dev_dbg(&dev->dev, "using INTX"); > + udev->info.irq_flags = IRQF_SHARED; > + udev->mode = IGBUIO_LEGACY_INTR_MODE; > + } else { > + dev_err(&dev->dev, "PCI INTX mask not supported\n"); > + err = -EIO; > + goto fail_release_iomem; > + } > } There is a problem here. These 2 lines are missing: pci_set_drvdata(dev, udev); igbuio_pci_irqcontrol(&udev->info, 0); > err = sysfs_create_group(&dev->dev.kobj, &dev_attr_grp); -- Thomas