Commit Graph

33507 Commits

Author SHA1 Message Date
Patrick Kelsey
67d955aab4 Corrected misspelled versions of rendezvous.
The MFC will include a compat definition of smp_no_rendevous_barrier()
that calls smp_no_rendezvous_barrier().

Reviewed by:	gnn, kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D10313
2017-04-09 02:00:03 +00:00
Bruce Evans
eeab8fcc4b Quick fix for removal of the mouse cursor in vga direct graphics modes
(that is, in all supported 8, 15, 16 and 24-color modes).  Moving the
mouse cursor while holding down a button (giving cut marking) left a
trail of garbage from misremoved mouse cursors (usually colored
rectangles and not cursor shapes).  Cases with a button not held down
worked better and may even have worked.

No renderer support for removing (software) mouse cursors is needed
(and many renderers don't have any), since sc_remove_mouse_image()
marks for update the region containing the image and usually much
more.  The mouse cursor can be (partially) over as many as 4 character
cells, and removing it in only the 1-4 cells occupied by it would be
best for efficiency and for avoiding flicker.  However,
sc_remove_mouse_image() can only mark a single linear region and
usually marks a full row of cells and 1 more to be sure to cover the
4 cells.  It always does this, so using the special rendering method
just wastes even more time and gives even more flicker.  The special
methods will be removed soon.

The general method always works.  vga_pxlmouse_direct() appeared to
defer to it by returning immediately if !on.  However,
vga_pxlmouse_direct() actually did foot-shooting using a disguised
saveunder method.  Normal order near a mouse move is:
  (1) remove the mouse cursor in the renderer (optional)
  (2) remove the mouse cursor again and refresh the screen over the
      mouse cursor and much more from the vtb.  When the mouse has
      actually moved and a button is down, many attributes in this
      region are changed to be up to date with the new cut marking
  (3) draw the keyboard cursor again if it was clobbered by the update
  (4) draw the mouse cursor image in its new position.
The bug was to remove the mouse cursor again in step (4), before the
drawing it again in (4), using a saveunder that was valid in step (1)
at best.  The quick fix is to use the saveunder in step (1) and not
in step (4).  Using it in step (4) also used it before it was
initialized, initially and after  mode and screen switches.
2017-04-08 10:00:39 +00:00
Bruce Evans
e53fbbe661 Fix removal of the keyboard cursor image in text mode, especially
in the vga renderer.  Removal used stale attributes and didn't try to
merge with the current attribute for cut marking, so special rendering
of cut marking was lost in many cases.  The gfb renderer is too broken
to support special rendering of cut marking at all, so this change is
supposed to be just a style fix for it.  Remove all traces of the
saveunder method which was used to implement this bug.

Fix drawing of the cursor image in text mode, only in the vga
renderer.  This used a stale attribute from the frame buffer instead
of from the saveunder, but did merge with the current attribute for
cut marking so it caused less obvious bugs (subtle misrendering for
the character under the cursor).

The saveunder method may be good in simpler drivers, but in syscons
the 'under' is already saved in a better way in the vtb.  Just redraw
it from there, with visible complications for cut marking and
invisible complications for mouse cursors.  Almost all drawing
requests are passed a flag 'flip' which currently means to flip to
reverse video for characters in the cut marking region, but should
mean that the the characters are in the cut marking regions so should
be rendered specially, preferably using something better than reverse
video.  The gfb renderer always ignores this flag.  The vga renderer
ignored it for removal of the text cursor -- the saveunder gave the
stale rendering at the time the cursor was drawn.  Mouse cursors need
even more complicated methods.  They are handled by drawing them last
and removing them first.  Removing them usually redraws many other
characters with the correct cut marking (but transiently loses the
keyboard cursor, which is redrawn soon).  This tended to hide the
saveunder bug for forward motions of the keyboard cursor.  But slow
backward motions of the keyboard cursor always lost the cut marking,
and fast backwards motions lost in for about 4 in every 5 characters,
depending on races with the scrn_update() timeout handler.  This is
because the forward motions are usually into the region redrawn for
the mouse cursor, while backwards motions rarely are.

Text cursor drawing in the vga renderer used also used a
possibly-stale copy of the character and its attribute.  The vga
render has the "optimization" of sometimes reading characters from the
screen instead of from the vtb (this was not so good even in 1990 when
main memory was only a few times faster than video RAM).  Due to care
in update orders, the character is never stale, but its attribute
might be (just the cut marking part, again due to care in order).

gfb doesn't have the scp->scr pointer used for the "optimization", and
vga only uses this pointer for text mode.  So most cases have to
refresh from the vtb, and we can be sure that the ordering of vtb
updates and drawing is as required for this to work.
2017-04-08 08:24:25 +00:00
Sean Bruno
64c9d60dad bnxt(4): add support for WOL Magic.
Submitted by:	venkatkumar.duvvuru@broadcom.com
Differential Revision:	https://reviews.freebsd.org/D10124
2017-04-07 16:15:50 +00:00
Sean Bruno
60596476cf Move pause frame counter out of struct if_ctx and into struct if_softc_ctx_t
so that we can use it in iflib to detect pause frames.

The igb(4) driver definitely used to use this in its old timer function and
I see no reason to restrict it to that driver only.

Sponsored by:	Limelight Networks
2017-04-07 00:33:03 +00:00
David E. O'Brien
9b6f7440b5 Remove dead code.
The #ifdef __FreeBSD__ section within the OpenBSD tpm_attach() implementation
can never be active.
2017-04-06 22:21:49 +00:00
Ed Maste
4ab072262a remove archaic register keyword from ixgb and ex
Reviewed by:	sbruno
2017-04-06 17:16:41 +00:00
Conrad Meyer
7013b24d32 bwn(4): Fix trivial null dereference
Reported by:	PVS-Studio
Sponsored by:	Dell EMC Isilon
2017-04-06 17:08:59 +00:00
Sean Bruno
8d64ff50b3 tx and rx interrupts are not combined in bnxt(4) and should be handled
independantly.

Submitted by:	venkatkumar.duvvuru@broadcom.com>
Differential Revision:	https://reviews.freebsd.org/D10297
2017-04-06 16:22:54 +00:00
Navdeep Parhar
1c7d0de794 cxgbe/iw_cxgbe: Remove another bad cast. This should have been
included in r316571.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-04-06 16:19:19 +00:00
Navdeep Parhar
ba81aae287 cxgbe/iw_cxgbe: Replace a magic constant with something more readable
(and accurate).

T4 and later have an extra bit for page shift so the maximum page size
is 8TB (shift of 12 + 31) instead of 128MB (12 + 15).  This saves space
in the chip's PBL (physical buffer list) when registering very large
memory regions.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-04-06 14:50:15 +00:00
Navdeep Parhar
870b2660d4 cxgbe/iw_cxgbe: Remove bad cast that resulted in incorrect length for
memory regions larger than 4GB.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-04-06 13:58:59 +00:00
Hans Petter Selasky
c9dd0b48c9 Cleanup the bitmap_xxx() functions in the LinuxKPI:
- Move all bitmap related functions from bitops.h to bitmap.h, similar
  to what Linux does.

- Apply some minor code cleanup and simplifications to optimize the
  generated code when using static inline functions.

- Implement the following list of bitmap functions which are needed by
  drm-next and ibcore:
  - bitmap_find_next_zero_area_off()
  - bitmap_find_next_zero_area()
  - bitmap_or()
  - bitmap_and()
  - bitmap_xor()

- Add missing include directives to the qlnxe driver
  (davidcs@ has been notified)

MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-04-06 13:30:31 +00:00
Sean Bruno
ec2408187e Don't overrite vf->flags variable at the end of ixgbe(4) ixgbe_add_vf().
Found by PVS-Studio Static code analyzer.

PR:		217748
Submitted by:	razmyslov@viva64.com
MFC after:	1 week
2017-04-05 22:01:49 +00:00
Sean Bruno
6916de8666 Fix a double free in ixgbe_rxeof()
Submitted by:	rstone
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D10255
2017-04-05 19:52:49 +00:00
Sepherosa Ziehau
b3b75d9c84 hyperv/hn: Fixat RNDIS rxfilter after the successful RNDIS init.
Under certain conditions on certain versions of Hyper-V, the RNDIS
rxfilter is _not_ zero on the hypervisor side after the successful
RNDIS initialization, which breaks the assumption of any following
code (well, it breaks the RNDIS API contract actually).  Clear the
RNDIS rxfilter explicitly, drain packets sneaking through, and drain
the interrupt taskqueues scheduled due to the stealth packets.

Reported by:	dexuan@
MFC after:	3 days
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D10230
2017-04-05 08:25:22 +00:00
Sepherosa Ziehau
498ef762ec hyperv/storvsc: Fixup SRB status.
This unbreaks GEN2 Hyper-V cd support.

Submitted by:	Hongjiang Zhang <honzhan microsoft com>
Reviewed by:	dexuan@
MFC after:	3 days
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D10212
2017-04-05 08:15:47 +00:00
Sepherosa Ziehau
3f1b91c58d hyperv/kbd: Add support for synthetic keyboard.
Synthetic keyboard is the only supported keyboard on GEN2 Hyper-V.

Submitted by:	Hongjiang Zhang <honzhan microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D10196
2017-04-05 05:01:23 +00:00
Navdeep Parhar
3128b167ed cxgbe(4): Program the global RSS key once instead of once per ifnet.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-04-04 23:14:03 +00:00
Sean Bruno
fd70242dbc no_desc_avail is tracked in iflib now making this redundant.
Sponsored by:	Limelight Networks
2017-04-04 16:54:46 +00:00
David C Somayajulu
11e25f0da3 Add 25/40/100Gigabit Ethernet Driver version v1.3.0 for Cavium Inc's.
Qlogic 45000 Series Adapters

MFC after:2 weeks
2017-04-04 06:16:59 +00:00
Justin Hibbits
2fad65cfa0 Don't calltsec_receive_intr_locked() from the error interrupt handler.
The tsec_error_intr_locked() is called with the global lock owned (e.g.
the transmit and the receive lock are both owned).  We must not call
tsec_receive_intr_locked() while owning the transmit lock.  The normal
receive interrupt takes care that frames are received, this is none of
the business of the error interrupt.

Submitted by:	Sebastian Huber <sebastian.huber_AT_embedded-brains.de>
2017-04-04 02:55:55 +00:00
Justin Hibbits
2c0dbbcb8a Defragment the transmit mbuf chain only if necessary.
Use a method similar to the if_dwc driver.  Use a wmb() before the flags of the
first transmit buffer of a frame are written.

Group transmit/receive structure members for better cache efficiency.

Tested on P1020RDB.  TCP transmit throughput increases from 60MiB/s to
90MiB/s.

Submitted by:	Sebastian Huber <sebastian.huber_AT_embedded-brains.de>
2017-04-04 02:48:27 +00:00
Justin Hibbits
72b58db80f Fix mis-manual merge.
Timeout is now effectively a boolean rather than a time-remaining.  This was
missed in r316478, but included in the original patch (mis-merged with a manual
merge).
2017-04-04 02:37:41 +00:00
Justin Hibbits
b11512cc9c Fix set-but-not-used warnings
Submitted by:	Sebastian Huber <sebastian_DOT_huber_AT_embedded-brains_DOT_de>
2017-04-04 00:46:48 +00:00
Justin Hibbits
88011b597f Use a common tsec_mii_wait() function to busy wait for status changes.
The status indicators are not set immediatly after a command.  Discard
the first value.

Unlock the PHY mutex after a timeout in tsec_init_locked().

Tested on the P1020RDB.

Submitted by:	Sebastian Huber <sebastian_DOT_huber_AT_embedded-brains_DOT_de>
2017-04-04 00:43:09 +00:00
Sean Bruno
548b549ade Remove unsafe and non-functional DDB functions that I added long ago
for debugging.
2017-04-03 21:19:12 +00:00
Sean Bruno
c45420ccac Remove rx_processing_limit sysctl and now orphaned function em_set_sysctl_value
Sponsored by:	Limelight Networks
2017-04-03 21:17:57 +00:00
Andriy Voskoboinyk
c422c270b5 iwn: use correct mask for queue ids (0xf -> 0x1f). 2017-04-02 13:24:58 +00:00
Gavin Atkinson
3f4760c8e1 Add IDs for several missing Intel SMBus controllers.
Obtained from:	Data sheets, Linux defines, local hardware
MFH:		2 weeks
2017-04-02 11:36:25 +00:00
Alexander Motin
7e907868b3 Add IDs for Intel Cougar Point USB 2.0 controller.
MFC after:	1 week
2017-04-02 11:32:05 +00:00
Bruce Evans
3a98d83edb Reset the DAC to 6-bit mode before calling the BIOS to set the screen
mode.  This works around bugs in at least 2 Intel BIOSes for our
subsequent setting of the DAC back to 8-bit mode.  The bug caused dark
(mostly 1/4-intensity) colors for all except the first setting to a
VESA graphics mode (including for settings to the current mode).

Remove restoration (with less bits) of the palette in vesa_unload()
after resetting the DAC to 6-bit mode.  Depend on the BIOS to keep
the palette consistent with the DAC for the simpler reset case like
we do everywhere else in places that are actually important.

Setting the video mode should reset everything to defaults, although
we usually don't want that.  Even the buggy BIOSes set the DAC to the
default 6-bit mode, and set the palette to a default that matches the
DAC.  We don't undo the reset for most things, but we do undo it for
the DAC (more precisely, we change to an 8-bit DAC if possible, and
this is the only way that we set to an 8-bit DAC; it is accidental
that if the DAC was in 8-bit mode from a previous mode switch then
setting it to 8-bit mode is an undo).  The buggy BIOSes are confused
by our setting of the DAC to 8-bit mode in the "undo" case.  They
should multiply palette entries by 4 to match, but they actually leave
all palette entries except #2 (green) and #248-255 (unused) untouched.
Green is mysteriously scaled from 0x2a to 0x6a, and #248-255 are scaled
correctly.

Our support for the 8-bit DAC had almost no effect except to enable
bugs.  Syscons barely supports 16 colors, so it doesn't benefit much
from having a palette with 16 million colors instead of only 256K.
Applications can manage the palette using FBIO_{GET,SET}PALETTE, but
the palette managed by this is only used in the less interesting modes
(text and non-truecolor graphics modes up to 8 bits wide), and the
kernel loses the changes on any mode switch (including to another vt
in a different mode).
2017-04-02 08:39:32 +00:00
Justin Hibbits
6e1c39e9b2 Use the newly added mpc85xx_get_system_clock()
Simplify the platform clock acquisition by using the new helper function.
2017-04-01 22:35:03 +00:00
Zbigniew Bodek
19fbe8bdbc Rework BGX detection to support both new and old firmware
Improve existing BGX detection and adjust it to support both
new and older ThunderX firmwares. Match BGX FDT nodes by name
and reg. Match PHY instances by qlm-mode and name.
Tested on Firmware Version: 2016-09-30 09:12:11

Obtained from:	Semihalf
Differential Revision:	https://reviews.freebsd.org/D9863
2017-03-31 18:04:34 +00:00
Kevin Lo
0642eac437 Add support for ThingM blink(1) notification LED to uled(4). 2017-03-31 08:20:59 +00:00
David C Somayajulu
a7c62c116c Add support for optional Soft LRO
MFC after:5 days
2017-03-30 22:43:32 +00:00
Gavin Atkinson
255bba06cf ichsmb: switch device_probe() from a large case statement to a lookup table.
The case statement was getting unmanageably large, and I'm about to add
several more devices to it.

MFC after:	2 weeks
2017-03-29 23:13:04 +00:00
David C Somayajulu
9986117559 Upgrade firmware and other related files to version 5.4.64 2017-03-29 23:00:07 +00:00
Navdeep Parhar
a6bef5c275 cxgbe: Don't call t4_edc_err_read for errors not related to the EDCs.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-03-29 19:25:31 +00:00
Bruce Evans
912da69951 The switch to kernel terminal context needs to update more than the cursor
position.  Especially the screen size, and potentially everything except
the input state and attributes.  Do this by changing the cursor position
setting method to a general syncing method.

Use proper constructors instead of copying to create kernel terminal
contexts.  We really want clones and not new instances, but there is
no method for cloning and there is nothing in the active instance that
needs to be cloned exactly.

Add proper destructors for kernel terminal contexts.  I doubt that the
destructor code has every been reached, but if it was then it leaked the
memory of the clones.

Remove freeing of statically allocated memory for the non-kernel terminal
context for the same terminal as the kernel.  This is in the nearly
unreachable code.  This used to not happen because delicate context
swapping made the user context use the dynamic memory and kernel
context the static memory.  I didn't restore this swapping since it
would have been unnatural to have all kernel contexts except 1 dynamic.

The constructor for terminal context has bad layering for reasons
related to the bug.  It has to return static memory early before
malloc() works.  Callers also can't allocate memory until after the
first constructor selects an emulator and tells upper layers the size
of its context.  After that, the cloning hack required the cloning
code to allocate the memory, but for all other constructors it would
be better for the terminal layer to allocate and deallocate the
memory in all cases.

Zero the memory when allocating terminal contexts dynamically.
2017-03-29 14:46:26 +00:00
Navdeep Parhar
ce22fbcf83 cxgbe/iw_cxgbe: T6 has no limit on the amount of memory that can be
registered in one ib_reg_phys_mr.
2017-03-28 23:39:11 +00:00
Andriy Voskoboinyk
350086f249 iwn: remove unneeded cast. 2017-03-28 22:40:51 +00:00
Andriy Voskoboinyk
50e04f492d iwn: drop duplicate synchronization requests.
Rx descriptor / payload is already synchronized in iwn_notif_intr()
(before accessing desc->type / desc->qid fields).

Tested with Intel 6205, STA mode.
2017-03-28 22:31:48 +00:00
Gavin Atkinson
44f3702036 Remove #define PCIS_SERIALBUS_SMBUS_PROGIF, unused since r200091 2017-03-28 21:54:36 +00:00
Navdeep Parhar
74308c6816 cxgbe/iw_cxgbe: Defer the handling of error CQEs and RDMA_TERMINATE to
the thread that deals with socket state changes.  This eliminates
various bad races with the ithread.

Submitted by:	KrishnamRaju ErapaRaju @ Chelsio (original version)
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-03-27 22:00:03 +00:00
Michael Zhilin
bf73b5a299 [etherswitch] add support for Marvell 88E6065 ethernet switch incl. 802.1q
This patch brings 802.1q support for Marvell 88E606x ethernet switches.
Test is done on 88E6065 chip (Aterm WR1200).

Submitted by:	Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by:	mizhka
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D10144
2017-03-27 19:06:29 +00:00
Sean Bruno
935ca1ae7c Access *correct* ifp data structure when debug sysctl is invoked.
Submitted by:	Kevin Bowling <kevin.bowling@kev009.com>
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D10126
2017-03-27 15:08:02 +00:00
Sean Bruno
a066d74b07 Change the default rss_type to M_HASHTYPE_OPAQUE_HASH.
Submitted by:	Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9905
2017-03-27 14:55:23 +00:00
Andriy Voskoboinyk
7beeab43a1 iwm: fix build without IWM_DEBUG.
Reported by:	O. Hartmann <ohartmann@walstatt.org>
Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D10146
2017-03-27 07:02:27 +00:00
Navdeep Parhar
dee33b4bd5 cxgbe/iw_cxgbe: Remove unused code.
MFC after:	3 days
2017-03-27 03:11:51 +00:00