Lines Matching +full:pd +full:- +full:revision
1 /*-
88 unsigned char islog2; /* Field contains the base-2 log of the value */
118 "\tloadboot-cfg <bc.bin> install boot config\n"
119 "\tloadboot-cfg clear remove boot config\n"
120 "\tloadcfg <fw-config.txt> install configuration file\n"
122 "\tloadfw <fw-image.bin> install firmware\n"
130 "\tsched-class params <param> <val> .. configure TX scheduler class\n"
131 "\tsched-queue <port> <queue> <class> bind NIC queues to TX Scheduling class\n"
265 return (val >> shift) & ((1 << len) - 1);
273 for ( ; reg_array->name; ++reg_array)
274 if (!reg_array->len) {
275 reg_val = regs[reg_array->addr / 4];
276 printf("[%#7x] %-47s %#-10x %u\n", reg_array->addr,
277 reg_array->name, reg_val, reg_val);
279 uint32_t v = xtract(reg_val, reg_array->addr,
280 reg_array->len);
282 printf(" %*u:%u %-47s %#-10x %u\n",
283 reg_array->addr < 10 ? 3 : 2,
284 reg_array->addr + reg_array->len - 1,
285 reg_array->addr, reg_array->name, v, v);
306 for ( ; nmodules; nmodules--, modtab++)
307 fprintf(stderr, " %s", modtab->name);
313 for ( ; nmodules; nmodules--, modtab++) {
317 if (!strcmp(argv[i], modtab->name))
322 dump_block_regs(modtab->ri, regs);
540 int vers, revision, rc;
557 revision = (regs.version >> 10) & 0x3f;
560 if (revision == 0x3f)
565 if (revision == 0x3f)
570 if (revision == 0x3f)
575 if (revision == 0x3f)
581 g.nexus, vers, revision);
640 * Parse an argument sub-vector as a { <parameter name> <value>[:<mask>] }
641 * ordered tuple. If the parameter name in the argument sub-vector does not
692 * Parse an argument sub-vector as a { <parameter name> <addr>[/<mask>] }
693 * ordered tuple. If the parameter name in the argument sub-vector does not
701 * family -- IPv4 or IPv6 -- of the address[/mask] and return its actual
798 for (m = mask; masksize >= 8; m++, masksize -= 8)
801 *m = ~0 << (8 - masksize);
808 * Parse an argument sub-vector as a { <parameter name> <value> } ordered
809 * tuple. If the parameter name in the argument sub-vector does not match the
857 printf("%4d", t->idx);
858 if (t->hits == UINT64_MAX)
859 printf(" %8s", "-");
861 printf(" %8ju", t->hits);
869 printf(" %1d/%1d", t->fs.val.fcoe, t->fs.mask.fcoe);
872 printf(" %1d/%1d", t->fs.val.iport, t->fs.mask.iport);
877 t->fs.val.pfvf_vld,
878 (t->fs.val.vnic >> 13) & 0x7,
879 t->fs.val.vnic & 0x1fff,
880 t->fs.mask.pfvf_vld,
881 (t->fs.mask.vnic >> 13) & 0x7,
882 t->fs.mask.vnic & 0x1fff);
885 t->fs.val.ovlan_vld, t->fs.val.vnic,
886 t->fs.mask.ovlan_vld, t->fs.mask.vnic);
891 t->fs.val.vlan_vld, t->fs.val.vlan,
892 t->fs.mask.vlan_vld, t->fs.mask.vlan);
895 printf(" %02x/%02x", t->fs.val.tos, t->fs.mask.tos);
898 printf(" %02x/%02x", t->fs.val.proto, t->fs.mask.proto);
901 printf(" %04x/%04x", t->fs.val.ethtype,
902 t->fs.mask.ethtype);
905 printf(" %03x/%03x", t->fs.val.macidx,
906 t->fs.mask.macidx);
909 printf(" %1x/%1x", t->fs.val.matchtype,
910 t->fs.mask.matchtype);
913 printf(" %1d/%1d", t->fs.val.frag, t->fs.mask.frag);
924 filters_show_ipaddr(t->fs.type, t->fs.val.dip, t->fs.mask.dip);
925 filters_show_ipaddr(t->fs.type, t->fs.val.sip, t->fs.mask.sip);
927 t->fs.val.dport, t->fs.mask.dport,
928 t->fs.val.sport, t->fs.mask.sport);
933 if (t->fs.action == FILTER_DROP)
935 else if (t->fs.action == FILTER_SWITCH) {
936 printf(" Switch: port=%d", t->fs.eport);
937 if (t->fs.newdmac)
941 t->fs.dmac[0], t->fs.dmac[1],
942 t->fs.dmac[2], t->fs.dmac[3],
943 t->fs.dmac[4], t->fs.dmac[5],
944 t->l2tidx);
945 if (t->fs.newsmac)
949 t->fs.smac[0], t->fs.smac[1],
950 t->fs.smac[2], t->fs.smac[3],
951 t->fs.smac[4], t->fs.smac[5],
952 t->smtidx);
953 if (t->fs.newvlan == VLAN_REMOVE)
955 else if (t->fs.newvlan == VLAN_INSERT)
956 printf(", vlan=insert(%x)", t->fs.vlan);
957 else if (t->fs.newvlan == VLAN_REWRITE)
958 printf(", vlan=rewrite(%x)", t->fs.vlan);
961 if (t->fs.dirsteer == 0) {
963 if (t->fs.maskhash)
964 printf("(region %d)", t->fs.iq << 1);
966 printf("%d", t->fs.iq);
967 if (t->fs.dirsteerhash == 0)
973 if (g.chip_id <= 5 && t->fs.prio)
975 if (t->fs.rpttid)
1093 for (; argc; argc--, argv++) {
1321 else if (!strcmp(argv[start_arg + 1], "dip-dp"))
1323 else if (!strcmp(argv[start_arg + 1], "dip-dp-sip"))
1325 else if (!strcmp(argv[start_arg + 1], "dip-dp-sp"))
1327 else if (!strcmp(argv[start_arg + 1], "sip-sp"))
1329 else if (!strcmp(argv[start_arg + 1], "dip-sip-sp"))
1335 "dip-dp, dip-dp-sip, dip-dp-sp, sip-sp, "
1336 "dip-sip-sp, and all", argv[start_arg + 1]);
1459 return set_filter_mode(argc - 1, argv + 1, hashfilter);
1470 idx = (uint32_t) -1;
1509 argc--;
1518 * Shows the fields of a multi-word structure. The structure is considered to
1519 * consist of @nwords 32-bit words (i.e, it's an (@nwords * 32)-bit structure)
1520 * whose fields are described by @fd. The 32-bit words are given in @words
1521 * starting with the least significant 32-bit word.
1529 for (p = fd; p->name; p++)
1530 w = max(w, strlen(p->name));
1532 while (fd->name) {
1534 int first_word = fd->start / 32;
1535 int shift = fd->start % 32;
1536 int width = fd->end - fd->start + 1;
1537 unsigned long long mask = (1ULL << width) - 1;
1540 ((uint64_t)words[first_word + 1] << (32 - shift));
1542 data |= ((uint64_t)words[first_word + 2] << (64 - shift));
1544 if (fd->islog2)
1546 printf("%-*s ", w, fd->name);
1547 printf(fd->hex ? "%#llx\n" : "%llu\n", data << fd->shift);
1718 if (p->mem_id == SGE_CONTEXT_EGRESS)
1719 show_struct(p->data, 7, (p->data[0] & 2) ? fl_t7 : egress_t7);
1720 else if (p->mem_id == SGE_CONTEXT_FLM)
1721 show_struct(p->data, 5, flm_t7);
1722 else if (p->mem_id == SGE_CONTEXT_INGRESS)
1723 show_struct(p->data, 6, ingress_t7);
1724 else if (p->mem_id == SGE_CONTEXT_CNM)
1725 show_struct(p->data, 2, conm_t7);
1964 if (p->mem_id == SGE_CONTEXT_EGRESS) {
1965 if (p->data[0] & 2)
1966 show_struct(p->data, 6, fl_t5);
1968 show_struct(p->data, 6, egress_t5);
1970 show_struct(p->data, 6, egress_t6);
1971 } else if (p->mem_id == SGE_CONTEXT_FLM)
1972 show_struct(p->data, 3, vers == 5 ? flm_t5 : flm_t6);
1973 else if (p->mem_id == SGE_CONTEXT_INGRESS)
1974 show_struct(p->data, 5, vers == 5 ? ingress_t5 : ingress_t6);
1975 else if (p->mem_id == SGE_CONTEXT_CNM)
1976 show_struct(p->data, 1, conm_t5);
2105 if (p->mem_id == SGE_CONTEXT_EGRESS)
2106 show_struct(p->data, 6, (p->data[0] & 2) ? fl_t4 : egress_t4);
2107 else if (p->mem_id == SGE_CONTEXT_FLM)
2108 show_struct(p->data, 3, flm_t4);
2109 else if (p->mem_id == SGE_CONTEXT_INGRESS)
2110 show_struct(p->data, 5, ingress_t4);
2111 else if (p->mem_id == SGE_CONTEXT_CNM)
2112 show_struct(p->data, 1, conm_t4);
2419 * Display memory as list of 'n' 4-byte values per line.
2428 for (i = 0; len && i < n; i++, buf++, len -= 4) {
2466 * Display TCB as list of 'n' 4-byte values per line.
2476 for (i = 0; len && i < n; i++, buf++, len -= 4) {
2622 port_idx = t.tp.port - 4;
2625 port_idx = t.tp.port - 8;
2628 port_idx = t.tp.port - 12;
2631 port_idx = t.tp.port - 16;
2699 * matching). Right now this is a quick-n-dirty implementation that traces the
2725 port = argv[0][2] - '0';
2732 port = argv[0][2] - '0';
2739 port = argv[0][2] - '0';
2798 return set_tracer(idx, argc - 1, argv + 1);
2889 string[i - SFF_8472_VENDOR_START] = i2cd.data[0];
2898 string[i - SFF_8472_SN_START] = i2cd.data[0];
2907 string[i - SFF_8472_PN_START] = i2cd.data[0];
2916 string[i - SFF_8472_REV_START] = i2cd.data[0];
2937 printf("-");
3005 op.subcmd = -1;
3006 op.type = -1;
3008 warnx("missing scheduling sub-command");
3013 op.u.config.minmax = -1;
3019 op.u.params.weight = op.u.params.pktsize = -1;
3021 warnx("invalid scheduling sub-command \"%s\"", argv[0]);
3065 if (!strcmp(args[1], "cl-rl"))
3067 else if (!strcmp(args[1], "cl-wrr"))
3069 else if (!strcmp(args[1], "ch-rl"))
3085 } else if (!strcmp(args[0], "rate-unit")) {
3091 warnx("invalid rate-unit parameter \"%s\"",
3095 } else if (!strcmp(args[0], "rate-mode")) {
3101 warnx("invalid rate-mode parameter \"%s\"",
3109 else if (!get_sched_param("min-rate", args, &l))
3111 else if (!get_sched_param("max-rate", args, &l))
3115 else if (!get_sched_param("pkt-size", args, &l))
3153 warnx("sched params \"rate-unit\" parameter missing");
3159 warnx("sched params \"rate-mode\" parameter missing");
3175 warnx("sched params \"max-rate\" missing for "
3176 "rate-limit level");
3182 "(not 1-99) for weighted-round-robin level");
3187 warnx("sched params \"pkt-size\" missing for "
3188 "rate-limit level");
3193 warnx("sched params mode flow needs rate-mode absolute");
3198 warnx("sched params \"max-rate\" takes "
3199 "percentage value(1-100) for rate-mode relative");
3204 warnx("sched params \"max-rate\" takes "
3205 "value(1-100000000) for rate-mode absolute");
3210 warnx("sched params \"max-rate\" is less than "
3211 "\"min-rate\"");
3217 warnx("%d error%s in sched-class command", errs,
3246 op.queue = -1;
3249 if (*p || val < -1) {
3257 op.cl = -1;
3260 if (*p || val < -1) {
3286 os->offload = (*pneg + 1) & 1;
3289 os->rx_coalesce = (*pneg + 1) & 1;
3292 os->tstamp = (*pneg + 1) & 1;
3295 os->sack = (*pneg + 1) & 1;
3298 os->nagle = (*pneg + 1) & 1;
3301 os->ecn = (*pneg + 1) & 1;
3304 os->ddp = (*pneg + 1) & 1;
3307 os->tls = (*pneg + 1) & 1;
3333 os->cong_algo = 0;
3335 os->cong_algo = 1;
3337 os->cong_algo = 2;
3339 os->cong_algo = 3;
3345 val = -1;
3347 /* (nsched_cls - 1) is spelled 15 here. */
3354 os->sched_class = val;
3372 os->txq = val;
3373 os->rxq = val;
3375 os->txq = val;
3377 os->rxq = val;
3382 val = -1;
3390 os->mss = val;
3408 .rx_coalesce = -1,
3409 .cong_algo = -1,
3410 .sched_class = -1,
3411 .tstamp = -1,
3412 .sack = -1,
3413 .nagle = -1,
3414 .ecn = -1,
3415 .ddp = -1,
3416 .tls = -1,
3419 .mss = -1,
3463 llen--;
3479 /* check for special strings: "-", "all", "any" */
3480 if (*str == '-') {
3496 * A rule has 3 parts: an open-type, a match expression, and offload settings.
3498 * [<open-type>] <expr> => <settings>
3501 parse_offload_policy_line(size_t lno, char *line, size_t llen, pcap_t *pd,
3512 s = &line[llen - 1];
3514 *s-- = '\0';
3515 llen--;
3530 r->open_type = *line;
3533 warnx("invalid socket-type \"%c\" on line %zd.", *line, lno);
3539 r->open_type, lno);
3560 * <expr> is either a special name (all, any) or a pcap-filter(7).
3561 * In case of a special name the bpf_prog stays all-zero.
3564 if (pcap_compile(pd, &r->bpf_prog, expr, 1,
3567 lno, pcap_geterr(pd));
3573 if (parse_offload_settings(settings, &r->settings) != 0) {
3576 pcap_freecode(&r->bpf_prog);
3592 for (i = 0; i < op->nrules; i++) {
3595 * for an rule that matches on 'any/all/-'.
3597 pcap_freecode(&op->rule[i].bpf_prog);
3599 free(op->rule);
3600 op->nrules = 0;
3601 op->rule = NULL;
3607 * Fills up op->nrules and op->rule.
3617 pcap_t *pd;
3624 pd = pcap_open_dead(DLT_EN10MB, 128);
3625 if (pd == NULL) {
3635 op->nrules = 0;
3636 op->rule = NULL;
3639 while ((llen = getline(&line, &lcap, fp)) != -1) {
3646 if (op->nrules == maxrules) {
3648 r = realloc(op->rule,
3656 op->rule = r;
3659 r = &op->rule[op->nrules];
3660 rc = parse_offload_policy_line(lno, line, llen, pd, r);
3666 op->nrules++;
3677 if (op->nrules == 0) {
3682 pcap_close(pd);
3786 int rc = -1;
3790 argc--;
3817 else if (!strcmp(cmd, "sched-class"))
3819 else if (!strcmp(cmd, "sched-queue"))
3825 else if (!strcmp(cmd, "loadboot-cfg"))
3903 if (len < 2 || isdigit(s[0]) || !isdigit(s[len - 1]))
3905 for (num = s + len - 1; isdigit(*num); num--)
3944 int rc = -1;
3949 if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
3963 argc -= 2;