Files
@ d0a14f973771
Branch filter:
Location: vmkdrivers/vmkdrivers/src_9/drivers/net/ixgbe/ixgbe_param.c
d0a14f973771
34.3 KiB
text/x-csrc
ESXi-5.0-U1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 | /*******************************************************************************
Intel 10 Gigabit PCI Express Linux driver
Copyright(c) 1999 - 2010 Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information:
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#include <linux/types.h>
#include <linux/module.h>
#include "ixgbe.h"
/* This is the only thing that needs to be changed to adjust the
* maximum number of ports that the driver can manage.
*/
#define IXGBE_MAX_NIC 32
#define OPTION_UNSET -1
#define OPTION_DISABLED 0
#define OPTION_ENABLED 1
#define STRINGIFY(foo) #foo /* magic for getting defines into strings */
#define XSTRINGIFY(bar) STRINGIFY(bar)
/* All parameters are treated the same, as an integer array of values.
* This macro just reduces the need to repeat the same declaration code
* over and over (plus this helps to avoid typo bugs).
*/
#define IXGBE_PARAM_INIT { [0 ... IXGBE_MAX_NIC] = OPTION_UNSET }
#ifndef module_param_array
/* Module Parameters are always initialized to -1, so that the driver
* can tell the difference between no user specified value or the
* user asking for the default value.
* The true default values are loaded in when ixgbe_check_options is called.
*
* This is a GCC extension to ANSI C.
* See the item "Labeled Elements in Initializers" in the section
* "Extensions to the C Language Family" of the GCC documentation.
*/
#define IXGBE_PARAM(X, desc) \
static const int __devinitdata X[IXGBE_MAX_NIC+1] = IXGBE_PARAM_INIT; \
MODULE_PARM(X, "1-" __MODULE_STRING(IXGBE_MAX_NIC) "i"); \
MODULE_PARM_DESC(X, desc);
#else
#define IXGBE_PARAM(X, desc) \
static int __devinitdata X[IXGBE_MAX_NIC+1] = IXGBE_PARAM_INIT; \
static unsigned int num_##X; \
module_param_array_named(X, X, int, &num_##X, 0); \
MODULE_PARM_DESC(X, desc);
#endif
/* IntMode (Interrupt Mode)
*
* Valid Range: 0-2
* - 0 - Legacy Interrupt
* - 1 - MSI Interrupt
* - 2 - MSI-X Interrupt(s)
*
* Default Value: 2
*/
IXGBE_PARAM(InterruptType, "Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default IntMode (deprecated)");
IXGBE_PARAM(IntMode, "Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default 2");
#define IXGBE_INT_LEGACY 0
#define IXGBE_INT_MSI 1
#define IXGBE_INT_MSIX 2
#define IXGBE_DEFAULT_INT IXGBE_INT_MSIX
IXGBE_PARAM(Node, "set the starting node to allocate memory on, default -1");
/* MQ - Multiple Queue enable/disable
*
* Valid Range: 0, 1
* - 0 - disables MQ
* - 1 - enables MQ
*
* Default Value: 1
*/
IXGBE_PARAM(MQ, "Disable or enable Multiple Queues, default 1");
#if defined(CONFIG_DCA) || defined(CONFIG_DCA_MODULE)
/* DCA - Direct Cache Access (DCA) Control
*
* This option allows the device to hint to DCA enabled processors
* which CPU should have its cache warmed with the data being
* transferred over PCIe. This can increase performance by reducing
* cache misses. ixgbe hardware supports DCA for:
* tx descriptor writeback
* rx descriptor writeback
* rx data
* rx data header only (in packet split mode)
*
* enabling option 2 can cause cache thrash in some tests, particularly
* if the CPU is completely utilized
*
* Valid Range: 0 - 2
* - 0 - disables DCA
* - 1 - enables DCA
* - 2 - enables DCA with rx data included
*
* Default Value: 2
*/
#define IXGBE_MAX_DCA 2
IXGBE_PARAM(DCA, "Disable or enable Direct Cache Access, 0=disabled, 1=descriptor only, 2=descriptor and data");
#endif
/* RSS - Receive-Side Scaling (RSS) Descriptor Queues
*
* Valid Range: 0-16
* - 0 - disables RSS
* - 1 - enables RSS and sets the Desc. Q's to min(16, num_online_cpus()).
* - 2-16 - enables RSS and sets the Desc. Q's to the specified value.
*
* Default Value: 1
*/
IXGBE_PARAM(RSS, "Number of Receive-Side Scaling Descriptor Queues, default 1=number of cpus");
#ifdef IXGBE_VMDQ
/* VMDQ - Virtual Machine Device Queues (VMDQ)
*
* Valid Range: 1-16
* - 1 Disables VMDQ by allocating only a single queue.
* - 2-16 - enables VMDQ and sets the Desc. Q's to the specified value.
*
* Default Value: 1
*/
#define IXGBE_DEFAULT_NUM_VMDQ 8
IXGBE_PARAM(VMDQ, "Number of Virtual Machine Device Queues: 0/1 = disable, 2-16 enable (default=" XSTRINGIFY(IXGBE_DEFAULT_NUM_VMDQ) ")");
#endif
/* Interrupt Throttle Rate (interrupts/sec)
*
* Valid Range: 956-488281 (0=off, 1=dynamic)
*
* Default Value: 8000
*/
#ifdef __VMKLNX__
#define DEFAULT_ITR 16000
IXGBE_PARAM(InterruptThrottleRate, "Maximum interrupts per second, per vector, (956-488281), default 16000");
#else
#define DEFAULT_ITR 8000
IXGBE_PARAM(InterruptThrottleRate, "Maximum interrupts per second, per vector, (956-488281), default 8000");
#endif
#define MAX_ITR IXGBE_MAX_INT_RATE
#define MIN_ITR IXGBE_MIN_INT_RATE
#ifndef IXGBE_NO_LLI
/* LLIPort (Low Latency Interrupt TCP Port)
*
* Valid Range: 0 - 65535
*
* Default Value: 0 (disabled)
*/
IXGBE_PARAM(LLIPort, "Low Latency Interrupt TCP Port (0-65535)");
#define DEFAULT_LLIPORT 0
#define MAX_LLIPORT 0xFFFF
#define MIN_LLIPORT 0
/* LLIPush (Low Latency Interrupt on TCP Push flag)
*
* Valid Range: 0,1
*
* Default Value: 0 (disabled)
*/
IXGBE_PARAM(LLIPush, "Low Latency Interrupt on TCP Push flag (0,1)");
#define DEFAULT_LLIPUSH 0
#define MAX_LLIPUSH 1
#define MIN_LLIPUSH 0
/* LLISize (Low Latency Interrupt on Packet Size)
*
* Valid Range: 0 - 1500
*
* Default Value: 0 (disabled)
*/
IXGBE_PARAM(LLISize, "Low Latency Interrupt on Packet Size (0-1500)");
#define DEFAULT_LLISIZE 0
#define MAX_LLISIZE 1500
#define MIN_LLISIZE 0
/* LLIEType (Low Latency Interrupt Ethernet Type)
*
* Valid Range: 0 - 0x8fff
*
* Default Value: 0 (disabled)
*/
IXGBE_PARAM(LLIEType, "Low Latency Interrupt Ethernet Protocol Type");
#define DEFAULT_LLIETYPE 0
#define MAX_LLIETYPE 0x8fff
#define MIN_LLIETYPE 0
/* LLIVLANP (Low Latency Interrupt on VLAN priority threshold)
*
* Valid Range: 0 - 7
*
* Default Value: 0 (disabled)
*/
IXGBE_PARAM(LLIVLANP, "Low Latency Interrupt on VLAN priority threshold");
#define DEFAULT_LLIVLANP 0
#define MAX_LLIVLANP 7
#define MIN_LLIVLANP 0
#endif /* IXGBE_NO_LLI */
/* Rx buffer mode
*
* Valid Range: 0-2 0 = 1buf_mode_always, 1 = ps_mode_always and 2 = optimal
*
* Default Value: 2
*/
IXGBE_PARAM(RxBufferMode, "0=1 descriptor per packet,\n"
"\t\t\t1=use packet split, multiple descriptors per jumbo frame\n"
"\t\t\t2 (default)=use 1buf mode for 1500 mtu, packet split for jumbo");
#define IXGBE_RXBUFMODE_1BUF_ALWAYS 0
#define IXGBE_RXBUFMODE_PS_ALWAYS 1
#define IXGBE_RXBUFMODE_OPTIMAL 2
#define IXGBE_DEFAULT_RXBUFMODE IXGBE_RXBUFMODE_OPTIMAL
#ifdef HAVE_TX_MQ
/* Flow Director filtering mode
*
* Valid Range: 0-2 0 = off, 1 = Hashing (ATR), and 2 = perfect filters
*
* Default Value: 1 (ATR)
*/
IXGBE_PARAM(FdirMode, "Flow Director filtering modes:\n"
"\t\t\t0 = Filtering off\n"
"\t\t\t1 = Signature Hashing filters (SW ATR)\n"
"\t\t\t2 = Perfect Filters");
#define IXGBE_FDIR_FILTER_OFF 0
#define IXGBE_FDIR_FILTER_HASH 1
#define IXGBE_FDIR_FILTER_PERFECT 2
#ifdef __VMKLNX__
#define IXGBE_DEFAULT_FDIR_FILTER IXGBE_FDIR_FILTER_OFF
#else
#define IXGBE_DEFAULT_FDIR_FILTER IXGBE_FDIR_FILTER_HASH
#endif
/* Flow Director packet buffer allocation level
*
* Valid Range: 0-2 0 = 8k hash/2k perfect, 1 = 16k hash/4k perfect,
* 2 = 32k hash/8k perfect
*
* Default Value: 0
*/
IXGBE_PARAM(FdirPballoc, "Flow Director packet buffer allocation level:\n"
"\t\t\t0 = 8k hash filters or 2k perfect filters\n"
"\t\t\t1 = 16k hash filters or 4k perfect filters\n"
"\t\t\t2 = 32k hash filters or 8k perfect filters");
#define IXGBE_FDIR_PBALLOC_64K 0
#define IXGBE_FDIR_PBALLOC_128K 1
#define IXGBE_FDIR_PBALLOC_256K 2
#define IXGBE_DEFAULT_FDIR_PBALLOC IXGBE_FDIR_PBALLOC_64K
/* Software ATR packet sample rate
*
* Valid Range: 0-100 0 = off, 1-100 = rate of Tx packet inspection
*
* Default Value: 20
*/
IXGBE_PARAM(AtrSampleRate, "Software ATR Tx packet sample rate");
#define IXGBE_MAX_ATR_SAMPLE_RATE 100
#define IXGBE_MIN_ATR_SAMPLE_RATE 1
#define IXGBE_ATR_SAMPLE_RATE_OFF 0
#ifdef __VMKLNX__
#define IXGBE_DEFAULT_ATR_SAMPLE_RATE IXGBE_ATR_SAMPLE_RATE_OFF
#else
#define IXGBE_DEFAULT_ATR_SAMPLE_RATE 20
#endif
#endif /* HAVE_TX_MQ */
/* enable/disable CNA
*
* Valid Range: 0-8
* - 0 Disables CNA functionality
* - 1-8 Enables CNA functionality with number of Qs allocated to FCoE
*
* Default Value: 1 - CNA enabled with 1 Q
*/
IXGBE_PARAM(CNA, "Number of FCoE Queues: 0 = disable, 1-8 = enable this many Qs");
struct ixgbe_option {
enum { enable_option, range_option, list_option } type;
const char *name;
const char *err;
int def;
union {
struct { /* range_option info */
int min;
int max;
} r;
struct { /* list_option info */
int nr;
const struct ixgbe_opt_list {
int i;
char *str;
} *p;
} l;
} arg;
};
static int __devinit ixgbe_validate_option(unsigned int *value,
struct ixgbe_option *opt)
{
if (*value == OPTION_UNSET) {
*value = opt->def;
return 0;
}
switch (opt->type) {
case enable_option:
switch (*value) {
case OPTION_ENABLED:
printk(KERN_INFO "ixgbe: %s Enabled\n", opt->name);
return 0;
case OPTION_DISABLED:
printk(KERN_INFO "ixgbe: %s Disabled\n", opt->name);
return 0;
}
break;
case range_option:
if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
printk(KERN_INFO "ixgbe: %s set to %d\n", opt->name, *value);
return 0;
}
break;
case list_option: {
int i;
const struct ixgbe_opt_list *ent;
for (i = 0; i < opt->arg.l.nr; i++) {
ent = &opt->arg.l.p[i];
if (*value == ent->i) {
if (ent->str[0] != '\0')
printk(KERN_INFO "%s\n", ent->str);
return 0;
}
}
}
break;
default:
BUG();
}
printk(KERN_INFO "ixgbe: Invalid %s specified (%d), %s\n",
opt->name, *value, opt->err);
*value = opt->def;
return -1;
}
#define LIST_LEN(l) (sizeof(l) / sizeof(l[0]))
/**
* ixgbe_check_options - Range Checking for Command Line Parameters
* @adapter: board private structure
*
* This routine checks all command line parameters for valid user
* input. If an invalid value is given, or if no user specified
* value exists, a default value is used. The final value is stored
* in a variable in the adapter structure.
**/
void __devinit ixgbe_check_options(struct ixgbe_adapter *adapter)
{
int bd = adapter->bd_number;
u32 *aflags = &adapter->flags;
struct ixgbe_ring_feature *feature = adapter->ring_feature;
if (bd >= IXGBE_MAX_NIC) {
printk(KERN_NOTICE
"Warning: no configuration for board #%d\n", bd);
printk(KERN_NOTICE "Using defaults for all values\n");
#ifndef module_param_array
bd = IXGBE_MAX_NIC;
#endif
}
{ /* Interrupt Mode */
unsigned int int_mode;
static struct ixgbe_option opt = {
.type = range_option,
.name = "Interrupt Mode",
.err =
"using default of "__MODULE_STRING(IXGBE_DEFAULT_INT),
.def = IXGBE_DEFAULT_INT,
.arg = { .r = { .min = IXGBE_INT_LEGACY,
.max = IXGBE_INT_MSIX}}
};
#ifdef module_param_array
if (num_IntMode > bd || num_InterruptType > bd) {
#endif
int_mode = IntMode[bd];
if (int_mode == OPTION_UNSET)
int_mode = InterruptType[bd];
ixgbe_validate_option(&int_mode, &opt);
switch (int_mode) {
case IXGBE_INT_MSIX:
if (!(*aflags & IXGBE_FLAG_MSIX_CAPABLE))
printk(KERN_INFO
"Ignoring MSI-X setting; "
"support unavailable\n");
break;
case IXGBE_INT_MSI:
if (!(*aflags & IXGBE_FLAG_MSI_CAPABLE)) {
printk(KERN_INFO
"Ignoring MSI setting; "
"support unavailable\n");
} else {
*aflags &= ~IXGBE_FLAG_MSIX_CAPABLE;
*aflags &= ~IXGBE_FLAG_DCB_CAPABLE;
}
break;
case IXGBE_INT_LEGACY:
default:
*aflags &= ~IXGBE_FLAG_MSIX_CAPABLE;
*aflags &= ~IXGBE_FLAG_MSI_CAPABLE;
*aflags &= ~IXGBE_FLAG_DCB_CAPABLE;
break;
}
#ifdef module_param_array
} else {
/* default settings */
if (opt.def == IXGBE_INT_MSIX &&
*aflags & IXGBE_FLAG_MSIX_CAPABLE) {
*aflags |= IXGBE_FLAG_MSIX_CAPABLE;
*aflags |= IXGBE_FLAG_MSI_CAPABLE;
} else if (opt.def == IXGBE_INT_MSI &&
*aflags & IXGBE_FLAG_MSI_CAPABLE) {
*aflags &= ~IXGBE_FLAG_MSIX_CAPABLE;
*aflags |= IXGBE_FLAG_MSI_CAPABLE;
*aflags &= ~IXGBE_FLAG_DCB_CAPABLE;
} else {
*aflags &= ~IXGBE_FLAG_MSIX_CAPABLE;
*aflags &= ~IXGBE_FLAG_MSI_CAPABLE;
*aflags &= ~IXGBE_FLAG_DCB_CAPABLE;
}
}
#endif
}
{ /* Multiple Queue Support */
static struct ixgbe_option opt = {
.type = enable_option,
.name = "Multiple Queue Support",
.err = "defaulting to Enabled",
.def = OPTION_ENABLED
};
#ifdef module_param_array
if (num_MQ > bd) {
#endif
unsigned int mq = MQ[bd];
ixgbe_validate_option(&mq, &opt);
if (mq)
*aflags |= IXGBE_FLAG_MQ_CAPABLE;
else
*aflags &= ~IXGBE_FLAG_MQ_CAPABLE;
#ifdef module_param_array
} else {
if (opt.def == OPTION_ENABLED)
*aflags |= IXGBE_FLAG_MQ_CAPABLE;
else
*aflags &= ~IXGBE_FLAG_MQ_CAPABLE;
}
#endif
/* Check Interoperability */
if ((*aflags & IXGBE_FLAG_MQ_CAPABLE) &&
!(*aflags & IXGBE_FLAG_MSIX_CAPABLE)) {
DPRINTK(PROBE, INFO,
"Multiple queues are not supported while MSI-X "
"is disabled. Disabling Multiple Queues.\n");
*aflags &= ~IXGBE_FLAG_MQ_CAPABLE;
}
}
#if defined(CONFIG_DCA) || defined(CONFIG_DCA_MODULE)
{ /* Direct Cache Access (DCA) */
static struct ixgbe_option opt = {
.type = range_option,
.name = "Direct Cache Access (DCA)",
.err = "defaulting to Enabled",
.def = IXGBE_MAX_DCA,
.arg = { .r = { .min = OPTION_DISABLED,
.max = IXGBE_MAX_DCA}}
};
unsigned int dca = opt.def;
#ifdef module_param_array
if (num_DCA > bd) {
#endif
dca = DCA[bd];
ixgbe_validate_option(&dca, &opt);
if (!dca)
*aflags &= ~IXGBE_FLAG_DCA_CAPABLE;
/* Check Interoperability */
if (!(*aflags & IXGBE_FLAG_DCA_CAPABLE)) {
DPRINTK(PROBE, INFO, "DCA is disabled\n");
*aflags &= ~IXGBE_FLAG_DCA_ENABLED;
}
if (dca == IXGBE_MAX_DCA) {
DPRINTK(PROBE, INFO,
"DCA enabled for rx data\n");
adapter->flags |= IXGBE_FLAG_DCA_ENABLED_DATA;
}
#ifdef module_param_array
} else {
/* make sure to clear the capability flag if the
* option is disabled by default above */
if (opt.def == OPTION_DISABLED)
*aflags &= ~IXGBE_FLAG_DCA_CAPABLE;
}
#endif
if (dca == IXGBE_MAX_DCA)
adapter->flags |= IXGBE_FLAG_DCA_ENABLED_DATA;
}
#endif /* CONFIG_DCA or CONFIG_DCA_MODULE */
{ /* Receive-Side Scaling (RSS) */
static struct ixgbe_option opt = {
.type = range_option,
.name = "Receive-Side Scaling (RSS)",
.err = "using default.",
#ifdef __VMKLNX__
.def = OPTION_DISABLED,
#else
.def = OPTION_ENABLED,
#endif /* __VMKLNX__ */
.arg = { .r = { .min = OPTION_DISABLED,
.max = IXGBE_MAX_RSS_INDICES}}
};
unsigned int rss = RSS[bd];
#ifdef module_param_array
if (num_RSS > bd) {
#endif
switch (rss) {
case 1:
/*
* Base it off num_online_cpus() with
* a hardware limit cap.
*/
rss = min(IXGBE_MAX_RSS_INDICES,
(int)num_online_cpus());
break;
default:
ixgbe_validate_option(&rss, &opt);
break;
}
feature[RING_F_RSS].indices = rss;
if (rss)
*aflags |= IXGBE_FLAG_RSS_ENABLED;
else
*aflags &= ~IXGBE_FLAG_RSS_ENABLED;
#ifdef module_param_array
} else {
if (opt.def == OPTION_DISABLED) {
*aflags &= ~IXGBE_FLAG_RSS_ENABLED;
} else {
rss = min(IXGBE_MAX_RSS_INDICES,
(int)num_online_cpus());
feature[RING_F_RSS].indices = rss;
if (rss)
*aflags |= IXGBE_FLAG_RSS_ENABLED;
else
*aflags &= ~IXGBE_FLAG_RSS_ENABLED;
}
}
#endif
/* Check Interoperability */
if (*aflags & IXGBE_FLAG_RSS_ENABLED) {
if (!(*aflags & IXGBE_FLAG_RSS_CAPABLE)) {
DPRINTK(PROBE, INFO,
"RSS is not supported on this "
"hardware. Disabling RSS.\n");
*aflags &= ~IXGBE_FLAG_RSS_ENABLED;
feature[RING_F_RSS].indices = 0;
} else if (!(*aflags & IXGBE_FLAG_MQ_CAPABLE)) {
DPRINTK(PROBE, INFO,
"RSS is not supported while multiple "
"queues are disabled. "
"Disabling RSS.\n");
*aflags &= ~IXGBE_FLAG_RSS_ENABLED;
*aflags &= ~IXGBE_FLAG_DCB_CAPABLE;
feature[RING_F_RSS].indices = 0;
}
}
}
{
adapter->flags2 &= ~IXGBE_FLAG2_CNA_ENABLED;
if (adapter->hw.mac.type != ixgbe_mac_82598EB) {
struct ixgbe_option opt = {
.type = range_option,
.name = "Enabled/Disable CNA",
.err = "defaulting to CNA Enabled",
.def = 1,
.arg = { .r = { .min = OPTION_DISABLED,
.max = IXGBE_FCRETA_SIZE} }
};
unsigned int cna_qs = opt.def;
#ifdef module_param_array
if (num_CNA > bd)
cna_qs = CNA[bd];
#endif
ixgbe_validate_option(&cna_qs, &opt);
/* only enabled CNA when MSIX is enabled */
if (!(*aflags & IXGBE_FLAG_MSIX_CAPABLE))
cna_qs = 0;
if (cna_qs) {
adapter->flags2 |= IXGBE_FLAG2_CNA_ENABLED;
adapter->num_tx_cna_queues = cna_qs;
adapter->num_rx_cna_queues = cna_qs;
adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
*aflags |= IXGBE_FLAG_DCB_ENABLED;
}
DPRINTK(PROBE, INFO, "CNA %sabled, %d queues\n",
(adapter->flags2 & IXGBE_FLAG2_CNA_ENABLED) ?
"en" : "dis", cna_qs);
}
/* Check Interoperability */
if (adapter->flags2 & IXGBE_FLAG2_CNA_ENABLED) {
/* disable RSC and PS, they don't get along with CNA/FCoE */
adapter->flags &= ~IXGBE_FLAG_RX_PS_CAPABLE;
adapter->flags2 &= ~IXGBE_FLAG2_RSC_CAPABLE;
}
}
#ifdef IXGBE_VMDQ
{ /* Virtual Machine Device Queues (VMDQ) */
static struct ixgbe_option opt = {
.type = range_option,
.name = "Virtual Machine Device Queues (VMDQ)",
.err = "defaulting to Disabled",
.def = OPTION_ENABLED,
.arg = { .r = { .min = OPTION_DISABLED,
.max = IXGBE_MAX_VMDQ_INDICES
}}
};
#ifdef module_param_array
if (num_VMDQ > bd) {
#endif
unsigned int vmdq = VMDQ[bd];
ixgbe_validate_option(&vmdq, &opt);
feature[RING_F_VMDQ].indices = vmdq;
adapter->flags2 |= IXGBE_FLAG2_VMDQ_DEFAULT_OVERRIDE;
/* zero or one both mean disabled from our driver's
* perspective */
if (vmdq > 1)
*aflags |= IXGBE_FLAG_VMDQ_ENABLED;
else
*aflags &= ~IXGBE_FLAG_VMDQ_ENABLED;
#ifdef module_param_array
} else {
if (opt.def == OPTION_DISABLED) {
*aflags &= ~IXGBE_FLAG_VMDQ_ENABLED;
} else {
feature[RING_F_VMDQ].indices = IXGBE_DEFAULT_NUM_VMDQ;
*aflags |= IXGBE_FLAG_VMDQ_ENABLED;
}
}
#endif
/* Check Interoperability */
if (*aflags & IXGBE_FLAG_VMDQ_ENABLED) {
if (!(*aflags & IXGBE_FLAG_VMDQ_CAPABLE)) {
DPRINTK(PROBE, INFO,
"VMDQ is not supported on this "
"hardware. Disabling VMDQ.\n");
*aflags &= ~IXGBE_FLAG_VMDQ_ENABLED;
feature[RING_F_VMDQ].indices = 0;
} else if (!(*aflags & IXGBE_FLAG_MQ_CAPABLE)) {
DPRINTK(PROBE, INFO,
"VMDQ is not supported while multiple "
"queues are disabled. "
"Disabling VMDQ.\n");
*aflags &= ~IXGBE_FLAG_VMDQ_ENABLED;
feature[RING_F_VMDQ].indices = 0;
}
switch (adapter->hw.mac.type) {
case ixgbe_mac_82598EB:
/* for now, disable RSS when using VMDQ mode */
*aflags &= ~IXGBE_FLAG_RSS_CAPABLE;
*aflags &= ~IXGBE_FLAG_RSS_ENABLED;
feature[RING_F_VMDQ].indices =
min(feature[RING_F_VMDQ].indices, 16);
break;
case ixgbe_mac_82599EB:
if (feature[RING_F_RSS].indices > 2
&& feature[RING_F_VMDQ].indices > 32)
feature[RING_F_RSS].indices = 2;
else if (feature[RING_F_RSS].indices != 0)
feature[RING_F_RSS].indices = 4;
break;
default:
break;
}
}
}
#endif /* IXGBE_VMDQ */
{ /* Interrupt Throttling Rate */
static struct ixgbe_option opt = {
.type = range_option,
.name = "Interrupt Throttling Rate (ints/sec)",
.err = "using default of "__MODULE_STRING(DEFAULT_ITR),
.def = DEFAULT_ITR,
.arg = { .r = { .min = MIN_ITR,
.max = MAX_ITR }}
};
#ifdef module_param_array
if (num_InterruptThrottleRate > bd) {
#endif
u32 eitr = InterruptThrottleRate[bd];
switch (eitr) {
case 0:
DPRINTK(PROBE, INFO, "%s turned off\n",
opt.name);
/*
* zero is a special value, we don't want to
* turn off ITR completely, just set it to an
* insane interrupt rate
*/
adapter->rx_eitr_param = IXGBE_MAX_INT_RATE;
adapter->rx_itr_setting = 0;
adapter->tx_itr_setting = 0;
break;
case 1:
DPRINTK(PROBE, INFO, "dynamic interrupt "
"throttling enabled\n");
adapter->rx_eitr_param = 20000;
adapter->tx_eitr_param =
adapter->rx_eitr_param >> 1;
adapter->rx_itr_setting = 1;
adapter->tx_itr_setting = 1;
break;
default:
ixgbe_validate_option(&eitr, &opt);
adapter->rx_eitr_param = eitr;
adapter->tx_eitr_param = (eitr >> 1);
/* the first bit is used as control */
adapter->rx_itr_setting = eitr & ~1;
adapter->tx_itr_setting = (eitr >> 1) & ~1;
break;
}
#ifdef module_param_array
} else {
adapter->rx_eitr_param = DEFAULT_ITR;
adapter->rx_itr_setting = DEFAULT_ITR & ~1;
adapter->tx_eitr_param = (DEFAULT_ITR >> 1);
adapter->tx_itr_setting = (DEFAULT_ITR >> 1) & ~1;
}
#endif
/* Check Interoperability */
if (adapter->rx_itr_setting == 0 &&
adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) {
/* itr ==0 and RSC are mutually exclusive */
adapter->flags2 &= ~IXGBE_FLAG2_RSC_CAPABLE;
adapter->netdev->features &= ~NETIF_F_LRO;
DPRINTK(PROBE, INFO,
"InterruptThrottleRate set to 0, disabling RSC\n");
}
}
#ifndef IXGBE_NO_LLI
{ /* Low Latency Interrupt TCP Port*/
static struct ixgbe_option opt = {
.type = range_option,
.name = "Low Latency Interrupt TCP Port",
.err = "using default of "
__MODULE_STRING(DEFAULT_LLIPORT),
.def = DEFAULT_LLIPORT,
.arg = { .r = { .min = MIN_LLIPORT,
.max = MAX_LLIPORT }}
};
#ifdef module_param_array
if (num_LLIPort > bd) {
#endif
adapter->lli_port = LLIPort[bd];
if (adapter->lli_port) {
ixgbe_validate_option(&adapter->lli_port, &opt);
} else {
DPRINTK(PROBE, INFO, "%s turned off\n",
opt.name);
}
#ifdef module_param_array
} else {
adapter->lli_port = opt.def;
}
#endif
}
{ /* Low Latency Interrupt on Packet Size */
static struct ixgbe_option opt = {
.type = range_option,
.name = "Low Latency Interrupt on Packet Size",
.err = "using default of "
__MODULE_STRING(DEFAULT_LLISIZE),
.def = DEFAULT_LLISIZE,
.arg = { .r = { .min = MIN_LLISIZE,
.max = MAX_LLISIZE }}
};
#ifdef module_param_array
if (num_LLISize > bd) {
#endif
adapter->lli_size = LLISize[bd];
if (adapter->lli_size) {
ixgbe_validate_option(&adapter->lli_size, &opt);
} else {
DPRINTK(PROBE, INFO, "%s turned off\n",
opt.name);
}
#ifdef module_param_array
} else {
adapter->lli_size = opt.def;
}
#endif
}
{ /*Low Latency Interrupt on TCP Push flag*/
static struct ixgbe_option opt = {
.type = enable_option,
.name = "Low Latency Interrupt on TCP Push flag",
.err = "defaulting to Disabled",
.def = OPTION_DISABLED
};
#ifdef module_param_array
if (num_LLIPush > bd) {
#endif
unsigned int lli_push = LLIPush[bd];
ixgbe_validate_option(&lli_push, &opt);
if (lli_push)
*aflags |= IXGBE_FLAG_LLI_PUSH;
else
*aflags &= ~IXGBE_FLAG_LLI_PUSH;
#ifdef module_param_array
} else {
if (opt.def == OPTION_ENABLED)
*aflags |= IXGBE_FLAG_LLI_PUSH;
else
*aflags &= ~IXGBE_FLAG_LLI_PUSH;
}
#endif
}
{ /* Low Latency Interrupt EtherType*/
static struct ixgbe_option opt = {
.type = range_option,
.name = "Low Latency Interrupt on Ethernet Protocol Type",
.err = "using default of "
__MODULE_STRING(DEFAULT_LLIETYPE),
.def = DEFAULT_LLIETYPE,
.arg = { .r = { .min = MIN_LLIETYPE,
.max = MAX_LLIETYPE }}
};
#ifdef module_param_array
if (num_LLIEType > bd) {
#endif
adapter->lli_etype = LLIEType[bd];
if (adapter->lli_etype) {
ixgbe_validate_option(&adapter->lli_etype, &opt);
} else {
DPRINTK(PROBE, INFO, "%s turned off\n",
opt.name);
}
#ifdef module_param_array
} else {
adapter->lli_etype = opt.def;
}
#endif
}
{ /* LLI VLAN Priority */
static struct ixgbe_option opt = {
.type = range_option,
.name = "Low Latency Interrupt on VLAN priority threashold",
.err = "using default of "
__MODULE_STRING(DEFAULT_LLIVLANP),
.def = DEFAULT_LLIVLANP,
.arg = { .r = { .min = MIN_LLIVLANP,
.max = MAX_LLIVLANP }}
};
#ifdef module_param_array
if (num_LLIVLANP > bd) {
#endif
adapter->lli_vlan_pri = LLIVLANP[bd];
if (adapter->lli_vlan_pri) {
ixgbe_validate_option(&adapter->lli_vlan_pri, &opt);
} else {
DPRINTK(PROBE, INFO, "%s turned off\n",
opt.name);
}
#ifdef module_param_array
} else {
adapter->lli_vlan_pri = opt.def;
}
#endif
}
#endif /* IXGBE_NO_LLI */
{ /* Rx buffer mode */
unsigned int rx_buf_mode;
static struct ixgbe_option opt = {
.type = range_option,
.name = "Rx buffer mode",
.err = "using default of "
__MODULE_STRING(IXGBE_DEFAULT_RXBUFMODE),
.def = IXGBE_DEFAULT_RXBUFMODE,
.arg = {.r = {.min = IXGBE_RXBUFMODE_1BUF_ALWAYS,
.max = IXGBE_RXBUFMODE_OPTIMAL}}
};
#ifdef module_param_array
if (num_RxBufferMode > bd) {
#endif
/* for 82599 only 1BUF supported value - erratum 45 */
if (adapter->hw.mac.type == ixgbe_mac_82599EB)
RxBufferMode[bd] = IXGBE_RXBUFMODE_1BUF_ALWAYS;
#ifdef __VMKLNX__
/* for ESX, Oplin has PS disabled as well */
if (adapter->hw.mac.type == ixgbe_mac_82598EB)
RxBufferMode[bd] = IXGBE_RXBUFMODE_1BUF_ALWAYS;
#endif
rx_buf_mode = RxBufferMode[bd];
ixgbe_validate_option(&rx_buf_mode, &opt);
switch (rx_buf_mode) {
case IXGBE_RXBUFMODE_OPTIMAL:
*aflags |= IXGBE_FLAG_RX_1BUF_CAPABLE;
*aflags |= IXGBE_FLAG_RX_PS_CAPABLE;
break;
case IXGBE_RXBUFMODE_PS_ALWAYS:
*aflags |= IXGBE_FLAG_RX_PS_CAPABLE;
break;
case IXGBE_RXBUFMODE_1BUF_ALWAYS:
*aflags |= IXGBE_FLAG_RX_1BUF_CAPABLE;
break;
default:
break;
}
#ifdef module_param_array
} else {
*aflags |= IXGBE_FLAG_RX_1BUF_CAPABLE;
*aflags |= IXGBE_FLAG_RX_PS_CAPABLE;
}
#endif
#ifdef __VMKLNX__
/* no packetsplit for ESX */
*aflags &= ~IXGBE_FLAG_RX_PS_CAPABLE;
#endif
}
#ifdef HAVE_TX_MQ
{ /* Flow Director filtering mode */
unsigned int fdir_filter_mode;
static struct ixgbe_option opt = {
.type = range_option,
.name = "Flow Director filtering mode",
.err = "using default of "
__MODULE_STRING(IXGBE_DEFAULT_FDIR_FILTER),
.def = IXGBE_DEFAULT_FDIR_FILTER,
.arg = {.r = {.min = IXGBE_FDIR_FILTER_OFF,
.max = IXGBE_FDIR_FILTER_PERFECT}}
};
*aflags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
*aflags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
if (adapter->hw.mac.type == ixgbe_mac_82598EB)
goto no_flow_director;
if (num_FdirMode > bd) {
fdir_filter_mode = FdirMode[bd];
ixgbe_validate_option(&fdir_filter_mode, &opt);
switch (fdir_filter_mode) {
case IXGBE_FDIR_FILTER_OFF:
DPRINTK(PROBE, INFO, "Flow Director disabled\n");
break;
case IXGBE_FDIR_FILTER_HASH:
*aflags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
*aflags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
feature[RING_F_FDIR].indices =
IXGBE_MAX_FDIR_INDICES;
DPRINTK(PROBE, INFO,
"Flow Director hash filtering enabled\n");
break;
case IXGBE_FDIR_FILTER_PERFECT:
#ifdef NETIF_F_NTUPLE
*aflags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
*aflags |= IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
feature[RING_F_FDIR].indices =
IXGBE_MAX_FDIR_INDICES;
DPRINTK(PROBE, INFO,
"Flow Director perfect filtering enabled\n");
#else /* NETIF_F_NTUPLE */
DPRINTK(PROBE, INFO, "No ethtool support for "
"Flow Director perfect filtering. "
"Defaulting to hash filtering.\n");
*aflags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
*aflags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
feature[RING_F_FDIR].indices =
IXGBE_MAX_FDIR_INDICES;
#endif /* NETIF_F_NTUPLE */
break;
default:
break;
}
} else {
if (opt.def == IXGBE_FDIR_FILTER_OFF) {
*aflags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
*aflags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
feature[RING_F_FDIR].indices = 0;
DPRINTK(PROBE, INFO,
"Flow Director hash filtering disabled\n");
} else {
*aflags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
feature[RING_F_FDIR].indices = IXGBE_MAX_FDIR_INDICES;
DPRINTK(PROBE, INFO,
"Flow Director hash filtering enabled\n");
}
}
/* Check interoperability */
if ((*aflags & IXGBE_FLAG_FDIR_HASH_CAPABLE) ||
(*aflags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) {
if (!(*aflags & IXGBE_FLAG_MQ_CAPABLE)) {
DPRINTK(PROBE, INFO,
"Flow Director is not supported "
"while multiple queues are disabled. "
"Disabling Flow Director\n");
*aflags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
*aflags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
}
}
no_flow_director:
/* empty code line with semi-colon */ ;
}
{ /* Flow Director packet buffer allocation */
unsigned int fdir_pballoc_mode;
static struct ixgbe_option opt = {
.type = range_option,
.name = "Flow Director packet buffer allocation",
.err = "using default of "
__MODULE_STRING(IXGBE_DEFAULT_FDIR_PBALLOC),
.def = IXGBE_DEFAULT_FDIR_PBALLOC,
.arg = {.r = {.min = IXGBE_FDIR_PBALLOC_64K,
.max = IXGBE_FDIR_PBALLOC_256K}}
};
char pstring[10];
if ((adapter->hw.mac.type == ixgbe_mac_82598EB) ||
(!(*aflags & (IXGBE_FLAG_FDIR_HASH_CAPABLE |
IXGBE_FLAG_FDIR_PERFECT_CAPABLE))))
goto no_fdir_pballoc;
if (num_FdirPballoc > bd) {
fdir_pballoc_mode = FdirPballoc[bd];
ixgbe_validate_option(&fdir_pballoc_mode, &opt);
switch (fdir_pballoc_mode) {
case IXGBE_FDIR_PBALLOC_64K:
adapter->fdir_pballoc = IXGBE_FDIR_PBALLOC_64K;
sprintf(pstring, "64kB");
break;
case IXGBE_FDIR_PBALLOC_128K:
adapter->fdir_pballoc = IXGBE_FDIR_PBALLOC_128K;
sprintf(pstring, "128kB");
break;
case IXGBE_FDIR_PBALLOC_256K:
adapter->fdir_pballoc = IXGBE_FDIR_PBALLOC_256K;
sprintf(pstring, "256kB");
break;
default:
break;
}
DPRINTK(PROBE, INFO,
"Flow Director allocated %s of packet buffer\n",
pstring);
} else {
adapter->fdir_pballoc = opt.def;
DPRINTK(PROBE, INFO,
"Flow Director allocated 64kB of packet buffer\n");
}
no_fdir_pballoc:
/* empty code line with semi-colon */ ;
}
{ /* Flow Director ATR Tx sample packet rate */
static struct ixgbe_option opt = {
.type = range_option,
.name = "Software ATR Tx packet sample rate",
.err = "using default of "
__MODULE_STRING(IXGBE_DEFAULT_ATR_SAMPLE_RATE),
.def = IXGBE_DEFAULT_ATR_SAMPLE_RATE,
.arg = {.r = {.min = IXGBE_ATR_SAMPLE_RATE_OFF,
.max = IXGBE_MAX_ATR_SAMPLE_RATE}}
};
static const char atr_string[] =
"ATR Tx Packet sample rate set to";
adapter->atr_sample_rate = IXGBE_ATR_SAMPLE_RATE_OFF;
if (adapter->hw.mac.type == ixgbe_mac_82598EB)
goto no_fdir_sample;
/* no sample rate for perfect filtering */
if (*aflags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)
goto no_fdir_sample;
if (num_AtrSampleRate > bd) {
/* Only enable the sample rate if hashing (ATR) is on */
if (*aflags & IXGBE_FLAG_FDIR_HASH_CAPABLE)
adapter->atr_sample_rate = AtrSampleRate[bd];
if (adapter->atr_sample_rate) {
ixgbe_validate_option(&adapter->atr_sample_rate,
&opt);
DPRINTK(PROBE, INFO, "%s %d\n", atr_string,
adapter->atr_sample_rate);
}
} else {
/* Only enable the sample rate if hashing (ATR) is on */
if (*aflags & IXGBE_FLAG_FDIR_HASH_CAPABLE)
adapter->atr_sample_rate = opt.def;
DPRINTK(PROBE, INFO, "%s default of %d\n", atr_string,
adapter->atr_sample_rate);
}
no_fdir_sample:
/* empty code line with semi-colon */ ;
}
#endif /* HAVE_TX_MQ */
#ifndef __VMKLNX__
{ /* Node assignment */
static struct ixgbe_option opt = {
.type = range_option,
.name = "Node to start on",
#ifdef HAVE_EARLY_VMALLOC_NODE
.err = "defaulting to 0",
.def = 0,
#else
.err = "defaulting to -1",
.def = -1,
#endif
.arg = { .r = { .min = 0,
.max = (MAX_NUMNODES - 1)}}
};
int node_param = opt.def;
/* if the default was zero then we need to set the
* default value to an online node, which is not
* necessarily zero, and the constant initializer
* above can't take first_online_node */
if (node_param == 0)
/* must set opt.def for validate */
opt.def = node_param = first_online_node;
#ifdef module_param_array
if (num_Node > bd) {
#endif
node_param = Node[bd];
ixgbe_validate_option(&node_param, &opt);
if (node_param != OPTION_UNSET) {
DPRINTK(PROBE, INFO, "node set to %d\n", node_param);
}
#ifdef module_param_array
}
#endif
/* check sanity of the value */
if (node_param != -1 && !node_online(node_param)) {
DPRINTK(PROBE, INFO,
"ignoring node set to invalid value %d\n",
node_param);
node_param = opt.def;
}
adapter->node = node_param;
}
#endif /* __VMKLNX__ */
}
|