net/qede/base: enable control frame filtering
[dpdk.git] / app / test-pmd / config.c
index 97020fb..3b921cf 100644 (file)
@@ -577,7 +577,7 @@ port_offload_cap_display(portid_t port_id)
        }
 
        if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM) {
-               printf("RX Outer IPv4 checksum:               ");
+               printf("RX Outer IPv4 checksum:        ");
                if (ports[port_id].dev_conf.rxmode.offloads &
                    DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM)
                        printf("on\n");
@@ -594,19 +594,37 @@ port_offload_cap_display(portid_t port_id)
                        printf("off\n");
        }
 
-       if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) {
-               printf("VLAN insert:                   ");
-               if (ports[port_id].dev_conf.txmode.offloads &
-                   DEV_TX_OFFLOAD_VLAN_INSERT)
+       if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP) {
+               printf("HW timestamp:                  ");
+               if (ports[port_id].dev_conf.rxmode.offloads &
+                   DEV_RX_OFFLOAD_TIMESTAMP)
                        printf("on\n");
                else
                        printf("off\n");
        }
 
-       if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP) {
-               printf("HW timestamp:                  ");
+       if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_KEEP_CRC) {
+               printf("Rx Keep CRC:                   ");
                if (ports[port_id].dev_conf.rxmode.offloads &
-                   DEV_RX_OFFLOAD_TIMESTAMP)
+                   DEV_RX_OFFLOAD_KEEP_CRC)
+                       printf("on\n");
+               else
+                       printf("off\n");
+       }
+
+       if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SECURITY) {
+               printf("RX offload security:           ");
+               if (ports[port_id].dev_conf.rxmode.offloads &
+                   DEV_RX_OFFLOAD_SECURITY)
+                       printf("on\n");
+               else
+                       printf("off\n");
+       }
+
+       if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) {
+               printf("VLAN insert:                   ");
+               if (ports[port_id].dev_conf.txmode.offloads &
+                   DEV_TX_OFFLOAD_VLAN_INSERT)
                        printf("on\n");
                else
                        printf("off\n");
@@ -1123,6 +1141,7 @@ static const struct {
        MK_FLOW_ACTION(END, 0),
        MK_FLOW_ACTION(VOID, 0),
        MK_FLOW_ACTION(PASSTHRU, 0),
+       MK_FLOW_ACTION(JUMP, 0),
        MK_FLOW_ACTION(MARK, sizeof(struct rte_flow_action_mark)),
        MK_FLOW_ACTION(FLAG, 0),
        MK_FLOW_ACTION(QUEUE, sizeof(struct rte_flow_action_queue)),
@@ -1337,11 +1356,12 @@ port_flow_complain(struct rte_flow_error *error)
                errstr = "unknown type";
        else
                errstr = errstrlist[error->type];
-       printf("Caught error type %d (%s): %s%s\n",
+       printf("Caught error type %d (%s): %s%s: %s\n",
               error->type, errstr,
               error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
                                        error->cause), buf) : "",
-              error->message ? error->message : "(no stated reason)");
+              error->message ? error->message : "(no stated reason)",
+              rte_strerror(err));
        return -err;
 }
 
@@ -2177,15 +2197,11 @@ rss_fwd_config_setup(void)
                fs->tx_queue = rxq;
                fs->peer_addr = fs->tx_port;
                fs->retry_enabled = retry_enabled;
-               rxq = (queueid_t) (rxq + 1);
-               if (rxq < nb_q)
-                       continue;
-               /*
-                * rxq == nb_q
-                * Restart from RX queue 0 on next RX port
-                */
-               rxq = 0;
                rxp++;
+               if (rxp < nb_fwd_ports)
+                       continue;
+               rxp = 0;
+               rxq++;
        }
 }
 
@@ -2332,6 +2348,55 @@ icmp_echo_config_setup(void)
        }
 }
 
+#if defined RTE_LIBRTE_PMD_SOFTNIC
+static void
+softnic_fwd_config_setup(void)
+{
+       struct rte_port *port;
+       portid_t pid, softnic_portid;
+       queueid_t i;
+       uint8_t softnic_enable = 0;
+
+       RTE_ETH_FOREACH_DEV(pid) {
+                       port = &ports[pid];
+                       const char *driver = port->dev_info.driver_name;
+
+                       if (strcmp(driver, "net_softnic") == 0) {
+                               softnic_portid = pid;
+                               softnic_enable = 1;
+                               break;
+                       }
+       }
+
+       if (softnic_enable == 0) {
+               printf("Softnic mode not configured(%s)!\n", __func__);
+               return;
+       }
+
+       cur_fwd_config.nb_fwd_ports = 1;
+       cur_fwd_config.nb_fwd_streams = (streamid_t) nb_rxq;
+
+       /* Re-initialize forwarding streams */
+       init_fwd_streams();
+
+       /*
+        * In the softnic forwarding test, the number of forwarding cores
+        * is set to one and remaining are used for softnic packet processing.
+        */
+       cur_fwd_config.nb_fwd_lcores = 1;
+       setup_fwd_config_of_each_lcore(&cur_fwd_config);
+
+       for (i = 0; i < cur_fwd_config.nb_fwd_streams; i++) {
+               fwd_streams[i]->rx_port   = softnic_portid;
+               fwd_streams[i]->rx_queue  = i;
+               fwd_streams[i]->tx_port   = softnic_portid;
+               fwd_streams[i]->tx_queue  = i;
+               fwd_streams[i]->peer_addr = fwd_streams[i]->tx_port;
+               fwd_streams[i]->retry_enabled = retry_enabled;
+       }
+}
+#endif
+
 void
 fwd_config_setup(void)
 {
@@ -2340,6 +2405,14 @@ fwd_config_setup(void)
                icmp_echo_config_setup();
                return;
        }
+
+#if defined RTE_LIBRTE_PMD_SOFTNIC
+       if (strcmp(cur_fwd_eng->fwd_mode_name, "softnic") == 0) {
+               softnic_fwd_config_setup();
+               return;
+       }
+#endif
+
        if ((nb_rxq > 1) && (nb_txq > 1)){
                if (dcb_config)
                        dcb_fwd_config_setup();
@@ -2350,6 +2423,23 @@ fwd_config_setup(void)
                simple_fwd_config_setup();
 }
 
+static const char *
+mp_alloc_to_str(uint8_t mode)
+{
+       switch (mode) {
+       case MP_ALLOC_NATIVE:
+               return "native";
+       case MP_ALLOC_ANON:
+               return "anon";
+       case MP_ALLOC_XMEM:
+               return "xmem";
+       case MP_ALLOC_XMEM_HUGE:
+               return "xmemhuge";
+       default:
+               return "invalid";
+       }
+}
+
 void
 pkt_fwd_config_display(struct fwd_config *cfg)
 {
@@ -2358,12 +2448,12 @@ pkt_fwd_config_display(struct fwd_config *cfg)
        streamid_t sm_id;
 
        printf("%s packet forwarding%s - ports=%d - cores=%d - streams=%d - "
-               "NUMA support %s, MP over anonymous pages %s\n",
+               "NUMA support %s, MP allocation mode: %s\n",
                cfg->fwd_eng->fwd_mode_name,
                retry_enabled == 0 ? "" : " with retry",
                cfg->nb_fwd_ports, cfg->nb_fwd_lcores, cfg->nb_fwd_streams,
                numa_support == 1 ? "enabled" : "disabled",
-               mp_anon != 0 ? "enabled" : "disabled");
+               mp_alloc_to_str(mp_alloc_type));
 
        if (retry_enabled)
                printf("TX retry num: %u, delay between TX retries: %uus\n",