remove extra parentheses in return statement
[dpdk.git] / app / test-pmd / config.c
index eb59d48..0062484 100644 (file)
 
 static char *flowtype_to_str(uint16_t flow_type);
 
+static const struct {
+       enum tx_pkt_split split;
+       const char *name;
+} tx_split_name[] = {
+       {
+               .split = TX_PKT_SPLIT_OFF,
+               .name = "off",
+       },
+       {
+               .split = TX_PKT_SPLIT_ON,
+               .name = "on",
+       },
+       {
+               .split = TX_PKT_SPLIT_RND,
+               .name = "rand",
+       },
+};
+
 struct rss_type_info {
        char str[32];
        uint64_t rss_type;
@@ -154,9 +172,7 @@ nic_stats_display(portid_t port_id)
                printf("  RX-packets: %-10"PRIu64" RX-missed: %-10"PRIu64" RX-bytes:  "
                       "%-"PRIu64"\n",
                       stats.ipackets, stats.imissed, stats.ibytes);
-               printf("  RX-badcrc:  %-10"PRIu64" RX-badlen: %-10"PRIu64" RX-errors: "
-                      "%-"PRIu64"\n",
-                      stats.ibadcrc, stats.ibadlen, stats.ierrors);
+               printf("  RX-errors: %-"PRIu64"\n", stats.ierrors);
                printf("  RX-nombuf:  %-10"PRIu64"\n",
                       stats.rx_nombuf);
                printf("  TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64" TX-bytes:  "
@@ -167,9 +183,7 @@ nic_stats_display(portid_t port_id)
                printf("  RX-packets:              %10"PRIu64"    RX-errors: %10"PRIu64
                       "    RX-bytes: %10"PRIu64"\n",
                       stats.ipackets, stats.ierrors, stats.ibytes);
-               printf("  RX-badcrc:               %10"PRIu64"    RX-badlen: %10"PRIu64
-                      "  RX-errors:  %10"PRIu64"\n",
-                      stats.ibadcrc, stats.ibadlen, stats.ierrors);
+               printf("  RX-errors:  %10"PRIu64"\n", stats.ierrors);
                printf("  RX-nombuf:               %10"PRIu64"\n",
                       stats.rx_nombuf);
                printf("  TX-packets:              %10"PRIu64"    TX-errors: %10"PRIu64
@@ -177,12 +191,6 @@ nic_stats_display(portid_t port_id)
                       stats.opackets, stats.oerrors, stats.obytes);
        }
 
-       /* stats fdir */
-       if (fdir_conf.mode != RTE_FDIR_MODE_NONE)
-               printf("  Fdirmiss:   %-10"PRIu64" Fdirmatch: %-10"PRIu64"\n",
-                      stats.fdirmiss,
-                      stats.fdirmatch);
-
        if (port->rx_queue_stats_mapping_enabled) {
                printf("\n");
                for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {
@@ -201,14 +209,6 @@ nic_stats_display(portid_t port_id)
                }
        }
 
-       /* Display statistics of XON/XOFF pause frames, if any. */
-       if ((stats.tx_pause_xon  | stats.rx_pause_xon |
-            stats.tx_pause_xoff | stats.rx_pause_xoff) > 0) {
-               printf("  RX-XOFF:    %-10"PRIu64" RX-XON:    %-10"PRIu64"\n",
-                      stats.rx_pause_xoff, stats.rx_pause_xon);
-               printf("  TX-XOFF:    %-10"PRIu64" TX-XON:    %-10"PRIu64"\n",
-                      stats.tx_pause_xoff, stats.tx_pause_xon);
-       }
        printf("  %s############################%s\n",
               nic_stats_border, nic_stats_border);
 }
@@ -750,7 +750,7 @@ ring_dma_zone_lookup(const char *ring_name, uint8_t port_id, uint16_t q_id)
                printf("%s ring memory zoneof (port %d, queue %d) not"
                       "found (zone name = %s\n",
                       ring_name, port_id, q_id, mz_name);
-       return (mz);
+       return mz;
 }
 
 union igb_ring_dword {
@@ -1251,10 +1251,7 @@ dcb_fwd_config_setup(void)
        /* reinitialize forwarding streams */
        init_fwd_streams();
        sm_id = 0;
-       if ((rxp & 0x1) == 0)
-               txp = (portid_t) (rxp + 1);
-       else
-               txp = (portid_t) (rxp - 1);
+       txp = 1;
        /* get the dcb info on the first RX and TX ports */
        (void)rte_eth_dev_get_dcb_info(fwd_ports_ids[rxp], &rxp_dcb_info);
        (void)rte_eth_dev_get_dcb_info(fwd_ports_ids[txp], &txp_dcb_info);
@@ -1582,6 +1579,49 @@ set_nb_pkt_per_burst(uint16_t nb)
               (unsigned int) nb_pkt_per_burst);
 }
 
+static const char *
+tx_split_get_name(enum tx_pkt_split split)
+{
+       uint32_t i;
+
+       for (i = 0; i != RTE_DIM(tx_split_name); i++) {
+               if (tx_split_name[i].split == split)
+                       return tx_split_name[i].name;
+       }
+       return NULL;
+}
+
+void
+set_tx_pkt_split(const char *name)
+{
+       uint32_t i;
+
+       for (i = 0; i != RTE_DIM(tx_split_name); i++) {
+               if (strcmp(tx_split_name[i].name, name) == 0) {
+                       tx_pkt_split = tx_split_name[i].split;
+                       return;
+               }
+       }
+       printf("unknown value: \"%s\"\n", name);
+}
+
+void
+show_tx_pkt_segments(void)
+{
+       uint32_t i, n;
+       const char *split;
+
+       n = tx_pkt_nb_segs;
+       split = tx_split_get_name(tx_pkt_split);
+
+       printf("Number of segments: %u\n", n);
+       printf("Segment sizes: ");
+       for (i = 0; i != n - 1; i++)
+               printf("%hu,", tx_pkt_seg_lengths[i]);
+       printf("%hu\n", tx_pkt_seg_lengths[i]);
+       printf("Split packet: %s\n", split);
+}
+
 void
 set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs)
 {