From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f174.google.com (mail-ob0-f174.google.com [209.85.214.174]) by dpdk.org (Postfix) with ESMTP id 2A6302E83 for ; Wed, 10 Feb 2016 10:27:34 +0100 (CET) Received: by mail-ob0-f174.google.com with SMTP id wb13so19268986obb.1 for ; Wed, 10 Feb 2016 01:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=PLx+lN0OjyUY6DDv+VSD4hEEuroXjnYumqYYGCQqUuU=; b=akrVDU+eWG8EAFtFG9dn2VjU3ulYdaS0uwf16fDQcCqL1fUH2+pDckXWdaM3eS+Who PP/Q/nf4Ux3CozbB33Y0lk+Y2Ja9gcK7JbVXOivJ5b4Ry6HowLQY1898eftQIkuS3aDZ yCSIFPa1m3sXuIxkxo+leqYjT700S8Enf9I54bcEIu7nsqRYRyNUCZYS+GKE56uqEYsk l5uoP7RApUjArpakuva1s4DIX4R9q/CrECdvSg1op+Mn0MlewQy6vv1qa3mAgpw9wXIf 4Ll27J7EHoFILr1UYcmJzsbUBR1h4YqShbCKDDHPo2yt4Tnn9MaaRk3d2yXlwlGjVqS1 FSCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=PLx+lN0OjyUY6DDv+VSD4hEEuroXjnYumqYYGCQqUuU=; b=Miat2OYlLdWYUanFwBDzqE9XSmnJtSr9XgrzcuF0dDPkYOtDIKhn8DAD4O8V5kfHHW YcgeVPEPZGcxUXI56LkPJdUhxWZAbvl2dHMtau93YzcYIt4v5bC76QR02NnmwElniOeB gQLSbgNpY6IZH+ARQ0OtHYpFulS7df0bSs5TViQzFwU1HWjk1i6nJop9Gapd+IlmmJDs NCgGI0SrmkebKrTECSwUPhpoik/NGNfNK8nxJmpg46YU/8fTjlesqTVCfXCuWHgaxyjj 4Hmf+ScQCPq9+8x/xmGCD445K8K97nvABIHi8AJElndv5Kg59X7+OIKoR1jndcu+WaKV GWRQ== X-Gm-Message-State: AG10YOR2knnh7vMMQPvPoFBOn9N30hHFyo5mBHswivQFOfJfpJmOF9GBUYPxwkuW5bM2hvWAf7KeLNBBy7TT/ZpI X-Received: by 10.182.103.167 with SMTP id fx7mr34915703obb.36.1455096453584; Wed, 10 Feb 2016 01:27:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.76.180.72 with HTTP; Wed, 10 Feb 2016 01:27:14 -0800 (PST) In-Reply-To: References: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> <1454076516-21591-4-git-send-email-david.marchand@6wind.com> <20160209180555.3ad379cf@pcviktorin.fit.vutbr.cz> From: David Marchand Date: Wed, 10 Feb 2016 10:27:14 +0100 Message-ID: To: Jan Viktorin Content-Type: text/plain; charset=UTF-8 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 3/9] drivers: no more pdev drivers 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: Wed, 10 Feb 2016 09:27:34 -0000 On Wed, Feb 10, 2016 at 9:51 AM, David Marchand wrote: > On Tue, Feb 9, 2016 at 6:05 PM, Jan Viktorin wrote: >> What about introducing a macro for this? >> >> RTE_REGISTER_PCI_DRIVER(rte_qad_pmd); > > Yes. The only problem here, is that rte_qad_pmd is a crypto structure (same problem with ethdev), so I can't just pass it to eal. I can't just pass the pci driver, for the cases where multiple drivers are registered in a single file (look at ixgbe driver). So, how about : In rte_pci.h : #define RTE_EAL_PCI_REGISTER(name, d)\ void pciinitfn_ ##name(void);\ void __attribute__((constructor, used)) pciinitfn_ ##name(void)\ {\ rte_eal_pci_register(d);\ } Then, in qat driver : RTE_EAL_PCI_REGISTER(qat, &rte_qat_pmd.pci_drv); -- David Marchand