]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sif: Make driver more silent at startup
authorKnut Omang <knut.omang@oracle.com>
Tue, 31 May 2016 05:59:31 +0000 (07:59 +0200)
committerKnut Omang <knut.omang@oracle.com>
Sun, 3 Jul 2016 14:01:42 +0000 (16:01 +0200)
- Set debug_mask to 0x1 for upstream
- Move most initialization messages to INIT(0x2) level
- Return number of VFs enabled instead of 0 from sif_vf_enable
  This also eliminates a warning from the kernel framework

Signed-off-by: Knut Omang <knut.omang@oracle.com>
drivers/infiniband/hw/sif/sif_base.c
drivers/infiniband/hw/sif/sif_dev.h
drivers/infiniband/hw/sif/sif_epsc.c
drivers/infiniband/hw/sif/sif_eq.c
drivers/infiniband/hw/sif/sif_hwi.c
drivers/infiniband/hw/sif/sif_main.c
drivers/infiniband/hw/sif/sif_pd.c
drivers/infiniband/hw/sif/sif_pt.c
drivers/infiniband/hw/sif/sif_qp.c
drivers/infiniband/hw/sif/sif_r3.c
drivers/infiniband/hw/sif/sif_vf.c

index a911d2991c5eeab5d129db69af7bc011defa66ad..d0cb37ffe6100f7fda6c4208fd619b848bf63287 100644 (file)
@@ -432,7 +432,7 @@ static int init_blocks(struct sif_dev *sdev, enum sif_tab_type type)
                 */
                int bitmap_bytes = (((tp->entry_per_block + 7) >> 3) + 7) & ~7;
 
-               sif_log(sdev, SIF_INFO,
+               sif_log(sdev, SIF_INIT,
                        "%s uses two-level alloc: entry_per_block %d, block_cnt %d bitmap_bytes %d",
                        sif_table_name(type), tp->entry_per_block, tp->block_cnt,
                                bitmap_bytes);
@@ -549,7 +549,7 @@ int sif_table_init(struct sif_dev *sdev, enum sif_tab_type type)
        if (tp->alloc_rr)
                tp->last_used = tp->block_cnt - 1; /* Next will be the first entry */
 
-       sif_log(sdev, SIF_INFO, "%s(%d): entry cnt %d, entry sz %d, ext sz %d, extent %d, [%s]",
+       sif_log(sdev, SIF_INIT, "%s(%d): entry cnt %d, entry sz %d, ext sz %d, extent %d, [%s]",
                base_layout[type].desc, type, tp->entry_cnt, base_layout[type].entry_sz, tp->ext_sz,
                extent, (base_layout[type].wr_access ? "writable" : "readonly"));
        sif_log(sdev, SIF_INIT, " - table sz 0x%lx %s sif_base 0x%llx csr off 0x%lx",
index 2ea33817cffafa49b243613e5856e8a6c0dd6311..ca133132d9661b9cdbe34d7b201904db0b767ee2 100644 (file)
@@ -411,21 +411,20 @@ extern ulong sif_trace_mask;
        do { \
                sif_log_trace(class, format, ## arg);   \
                if (unlikely((sif_debug_mask) & (class))) {             \
-                       const char *cl = #class;\
                        dev_info(&(sdev)->pdev->dev,    \
-                                  "[%d] %5s %s: " format "\n", \
-                                  current->pid, &cl[4], __func__,      \
+                                  "[%d] " format "\n", \
+                                  current->pid, \
                                   ## arg); \
                } \
        } while (0)
 
 #define sif_logi(ibdev, class, format, arg...) \
        do { \
+               sif_log_trace(class, format, ## arg);   \
                if (unlikely((sif_debug_mask) & (class))) {             \
-                       const char *cl = #class;\
                        dev_info((ibdev)->dma_device,     \
-                                  "[%d] %5s %s: " format "\n", \
-                                  current->pid, &cl[4], __func__,      \
+                                  "[%d] " format "\n", \
+                                  current->pid, \
                                   ## arg); \
                } \
        } while (0)
@@ -433,8 +432,8 @@ extern ulong sif_trace_mask;
 #define sif_log0(class, format, arg...)        \
        do { \
                if (unlikely((sif_debug_mask) & (class)))       \
-                       pr_info("pid [%d] %s: " format "\n", \
-                               current->pid, __func__,      \
+                       pr_info("sif [%d] " format "\n", \
+                               current->pid, \
                                ## arg);                     \
        } while (0)
 
index deb72880c2f9963f9a7d72d5f17a790a9b89ede6..70286d97ff8378ccce2175bcd86721e27ab88a44 100644 (file)
@@ -234,7 +234,7 @@ static int sif_eps_api_version_ok(struct sif_dev *sdev, enum psif_mbox_type eps_
        struct sif_eps *es = &sdev->es[eps_num];
 
        /* Validate that we have compatible versions */
-       sif_log(sdev, SIF_INFO, "Connected to SIF version %d.%d,  EPS%s version %d.%d",
+       sif_log(sdev, SIF_INFO_V, "Connected to SIF version %d.%d,  EPS%s API version %d.%d",
                es->ver.psif_major, es->ver.psif_minor,
                eps_name(sdev, eps_num),
                es->ver.epsc_major, es->ver.epsc_minor);
@@ -312,9 +312,9 @@ static int sif_eps_firmware_version_ok(struct sif_dev *sdev, enum psif_mbox_type
                                break;
                }
        }
-       sif_log(sdev, SIF_INFO, "EPSC firmware image revision string %s",
+       sif_log(sdev, SIF_INFO_V, "EPSC firmware image revision string %s",
                es->ver.fw_version[FWV_EPS_REV_STRING]);
-       sif_log(sdev, SIF_INFO, "EPSC firmware version tag:\n%s",
+       sif_log(sdev, SIF_INFO_V, "EPSC firmware version tag:\n%s",
                es->ver.fw_version[FWV_EPS_GIT_LAST_COMMIT]);
        if (es->ver.fw_version[FWV_EPS_GIT_STATUS][0] != '\0')
                sif_log(sdev, SIF_INFO, " *** epsfw git status at build time: ***\n%s",
@@ -327,7 +327,7 @@ static int sif_eps_firmware_version_ok(struct sif_dev *sdev, enum psif_mbox_type
        if (vs[0] == 'R' && es->ver.fw_minor == 0)
                es->ver.fw_minor = 1;
 
-       sif_log(sdev, SIF_INFO, "EPSC interpreted firmware revision: %hu.%hu",
+       sif_log(sdev, SIF_INIT, "EPSC firmware revision: %hu.%hu",
                es->ver.fw_major, es->ver.fw_minor);
        return 0;
 }
@@ -832,7 +832,7 @@ eps_reset:
                es->ver.seq_set_proto = get.x.data;
 
 proto_probing_done:
-       sif_log(sdev, SIF_INFO, "In contact with EPS%s with initial mailbox negotiation protocol v.%d",
+       sif_log(sdev, SIF_INFO_V, "In contact with EPS%s with initial mailbox negotiation protocol v.%d",
                eps_name(sdev, eps_num), es->ver.seq_set_proto);
        if (!es->ver.seq_set_proto)
                sif_log(sdev, SIF_INFO,
index 5b5db9bf72162960cbb2130a4424f54d6fdcced7..ac962d29bc3959b00b1dc6a0fa40af023c1ea68d 100644 (file)
@@ -230,7 +230,7 @@ static int sif_eq_table_init(struct sif_dev *sdev, struct sif_eps *es, u16 eq_id
        eqe = (struct psif_eq_entry *)get_eq_entry(eq, 0);
        set_psif_eq_entry__seq_num(eqe, eq->entries);
 
-       sif_log(sdev, SIF_INFO,
+       sif_log(sdev, SIF_INIT,
                "Event queue %d: entry cnt %d (min.req.%d), ext sz %d, extent %d, sw_index_interval %d",
                eq_idx, tp->entry_cnt, min_entries, tp->ext_sz, extent, eq->sw_index_interval);
        sif_log(sdev, SIF_INIT, " - table sz 0x%lx %s sif_base 0x%llx",
index 2a299a5085df0f6a6885a46644d352f192aecf70..b01dcfc1c1d337a31796a2b5addcf19de106babc 100644 (file)
@@ -151,7 +151,7 @@ static int sif_ki_spqp_init(struct sif_dev *sdev)
        }
 
        if (i)
-               sif_log(sdev, SIF_INFO, "Created %d INVALIDATE_KEY stencil QPs", i);
+               sif_log(sdev, SIF_INIT, "Created %d INVALIDATE_KEY stencil QPs", i);
 bm_failed:
        if (ret)
                kfree(sdev->ki_spqp.spqp);
index 3e33f40d9e166628cd24574db917f1f34ebeae2c..0ecff0d72c454c26dd206d93b0edec85b98e8279 100644 (file)
@@ -61,43 +61,19 @@ static int sif_probe(struct pci_dev *pdev,
                               const struct pci_device_id *id);
 static void sif_remove(struct pci_dev *dev);
 
-static int sif_suspend(struct pci_dev *dev, pm_message_t state)
-{
-       struct sif_dev *sdev = pci_get_drvdata(dev);
-
-       sif_log(sdev, SIF_INFO, " ");
-       return 0;
-}
-
-static int sif_resume(struct pci_dev *dev)
-{
-       struct sif_dev *sdev = pci_get_drvdata(dev);
-
-       sif_log(sdev, SIF_INFO, " ");
-       return 0;
-}
-
-static void sif_shutdown(struct pci_dev *dev)
-{
-       struct sif_dev *sdev = pci_get_drvdata(dev);
-
-       sif_log(sdev, SIF_INFO, " ");
-}
 
 static struct pci_driver sif_driver = {
        .name = "sif",
        .id_table = pci_table,
        .probe =        sif_probe,
        .remove =       sif_remove,
-       .suspend =      sif_suspend,
-       .resume =       sif_resume,
-       .shutdown =     sif_shutdown,
        .sriov_configure = sif_vf_enable,
 };
 
 /* Driver parameters: */
 
-ulong sif_debug_mask = 0x3;
+ulong sif_debug_mask = 0x1;
+
 module_param_named(debug_mask, sif_debug_mask, ulong, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug_mask, "Selective enabling of debugging output to the system log");
 
@@ -255,6 +231,8 @@ static int sif_probe(struct pci_dev *pdev,
        /* TBD: Zeroed memory from ib_alloc_device? */
        struct sif_dev *sdev =
            (struct sif_dev *)ib_alloc_device(sizeof(struct sif_dev));
+       struct sif_eps *es;
+
        if (!sdev) {
                err = -ENOMEM;
                goto pfail_ib_alloc;
@@ -270,9 +248,10 @@ static int sif_probe(struct pci_dev *pdev,
 
        pci_set_drvdata(pdev, sdev);
        sif_log(sdev, SIF_INFO,
-               "%s found, device id 0x%x, subsystem id 0x%x, revision %d, at 0x%p",
+               "%s found, device id 0x%x, subsystem id 0x%x, rev.%d",
                get_product_str(sdev), PSIF_DEVICE(sdev),
-               PSIF_SUBSYSTEM(sdev), PSIF_REVISION(sdev), sdev);
+               PSIF_SUBSYSTEM(sdev), PSIF_REVISION(sdev));
+
 
        sdev->wq = create_singlethread_workqueue(sdev->ib_dev.name);
        if (!sdev->wq) {
@@ -393,7 +372,12 @@ static int sif_probe(struct pci_dev *pdev,
        sif_dfs_link_to_ibdev(sdev);
 
 
-       sif_log(sdev, SIF_INFO, "Successfully probed and set up device");
+       es = &sdev->es[sdev->mbox_epsc];
+       sif_log(sdev, SIF_INFO, "Enabled %s (hardware v%d.%d - firmware v%d.%d (api v%d.%d))",
+               sdev->ib_dev.name,
+               es->ver.psif_major, es->ver.psif_minor,
+               es->ver.fw_major, es->ver.fw_minor,
+               es->ver.epsc_major, es->ver.epsc_minor);
        return 0;
 pfail_ibreg:
        sif_r3_deinit(sdev);
@@ -427,7 +411,7 @@ static void sif_remove(struct pci_dev *dev)
 {
        struct sif_dev *sdev = pci_get_drvdata(dev);
 
-       sif_log0(SIF_INIT, "Enter: sif_remove");
+       sif_log(sdev, SIF_INIT, "Enter: sif_remove");
 
        sif_vf_disable(sdev);
 
@@ -443,8 +427,8 @@ static void sif_remove(struct pci_dev *dev)
        pci_disable_device(dev);
        flush_workqueue(sdev->wq);
        destroy_workqueue(sdev->wq);
+       sif_log(sdev, SIF_INFO, "removed device %s", sdev->ib_dev.name);
        ib_dealloc_device(&sdev->ib_dev);
-       sif_log0(SIF_INIT, "exit sif_remove");
 }
 
 static int sif_bar_init(struct pci_dev *pdev)
@@ -572,20 +556,7 @@ static int __init sif_init(void)
 {
        int stat = 0;
 
-       sif_log0(SIF_INFO, "**** Oracle development driver - internal use only! ****");
-       sif_log0(SIF_INFO, "%s - build user %s at %s", sif_version.git_repo,
-               sif_version.build_user, sif_version.build_git_time);
-       sif_log0(SIF_INFO, "sifdrv git tag:\n%s", sif_version.last_commit);
-       if (sif_version.git_status[0] != '\0')
-               sif_log0(SIF_INFO, " *** sifdrv git status at build time: ***\n%s", sif_version.git_status);
-       sif_log0(SIF_INFO, "psifapi git tag:\n%s", sif_version.last_psifapi_commit);
-       if (sif_version.git_psifapi_status[0] != '\0')
-               sif_log0(SIF_INFO, " *** psifapi git status at build time ***\n%s",
-                       sif_version.git_psifapi_status);
-
-       sif_log0(SIF_INIT, "hw header release \"%s\"", PSIF_RELEASE_STR);
-       sif_log0(SIF_INIT, "built for PSIF version %d.%d, EPSC API version %d.%d",
-               PSIF_MAJOR_VERSION, PSIF_MINOR_VERSION, EPSC_MAJOR_VERSION, EPSC_MINOR_VERSION);
+       sif_log0(SIF_INFO, "SIF - driver for Oracle's Infiniband HCAs");
        sif_log0(SIF_INIT, "sif debug mask 0x%lx", sif_debug_mask);
        if (sif_feature_mask) {
                u64 undef = sif_feature_mask & ~SIFF_all_features;
index e1fc92f5fa33feaab99375ebca08107ef6b89bc3..778d0c2856cca26a185d3cbf877a9dda86116b4d 100644 (file)
@@ -204,7 +204,7 @@ static void sif_cb_init(struct sif_dev *sdev)
                else {
                        sdev->bw_cb_cnt = rsp.data;
                        sdev->lat_cb_cnt = rsp.info;
-                       sif_log(sdev, SIF_INFO, "Got %ld bw_cbs and %ld lat_cbs",
+                       sif_log(sdev, SIF_INIT, "Got %ld bw_cbs and %ld lat_cbs",
                                sdev->bw_cb_cnt, sdev->lat_cb_cnt);
                }
        }
index e6f314a9ba7cab32213829a27f70a25ed44591ed..23d76ef2c0937a8360a8693c9d3646936a4134b0 100644 (file)
@@ -48,7 +48,6 @@ int sif_pt_init(void)
        pt_page_cache = KMEM_CACHE(sif_pt_page, 0);
        if (!pt_page_cache)
                return -ENOMEM;
-       sif_log0(SIF_INFO, "order PAGE_SIZE = %d", order_base_2(PAGE_SIZE));
        return 0;
 }
 
index b0733dbb01bc5d873a65c3aa1654220dbe427c30..1dbc260d4f193cf7b86dfd868eaf369fd4ff68c5 100644 (file)
@@ -2469,9 +2469,9 @@ void sif_dfs_print_qp(struct seq_file *s, struct sif_dev *sdev,
                else
                        seq_puts(s, "\t[GSI_QP_P2]\n");
        else if (qp->ibqp.qp_type == IB_QPT_XRC_TGT)
-                       seq_puts(s, "\t[RECV]\n");
+               seq_puts(s, "\t[RECV]\n");
        else if (qp->ibqp.qp_type == IB_QPT_XRC_INI)
-                       seq_puts(s, "\t[SEND]\n");
+               seq_puts(s, "\t[SEND]\n");
        else
                seq_puts(s, "\n");
 }
index 4b4205de05391cfaf7bf17e8176594301b1e32fc..7bdf3652be0b76e15589b451511ef5ed5a87bf7c 100644 (file)
@@ -284,7 +284,7 @@ static int sif_hw_allocate_flush_qp(struct sif_dev *sdev)
        }
 
        sdev->flush_qp = qp->qp_idx;
-       sif_log(sdev, SIF_INFO, "Allocated flush-retry qp, index %d", sdev->flush_qp);
+       sif_log(sdev, SIF_QPE, "Allocated flush-retry qp, index %d", sdev->flush_qp);
 
        return ret;
 
index a2cbcbea4f85400280c91c43fd2460fccdb0738a..d4604b6410d3da437f48ced6db4b1cd135bad8f9 100644 (file)
@@ -53,6 +53,7 @@ int sif_vf_enable(struct pci_dev *dev, int num_vfs)
                sdev->num_vfs = num_vfs;
        } else
                pci_disable_sriov(sdev->pdev);
+       return num_vfs;
 sriov_failed:
        return ret;
 }