Skip to content

Commit 4a251dd

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Revert CHECKSUM_COMPLETE optimization in pskb_trim_rcsum(), I can't figure out why it breaks things. 2) Fix comparison in netfilter ipset's hash_netnet4_data_equal(), it was basically doing "x == x", from Dave Jones. 3) Freescale FEC driver was DMA mapping the wrong number of bytes, from Sebastian Siewior. 4) Blackhole and prohibit routes in ipv6 were not doing the right thing because their ->input and ->output methods were not being assigned correctly. Now they behave properly like their ipv4 counterparts. From Kamala R. 5) Several drivers advertise the NETIF_F_FRAGLIST capability, but really do not support this feature and will send garbage packets if fed fraglist SKBs. From Eric Dumazet. 6) Fix long standing user triggerable BUG_ON over loopback in RDS protocol stack, from Venkat Venkatsubra. 7) Several not so common code paths can potentially try to invoke packet scheduler actions that might be NULL without checking. Shore things up by either 1) defining a method as mandatory and erroring on registration if that method is NULL 2) defininig a method as optional and the registration function hooks up a default implementation when NULL is seen. From Jamal Hadi Salim. 8) Fix fragment detection in xen-natback driver, from Paul Durrant. 9) Kill dangling enter_memory_pressure method in cg_proto ops, from Eric W Biederman. 10) SKBs that traverse namespaces should have their local_df cleared, from Hannes Frederic Sowa. 11) IOCB file position is not being updated by macvtap_aio_read() and tun_chr_aio_read(). From Zhi Yong Wu. 12) Don't free virtio_net netdev before releasing all of the NAPI instances. From Andrey Vagin. 13) Procfs entry leak in xt_hashlimit, from Sergey Popovich. 14) IPv6 routes that are no cached routes should not count against the garbage collection limits. We had this almost right, but were missing handling addrconf generated routes properly. From Hannes Frederic Sowa. 15) fib{4,6}_rule_suppress() have to consider potentially seeing NULL route info when they are called, from Stefan Tomanek. 16) TUN and MACVTAP have had truncated packet signalling for some time, fix from Jason Wang. 17) Fix use after frrr in __udp4_lib_rcv(), from Eric Dumazet. 18) xen-netback does not interpret the NAPI budget properly for TX work, fix from Paul Durrant. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (132 commits) igb: Fix for issue where values could be too high for udelay function. i40e: fix null dereference xen-netback: fix gso_prefix check net: make neigh_priv_len in struct net_device 16bit instead of 8bit drivers: net: cpsw: fix for cpsw crash when build as modules xen-netback: napi: don't prematurely request a tx event xen-netback: napi: fix abuse of budget sch_tbf: use do_div() for 64-bit divide udp: ipv4: must add synchronization in udp_sk_rx_dst_set() net:fec: remove duplicate lines in comment about errata ERR006358 Revert "8390 : Replace ei_debug with msg_enable/NETIF_MSG_* feature" 8390 : Replace ei_debug with msg_enable/NETIF_MSG_* feature xen-netback: make sure skb linear area covers checksum field net: smc91x: Fix device tree based configuration so it's usable udp: ipv4: fix potential use after free in udp_v4_early_demux() macvtap: signal truncated packets tun: unbreak truncated packet signalling net: sched: htb: fix the calculation of quantum net: sched: tbf: fix the calculation of max_size micrel: add support for KSZ8041RNLI ...
2 parents 908bfda + df29df9 commit 4a251dd

File tree

141 files changed

+1551
-916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+1551
-916
lines changed

Documentation/devicetree/bindings/net/davinci_emac.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides information, what the device node
44
for the davinci_emac interface contains.
55

66
Required properties:
7-
- compatible: "ti,davinci-dm6467-emac";
7+
- compatible: "ti,davinci-dm6467-emac" or "ti,am3517-emac"
88
- reg: Offset and length of the register set for the device
99
- ti,davinci-ctrl-reg-offset: offset to control register
1010
- ti,davinci-ctrl-mod-reg-offset: offset to control module register

Documentation/devicetree/bindings/net/smsc-lan91c111.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ Required properties:
88
Optional properties:
99
- phy-device : phandle to Ethernet phy
1010
- local-mac-address : Ethernet mac address to use
11+
- reg-io-width : Mask of sizes (in bytes) of the IO accesses that
12+
are supported on the device. Valid value for SMSC LAN91c111 are
13+
1, 2 or 4. If it's omitted or invalid, the size would be 2 meaning
14+
16-bit access only.

Documentation/networking/packet_mmap.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ Transmission process is similar to capture as shown below.
123123
[shutdown] close() --------> destruction of the transmission socket and
124124
deallocation of all associated resources.
125125

126+
Socket creation and destruction is also straight forward, and is done
127+
the same way as in capturing described in the previous paragraph:
128+
129+
int fd = socket(PF_PACKET, mode, 0);
130+
131+
The protocol can optionally be 0 in case we only want to transmit
132+
via this socket, which avoids an expensive call to packet_rcv().
133+
In this case, you also need to bind(2) the TX_RING with sll_protocol = 0
134+
set. Otherwise, htons(ETH_P_ALL) or any other protocol, for example.
135+
126136
Binding the socket to your network interface is mandatory (with zero copy) to
127137
know the header size of frames used in the circular buffer.
128138

MAINTAINERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4466,10 +4466,8 @@ M: Bruce Allan <bruce.w.allan@intel.com>
44664466
M: Carolyn Wyborny <carolyn.wyborny@intel.com>
44674467
M: Don Skidmore <donald.c.skidmore@intel.com>
44684468
M: Greg Rose <gregory.v.rose@intel.com>
4469-
M: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
44704469
M: Alex Duyck <alexander.h.duyck@intel.com>
44714470
M: John Ronciak <john.ronciak@intel.com>
4472-
M: Tushar Dave <tushar.n.dave@intel.com>
44734471
L: e1000-devel@lists.sourceforge.net
44744472
W: http://www.intel.com/support/feedback.htm
44754473
W: http://e1000.sourceforge.net/

drivers/net/bonding/bond_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4199,9 +4199,9 @@ static int bond_check_params(struct bond_params *params)
41994199
(arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[i]; i++) {
42004200
/* not complete check, but should be good enough to
42014201
catch mistakes */
4202-
__be32 ip = in_aton(arp_ip_target[i]);
4203-
if (!isdigit(arp_ip_target[i][0]) || ip == 0 ||
4204-
ip == htonl(INADDR_BROADCAST)) {
4202+
__be32 ip;
4203+
if (!in4_pton(arp_ip_target[i], -1, (u8 *)&ip, -1, NULL) ||
4204+
IS_IP_TARGET_UNUSABLE_ADDRESS(ip)) {
42054205
pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
42064206
arp_ip_target[i]);
42074207
arp_interval = 0;

drivers/net/bonding/bond_sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,12 +1635,12 @@ static ssize_t bonding_show_packets_per_slave(struct device *d,
16351635
char *buf)
16361636
{
16371637
struct bonding *bond = to_bond(d);
1638-
int packets_per_slave = bond->params.packets_per_slave;
1638+
unsigned int packets_per_slave = bond->params.packets_per_slave;
16391639

16401640
if (packets_per_slave > 1)
16411641
packets_per_slave = reciprocal_value(packets_per_slave);
16421642

1643-
return sprintf(buf, "%d\n", packets_per_slave);
1643+
return sprintf(buf, "%u\n", packets_per_slave);
16441644
}
16451645

16461646
static ssize_t bonding_store_packets_per_slave(struct device *d,

drivers/net/ethernet/allwinner/sun4i-emac.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,7 @@ static int emac_open(struct net_device *dev)
717717
if (netif_msg_ifup(db))
718718
dev_dbg(db->dev, "enabling %s\n", dev->name);
719719

720-
if (devm_request_irq(db->dev, dev->irq, &emac_interrupt,
721-
0, dev->name, dev))
720+
if (request_irq(dev->irq, &emac_interrupt, 0, dev->name, dev))
722721
return -EAGAIN;
723722

724723
/* Initialize EMAC board */
@@ -774,6 +773,8 @@ static int emac_stop(struct net_device *ndev)
774773

775774
emac_shutdown(ndev);
776775

776+
free_irq(ndev->irq, ndev);
777+
777778
return 0;
778779
}
779780

drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3114,6 +3114,11 @@ int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs_param)
31143114
{
31153115
struct bnx2x *bp = netdev_priv(pci_get_drvdata(dev));
31163116

3117+
if (!IS_SRIOV(bp)) {
3118+
BNX2X_ERR("failed to configure SR-IOV since vfdb was not allocated. Check dmesg for errors in probe stage\n");
3119+
return -EINVAL;
3120+
}
3121+
31173122
DP(BNX2X_MSG_IOV, "bnx2x_sriov_configure called with %d, BNX2X_NR_VIRTFN(bp) was %d\n",
31183123
num_vfs_param, BNX2X_NR_VIRTFN(bp));
31193124

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8932,6 +8932,9 @@ static int tg3_chip_reset(struct tg3 *tp)
89328932
void (*write_op)(struct tg3 *, u32, u32);
89338933
int i, err;
89348934

8935+
if (!pci_device_is_present(tp->pdev))
8936+
return -ENODEV;
8937+
89358938
tg3_nvram_lock(tp);
89368939

89378940
tg3_ape_lock(tp, TG3_APE_LOCK_GRC);
@@ -11581,10 +11584,11 @@ static int tg3_close(struct net_device *dev)
1158111584
memset(&tp->net_stats_prev, 0, sizeof(tp->net_stats_prev));
1158211585
memset(&tp->estats_prev, 0, sizeof(tp->estats_prev));
1158311586

11584-
tg3_power_down_prepare(tp);
11585-
11586-
tg3_carrier_off(tp);
11587+
if (pci_device_is_present(tp->pdev)) {
11588+
tg3_power_down_prepare(tp);
1158711589

11590+
tg3_carrier_off(tp);
11591+
}
1158811592
return 0;
1158911593
}
1159011594

@@ -16499,6 +16503,9 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
1649916503
/* Clear this out for sanity. */
1650016504
tw32(TG3PCI_MEM_WIN_BASE_ADDR, 0);
1650116505

16506+
/* Clear TG3PCI_REG_BASE_ADDR to prevent hangs. */
16507+
tw32(TG3PCI_REG_BASE_ADDR, 0);
16508+
1650216509
pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE,
1650316510
&pci_state_reg);
1650416511
if ((pci_state_reg & PCISTATE_CONV_PCI_MODE) == 0 &&
@@ -17726,10 +17733,12 @@ static int tg3_suspend(struct device *device)
1772617733
struct pci_dev *pdev = to_pci_dev(device);
1772717734
struct net_device *dev = pci_get_drvdata(pdev);
1772817735
struct tg3 *tp = netdev_priv(dev);
17729-
int err;
17736+
int err = 0;
17737+
17738+
rtnl_lock();
1773017739

1773117740
if (!netif_running(dev))
17732-
return 0;
17741+
goto unlock;
1773317742

1773417743
tg3_reset_task_cancel(tp);
1773517744
tg3_phy_stop(tp);
@@ -17771,6 +17780,8 @@ static int tg3_suspend(struct device *device)
1777117780
tg3_phy_start(tp);
1777217781
}
1777317782

17783+
unlock:
17784+
rtnl_unlock();
1777417785
return err;
1777517786
}
1777617787

@@ -17779,10 +17790,12 @@ static int tg3_resume(struct device *device)
1777917790
struct pci_dev *pdev = to_pci_dev(device);
1778017791
struct net_device *dev = pci_get_drvdata(pdev);
1778117792
struct tg3 *tp = netdev_priv(dev);
17782-
int err;
17793+
int err = 0;
17794+
17795+
rtnl_lock();
1778317796

1778417797
if (!netif_running(dev))
17785-
return 0;
17798+
goto unlock;
1778617799

1778717800
netif_device_attach(dev);
1778817801

@@ -17806,6 +17819,8 @@ static int tg3_resume(struct device *device)
1780617819
if (!err)
1780717820
tg3_phy_start(tp);
1780817821

17822+
unlock:
17823+
rtnl_unlock();
1780917824
return err;
1781017825
}
1781117826
#endif /* CONFIG_PM_SLEEP */

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

Lines changed: 53 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@
4949
#include <asm/io.h>
5050
#include "cxgb4_uld.h"
5151

52-
#define FW_VERSION_MAJOR 1
53-
#define FW_VERSION_MINOR 4
54-
#define FW_VERSION_MICRO 0
52+
#define T4FW_VERSION_MAJOR 0x01
53+
#define T4FW_VERSION_MINOR 0x06
54+
#define T4FW_VERSION_MICRO 0x18
55+
#define T4FW_VERSION_BUILD 0x00
5556

56-
#define FW_VERSION_MAJOR_T5 0
57-
#define FW_VERSION_MINOR_T5 0
58-
#define FW_VERSION_MICRO_T5 0
57+
#define T5FW_VERSION_MAJOR 0x01
58+
#define T5FW_VERSION_MINOR 0x08
59+
#define T5FW_VERSION_MICRO 0x1C
60+
#define T5FW_VERSION_BUILD 0x00
5961

6062
#define CH_WARN(adap, fmt, ...) dev_warn(adap->pdev_dev, fmt, ## __VA_ARGS__)
6163

@@ -240,6 +242,26 @@ struct pci_params {
240242
unsigned char width;
241243
};
242244

245+
#define CHELSIO_CHIP_CODE(version, revision) (((version) << 4) | (revision))
246+
#define CHELSIO_CHIP_FPGA 0x100
247+
#define CHELSIO_CHIP_VERSION(code) (((code) >> 4) & 0xf)
248+
#define CHELSIO_CHIP_RELEASE(code) ((code) & 0xf)
249+
250+
#define CHELSIO_T4 0x4
251+
#define CHELSIO_T5 0x5
252+
253+
enum chip_type {
254+
T4_A1 = CHELSIO_CHIP_CODE(CHELSIO_T4, 1),
255+
T4_A2 = CHELSIO_CHIP_CODE(CHELSIO_T4, 2),
256+
T4_FIRST_REV = T4_A1,
257+
T4_LAST_REV = T4_A2,
258+
259+
T5_A0 = CHELSIO_CHIP_CODE(CHELSIO_T5, 0),
260+
T5_A1 = CHELSIO_CHIP_CODE(CHELSIO_T5, 1),
261+
T5_FIRST_REV = T5_A0,
262+
T5_LAST_REV = T5_A1,
263+
};
264+
243265
struct adapter_params {
244266
struct tp_params tp;
245267
struct vpd_params vpd;
@@ -259,14 +281,31 @@ struct adapter_params {
259281

260282
unsigned char nports; /* # of ethernet ports */
261283
unsigned char portvec;
262-
unsigned char rev; /* chip revision */
284+
enum chip_type chip; /* chip code */
263285
unsigned char offload;
264286

265287
unsigned char bypass;
266288

267289
unsigned int ofldq_wr_cred;
268290
};
269291

292+
#include "t4fw_api.h"
293+
294+
#define FW_VERSION(chip) ( \
295+
FW_HDR_FW_VER_MAJOR_GET(chip##FW_VERSION_MAJOR) | \
296+
FW_HDR_FW_VER_MINOR_GET(chip##FW_VERSION_MINOR) | \
297+
FW_HDR_FW_VER_MICRO_GET(chip##FW_VERSION_MICRO) | \
298+
FW_HDR_FW_VER_BUILD_GET(chip##FW_VERSION_BUILD))
299+
#define FW_INTFVER(chip, intf) (FW_HDR_INTFVER_##intf)
300+
301+
struct fw_info {
302+
u8 chip;
303+
char *fs_name;
304+
char *fw_mod_name;
305+
struct fw_hdr fw_hdr;
306+
};
307+
308+
270309
struct trace_params {
271310
u32 data[TRACE_LEN / 4];
272311
u32 mask[TRACE_LEN / 4];
@@ -512,25 +551,6 @@ struct sge {
512551

513552
struct l2t_data;
514553

515-
#define CHELSIO_CHIP_CODE(version, revision) (((version) << 4) | (revision))
516-
#define CHELSIO_CHIP_VERSION(code) ((code) >> 4)
517-
#define CHELSIO_CHIP_RELEASE(code) ((code) & 0xf)
518-
519-
#define CHELSIO_T4 0x4
520-
#define CHELSIO_T5 0x5
521-
522-
enum chip_type {
523-
T4_A1 = CHELSIO_CHIP_CODE(CHELSIO_T4, 0),
524-
T4_A2 = CHELSIO_CHIP_CODE(CHELSIO_T4, 1),
525-
T4_A3 = CHELSIO_CHIP_CODE(CHELSIO_T4, 2),
526-
T4_FIRST_REV = T4_A1,
527-
T4_LAST_REV = T4_A3,
528-
529-
T5_A1 = CHELSIO_CHIP_CODE(CHELSIO_T5, 0),
530-
T5_FIRST_REV = T5_A1,
531-
T5_LAST_REV = T5_A1,
532-
};
533-
534554
#ifdef CONFIG_PCI_IOV
535555

536556
/* T4 supports SRIOV on PF0-3 and T5 on PF0-7. However, the Serial
@@ -715,12 +735,12 @@ enum {
715735

716736
static inline int is_t5(enum chip_type chip)
717737
{
718-
return (chip >= T5_FIRST_REV && chip <= T5_LAST_REV);
738+
return CHELSIO_CHIP_VERSION(chip) == CHELSIO_T5;
719739
}
720740

721741
static inline int is_t4(enum chip_type chip)
722742
{
723-
return (chip >= T4_FIRST_REV && chip <= T4_LAST_REV);
743+
return CHELSIO_CHIP_VERSION(chip) == CHELSIO_T4;
724744
}
725745

726746
static inline u32 t4_read_reg(struct adapter *adap, u32 reg_addr)
@@ -900,7 +920,11 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p);
900920
int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size);
901921
unsigned int t4_flash_cfg_addr(struct adapter *adapter);
902922
int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size);
903-
int t4_check_fw_version(struct adapter *adapter);
923+
int t4_get_fw_version(struct adapter *adapter, u32 *vers);
924+
int t4_get_tp_version(struct adapter *adapter, u32 *vers);
925+
int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info,
926+
const u8 *fw_data, unsigned int fw_size,
927+
struct fw_hdr *card_fw, enum dev_state state, int *reset);
904928
int t4_prep_adapter(struct adapter *adapter);
905929
int t4_port_init(struct adapter *adap, int mbox, int pf, int vf);
906930
void t4_fatal_err(struct adapter *adapter);

0 commit comments

Comments
 (0)