app/crypto-perf: set AAD after the crypto operation
[dpdk.git] / lib / librte_eal / common / eal_common_bus.c
index 1d3635c..c3c77f4 100644 (file)
@@ -1,8 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2016 NXP
- *   All rights reserved.
+ *   Copyright 2016 NXP.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -74,11 +73,9 @@ rte_bus_scan(void)
 
        TAILQ_FOREACH(bus, &rte_bus_list, next) {
                ret = bus->scan();
-               if (ret) {
+               if (ret)
                        RTE_LOG(ERR, EAL, "Scan for (%s) bus failed.\n",
                                bus->name);
-                       return ret;
-               }
        }
 
        return 0;
@@ -98,20 +95,16 @@ rte_bus_probe(void)
                }
 
                ret = bus->probe();
-               if (ret) {
+               if (ret)
                        RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n",
                                bus->name);
-                       return ret;
-               }
        }
 
        if (vbus) {
                ret = vbus->probe();
-               if (ret) {
+               if (ret)
                        RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n",
                                vbus->name);
-                       return ret;
-               }
        }
 
        return 0;
@@ -223,3 +216,26 @@ rte_bus_find_by_device_name(const char *str)
                c[0] = '\0';
        return rte_bus_find(NULL, bus_can_parse, name);
 }
+
+
+/*
+ * Get iommu class of devices on the bus.
+ */
+enum rte_iova_mode
+rte_bus_get_iommu_class(void)
+{
+       int mode = RTE_IOVA_DC;
+       struct rte_bus *bus;
+
+       TAILQ_FOREACH(bus, &rte_bus_list, next) {
+
+               if (bus->get_iommu_class)
+                       mode |= bus->get_iommu_class();
+       }
+
+       if (mode != RTE_IOVA_VA) {
+               /* Use default IOVA mode */
+               mode = RTE_IOVA_PA;
+       }
+       return mode;
+}