summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_oce.c
AgeCommit message (Collapse)Author
2024-05-24remove unneeded includes; ok miod@Jonathan Gray
2023-11-10Make ifq and ifiq interface MP safe.Alexander Bluhm
Rename ifq_set_maxlen() to ifq_init_maxlen(). This function neither uses WRITE_ONCE() nor a mutex and is called before the ifq mutex is initialized. The new name expresses that it should be used only during interface attach when there is no concurrency. Protect ifq_len(), ifq_empty(), ifiq_len(), and ifiq_empty() with READ_ONCE(). They can be used without lock as they only read a single integer. OK dlg@
2023-04-28Remove error handling around mallocarray(9). I cannot fail whenAlexander Bluhm
called with M_WAITOK. OK kevlo@
2022-03-11Constify struct cfattach.Martin Pieuchot
2022-01-09spellingJonathan Gray
feedback and ok tb@ jmc@ ok ratchov@
2020-12-12Rename the macro MCLGETI to MCLGETL and removes the dead parameter ifp.jan
OK dlg@, bluhm@ No Opinion mpi@ Not against it claudio@
2020-07-10Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.Patrick Wildt
ok dlg@ tobhe@
2020-07-10Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use thePatrick Wildt
"new" API. ok dlg@ tobhe@
2020-06-22use ifiq_input and use it's return value to apply backpressure to rxrs.David Gwynne
this is a step toward deprecating softclock based livelock detection.
2017-11-27lenght->length, mostly in commentsStuart Henderson
2017-01-22move counting if_opackets next to counting if_obytes in if_enqueue.David Gwynne
this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it. ok mpi@ deraadt@
2016-09-15all pools have their ipl set via pool_setipl, so fold it into pool_init.David Gwynne
the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
2016-09-14Declare the type instead of a on-stack variable for sizeof purposesMike Belopuhov
(Un?)surprisingly the compiler is smart enough to produce the same code in both cases, but this conveys the intention better.
2016-08-24pool_setipl for oce(4)David Gwynne
ok mikeb@
2016-04-13G/C IFQ_SET_READY().Martin Pieuchot
2016-03-14Allocate statistics command from the heap, pointed out by deraadt@Mike Belopuhov
2016-03-04extra ) not needed, spotted by tiago silvaTheo de Raadt
2016-01-06revert 1.87, more work is needed hereMike Belopuhov
2015-12-11Replace mountroothook_establish(9) by config_mountroot(9) a narrower APIMartin Pieuchot
similar to config_defer(9). ok mikeb@, deraadt@
2015-11-25replace IFF_OACTIVE manipulation with mpsafe operations.David Gwynne
there are two things shared between the network stack and drivers in the send path: the send queue and the IFF_OACTIVE flag. the send queue is now protected by a mutex. this diff makes the oactive functionality mpsafe too. IFF_OACTIVE is part of if_flags. there are two problems with that. firstly, if_flags is a short and we dont have any MI atomic operations to manipulate a short. secondly, while we could make the IFF_OACTIVE operates mpsafe, all changes to other flags would have to be made safe at the same time, otherwise a read-modify-write cycle on their updates could clobber the oactive change. instead, this moves the oactive mark into struct ifqueue and provides an API for changing it. there's ifq_set_oactive, ifq_clr_oactive, and ifq_is_oactive. these are modelled on ifsq_set_oactive, ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd. this diff includes changes to all the drivers manipulating IFF_OACTIVE to now use the ifsq_{set,clr_is}_oactive API too. ok kettenis@ mpi@ jmatthew@ deraadt@
2015-11-14Do not include <net/if_vlan_var.h> when it's not necessary.Martin Pieuchot
Because of the VLAN hacks in mpw(4) this file still contains the definition of "struct ifvlan" which depends on <sys/refcnt.h> which in turns pull <sys/atomic.h>...
2015-10-25arp_ifinit() is no longer needed.Martin Pieuchot
2015-09-29Unlock interrupt handler rx path with intr_barrierChris Cappuccio
ok mikeb@
2015-09-11Make room for media types of the future. Extend the ifmedia word to 64 bits.Stefan Sperling
This changes numbers of the SIOCSIFMEDIA and SIOCGIFMEDIA ioctls and grows struct ifmediareq. Old ifconfig and dhclient binaries can still assign addresses, however the 'media' subcommand stops working. Recompiling ifconfig and dhclient with new headers before a reboot should not be necessary unless in very special circumstances where non-default media settings must be used to get link and console access is not available. There may be some MD fallout but that will be cleared up later. ok deraadt miod with help and suggestions from several sharks attending l2k15
2015-06-29Hide ETHER_ALIGN mbuf adjustment under "#ifdef __STRICT_ALIGNMENT"Mike Belopuhov
for now to get jumbo frames working. oce(4) will need the same treatment as ix(4) when sparc64 support will be implemented. Tested by Pedro Caetano <pedrocaetano at binaryflows ! com>, thanks!
2015-06-24Increment if_ipackets in if_input().Martin Pieuchot
Note that pseudo-drivers not using if_input() are not affected by this conversion. ok mikeb@, kettenis@, claudio@, dlg@
2015-04-30Convert moar drivers to if_input().Martin Pieuchot
ok dlg@
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2014-12-22unifdef INETTed Unangst
2014-12-13yet more mallocarray() changes.Doug Hogan
ok tedu@ deraadt@
2014-08-30let the mru always be what the chip can do, not what the mtu implies.David Gwynne
tested by and ok mikeb@
2014-08-14Implement rxrinfo ioctl for cluster usage statisticsMike Belopuhov
2014-07-22Fewer <netinet/in_systm.h>Martin Pieuchot
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-08cut things that relied on mclgeti for rx ring accounting/restriction overDavid Gwynne
to using if_rxr. cut the reporting systat did over to the rxr ioctl. tested as much as i can on alpha, amd64, and sparc64. mpi@ has run it on macppc. ok mpi@
2014-01-20bcopy to memcpyChris Cappuccio
ok mikeb@
2014-01-20bcmp to memcmpChris Cappuccio
ok mikeb@
2014-01-20bzero to memsetChris Cappuccio
ok mikeb@
2013-08-23don't call if_link_state_change if link state is not changedMike Belopuhov
2013-08-07Most network drivers include netinet/in_var.h, but apparently theyAlexander Bluhm
don't have to. Just remove these include lines. Compiled on amd64 i386 sparc64; OK henning@ mikeb@
2013-01-17first or second coming, commie or not commie, one m in coming is sufficientHenning Brauer
ok claudio
2012-12-10adjust mbuf chain data pointer so that ip header would appearMike Belopuhov
word aligned; remove pool constraints insanity while here
2012-11-27fix format string; OK mikeb@Gleydson Soares
2012-11-26shorten MBX_RX_IFACE_* definesMike Belopuhov
2012-11-26get rid of some useless bitfields in oce_mbx and mbx_hdrMike Belopuhov
2012-11-23better way to set baudrate to 0; pointed out by gsoares@Mike Belopuhov
2012-11-21Don't forget to delete an rx refill timeout when bringingMike Belopuhov
an interface down (noticed by dlg@ in the other diff). While here, do some minor cleanup in the interrupt handler.
2012-11-20fix typoMike Belopuhov
2012-11-14allocate a mailbox payload dma memory upfront instead of per requestMike Belopuhov
2012-11-13do an OACTIVE/if_start dance only once per tx interruptMike Belopuhov