1
0
Fork 0
Commit Graph

56 Commits (48b775ca0f932c8f9e168d7a07417c8c2b830f5a)

Author SHA1 Message Date
Greg Kroah-Hartman 98a95b9cc9 staging: octeon: remove redundant license text
Now that the SPDX tag is in all drivers/staging/octeon/ files, that
identifies the license in a specific and legally-defined manner.  So the
extra GPL text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15 16:03:45 +01:00
Greg Kroah-Hartman 30bdc499d7 staging: octeon: add SPDX identifiers.
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the staging octeon driver to have a proper SPDX identifier, based
on the license text in the file itself.  The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15 16:03:45 +01:00
yuan linyu de77b966ce net: introduce __skb_put_[zero, data, u8]
follow Johannes Berg, semantic patch file as below,
@@
identifier p, p2;
expression len;
expression skb;
type t, t2;
@@
(
-p = __skb_put(skb, len);
+p = __skb_put_zero(skb, len);
|
-p = (t)__skb_put(skb, len);
+p = __skb_put_zero(skb, len);
)
... when != p
(
p2 = (t2)p;
-memset(p2, 0, len);
|
-memset(p, 0, len);
)

@@
identifier p;
expression len;
expression skb;
type t;
@@
(
-t p = __skb_put(skb, len);
+t p = __skb_put_zero(skb, len);
)
... when != p
(
-memset(p, 0, len);
)

@@
type t, t2;
identifier p, p2;
expression skb;
@@
t *p;
...
(
-p = __skb_put(skb, sizeof(t));
+p = __skb_put_zero(skb, sizeof(t));
|
-p = (t *)__skb_put(skb, sizeof(t));
+p = __skb_put_zero(skb, sizeof(t));
)
... when != p
(
p2 = (t2)p;
-memset(p2, 0, sizeof(*p));
|
-memset(p, 0, sizeof(*p));
)

@@
expression skb, len;
@@
-memset(__skb_put(skb, len), 0, len);
+__skb_put_zero(skb, len);

@@
expression skb, len, data;
@@
-memcpy(__skb_put(skb, len), data, len);
+__skb_put_data(skb, data, len);

@@
expression SKB, C, S;
typedef u8;
identifier fn = {__skb_put};
fresh identifier fn2 = fn ## "_u8";
@@
- *(u8 *)fn(SKB, S) = C;
+ fn2(SKB, C);

Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-20 13:30:14 -04:00
Linus Torvalds caa5942897 staging/iio driver patches for 4.11-rc1
Here is the big staging and iio driver patchsets for 4.11-rc1.
 
 We almost broke even this time around, with only a few thousand lines
 added overall, as we removed the old and obsolete i4l code, but added
 some new drivers for the RPi platform, as well as adding some new IIO
 drivers.
 
 All of these have been in linux-next for a while with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWK2j/w8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymZ1ACdFR4o6xYrWEizmao4a/u+lUZE1aIAnRmcGcIc
 J+leO1n9bE5iadQvKYUW
 =sKVA
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging/iio driver updates from Greg KH:
 "Here is the big staging and iio driver patchsets for 4.11-rc1.

  We almost broke even this time around, with only a few thousand lines
  added overall, as we removed the old and obsolete i4l code, but added
  some new drivers for the RPi platform, as well as adding some new IIO
  drivers.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'staging-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (669 commits)
  Staging: vc04_services: Fix the "space prohibited" code style errors
  Staging: vc04_services: Fix the "wrong indent" code style errors
  staging: octeon: Use net_device_stats from struct net_device
  Staging: rtl8192u: ieee80211: ieee80211.h - style fix
  Staging: rtl8192u: ieee80211: ieee80211_tx.c - style fix
  Staging: rtl8192u: ieee80211: rtl819x_BAProc.c - style fix
  Staging: rtl8192u: ieee80211: ieee80211_module.c - style fix
  Staging: rtl8192u: ieee80211: rtl819x_TSProc.c - style fix
  Staging: rtl8192u: r8192U.h - style fix
  Staging: rtl8192u: r8192U_core.c - style fix
  Staging: rtl8192u: r819xU_cmdpkt.c - style fix
  staging: rtl8192u: blank lines aren't necessary before a close brace '}'
  staging: rtl8192u: Adding space after enum and struct definition
  staging: rtl8192u: Adding space after struct definition
  Staging: ks7010: Add required and preferred spaces around operators
  Staging: ks7010: ks*: Remove redundant blank lines
  Staging: ks7010: ks*: Add missing blank lines after declarations
  staging: visorbus, replace init_timer with setup_timer
  staging: vt6656: rxtx.c Removed multiple dereferencing
  staging: vt6656: Alignment match open parenthesis
  ...
2017-02-22 12:14:01 -08:00
Tobias Klauser 66812da3a6 staging: octeon: Use net_device_stats from struct net_device
Instead of using a private copy of struct net_device_stats in
struct octeon_ethernet, use stats from struct net_device. Also remove
the now unnecessary .ndo_get_stats function.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-16 10:44:58 -08:00
Willem de Bruijn a5135bcfba net-tc: convert tc_verd to integer bitfields
Extract the remaining two fields from tc_verd and remove the __u16
completely. TC_AT and TC_FROM are converted to equivalent two-bit
integer fields tc_at and tc_from. Where possible, use existing
helper skb_at_tc_ingress when reading tc_at. Introduce helper
skb_reset_tc to clear fields.

Not documenting tc_from and tc_at, because they will be replaced
with single bit fields in follow-on patches.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-08 20:58:52 -05:00
Laura Garcia Liebana ac05a587c8 staging: octeon: Fix alignment with open parenthesis
Alignment should match open parenthesis. Checkpatch detected these
issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Laura Garcia Liebana c2598d468f staging: octeon: Use type int instead of int32_t
Prefer the use of type int instead of int32_t. Checkpatch detected these
issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Laura Garcia Liebana 32680d9319 staging: octeon: Fix braces in condition statement
Braces should be used on all arms of the if statement. Checkpatch
detected this issue.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Laura Garcia Liebana 3f4a565a91 staging: octeon: Remove multiple blank lines
Avoid the use of multiple blank lines. Checkpatch detected these issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Laura Garcia Liebana 7ba18e852d staging: octeon: Remove blank lines after open brace
Blank lines are not necessary after an open brace. Checkpatch detected
these issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Laura Garcia Liebana b4ede7922e staging: octeon: Fix block comments
Remove commented source code. Checkpatch detected these issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Laura Garcia Liebana e8a4e572c4 staging: octeon: Remove comparison to NULL
Comparison to NULL should be avoided in conditions. Chackpatch detected
these issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Laura Garcia Liebana 7636941eb3 staging: octeon: Move logical operators on the correct line
Logical continuations should be on the previous line. Checkpatch detected this issue.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Janani Ravichandran beb6e57b50 staging: octeon: Add spaces around operators
Add spaces around operators for better readability. Change suggested by
checkpatch.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:40:02 -08:00
Luuk Paulussen 7c0b6bce6e staging: octeon: Fix logic for waking octeon ethernet tx queue.
Only wake tx queue when driver queue is back within bounds.

The logic here was just reenabling the queue when any buffers had been
freed.  the queue was stopped whenever the length exceeded 1000
(MAX_OUT_QUEUE_DEPTH), but then was essentially immediately started again.
On a congested link, the queue length would just keep increasing up to
around 8000 (for average size packets), at which point the hardware would
start refusing the packets and they would begin to be dropped.
This prevented the qdisc layer from effectively managing and prioritising
packets, as essentially all packets were being allowed into the driver
queue and then were being dropped by the hardware.

This change only restarts the queue if the length is less than 1000
(MAX_OUT_QUEUE_DEPTH).

Reviewed-by: Kyeong Yoo <kyeong.yoo@alliedtelesis.co.nz>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Richard Laing <richard.laing@alliedtelesis.co.nz>
Signed-off-by: Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:35:16 -08:00
Hamish Martin 5a89a875c9 staging: octeon-ethernet: fix TCP/UDP checksum calc
If the network portion of a frame is preceded by more than 14 bytes of
data, the checksum calculated in the HW is done over the wrong data and
is put in the wrong place.
In our use case an Octeon ethernet controller is connected to a Broadcom
switch chip. Extra data is included in the frame prior to egressing the
Octeon ethernet (i.e. 4 bytes of an 802.1Q tag, 4 bytes of a proprietary
BCM tag later stripped by the switch chip). This extra data causes the
checksum calculation to be incorrect.
The fix in this patch is to make use of the network header offset of the
skb. This enables the checksum to be calculated correctly.
This has been tested in both the configuration with the switch chip in
the egress path (as described above) and in a simple connection direct
to the wire.

Reviewed-by: Richard Laing <richard.laing@alliedtelesis.co.nz>
Reviewed-by: Tim Beale <tim.beale@alliedtelesis.co.nz>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:35:16 -08:00
Muhammad Falak R Wani ffca44fb93 staging: octeon: Remove explicit NULL comparison
Remove the explicit NULL comparison and rewrite in a compact form.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:28:52 -07:00
Aybuke Ozdemir ec2c398eff Staging: octeon: Use preferred kernel type
This patch "uint*_t" type instead of "u*" type was used.
checkpatch.pl issue in octeon driver.

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:36:00 +02:00
Linus Torvalds 807249d3ad Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle:
 "This is the main pull request for 4.3 for MIPS.  Here's the summary:

  Three fixes that didn't make 4.2-stable:

   - a -Os build might compile the kernel using the MIPS16 instruction
     set but the R2 optimized inline functions in <uapi/asm/swab.h> are
     implemented using 32-bit wide instructions which is invalid.

   - a build error in pgtable-bits.h for a particular kernel
     configuration.

   - accessing registers of the CM GCR might have been compiled to use
     64 bit accesses but these registers are onl 32 bit wide.

  And also a few new bits:

   - move the ATH79 GPIO driver to drivers/gpio

   - the definition of IRQCHIP_DECLARE has moved to linux/irqchip.h,
     change ATH79 accordingly.

   - fix definition of pgprot_writecombine

   - add an implementation of dma_map_ops.mmap

   - fix alignment of quiet build output for vmlinuz link

   - BCM47xx: Use kmemdup rather than duplicating its implementation

   - Netlogic: Fix 0x0x prefixes of constants.

   - merge Bjorn Helgaas' series to remove most of the weak keywords
     from function declarations.

   - CP0 and CP1 registers are best considered treated as unsigned
     values to avoid large values from becoming negative values.

   - improve support for the MIPS GIC timer.

   - enable common clock framework for Malta and SEAD3.

   - a number of improvments and fixes to dump_tlb().

   - document the MIPS TLB dump functionality in Magic SysRq.

   - Cavium Octeon CN68XX improvments.

   - NetLogic improvments.

   - irq: Use access helper irq_data_get_affinity_mask.

   - handle MSA unaligned accesses.

   - a number of R6-related math-emu fixes.

   - support for I6400.

   - improvments to MSA support.

   - add uprobes support.

   - move from deprecated __initcall to arch_initcall.

   - remove finish_arch_switch().

   - IRQ cleanups by Thomas Gleixner.

   - migrate to new 'set-state' interface.

   - random small cleanups"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (148 commits)
  MIPS: UAPI: Fix unrecognized opcode WSBH/DSBH/DSHD when using MIPS16.
  MIPS: Fix alignment of quiet build output for vmlinuz link
  MIPS: math-emu: Remove unused handle_dsemul function declaration
  MIPS: math-emu: Add support for the MIPS R6 MAX{, A} FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 MIN{, A} FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 CLASS FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 RINT FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 MSUBF FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 MADDF FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 SELNEZ FPU instruction
  MIPS: math-emu: Add support for the MIPS R6 SELEQZ FPU instruction
  MIPS: math-emu: Add support for the CMP.condn.fmt R6 instruction
  MIPS: inst.h: Add new MIPS R6 FPU opcodes
  MIPS: Octeon: Fix management port MII address on Kontron S1901
  MIPS: BCM47xx: Use kmemdup rather than duplicating its implementation
  STAGING: Octeon: Use common helpers for determining interface and port
  MIPS: Octeon: Support interfaces 4 and 5
  MIPS: Octeon: Set up 1:1 mapping between CN68XX PKO queues and ports
  MIPS: Octeon: Initialize CN68XX PKO
  STAGING: Octeon: Support CN68XX style WQE
  ...
2015-09-03 16:55:55 -07:00
Janne Huttunen f8023da8ae STAGING: Octeon: Support CN68XX style WQE
CN68XX has a bit different WQE structure. This patch provides the new
definitions and converts the code to use the proper variant based on
the actual model.

Signed-off-by: Janne Huttunen <janne.huttunen@nokia.com>
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Acked-by: David Daney <david.daney@cavium.com>
Cc: David Daney <ddaney.cavm@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: Janne Huttunen <janne.huttunen@nokia.com>
Cc: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Patchwork: https://patchwork.linux-mips.org/patch/10973/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2015-09-03 12:08:10 +02:00
Jacob Kiefer 861e82d5b5 staging: style fix for octeon/ethernet-tx.c
Broke line with greater than 80 characters into two lines and
improved logical operator readability in hardware checksum if statement.

Signed-off-by: Jacob Kiefer <jtk54@cornell.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 20:18:56 -07:00
Aaro Koskinen 67620987c5 staging: octeon-ethernet: update boilerplate comments
Update boilerplate comments to be more terse by removing
redundant information.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30 17:06:09 +02:00
Aaro Koskinen c93b0e75a8 staging: octeon-ethernet: eliminate DONT_WRITEBACK
This feature is not used so eliminate it.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30 17:06:09 +02:00
Aaro Koskinen 6646baf704 staging: octeon-ethernet: eliminate USE_HW_TCPUDP_CHECKSUM define
HW checksum is always enabled, so delete a redundant define.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30 17:03:37 +02:00
Paul Martin 97b290b563 MIPS: Octeon: Fix to IP checksum offloading in Little Endian
When hardware checksum generation is switched on the checksum
generation was only being signalled to the hardware correctly
in Big Endian mode.

Signed-off-by: Paul Martin <paul.martin@codethink.co.uk>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9634/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2015-04-01 17:22:15 +02:00
Paul Martin 8a5cc923af MIPS: Octeon: Set up ethernet hardware for little endian
Signed-off-by: Paul Martin <paul.martin@codethink.co.uk>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9635/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2015-04-01 17:22:14 +02:00
Roberto Medina b9fc9cf29e Staging: octeon: ethernet-tx: fixed coding style warnings, missing blank lines
Fixed coding style warnings due to missing blank lines.
Dubious additions removed.

Signed-off-by: Roberto Medina <robertoxmed@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:27 +08:00
Linus Torvalds cd6362befe Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller:
 "Here is my initial pull request for the networking subsystem during
  this merge window:

   1) Support for ESN in AH (RFC 4302) from Fan Du.

   2) Add full kernel doc for ethtool command structures, from Ben
      Hutchings.

   3) Add BCM7xxx PHY driver, from Florian Fainelli.

   4) Export computed TCP rate information in netlink socket dumps, from
      Eric Dumazet.

   5) Allow IPSEC SA to be dumped partially using a filter, from Nicolas
      Dichtel.

   6) Convert many drivers to pci_enable_msix_range(), from Alexander
      Gordeev.

   7) Record SKB timestamps more efficiently, from Eric Dumazet.

   8) Switch to microsecond resolution for TCP round trip times, also
      from Eric Dumazet.

   9) Clean up and fix 6lowpan fragmentation handling by making use of
      the existing inet_frag api for it's implementation.

  10) Add TX grant mapping to xen-netback driver, from Zoltan Kiss.

  11) Auto size SKB lengths when composing netlink messages based upon
      past message sizes used, from Eric Dumazet.

  12) qdisc dumps can take a long time, add a cond_resched(), From Eric
      Dumazet.

  13) Sanitize netpoll core and drivers wrt.  SKB handling semantics.
      Get rid of never-used-in-tree netpoll RX handling.  From Eric W
      Biederman.

  14) Support inter-address-family and namespace changing in VTI tunnel
      driver(s).  From Steffen Klassert.

  15) Add Altera TSE driver, from Vince Bridgers.

  16) Optimizing csum_replace2() so that it doesn't adjust the checksum
      by checksumming the entire header, from Eric Dumazet.

  17) Expand BPF internal implementation for faster interpreting, more
      direct translations into JIT'd code, and much cleaner uses of BPF
      filtering in non-socket ocntexts.  From Daniel Borkmann and Alexei
      Starovoitov"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1976 commits)
  netpoll: Use skb_irq_freeable to make zap_completion_queue safe.
  net: Add a test to see if a skb is freeable in irq context
  qlcnic: Fix build failure due to undefined reference to `vxlan_get_rx_port'
  net: ptp: move PTP classifier in its own file
  net: sxgbe: make "core_ops" static
  net: sxgbe: fix logical vs bitwise operation
  net: sxgbe: sxgbe_mdio_register() frees the bus
  Call efx_set_channels() before efx->type->dimension_resources()
  xen-netback: disable rogue vif in kthread context
  net/mlx4: Set proper build dependancy with vxlan
  be2net: fix build dependency on VxLAN
  mac802154: make csma/cca parameters per-wpan
  mac802154: allow only one WPAN to be up at any given time
  net: filter: minor: fix kdoc in __sk_run_filter
  netlink: don't compare the nul-termination in nla_strcmp
  can: c_can: Avoid led toggling for every packet.
  can: c_can: Simplify TX interrupt cleanup
  can: c_can: Store dlc private
  can: c_can: Reduce register access
  can: c_can: Make the code readable
  ...
2014-04-02 20:53:45 -07:00
Eric W. Biederman 8b6da5fb96 staging/octeon-ethernet: Call dev_kfree/consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_kfree_skb_any in cvm_oct_xmit_pow which
can be called in hard irq and other contexts, on the code paths that
drop packets.

Replace dev_kfree_skb with dev_consume_skb_any in cvm_oct_xmit_pow which
can be called in hard irq and other contexts, on the code path where
the packet is transmitted successfully.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:19:24 -07:00
Aaro Koskinen 54396b6b03 staging: octeon-ethernet: make cvm_oct_free_tx_skbs static
Make cvm_oct_free_tx_skbs static to eliminate a sparse warning.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04 16:42:28 -08:00
Paul Gortmaker 885a947e5b staging: delete non-required instances of include <linux/init.h>
None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 10:08:14 -08:00
Ebru Akagunduz a012649d6b Staging: octeon: fix line over 80 characters in ethernet-tx.c
Fix checkpatch.pl issues with line over 80
characters in ethernet-tx.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 13:52:01 -07:00
Ebru Akagunduz 6b478c2c38 Staging: octeon: fix quoted string split across lines in ethernet-tx.c
Fix checkpatch.pl issues with quoted string split
across lines in ethernet-tx.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 13:52:00 -07:00
Masanari Iida 811a751984 staging: octeon: Fix typo in staging/octeon
Correct spelling typo in staging/octeon

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25 16:25:40 -07:00
Linus Torvalds fb09bafda6 Staging tree pull request for 3.5-rc1
Here is the big staging tree pull request for the 3.5-rc1 merge window.
 
 Loads of changes here, and we just narrowly added more lines than we
 added:
  622 files changed, 28356 insertions(+), 26059 deletions(-)
 
 But, good news is that there is a number of subsystems that moved out of
 the staging tree, to their respective "real" portions of the kernel.
 
 Code that moved out was:
 	- iio core code
 	- mei driver
 	- vme core and bridge drivers
 
 There was one broken network driver that moved into staging as a step
 before it is removed from the tree (pc300), and there was a few new
 drivers added to the tree:
 	- new iio drivers
 	- gdm72xx wimax USB driver
 	- ipack subsystem and 2 drivers
 
 All of the movements around have acks from the various subsystem
 maintainers, and all of this has been in the linux-next tree for a
 while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iEYEABECAAYFAk+7q8MACgkQMUfUDdst+ymjogCguo8fANFVlPWeZGeoBTL+aQfQ
 yTkAoLE0codmh+2SvhulYgyU1Wh6ZDK2
 =nJ2F
 -----END PGP SIGNATURE-----

Merge tag 'staging-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging tree changes from Greg Kroah-Hartman:
 "Here is the big staging tree pull request for the 3.5-rc1 merge
  window.

  Loads of changes here, and we just narrowly added more lines than we
  added:
   622 files changed, 28356 insertions(+), 26059 deletions(-)

  But, good news is that there is a number of subsystems that moved out
  of the staging tree, to their respective "real" portions of the
  kernel.

  Code that moved out was:
	- iio core code
	- mei driver
	- vme core and bridge drivers

  There was one broken network driver that moved into staging as a step
  before it is removed from the tree (pc300), and there was a few new
  drivers added to the tree:
	- new iio drivers
	- gdm72xx wimax USB driver
	- ipack subsystem and 2 drivers

  All of the movements around have acks from the various subsystem
  maintainers, and all of this has been in the linux-next tree for a
  while.

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

Fixed up various trivial conflicts, along with a non-trivial one found
in -next and pointed out by Olof Johanssen: a clean - but incorrect -
merge of the arch/arm/boot/dts/at91sam9g20.dtsi file.  Fix up manually
as per Stephen Rothwell.

* tag 'staging-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (536 commits)
  Staging: bcm: Remove two unused variables from Adapter.h
  Staging: bcm: Removes the volatile type definition from Adapter.h
  Staging: bcm: Rename all "INT" to "int" in Adapter.h
  Staging: bcm: Fix warning: __packed vs. __attribute__((packed)) in Adapter.h
  Staging: bcm: Correctly format all comments in Adapter.h
  Staging: bcm: Fix all whitespace issues in Adapter.h
  Staging: bcm: Properly format braces in Adapter.h
  Staging: ipack/bridges/tpci200: remove unneeded casts
  Staging: ipack/bridges/tpci200: remove TPCI200_SHORTNAME constant
  Staging: ipack: remove board_name and bus_name fields from struct ipack_device
  Staging: ipack: improve the register of a bus and a device in the bus.
  staging: comedi: cleanup all the comedi_driver 'detach' functions
  staging: comedi: remove all 'default N' in Kconfig
  staging: line6/config.h: Delete unused header
  staging: gdm72xx depends on NET
  staging: gdm72xx: Set up parent link in sysfs for gdm72xx devices
  staging: drm/omap: initial dmabuf/prime import support
  staging: drm/omap: dmabuf/prime mmap support
  pstore/ram: Add ECC support
  pstore/ram: Switch to persistent_ram routines
  ...
2012-05-22 16:34:21 -07:00
David S. Miller 0d6c4a2e46 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/net/ethernet/intel/e1000e/param.c
	drivers/net/wireless/iwlwifi/iwl-agn-rx.c
	drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
	drivers/net/wireless/iwlwifi/iwl-trans.h

Resolved the iwlwifi conflict with mainline using 3-way diff posted
by John Linville and Stephen Rothwell.  In 'net' we added a bug
fix to make iwlwifi report a more accurate skb->truesize but this
conflicted with RX path changes that happened meanwhile in net-next.

In e1000e a conflict arose in the validation code for settings of
adapter->itr.  'net-next' had more sophisticated logic so that
logic was used.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-07 23:35:40 -04:00
Alexander Duyck ec47ea8247 skb: Add inline helper for getting the skb end offset from head
With the recent changes for how we compute the skb truesize it occurs to me
we are probably going to have a lot of calls to skb_end_pointer -
skb->head.  Instead of running all over the place doing that it would make
more sense to just make it a separate inline skb_end_offset(skb) that way
we can return the correct value without having gcc having to do all the
optimization to cancel out skb->head - skb->head.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-06 13:13:19 -04:00
Greg Kroah-Hartman d210267741 Merge 3.4-rc5 into staging-next
This resolves the conflict in:
	drivers/staging/vt6656/ioctl.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-02 11:48:07 -07:00
Imre Kaloz dc890df0a7 staging: octeon-ethernet: fix build errors by including interrupt.h
This patch fixes the following build failures:

drivers/staging/octeon/ethernet.c: In function 'cvm_oct_cleanup_module':
drivers/staging/octeon/ethernet.c:799:2: error: implicit declaration of function 'free_irq'
drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_no_more_work':
drivers/staging/octeon/ethernet-rx.c:119:3: error: implicit declaration of function 'enable_irq'
drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_do_interrupt':
drivers/staging/octeon/ethernet-rx.c:136:2: error: implicit declaration of function 'disable_irq_nosync'
drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_rx_initialize':
drivers/staging/octeon/ethernet-rx.c:532:2: error: implicit declaration of function 'request_irq'
drivers/staging/octeon/ethernet-tx.c: In function 'cvm_oct_tx_initialize':
drivers/staging/octeon/ethernet-tx.c:712:2: error: implicit declaration of function 'request_irq'
drivers/staging/octeon/ethernet-tx.c: In function 'cvm_oct_tx_shutdown':
drivers/staging/octeon/ethernet-tx.c:723:2: error: implicit declaration of function 'free_irq'

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Acked-by: David Daney <david.daney@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24 11:57:37 -07:00
Justin P. Mattock 215c47c931 staging:octeon Fix typos in staging:octeon
The below patch is a resend to fix some typos and comments that
I have found while reading.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Acked-by: David Daney <david.daney@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 09:47:05 -07:00
David Daney af866496c7 MIPS: Octeon: Move some Ethernet support files out of staging.
Signed-off-by: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: netdev@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Patchwork: https://patchwork.linux-mips.org/patch/2942/
Patchwork: https://patchwork.linux-mips.org/patch/3012/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2011-12-07 22:03:28 +00:00
David Daney 8d804d4fdf STAGING: octeon-ethernet: Fix compile error caused by skb_frag_struct change
Evidently the definition of struct skb_frag_struct has changed, so we
need to change to match it.

Signed-off-by: David Daney <david.daney@cavium.com>
To: netdev@vger.kernel.org
To: gregkh@suse.de
To: devel@driverdev.osuosl.org
Patchwork: https://patchwork.linux-mips.org/patch/2909/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2011-11-09 17:14:27 +00:00
Arun Sharma 60063497a9 atomic: use <linux/atomic.h>
This allows us to move duplicated code in <asm/atomic.h>
(atomic_inc_not_zero() for now) to <linux/atomic.h>

Signed-off-by: Arun Sharma <asharma@fb.com>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-26 16:49:47 -07:00
Christian Dietrich 7a2eaf9358 staging: octeon: use printk_ratelimited instead of printk_ratelimit
As per printk_ratelimit comment, it should not be used

Signed-off-by: Christian Dietrich <christian.dietrich@informatik.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:29:19 -07:00
David Daney ec977c5b47 Staging: Octeon: Reformat a bunch of comments.
Many of the comments didn't follow kerneldoc guidlines.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
To: netdev@vger.kernel.org
To: gregkh@suse.de
Patchwork: http://patchwork.linux-mips.org/patch/971/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27 12:53:30 +01:00
David Daney 4898c56010 Staging: Octeon: Free transmit SKBs in a timely manner
If we wait for the once-per-second cleanup to free transmit SKBs,
sockets with small transmit buffer sizes might spend most of their
time blocked waiting for the cleanup.

Normally we do a cleanup for each transmitted packet.  We add a
watchdog type timer so that we also schedule a timeout for 150uS after
a packet is transmitted.  The watchdog is reset for each transmitted
packet, so for high packet rates, it never expires.  At these high
rates, the cleanups are done for each packet so the extra watchdog
initiated cleanups are neither needed nor triggered.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
To: netdev@vger.kernel.org
To: gregkh@suse.de
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Patchwork: http://patchwork.linux-mips.org/patch/968/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

This version has spelling and comment changes based on feedback from
Eric Dumazet.
2010-02-27 12:53:30 +01:00
David Daney 081f6749ae Staging: Octeon Ethernet: Use constants from in.h
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
To: gregkh@suse.de
Patchwork: http://patchwork.linux-mips.org/patch/837/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27 12:53:09 +01:00
David Daney 924cc2680f Staging: Octeon Ethernet: Enable scatter-gather.
Octeon ethernet hardware can handle NETIF_F_SG, so we enable it.

A gather list of up to six fragments will fit in the SKB's CB
structure, so no extra memory is required.  If a SKB has more than six
fragments, we must linearize it.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
To: gregkh@suse.de
Patchwork: http://patchwork.linux-mips.org/patch/838/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27 12:53:08 +01:00
David Daney 6888fc8776 Staging: Octeon Ethernet: Rewrite transmit code.
Stop the queue if too many packets are queued.  Restart it from a high
resolution timer.

Rearrange and simplify locking and SKB freeing code

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
To: gregkh@suse.de
Patchwork: http://patchwork.linux-mips.org/patch/843/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27 12:53:07 +01:00