From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4F220A0540; Thu, 16 Jul 2020 11:40:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AE6691BEA9; Thu, 16 Jul 2020 11:40:26 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id D87621BE9C for ; Thu, 16 Jul 2020 11:40:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594892424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bdHmoqthXJLhKhLEddgh1SmtkgTq9y+TDlZQl/7ngmM=; b=VMHp4DSVr8ydt+OOOMqpzIv0YBgawl//wBbcfi1q/n0syC3ydrzwIuRT+L5DosfS/VZ28M pV7aOOTGQDbQk6YcMTxojmsO1rgHykPr1GHBmYSv+uQcyI311JAT+s0dfFPaOnFXEqpOHx vCOcO1SLmGG1rF3adL6jr4DFGjDf0fw= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-470-I255WKxxOmm2emufCtMd9g-1; Thu, 16 Jul 2020 05:40:22 -0400 X-MC-Unique: I255WKxxOmm2emufCtMd9g-1 Received: by mail-vk1-f197.google.com with SMTP id b128so1840947vka.17 for ; Thu, 16 Jul 2020 02:40:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bdHmoqthXJLhKhLEddgh1SmtkgTq9y+TDlZQl/7ngmM=; b=jT2vATc1Vnk7uPe1KigJNpo3kdrleZA1HHHRb20J4V4d+z4fpXhQZIrBJuBt0qdCWG OBveXhIylouzeNhaAThPtsk/suKSHFCHfNHW7XKDRQxpar4S2uGQyMJ4/YYodJvNeABt pj4ztYVbHPnFyNi9OcgqqQOeS0jmR90SPos72dPANiaL0q+I90txxUhRPZvVdUi/b14X M31XpZCnq7ozGLUU+EHKZGiQoMZDI6OOs+Yoz/Aw1S6bKWf/L6Yyx7ZcXp/07QLtP4Mo QhY/qp7udmGKE23nv2s8LZwvPnlLxkqEJeIqaTAt2I0De1efxJBeTJvcM03RlEFURJd7 Uolw== X-Gm-Message-State: AOAM532fuXlJDRjKUB8LJ30tIJs6WCcU5Nw1mnEywwdB4dHPJc1hvGRx q4KHMpjDALeTAJ7z5W+bmTW39QWh8HzrZsUut8sGU61pkPzwtZ75t8QKoHon19Pp9yh7S2AdubN Du6l35l7Tuu/RPn0Y2Ew= X-Received: by 2002:a9f:31b3:: with SMTP id v48mr2466254uad.87.1594892421912; Thu, 16 Jul 2020 02:40:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5w+7iwbLt8QIvlPNtXtOfvXU/ecqbCsyE490wNxjtdm9lU5EIpFjqqCaPxdALcR1CXzs8KIqwh7/QMnbVaxY= X-Received: by 2002:a9f:31b3:: with SMTP id v48mr2466239uad.87.1594892421553; Thu, 16 Jul 2020 02:40:21 -0700 (PDT) MIME-Version: 1.0 References: <1594419966-230753-1-git-send-email-nicolas.chautru@intel.com> <1594419966-230753-2-git-send-email-nicolas.chautru@intel.com> In-Reply-To: <1594419966-230753-2-git-send-email-nicolas.chautru@intel.com> From: David Marchand Date: Thu, 16 Jul 2020 11:40:10 +0200 Message-ID: To: Nicolas Chautru Cc: dev , Akhil Goyal , Thomas Monjalon X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v1] baseband/fpga_5gnr_fec: add companion PF config App X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Sat, Jul 11, 2020 at 12:28 AM Nicolas Chautru wrote: [snip] > +#define SYS_DIR "/sys/bus/pci/devices" > +#define CUR_DIR "." > +#define PREV_DIR ".." > + > +#define DRIVER_LINK "driver" > +#define DEVICE_FILE "device" > +#define VENDOR_FILE "vendor" > +#define BAR0_FILE "resource0" > +#define MAX_VFS_FILE "max_vfs" > + > +#define PCI_STR_SIZE 15 > +#define DEV_STR_SIZE 10 > +#define NULL_PAD 2 > + > +/* Function Pointer for device specific configuration file */ > +typedef int (*configuration)(void *bar0addr, const char *arg_cfg_filename); > + > +typedef struct hw_device { > + const char *device_name; > + char *config_file; > + int vendor_id; > + int device_id; > + char pci_address[PCI_STR_SIZE]; > + bool driver_found; > + configuration conf; > + char *num_vfs; > + int config_all; > +} hw_device; > + > +static int > +enable_vfs(const char *pci_addr, char *num_vfs) > +{ > + char maxvfspath[PATH_MAX]; > + char fs_num_vfs[4] = {0, 0, 0, 0}; > + int maxvfsfd; > + > + snprintf(maxvfspath, sizeof(maxvfspath), > + "%s/%s/%s", SYS_DIR, pci_addr, MAX_VFS_FILE); > + maxvfsfd = open(maxvfspath, O_RDWR | O_SYNC); You should stop relying on igb_uio (reminder: it is going to move out of the dpdk tree in 20.11) and use vfio vf token that got merged in 20.08. -- David Marchand