Lines Matching +full:v +full:- +full:neg +full:- +full:supply

1 /*-
87 unsigned char islog2; /* Field contains the base-2 log of the value */
116 "\tloadboot-cfg <bc.bin> install boot config\n" in usage()
117 "\tloadboot-cfg clear remove boot config\n" in usage()
118 "\tloadcfg <fw-config.txt> install configuration file\n" in usage()
120 "\tloadfw <fw-image.bin> install firmware\n" in usage()
128 "\tsched-class params <param> <val> .. configure TX scheduler class\n" in usage()
129 "\tsched-queue <port> <queue> <class> bind NIC queues to TX Scheduling class\n" in usage()
203 char *p, *v; in register_io() local
219 v = p + 1; in register_io()
220 p = str_to_number(v, NULL, &val); in register_io()
223 warnx("invalid value \"%s\"", v); in register_io()
263 return (val >> shift) & ((1 << len) - 1); in xtract()
271 for ( ; reg_array->name; ++reg_array) in dump_block_regs()
272 if (!reg_array->len) { in dump_block_regs()
273 reg_val = regs[reg_array->addr / 4]; in dump_block_regs()
274 printf("[%#7x] %-47s %#-10x %u\n", reg_array->addr, in dump_block_regs()
275 reg_array->name, reg_val, reg_val); in dump_block_regs()
277 uint32_t v = xtract(reg_val, reg_array->addr, in dump_block_regs() local
278 reg_array->len); in dump_block_regs()
280 printf(" %*u:%u %-47s %#-10x %u\n", in dump_block_regs()
281 reg_array->addr < 10 ? 3 : 2, in dump_block_regs()
282 reg_array->addr + reg_array->len - 1, in dump_block_regs()
283 reg_array->addr, reg_array->name, v, v); in dump_block_regs()
304 for ( ; nmodules; nmodules--, modtab++) in dump_regs_table()
305 fprintf(stderr, " %s", modtab->name); in dump_regs_table()
311 for ( ; nmodules; nmodules--, modtab++) { in dump_regs_table()
315 if (!strcmp(argv[i], modtab->name)) in dump_regs_table()
320 dump_block_regs(modtab->ri, regs); in dump_regs_table()
577 * Parse an argument sub-vector as a { <parameter name> <value>[:<mask>] }
578 * ordered tuple. If the parameter name in the argument sub-vector does not
629 * Parse an argument sub-vector as a { <parameter name> <addr>[/<mask>] }
630 * ordered tuple. If the parameter name in the argument sub-vector does not
638 * family -- IPv4 or IPv6 -- of the address[/mask] and return its actual
735 for (m = mask; masksize >= 8; m++, masksize -= 8) in parse_ipaddr()
738 *m = ~0 << (8 - masksize); in parse_ipaddr()
745 * Parse an argument sub-vector as a { <parameter name> <value> } ordered
746 * tuple. If the parameter name in the argument sub-vector does not match the
794 printf("%4d", t->idx); in do_show_one_filter_info()
795 if (t->hits == UINT64_MAX) in do_show_one_filter_info()
796 printf(" %8s", "-"); in do_show_one_filter_info()
798 printf(" %8ju", t->hits); in do_show_one_filter_info()
806 printf(" %1d/%1d", t->fs.val.fcoe, t->fs.mask.fcoe); in do_show_one_filter_info()
809 printf(" %1d/%1d", t->fs.val.iport, t->fs.mask.iport); in do_show_one_filter_info()
814 t->fs.val.pfvf_vld, in do_show_one_filter_info()
815 (t->fs.val.vnic >> 13) & 0x7, in do_show_one_filter_info()
816 t->fs.val.vnic & 0x1fff, in do_show_one_filter_info()
817 t->fs.mask.pfvf_vld, in do_show_one_filter_info()
818 (t->fs.mask.vnic >> 13) & 0x7, in do_show_one_filter_info()
819 t->fs.mask.vnic & 0x1fff); in do_show_one_filter_info()
822 t->fs.val.ovlan_vld, t->fs.val.vnic, in do_show_one_filter_info()
823 t->fs.mask.ovlan_vld, t->fs.mask.vnic); in do_show_one_filter_info()
828 t->fs.val.vlan_vld, t->fs.val.vlan, in do_show_one_filter_info()
829 t->fs.mask.vlan_vld, t->fs.mask.vlan); in do_show_one_filter_info()
832 printf(" %02x/%02x", t->fs.val.tos, t->fs.mask.tos); in do_show_one_filter_info()
835 printf(" %02x/%02x", t->fs.val.proto, t->fs.mask.proto); in do_show_one_filter_info()
838 printf(" %04x/%04x", t->fs.val.ethtype, in do_show_one_filter_info()
839 t->fs.mask.ethtype); in do_show_one_filter_info()
842 printf(" %03x/%03x", t->fs.val.macidx, in do_show_one_filter_info()
843 t->fs.mask.macidx); in do_show_one_filter_info()
846 printf(" %1x/%1x", t->fs.val.matchtype, in do_show_one_filter_info()
847 t->fs.mask.matchtype); in do_show_one_filter_info()
850 printf(" %1d/%1d", t->fs.val.frag, t->fs.mask.frag); in do_show_one_filter_info()
861 filters_show_ipaddr(t->fs.type, t->fs.val.dip, t->fs.mask.dip); in do_show_one_filter_info()
862 filters_show_ipaddr(t->fs.type, t->fs.val.sip, t->fs.mask.sip); in do_show_one_filter_info()
864 t->fs.val.dport, t->fs.mask.dport, in do_show_one_filter_info()
865 t->fs.val.sport, t->fs.mask.sport); in do_show_one_filter_info()
870 if (t->fs.action == FILTER_DROP) in do_show_one_filter_info()
872 else if (t->fs.action == FILTER_SWITCH) { in do_show_one_filter_info()
873 printf(" Switch: port=%d", t->fs.eport); in do_show_one_filter_info()
874 if (t->fs.newdmac) in do_show_one_filter_info()
878 t->fs.dmac[0], t->fs.dmac[1], in do_show_one_filter_info()
879 t->fs.dmac[2], t->fs.dmac[3], in do_show_one_filter_info()
880 t->fs.dmac[4], t->fs.dmac[5], in do_show_one_filter_info()
881 t->l2tidx); in do_show_one_filter_info()
882 if (t->fs.newsmac) in do_show_one_filter_info()
886 t->fs.smac[0], t->fs.smac[1], in do_show_one_filter_info()
887 t->fs.smac[2], t->fs.smac[3], in do_show_one_filter_info()
888 t->fs.smac[4], t->fs.smac[5], in do_show_one_filter_info()
889 t->smtidx); in do_show_one_filter_info()
890 if (t->fs.newvlan == VLAN_REMOVE) in do_show_one_filter_info()
892 else if (t->fs.newvlan == VLAN_INSERT) in do_show_one_filter_info()
893 printf(", vlan=insert(%x)", t->fs.vlan); in do_show_one_filter_info()
894 else if (t->fs.newvlan == VLAN_REWRITE) in do_show_one_filter_info()
895 printf(", vlan=rewrite(%x)", t->fs.vlan); in do_show_one_filter_info()
898 if (t->fs.dirsteer == 0) { in do_show_one_filter_info()
900 if (t->fs.maskhash) in do_show_one_filter_info()
901 printf("(region %d)", t->fs.iq << 1); in do_show_one_filter_info()
903 printf("%d", t->fs.iq); in do_show_one_filter_info()
904 if (t->fs.dirsteerhash == 0) in do_show_one_filter_info()
910 if (g.chip_id <= 5 && t->fs.prio) in do_show_one_filter_info()
912 if (t->fs.rpttid) in do_show_one_filter_info()
1030 for (; argc; argc--, argv++) { in set_filter_mode()
1258 else if (!strcmp(argv[start_arg + 1], "dip-dp")) in set_filter()
1260 else if (!strcmp(argv[start_arg + 1], "dip-dp-sip")) in set_filter()
1262 else if (!strcmp(argv[start_arg + 1], "dip-dp-sp")) in set_filter()
1264 else if (!strcmp(argv[start_arg + 1], "sip-sp")) in set_filter()
1266 else if (!strcmp(argv[start_arg + 1], "dip-sip-sp")) in set_filter()
1272 "dip-dp, dip-dp-sip, dip-dp-sp, sip-sp, " in set_filter()
1273 "dip-sip-sp, and all", argv[start_arg + 1]); in set_filter()
1396 return set_filter_mode(argc - 1, argv + 1, hashfilter); in filter_cmd()
1407 idx = (uint32_t) -1; in filter_cmd()
1446 argc--; in filter_cmd()
1455 * Shows the fields of a multi-word structure. The structure is considered to
1456 * consist of @nwords 32-bit words (i.e, it's an (@nwords * 32)-bit structure)
1457 * whose fields are described by @fd. The 32-bit words are given in @words
1458 * starting with the least significant 32-bit word.
1466 for (p = fd; p->name; p++) in show_struct()
1467 w = max(w, strlen(p->name)); in show_struct()
1469 while (fd->name) { in show_struct()
1471 int first_word = fd->start / 32; in show_struct()
1472 int shift = fd->start % 32; in show_struct()
1473 int width = fd->end - fd->start + 1; in show_struct()
1474 unsigned long long mask = (1ULL << width) - 1; in show_struct()
1477 ((uint64_t)words[first_word + 1] << (32 - shift)); in show_struct()
1479 data |= ((uint64_t)words[first_word + 2] << (64 - shift)); in show_struct()
1481 if (fd->islog2) in show_struct()
1483 printf("%-*s ", w, fd->name); in show_struct()
1484 printf(fd->hex ? "%#llx\n" : "%llu\n", data << fd->shift); in show_struct()
1728 if (p->mem_id == SGE_CONTEXT_EGRESS) { in show_t5t6_ctxt()
1729 if (p->data[0] & 2) in show_t5t6_ctxt()
1730 show_struct(p->data, 6, fl_t5); in show_t5t6_ctxt()
1732 show_struct(p->data, 6, egress_t5); in show_t5t6_ctxt()
1734 show_struct(p->data, 6, egress_t6); in show_t5t6_ctxt()
1735 } else if (p->mem_id == SGE_CONTEXT_FLM) in show_t5t6_ctxt()
1736 show_struct(p->data, 3, vers == 5 ? flm_t5 : flm_t6); in show_t5t6_ctxt()
1737 else if (p->mem_id == SGE_CONTEXT_INGRESS) in show_t5t6_ctxt()
1738 show_struct(p->data, 5, vers == 5 ? ingress_t5 : ingress_t6); in show_t5t6_ctxt()
1739 else if (p->mem_id == SGE_CONTEXT_CNM) in show_t5t6_ctxt()
1740 show_struct(p->data, 1, conm_t5); in show_t5t6_ctxt()
1869 if (p->mem_id == SGE_CONTEXT_EGRESS) in show_t4_ctxt()
1870 show_struct(p->data, 6, (p->data[0] & 2) ? fl_t4 : egress_t4); in show_t4_ctxt()
1871 else if (p->mem_id == SGE_CONTEXT_FLM) in show_t4_ctxt()
1872 show_struct(p->data, 3, flm_t4); in show_t4_ctxt()
1873 else if (p->mem_id == SGE_CONTEXT_INGRESS) in show_t4_ctxt()
1874 show_struct(p->data, 5, ingress_t4); in show_t4_ctxt()
1875 else if (p->mem_id == SGE_CONTEXT_CNM) in show_t4_ctxt()
1876 show_struct(p->data, 1, conm_t4); in show_t4_ctxt()
2176 * Display memory as list of 'n' 4-byte values per line.
2185 for (i = 0; len && i < n; i++, buf++, len -= 4) { in show_mem()
2223 * Display TCB as list of 'n' 4-byte values per line.
2233 for (i = 0; len && i < n; i++, buf++, len -= 4) { in show_tcb()
2379 port_idx = t.tp.port - 4; in show_tracers()
2382 port_idx = t.tp.port - 8; in show_tracers()
2385 port_idx = t.tp.port - 12; in show_tracers()
2388 port_idx = t.tp.port - 16; in show_tracers()
2456 * matching). Right now this is a quick-n-dirty implementation that traces the
2482 port = argv[0][2] - '0'; in set_tracer()
2489 port = argv[0][2] - '0'; in set_tracer()
2496 port = argv[0][2] - '0'; in set_tracer()
2555 return set_tracer(idx, argc - 1, argv + 1); in tracer_cmd()
2603 warnx("must supply a port"); in modinfo()
2646 string[i - SFF_8472_VENDOR_START] = i2cd.data[0]; in modinfo()
2655 string[i - SFF_8472_SN_START] = i2cd.data[0]; in modinfo()
2664 string[i - SFF_8472_PN_START] = i2cd.data[0]; in modinfo()
2673 string[i - SFF_8472_REV_START] = i2cd.data[0]; in modinfo()
2694 printf("-"); in modinfo()
2762 op.subcmd = -1; in sched_class()
2763 op.type = -1; in sched_class()
2765 warnx("missing scheduling sub-command"); in sched_class()
2770 op.u.config.minmax = -1; in sched_class()
2776 op.u.params.weight = op.u.params.pktsize = -1; in sched_class()
2778 warnx("invalid scheduling sub-command \"%s\"", argv[0]); in sched_class()
2822 if (!strcmp(args[1], "cl-rl")) in sched_class()
2824 else if (!strcmp(args[1], "cl-wrr")) in sched_class()
2826 else if (!strcmp(args[1], "ch-rl")) in sched_class()
2842 } else if (!strcmp(args[0], "rate-unit")) { in sched_class()
2848 warnx("invalid rate-unit parameter \"%s\"", in sched_class()
2852 } else if (!strcmp(args[0], "rate-mode")) { in sched_class()
2858 warnx("invalid rate-mode parameter \"%s\"", in sched_class()
2866 else if (!get_sched_param("min-rate", args, &l)) in sched_class()
2868 else if (!get_sched_param("max-rate", args, &l)) in sched_class()
2872 else if (!get_sched_param("pkt-size", args, &l)) in sched_class()
2910 warnx("sched params \"rate-unit\" parameter missing"); in sched_class()
2916 warnx("sched params \"rate-mode\" parameter missing"); in sched_class()
2932 warnx("sched params \"max-rate\" missing for " in sched_class()
2933 "rate-limit level"); in sched_class()
2939 "(not 1-99) for weighted-round-robin level"); in sched_class()
2944 warnx("sched params \"pkt-size\" missing for " in sched_class()
2945 "rate-limit level"); in sched_class()
2950 warnx("sched params mode flow needs rate-mode absolute"); in sched_class()
2955 warnx("sched params \"max-rate\" takes " in sched_class()
2956 "percentage value(1-100) for rate-mode relative"); in sched_class()
2961 warnx("sched params \"max-rate\" takes " in sched_class()
2962 "value(1-100000000) for rate-mode absolute"); in sched_class()
2967 warnx("sched params \"max-rate\" is less than " in sched_class()
2968 "\"min-rate\""); in sched_class()
2974 warnx("%d error%s in sched-class command", errs, in sched_class()
3003 op.queue = -1; in sched_queue()
3006 if (*p || val < -1) { in sched_queue()
3014 op.cl = -1; in sched_queue()
3017 if (*p || val < -1) { in sched_queue()
3043 os->offload = (*pneg + 1) & 1; in parse_offload_settings_word()
3046 os->rx_coalesce = (*pneg + 1) & 1; in parse_offload_settings_word()
3049 os->tstamp = (*pneg + 1) & 1; in parse_offload_settings_word()
3052 os->sack = (*pneg + 1) & 1; in parse_offload_settings_word()
3055 os->nagle = (*pneg + 1) & 1; in parse_offload_settings_word()
3058 os->ecn = (*pneg + 1) & 1; in parse_offload_settings_word()
3061 os->ddp = (*pneg + 1) & 1; in parse_offload_settings_word()
3064 os->tls = (*pneg + 1) & 1; in parse_offload_settings_word()
3090 os->cong_algo = 0; in parse_offload_settings_word()
3092 os->cong_algo = 1; in parse_offload_settings_word()
3094 os->cong_algo = 2; in parse_offload_settings_word()
3096 os->cong_algo = 3; in parse_offload_settings_word()
3102 val = -1; in parse_offload_settings_word()
3104 /* (nsched_cls - 1) is spelled 15 here. */ in parse_offload_settings_word()
3111 os->sched_class = val; in parse_offload_settings_word()
3129 os->txq = val; in parse_offload_settings_word()
3130 os->rxq = val; in parse_offload_settings_word()
3132 os->txq = val; in parse_offload_settings_word()
3134 os->rxq = val; in parse_offload_settings_word()
3139 val = -1; in parse_offload_settings_word()
3147 os->mss = val; in parse_offload_settings_word()
3160 const char *ws = " \f\n\r\v\t"; in parse_offload_settings()
3162 int rc, nsettings, neg; in parse_offload_settings() local
3165 .rx_coalesce = -1, in parse_offload_settings()
3166 .cong_algo = -1, in parse_offload_settings()
3167 .sched_class = -1, in parse_offload_settings()
3168 .tstamp = -1, in parse_offload_settings()
3169 .sack = -1, in parse_offload_settings()
3170 .nagle = -1, in parse_offload_settings()
3171 .ecn = -1, in parse_offload_settings()
3172 .ddp = -1, in parse_offload_settings()
3173 .tls = -1, in parse_offload_settings()
3176 .mss = -1, in parse_offload_settings()
3189 neg = 0; in parse_offload_settings()
3194 rc = parse_offload_settings_word(s, &next, ws, &neg, os); in parse_offload_settings()
3203 if (neg > 0) { in parse_offload_settings()
3204 warnx("%d stray negation(s) at end of offload settings", neg); in parse_offload_settings()
3220 llen--; in isempty_line()
3236 /* check for special strings: "-", "all", "any" */ in special_offload_rule()
3237 if (*str == '-') { in special_offload_rule()
3253 * A rule has 3 parts: an open-type, a match expression, and offload settings.
3255 * [<open-type>] <expr> => <settings>
3269 s = &line[llen - 1]; in parse_offload_policy_line()
3271 *s-- = '\0'; in parse_offload_policy_line()
3272 llen--; in parse_offload_policy_line()
3287 r->open_type = *line; in parse_offload_policy_line()
3290 warnx("invalid socket-type \"%c\" on line %zd.", *line, lno); in parse_offload_policy_line()
3296 r->open_type, lno); in parse_offload_policy_line()
3317 * <expr> is either a special name (all, any) or a pcap-filter(7). in parse_offload_policy_line()
3318 * In case of a special name the bpf_prog stays all-zero. in parse_offload_policy_line()
3321 if (pcap_compile(pd, &r->bpf_prog, expr, 1, in parse_offload_policy_line()
3330 if (parse_offload_settings(settings, &r->settings) != 0) { in parse_offload_policy_line()
3333 pcap_freecode(&r->bpf_prog); in parse_offload_policy_line()
3349 for (i = 0; i < op->nrules; i++) { in free_offload_policy()
3352 * for an rule that matches on 'any/all/-'. in free_offload_policy()
3354 pcap_freecode(&op->rule[i].bpf_prog); in free_offload_policy()
3356 free(op->rule); in free_offload_policy()
3357 op->nrules = 0; in free_offload_policy()
3358 op->rule = NULL; in free_offload_policy()
3364 * Fills up op->nrules and op->rule.
3392 op->nrules = 0; in parse_offload_policy()
3393 op->rule = NULL; in parse_offload_policy()
3396 while ((llen = getline(&line, &lcap, fp)) != -1) { in parse_offload_policy()
3403 if (op->nrules == maxrules) { in parse_offload_policy()
3405 r = realloc(op->rule, in parse_offload_policy()
3413 op->rule = r; in parse_offload_policy()
3416 r = &op->rule[op->nrules]; in parse_offload_policy()
3423 op->nrules++; in parse_offload_policy()
3434 if (op->nrules == 0) { in parse_offload_policy()
3543 int rc = -1; in run_cmd()
3547 argc--; in run_cmd()
3574 else if (!strcmp(cmd, "sched-class")) in run_cmd()
3576 else if (!strcmp(cmd, "sched-queue")) in run_cmd()
3582 else if (!strcmp(cmd, "loadboot-cfg")) in run_cmd()
3660 if (len < 2 || isdigit(s[0]) || !isdigit(s[len - 1])) in open_nexus_device()
3662 for (num = s + len - 1; isdigit(*num); num--) in open_nexus_device()
3701 int rc = -1; in main()
3706 if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) { in main()
3720 argc -= 2; in main()