i40e: Update flow director error messages to reduce user confusion

This patch changes the wording of the flow director add/remove and
asynchronous failure messages to include fd_id to try and add some
way to track the operations on a given fd_id.  Its not perfect, but
its better than what we had as PCTYPE can apply to several different
filter requests.

This patch also removes a redundant message when filter
addition fails due to full condition.

Change-ID: Icf58b0603d4f162d9fc542f11a74866a907049f2
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e: Some FD message fixes

Change the message that gets printed when adding/deleting a filter to
the SB, so that user can tell if a filter was added or deleted.
Print filter add failures only in case of SB filters. For ATR the
information is not useful to the user and hence suppress it unless in
higher debug mode.

Change-ID: I78d7a7a6ecfa82a38a582b0d7b4da038355e3735
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e: ATR policy change to flush the table to clean stale ATR rules

Instead of disabling ATR when we get a programming error, we now
will wait it out to see if some room gets created by ATR rule deletion.
If we still have too many errors and ATR filter count did not change
much, its time to flush and replay. We no more auto-disable ATR when
we have errors in programming.
The disabling of ATR when we get programming error was buggy and
was still adding new rules and causing continuous errors. With this
policy change we flush instead when we see too many errors.
ATR is still disabled if we add a SB rule for TCP/IPv4 flow type,
more logic is added to re-enable it once all SB TCP/IPv4 rules are gone.

Change-ID: I77edcbeab9500c72a7e0bd7b5c5b113ced133a9c
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e: Add a FD flush counter to ethtool

This helps know how many times the interface had to flush and replay FD
filter table, which gives an indication on how often we are getting FD
table full situation.

Also check on certain pf states before proceeding to add or delete
filters since we can't add or delete filters if we are in those states.

Change-ID: I97f5bbbea7146833ea61af0e08ea794fccba1780
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e: Enable l2tsel bit for VLAN tag control

Enable the l2tsel bit on Rx queue contexts that are assigned to VFs so
that the VF can get the stripped VLAN tag.

Change-ID: I7d9bc56238a9ea9baf5e8a97e69b9e27ebb9d169
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Ashish Shah <ashish.n.shah@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e: set num_queue_pairs to num configured by VF

Change vsi->num_queue_pairs to equal the number that are configured
by the VF. This, in turn, limits the number of queues that are
enable/disabled. This fixes the mismatched case for when a VF configures
fewer queues than is allocated to it by the PF.

Change other sections to use alloc_queue_pairs as warranted.

Change-ID: I0de1b55c9084e7be6acc818da8569f12128a82c2
Signed-off-by: Ashish Shah <ashish.n.shah@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e: Add checks and message for Qualified Module info

This patch adds a check during handle_link_event for unqualified
module when link is down and there is a module plugged.  If found,
print a message.

Change-ID: Ibd8666d77d3044c2a3dd4d762d3ae9ac6e18e943
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e/i40evf: add max buf len to aq debug print helper

There is at least one case in the Firmware API where the response to a
command changes the buffer size field in the AQ descriptor to a larger
number than what the request's buffer size started as.  This is in addition
to setting an error flag and is in order to tell the requester how much
larger a buffer is required for the answer.  We need to be sure not to
use that number when dumping the contents of the data buffer because it
can send us into the weeds and generate an invalid pointer exception.

This patch adds a max buffer size parameter to the print helper to be
sure the code knows when to stop.

Change-ID: Ib84f7ed72140fe9d600086d8f2002fc5d8753092
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e: quiet complaints when removing default MAC VLAN filter and make set_mac reversible

Older firmware has an incorrect MAC VLAN filter that needs to be replaced
at startup, and now newer firmware doesn't have this problem.  With this
change we no longer complain if the remove fails, and we only add the
new filter if the remove succeeded.

Setting a new LAA worked the first time, but didn't work well in successive
operations, including returning to the HW default address.  This simplifies
the code that was trying to be too smart.

Lastly, this pulls the hardware default mac address out into separate
handling code and keeps the broadcast filtering from getting munged.

Change-ID: I1f54b002def04ffef2546febb9a4044385452f85
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e/i40evf: Ignore a driver perceived Tx hang if the number of desc pending < 4

We are seeing situations where the driver sees a hang with less than 4
desc pending, if the driver chooses to ignore it the queue progresses
forward and the stack never experiences a real hang.
With this patch we will log a stat when this situation happens
"tx_sluggish" will increment and we can see some more details
at a higher debug level. Other than that we will ignore this
particular case of Tx hang.

Change-ID: I7d1d1666d990e2b12f4f6bed0d17d22e1b6410d5
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e/i40evf: Bump i40e & i40evf version

Bump versions for i40e to 1.0.4 and i40evf to 1.0.1.

Change-ID: I960c04da2c91bdf1d02f8e5011e68c34a634122d
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-By: Jim Young <jamesx.m.young@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
net: Update sk_buff flag bit availability comment.

We lost one when xmit_more was added.

Signed-off-by: David S. Miller <davem@davemloft.net>
r8152: replace strncpy with strlcpy

Replace the strncpy with strlcpy, and use sizeof to determine the
length.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
bnx2x: Fix static checker warning regarding `txdata_ptr'

Incorrect checking of array instead of array contents in panic_dump
flow - results of commit e261199872a2 ("bnx2x: Safe bnx2x_panic_dump()").

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tcp: syncookies: mark cookie_secret read_mostly

only written once.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
ethernet: arc: remove use of 'struct platform_device'

This is a preparation of an api changes for the emac_main.c module.
The involved functions are arc_emac_probe and arc_emac_remove.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
ethernet: arc: mdio changes for future SoC glue layer devtree support

This is an api changes for the emac_mdio.c module.
It will be required later when arc_emac_probe/arc_emac_remove
will no longer use 'struct platform_device'.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
ethernet: arc: Add support for specific SoC layer device tree bindings

Some platforms have special bank registers which might be used to
select the correct clock or the right mode for Media Indepent Interface
controllers. Sometimes, it is also required to activate vcc regulators
in the right order to supply the ethernet controller at the right time.
This patch is an architecture refactoring of the arc-emac device driver.
It adds a new software design which allows to add specific platform
glue layer. Each platform has now its own module which performs custom
initialization and remove for the target and then calls to the
core driver.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
f_ncm: Don't use netdev_start_xmit().

Unfortunately, the USB gadget layer has this weird things where NULL
skbs are passed into ops->ndo_start_xmit() in order to trigger the
dev->wrap() calls to build packets.

This is completely outside of the allowable range of sane arguments
for the ndo_start_xmit method.  All invocations of ndo_start_xmit()
should be with non-NULL SKB arguments.

Put back the direct call, but with a comment explaining how this
is not acceptable in the long term.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tulip: dmfe: Fix global namespace pollution of phy accessors.

The dmfe driver has "phy_read()" and "phy_write()" functions, which
we need to rename because the generic phy layer is about to export
generic interfaces with the same name.

Signed-off-by: David S. Miller <davem@davemloft.net>