drivers/net: remove redundant new line from logs
[dpdk.git] / drivers / net / sfc / sfc_ev.c
index de42845..f717faa 100644 (file)
@@ -104,7 +104,7 @@ sfc_ev_rx(void *arg, __rte_unused uint32_t label, uint32_t id,
                        evq->exception = B_TRUE;
                        sfc_err(evq->sa,
                                "EVQ %u RxQ %u invalid RX abort "
-                               "(id=%#x size=%u flags=%#x); needs restart\n",
+                               "(id=%#x size=%u flags=%#x); needs restart",
                                evq->evq_index, sfc_rxq_sw_index(rxq),
                                id, size, flags);
                        goto done;
@@ -119,7 +119,7 @@ sfc_ev_rx(void *arg, __rte_unused uint32_t label, uint32_t id,
 
                sfc_err(evq->sa,
                        "EVQ %u RxQ %u completion out of order "
-                       "(id=%#x delta=%u flags=%#x); needs restart\n",
+                       "(id=%#x delta=%u flags=%#x); needs restart",
                        evq->evq_index, sfc_rxq_sw_index(rxq), id, delta,
                        flags);
 
@@ -287,11 +287,25 @@ sfc_ev_link_change(void *arg, efx_link_mode_t link_mode)
        struct sfc_adapter *sa = evq->sa;
        struct rte_eth_link *dev_link = &sa->eth_dev->data->dev_link;
        struct rte_eth_link new_link;
+       uint64_t new_link_u64;
+       uint64_t old_link_u64;
 
        EFX_STATIC_ASSERT(sizeof(*dev_link) == sizeof(rte_atomic64_t));
 
        sfc_port_link_mode_to_info(link_mode, &new_link);
-       rte_atomic64_set((rte_atomic64_t *)dev_link, *(uint64_t *)&new_link);
+
+       new_link_u64 = *(uint64_t *)&new_link;
+       do {
+               old_link_u64 = rte_atomic64_read((rte_atomic64_t *)dev_link);
+               if (old_link_u64 == new_link_u64)
+                       break;
+
+               if (rte_atomic64_cmpset((volatile uint64_t *)dev_link,
+                                       old_link_u64, new_link_u64)) {
+                       evq->sa->port.lsc_seq++;
+                       break;
+               }
+       } while (B_TRUE);
 
        return B_FALSE;
 }
@@ -485,10 +499,14 @@ sfc_ev_mgmt_periodic_qpoll(void *arg)
 
        rc = rte_eal_alarm_set(SFC_MGMT_EV_QPOLL_PERIOD_US,
                               sfc_ev_mgmt_periodic_qpoll, sa);
-       if (rc != 0)
-               sfc_panic(sa,
-                         "cannot rearm management EVQ polling alarm (rc=%d)",
-                         rc);
+       if (rc == -ENOTSUP) {
+               sfc_warn(sa, "alarms are not supported");
+               sfc_warn(sa, "management EVQ must be polled indirectly using no-wait link status update");
+       } else if (rc != 0) {
+               sfc_err(sa,
+                       "cannot rearm management EVQ polling alarm (rc=%d)",
+                       rc);
+       }
 }
 
 static void
@@ -521,6 +539,12 @@ sfc_ev_start(struct sfc_adapter *sa)
        if (rc != 0)
                goto fail_mgmt_evq_start;
 
+       if (sa->intr.lsc_intr) {
+               rc = sfc_ev_qprime(sa->evq_info[sa->mgmt_evq_index].evq);
+               if (rc != 0)
+                       goto fail_evq0_prime;
+       }
+
        rte_spinlock_unlock(&sa->mgmt_evq_lock);
 
        /*
@@ -538,6 +562,9 @@ sfc_ev_start(struct sfc_adapter *sa)
 
        return 0;
 
+fail_evq0_prime:
+       sfc_ev_qstop(sa, 0);
+
 fail_mgmt_evq_start:
        rte_spinlock_unlock(&sa->mgmt_evq_lock);
        efx_ev_fini(sa->nic);
@@ -639,7 +666,10 @@ sfc_ev_qinit_info(struct sfc_adapter *sa, unsigned int sw_index)
        SFC_ASSERT(rte_is_power_of_2(max_entries));
 
        evq_info->max_entries = max_entries;
-       evq_info->flags = sa->evq_flags | EFX_EVQ_FLAGS_NOTIFY_DISABLED;
+       evq_info->flags = sa->evq_flags |
+               ((sa->intr.lsc_intr && sw_index == sa->mgmt_evq_index) ?
+                       EFX_EVQ_FLAGS_NOTIFY_INTERRUPT :
+                       EFX_EVQ_FLAGS_NOTIFY_DISABLED);
 
        return 0;
 }