Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

1) If the local_df boolean is set on an SKB we have to allocate a
unique ID even if IP_DF is set in the ipv4 headers, from Ansis
Atteka.

2) Some fixups for the new chipset support that went into the sfc
driver, from Ben Hutchings.

3) Because SCTP bypasses a good chunk of, and actually duplicates, the
logic of the ipv6 output path, some IPSEC things don't get done
properly. Integrate SCTP better into the ipv6 output path so that
these problems are fixed and such issues don't get missed in the
future either. From Daniel Borkmann.

4) Fix skge regressions added by the DMA mapping error return checking
added in v3.10, from Mikulas Patocka.

5) Kill some more IRQF_DISABLED references, from Michael Opdenacker.

6) Fix races and deadlocks in the bridging code, from Hong Zhiguo.

7) Fix error handling in tun_set_iff(), in particular don't leak
resources. From Jason Wang.

8) Prevent format-string injection into xen-netback driver, from Kees
Cook.

9) Fix regression added to netpoll ARP packet handling, in particular
check for the right ETH_P_ARP protocol code. From Sonic Zhang.

10) Try to deal with AMD IOMMU errors when using r8169 chips, from
Francois Romieu.

11) Cure freezes due to recent changes in the rt2x00 wireless driver,
from Stanislaw Gruszka.

12) Don't do SPI transfers (which can sleep) in interrupt context in
cw1200 driver, from Solomon Peachy.

13) Fix LEDs handling bug in 5720 tg3 chips already handled for 5719.
From Nithin Sujir.

14) Make xen_netbk_count_skb_slots() count the actual number of slots
that will be used, taking into consideration packing and other
issues that the transmit path will run into. From David Vrabel.

15) Use the correct maximum age when calculating the bridge
message_age_timer, from Chris Healy.

16) Get rid of memory leaks in mcs7780 IRDA driver, from Alexey
Khoroshilov.

17) Netfilter conntrack extensions were converted to RCU but are not
always freed properly using kfree_rcu(). Fix from Michal Kubecek.

18) VF reset recovery not being done correctly in qlcnic driver, from
Manish Chopra.

19) Fix inverted test in ATM nicstar driver, from Andy Shevchenko.

20) Missing workqueue destroy in cxgb4 error handling, from Wei Yang.

21) Internal switch not initialized properly in bgmac driver, from Rafał
Miłecki.

22) Netlink messages report wrong local and remote addresses in IPv6
tunneling, from Ding Zhi.

23) ICMP redirects should not generate socket errors in DCCP and SCTP.
We're still working out how this should be handled for RAW and UDP
sockets. From Daniel Borkmann and Duan Jiong.

24) We've had several bugs wherein the network namespace's loopback
device gets accessed after it is free'd, NULL it out so that we can
catch these problems more readily. From Eric W Biederman.

25) Fix regression in TCP RTO calculations, from Neal Cardwell.

26) Fix too early free of xen-netback network device when VIFs still
exist. From Paul Durrant.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (87 commits)
netconsole: fix a deadlock with rtnl and netconsole's mutex
netpoll: fix NULL pointer dereference in netpoll_cleanup
skge: fix broken driver
ip: generate unique IP identificator if local fragmentation is allowed
ip: use ip_hdr() in __ip_make_skb() to retrieve IP header
xen-netback: Don't destroy the netdev until the vif is shut down
net:dccp: do not report ICMP redirects to user space
cnic: Fix crash in cnic_bnx2x_service_kcq()
bnx2x, cnic, bnx2i, bnx2fc: Fix bnx2i and bnx2fc regressions.
vxlan: Avoid creating fdb entry with NULL destination
tcp: fix RTO calculated from cached RTT
drivers: net: phy: cicada.c: clears warning Use #include <linux/io.h> instead of <asm/io.h>
net loopback: Set loopback_dev to NULL when freed
batman-adv: set the TAG flag for the vid passed to BLA
netfilter: nfnetlink_queue: use network skb for sequence adjustment
net: sctp: rfc4443: do not report ICMP redirects to user space
net: usb: cdc_ether: use usb.h macros whenever possible
net: usb: cdc_ether: fix checkpatch errors and warnings
net: usb: cdc_ether: Use wwan interface for Telit modules
ip6_tunnels: raddr and laddr are inverted in nl msg
...

+755 -521
+6
Documentation/networking/bonding.txt
··· 1362 1362 To remove an ARP target: 1363 1363 # echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target 1364 1364 1365 + To configure the interval between learning packet transmits: 1366 + # echo 12 > /sys/class/net/bond0/bonding/lp_interval 1367 + NOTE: the lp_inteval is the number of seconds between instances where 1368 + the bonding driver sends learning packets to each slaves peer switch. The 1369 + default interval is 1 second. 1370 + 1365 1371 Example Configuration 1366 1372 --------------------- 1367 1373 We begin with the same example that is shown in section 3.3,
+1 -12
drivers/atm/he.c
··· 2865 2865 .id_table = he_pci_tbl, 2866 2866 }; 2867 2867 2868 - static int __init he_init(void) 2869 - { 2870 - return pci_register_driver(&he_driver); 2871 - } 2872 - 2873 - static void __exit he_cleanup(void) 2874 - { 2875 - pci_unregister_driver(&he_driver); 2876 - } 2877 - 2878 - module_init(he_init); 2879 - module_exit(he_cleanup); 2868 + module_pci_driver(he_driver);
+1 -1
drivers/atm/nicstar.c
··· 778 778 return error; 779 779 } 780 780 781 - if (mac[i] == NULL || mac_pton(mac[i], card->atmdev->esi)) { 781 + if (mac[i] == NULL || !mac_pton(mac[i], card->atmdev->esi)) { 782 782 nicstar_read_eprom(card->membase, NICSTAR_EPROM_MAC_ADDR_OFFSET, 783 783 card->atmdev->esi, 6); 784 784 if (memcmp(card->atmdev->esi, "\x00\x00\x00\x00\x00\x00", 6) ==
+7 -5
drivers/bcma/scan.c
··· 269 269 return NULL; 270 270 } 271 271 272 + #define IS_ERR_VALUE_U32(x) ((x) >= (u32)-MAX_ERRNO) 273 + 272 274 static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, 273 275 struct bcma_device_id *match, int core_num, 274 276 struct bcma_device *core) ··· 353 351 * the main register space for the core 354 352 */ 355 353 tmp = bcma_erom_get_addr_desc(bus, eromptr, SCAN_ADDR_TYPE_SLAVE, 0); 356 - if (tmp == 0 || IS_ERR_VALUE(tmp)) { 354 + if (tmp == 0 || IS_ERR_VALUE_U32(tmp)) { 357 355 /* Try again to see if it is a bridge */ 358 356 tmp = bcma_erom_get_addr_desc(bus, eromptr, 359 357 SCAN_ADDR_TYPE_BRIDGE, 0); 360 - if (tmp == 0 || IS_ERR_VALUE(tmp)) { 358 + if (tmp == 0 || IS_ERR_VALUE_U32(tmp)) { 361 359 return -EILSEQ; 362 360 } else { 363 361 bcma_info(bus, "Bridge found\n"); ··· 371 369 for (j = 0; ; j++) { 372 370 tmp = bcma_erom_get_addr_desc(bus, eromptr, 373 371 SCAN_ADDR_TYPE_SLAVE, i); 374 - if (IS_ERR_VALUE(tmp)) { 372 + if (IS_ERR_VALUE_U32(tmp)) { 375 373 /* no more entries for port _i_ */ 376 374 /* pr_debug("erom: slave port %d " 377 375 * "has %d descriptors\n", i, j); */ ··· 388 386 for (j = 0; ; j++) { 389 387 tmp = bcma_erom_get_addr_desc(bus, eromptr, 390 388 SCAN_ADDR_TYPE_MWRAP, i); 391 - if (IS_ERR_VALUE(tmp)) { 389 + if (IS_ERR_VALUE_U32(tmp)) { 392 390 /* no more entries for port _i_ */ 393 391 /* pr_debug("erom: master wrapper %d " 394 392 * "has %d descriptors\n", i, j); */ ··· 406 404 for (j = 0; ; j++) { 407 405 tmp = bcma_erom_get_addr_desc(bus, eromptr, 408 406 SCAN_ADDR_TYPE_SWRAP, i + hack); 409 - if (IS_ERR_VALUE(tmp)) { 407 + if (IS_ERR_VALUE_U32(tmp)) { 410 408 /* no more entries for port _i_ */ 411 409 /* pr_debug("erom: master wrapper %d " 412 410 * has %d descriptors\n", i, j); */
+2 -2
drivers/isdn/hardware/mISDN/hfcpci.c
··· 2295 2295 static void 2296 2296 hfcpci_softirq(void *arg) 2297 2297 { 2298 - (void) driver_for_each_device(&hfc_driver.driver, NULL, arg, 2299 - _hfcpci_softirq); 2298 + WARN_ON_ONCE(driver_for_each_device(&hfc_driver.driver, NULL, arg, 2299 + _hfcpci_softirq) != 0); 2300 2300 2301 2301 /* if next event would be in the past ... */ 2302 2302 if ((s32)(hfc_jiffies + tics - jiffies) <= 0)
+2 -2
drivers/isdn/hisax/amd7930_fn.c
··· 314 314 315 315 t += sprintf(t, "Amd7930: empty_Dfifo cnt: %d |", cs->rcvidx); 316 316 QuickHex(t, cs->rcvbuf, cs->rcvidx); 317 - debugl1(cs, cs->dlog); 317 + debugl1(cs, "%s", cs->dlog); 318 318 } 319 319 /* moves received data in sk-buffer */ 320 320 memcpy(skb_put(skb, cs->rcvidx), cs->rcvbuf, cs->rcvidx); ··· 406 406 407 407 t += sprintf(t, "Amd7930: fill_Dfifo cnt: %d |", count); 408 408 QuickHex(t, deb_ptr, count); 409 - debugl1(cs, cs->dlog); 409 + debugl1(cs, "%s", cs->dlog); 410 410 } 411 411 /* AMD interrupts on */ 412 412 AmdIrqOn(cs);
+2 -2
drivers/isdn/hisax/avm_pci.c
··· 285 285 t += sprintf(t, "hdlc_empty_fifo %c cnt %d", 286 286 bcs->channel ? 'B' : 'A', count); 287 287 QuickHex(t, p, count); 288 - debugl1(cs, bcs->blog); 288 + debugl1(cs, "%s", bcs->blog); 289 289 } 290 290 } 291 291 ··· 345 345 t += sprintf(t, "hdlc_fill_fifo %c cnt %d", 346 346 bcs->channel ? 'B' : 'A', count); 347 347 QuickHex(t, p, count); 348 - debugl1(cs, bcs->blog); 348 + debugl1(cs, "%s", bcs->blog); 349 349 } 350 350 } 351 351
+1 -1
drivers/isdn/hisax/config.c
··· 1896 1896 ptr--; 1897 1897 *ptr++ = '\n'; 1898 1898 *ptr = 0; 1899 - HiSax_putstatus(cs, NULL, cs->dlog); 1899 + HiSax_putstatus(cs, NULL, "%s", cs->dlog); 1900 1900 } else 1901 1901 HiSax_putstatus(cs, "LogEcho: ", 1902 1902 "warning Frame too big (%d)",
+2 -2
drivers/isdn/hisax/diva.c
··· 427 427 t += sprintf(t, "hscx_empty_fifo %c cnt %d", 428 428 bcs->hw.hscx.hscx ? 'B' : 'A', count); 429 429 QuickHex(t, ptr, count); 430 - debugl1(cs, bcs->blog); 430 + debugl1(cs, "%s", bcs->blog); 431 431 } 432 432 } 433 433 ··· 469 469 t += sprintf(t, "hscx_fill_fifo %c cnt %d", 470 470 bcs->hw.hscx.hscx ? 'B' : 'A', count); 471 471 QuickHex(t, ptr, count); 472 - debugl1(cs, bcs->blog); 472 + debugl1(cs, "%s", bcs->blog); 473 473 } 474 474 } 475 475
+1 -1
drivers/isdn/hisax/elsa.c
··· 535 535 t = tmp; 536 536 t += sprintf(tmp, "Arcofi data"); 537 537 QuickHex(t, p, cs->dc.isac.mon_rxp); 538 - debugl1(cs, tmp); 538 + debugl1(cs, "%s", tmp); 539 539 if ((cs->dc.isac.mon_rxp == 2) && (cs->dc.isac.mon_rx[0] == 0xa0)) { 540 540 switch (cs->dc.isac.mon_rx[1]) { 541 541 case 0x80:
+1 -1
drivers/isdn/hisax/elsa_ser.c
··· 344 344 345 345 t += sprintf(t, "modem read cnt %d", cs->hw.elsa.rcvcnt); 346 346 QuickHex(t, cs->hw.elsa.rcvbuf, cs->hw.elsa.rcvcnt); 347 - debugl1(cs, tmp); 347 + debugl1(cs, "%s", tmp); 348 348 } 349 349 cs->hw.elsa.rcvcnt = 0; 350 350 }
+1 -1
drivers/isdn/hisax/hfc_pci.c
··· 901 901 ptr--; 902 902 *ptr++ = '\n'; 903 903 *ptr = 0; 904 - HiSax_putstatus(cs, NULL, cs->dlog); 904 + HiSax_putstatus(cs, NULL, "%s", cs->dlog); 905 905 } else 906 906 HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", total - 3); 907 907 }
+1 -1
drivers/isdn/hisax/hfc_sx.c
··· 674 674 ptr--; 675 675 *ptr++ = '\n'; 676 676 *ptr = 0; 677 - HiSax_putstatus(cs, NULL, cs->dlog); 677 + HiSax_putstatus(cs, NULL, "%s", cs->dlog); 678 678 } else 679 679 HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", skb->len); 680 680 }
+2 -2
drivers/isdn/hisax/hscx_irq.c
··· 75 75 t += sprintf(t, "hscx_empty_fifo %c cnt %d", 76 76 bcs->hw.hscx.hscx ? 'B' : 'A', count); 77 77 QuickHex(t, ptr, count); 78 - debugl1(cs, bcs->blog); 78 + debugl1(cs, "%s", bcs->blog); 79 79 } 80 80 } 81 81 ··· 115 115 t += sprintf(t, "hscx_fill_fifo %c cnt %d", 116 116 bcs->hw.hscx.hscx ? 'B' : 'A', count); 117 117 QuickHex(t, ptr, count); 118 - debugl1(cs, bcs->blog); 118 + debugl1(cs, "%s", bcs->blog); 119 119 } 120 120 } 121 121
+2 -2
drivers/isdn/hisax/icc.c
··· 134 134 135 135 t += sprintf(t, "icc_empty_fifo cnt %d", count); 136 136 QuickHex(t, ptr, count); 137 - debugl1(cs, cs->dlog); 137 + debugl1(cs, "%s", cs->dlog); 138 138 } 139 139 } 140 140 ··· 176 176 177 177 t += sprintf(t, "icc_fill_fifo cnt %d", count); 178 178 QuickHex(t, ptr, count); 179 - debugl1(cs, cs->dlog); 179 + debugl1(cs, "%s", cs->dlog); 180 180 } 181 181 } 182 182
+4 -4
drivers/isdn/hisax/ipacx.c
··· 260 260 261 261 t += sprintf(t, "dch_empty_fifo() cnt %d", count); 262 262 QuickHex(t, ptr, count); 263 - debugl1(cs, cs->dlog); 263 + debugl1(cs, "%s", cs->dlog); 264 264 } 265 265 } 266 266 ··· 307 307 308 308 t += sprintf(t, "dch_fill_fifo() cnt %d", count); 309 309 QuickHex(t, ptr, count); 310 - debugl1(cs, cs->dlog); 310 + debugl1(cs, "%s", cs->dlog); 311 311 } 312 312 } 313 313 ··· 539 539 540 540 t += sprintf(t, "bch_empty_fifo() B-%d cnt %d", hscx, count); 541 541 QuickHex(t, ptr, count); 542 - debugl1(cs, bcs->blog); 542 + debugl1(cs, "%s", bcs->blog); 543 543 } 544 544 } 545 545 ··· 582 582 583 583 t += sprintf(t, "chb_fill_fifo() B-%d cnt %d", hscx, count); 584 584 QuickHex(t, ptr, count); 585 - debugl1(cs, bcs->blog); 585 + debugl1(cs, "%s", bcs->blog); 586 586 } 587 587 } 588 588
+2 -2
drivers/isdn/hisax/isac.c
··· 137 137 138 138 t += sprintf(t, "isac_empty_fifo cnt %d", count); 139 139 QuickHex(t, ptr, count); 140 - debugl1(cs, cs->dlog); 140 + debugl1(cs, "%s", cs->dlog); 141 141 } 142 142 } 143 143 ··· 179 179 180 180 t += sprintf(t, "isac_fill_fifo cnt %d", count); 181 181 QuickHex(t, ptr, count); 182 - debugl1(cs, cs->dlog); 182 + debugl1(cs, "%s", cs->dlog); 183 183 } 184 184 } 185 185
+3 -3
drivers/isdn/hisax/isar.c
··· 74 74 t = tmp; 75 75 t += sprintf(t, "sendmbox cnt %d", len); 76 76 QuickHex(t, &msg[len-i], (i > 64) ? 64 : i); 77 - debugl1(cs, tmp); 77 + debugl1(cs, "%s", tmp); 78 78 i -= 64; 79 79 } 80 80 } ··· 105 105 t = tmp; 106 106 t += sprintf(t, "rcv_mbox cnt %d", ireg->clsb); 107 107 QuickHex(t, &msg[ireg->clsb - i], (i > 64) ? 64 : i); 108 - debugl1(cs, tmp); 108 + debugl1(cs, "%s", tmp); 109 109 i -= 64; 110 110 } 111 111 } ··· 1248 1248 tp += sprintf(debbuf, "msg iis(%x) msb(%x)", 1249 1249 ireg->iis, ireg->cmsb); 1250 1250 QuickHex(tp, (u_char *)ireg->par, ireg->clsb); 1251 - debugl1(cs, debbuf); 1251 + debugl1(cs, "%s", debbuf); 1252 1252 } 1253 1253 break; 1254 1254 case ISAR_IIS_INVMSG:
+5 -13
drivers/isdn/hisax/jade.c
··· 81 81 int jade = bcs->hw.hscx.hscx; 82 82 83 83 if (cs->debug & L1_DEB_HSCX) { 84 - char tmp[40]; 85 - sprintf(tmp, "jade %c mode %d ichan %d", 86 - 'A' + jade, mode, bc); 87 - debugl1(cs, tmp); 84 + debugl1(cs, "jade %c mode %d ichan %d", 'A' + jade, mode, bc); 88 85 } 89 86 bcs->mode = mode; 90 87 bcs->channel = bc; ··· 254 257 clear_pending_jade_ints(struct IsdnCardState *cs) 255 258 { 256 259 int val; 257 - char tmp[64]; 258 260 259 261 cs->BC_Write_Reg(cs, 0, jade_HDLC_IMR, 0x00); 260 262 cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0x00); 261 263 262 264 val = cs->BC_Read_Reg(cs, 1, jade_HDLC_ISR); 263 - sprintf(tmp, "jade B ISTA %x", val); 264 - debugl1(cs, tmp); 265 + debugl1(cs, "jade B ISTA %x", val); 265 266 val = cs->BC_Read_Reg(cs, 0, jade_HDLC_ISR); 266 - sprintf(tmp, "jade A ISTA %x", val); 267 - debugl1(cs, tmp); 267 + debugl1(cs, "jade A ISTA %x", val); 268 268 val = cs->BC_Read_Reg(cs, 1, jade_HDLC_STAR); 269 - sprintf(tmp, "jade B STAR %x", val); 270 - debugl1(cs, tmp); 269 + debugl1(cs, "jade B STAR %x", val); 271 270 val = cs->BC_Read_Reg(cs, 0, jade_HDLC_STAR); 272 - sprintf(tmp, "jade A STAR %x", val); 273 - debugl1(cs, tmp); 271 + debugl1(cs, "jade A STAR %x", val); 274 272 /* Unmask ints */ 275 273 cs->BC_Write_Reg(cs, 0, jade_HDLC_IMR, 0xF8); 276 274 cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0xF8);
+2 -2
drivers/isdn/hisax/jade_irq.c
··· 65 65 t += sprintf(t, "jade_empty_fifo %c cnt %d", 66 66 bcs->hw.hscx.hscx ? 'B' : 'A', count); 67 67 QuickHex(t, ptr, count); 68 - debugl1(cs, bcs->blog); 68 + debugl1(cs, "%s", bcs->blog); 69 69 } 70 70 } 71 71 ··· 105 105 t += sprintf(t, "jade_fill_fifo %c cnt %d", 106 106 bcs->hw.hscx.hscx ? 'B' : 'A', count); 107 107 QuickHex(t, ptr, count); 108 - debugl1(cs, bcs->blog); 108 + debugl1(cs, "%s", bcs->blog); 109 109 } 110 110 } 111 111
+18 -32
drivers/isdn/hisax/l3_1tr6.c
··· 63 63 { 64 64 dev_kfree_skb(skb); 65 65 if (pc->st->l3.debug & L3_DEB_WARN) 66 - l3_debug(pc->st, msg); 66 + l3_debug(pc->st, "%s", msg); 67 67 l3_1tr6_release_req(pc, 0, NULL); 68 68 } 69 69 ··· 161 161 { 162 162 u_char *p; 163 163 int bcfound = 0; 164 - char tmp[80]; 165 164 struct sk_buff *skb = arg; 166 165 167 166 /* Channel Identification */ ··· 213 214 /* Signal all services, linklevel takes care of Service-Indicator */ 214 215 if (bcfound) { 215 216 if ((pc->para.setup.si1 != 7) && (pc->st->l3.debug & L3_DEB_WARN)) { 216 - sprintf(tmp, "non-digital call: %s -> %s", 217 + l3_debug(pc->st, "non-digital call: %s -> %s", 217 218 pc->para.setup.phone, 218 219 pc->para.setup.eazmsn); 219 - l3_debug(pc->st, tmp); 220 220 } 221 221 newl3state(pc, 6); 222 222 pc->st->l3.l3l4(pc->st, CC_SETUP | INDICATION, pc); ··· 299 301 { 300 302 u_char *p; 301 303 int i, tmpcharge = 0; 302 - char a_charge[8], tmp[32]; 304 + char a_charge[8]; 303 305 struct sk_buff *skb = arg; 304 306 305 307 p = skb->data; ··· 314 316 pc->st->l3.l3l4(pc->st, CC_CHARGE | INDICATION, pc); 315 317 } 316 318 if (pc->st->l3.debug & L3_DEB_CHARGE) { 317 - sprintf(tmp, "charging info %d", pc->para.chargeinfo); 318 - l3_debug(pc->st, tmp); 319 + l3_debug(pc->st, "charging info %d", 320 + pc->para.chargeinfo); 319 321 } 320 322 } else if (pc->st->l3.debug & L3_DEB_CHARGE) 321 323 l3_debug(pc->st, "charging info not found"); ··· 397 399 struct sk_buff *skb = arg; 398 400 u_char *p; 399 401 int i, tmpcharge = 0; 400 - char a_charge[8], tmp[32]; 402 + char a_charge[8]; 401 403 402 404 StopAllL3Timer(pc); 403 405 p = skb->data; ··· 412 414 pc->st->l3.l3l4(pc->st, CC_CHARGE | INDICATION, pc); 413 415 } 414 416 if (pc->st->l3.debug & L3_DEB_CHARGE) { 415 - sprintf(tmp, "charging info %d", pc->para.chargeinfo); 416 - l3_debug(pc->st, tmp); 417 + l3_debug(pc->st, "charging info %d", 418 + pc->para.chargeinfo); 417 419 } 418 420 } else if (pc->st->l3.debug & L3_DEB_CHARGE) 419 421 l3_debug(pc->st, "charging info not found"); ··· 744 746 int i, mt, cr; 745 747 struct l3_process *proc; 746 748 struct sk_buff *skb = arg; 747 - char tmp[80]; 748 749 749 750 switch (pr) { 750 751 case (DL_DATA | INDICATION): ··· 759 762 } 760 763 if (skb->len < 4) { 761 764 if (st->l3.debug & L3_DEB_PROTERR) { 762 - sprintf(tmp, "up1tr6 len only %d", skb->len); 763 - l3_debug(st, tmp); 765 + l3_debug(st, "up1tr6 len only %d", skb->len); 764 766 } 765 767 dev_kfree_skb(skb); 766 768 return; 767 769 } 768 770 if ((skb->data[0] & 0xfe) != PROTO_DIS_N0) { 769 771 if (st->l3.debug & L3_DEB_PROTERR) { 770 - sprintf(tmp, "up1tr6%sunexpected discriminator %x message len %d", 772 + l3_debug(st, "up1tr6%sunexpected discriminator %x message len %d", 771 773 (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", 772 774 skb->data[0], skb->len); 773 - l3_debug(st, tmp); 774 775 } 775 776 dev_kfree_skb(skb); 776 777 return; 777 778 } 778 779 if (skb->data[1] != 1) { 779 780 if (st->l3.debug & L3_DEB_PROTERR) { 780 - sprintf(tmp, "up1tr6 CR len not 1"); 781 - l3_debug(st, tmp); 781 + l3_debug(st, "up1tr6 CR len not 1"); 782 782 } 783 783 dev_kfree_skb(skb); 784 784 return; ··· 785 791 if (skb->data[0] == PROTO_DIS_N0) { 786 792 dev_kfree_skb(skb); 787 793 if (st->l3.debug & L3_DEB_STATE) { 788 - sprintf(tmp, "up1tr6%s N0 mt %x unhandled", 794 + l3_debug(st, "up1tr6%s N0 mt %x unhandled", 789 795 (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", mt); 790 - l3_debug(st, tmp); 791 796 } 792 797 } else if (skb->data[0] == PROTO_DIS_N1) { 793 798 if (!(proc = getl3proc(st, cr))) { ··· 794 801 if (cr < 128) { 795 802 if (!(proc = new_l3_process(st, cr))) { 796 803 if (st->l3.debug & L3_DEB_PROTERR) { 797 - sprintf(tmp, "up1tr6 no roc mem"); 798 - l3_debug(st, tmp); 804 + l3_debug(st, "up1tr6 no roc mem"); 799 805 } 800 806 dev_kfree_skb(skb); 801 807 return; ··· 813 821 } else { 814 822 if (!(proc = new_l3_process(st, cr))) { 815 823 if (st->l3.debug & L3_DEB_PROTERR) { 816 - sprintf(tmp, "up1tr6 no roc mem"); 817 - l3_debug(st, tmp); 824 + l3_debug(st, "up1tr6 no roc mem"); 818 825 } 819 826 dev_kfree_skb(skb); 820 827 return; ··· 828 837 if (i == ARRAY_SIZE(datastln1)) { 829 838 dev_kfree_skb(skb); 830 839 if (st->l3.debug & L3_DEB_STATE) { 831 - sprintf(tmp, "up1tr6%sstate %d mt %x unhandled", 840 + l3_debug(st, "up1tr6%sstate %d mt %x unhandled", 832 841 (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", 833 842 proc->state, mt); 834 - l3_debug(st, tmp); 835 843 } 836 844 return; 837 845 } else { 838 846 if (st->l3.debug & L3_DEB_STATE) { 839 - sprintf(tmp, "up1tr6%sstate %d mt %x", 847 + l3_debug(st, "up1tr6%sstate %d mt %x", 840 848 (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", 841 849 proc->state, mt); 842 - l3_debug(st, tmp); 843 850 } 844 851 datastln1[i].rout(proc, pr, skb); 845 852 } ··· 850 861 int i, cr; 851 862 struct l3_process *proc; 852 863 struct Channel *chan; 853 - char tmp[80]; 854 864 855 865 if ((DL_ESTABLISH | REQUEST) == pr) { 856 866 l3_msg(st, pr, NULL); ··· 876 888 break; 877 889 if (i == ARRAY_SIZE(downstl)) { 878 890 if (st->l3.debug & L3_DEB_STATE) { 879 - sprintf(tmp, "down1tr6 state %d prim %d unhandled", 891 + l3_debug(st, "down1tr6 state %d prim %d unhandled", 880 892 proc->state, pr); 881 - l3_debug(st, tmp); 882 893 } 883 894 } else { 884 895 if (st->l3.debug & L3_DEB_STATE) { 885 - sprintf(tmp, "down1tr6 state %d prim %d", 896 + l3_debug(st, "down1tr6 state %d prim %d", 886 897 proc->state, pr); 887 - l3_debug(st, tmp); 888 898 } 889 899 downstl[i].rout(proc, pr, arg); 890 900 }
+1 -1
drivers/isdn/hisax/netjet.c
··· 176 176 else 177 177 j = i; 178 178 QuickHex(t, p, j); 179 - debugl1(cs, tmp); 179 + debugl1(cs, "%s", tmp); 180 180 p += j; 181 181 i -= j; 182 182 t = tmp;
+3 -3
drivers/isdn/hisax/q931.c
··· 1179 1179 dp--; 1180 1180 *dp++ = '\n'; 1181 1181 *dp = 0; 1182 - HiSax_putstatus(cs, NULL, cs->dlog); 1182 + HiSax_putstatus(cs, NULL, "%s", cs->dlog); 1183 1183 } else 1184 1184 HiSax_putstatus(cs, "LogFrame: ", "warning Frame too big (%d)", size); 1185 1185 } ··· 1246 1246 } 1247 1247 if (finish) { 1248 1248 *dp = 0; 1249 - HiSax_putstatus(cs, NULL, cs->dlog); 1249 + HiSax_putstatus(cs, NULL, "%s", cs->dlog); 1250 1250 return; 1251 1251 } 1252 1252 if ((0xfe & buf[0]) == PROTO_DIS_N0) { /* 1TR6 */ ··· 1509 1509 dp += sprintf(dp, "Unknown protocol %x!", buf[0]); 1510 1510 } 1511 1511 *dp = 0; 1512 - HiSax_putstatus(cs, NULL, cs->dlog); 1512 + HiSax_putstatus(cs, NULL, "%s", cs->dlog); 1513 1513 }
+4 -4
drivers/isdn/hisax/w6692.c
··· 154 154 155 155 t += sprintf(t, "W6692_empty_fifo cnt %d", count); 156 156 QuickHex(t, ptr, count); 157 - debugl1(cs, cs->dlog); 157 + debugl1(cs, "%s", cs->dlog); 158 158 } 159 159 } 160 160 ··· 196 196 197 197 t += sprintf(t, "W6692_fill_fifo cnt %d", count); 198 198 QuickHex(t, ptr, count); 199 - debugl1(cs, cs->dlog); 199 + debugl1(cs, "%s", cs->dlog); 200 200 } 201 201 } 202 202 ··· 226 226 t += sprintf(t, "W6692B_empty_fifo %c cnt %d", 227 227 bcs->channel + '1', count); 228 228 QuickHex(t, ptr, count); 229 - debugl1(cs, bcs->blog); 229 + debugl1(cs, "%s", bcs->blog); 230 230 } 231 231 } 232 232 ··· 264 264 t += sprintf(t, "W6692B_fill_fifo %c cnt %d", 265 265 bcs->channel + '1', count); 266 266 QuickHex(t, ptr, count); 267 - debugl1(cs, bcs->blog); 267 + debugl1(cs, "%s", bcs->blog); 268 268 } 269 269 } 270 270
+1 -1
drivers/net/bonding/bond_alb.c
··· 1472 1472 bond_info->lp_counter++; 1473 1473 1474 1474 /* send learning packets */ 1475 - if (bond_info->lp_counter >= BOND_ALB_LP_TICKS) { 1475 + if (bond_info->lp_counter >= BOND_ALB_LP_TICKS(bond)) { 1476 1476 /* change of curr_active_slave involves swapping of mac addresses. 1477 1477 * in order to avoid this swapping from happening while 1478 1478 * sending the learning packets, the curr_slave_lock must be held for
+5 -4
drivers/net/bonding/bond_alb.h
··· 36 36 * Used for division - never set 37 37 * to zero !!! 38 38 */ 39 - #define BOND_ALB_LP_INTERVAL 1 /* In seconds, periodic send of 40 - * learning packets to the switch 41 - */ 39 + #define BOND_ALB_DEFAULT_LP_INTERVAL 1 40 + #define BOND_ALB_LP_INTERVAL(bond) (bond->params.lp_interval) /* In seconds, periodic send of 41 + * learning packets to the switch 42 + */ 42 43 43 44 #define BOND_TLB_REBALANCE_TICKS (BOND_TLB_REBALANCE_INTERVAL \ 44 45 * ALB_TIMER_TICKS_PER_SEC) 45 46 46 - #define BOND_ALB_LP_TICKS (BOND_ALB_LP_INTERVAL \ 47 + #define BOND_ALB_LP_TICKS(bond) (BOND_ALB_LP_INTERVAL(bond) \ 47 48 * ALB_TIMER_TICKS_PER_SEC) 48 49 49 50 #define TLB_HASH_TABLE_SIZE 256 /* The size of the clients hash table.
+1
drivers/net/bonding/bond_main.c
··· 4416 4416 params->all_slaves_active = all_slaves_active; 4417 4417 params->resend_igmp = resend_igmp; 4418 4418 params->min_links = min_links; 4419 + params->lp_interval = BOND_ALB_DEFAULT_LP_INTERVAL; 4419 4420 4420 4421 if (primary) { 4421 4422 strncpy(params->primary, primary, IFNAMSIZ);
+39
drivers/net/bonding/bond_sysfs.c
··· 1699 1699 static DEVICE_ATTR(resend_igmp, S_IRUGO | S_IWUSR, 1700 1700 bonding_show_resend_igmp, bonding_store_resend_igmp); 1701 1701 1702 + 1703 + static ssize_t bonding_show_lp_interval(struct device *d, 1704 + struct device_attribute *attr, 1705 + char *buf) 1706 + { 1707 + struct bonding *bond = to_bond(d); 1708 + return sprintf(buf, "%d\n", bond->params.lp_interval); 1709 + } 1710 + 1711 + static ssize_t bonding_store_lp_interval(struct device *d, 1712 + struct device_attribute *attr, 1713 + const char *buf, size_t count) 1714 + { 1715 + struct bonding *bond = to_bond(d); 1716 + int new_value, ret = count; 1717 + 1718 + if (sscanf(buf, "%d", &new_value) != 1) { 1719 + pr_err("%s: no lp interval value specified.\n", 1720 + bond->dev->name); 1721 + ret = -EINVAL; 1722 + goto out; 1723 + } 1724 + 1725 + if (new_value <= 0) { 1726 + pr_err ("%s: lp_interval must be between 1 and %d\n", 1727 + bond->dev->name, INT_MAX); 1728 + ret = -EINVAL; 1729 + goto out; 1730 + } 1731 + 1732 + bond->params.lp_interval = new_value; 1733 + out: 1734 + return ret; 1735 + } 1736 + 1737 + static DEVICE_ATTR(lp_interval, S_IRUGO | S_IWUSR, 1738 + bonding_show_lp_interval, bonding_store_lp_interval); 1739 + 1702 1740 static struct attribute *per_bond_attrs[] = { 1703 1741 &dev_attr_slaves.attr, 1704 1742 &dev_attr_mode.attr, ··· 1767 1729 &dev_attr_all_slaves_active.attr, 1768 1730 &dev_attr_resend_igmp.attr, 1769 1731 &dev_attr_min_links.attr, 1732 + &dev_attr_lp_interval.attr, 1770 1733 NULL, 1771 1734 }; 1772 1735
+1
drivers/net/bonding/bonding.h
··· 176 176 int tx_queues; 177 177 int all_slaves_active; 178 178 int resend_igmp; 179 + int lp_interval; 179 180 }; 180 181 181 182 struct bond_parm_tbl {
+2 -2
drivers/net/ethernet/adi/bfin_mac.c
··· 530 530 if (lp->wol && !lp->irq_wake_requested) { 531 531 /* register wake irq handler */ 532 532 rc = request_irq(IRQ_MAC_WAKEDET, bfin_mac_wake_interrupt, 533 - IRQF_DISABLED, "EMAC_WAKE", dev); 533 + 0, "EMAC_WAKE", dev); 534 534 if (rc) 535 535 return rc; 536 536 lp->irq_wake_requested = true; ··· 1686 1686 /* now, enable interrupts */ 1687 1687 /* register irq handler */ 1688 1688 rc = request_irq(IRQ_MAC_RX, bfin_mac_interrupt, 1689 - IRQF_DISABLED, "EMAC_RX", ndev); 1689 + 0, "EMAC_RX", ndev); 1690 1690 if (rc) { 1691 1691 dev_err(&pdev->dev, "Cannot request Blackfin MAC RX IRQ!\n"); 1692 1692 rc = -EBUSY;
+1 -1
drivers/net/ethernet/amd/sun3lance.c
··· 358 358 359 359 REGA(CSR0) = CSR0_STOP; 360 360 361 - if (request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev) < 0) { 361 + if (request_irq(LANCE_IRQ, lance_interrupt, 0, "SUN3 Lance", dev) < 0) { 362 362 #ifdef CONFIG_SUN3 363 363 iounmap((void __iomem *)ioaddr); 364 364 #endif
+2 -7
drivers/net/ethernet/atheros/alx/main.c
··· 1188 1188 struct alx_priv *alx; 1189 1189 struct alx_hw *hw; 1190 1190 bool phy_configured; 1191 - int bars, pm_cap, err; 1191 + int bars, err; 1192 1192 1193 1193 err = pci_enable_device_mem(pdev); 1194 1194 if (err) ··· 1225 1225 pci_enable_pcie_error_reporting(pdev); 1226 1226 pci_set_master(pdev); 1227 1227 1228 - pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM); 1229 - if (pm_cap == 0) { 1228 + if (!pdev->pm_cap) { 1230 1229 dev_err(&pdev->dev, 1231 1230 "Can't find power management capability, aborting\n"); 1232 1231 err = -EIO; 1233 1232 goto out_pci_release; 1234 1233 } 1235 - 1236 - err = pci_set_power_state(pdev, PCI_D0); 1237 - if (err) 1238 - goto out_pci_release; 1239 1234 1240 1235 netdev = alloc_etherdev(sizeof(*alx)); 1241 1236 if (!netdev) {
+31 -13
drivers/net/ethernet/broadcom/bgmac.c
··· 157 157 if (++ring->end >= BGMAC_TX_RING_SLOTS) 158 158 ring->end = 0; 159 159 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_TX_INDEX, 160 + ring->index_base + 160 161 ring->end * sizeof(struct bgmac_dma_desc)); 161 162 162 163 /* Always keep one slot free to allow detecting bugged calls. */ ··· 181 180 182 181 /* The last slot that hardware didn't consume yet */ 183 182 empty_slot = bgmac_read(bgmac, ring->mmio_base + BGMAC_DMA_TX_STATUS); 183 + empty_slot &= BGMAC_DMA_TX_STATDPTR; 184 + empty_slot -= ring->index_base; 184 185 empty_slot &= BGMAC_DMA_TX_STATDPTR; 185 186 empty_slot /= sizeof(struct bgmac_dma_desc); 186 187 ··· 276 273 int handled = 0; 277 274 278 275 end_slot = bgmac_read(bgmac, ring->mmio_base + BGMAC_DMA_RX_STATUS); 276 + end_slot &= BGMAC_DMA_RX_STATDPTR; 277 + end_slot -= ring->index_base; 279 278 end_slot &= BGMAC_DMA_RX_STATDPTR; 280 279 end_slot /= sizeof(struct bgmac_dma_desc); 281 280 ··· 423 418 ring = &bgmac->tx_ring[i]; 424 419 ring->num_slots = BGMAC_TX_RING_SLOTS; 425 420 ring->mmio_base = ring_base[i]; 426 - if (bgmac_dma_unaligned(bgmac, ring, BGMAC_DMA_RING_TX)) 427 - bgmac_warn(bgmac, "TX on ring 0x%X supports unaligned addressing but this feature is not implemented\n", 428 - ring->mmio_base); 429 421 430 422 /* Alloc ring of descriptors */ 431 423 size = ring->num_slots * sizeof(struct bgmac_dma_desc); ··· 437 435 if (ring->dma_base & 0xC0000000) 438 436 bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n"); 439 437 438 + ring->unaligned = bgmac_dma_unaligned(bgmac, ring, 439 + BGMAC_DMA_RING_TX); 440 + if (ring->unaligned) 441 + ring->index_base = lower_32_bits(ring->dma_base); 442 + else 443 + ring->index_base = 0; 444 + 440 445 /* No need to alloc TX slots yet */ 441 446 } 442 447 ··· 453 444 ring = &bgmac->rx_ring[i]; 454 445 ring->num_slots = BGMAC_RX_RING_SLOTS; 455 446 ring->mmio_base = ring_base[i]; 456 - if (bgmac_dma_unaligned(bgmac, ring, BGMAC_DMA_RING_RX)) 457 - bgmac_warn(bgmac, "RX on ring 0x%X supports unaligned addressing but this feature is not implemented\n", 458 - ring->mmio_base); 459 447 460 448 /* Alloc ring of descriptors */ 461 449 size = ring->num_slots * sizeof(struct bgmac_dma_desc); ··· 467 461 } 468 462 if (ring->dma_base & 0xC0000000) 469 463 bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n"); 464 + 465 + ring->unaligned = bgmac_dma_unaligned(bgmac, ring, 466 + BGMAC_DMA_RING_RX); 467 + if (ring->unaligned) 468 + ring->index_base = lower_32_bits(ring->dma_base); 469 + else 470 + ring->index_base = 0; 470 471 471 472 /* Alloc RX slots */ 472 473 for (j = 0; j < ring->num_slots; j++) { ··· 502 489 for (i = 0; i < BGMAC_MAX_TX_RINGS; i++) { 503 490 ring = &bgmac->tx_ring[i]; 504 491 505 - /* We don't implement unaligned addressing, so enable first */ 506 - bgmac_dma_tx_enable(bgmac, ring); 492 + if (!ring->unaligned) 493 + bgmac_dma_tx_enable(bgmac, ring); 507 494 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_TX_RINGLO, 508 495 lower_32_bits(ring->dma_base)); 509 496 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_TX_RINGHI, 510 497 upper_32_bits(ring->dma_base)); 498 + if (ring->unaligned) 499 + bgmac_dma_tx_enable(bgmac, ring); 511 500 512 501 ring->start = 0; 513 502 ring->end = 0; /* Points the slot that should *not* be read */ ··· 520 505 521 506 ring = &bgmac->rx_ring[i]; 522 507 523 - /* We don't implement unaligned addressing, so enable first */ 524 - bgmac_dma_rx_enable(bgmac, ring); 508 + if (!ring->unaligned) 509 + bgmac_dma_rx_enable(bgmac, ring); 525 510 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_RX_RINGLO, 526 511 lower_32_bits(ring->dma_base)); 527 512 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_RX_RINGHI, 528 513 upper_32_bits(ring->dma_base)); 514 + if (ring->unaligned) 515 + bgmac_dma_rx_enable(bgmac, ring); 529 516 530 517 for (j = 0, dma_desc = ring->cpu_base; j < ring->num_slots; 531 518 j++, dma_desc++) { ··· 548 531 } 549 532 550 533 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_RX_INDEX, 534 + ring->index_base + 551 535 ring->num_slots * sizeof(struct bgmac_dma_desc)); 552 536 553 537 ring->start = 0; ··· 926 908 struct bcma_drv_cc *cc = &bgmac->core->bus->drv_cc; 927 909 u8 et_swtype = 0; 928 910 u8 sw_type = BGMAC_CHIPCTL_1_SW_TYPE_EPHY | 929 - BGMAC_CHIPCTL_1_IF_TYPE_RMII; 930 - char buf[2]; 911 + BGMAC_CHIPCTL_1_IF_TYPE_MII; 912 + char buf[4]; 931 913 932 - if (bcm47xx_nvram_getenv("et_swtype", buf, 1) > 0) { 914 + if (bcm47xx_nvram_getenv("et_swtype", buf, sizeof(buf)) > 0) { 933 915 if (kstrtou8(buf, 0, &et_swtype)) 934 916 bgmac_err(bgmac, "Failed to parse et_swtype (%s)\n", 935 917 buf);
+3 -1
drivers/net/ethernet/broadcom/bgmac.h
··· 333 333 334 334 #define BGMAC_CHIPCTL_1_IF_TYPE_MASK 0x00000030 335 335 #define BGMAC_CHIPCTL_1_IF_TYPE_RMII 0x00000000 336 - #define BGMAC_CHIPCTL_1_IF_TYPE_MI 0x00000010 336 + #define BGMAC_CHIPCTL_1_IF_TYPE_MII 0x00000010 337 337 #define BGMAC_CHIPCTL_1_IF_TYPE_RGMII 0x00000020 338 338 #define BGMAC_CHIPCTL_1_SW_TYPE_MASK 0x000000C0 339 339 #define BGMAC_CHIPCTL_1_SW_TYPE_EPHY 0x00000000 ··· 384 384 u16 mmio_base; 385 385 struct bgmac_dma_desc *cpu_base; 386 386 dma_addr_t dma_base; 387 + u32 index_base; /* Used for unaligned rings only, otherwise 0 */ 388 + bool unaligned; 387 389 388 390 struct bgmac_slot_info slots[BGMAC_RX_RING_SLOTS]; 389 391 };
+33 -4
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
··· 246 246 BNX2X_MAX_CNIC_ETH_CL_ID_IDX, 247 247 }; 248 248 249 - #define BNX2X_CNIC_START_ETH_CID(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) *\ 249 + /* use a value high enough to be above all the PFs, which has least significant 250 + * nibble as 8, so when cnic needs to come up with a CID for UIO to use to 251 + * calculate doorbell address according to old doorbell configuration scheme 252 + * (db_msg_sz 1 << 7 * cid + 0x40 DPM offset) it can come up with a valid number 253 + * We must avoid coming up with cid 8 for iscsi since according to this method 254 + * the designated UIO cid will come out 0 and it has a special handling for that 255 + * case which doesn't suit us. Therefore will will cieling to closes cid which 256 + * has least signigifcant nibble 8 and if it is 8 we will move forward to 0x18. 257 + */ 258 + 259 + #define BNX2X_1st_NON_L2_ETH_CID(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) * \ 250 260 (bp)->max_cos) 261 + /* amount of cids traversed by UIO's DPM addition to doorbell */ 262 + #define UIO_DPM 8 263 + /* roundup to DPM offset */ 264 + #define UIO_ROUNDUP(bp) (roundup(BNX2X_1st_NON_L2_ETH_CID(bp), \ 265 + UIO_DPM)) 266 + /* offset to nearest value which has lsb nibble matching DPM */ 267 + #define UIO_CID_OFFSET(bp) ((UIO_ROUNDUP(bp) + UIO_DPM) % \ 268 + (UIO_DPM * 2)) 269 + /* add offset to rounded-up cid to get a value which could be used with UIO */ 270 + #define UIO_DPM_ALIGN(bp) (UIO_ROUNDUP(bp) + UIO_CID_OFFSET(bp)) 271 + /* but wait - avoid UIO special case for cid 0 */ 272 + #define UIO_DPM_CID0_OFFSET(bp) ((UIO_DPM * 2) * \ 273 + (UIO_DPM_ALIGN(bp) == UIO_DPM)) 274 + /* Properly DPM aligned CID dajusted to cid 0 secal case */ 275 + #define BNX2X_CNIC_START_ETH_CID(bp) (UIO_DPM_ALIGN(bp) + \ 276 + (UIO_DPM_CID0_OFFSET(bp))) 277 + /* how many cids were wasted - need this value for cid allocation */ 278 + #define UIO_CID_PAD(bp) (BNX2X_CNIC_START_ETH_CID(bp) - \ 279 + BNX2X_1st_NON_L2_ETH_CID(bp)) 251 280 /* iSCSI L2 */ 252 281 #define BNX2X_ISCSI_ETH_CID(bp) (BNX2X_CNIC_START_ETH_CID(bp)) 253 282 /* FCoE L2 */ ··· 1571 1542 */ 1572 1543 bool fcoe_init; 1573 1544 1574 - int pm_cap; 1575 1545 int mrrs; 1576 1546 1577 1547 struct delayed_work sp_task; ··· 1709 1681 * Maximum CID count that might be required by the bnx2x: 1710 1682 * Max RSS * Max_Tx_Multi_Cos + FCoE + iSCSI 1711 1683 */ 1684 + 1712 1685 #define BNX2X_L2_CID_COUNT(bp) (BNX2X_NUM_ETH_QUEUES(bp) * BNX2X_MULTI_TX_COS \ 1713 - + 2 * CNIC_SUPPORT(bp)) 1686 + + CNIC_SUPPORT(bp) * (2 + UIO_CID_PAD(bp))) 1714 1687 #define BNX2X_L2_MAX_CID(bp) (BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS \ 1715 - + 2 * CNIC_SUPPORT(bp)) 1688 + + CNIC_SUPPORT(bp) * (2 + UIO_CID_PAD(bp))) 1716 1689 #define L2_ILT_LINES(bp) (DIV_ROUND_UP(BNX2X_L2_CID_COUNT(bp),\ 1717 1690 ILT_PAGE_CIDS)) 1718 1691
+4 -4
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 3008 3008 u16 pmcsr; 3009 3009 3010 3010 /* If there is no power capability, silently succeed */ 3011 - if (!bp->pm_cap) { 3011 + if (!bp->pdev->pm_cap) { 3012 3012 BNX2X_DEV_INFO("No power capability. Breaking.\n"); 3013 3013 return 0; 3014 3014 } 3015 3015 3016 - pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmcsr); 3016 + pci_read_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_CTRL, &pmcsr); 3017 3017 3018 3018 switch (state) { 3019 3019 case PCI_D0: 3020 - pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, 3020 + pci_write_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_CTRL, 3021 3021 ((pmcsr & ~PCI_PM_CTRL_STATE_MASK) | 3022 3022 PCI_PM_CTRL_PME_STATUS)); 3023 3023 ··· 3041 3041 if (bp->wol) 3042 3042 pmcsr |= PCI_PM_CTRL_PME_ENABLE; 3043 3043 3044 - pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, 3044 + pci_write_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_CTRL, 3045 3045 pmcsr); 3046 3046 3047 3047 /* No more memory access after this point until
+2 -2
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
··· 1387 1387 u16 pm = 0; 1388 1388 struct net_device *dev = pci_get_drvdata(bp->pdev); 1389 1389 1390 - if (bp->pm_cap) 1390 + if (bp->pdev->pm_cap) 1391 1391 rc = pci_read_config_word(bp->pdev, 1392 - bp->pm_cap + PCI_PM_CTRL, &pm); 1392 + bp->pdev->pm_cap + PCI_PM_CTRL, &pm); 1393 1393 1394 1394 if ((rc && !netif_running(dev)) || 1395 1395 (!rc && ((pm & PCI_PM_CTRL_STATE_MASK) != (__force u16)PCI_D0)))
+9 -5
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 8652 8652 else if (bp->wol) { 8653 8653 u32 emac_base = port ? GRCBASE_EMAC1 : GRCBASE_EMAC0; 8654 8654 u8 *mac_addr = bp->dev->dev_addr; 8655 + struct pci_dev *pdev = bp->pdev; 8655 8656 u32 val; 8656 8657 u16 pmc; 8657 8658 ··· 8669 8668 EMAC_WR(bp, EMAC_REG_EMAC_MAC_MATCH + entry + 4, val); 8670 8669 8671 8670 /* Enable the PME and clear the status */ 8672 - pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmc); 8671 + pci_read_config_word(pdev, pdev->pm_cap + PCI_PM_CTRL, &pmc); 8673 8672 pmc |= PCI_PM_CTRL_PME_ENABLE | PCI_PM_CTRL_PME_STATUS; 8674 - pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, pmc); 8673 + pci_write_config_word(pdev, pdev->pm_cap + PCI_PM_CTRL, pmc); 8675 8674 8676 8675 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_EN; 8677 8676 ··· 10400 10399 break; 10401 10400 } 10402 10401 10403 - pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_PMC, &pmc); 10402 + pci_read_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_PMC, &pmc); 10404 10403 bp->flags |= (pmc & PCI_PM_CAP_PME_D3cold) ? 0 : NO_WOL_FLAG; 10405 10404 10406 10405 BNX2X_DEV_INFO("%sWoL capable\n", ··· 12142 12141 } 12143 12142 12144 12143 if (IS_PF(bp)) { 12145 - bp->pm_cap = pdev->pm_cap; 12146 - if (bp->pm_cap == 0) { 12144 + if (!pdev->pm_cap) { 12147 12145 dev_err(&bp->pdev->dev, 12148 12146 "Cannot find power management capability, aborting\n"); 12149 12147 rc = -EIO; ··· 13631 13631 cp->starting_cid = bnx2x_cid_ilt_lines(bp) * ILT_PAGE_CIDS; 13632 13632 cp->fcoe_init_cid = BNX2X_FCOE_ETH_CID(bp); 13633 13633 cp->iscsi_l2_cid = BNX2X_ISCSI_ETH_CID(bp); 13634 + 13635 + DP(NETIF_MSG_IFUP, "BNX2X_1st_NON_L2_ETH_CID(bp) %x, cp->starting_cid %x, cp->fcoe_init_cid %x, cp->iscsi_l2_cid %x\n", 13636 + BNX2X_1st_NON_L2_ETH_CID(bp), cp->starting_cid, cp->fcoe_init_cid, 13637 + cp->iscsi_l2_cid); 13634 13638 13635 13639 if (NO_ISCSI_OOO(bp)) 13636 13640 cp->drv_state |= CNIC_DRV_STATE_NO_ISCSI_OOO;
+4 -2
drivers/net/ethernet/broadcom/cnic.c
··· 3135 3135 { 3136 3136 struct cnic_dev *dev = (struct cnic_dev *) data; 3137 3137 struct cnic_local *cp = dev->cnic_priv; 3138 + struct bnx2x *bp = netdev_priv(dev->netdev); 3138 3139 u32 status_idx, new_status_idx; 3139 3140 3140 3141 if (unlikely(!test_bit(CNIC_F_CNIC_UP, &dev->flags))) ··· 3147 3146 CNIC_WR16(dev, cp->kcq1.io_addr, 3148 3147 cp->kcq1.sw_prod_idx + MAX_KCQ_IDX); 3149 3148 3150 - if (cp->ethdev->drv_state & CNIC_DRV_STATE_NO_FCOE) { 3149 + if (!CNIC_SUPPORTS_FCOE(bp)) { 3151 3150 cp->arm_int(dev, status_idx); 3152 3151 break; 3153 3152 } ··· 5218 5217 "iSCSI CLIENT_SETUP did not complete\n"); 5219 5218 cnic_spq_completion(dev, DRV_CTL_RET_L2_SPQ_CREDIT_CMD, 1); 5220 5219 cnic_ring_ctl(dev, cid, cli, 1); 5221 - *cid_ptr = cid; 5220 + *cid_ptr = cid >> 4; 5221 + *(cid_ptr + 1) = cid * bp->db_size; 5222 5222 } 5223 5223 } 5224 5224
+3 -3
drivers/net/ethernet/broadcom/tg3.c
··· 3034 3034 { 3035 3035 switch (tg3_asic_rev(tp)) { 3036 3036 case ASIC_REV_5719: 3037 + case ASIC_REV_5720: 3037 3038 if ((tp->phy_flags & TG3_PHYFLG_MII_SERDES) && 3038 3039 !tp->pci_fn) 3039 3040 return true; ··· 16193 16192 * So explicitly force the chip into D0 here. 16194 16193 */ 16195 16194 pci_read_config_dword(tp->pdev, 16196 - tp->pm_cap + PCI_PM_CTRL, 16195 + tp->pdev->pm_cap + PCI_PM_CTRL, 16197 16196 &pm_reg); 16198 16197 pm_reg &= ~PCI_PM_CTRL_STATE_MASK; 16199 16198 pm_reg |= PCI_PM_CTRL_PME_ENABLE | 0 /* D0 */; 16200 16199 pci_write_config_dword(tp->pdev, 16201 - tp->pm_cap + PCI_PM_CTRL, 16200 + tp->pdev->pm_cap + PCI_PM_CTRL, 16202 16201 pm_reg); 16203 16202 16204 16203 /* Also, force SERR#/PERR# in PCI command. */ ··· 17347 17346 tp = netdev_priv(dev); 17348 17347 tp->pdev = pdev; 17349 17348 tp->dev = dev; 17350 - tp->pm_cap = pdev->pm_cap; 17351 17349 tp->rx_mode = TG3_DEF_RX_MODE; 17352 17350 tp->tx_mode = TG3_DEF_TX_MODE; 17353 17351 tp->irq_sync = 1;
-1
drivers/net/ethernet/broadcom/tg3.h
··· 3234 3234 u8 pci_lat_timer; 3235 3235 3236 3236 int pci_fn; 3237 - int pm_cap; 3238 3237 int msi_cap; 3239 3238 int pcix_cap; 3240 3239 int pcie_readrq;
+3 -1
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
··· 6149 6149 pr_warn("could not create debugfs entry, continuing\n"); 6150 6150 6151 6151 ret = pci_register_driver(&cxgb4_driver); 6152 - if (ret < 0) 6152 + if (ret < 0) { 6153 6153 debugfs_remove(cxgb4_debugfs_root); 6154 + destroy_workqueue(workq); 6155 + } 6154 6156 6155 6157 register_inet6addr_notifier(&cxgb4_inet6addr_notifier); 6156 6158
+1 -1
drivers/net/ethernet/dec/tulip/de4x5.c
··· 1321 1321 if (request_irq(dev->irq, de4x5_interrupt, IRQF_SHARED, 1322 1322 lp->adapter_name, dev)) { 1323 1323 printk("de4x5_open(): Requested IRQ%d is busy - attemping FAST/SHARE...", dev->irq); 1324 - if (request_irq(dev->irq, de4x5_interrupt, IRQF_DISABLED | IRQF_SHARED, 1324 + if (request_irq(dev->irq, de4x5_interrupt, IRQF_SHARED, 1325 1325 lp->adapter_name, dev)) { 1326 1326 printk("\n Cannot get IRQ- reconfigure your hardware.\n"); 1327 1327 disable_ast(dev);
+1 -1
drivers/net/ethernet/emulex/benet/be_main.c
··· 2802 2802 struct be_resources res = {0}; 2803 2803 struct be_vf_cfg *vf_cfg; 2804 2804 u32 cap_flags, en_flags, vf; 2805 - int status; 2805 + int status = 0; 2806 2806 2807 2807 cap_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST | 2808 2808 BE_IF_FLAGS_MULTICAST;
+1 -1
drivers/net/ethernet/freescale/fec_main.c
··· 2199 2199 goto failed_irq; 2200 2200 } 2201 2201 ret = devm_request_irq(&pdev->dev, irq, fec_enet_interrupt, 2202 - IRQF_DISABLED, pdev->name, ndev); 2202 + 0, pdev->name, ndev); 2203 2203 if (ret) 2204 2204 goto failed_irq; 2205 2205 }
+1 -1
drivers/net/ethernet/hp/hp100.c
··· 1097 1097 /* New: if bus is PCI or EISA, interrupts might be shared interrupts */ 1098 1098 if (request_irq(dev->irq, hp100_interrupt, 1099 1099 lp->bus == HP100_BUS_PCI || lp->bus == 1100 - HP100_BUS_EISA ? IRQF_SHARED : IRQF_DISABLED, 1100 + HP100_BUS_EISA ? IRQF_SHARED : 0, 1101 1101 "hp100", dev)) { 1102 1102 printk("hp100: %s: unable to get IRQ %d\n", dev->name, dev->irq); 1103 1103 return -EAGAIN;
+16 -5
drivers/net/ethernet/ibm/ehea/ehea_main.c
··· 102 102 103 103 static int ehea_remove(struct platform_device *dev); 104 104 105 + static struct of_device_id ehea_module_device_table[] = { 106 + { 107 + .name = "lhea", 108 + .compatible = "IBM,lhea", 109 + }, 110 + { 111 + .type = "network", 112 + .compatible = "IBM,lhea-ethernet", 113 + }, 114 + {}, 115 + }; 116 + MODULE_DEVICE_TABLE(of, ehea_module_device_table); 117 + 105 118 static struct of_device_id ehea_device_table[] = { 106 119 { 107 120 .name = "lhea", ··· 122 109 }, 123 110 {}, 124 111 }; 125 - MODULE_DEVICE_TABLE(of, ehea_device_table); 126 112 127 113 static struct platform_driver ehea_driver = { 128 114 .driver = { ··· 1297 1285 1298 1286 ret = ibmebus_request_irq(port->qp_eq->attr.ist1, 1299 1287 ehea_qp_aff_irq_handler, 1300 - IRQF_DISABLED, port->int_aff_name, port); 1288 + 0, port->int_aff_name, port); 1301 1289 if (ret) { 1302 1290 netdev_err(dev, "failed registering irq for qp_aff_irq_handler:ist=%X\n", 1303 1291 port->qp_eq->attr.ist1); ··· 1315 1303 "%s-queue%d", dev->name, i); 1316 1304 ret = ibmebus_request_irq(pr->eq->attr.ist1, 1317 1305 ehea_recv_irq_handler, 1318 - IRQF_DISABLED, pr->int_send_name, 1319 - pr); 1306 + 0, pr->int_send_name, pr); 1320 1307 if (ret) { 1321 1308 netdev_err(dev, "failed registering irq for ehea_queue port_res_nr:%d, ist=%X\n", 1322 1309 i, pr->eq->attr.ist1); ··· 3331 3320 } 3332 3321 3333 3322 ret = ibmebus_request_irq(adapter->neq->attr.ist1, 3334 - ehea_interrupt_neq, IRQF_DISABLED, 3323 + ehea_interrupt_neq, 0, 3335 3324 "ehea_neq", adapter); 3336 3325 if (ret) { 3337 3326 dev_err(&dev->dev, "requesting NEQ IRQ failed\n");
+8
drivers/net/ethernet/intel/e1000e/ethtool.c
··· 922 922 else 923 923 mask &= ~(1 << 30); 924 924 } 925 + if (mac->type == e1000_pch2lan) { 926 + /* SHRAH[0,1,2] different than previous */ 927 + if (i == 7) 928 + mask &= 0xFFF4FFFF; 929 + /* SHRAH[3] different than SHRAH[0,1,2] */ 930 + if (i == 10) 931 + mask |= (1 << 30); 932 + } 925 933 926 934 REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), mask, 927 935 0xFFFFFFFF);
+8 -5
drivers/net/ethernet/intel/e1000e/ich8lan.c
··· 1371 1371 return; 1372 1372 } 1373 1373 1374 - if (index < hw->mac.rar_entry_count) { 1374 + /* RAR[1-6] are owned by manageability. Skip those and program the 1375 + * next address into the SHRA register array. 1376 + */ 1377 + if (index < (u32)(hw->mac.rar_entry_count - 6)) { 1375 1378 s32 ret_val; 1376 1379 1377 1380 ret_val = e1000_acquire_swflag_ich8lan(hw); ··· 1965 1962 if (ret_val) 1966 1963 goto release; 1967 1964 1968 - /* Copy both RAL/H (rar_entry_count) and SHRAL/H (+4) to PHY */ 1969 - for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) { 1965 + /* Copy both RAL/H (rar_entry_count) and SHRAL/H to PHY */ 1966 + for (i = 0; i < (hw->mac.rar_entry_count); i++) { 1970 1967 mac_reg = er32(RAL(i)); 1971 1968 hw->phy.ops.write_reg_page(hw, BM_RAR_L(i), 1972 1969 (u16)(mac_reg & 0xFFFF)); ··· 2010 2007 return ret_val; 2011 2008 2012 2009 if (enable) { 2013 - /* Write Rx addresses (rar_entry_count for RAL/H, +4 for 2010 + /* Write Rx addresses (rar_entry_count for RAL/H, and 2014 2011 * SHRAL/H) and initial CRC values to the MAC 2015 2012 */ 2016 - for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) { 2013 + for (i = 0; i < hw->mac.rar_entry_count; i++) { 2017 2014 u8 mac_addr[ETH_ALEN] = { 0 }; 2018 2015 u32 addr_high, addr_low; 2019 2016
+1 -1
drivers/net/ethernet/intel/e1000e/ich8lan.h
··· 98 98 #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL 99 99 100 100 #define E1000_ICH_RAR_ENTRIES 7 101 - #define E1000_PCH2_RAR_ENTRIES 5 /* RAR[0], SHRA[0-3] */ 101 + #define E1000_PCH2_RAR_ENTRIES 11 /* RAR[0-6], SHRA[0-3] */ 102 102 #define E1000_PCH_LPT_RAR_ENTRIES 12 /* RAR[0], SHRA[0-10] */ 103 103 104 104 #define PHY_PAGE_SHIFT 5
+1 -1
drivers/net/ethernet/intel/e1000e/netdev.c
··· 4868 4868 */ 4869 4869 if ((hw->phy.type == e1000_phy_igp_3 || 4870 4870 hw->phy.type == e1000_phy_bm) && 4871 - (hw->mac.autoneg == true) && 4871 + hw->mac.autoneg && 4872 4872 (adapter->link_speed == SPEED_10 || 4873 4873 adapter->link_speed == SPEED_100) && 4874 4874 (adapter->link_duplex == HALF_DUPLEX)) {
+4
drivers/net/ethernet/intel/igb/e1000_82575.c
··· 719 719 u32 ctrl_ext; 720 720 u32 mdic; 721 721 722 + /* Extra read required for some PHY's on i354 */ 723 + if (hw->mac.type == e1000_i354) 724 + igb_get_phy_id(hw); 725 + 722 726 /* For SGMII PHYs, we try the list of possible addresses until 723 727 * we find one that works. For non-SGMII PHYs 724 728 * (e.g. integrated copper PHYs), an address of 1 should
+9 -1
drivers/net/ethernet/intel/igb/e1000_mac.c
··· 712 712 static s32 igb_set_default_fc(struct e1000_hw *hw) 713 713 { 714 714 s32 ret_val = 0; 715 + u16 lan_offset; 715 716 u16 nvm_data; 716 717 717 718 /* Read and store word 0x0F of the EEPROM. This word contains bits ··· 723 722 * control setting, then the variable hw->fc will 724 723 * be initialized based on a value in the EEPROM. 725 724 */ 726 - ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &nvm_data); 725 + if (hw->mac.type == e1000_i350) { 726 + lan_offset = NVM_82580_LAN_FUNC_OFFSET(hw->bus.func); 727 + ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG 728 + + lan_offset, 1, &nvm_data); 729 + } else { 730 + ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 731 + 1, &nvm_data); 732 + } 727 733 728 734 if (ret_val) { 729 735 hw_dbg("NVM Read Error\n");
+25
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
··· 160 160 bool autoneg = false; 161 161 bool link_up; 162 162 163 + /* SFP type is needed for get_link_capabilities */ 164 + if (hw->phy.media_type & (ixgbe_media_type_fiber | 165 + ixgbe_media_type_fiber_qsfp)) { 166 + if (hw->phy.sfp_type == ixgbe_sfp_type_not_present) 167 + hw->phy.ops.identify_sfp(hw); 168 + } 169 + 163 170 hw->mac.ops.get_link_capabilities(hw, &supported_link, &autoneg); 164 171 165 172 /* set the supported link speeds */ ··· 193 186 ecmd->advertising |= ADVERTISED_1000baseT_Full; 194 187 if (supported_link & IXGBE_LINK_SPEED_100_FULL) 195 188 ecmd->advertising |= ADVERTISED_100baseT_Full; 189 + 190 + if (hw->phy.multispeed_fiber && !autoneg) { 191 + if (supported_link & IXGBE_LINK_SPEED_10GB_FULL) 192 + ecmd->advertising = ADVERTISED_10000baseT_Full; 193 + } 196 194 } 197 195 198 196 if (autoneg) { ··· 325 313 */ 326 314 if (ecmd->advertising & ~ecmd->supported) 327 315 return -EINVAL; 316 + 317 + /* only allow one speed at a time if no autoneg */ 318 + if (!ecmd->autoneg && hw->phy.multispeed_fiber) { 319 + if (ecmd->advertising == 320 + (ADVERTISED_10000baseT_Full | 321 + ADVERTISED_1000baseT_Full)) 322 + return -EINVAL; 323 + } 328 324 329 325 old = hw->phy.autoneg_advertised; 330 326 advertised = 0; ··· 1825 1805 unsigned int size = 1024; 1826 1806 netdev_tx_t tx_ret_val; 1827 1807 struct sk_buff *skb; 1808 + u32 flags_orig = adapter->flags; 1809 + 1810 + /* DCB can modify the frames on Tx */ 1811 + adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; 1828 1812 1829 1813 /* allocate test skb */ 1830 1814 skb = alloc_skb(size, GFP_KERNEL); ··· 1881 1857 1882 1858 /* free the original skb */ 1883 1859 kfree_skb(skb); 1860 + adapter->flags = flags_orig; 1884 1861 1885 1862 return ret_val; 1886 1863 }
+17 -2
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 3571 3571 { 3572 3572 struct ixgbe_hw *hw = &adapter->hw; 3573 3573 int i; 3574 - u32 rxctrl; 3574 + u32 rxctrl, rfctl; 3575 3575 3576 3576 /* disable receives while setting up the descriptors */ 3577 3577 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); ··· 3579 3579 3580 3580 ixgbe_setup_psrtype(adapter); 3581 3581 ixgbe_setup_rdrxctl(adapter); 3582 + 3583 + /* RSC Setup */ 3584 + rfctl = IXGBE_READ_REG(hw, IXGBE_RFCTL); 3585 + rfctl &= ~IXGBE_RFCTL_RSC_DIS; 3586 + if (!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)) 3587 + rfctl |= IXGBE_RFCTL_RSC_DIS; 3588 + IXGBE_WRITE_REG(hw, IXGBE_RFCTL, rfctl); 3582 3589 3583 3590 /* Program registers for the distribution of queues */ 3584 3591 ixgbe_setup_mrqc(adapter); ··· 6000 5993 adapter->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG; 6001 5994 6002 5995 speed = hw->phy.autoneg_advertised; 6003 - if ((!speed) && (hw->mac.ops.get_link_capabilities)) 5996 + if ((!speed) && (hw->mac.ops.get_link_capabilities)) { 6004 5997 hw->mac.ops.get_link_capabilities(hw, &speed, &autoneg); 5998 + 5999 + /* setup the highest link when no autoneg */ 6000 + if (!autoneg) { 6001 + if (speed & IXGBE_LINK_SPEED_10GB_FULL) 6002 + speed = IXGBE_LINK_SPEED_10GB_FULL; 6003 + } 6004 + } 6005 + 6005 6006 if (hw->mac.ops.setup_link) 6006 6007 hw->mac.ops.setup_link(hw, speed, true); 6007 6008
+1
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
··· 1861 1861 #define IXGBE_RFCTL_ISCSI_DIS 0x00000001 1862 1862 #define IXGBE_RFCTL_ISCSI_DWC_MASK 0x0000003E 1863 1863 #define IXGBE_RFCTL_ISCSI_DWC_SHIFT 1 1864 + #define IXGBE_RFCTL_RSC_DIS 0x00000020 1864 1865 #define IXGBE_RFCTL_NFSW_DIS 0x00000040 1865 1866 #define IXGBE_RFCTL_NFSR_DIS 0x00000080 1866 1867 #define IXGBE_RFCTL_NFS_VER_MASK 0x00000300
+2 -4
drivers/net/ethernet/lantiq_etop.c
··· 282 282 283 283 if (IS_TX(i)) { 284 284 ltq_dma_alloc_tx(&ch->dma); 285 - request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED, 286 - "etop_tx", priv); 285 + request_irq(irq, ltq_etop_dma_irq, 0, "etop_tx", priv); 287 286 } else if (IS_RX(i)) { 288 287 ltq_dma_alloc_rx(&ch->dma); 289 288 for (ch->dma.desc = 0; ch->dma.desc < LTQ_DESC_NUM; ··· 290 291 if (ltq_etop_alloc_skb(ch)) 291 292 return -ENOMEM; 292 293 ch->dma.desc = 0; 293 - request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED, 294 - "etop_rx", priv); 294 + request_irq(irq, ltq_etop_dma_irq, 0, "etop_rx", priv); 295 295 } 296 296 ch->dma.irq = irq; 297 297 }
+1 -2
drivers/net/ethernet/marvell/pxa168_eth.c
··· 1123 1123 struct pxa168_eth_private *pep = netdev_priv(dev); 1124 1124 int err; 1125 1125 1126 - err = request_irq(dev->irq, pxa168_eth_int_handler, 1127 - IRQF_DISABLED, dev->name, dev); 1126 + err = request_irq(dev->irq, pxa168_eth_int_handler, 0, dev->name, dev); 1128 1127 if (err) { 1129 1128 dev_err(&dev->dev, "can't assign irq\n"); 1130 1129 return -EAGAIN;
+3 -2
drivers/net/ethernet/marvell/skge.c
··· 3092 3092 if (!nskb) 3093 3093 goto resubmit; 3094 3094 3095 + skb = e->skb; 3096 + prefetch(skb->data); 3097 + 3095 3098 if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) { 3096 3099 dev_kfree_skb(nskb); 3097 3100 goto resubmit; ··· 3104 3101 dma_unmap_addr(e, mapaddr), 3105 3102 dma_unmap_len(e, maplen), 3106 3103 PCI_DMA_FROMDEVICE); 3107 - skb = e->skb; 3108 - prefetch(skb->data); 3109 3104 } 3110 3105 3111 3106 skb_put(skb, len);
+10 -6
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
··· 53 53 for (i = 0; i < priv->tx_ring_num; i++) { 54 54 priv->tx_cq[i].moder_cnt = priv->tx_frames; 55 55 priv->tx_cq[i].moder_time = priv->tx_usecs; 56 - err = mlx4_en_set_cq_moder(priv, &priv->tx_cq[i]); 57 - if (err) 58 - return err; 56 + if (priv->port_up) { 57 + err = mlx4_en_set_cq_moder(priv, &priv->tx_cq[i]); 58 + if (err) 59 + return err; 60 + } 59 61 } 60 62 61 63 if (priv->adaptive_rx_coal) ··· 67 65 priv->rx_cq[i].moder_cnt = priv->rx_frames; 68 66 priv->rx_cq[i].moder_time = priv->rx_usecs; 69 67 priv->last_moder_time[i] = MLX4_EN_AUTO_CONF; 70 - err = mlx4_en_set_cq_moder(priv, &priv->rx_cq[i]); 71 - if (err) 72 - return err; 68 + if (priv->port_up) { 69 + err = mlx4_en_set_cq_moder(priv, &priv->rx_cq[i]); 70 + if (err) 71 + return err; 72 + } 73 73 } 74 74 75 75 return err;
+1 -1
drivers/net/ethernet/micrel/ks8851_mll.c
··· 915 915 struct ks_net *ks = netdev_priv(netdev); 916 916 int err; 917 917 918 - #define KS_INT_FLAGS (IRQF_DISABLED|IRQF_TRIGGER_LOW) 918 + #define KS_INT_FLAGS IRQF_TRIGGER_LOW 919 919 /* lock the card, even if we may not actually do anything 920 920 * else at the moment. 921 921 */
+1 -2
drivers/net/ethernet/natsemi/jazzsonic.c
··· 83 83 { 84 84 int retval; 85 85 86 - retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED, 87 - "sonic", dev); 86 + retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev); 88 87 if (retval) { 89 88 printk(KERN_ERR "%s: unable to get IRQ %d.\n", 90 89 dev->name, dev->irq);
+1 -2
drivers/net/ethernet/natsemi/xtsonic.c
··· 95 95 { 96 96 int retval; 97 97 98 - retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED, 99 - "sonic", dev); 98 + retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev); 100 99 if (retval) { 101 100 printk(KERN_ERR "%s: unable to get IRQ %d.\n", 102 101 dev->name, dev->irq);
+2 -2
drivers/net/ethernet/pasemi/pasemi_mac.c
··· 1219 1219 snprintf(mac->tx_irq_name, sizeof(mac->tx_irq_name), "%s tx", 1220 1220 dev->name); 1221 1221 1222 - ret = request_irq(mac->tx->chan.irq, pasemi_mac_tx_intr, IRQF_DISABLED, 1222 + ret = request_irq(mac->tx->chan.irq, pasemi_mac_tx_intr, 0, 1223 1223 mac->tx_irq_name, mac->tx); 1224 1224 if (ret) { 1225 1225 dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n", ··· 1230 1230 snprintf(mac->rx_irq_name, sizeof(mac->rx_irq_name), "%s rx", 1231 1231 dev->name); 1232 1232 1233 - ret = request_irq(mac->rx->chan.irq, pasemi_mac_rx_intr, IRQF_DISABLED, 1233 + ret = request_irq(mac->rx->chan.irq, pasemi_mac_rx_intr, 0, 1234 1234 mac->rx_irq_name, mac->rx); 1235 1235 if (ret) { 1236 1236 dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n",
+1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
··· 1561 1561 { 1562 1562 int err; 1563 1563 1564 + adapter->need_fw_reset = 0; 1564 1565 qlcnic_83xx_reinit_mbx_work(adapter->ahw->mailbox); 1565 1566 qlcnic_83xx_enable_mbx_interrupt(adapter); 1566 1567
+1
drivers/net/ethernet/realtek/r8169.c
··· 4231 4231 case RTL_GIGA_MAC_VER_23: 4232 4232 case RTL_GIGA_MAC_VER_24: 4233 4233 case RTL_GIGA_MAC_VER_34: 4234 + case RTL_GIGA_MAC_VER_35: 4234 4235 RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST); 4235 4236 break; 4236 4237 case RTL_GIGA_MAC_VER_40:
+1 -1
drivers/net/ethernet/sfc/Kconfig
··· 7 7 select I2C_ALGOBIT 8 8 select PTP_1588_CLOCK 9 9 ---help--- 10 - This driver supports 10-gigabit Ethernet cards based on 10 + This driver supports 10/40-gigabit Ethernet cards based on 11 11 the Solarflare SFC4000, SFC9000-family and SFC9100-family 12 12 controllers. 13 13
+37 -21
drivers/net/ethernet/sfc/ef10.c
··· 94 94 return resource_size(&efx->pci_dev->resource[EFX_MEM_BAR]); 95 95 } 96 96 97 - static int efx_ef10_init_capabilities(struct efx_nic *efx) 97 + static int efx_ef10_init_datapath_caps(struct efx_nic *efx) 98 98 { 99 99 MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_CAPABILITIES_OUT_LEN); 100 100 struct efx_ef10_nic_data *nic_data = efx->nic_data; ··· 107 107 outbuf, sizeof(outbuf), &outlen); 108 108 if (rc) 109 109 return rc; 110 + if (outlen < sizeof(outbuf)) { 111 + netif_err(efx, drv, efx->net_dev, 112 + "unable to read datapath firmware capabilities\n"); 113 + return -EIO; 114 + } 110 115 111 - if (outlen >= sizeof(outbuf)) { 112 - nic_data->datapath_caps = 113 - MCDI_DWORD(outbuf, GET_CAPABILITIES_OUT_FLAGS1); 114 - if (!(nic_data->datapath_caps & 115 - (1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN))) { 116 - netif_err(efx, drv, efx->net_dev, 117 - "Capabilities don't indicate TSO support.\n"); 118 - return -ENODEV; 119 - } 116 + nic_data->datapath_caps = 117 + MCDI_DWORD(outbuf, GET_CAPABILITIES_OUT_FLAGS1); 118 + 119 + if (!(nic_data->datapath_caps & 120 + (1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN))) { 121 + netif_err(efx, drv, efx->net_dev, 122 + "current firmware does not support TSO\n"); 123 + return -ENODEV; 124 + } 125 + 126 + if (!(nic_data->datapath_caps & 127 + (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) { 128 + netif_err(efx, probe, efx->net_dev, 129 + "current firmware does not support an RX prefix\n"); 130 + return -ENODEV; 120 131 } 121 132 122 133 return 0; ··· 228 217 if (rc) 229 218 goto fail3; 230 219 231 - rc = efx_ef10_init_capabilities(efx); 220 + rc = efx_ef10_init_datapath_caps(efx); 232 221 if (rc < 0) 233 222 goto fail3; 234 223 235 224 efx->rx_packet_len_offset = 236 225 ES_DZ_RX_PREFIX_PKTLEN_OFST - ES_DZ_RX_PREFIX_SIZE; 237 - 238 - if (!(nic_data->datapath_caps & 239 - (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) { 240 - netif_err(efx, probe, efx->net_dev, 241 - "current firmware does not support an RX prefix\n"); 242 - rc = -ENODEV; 243 - goto fail3; 244 - } 245 226 246 227 rc = efx_mcdi_port_get_number(efx); 247 228 if (rc < 0) ··· 262 259 rc = efx_mcdi_mon_probe(efx); 263 260 if (rc) 264 261 goto fail3; 265 - 266 - efx_ptp_probe(efx); 267 262 268 263 return 0; 269 264 ··· 342 341 { 343 342 struct efx_ef10_nic_data *nic_data = efx->nic_data; 344 343 int rc; 344 + 345 + if (nic_data->must_check_datapath_caps) { 346 + rc = efx_ef10_init_datapath_caps(efx); 347 + if (rc) 348 + return rc; 349 + nic_data->must_check_datapath_caps = false; 350 + } 345 351 346 352 if (nic_data->must_realloc_vis) { 347 353 /* We cannot let the number of VIs change now */ ··· 717 709 nic_data->must_realloc_vis = true; 718 710 nic_data->must_restore_filters = true; 719 711 nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID; 712 + 713 + /* The datapath firmware might have been changed */ 714 + nic_data->must_check_datapath_caps = true; 715 + 716 + /* MAC statistics have been cleared on the NIC; clear the local 717 + * statistic that we update with efx_update_diff_stat(). 718 + */ 719 + nic_data->stats[EF10_STAT_rx_bad_bytes] = 0; 720 720 721 721 return -EIO; 722 722 }
+2
drivers/net/ethernet/sfc/mcdi_port.c
··· 556 556 case 100: caps = 1 << MC_CMD_PHY_CAP_100FDX_LBN; break; 557 557 case 1000: caps = 1 << MC_CMD_PHY_CAP_1000FDX_LBN; break; 558 558 case 10000: caps = 1 << MC_CMD_PHY_CAP_10000FDX_LBN; break; 559 + case 40000: caps = 1 << MC_CMD_PHY_CAP_40000FDX_LBN; break; 559 560 default: return -EINVAL; 560 561 } 561 562 } else { ··· 842 841 [MCDI_EVENT_LINKCHANGE_SPEED_100M] = 100, 843 842 [MCDI_EVENT_LINKCHANGE_SPEED_1G] = 1000, 844 843 [MCDI_EVENT_LINKCHANGE_SPEED_10G] = 10000, 844 + [MCDI_EVENT_LINKCHANGE_SPEED_40G] = 40000, 845 845 }; 846 846 847 847 void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev)
+3
drivers/net/ethernet/sfc/nic.h
··· 400 400 * @rx_rss_context: Firmware handle for our RSS context 401 401 * @stats: Hardware statistics 402 402 * @workaround_35388: Flag: firmware supports workaround for bug 35388 403 + * @must_check_datapath_caps: Flag: @datapath_caps needs to be revalidated 404 + * after MC reboot 403 405 * @datapath_caps: Capabilities of datapath firmware (FLAGS1 field of 404 406 * %MC_CMD_GET_CAPABILITIES response) 405 407 */ ··· 415 413 u32 rx_rss_context; 416 414 u64 stats[EF10_STAT_COUNT]; 417 415 bool workaround_35388; 416 + bool must_check_datapath_caps; 418 417 u32 datapath_caps; 419 418 }; 420 419
+1 -1
drivers/net/ethernet/smsc/smc91x.h
··· 271 271 #define SMC_insw(a, r, p, l) mcf_insw(a + r, p, l) 272 272 #define SMC_outsw(a, r, p, l) mcf_outsw(a + r, p, l) 273 273 274 - #define SMC_IRQ_FLAGS (IRQF_DISABLED) 274 + #define SMC_IRQ_FLAGS 0 275 275 276 276 #else 277 277
+1 -2
drivers/net/ethernet/smsc/smsc9420.c
··· 1356 1356 smsc9420_reg_write(pd, INT_STAT, 0xFFFFFFFF); 1357 1357 smsc9420_pci_flush_write(pd); 1358 1358 1359 - result = request_irq(irq, smsc9420_isr, IRQF_SHARED | IRQF_DISABLED, 1360 - DRV_NAME, pd); 1359 + result = request_irq(irq, smsc9420_isr, IRQF_SHARED, DRV_NAME, pd); 1361 1360 if (result) { 1362 1361 smsc_warn(IFUP, "Unable to use IRQ = %d", irq); 1363 1362 result = -ENODEV;
+1 -1
drivers/net/ethernet/toshiba/ps3_gelic_net.c
··· 1726 1726 goto fail_alloc_irq; 1727 1727 } 1728 1728 result = request_irq(card->irq, gelic_card_interrupt, 1729 - IRQF_DISABLED, netdev->name, card); 1729 + 0, netdev->name, card); 1730 1730 1731 1731 if (result) { 1732 1732 dev_info(ctodev(card), "%s:request_irq failed (%d)\n",
+23 -17
drivers/net/irda/mcs7780.c
··· 191 191 goto error; 192 192 193 193 ret = 0; 194 - error: 195 - return ret; 194 + error: 195 + return ret; 196 196 } 197 197 198 198 /* Setup a communication between mcs7780 and agilent chip. */ ··· 501 501 return 0; 502 502 503 503 mcs->rx_urb = usb_alloc_urb(0, GFP_KERNEL); 504 - if (!mcs->rx_urb) 504 + if (!mcs->rx_urb) { 505 + usb_free_urb(mcs->tx_urb); 506 + mcs->tx_urb = NULL; 505 507 return 0; 508 + } 506 509 507 510 return 1; 508 511 } ··· 646 643 ret = mcs_set_reg(mcs, MCS_MODE_REG, rval); 647 644 648 645 mcs->speed = mcs->new_speed; 649 - error: 650 - mcs->new_speed = 0; 651 - return ret; 646 + error: 647 + mcs->new_speed = 0; 648 + return ret; 652 649 } 653 650 654 651 /* Ioctl calls not supported at this time. Can be an area of future work. */ ··· 741 738 742 739 ret = mcs_receive_start(mcs); 743 740 if (ret) 744 - goto error3; 741 + goto error4; 745 742 746 743 netif_start_queue(netdev); 747 744 return 0; 748 745 749 - error3: 750 - irlap_close(mcs->irlap); 751 - error2: 752 - kfree_skb(mcs->rx_buff.skb); 753 - error1: 754 - return ret; 746 + error4: 747 + usb_free_urb(mcs->rx_urb); 748 + usb_free_urb(mcs->tx_urb); 749 + error3: 750 + irlap_close(mcs->irlap); 751 + error2: 752 + kfree_skb(mcs->rx_buff.skb); 753 + error1: 754 + return ret; 755 755 } 756 756 757 757 /* Receive callback function. */ ··· 952 946 usb_set_intfdata(intf, mcs); 953 947 return 0; 954 948 955 - error2: 956 - free_netdev(ndev); 949 + error2: 950 + free_netdev(ndev); 957 951 958 - error1: 959 - return ret; 952 + error1: 953 + return ret; 960 954 } 961 955 962 956 /* The current device is removed, the USB layer tells us to shut down. */
+1
drivers/net/loopback.c
··· 146 146 147 147 static void loopback_dev_free(struct net_device *dev) 148 148 { 149 + dev_net(dev)->loopback_dev = NULL; 149 150 free_percpu(dev->lstats); 150 151 free_netdev(dev); 151 152 }
+1 -4
drivers/net/netconsole.c
··· 684 684 case NETDEV_RELEASE: 685 685 case NETDEV_JOIN: 686 686 case NETDEV_UNREGISTER: 687 - /* 688 - * rtnl_lock already held 687 + /* rtnl_lock already held 689 688 * we might sleep in __netpoll_cleanup() 690 689 */ 691 690 spin_unlock_irqrestore(&target_list_lock, flags); 692 691 693 - mutex_lock(&nt->mutex); 694 692 __netpoll_cleanup(&nt->np); 695 - mutex_unlock(&nt->mutex); 696 693 697 694 spin_lock_irqsave(&target_list_lock, flags); 698 695 dev_put(nt->np.dev);
+2 -2
drivers/net/phy/cicada.c
··· 30 30 #include <linux/ethtool.h> 31 31 #include <linux/phy.h> 32 32 33 - #include <asm/io.h> 33 + #include <linux/io.h> 34 34 #include <asm/irq.h> 35 - #include <asm/uaccess.h> 35 + #include <linux/uaccess.h> 36 36 37 37 /* Cicada Extended Control Register 1 */ 38 38 #define MII_CIS8201_EXT_CON1 0x17
+1 -1
drivers/net/ppp/pptp.c
··· 281 281 nf_reset(skb); 282 282 283 283 skb->ip_summed = CHECKSUM_NONE; 284 - ip_select_ident(iph, &rt->dst, NULL); 284 + ip_select_ident(skb, &rt->dst, NULL); 285 285 ip_send_check(iph); 286 286 287 287 ip_local_out(skb);
+8 -3
drivers/net/tun.c
··· 1641 1641 INIT_LIST_HEAD(&tun->disabled); 1642 1642 err = tun_attach(tun, file, false); 1643 1643 if (err < 0) 1644 - goto err_free_dev; 1644 + goto err_free_flow; 1645 1645 1646 1646 err = register_netdevice(tun->dev); 1647 1647 if (err < 0) 1648 - goto err_free_dev; 1648 + goto err_detach; 1649 1649 1650 1650 if (device_create_file(&tun->dev->dev, &dev_attr_tun_flags) || 1651 1651 device_create_file(&tun->dev->dev, &dev_attr_owner) || ··· 1689 1689 strcpy(ifr->ifr_name, tun->dev->name); 1690 1690 return 0; 1691 1691 1692 - err_free_dev: 1692 + err_detach: 1693 + tun_detach_all(dev); 1694 + err_free_flow: 1695 + tun_flow_uninit(tun); 1696 + security_tun_dev_free_security(tun->security); 1697 + err_free_dev: 1693 1698 free_netdev(dev); 1694 1699 return err; 1695 1700 }
+42 -73
drivers/net/usb/cdc_ether.c
··· 33 33 #include <linux/usb/usbnet.h> 34 34 35 35 36 - #if defined(CONFIG_USB_NET_RNDIS_HOST) || defined(CONFIG_USB_NET_RNDIS_HOST_MODULE) 36 + #if IS_ENABLED(CONFIG_USB_NET_RNDIS_HOST) 37 37 38 38 static int is_rndis(struct usb_interface_descriptor *desc) 39 39 { ··· 69 69 0xa6, 0x07, 0xc0, 0xff, 0xcb, 0x7e, 0x39, 0x2a, 70 70 }; 71 71 72 - /* 73 - * probes control interface, claims data interface, collects the bulk 72 + /* probes control interface, claims data interface, collects the bulk 74 73 * endpoints, activates data interface (if needed), maybe sets MTU. 75 74 * all pure cdc, except for certain firmware workarounds, and knowing 76 75 * that rndis uses one different rule. ··· 87 88 struct usb_cdc_mdlm_desc *desc = NULL; 88 89 struct usb_cdc_mdlm_detail_desc *detail = NULL; 89 90 90 - if (sizeof dev->data < sizeof *info) 91 + if (sizeof(dev->data) < sizeof(*info)) 91 92 return -EDOM; 92 93 93 94 /* expect strict spec conformance for the descriptors, but ··· 125 126 is_activesync(&intf->cur_altsetting->desc) || 126 127 is_wireless_rndis(&intf->cur_altsetting->desc)); 127 128 128 - memset(info, 0, sizeof *info); 129 + memset(info, 0, sizeof(*info)); 129 130 info->control = intf; 130 131 while (len > 3) { 131 - if (buf [1] != USB_DT_CS_INTERFACE) 132 + if (buf[1] != USB_DT_CS_INTERFACE) 132 133 goto next_desc; 133 134 134 135 /* use bDescriptorSubType to identify the CDC descriptors. ··· 138 139 * in favor of a complicated OID-based RPC scheme doing what 139 140 * CDC Ethernet achieves with a simple descriptor. 140 141 */ 141 - switch (buf [2]) { 142 + switch (buf[2]) { 142 143 case USB_CDC_HEADER_TYPE: 143 144 if (info->header) { 144 145 dev_dbg(&intf->dev, "extra CDC header\n"); 145 146 goto bad_desc; 146 147 } 147 148 info->header = (void *) buf; 148 - if (info->header->bLength != sizeof *info->header) { 149 + if (info->header->bLength != sizeof(*info->header)) { 149 150 dev_dbg(&intf->dev, "CDC header len %u\n", 150 151 info->header->bLength); 151 152 goto bad_desc; ··· 174 175 goto bad_desc; 175 176 } 176 177 info->u = (void *) buf; 177 - if (info->u->bLength != sizeof *info->u) { 178 + if (info->u->bLength != sizeof(*info->u)) { 178 179 dev_dbg(&intf->dev, "CDC union len %u\n", 179 180 info->u->bLength); 180 181 goto bad_desc; ··· 232 233 goto bad_desc; 233 234 } 234 235 info->ether = (void *) buf; 235 - if (info->ether->bLength != sizeof *info->ether) { 236 + if (info->ether->bLength != sizeof(*info->ether)) { 236 237 dev_dbg(&intf->dev, "CDC ether len %u\n", 237 238 info->ether->bLength); 238 239 goto bad_desc; ··· 273 274 break; 274 275 } 275 276 next_desc: 276 - len -= buf [0]; /* bLength */ 277 - buf += buf [0]; 277 + len -= buf[0]; /* bLength */ 278 + buf += buf[0]; 278 279 } 279 280 280 281 /* Microsoft ActiveSync based and some regular RNDIS devices lack the ··· 378 379 } 379 380 EXPORT_SYMBOL_GPL(usbnet_cdc_unbind); 380 381 381 - /*------------------------------------------------------------------------- 382 - * 383 - * Communications Device Class, Ethernet Control model 382 + /* Communications Device Class, Ethernet Control model 384 383 * 385 384 * Takes two interfaces. The DATA interface is inactive till an altsetting 386 385 * is selected. Configuration data includes class descriptors. There's ··· 386 389 * 387 390 * This should interop with whatever the 2.4 "CDCEther.c" driver 388 391 * (by Brad Hards) talked with, with more functionality. 389 - * 390 - *-------------------------------------------------------------------------*/ 392 + */ 391 393 392 394 static void dumpspeed(struct usbnet *dev, __le32 *speeds) 393 395 { ··· 400 404 { 401 405 struct usb_cdc_notification *event; 402 406 403 - if (urb->actual_length < sizeof *event) 407 + if (urb->actual_length < sizeof(*event)) 404 408 return; 405 409 406 410 /* SPEED_CHANGE can get split into two 8-byte packets */ ··· 419 423 case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */ 420 424 netif_dbg(dev, timer, dev->net, "CDC: speed change (len %d)\n", 421 425 urb->actual_length); 422 - if (urb->actual_length != (sizeof *event + 8)) 426 + if (urb->actual_length != (sizeof(*event) + 8)) 423 427 set_bit(EVENT_STS_SPLIT, &dev->flags); 424 428 else 425 429 dumpspeed(dev, (__le32 *) &event[1]); ··· 465 469 static const struct driver_info cdc_info = { 466 470 .description = "CDC Ethernet Device", 467 471 .flags = FLAG_ETHER | FLAG_POINTTOPOINT, 468 - // .check_connect = cdc_check_connect, 469 472 .bind = usbnet_cdc_bind, 470 473 .unbind = usbnet_cdc_unbind, 471 474 .status = usbnet_cdc_status, ··· 488 493 #define DELL_VENDOR_ID 0x413C 489 494 #define REALTEK_VENDOR_ID 0x0bda 490 495 491 - static const struct usb_device_id products [] = { 492 - /* 493 - * BLACKLIST !! 496 + static const struct usb_device_id products[] = { 497 + /* BLACKLIST !! 494 498 * 495 499 * First blacklist any products that are egregiously nonconformant 496 500 * with the CDC Ethernet specs. Minor braindamage we cope with; when ··· 536 542 .driver_info = 0, 537 543 }, { 538 544 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO 539 - | USB_DEVICE_ID_MATCH_DEVICE, 545 + | USB_DEVICE_ID_MATCH_DEVICE, 540 546 .idVendor = 0x04DD, 541 547 .idProduct = 0x8007, /* C-700 */ 542 548 ZAURUS_MASTER_INTERFACE, ··· 653 659 .driver_info = 0, 654 660 }, 655 661 656 - /* 657 - * WHITELIST!!! 662 + /* WHITELIST!!! 658 663 * 659 664 * CDC Ether uses two interfaces, not necessarily consecutive. 660 665 * We match the main interface, ignoring the optional device ··· 665 672 */ 666 673 { 667 674 /* ZTE (Vodafone) K3805-Z */ 668 - .match_flags = USB_DEVICE_ID_MATCH_VENDOR 669 - | USB_DEVICE_ID_MATCH_PRODUCT 670 - | USB_DEVICE_ID_MATCH_INT_INFO, 671 - .idVendor = ZTE_VENDOR_ID, 672 - .idProduct = 0x1003, 673 - .bInterfaceClass = USB_CLASS_COMM, 674 - .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, 675 - .bInterfaceProtocol = USB_CDC_PROTO_NONE, 675 + USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1003, USB_CLASS_COMM, 676 + USB_CDC_SUBCLASS_ETHERNET, 677 + USB_CDC_PROTO_NONE), 676 678 .driver_info = (unsigned long)&wwan_info, 677 679 }, { 678 680 /* ZTE (Vodafone) K3806-Z */ 679 - .match_flags = USB_DEVICE_ID_MATCH_VENDOR 680 - | USB_DEVICE_ID_MATCH_PRODUCT 681 - | USB_DEVICE_ID_MATCH_INT_INFO, 682 - .idVendor = ZTE_VENDOR_ID, 683 - .idProduct = 0x1015, 684 - .bInterfaceClass = USB_CLASS_COMM, 685 - .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, 686 - .bInterfaceProtocol = USB_CDC_PROTO_NONE, 681 + USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1015, USB_CLASS_COMM, 682 + USB_CDC_SUBCLASS_ETHERNET, 683 + USB_CDC_PROTO_NONE), 687 684 .driver_info = (unsigned long)&wwan_info, 688 685 }, { 689 686 /* ZTE (Vodafone) K4510-Z */ 690 - .match_flags = USB_DEVICE_ID_MATCH_VENDOR 691 - | USB_DEVICE_ID_MATCH_PRODUCT 692 - | USB_DEVICE_ID_MATCH_INT_INFO, 693 - .idVendor = ZTE_VENDOR_ID, 694 - .idProduct = 0x1173, 695 - .bInterfaceClass = USB_CLASS_COMM, 696 - .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, 697 - .bInterfaceProtocol = USB_CDC_PROTO_NONE, 687 + USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1173, USB_CLASS_COMM, 688 + USB_CDC_SUBCLASS_ETHERNET, 689 + USB_CDC_PROTO_NONE), 698 690 .driver_info = (unsigned long)&wwan_info, 699 691 }, { 700 692 /* ZTE (Vodafone) K3770-Z */ 701 - .match_flags = USB_DEVICE_ID_MATCH_VENDOR 702 - | USB_DEVICE_ID_MATCH_PRODUCT 703 - | USB_DEVICE_ID_MATCH_INT_INFO, 704 - .idVendor = ZTE_VENDOR_ID, 705 - .idProduct = 0x1177, 706 - .bInterfaceClass = USB_CLASS_COMM, 707 - .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, 708 - .bInterfaceProtocol = USB_CDC_PROTO_NONE, 693 + USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1177, USB_CLASS_COMM, 694 + USB_CDC_SUBCLASS_ETHERNET, 695 + USB_CDC_PROTO_NONE), 709 696 .driver_info = (unsigned long)&wwan_info, 710 697 }, { 711 698 /* ZTE (Vodafone) K3772-Z */ 712 - .match_flags = USB_DEVICE_ID_MATCH_VENDOR 713 - | USB_DEVICE_ID_MATCH_PRODUCT 714 - | USB_DEVICE_ID_MATCH_INT_INFO, 715 - .idVendor = ZTE_VENDOR_ID, 716 - .idProduct = 0x1181, 717 - .bInterfaceClass = USB_CLASS_COMM, 718 - .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, 719 - .bInterfaceProtocol = USB_CDC_PROTO_NONE, 699 + USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1181, USB_CLASS_COMM, 700 + USB_CDC_SUBCLASS_ETHERNET, 701 + USB_CDC_PROTO_NONE), 720 702 .driver_info = (unsigned long)&wwan_info, 703 + }, { 704 + /* Telit modules */ 705 + USB_VENDOR_AND_INTERFACE_INFO(0x1bc7, USB_CLASS_COMM, 706 + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 707 + .driver_info = (kernel_ulong_t) &wwan_info, 721 708 }, { 722 709 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET, 723 710 USB_CDC_PROTO_NONE), ··· 709 736 710 737 }, { 711 738 /* Various Huawei modems with a network port like the UMG1831 */ 712 - .match_flags = USB_DEVICE_ID_MATCH_VENDOR 713 - | USB_DEVICE_ID_MATCH_INT_INFO, 714 - .idVendor = HUAWEI_VENDOR_ID, 715 - .bInterfaceClass = USB_CLASS_COMM, 716 - .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, 717 - .bInterfaceProtocol = 255, 739 + USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_COMM, 740 + USB_CDC_SUBCLASS_ETHERNET, 255), 718 741 .driver_info = (unsigned long)&wwan_info, 719 742 }, 720 - { }, // END 743 + { }, /* END */ 721 744 }; 722 745 MODULE_DEVICE_TABLE(usb, products); 723 746
+21 -19
drivers/net/vxlan.c
··· 564 564 struct net_device *dev; 565 565 struct net *net = sock_net(sk); 566 566 sa_family_t sa_family = sk->sk_family; 567 - u16 port = htons(inet_sk(sk)->inet_sport); 567 + __be16 port = inet_sk(sk)->inet_sport; 568 568 569 569 rcu_read_lock(); 570 570 for_each_netdev_rcu(net, dev) { ··· 581 581 struct net_device *dev; 582 582 struct net *net = sock_net(sk); 583 583 sa_family_t sa_family = sk->sk_family; 584 - u16 port = htons(inet_sk(sk)->inet_sport); 584 + __be16 port = inet_sk(sk)->inet_sport; 585 585 586 586 rcu_read_lock(); 587 587 for_each_netdev_rcu(net, dev) { ··· 2021 2021 }; 2022 2022 2023 2023 /* Calls the ndo_add_vxlan_port of the caller in order to 2024 - * supply the listening VXLAN udp ports. 2024 + * supply the listening VXLAN udp ports. Callers are expected 2025 + * to implement the ndo_add_vxlan_port. 2025 2026 */ 2026 2027 void vxlan_get_rx_port(struct net_device *dev) 2027 2028 { ··· 2030 2029 struct net *net = dev_net(dev); 2031 2030 struct vxlan_net *vn = net_generic(net, vxlan_net_id); 2032 2031 sa_family_t sa_family; 2033 - u16 port; 2034 - int i; 2035 - 2036 - if (!dev || !dev->netdev_ops || !dev->netdev_ops->ndo_add_vxlan_port) 2037 - return; 2032 + __be16 port; 2033 + unsigned int i; 2038 2034 2039 2035 spin_lock(&vn->sock_lock); 2040 2036 for (i = 0; i < PORT_HASH_SIZE; ++i) { 2041 - hlist_for_each_entry_rcu(vs, vs_head(net, i), hlist) { 2042 - port = htons(inet_sk(vs->sock->sk)->inet_sport); 2037 + hlist_for_each_entry_rcu(vs, &vn->sock_list[i], hlist) { 2038 + port = inet_sk(vs->sock->sk)->inet_sport; 2043 2039 sa_family = vs->sock->sk->sk_family; 2044 2040 dev->netdev_ops->ndo_add_vxlan_port(dev, sa_family, 2045 2041 port); ··· 2490 2492 2491 2493 SET_ETHTOOL_OPS(dev, &vxlan_ethtool_ops); 2492 2494 2493 - /* create an fdb entry for default destination */ 2494 - err = vxlan_fdb_create(vxlan, all_zeros_mac, 2495 - &vxlan->default_dst.remote_ip, 2496 - NUD_REACHABLE|NUD_PERMANENT, 2497 - NLM_F_EXCL|NLM_F_CREATE, 2498 - vxlan->dst_port, vxlan->default_dst.remote_vni, 2499 - vxlan->default_dst.remote_ifindex, NTF_SELF); 2500 - if (err) 2501 - return err; 2495 + /* create an fdb entry for a valid default destination */ 2496 + if (!vxlan_addr_any(&vxlan->default_dst.remote_ip)) { 2497 + err = vxlan_fdb_create(vxlan, all_zeros_mac, 2498 + &vxlan->default_dst.remote_ip, 2499 + NUD_REACHABLE|NUD_PERMANENT, 2500 + NLM_F_EXCL|NLM_F_CREATE, 2501 + vxlan->dst_port, 2502 + vxlan->default_dst.remote_vni, 2503 + vxlan->default_dst.remote_ifindex, 2504 + NTF_SELF); 2505 + if (err) 2506 + return err; 2507 + } 2502 2508 2503 2509 err = register_netdevice(dev); 2504 2510 if (err) {
+2 -2
drivers/net/wireless/brcm80211/Kconfig
··· 28 28 29 29 config BRCMFMAC_SDIO 30 30 bool "SDIO bus interface support for FullMAC driver" 31 - depends on MMC 31 + depends on (MMC = y || MMC = BRCMFMAC) 32 32 depends on BRCMFMAC 33 33 select FW_LOADER 34 34 default y ··· 39 39 40 40 config BRCMFMAC_USB 41 41 bool "USB bus interface support for FullMAC driver" 42 - depends on USB 42 + depends on (USB = y || USB = BRCMFMAC) 43 43 depends on BRCMFMAC 44 44 select FW_LOADER 45 45 ---help---
+25 -3
drivers/net/wireless/cw1200/cw1200_spi.c
··· 40 40 struct cw1200_common *core; 41 41 const struct cw1200_platform_data_spi *pdata; 42 42 spinlock_t lock; /* Serialize all bus operations */ 43 + wait_queue_head_t wq; 43 44 int claimed; 45 + int irq_disabled; 44 46 }; 45 47 46 48 #define SDIO_TO_SPI_ADDR(addr) ((addr & 0x1f)>>2) ··· 199 197 { 200 198 unsigned long flags; 201 199 200 + DECLARE_WAITQUEUE(wait, current); 201 + 202 202 might_sleep(); 203 203 204 + add_wait_queue(&self->wq, &wait); 204 205 spin_lock_irqsave(&self->lock, flags); 205 206 while (1) { 206 207 set_current_state(TASK_UNINTERRUPTIBLE); ··· 216 211 set_current_state(TASK_RUNNING); 217 212 self->claimed = 1; 218 213 spin_unlock_irqrestore(&self->lock, flags); 214 + remove_wait_queue(&self->wq, &wait); 219 215 220 216 return; 221 217 } ··· 228 222 spin_lock_irqsave(&self->lock, flags); 229 223 self->claimed = 0; 230 224 spin_unlock_irqrestore(&self->lock, flags); 225 + wake_up(&self->wq); 226 + 231 227 return; 232 228 } 233 229 ··· 238 230 struct hwbus_priv *self = dev_id; 239 231 240 232 if (self->core) { 233 + disable_irq_nosync(self->func->irq); 234 + self->irq_disabled = 1; 241 235 cw1200_irq_handler(self->core); 242 236 return IRQ_HANDLED; 243 237 } else { ··· 273 263 274 264 static int cw1200_spi_irq_unsubscribe(struct hwbus_priv *self) 275 265 { 276 - int ret = 0; 277 - 278 266 pr_debug("SW IRQ unsubscribe\n"); 279 267 disable_irq_wake(self->func->irq); 280 268 free_irq(self->func->irq, self); 281 269 282 - return ret; 270 + return 0; 271 + } 272 + 273 + static int cw1200_spi_irq_enable(struct hwbus_priv *self, int enable) 274 + { 275 + /* Disables are handled by the interrupt handler */ 276 + if (enable && self->irq_disabled) { 277 + enable_irq(self->func->irq); 278 + self->irq_disabled = 0; 279 + } 280 + 281 + return 0; 283 282 } 284 283 285 284 static int cw1200_spi_off(const struct cw1200_platform_data_spi *pdata) ··· 368 349 .unlock = cw1200_spi_unlock, 369 350 .align_size = cw1200_spi_align_size, 370 351 .power_mgmt = cw1200_spi_pm, 352 + .irq_enable = cw1200_spi_irq_enable, 371 353 }; 372 354 373 355 /* Probe Function to be called by SPI stack when device is discovered */ ··· 419 399 spin_lock_init(&self->lock); 420 400 421 401 spi_set_drvdata(func, self); 402 + 403 + init_waitqueue_head(&self->wq); 422 404 423 405 status = cw1200_spi_irq_subscribe(self); 424 406
+1 -1
drivers/net/wireless/cw1200/fwio.c
··· 485 485 486 486 /* Enable interrupt signalling */ 487 487 priv->hwbus_ops->lock(priv->hwbus_priv); 488 - ret = __cw1200_irq_enable(priv, 1); 488 + ret = __cw1200_irq_enable(priv, 2); 489 489 priv->hwbus_ops->unlock(priv->hwbus_priv); 490 490 if (ret < 0) 491 491 goto unsubscribe;
+1
drivers/net/wireless/cw1200/hwbus.h
··· 28 28 void (*unlock)(struct hwbus_priv *self); 29 29 size_t (*align_size)(struct hwbus_priv *self, size_t size); 30 30 int (*power_mgmt)(struct hwbus_priv *self, bool suspend); 31 + int (*irq_enable)(struct hwbus_priv *self, int enable); 31 32 }; 32 33 33 34 #endif /* CW1200_HWBUS_H */
+15
drivers/net/wireless/cw1200/hwio.c
··· 273 273 u16 val16; 274 274 int ret; 275 275 276 + /* We need to do this hack because the SPI layer can sleep on I/O 277 + and the general path involves I/O to the device in interrupt 278 + context. 279 + 280 + However, the initial enable call needs to go to the hardware. 281 + 282 + We don't worry about shutdown because we do a full reset which 283 + clears the interrupt enabled bits. 284 + */ 285 + if (priv->hwbus_ops->irq_enable) { 286 + ret = priv->hwbus_ops->irq_enable(priv->hwbus_priv, enable); 287 + if (ret || enable < 2) 288 + return ret; 289 + } 290 + 276 291 if (HIF_8601_SILICON == priv->hw_type) { 277 292 ret = __cw1200_reg_read_32(priv, ST90TDS_CONFIG_REG_ID, &val32); 278 293 if (ret < 0) {
+6 -5
drivers/net/wireless/rt2x00/rt2800lib.c
··· 6659 6659 rt2800_init_registers(rt2x00dev))) 6660 6660 return -EIO; 6661 6661 6662 + if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev))) 6663 + return -EIO; 6664 + 6662 6665 /* 6663 6666 * Send signal to firmware during boot time. 6664 6667 */ 6665 6668 rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0); 6666 6669 rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0); 6667 - if (rt2x00_is_usb(rt2x00dev)) { 6670 + if (rt2x00_is_usb(rt2x00dev)) 6668 6671 rt2800_register_write(rt2x00dev, H2M_INT_SRC, 0); 6669 - rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0); 6670 - } 6672 + rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0); 6671 6673 msleep(1); 6672 6674 6673 - if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev) || 6674 - rt2800_wait_bbp_ready(rt2x00dev))) 6675 + if (unlikely(rt2800_wait_bbp_ready(rt2x00dev))) 6675 6676 return -EIO; 6676 6677 6677 6678 rt2800_init_bbp(rt2x00dev);
+10 -5
drivers/net/wireless/rtl818x/rtl8187/dev.c
··· 438 438 skb_queue_tail(&priv->rx_queue, skb); 439 439 usb_anchor_urb(entry, &priv->anchored); 440 440 ret = usb_submit_urb(entry, GFP_KERNEL); 441 + usb_put_urb(entry); 441 442 if (ret) { 442 443 skb_unlink(skb, &priv->rx_queue); 443 444 usb_unanchor_urb(entry); 444 445 goto err; 445 446 } 446 - usb_free_urb(entry); 447 447 } 448 448 return ret; 449 449 450 450 err: 451 - usb_free_urb(entry); 452 451 kfree_skb(skb); 453 452 usb_kill_anchored_urbs(&priv->anchored); 454 453 return ret; ··· 955 956 (RETRY_COUNT << 8 /* short retry limit */) | 956 957 (RETRY_COUNT << 0 /* long retry limit */) | 957 958 (7 << 21 /* MAX TX DMA */)); 958 - rtl8187_init_urbs(dev); 959 - rtl8187b_init_status_urb(dev); 959 + ret = rtl8187_init_urbs(dev); 960 + if (ret) 961 + goto rtl8187_start_exit; 962 + ret = rtl8187b_init_status_urb(dev); 963 + if (ret) 964 + usb_kill_anchored_urbs(&priv->anchored); 960 965 goto rtl8187_start_exit; 961 966 } 962 967 ··· 969 966 rtl818x_iowrite32(priv, &priv->map->MAR[0], ~0); 970 967 rtl818x_iowrite32(priv, &priv->map->MAR[1], ~0); 971 968 972 - rtl8187_init_urbs(dev); 969 + ret = rtl8187_init_urbs(dev); 970 + if (ret) 971 + goto rtl8187_start_exit; 973 972 974 973 reg = RTL818X_RX_CONF_ONLYERLPKT | 975 974 RTL818X_RX_CONF_RX_AUTORESETPHY |
+1
drivers/net/xen-netback/common.h
··· 184 184 unsigned long rx_ring_ref, unsigned int tx_evtchn, 185 185 unsigned int rx_evtchn); 186 186 void xenvif_disconnect(struct xenvif *vif); 187 + void xenvif_free(struct xenvif *vif); 187 188 188 189 int xenvif_xenbus_init(void); 189 190 void xenvif_xenbus_fini(void);
+11 -17
drivers/net/xen-netback/interface.c
··· 353 353 } 354 354 355 355 netdev_dbg(dev, "Successfully created xenvif\n"); 356 + 357 + __module_get(THIS_MODULE); 358 + 356 359 return vif; 357 360 } 358 361 ··· 368 365 /* Already connected through? */ 369 366 if (vif->tx_irq) 370 367 return 0; 371 - 372 - __module_get(THIS_MODULE); 373 368 374 369 err = xenvif_map_frontend_rings(vif, tx_ring_ref, rx_ring_ref); 375 370 if (err < 0) ··· 407 406 408 407 init_waitqueue_head(&vif->wq); 409 408 vif->task = kthread_create(xenvif_kthread, 410 - (void *)vif, vif->dev->name); 409 + (void *)vif, "%s", vif->dev->name); 411 410 if (IS_ERR(vif->task)) { 412 411 pr_warn("Could not allocate kthread for %s\n", vif->dev->name); 413 412 err = PTR_ERR(vif->task); ··· 453 452 454 453 void xenvif_disconnect(struct xenvif *vif) 455 454 { 456 - /* Disconnect funtion might get called by generic framework 457 - * even before vif connects, so we need to check if we really 458 - * need to do a module_put. 459 - */ 460 - int need_module_put = 0; 461 - 462 455 if (netif_carrier_ok(vif->dev)) 463 456 xenvif_carrier_off(vif); 464 457 ··· 463 468 unbind_from_irqhandler(vif->tx_irq, vif); 464 469 unbind_from_irqhandler(vif->rx_irq, vif); 465 470 } 466 - /* vif->irq is valid, we had a module_get in 467 - * xenvif_connect. 468 - */ 469 - need_module_put = 1; 471 + vif->tx_irq = 0; 470 472 } 471 473 472 474 if (vif->task) 473 475 kthread_stop(vif->task); 474 476 477 + xenvif_unmap_frontend_rings(vif); 478 + } 479 + 480 + void xenvif_free(struct xenvif *vif) 481 + { 475 482 netif_napi_del(&vif->napi); 476 483 477 484 unregister_netdev(vif->dev); 478 485 479 - xenvif_unmap_frontend_rings(vif); 480 - 481 486 free_netdev(vif->dev); 482 487 483 - if (need_module_put) 484 - module_put(THIS_MODULE); 488 + module_put(THIS_MODULE); 485 489 }
+65 -31
drivers/net/xen-netback/netback.c
··· 212 212 return false; 213 213 } 214 214 215 + struct xenvif_count_slot_state { 216 + unsigned long copy_off; 217 + bool head; 218 + }; 219 + 220 + unsigned int xenvif_count_frag_slots(struct xenvif *vif, 221 + unsigned long offset, unsigned long size, 222 + struct xenvif_count_slot_state *state) 223 + { 224 + unsigned count = 0; 225 + 226 + offset &= ~PAGE_MASK; 227 + 228 + while (size > 0) { 229 + unsigned long bytes; 230 + 231 + bytes = PAGE_SIZE - offset; 232 + 233 + if (bytes > size) 234 + bytes = size; 235 + 236 + if (start_new_rx_buffer(state->copy_off, bytes, state->head)) { 237 + count++; 238 + state->copy_off = 0; 239 + } 240 + 241 + if (state->copy_off + bytes > MAX_BUFFER_OFFSET) 242 + bytes = MAX_BUFFER_OFFSET - state->copy_off; 243 + 244 + state->copy_off += bytes; 245 + 246 + offset += bytes; 247 + size -= bytes; 248 + 249 + if (offset == PAGE_SIZE) 250 + offset = 0; 251 + 252 + state->head = false; 253 + } 254 + 255 + return count; 256 + } 257 + 215 258 /* 216 259 * Figure out how many ring slots we're going to need to send @skb to 217 260 * the guest. This function is essentially a dry run of ··· 262 219 */ 263 220 unsigned int xenvif_count_skb_slots(struct xenvif *vif, struct sk_buff *skb) 264 221 { 222 + struct xenvif_count_slot_state state; 265 223 unsigned int count; 266 - int i, copy_off; 224 + unsigned char *data; 225 + unsigned i; 267 226 268 - count = DIV_ROUND_UP(skb_headlen(skb), PAGE_SIZE); 227 + state.head = true; 228 + state.copy_off = 0; 269 229 270 - copy_off = skb_headlen(skb) % PAGE_SIZE; 230 + /* Slot for the first (partial) page of data. */ 231 + count = 1; 271 232 233 + /* Need a slot for the GSO prefix for GSO extra data? */ 272 234 if (skb_shinfo(skb)->gso_size) 273 235 count++; 236 + 237 + data = skb->data; 238 + while (data < skb_tail_pointer(skb)) { 239 + unsigned long offset = offset_in_page(data); 240 + unsigned long size = PAGE_SIZE - offset; 241 + 242 + if (data + size > skb_tail_pointer(skb)) 243 + size = skb_tail_pointer(skb) - data; 244 + 245 + count += xenvif_count_frag_slots(vif, offset, size, &state); 246 + 247 + data += size; 248 + } 274 249 275 250 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 276 251 unsigned long size = skb_frag_size(&skb_shinfo(skb)->frags[i]); 277 252 unsigned long offset = skb_shinfo(skb)->frags[i].page_offset; 278 - unsigned long bytes; 279 253 280 - offset &= ~PAGE_MASK; 281 - 282 - while (size > 0) { 283 - BUG_ON(offset >= PAGE_SIZE); 284 - BUG_ON(copy_off > MAX_BUFFER_OFFSET); 285 - 286 - bytes = PAGE_SIZE - offset; 287 - 288 - if (bytes > size) 289 - bytes = size; 290 - 291 - if (start_new_rx_buffer(copy_off, bytes, 0)) { 292 - count++; 293 - copy_off = 0; 294 - } 295 - 296 - if (copy_off + bytes > MAX_BUFFER_OFFSET) 297 - bytes = MAX_BUFFER_OFFSET - copy_off; 298 - 299 - copy_off += bytes; 300 - 301 - offset += bytes; 302 - size -= bytes; 303 - 304 - if (offset == PAGE_SIZE) 305 - offset = 0; 306 - } 254 + count += xenvif_count_frag_slots(vif, offset, size, &state); 307 255 } 308 256 return count; 309 257 }
+13 -6
drivers/net/xen-netback/xenbus.c
··· 42 42 if (be->vif) { 43 43 kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); 44 44 xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status"); 45 - xenvif_disconnect(be->vif); 45 + xenvif_free(be->vif); 46 46 be->vif = NULL; 47 47 } 48 48 kfree(be); ··· 213 213 { 214 214 struct backend_info *be = dev_get_drvdata(&dev->dev); 215 215 216 - if (be->vif) { 217 - xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status"); 216 + if (be->vif) 218 217 xenvif_disconnect(be->vif); 218 + } 219 + 220 + static void destroy_backend(struct xenbus_device *dev) 221 + { 222 + struct backend_info *be = dev_get_drvdata(&dev->dev); 223 + 224 + if (be->vif) { 225 + kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); 226 + xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status"); 227 + xenvif_free(be->vif); 219 228 be->vif = NULL; 220 229 } 221 230 } ··· 255 246 case XenbusStateConnected: 256 247 if (dev->state == XenbusStateConnected) 257 248 break; 258 - backend_create_xenvif(be); 259 249 if (be->vif) 260 250 connect(be); 261 251 break; 262 252 263 253 case XenbusStateClosing: 264 - if (be->vif) 265 - kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); 266 254 disconnect_backend(dev); 267 255 xenbus_switch_state(dev, XenbusStateClosing); 268 256 break; ··· 268 262 xenbus_switch_state(dev, XenbusStateClosed); 269 263 if (xenbus_dev_is_online(dev)) 270 264 break; 265 + destroy_backend(dev); 271 266 /* fall through if not online */ 272 267 case XenbusStateUnknown: 273 268 device_unregister(&dev->dev);
+1 -1
drivers/scsi/bnx2fc/bnx2fc.h
··· 105 105 #define BNX2FC_RQ_WQE_SIZE (BNX2FC_RQ_BUF_SZ) 106 106 #define BNX2FC_XFERQ_WQE_SIZE (sizeof(struct fcoe_xfrqe)) 107 107 #define BNX2FC_CONFQ_WQE_SIZE (sizeof(struct fcoe_confqe)) 108 - #define BNX2FC_5771X_DB_PAGE_SIZE 128 108 + #define BNX2X_DB_SHIFT 3 109 109 110 110 #define BNX2FC_TASK_SIZE 128 111 111 #define BNX2FC_TASKS_PER_PAGE (PAGE_SIZE/BNX2FC_TASK_SIZE)
+1 -2
drivers/scsi/bnx2fc/bnx2fc_hwi.c
··· 1421 1421 1422 1422 reg_base = pci_resource_start(hba->pcidev, 1423 1423 BNX2X_DOORBELL_PCI_BAR); 1424 - reg_off = BNX2FC_5771X_DB_PAGE_SIZE * 1425 - (context_id & 0x1FFFF) + DPM_TRIGER_TYPE; 1424 + reg_off = (1 << BNX2X_DB_SHIFT) * (context_id & 0x1FFFF); 1426 1425 tgt->ctx_base = ioremap_nocache(reg_base + reg_off, 4); 1427 1426 if (!tgt->ctx_base) 1428 1427 return -ENOMEM;
+1 -1
drivers/scsi/bnx2i/bnx2i.h
··· 64 64 #define MAX_PAGES_PER_CTRL_STRUCT_POOL 8 65 65 #define BNX2I_RESERVED_SLOW_PATH_CMD_SLOTS 4 66 66 67 - #define BNX2I_5771X_DBELL_PAGE_SIZE 128 67 + #define BNX2X_DB_SHIFT 3 68 68 69 69 /* 5706/08 hardware has limit on maximum buffer size per BD it can handle */ 70 70 #define MAX_BD_LENGTH 65535
+1 -2
drivers/scsi/bnx2i/bnx2i_hwi.c
··· 2738 2738 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { 2739 2739 reg_base = pci_resource_start(ep->hba->pcidev, 2740 2740 BNX2X_DOORBELL_PCI_BAR); 2741 - reg_off = BNX2I_5771X_DBELL_PAGE_SIZE * (cid_num & 0x1FFFF) + 2742 - DPM_TRIGER_TYPE; 2741 + reg_off = (1 << BNX2X_DB_SHIFT) * (cid_num & 0x1FFFF); 2743 2742 ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 4); 2744 2743 goto arm_cq; 2745 2744 }
+4 -4
include/linux/netdevice.h
··· 950 950 * multiple net devices on single physical port. 951 951 * 952 952 * void (*ndo_add_vxlan_port)(struct net_device *dev, 953 - * sa_family_t sa_family, __u16 port); 953 + * sa_family_t sa_family, __be16 port); 954 954 * Called by vxlan to notiy a driver about the UDP port and socket 955 955 * address family that vxlan is listnening to. It is called only when 956 956 * a new port starts listening. The operation is protected by the 957 957 * vxlan_net->sock_lock. 958 958 * 959 959 * void (*ndo_del_vxlan_port)(struct net_device *dev, 960 - * sa_family_t sa_family, __u16 port); 960 + * sa_family_t sa_family, __be16 port); 961 961 * Called by vxlan to notify the driver about a UDP port and socket 962 962 * address family that vxlan is not listening to anymore. The operation 963 963 * is protected by the vxlan_net->sock_lock. ··· 1093 1093 struct netdev_phys_port_id *ppid); 1094 1094 void (*ndo_add_vxlan_port)(struct net_device *dev, 1095 1095 sa_family_t sa_family, 1096 - __u16 port); 1096 + __be16 port); 1097 1097 void (*ndo_del_vxlan_port)(struct net_device *dev, 1098 1098 sa_family_t sa_family, 1099 - __u16 port); 1099 + __be16 port); 1100 1100 }; 1101 1101 1102 1102 /*
+4 -2
include/linux/netfilter/ipset/ip_set.h
··· 296 296 297 297 /* Match elements marked with nomatch */ 298 298 static inline bool 299 - ip_set_enomatch(int ret, u32 flags, enum ipset_adt adt) 299 + ip_set_enomatch(int ret, u32 flags, enum ipset_adt adt, struct ip_set *set) 300 300 { 301 301 return adt == IPSET_TEST && 302 - ret == -ENOTEMPTY && ((flags >> 16) & IPSET_FLAG_NOMATCH); 302 + (set->type->features & IPSET_TYPE_NOMATCH) && 303 + ((flags >> 16) & IPSET_FLAG_NOMATCH) && 304 + (ret > 0 || ret == -ENOTEMPTY); 303 305 } 304 306 305 307 /* Check the NLA_F_NET_BYTEORDER flag */
+8 -4
include/net/ip.h
··· 264 264 265 265 extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); 266 266 267 - static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, struct sock *sk) 267 + static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk) 268 268 { 269 - if (iph->frag_off & htons(IP_DF)) { 269 + struct iphdr *iph = ip_hdr(skb); 270 + 271 + if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) { 270 272 /* This is only to work around buggy Windows95/2000 271 273 * VJ compression implementations. If the ID field 272 274 * does not change, they drop every other packet in ··· 280 278 __ip_select_ident(iph, dst, 0); 281 279 } 282 280 283 - static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more) 281 + static inline void ip_select_ident_more(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk, int more) 284 282 { 285 - if (iph->frag_off & htons(IP_DF)) { 283 + struct iphdr *iph = ip_hdr(skb); 284 + 285 + if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) { 286 286 if (sk && inet_sk(sk)->inet_daddr) { 287 287 iph->id = htons(inet_sk(sk)->inet_id); 288 288 inet_sk(sk)->inet_id += 1 + more;
+1 -1
include/net/netfilter/nf_conntrack_extend.h
··· 86 86 static inline void nf_ct_ext_free(struct nf_conn *ct) 87 87 { 88 88 if (ct->ext) 89 - kfree(ct->ext); 89 + kfree_rcu(ct->ext, rcu); 90 90 } 91 91 92 92 /* Add this type, returns pointer to data or NULL. */
+2
net/batman-adv/soft-interface.c
··· 168 168 case ETH_P_8021Q: 169 169 vhdr = (struct vlan_ethhdr *)skb->data; 170 170 vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK; 171 + vid |= BATADV_VLAN_HAS_TAG; 171 172 172 173 if (vhdr->h_vlan_encapsulated_proto != ethertype) 173 174 break; ··· 332 331 case ETH_P_8021Q: 333 332 vhdr = (struct vlan_ethhdr *)skb->data; 334 333 vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK; 334 + vid |= BATADV_VLAN_HAS_TAG; 335 335 336 336 if (vhdr->h_vlan_encapsulated_proto != ethertype) 337 337 break;
+2 -2
net/bridge/br_netlink.c
··· 207 207 struct net_device *dev, u32 filter_mask) 208 208 { 209 209 int err = 0; 210 - struct net_bridge_port *port = br_port_get_rcu(dev); 210 + struct net_bridge_port *port = br_port_get_rtnl(dev); 211 211 212 212 /* not a bridge port and */ 213 213 if (!port && !(filter_mask & RTEXT_FILTER_BRVLAN)) ··· 451 451 struct net_port_vlans *pv; 452 452 453 453 if (br_port_exists(dev)) 454 - pv = nbp_get_vlan_info(br_port_get_rcu(dev)); 454 + pv = nbp_get_vlan_info(br_port_get_rtnl(dev)); 455 455 else if (dev->priv_flags & IFF_EBRIDGE) 456 456 pv = br_get_vlan_info((struct net_bridge *)netdev_priv(dev)); 457 457 else
+3 -5
net/bridge/br_private.h
··· 202 202 203 203 static inline struct net_bridge_port *br_port_get_rcu(const struct net_device *dev) 204 204 { 205 - struct net_bridge_port *port = 206 - rcu_dereference_rtnl(dev->rx_handler_data); 207 - 208 - return br_port_exists(dev) ? port : NULL; 205 + return rcu_dereference(dev->rx_handler_data); 209 206 } 210 207 211 - static inline struct net_bridge_port *br_port_get_rtnl(struct net_device *dev) 208 + static inline struct net_bridge_port *br_port_get_rtnl(const struct net_device *dev) 212 209 { 213 210 return br_port_exists(dev) ? 214 211 rtnl_dereference(dev->rx_handler_data) : NULL; ··· 743 746 extern void br_init_port(struct net_bridge_port *p); 744 747 extern void br_become_designated_port(struct net_bridge_port *p); 745 748 749 + extern void __br_set_forward_delay(struct net_bridge *br, unsigned long t); 746 750 extern int br_set_forward_delay(struct net_bridge *br, unsigned long x); 747 751 extern int br_set_hello_time(struct net_bridge *br, unsigned long x); 748 752 extern int br_set_max_age(struct net_bridge *br, unsigned long x);
+19 -10
net/bridge/br_stp.c
··· 209 209 p->designated_age = jiffies - bpdu->message_age; 210 210 211 211 mod_timer(&p->message_age_timer, jiffies 212 - + (p->br->max_age - bpdu->message_age)); 212 + + (bpdu->max_age - bpdu->message_age)); 213 213 } 214 214 215 215 /* called under bridge lock */ ··· 544 544 545 545 } 546 546 547 - int br_set_forward_delay(struct net_bridge *br, unsigned long val) 547 + void __br_set_forward_delay(struct net_bridge *br, unsigned long t) 548 548 { 549 - unsigned long t = clock_t_to_jiffies(val); 550 - 551 - if (br->stp_enabled != BR_NO_STP && 552 - (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY)) 553 - return -ERANGE; 554 - 555 - spin_lock_bh(&br->lock); 556 549 br->bridge_forward_delay = t; 557 550 if (br_is_root_bridge(br)) 558 551 br->forward_delay = br->bridge_forward_delay; 552 + } 553 + 554 + int br_set_forward_delay(struct net_bridge *br, unsigned long val) 555 + { 556 + unsigned long t = clock_t_to_jiffies(val); 557 + int err = -ERANGE; 558 + 559 + spin_lock_bh(&br->lock); 560 + if (br->stp_enabled != BR_NO_STP && 561 + (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY)) 562 + goto unlock; 563 + 564 + __br_set_forward_delay(br, t); 565 + err = 0; 566 + 567 + unlock: 559 568 spin_unlock_bh(&br->lock); 560 - return 0; 569 + return err; 561 570 }
+10 -2
net/bridge/br_stp_if.c
··· 129 129 char *envp[] = { NULL }; 130 130 131 131 r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC); 132 + 133 + spin_lock_bh(&br->lock); 134 + 135 + if (br->bridge_forward_delay < BR_MIN_FORWARD_DELAY) 136 + __br_set_forward_delay(br, BR_MIN_FORWARD_DELAY); 137 + else if (br->bridge_forward_delay < BR_MAX_FORWARD_DELAY) 138 + __br_set_forward_delay(br, BR_MAX_FORWARD_DELAY); 139 + 132 140 if (r == 0) { 133 141 br->stp_enabled = BR_USER_STP; 134 142 br_debug(br, "userspace STP started\n"); ··· 145 137 br_debug(br, "using kernel STP\n"); 146 138 147 139 /* To start timers on any ports left in blocking */ 148 - spin_lock_bh(&br->lock); 149 140 br_port_state_selection(br); 150 - spin_unlock_bh(&br->lock); 151 141 } 142 + 143 + spin_unlock_bh(&br->lock); 152 144 } 153 145 154 146 static void br_stp_stop(struct net_bridge *br)
+5 -6
net/core/netpoll.c
··· 550 550 return; 551 551 552 552 proto = ntohs(eth_hdr(skb)->h_proto); 553 - if (proto == ETH_P_IP) { 553 + if (proto == ETH_P_ARP) { 554 554 struct arphdr *arp; 555 555 unsigned char *arp_ptr; 556 556 /* No arp on this interface */ ··· 1284 1284 1285 1285 void netpoll_cleanup(struct netpoll *np) 1286 1286 { 1287 - if (!np->dev) 1288 - return; 1289 - 1290 1287 rtnl_lock(); 1288 + if (!np->dev) 1289 + goto out; 1291 1290 __netpoll_cleanup(np); 1292 - rtnl_unlock(); 1293 - 1294 1291 dev_put(np->dev); 1295 1292 np->dev = NULL; 1293 + out: 1294 + rtnl_unlock(); 1296 1295 } 1297 1296 EXPORT_SYMBOL(netpoll_cleanup); 1298 1297
+1
net/dccp/ipv6.c
··· 135 135 136 136 if (dst) 137 137 dst->ops->redirect(dst, sk, skb); 138 + goto out; 138 139 } 139 140 140 141 if (type == ICMPV6_PKT_TOOBIG) {
+2 -2
net/ipv4/igmp.c
··· 369 369 pip->saddr = fl4.saddr; 370 370 pip->protocol = IPPROTO_IGMP; 371 371 pip->tot_len = 0; /* filled in later */ 372 - ip_select_ident(pip, &rt->dst, NULL); 372 + ip_select_ident(skb, &rt->dst, NULL); 373 373 ((u8 *)&pip[1])[0] = IPOPT_RA; 374 374 ((u8 *)&pip[1])[1] = 4; 375 375 ((u8 *)&pip[1])[2] = 0; ··· 714 714 iph->daddr = dst; 715 715 iph->saddr = fl4.saddr; 716 716 iph->protocol = IPPROTO_IGMP; 717 - ip_select_ident(iph, &rt->dst, NULL); 717 + ip_select_ident(skb, &rt->dst, NULL); 718 718 ((u8 *)&iph[1])[0] = IPOPT_RA; 719 719 ((u8 *)&iph[1])[1] = 4; 720 720 ((u8 *)&iph[1])[2] = 0;
+2 -2
net/ipv4/inetpeer.c
··· 32 32 * At the moment of writing this notes identifier of IP packets is generated 33 33 * to be unpredictable using this code only for packets subjected 34 34 * (actually or potentially) to defragmentation. I.e. DF packets less than 35 - * PMTU in size uses a constant ID and do not use this code (see 36 - * ip_select_ident() in include/net/ip.h). 35 + * PMTU in size when local fragmentation is disabled use a constant ID and do 36 + * not use this code (see ip_select_ident() in include/net/ip.h). 37 37 * 38 38 * Route cache entries hold references to our nodes. 39 39 * New cache entries get references via lookup by destination IP address in
+4 -4
net/ipv4/ip_output.c
··· 148 148 iph->daddr = (opt && opt->opt.srr ? opt->opt.faddr : daddr); 149 149 iph->saddr = saddr; 150 150 iph->protocol = sk->sk_protocol; 151 - ip_select_ident(iph, &rt->dst, sk); 151 + ip_select_ident(skb, &rt->dst, sk); 152 152 153 153 if (opt && opt->opt.optlen) { 154 154 iph->ihl += opt->opt.optlen>>2; ··· 386 386 ip_options_build(skb, &inet_opt->opt, inet->inet_daddr, rt, 0); 387 387 } 388 388 389 - ip_select_ident_more(iph, &rt->dst, sk, 389 + ip_select_ident_more(skb, &rt->dst, sk, 390 390 (skb_shinfo(skb)->gso_segs ?: 1) - 1); 391 391 392 392 skb->priority = sk->sk_priority; ··· 1316 1316 else 1317 1317 ttl = ip_select_ttl(inet, &rt->dst); 1318 1318 1319 - iph = (struct iphdr *)skb->data; 1319 + iph = ip_hdr(skb); 1320 1320 iph->version = 4; 1321 1321 iph->ihl = 5; 1322 1322 iph->tos = inet->tos; ··· 1324 1324 iph->ttl = ttl; 1325 1325 iph->protocol = sk->sk_protocol; 1326 1326 ip_copy_addrs(iph, fl4); 1327 - ip_select_ident(iph, &rt->dst, sk); 1327 + ip_select_ident(skb, &rt->dst, sk); 1328 1328 1329 1329 if (opt) { 1330 1330 iph->ihl += opt->optlen>>2;
+1 -1
net/ipv4/ipmr.c
··· 1658 1658 iph->protocol = IPPROTO_IPIP; 1659 1659 iph->ihl = 5; 1660 1660 iph->tot_len = htons(skb->len); 1661 - ip_select_ident(iph, skb_dst(skb), NULL); 1661 + ip_select_ident(skb, skb_dst(skb), NULL); 1662 1662 ip_send_check(iph); 1663 1663 1664 1664 memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
+1 -1
net/ipv4/raw.c
··· 387 387 iph->check = 0; 388 388 iph->tot_len = htons(length); 389 389 if (!iph->id) 390 - ip_select_ident(iph, &rt->dst, NULL); 390 + ip_select_ident(skb, &rt->dst, NULL); 391 391 392 392 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); 393 393 }
+3 -1
net/ipv4/tcp_metrics.c
··· 502 502 * ACKs, wait for troubles. 503 503 */ 504 504 if (crtt > tp->srtt) { 505 - inet_csk(sk)->icsk_rto = crtt + max(crtt >> 2, tcp_rto_min(sk)); 505 + /* Set RTO like tcp_rtt_estimator(), but from cached RTT. */ 506 + crtt >>= 3; 507 + inet_csk(sk)->icsk_rto = crtt + max(2 * crtt, tcp_rto_min(sk)); 506 508 } else if (tp->srtt == 0) { 507 509 /* RFC6298: 5.7 We've failed to get a valid RTT sample from 508 510 * 3WHS. This is most likely due to retransmission,
+1 -1
net/ipv4/xfrm4_mode_tunnel.c
··· 117 117 118 118 top_iph->frag_off = (flags & XFRM_STATE_NOPMTUDISC) ? 119 119 0 : (XFRM_MODE_SKB_CB(skb)->frag_off & htons(IP_DF)); 120 - ip_select_ident(top_iph, dst->child, NULL); 120 + ip_select_ident(skb, dst->child, NULL); 121 121 122 122 top_iph->ttl = ip4_dst_hoplimit(dst->child); 123 123
+2 -2
net/ipv6/ip6_tunnel.c
··· 1656 1656 1657 1657 if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || 1658 1658 nla_put(skb, IFLA_IPTUN_LOCAL, sizeof(struct in6_addr), 1659 - &parm->raddr) || 1660 - nla_put(skb, IFLA_IPTUN_REMOTE, sizeof(struct in6_addr), 1661 1659 &parm->laddr) || 1660 + nla_put(skb, IFLA_IPTUN_REMOTE, sizeof(struct in6_addr), 1661 + &parm->raddr) || 1662 1662 nla_put_u8(skb, IFLA_IPTUN_TTL, parm->hop_limit) || 1663 1663 nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) || 1664 1664 nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
+2 -2
net/ipv6/netfilter/nf_nat_proto_icmpv6.c
··· 69 69 hdr = (struct icmp6hdr *)(skb->data + hdroff); 70 70 l3proto->csum_update(skb, iphdroff, &hdr->icmp6_cksum, 71 71 tuple, maniptype); 72 - if (hdr->icmp6_code == ICMPV6_ECHO_REQUEST || 73 - hdr->icmp6_code == ICMPV6_ECHO_REPLY) { 72 + if (hdr->icmp6_type == ICMPV6_ECHO_REQUEST || 73 + hdr->icmp6_type == ICMPV6_ECHO_REPLY) { 74 74 inet_proto_csum_replace2(&hdr->icmp6_cksum, skb, 75 75 hdr->icmp6_identifier, 76 76 tuple->src.u.icmp.id, 0);
+2 -3
net/netfilter/ipset/ip_set_core.c
··· 1052 1052 * Not an artificial restriction anymore, as we must prevent 1053 1053 * possible loops created by swapping in setlist type of sets. */ 1054 1054 if (!(from->type->features == to->type->features && 1055 - from->type->family == to->type->family)) 1055 + from->family == to->family)) 1056 1056 return -IPSET_ERR_TYPE_MISMATCH; 1057 1057 1058 1058 strncpy(from_name, from->name, IPSET_MAXNAMELEN); ··· 1489 1489 if (ret == -EAGAIN) 1490 1490 ret = 1; 1491 1491 1492 - return (ret < 0 && ret != -ENOTEMPTY) ? ret : 1493 - ret > 0 ? 0 : -IPSET_ERR_EXIST; 1492 + return ret > 0 ? 0 : -IPSET_ERR_EXIST; 1494 1493 } 1495 1494 1496 1495 /* Get headed data of a set */
+2 -2
net/netfilter/ipset/ip_set_getport.c
··· 116 116 { 117 117 int protoff; 118 118 u8 nexthdr; 119 - __be16 frag_off; 119 + __be16 frag_off = 0; 120 120 121 121 nexthdr = ipv6_hdr(skb)->nexthdr; 122 122 protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr, 123 123 &frag_off); 124 - if (protoff < 0) 124 + if (protoff < 0 || (frag_off & htons(~0x7)) != 0) 125 125 return false; 126 126 127 127 return get_port(skb, nexthdr, protoff, src, port, proto);
+15 -11
net/netfilter/ipset/ip_set_hash_gen.h
··· 325 325 static void 326 326 mtype_del_cidr(struct htype *h, u8 cidr, u8 nets_length) 327 327 { 328 - u8 i, j; 328 + u8 i, j, net_end = nets_length - 1; 329 329 330 - for (i = 0; i < nets_length - 1 && h->nets[i].cidr != cidr; i++) 331 - ; 332 - h->nets[i].nets--; 333 - 334 - if (h->nets[i].nets != 0) 335 - return; 336 - 337 - for (j = i; j < nets_length - 1 && h->nets[j].nets; j++) { 338 - h->nets[j].cidr = h->nets[j + 1].cidr; 339 - h->nets[j].nets = h->nets[j + 1].nets; 330 + for (i = 0; i < nets_length; i++) { 331 + if (h->nets[i].cidr != cidr) 332 + continue; 333 + if (h->nets[i].nets > 1 || i == net_end || 334 + h->nets[i + 1].nets == 0) { 335 + h->nets[i].nets--; 336 + return; 337 + } 338 + for (j = i; j < net_end && h->nets[j].nets; j++) { 339 + h->nets[j].cidr = h->nets[j + 1].cidr; 340 + h->nets[j].nets = h->nets[j + 1].nets; 341 + } 342 + h->nets[j].nets = 0; 343 + return; 340 344 } 341 345 } 342 346 #endif
+2 -2
net/netfilter/ipset/ip_set_hash_ipportnet.c
··· 260 260 e.ip = htonl(ip); 261 261 e.ip2 = htonl(ip2_from & ip_set_hostmask(e.cidr + 1)); 262 262 ret = adtfn(set, &e, &ext, &ext, flags); 263 - return ip_set_enomatch(ret, flags, adt) ? 1 : 263 + return ip_set_enomatch(ret, flags, adt, set) ? -ret : 264 264 ip_set_eexist(ret, flags) ? 0 : ret; 265 265 } 266 266 ··· 544 544 545 545 if (adt == IPSET_TEST || !with_ports || !tb[IPSET_ATTR_PORT_TO]) { 546 546 ret = adtfn(set, &e, &ext, &ext, flags); 547 - return ip_set_enomatch(ret, flags, adt) ? 1 : 547 + return ip_set_enomatch(ret, flags, adt, set) ? -ret : 548 548 ip_set_eexist(ret, flags) ? 0 : ret; 549 549 } 550 550
+2 -2
net/netfilter/ipset/ip_set_hash_net.c
··· 199 199 if (adt == IPSET_TEST || !tb[IPSET_ATTR_IP_TO]) { 200 200 e.ip = htonl(ip & ip_set_hostmask(e.cidr)); 201 201 ret = adtfn(set, &e, &ext, &ext, flags); 202 - return ip_set_enomatch(ret, flags, adt) ? 1 : 202 + return ip_set_enomatch(ret, flags, adt, set) ? -ret: 203 203 ip_set_eexist(ret, flags) ? 0 : ret; 204 204 } 205 205 ··· 396 396 397 397 ret = adtfn(set, &e, &ext, &ext, flags); 398 398 399 - return ip_set_enomatch(ret, flags, adt) ? 1 : 399 + return ip_set_enomatch(ret, flags, adt, set) ? -ret : 400 400 ip_set_eexist(ret, flags) ? 0 : ret; 401 401 } 402 402
+2 -2
net/netfilter/ipset/ip_set_hash_netiface.c
··· 368 368 if (adt == IPSET_TEST || !tb[IPSET_ATTR_IP_TO]) { 369 369 e.ip = htonl(ip & ip_set_hostmask(e.cidr)); 370 370 ret = adtfn(set, &e, &ext, &ext, flags); 371 - return ip_set_enomatch(ret, flags, adt) ? 1 : 371 + return ip_set_enomatch(ret, flags, adt, set) ? -ret : 372 372 ip_set_eexist(ret, flags) ? 0 : ret; 373 373 } 374 374 ··· 634 634 635 635 ret = adtfn(set, &e, &ext, &ext, flags); 636 636 637 - return ip_set_enomatch(ret, flags, adt) ? 1 : 637 + return ip_set_enomatch(ret, flags, adt, set) ? -ret : 638 638 ip_set_eexist(ret, flags) ? 0 : ret; 639 639 } 640 640
+2 -2
net/netfilter/ipset/ip_set_hash_netport.c
··· 244 244 if (adt == IPSET_TEST || !(with_ports || tb[IPSET_ATTR_IP_TO])) { 245 245 e.ip = htonl(ip & ip_set_hostmask(e.cidr + 1)); 246 246 ret = adtfn(set, &e, &ext, &ext, flags); 247 - return ip_set_enomatch(ret, flags, adt) ? 1 : 247 + return ip_set_enomatch(ret, flags, adt, set) ? -ret : 248 248 ip_set_eexist(ret, flags) ? 0 : ret; 249 249 } 250 250 ··· 489 489 490 490 if (adt == IPSET_TEST || !with_ports || !tb[IPSET_ATTR_PORT_TO]) { 491 491 ret = adtfn(set, &e, &ext, &ext, flags); 492 - return ip_set_enomatch(ret, flags, adt) ? 1 : 492 + return ip_set_enomatch(ret, flags, adt, set) ? -ret : 493 493 ip_set_eexist(ret, flags) ? 0 : ret; 494 494 } 495 495
+1 -1
net/netfilter/ipvs/ip_vs_xmit.c
··· 883 883 iph->daddr = cp->daddr.ip; 884 884 iph->saddr = saddr; 885 885 iph->ttl = old_iph->ttl; 886 - ip_select_ident(iph, &rt->dst, NULL); 886 + ip_select_ident(skb, &rt->dst, NULL); 887 887 888 888 /* Another hack: avoid icmp_send in ip_fragment */ 889 889 skb->local_df = 1;
+1 -2
net/sctp/input.c
··· 634 634 break; 635 635 case ICMP_REDIRECT: 636 636 sctp_icmp_redirect(sk, transport, skb); 637 - err = 0; 638 - break; 637 + /* Fall through to out_unlock. */ 639 638 default: 640 639 goto out_unlock; 641 640 }
+14 -30
net/sctp/ipv6.c
··· 183 183 break; 184 184 case NDISC_REDIRECT: 185 185 sctp_icmp_redirect(sk, transport, skb); 186 - break; 186 + goto out_unlock; 187 187 default: 188 188 break; 189 189 } ··· 204 204 in6_dev_put(idev); 205 205 } 206 206 207 - /* Based on tcp_v6_xmit() in tcp_ipv6.c. */ 208 207 static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport) 209 208 { 210 209 struct sock *sk = skb->sk; 211 210 struct ipv6_pinfo *np = inet6_sk(sk); 212 - struct flowi6 fl6; 213 - 214 - memset(&fl6, 0, sizeof(fl6)); 215 - 216 - fl6.flowi6_proto = sk->sk_protocol; 217 - 218 - /* Fill in the dest address from the route entry passed with the skb 219 - * and the source address from the transport. 220 - */ 221 - fl6.daddr = transport->ipaddr.v6.sin6_addr; 222 - fl6.saddr = transport->saddr.v6.sin6_addr; 223 - 224 - fl6.flowlabel = np->flow_label; 225 - IP6_ECN_flow_xmit(sk, fl6.flowlabel); 226 - if (ipv6_addr_type(&fl6.saddr) & IPV6_ADDR_LINKLOCAL) 227 - fl6.flowi6_oif = transport->saddr.v6.sin6_scope_id; 228 - else 229 - fl6.flowi6_oif = sk->sk_bound_dev_if; 230 - 231 - if (np->opt && np->opt->srcrt) { 232 - struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; 233 - fl6.daddr = *rt0->addr; 234 - } 211 + struct flowi6 *fl6 = &transport->fl.u.ip6; 235 212 236 213 pr_debug("%s: skb:%p, len:%d, src:%pI6 dst:%pI6\n", __func__, skb, 237 - skb->len, &fl6.saddr, &fl6.daddr); 214 + skb->len, &fl6->saddr, &fl6->daddr); 238 215 239 - SCTP_INC_STATS(sock_net(sk), SCTP_MIB_OUTSCTPPACKS); 216 + IP6_ECN_flow_xmit(sk, fl6->flowlabel); 240 217 241 218 if (!(transport->param_flags & SPP_PMTUD_ENABLE)) 242 219 skb->local_df = 1; 243 220 244 - return ip6_xmit(sk, skb, &fl6, np->opt, np->tclass); 221 + SCTP_INC_STATS(sock_net(sk), SCTP_MIB_OUTSCTPPACKS); 222 + 223 + return ip6_xmit(sk, skb, fl6, np->opt, np->tclass); 245 224 } 246 225 247 226 /* Returns the dst cache entry for the given source and destination ip ··· 233 254 struct dst_entry *dst = NULL; 234 255 struct flowi6 *fl6 = &fl->u.ip6; 235 256 struct sctp_bind_addr *bp; 257 + struct ipv6_pinfo *np = inet6_sk(sk); 236 258 struct sctp_sockaddr_entry *laddr; 237 259 union sctp_addr *baddr = NULL; 238 260 union sctp_addr *daddr = &t->ipaddr; 239 261 union sctp_addr dst_saddr; 262 + struct in6_addr *final_p, final; 240 263 __u8 matchlen = 0; 241 264 __u8 bmatchlen; 242 265 sctp_scope_t scope; ··· 262 281 pr_debug("src=%pI6 - ", &fl6->saddr); 263 282 } 264 283 265 - dst = ip6_dst_lookup_flow(sk, fl6, NULL, false); 284 + final_p = fl6_update_dst(fl6, np->opt, &final); 285 + dst = ip6_dst_lookup_flow(sk, fl6, final_p, false); 266 286 if (!asoc || saddr) 267 287 goto out; 268 288 ··· 315 333 } 316 334 } 317 335 rcu_read_unlock(); 336 + 318 337 if (baddr) { 319 338 fl6->saddr = baddr->v6.sin6_addr; 320 339 fl6->fl6_sport = baddr->v6.sin6_port; 321 - dst = ip6_dst_lookup_flow(sk, fl6, NULL, false); 340 + final_p = fl6_update_dst(fl6, np->opt, &final); 341 + dst = ip6_dst_lookup_flow(sk, fl6, final_p, false); 322 342 } 323 343 324 344 out: