net/virtio: replace SMP barrier with IO barrier
[dpdk.git] / drivers / net / ionic / ionic_lif.c
index 722a895..28ae9dc 100644 (file)
@@ -84,7 +84,7 @@ ionic_lif_reset(struct ionic_lif *lif)
        ionic_dev_cmd_lif_reset(idev, lif->index);
        err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
        if (err)
-               IONIC_PRINT(WARNING, "Failed to reset lif");
+               IONIC_PRINT(WARNING, "Failed to reset %s", lif->name);
 }
 
 static void
@@ -554,7 +554,7 @@ ionic_intr_alloc(struct ionic_lif *lif, struct ionic_intr_info *intr)
        /*
         * Note: interrupt handler is called for index = 0 only
         * (we use interrupts for the notifyq only anyway,
-        * which hash index = 0)
+        * which has index = 0)
         */
 
        for (index = 0; index < adapter->nintrs; index++)
@@ -687,8 +687,8 @@ ionic_qcq_alloc(struct ionic_lif *lif, uint8_t type,
                ionic_q_sg_map(&new->q, sg_base, sg_base_pa);
        }
 
-       IONIC_PRINT(DEBUG, "Q-Base-PA = %ju CQ-Base-PA = %ju "
-               "SG-base-PA = %ju",
+       IONIC_PRINT(DEBUG, "Q-Base-PA = %#jx CQ-Base-PA = %#jx "
+               "SG-base-PA = %#jx",
                q_base_pa, cq_base_pa, sg_base_pa);
 
        ionic_q_map(&new->q, q_base, q_base_pa);
@@ -827,7 +827,13 @@ ionic_lif_alloc(struct ionic_lif *lif)
        int dbpage_num;
        int err;
 
-       snprintf(lif->name, sizeof(lif->name), "lif%u", lif->index);
+       /*
+        * lif->name was zeroed on allocation.
+        * Copy (sizeof() - 1) bytes to ensure that it is NULL terminated.
+        */
+       memcpy(lif->name, lif->eth_dev->data->name, sizeof(lif->name) - 1);
+
+       IONIC_PRINT(DEBUG, "LIF: %s", lif->name);
 
        IONIC_PRINT(DEBUG, "Allocating Lif Info");
 
@@ -868,8 +874,6 @@ ionic_lif_alloc(struct ionic_lif *lif)
 
        IONIC_PRINT(DEBUG, "Allocating Admin Queue");
 
-       IONIC_PRINT(DEBUG, "Allocating Admin Queue");
-
        err = ionic_admin_qcq_alloc(lif);
        if (err) {
                IONIC_PRINT(ERR, "Cannot allocate admin queue");
@@ -1223,6 +1227,7 @@ ionic_lif_notifyq_init(struct ionic_lif *lif)
                ctx.cmd.q_init.ring_base);
        IONIC_PRINT(DEBUG, "notifyq_init.ring_size %d",
                ctx.cmd.q_init.ring_size);
+       IONIC_PRINT(DEBUG, "notifyq_init.ver %u", ctx.cmd.q_init.ver);
 
        err = ionic_adminq_post_wait(lif, &ctx);
        if (err)
@@ -1332,6 +1337,7 @@ ionic_lif_txq_init(struct ionic_qcq *qcq)
                ctx.cmd.q_init.ring_base);
        IONIC_PRINT(DEBUG, "txq_init.ring_size %d",
                ctx.cmd.q_init.ring_size);
+       IONIC_PRINT(DEBUG, "txq_init.ver %u", ctx.cmd.q_init.ver);
 
        err = ionic_adminq_post_wait(qcq->lif, &ctx);
        if (err)
@@ -1378,6 +1384,7 @@ ionic_lif_rxq_init(struct ionic_qcq *qcq)
                ctx.cmd.q_init.ring_base);
        IONIC_PRINT(DEBUG, "rxq_init.ring_size %d",
                ctx.cmd.q_init.ring_size);
+       IONIC_PRINT(DEBUG, "rxq_init.ver %u", ctx.cmd.q_init.ver);
 
        err = ionic_adminq_post_wait(qcq->lif, &ctx);
        if (err)
@@ -1448,8 +1455,8 @@ ionic_lif_set_name(struct ionic_lif *lif)
                },
        };
 
-       snprintf(ctx.cmd.lif_setattr.name, sizeof(ctx.cmd.lif_setattr.name),
-               "%d", lif->port_id);
+       memcpy(ctx.cmd.lif_setattr.name, lif->name,
+               sizeof(ctx.cmd.lif_setattr.name) - 1);
 
        ionic_adminq_post_wait(lif, &ctx);
 }
@@ -1680,7 +1687,8 @@ ionic_lifs_size(struct ionic_adapter *adapter)
        nintrs = nlifs * 1 /* notifyq */;
 
        if (nintrs > dev_nintrs) {
-               IONIC_PRINT(ERR, "At most %d intr queues supported, minimum required is %u",
+               IONIC_PRINT(ERR,
+                       "At most %d intr supported, minimum req'd is %u",
                        dev_nintrs, nintrs);
                return -ENOSPC;
        }