* [net-next 02/11] ixgbevf: Resolve missing-field-initializers warnings
From: Jeff Kirsher @ 2014-09-12 12:33 UTC (permalink / raw)
To: davem; +Cc: Mark Rustad, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1410525231-19851-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mark Rustad <mark.d.rustad@intel.com>
Resolve missing-field-initializers warnings by using
designated initialization.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbevf/ethtool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
index d420f12..cc0e5b7 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
@@ -523,7 +523,7 @@ static const struct ixgbevf_reg_test reg_test_vf[] = {
{ IXGBE_VFTDBAL(0), 2, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
{ IXGBE_VFTDBAH(0), 2, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
{ IXGBE_VFTDLEN(0), 2, PATTERN_TEST, 0x000FFF80, 0x000FFF80 },
- { 0, 0, 0, 0 }
+ { .reg = 0 }
};
static const u32 register_test_patterns[] = {
--
1.9.3
^ permalink raw reply related
* [net-next 03/11] ixgbe: Drop Rx alloc at end of Rx cleanup
From: Jeff Kirsher @ 2014-09-12 12:33 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <1410525231-19851-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
This change removes the Rx buffer allocation at the end of ixgbe_clean_rx_irq.
The reason for removing this is to avoid the extra latency introduced by the
MMIO write. This can amount to somewhere around an extra 100ns of latency and
one extra message worth of PCIe bus overhead.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 87613806..6a12bb1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -2077,9 +2077,6 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
q_vector->rx.total_packets += total_rx_packets;
q_vector->rx.total_bytes += total_rx_bytes;
- if (cleaned_count)
- ixgbe_alloc_rx_buffers(rx_ring, cleaned_count);
-
return total_rx_packets;
}
--
1.9.3
^ permalink raw reply related
* [net-next 00/11][pull request] Intel Wired LAN Driver Updates 2014-09-12
From: Jeff Kirsher @ 2014-09-12 12:33 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene
This series contains updates to e1000, ixgbe and ixgbevf.
Mark provide two fixes to reduce compile warnings produce by ixgbe
and ixgbevf.
Alex provides two patches for ixgbe, first removes the receive buffer
allocation at the end of the ixgbe_clean_rx_irq(). The reason for
removing this is to avoid the extra latency introduced by the MMIO write.
Second patch addresses several issues in the current ixgbe implementation
of busy poll sockets. It was possible for frames to be delivered out of
order if they were held in GRO, so address this by flushing the GRO
buffers before releasing the q_vector back to the idle state. Also, we
were having to take a spinlock on changing the state to and from idle,
so to resolve this, replaced the state value with an atomic and use
atomic_cmpxchg to change the value from idle, and a simple atomic set
to restore it back to idle after we have acquired it. This allows us
to only use a locked operation on acquiring the vector without a need
for a locked operation to release it.
Florian Westphal provides several patches for e1000 which does some
cleanup and updating of the driver. Moved e1000_tbi_adjust_stats()
so that he could make the function static. Added a helper function
to deal with the tbi workaround that was located in 2 different
Rx clean functions. Added a e1000_rx_buffer struct for use on receive
since the transmit and receive have different requirements. Updates
e1000 to use napi_gro_frags API.
The following are changes since commit b954d83421d51d822c42e5ab7b65069b25ad3005:
net: bpf: only build bpf_jit_binary_{alloc, free}() when jit selected
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Alexander Duyck (2):
ixgbe: Drop Rx alloc at end of Rx cleanup
ixgbe: Refactor busy poll socket code to address multiple issues
Florian Westphal (7):
e1000: move e1000_tbi_adjust_stats to where its used
e1000: move tbi workaround code into helper function
e1000: perform copybreak ahead of DMA unmap
e1000: add and use e1000_rx_buffer info for Rx
e1000: rename struct e1000_buffer to e1000_tx_buffer
e1000: convert to build_skb
e1000: switch to napi_gro_frags api
Mark Rustad (2):
ixgbe: Resolve warnings produced in W=2 builds
ixgbevf: Resolve missing-field-initializers warnings
drivers/net/ethernet/intel/e1000/e1000.h | 19 +-
drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 38 +-
drivers/net/ethernet/intel/e1000/e1000_hw.c | 78 ----
drivers/net/ethernet/intel/e1000/e1000_hw.h | 2 -
drivers/net/ethernet/intel/e1000/e1000_main.c | 498 ++++++++++++++---------
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 112 ++---
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | 5 +
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 21 +-
drivers/net/ethernet/intel/ixgbevf/ethtool.c | 2 +-
10 files changed, 396 insertions(+), 383 deletions(-)
--
1.9.3
^ permalink raw reply
* [PATCH net] bonding: fix div by zero while enslaving and transmitting
From: Nikolay Aleksandrov @ 2014-09-12 12:22 UTC (permalink / raw)
To: netdev
Cc: Nikolay Aleksandrov, Jiri Pirko, Andy Gospodarek, Jay Vosburgh,
Veaceslav Falico
The problem is that the slave is first linked and slave_cnt is
incremented afterwards leading to a div by zero in the modes that use it
as a modulus. What happens is that in bond_start_xmit() bond_has_slaves()
is used to evaluate further transmission and it becomes true after the
slave is linked in, but when slave_cnt is used in the xmit path it is
still 0. The problem was introduced in commit:
5378c2e6ea236d ("bonding: move bond-specific init after enslave happens")
when the slave_cnt increment was moved after the linking.
Call trace (took it out of net-next kernel, but it's the same with net):
[46934.330038] divide error: 0000 [#1] SMP
[46934.330041] Modules linked in: bonding(O) 9p fscache
snd_hda_codec_generic crct10dif_pclmul
[46934.330041] bond0: Enslaving eth1 as an active interface with an up
link
[46934.330051] ppdev joydev crc32_pclmul crc32c_intel 9pnet_virtio
ghash_clmulni_intel snd_hda_intel 9pnet snd_hda_controller parport_pc
serio_raw pcspkr snd_hda_codec parport virtio_balloon virtio_console
snd_hwdep snd_pcm pvpanic i2c_piix4 snd_timer i2ccore snd soundcore
virtio_blk virtio_net virtio_pci virtio_ring virtio ata_generic
pata_acpi floppy [last unloaded: bonding]
[46934.330053] CPU: 1 PID: 3382 Comm: ping Tainted: G O
3.17.0-rc4+ #27
[46934.330053] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[46934.330054] task: ffff88005aebf2c0 ti: ffff88005b728000 task.ti:
ffff88005b728000
[46934.330059] RIP: 0010:[<ffffffffa0198c33>] [<ffffffffa0198c33>]
bond_start_xmit+0x1c3/0x450 [bonding]
[46934.330060] RSP: 0018:ffff88005b72b7f8 EFLAGS: 00010246
[46934.330060] RAX: 0000000000000679 RBX: ffff88004b077000 RCX:
000000000000002a
[46934.330061] RDX: 0000000000000000 RSI: ffff88004b3f0500 RDI:
ffff88004b077940
[46934.330061] RBP: ffff88005b72b830 R08: 00000000000000c0 R09:
ffff88004a83e000
[46934.330062] R10: 000000000000ffff R11: ffff88004b1f12c0 R12:
ffff88004b3f0500
[46934.330062] R13: ffff88004b3f0500 R14: 000000000000002a R15:
ffff88004b077940
[46934.330063] FS: 00007fbd91a4c740(0000) GS:ffff88005f080000(0000)
knlGS:0000000000000000
[46934.330064] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[46934.330064] CR2: 00007f803a8bb000 CR3: 000000004b2c9000 CR4:
00000000000406e0
[46934.330069] Stack:
[46934.330071] ffffffff811e6169 00000000e772fa05 ffff88004b077000
ffff88004b3f0500
[46934.330072] ffffffff81d17d18 000000000000002a 0000000000000000
ffff88005b72b8a0
[46934.330073] ffffffff81620108 ffffffff8161fe0e ffff88005b72b8c4
ffff88005b302000
[46934.330073] Call Trace:
[46934.330077] [<ffffffff811e6169>] ?
__kmalloc_node_track_caller+0x119/0x300
[46934.330084] [<ffffffff81620108>] dev_hard_start_xmit+0x188/0x410
[46934.330086] [<ffffffff8161fe0e>] ? harmonize_features+0x2e/0x90
[46934.330088] [<ffffffff81620b06>] __dev_queue_xmit+0x456/0x590
[46934.330089] [<ffffffff81620c50>] dev_queue_xmit+0x10/0x20
[46934.330090] [<ffffffff8168f022>] arp_xmit+0x22/0x60
[46934.330091] [<ffffffff8168f090>] arp_send.part.16+0x30/0x40
[46934.330092] [<ffffffff8168f1e5>] arp_solicit+0x115/0x2b0
[46934.330094] [<ffffffff8160b5d7>] ? copy_skb_header+0x17/0xa0
[46934.330096] [<ffffffff8162875a>] neigh_probe+0x4a/0x70
[46934.330097] [<ffffffff8162979c>] __neigh_event_send+0xac/0x230
[46934.330098] [<ffffffff8162a00b>] neigh_resolve_output+0x13b/0x220
[46934.330100] [<ffffffff8165f120>] ? ip_forward_options+0x1c0/0x1c0
[46934.330101] [<ffffffff81660478>] ip_finish_output+0x1f8/0x860
[46934.330102] [<ffffffff81661f08>] ip_output+0x58/0x90
[46934.330103] [<ffffffff81661602>] ? __ip_local_out+0xa2/0xb0
[46934.330104] [<ffffffff81661640>] ip_local_out_sk+0x30/0x40
[46934.330105] [<ffffffff81662a66>] ip_send_skb+0x16/0x50
[46934.330106] [<ffffffff81662ad3>] ip_push_pending_frames+0x33/0x40
[46934.330107] [<ffffffff8168854c>] raw_sendmsg+0x88c/0xa30
[46934.330110] [<ffffffff81612b31>] ? skb_recv_datagram+0x41/0x60
[46934.330111] [<ffffffff816875a9>] ? raw_recvmsg+0xa9/0x1f0
[46934.330113] [<ffffffff816978d4>] inet_sendmsg+0x74/0xc0
[46934.330114] [<ffffffff81697a9b>] ? inet_recvmsg+0x8b/0xb0
[46934.330115] bond0: Adding slave eth2
[46934.330116] [<ffffffff8160357c>] sock_sendmsg+0x9c/0xe0
[46934.330118] [<ffffffff81603248>] ?
move_addr_to_kernel.part.20+0x28/0x80
[46934.330121] [<ffffffff811b4477>] ? might_fault+0x47/0x50
[46934.330122] [<ffffffff816039b9>] ___sys_sendmsg+0x3a9/0x3c0
[46934.330125] [<ffffffff8144a14a>] ? n_tty_write+0x3aa/0x530
[46934.330127] [<ffffffff810d1ae4>] ? __wake_up+0x44/0x50
[46934.330129] [<ffffffff81242b38>] ? fsnotify+0x238/0x310
[46934.330130] [<ffffffff816048a1>] __sys_sendmsg+0x51/0x90
[46934.330131] [<ffffffff816048f2>] SyS_sendmsg+0x12/0x20
[46934.330134] [<ffffffff81738b29>] system_call_fastpath+0x16/0x1b
[46934.330144] Code: 48 8b 10 4c 89 ee 4c 89 ff e8 aa bc ff ff 31 c0 e9
1a ff ff ff 0f 1f 00 4c 89 ee 4c 89 ff e8 65 fb ff ff 31 d2 4c 89 ee 4c
89 ff <f7> b3 64 09 00 00 e8 02 bd ff ff 31 c0 e9 f2 fe ff ff 0f 1f 00
[46934.330146] RIP [<ffffffffa0198c33>] bond_start_xmit+0x1c3/0x450
[bonding]
[46934.330146] RSP <ffff88005b72b7f8>
CC: Jiri Pirko <jiri@resnulli.us>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Veaceslav Falico <vfalico@gmail.com>
Fixes: 5378c2e6ea236d ("bonding: move bond-specific init after enslave happens")
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
drivers/net/bonding/bond_main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 57912ee231cb..10ad434ea184 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1552,6 +1552,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
goto err_detach;
}
+ /* Increment slave_cnt before linking in the slave so we won't end up in
+ * bond_start_xmit with bond_has_slaves() true and slave_cnt == 0.
+ */
+ bond->slave_cnt++;
res = bond_master_upper_dev_link(bond_dev, slave_dev, new_slave);
if (res) {
netdev_dbg(bond_dev, "Error %d calling bond_master_upper_dev_link\n", res);
@@ -1564,7 +1568,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
goto err_upper_unlink;
}
- bond->slave_cnt++;
bond_compute_features(bond);
bond_set_carrier(bond);
@@ -1590,6 +1593,7 @@ err_upper_unlink:
err_unregister:
netdev_rx_handler_unregister(slave_dev);
+ bond->slave_cnt--;
err_detach:
if (!bond_uses_primary(bond))
--
1.9.3
^ permalink raw reply related
* [PATCH net-next 5/8] be2net: add ethtool "-m" option support
From: Sathya Perla @ 2014-09-12 12:09 UTC (permalink / raw)
To: netdev
In-Reply-To: <1410523761-1744-1-git-send-email-sathya.perla@emulex.com>
From: Mark Leonard <mark.leonard@emulex.com>
This patch adds support for the dump-module-eeprom and module-info
ethtool options.
Signed-off-by: Mark Leonard <mark.leonard@emulex.com>
Signed-off-by: Suresh Reddy <Suresh.Reddy@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_cmds.c | 47 ++++++++++++++++++++
drivers/net/ethernet/emulex/benet/be_cmds.h | 25 +++--------
drivers/net/ethernet/emulex/benet/be_ethtool.c | 56 +++++++++++++++++++++++-
3 files changed, 109 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 5d8016c..e0dd482 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -2176,6 +2176,53 @@ err:
return status;
}
+/* Uses sync mcc */
+int be_cmd_read_port_transceiver_data(struct be_adapter *adapter,
+ u8 page_num, u8 *data)
+{
+ struct be_dma_mem cmd;
+ struct be_mcc_wrb *wrb;
+ struct be_cmd_req_port_type *req;
+ int status;
+
+ if (page_num > TR_PAGE_A2)
+ return -EINVAL;
+
+ cmd.size = sizeof(struct be_cmd_resp_port_type);
+ cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma);
+ if (!cmd.va) {
+ dev_err(&adapter->pdev->dev, "Memory allocation failed\n");
+ return -ENOMEM;
+ }
+ memset(cmd.va, 0, cmd.size);
+
+ spin_lock_bh(&adapter->mcc_lock);
+
+ wrb = wrb_from_mccq(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
+ req = cmd.va;
+
+ be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
+ OPCODE_COMMON_READ_TRANSRECV_DATA,
+ cmd.size, wrb, &cmd);
+
+ req->port = cpu_to_le32(adapter->hba_port_num);
+ req->page_num = cpu_to_le32(page_num);
+ status = be_mcc_notify_wait(adapter);
+ if (!status) {
+ struct be_cmd_resp_port_type *resp = cmd.va;
+
+ memcpy(data, resp->page_data, PAGE_DATA_LEN);
+ }
+err:
+ spin_unlock_bh(&adapter->mcc_lock);
+ pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma);
+ return status;
+}
+
int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
u32 data_size, u32 data_offset,
const char *obj_name, u32 *data_written,
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index 3b1606c..f05f1fb 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -1014,28 +1014,15 @@ enum {
TR_PAGE_A2 = 0xa2
};
+/* From SFF-8472 spec */
+#define SFP_PLUS_SFF_8472_COMP 0x5E
+
+#define PAGE_DATA_LEN 256
struct be_cmd_resp_port_type {
struct be_cmd_resp_hdr hdr;
u32 page_num;
u32 port;
- struct data {
- u8 identifier;
- u8 identifier_ext;
- u8 connector;
- u8 transceiver[8];
- u8 rsvd0[3];
- u8 length_km;
- u8 length_hm;
- u8 length_om1;
- u8 length_om2;
- u8 length_cu;
- u8 length_cu_m;
- u8 vendor_name[16];
- u8 rsvd;
- u8 vendor_oui[3];
- u8 vendor_pn[16];
- u8 vendor_rev[4];
- } data;
+ u8 page_data[PAGE_DATA_LEN];
};
/******************** Get FW Version *******************/
@@ -2067,6 +2054,8 @@ int be_cmd_set_beacon_state(struct be_adapter *adapter, u8 port_num, u8 beacon,
u8 status, u8 state);
int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num,
u32 *state);
+int be_cmd_read_port_transceiver_data(struct be_adapter *adapter,
+ u8 page_num, u8 *data);
int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
u32 flash_oper, u32 flash_opcode, u32 buf_size);
int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index ee565be..a28013f 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -1189,6 +1189,58 @@ static int be_set_rxfh(struct net_device *netdev, const u32 *indir,
return 0;
}
+static int be_get_module_info(struct net_device *netdev,
+ struct ethtool_modinfo *modinfo)
+{
+ struct be_adapter *adapter = netdev_priv(netdev);
+ u8 page_data[PAGE_DATA_LEN];
+ int status;
+
+ if (!check_privilege(adapter, MAX_PRIVILEGES))
+ return -EOPNOTSUPP;
+
+ status = be_cmd_read_port_transceiver_data(adapter, TR_PAGE_A0,
+ page_data);
+ if (!status) {
+ if (!page_data[SFP_PLUS_SFF_8472_COMP]) {
+ modinfo->type = ETH_MODULE_SFF_8079;
+ modinfo->eeprom_len = PAGE_DATA_LEN;
+ } else {
+ modinfo->type = ETH_MODULE_SFF_8472;
+ modinfo->eeprom_len = 2 * PAGE_DATA_LEN;
+ }
+ }
+ return be_cmd_status(status);
+}
+
+static int be_get_module_eeprom(struct net_device *netdev,
+ struct ethtool_eeprom *eeprom, u8 *data)
+{
+ struct be_adapter *adapter = netdev_priv(netdev);
+ int status;
+
+ if (!check_privilege(adapter, MAX_PRIVILEGES))
+ return -EOPNOTSUPP;
+
+ status = be_cmd_read_port_transceiver_data(adapter, TR_PAGE_A0,
+ data);
+ if (status)
+ goto err;
+
+ if (eeprom->offset + eeprom->len > PAGE_DATA_LEN) {
+ status = be_cmd_read_port_transceiver_data(adapter,
+ TR_PAGE_A2,
+ data +
+ PAGE_DATA_LEN);
+ if (status)
+ goto err;
+ }
+ if (eeprom->offset)
+ memcpy(data, data + eeprom->offset, eeprom->len);
+err:
+ return be_cmd_status(status);
+}
+
const struct ethtool_ops be_ethtool_ops = {
.get_settings = be_get_settings,
.get_drvinfo = be_get_drvinfo,
@@ -1220,5 +1272,7 @@ const struct ethtool_ops be_ethtool_ops = {
.get_rxfh = be_get_rxfh,
.set_rxfh = be_set_rxfh,
.get_channels = be_get_channels,
- .set_channels = be_set_channels
+ .set_channels = be_set_channels,
+ .get_module_info = be_get_module_info,
+ .get_module_eeprom = be_get_module_eeprom
};
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 7/8] be2net: send a max of 8 EQs to be_cmd_modify_eqd() on Lancer
From: Sathya Perla @ 2014-09-12 12:09 UTC (permalink / raw)
To: netdev
In-Reply-To: <1410523761-1744-1-git-send-email-sathya.perla@emulex.com>
From: Kalesh AP <kalesh.purayil@emulex.com>
The MODIFY_EQ_DELAY FW cmd on Lancer is supported for a max of 8 EQs per cmd.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_cmds.c | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 85edde6..cd213d9 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -1783,8 +1783,8 @@ err:
/* set the EQ delay interval of an EQ to specified value
* Uses async mcc
*/
-int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *set_eqd,
- int num)
+int __be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *set_eqd,
+ int num)
{
struct be_mcc_wrb *wrb;
struct be_cmd_req_modify_eq_delay *req;
@@ -1817,6 +1817,25 @@ err:
return status;
}
+int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *set_eqd,
+ int num)
+{
+ int num_eqs, i = 0;
+
+ if (lancer_chip(adapter) && num > 8) {
+ while (num) {
+ num_eqs = min(num, 8);
+ __be_cmd_modify_eqd(adapter, &set_eqd[i], num_eqs);
+ i += num_eqs;
+ num -= num_eqs;
+ }
+ } else {
+ __be_cmd_modify_eqd(adapter, set_eqd, num);
+ }
+
+ return 0;
+}
+
/* Uses sycnhronous mcc */
int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array,
u32 num)
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 8/8] be2net: enable PCIe error reporting on VFs too
From: Sathya Perla @ 2014-09-12 12:09 UTC (permalink / raw)
To: netdev
In-Reply-To: <1410523761-1744-1-git-send-email-sathya.perla@emulex.com>
From: Kalesh AP <kalesh.purayil@emulex.com>
Currently PCIe error reporting is enabled only on PFs. This patch enables
this feature on VFs too as Lancer VFs support it.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_main.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index a6cf6c7..beebab6 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -4877,11 +4877,9 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id)
}
}
- if (be_physfn(adapter)) {
- status = pci_enable_pcie_error_reporting(pdev);
- if (!status)
- dev_info(&pdev->dev, "PCIe error reporting enabled\n");
- }
+ status = pci_enable_pcie_error_reporting(pdev);
+ if (!status)
+ dev_info(&pdev->dev, "PCIe error reporting enabled\n");
status = be_ctrl_init(adapter);
if (status)
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 3/8] be2net: fix RX fragment posting for jumbo frames
From: Sathya Perla @ 2014-09-12 12:09 UTC (permalink / raw)
To: netdev
In-Reply-To: <1410523761-1744-1-git-send-email-sathya.perla@emulex.com>
From: Ajit Khaparde <ajit.khaparde@emulex.com>
In the RX path, the driver currently consumes upto 64 (budget) packets in
one NAPI sweep. When the size of the packet received is larger than a
fragment size (2K), more than one fragment is consumed for each packet.
As the driver currently posts a max of 64 fragments, all the consumed
fragments may not be replenished. This can cause avoidable drops in RX path.
This patch fixes this by posting a max(consumed_frags, 64) frags. This is
done only when there are atleast 64 free slots in the RXQ.
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_main.c | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index f059b62..a6cf6c7 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1852,7 +1852,7 @@ static inline struct page *be_alloc_pages(u32 size, gfp_t gfp)
* Allocate a page, split it to fragments of size rx_frag_size and post as
* receive buffers to BE
*/
-static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp)
+static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp, u32 frags_needed)
{
struct be_adapter *adapter = rxo->adapter;
struct be_rx_page_info *page_info = NULL, *prev_page_info = NULL;
@@ -1861,10 +1861,10 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp)
struct device *dev = &adapter->pdev->dev;
struct be_eth_rx_d *rxd;
u64 page_dmaaddr = 0, frag_dmaaddr;
- u32 posted, page_offset = 0;
+ u32 posted, page_offset = 0, notify = 0;
page_info = &rxo->page_info_tbl[rxq->head];
- for (posted = 0; posted < MAX_RX_POST && !page_info->page; posted++) {
+ for (posted = 0; posted < frags_needed && !page_info->page; posted++) {
if (!pagep) {
pagep = be_alloc_pages(adapter->big_page_size, gfp);
if (unlikely(!pagep)) {
@@ -1920,7 +1920,11 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp)
atomic_add(posted, &rxq->used);
if (rxo->rx_post_starved)
rxo->rx_post_starved = false;
- be_rxq_notify(adapter, rxq->id, posted);
+ do {
+ notify = min(256u, posted);
+ be_rxq_notify(adapter, rxq->id, notify);
+ posted -= notify;
+ } while (posted);
} else if (atomic_read(&rxq->used) == 0) {
/* Let be_worker replenish when memory is available */
rxo->rx_post_starved = true;
@@ -2371,6 +2375,7 @@ static int be_process_rx(struct be_rx_obj *rxo, struct napi_struct *napi,
struct be_queue_info *rx_cq = &rxo->cq;
struct be_rx_compl_info *rxcp;
u32 work_done;
+ u32 frags_consumed = 0;
for (work_done = 0; work_done < budget; work_done++) {
rxcp = be_rx_compl_get(rxo);
@@ -2403,6 +2408,7 @@ static int be_process_rx(struct be_rx_obj *rxo, struct napi_struct *napi,
be_rx_compl_process(rxo, napi, rxcp);
loop_continue:
+ frags_consumed += rxcp->num_rcvd;
be_rx_stats_update(rxo, rxcp);
}
@@ -2414,7 +2420,9 @@ loop_continue:
*/
if (atomic_read(&rxo->q.used) < RX_FRAGS_REFILL_WM &&
!rxo->rx_post_starved)
- be_post_rx_frags(rxo, GFP_ATOMIC);
+ be_post_rx_frags(rxo, GFP_ATOMIC,
+ max_t(u32, MAX_RX_POST,
+ frags_consumed));
}
return work_done;
@@ -2896,7 +2904,7 @@ static int be_rx_qs_create(struct be_adapter *adapter)
/* First time posting */
for_all_rx_queues(adapter, rxo, i)
- be_post_rx_frags(rxo, GFP_KERNEL);
+ be_post_rx_frags(rxo, GFP_KERNEL, MAX_RX_POST);
return 0;
}
@@ -4778,7 +4786,7 @@ static void be_worker(struct work_struct *work)
* allocation failures.
*/
if (rxo->rx_post_starved)
- be_post_rx_frags(rxo, GFP_KERNEL);
+ be_post_rx_frags(rxo, GFP_KERNEL, MAX_RX_POST);
}
be_eqd_update(adapter);
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 6/8] be2net: fix port-type reporting in get_settings
From: Sathya Perla @ 2014-09-12 12:09 UTC (permalink / raw)
To: netdev
In-Reply-To: <1410523761-1744-1-git-send-email-sathya.perla@emulex.com>
From: Ravikumar Nelavelli <ravikumar.nelavelli@emulex.com>
Report the ethtool port-type/supported/advertising values based on the
cable_type for QSFP and SFP+ interfaces. The cable_type is parsed from
the transceiver data fetched from the FW.
Signed-off-by: Ravikumar Nelavelli <ravikumar.nelavelli@emulex.com>
Signed-off-by: Suresh Reddy <Suresh.Reddy@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be.h | 2 +-
drivers/net/ethernet/emulex/benet/be_cmds.c | 25 +++++++++++++
drivers/net/ethernet/emulex/benet/be_cmds.h | 15 +++++++-
drivers/net/ethernet/emulex/benet/be_ethtool.c | 47 +++++++++++++++++-------
4 files changed, 73 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index a9f239a..9a2d752 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -407,9 +407,9 @@ struct phy_info {
u16 auto_speeds_supported;
u16 fixed_speeds_supported;
int link_speed;
- u32 dac_cable_len;
u32 advertising;
u32 supported;
+ u8 cable_type;
};
struct be_resources {
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index e0dd482..85edde6 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -2296,6 +2296,31 @@ err_unlock:
return status;
}
+int be_cmd_query_cable_type(struct be_adapter *adapter)
+{
+ u8 page_data[PAGE_DATA_LEN];
+ int status;
+
+ status = be_cmd_read_port_transceiver_data(adapter, TR_PAGE_A0,
+ page_data);
+ if (!status) {
+ switch (adapter->phy.interface_type) {
+ case PHY_TYPE_QSFP:
+ adapter->phy.cable_type =
+ page_data[QSFP_PLUS_CABLE_TYPE_OFFSET];
+ break;
+ case PHY_TYPE_SFP_PLUS_10GB:
+ adapter->phy.cable_type =
+ page_data[SFP_PLUS_CABLE_TYPE_OFFSET];
+ break;
+ default:
+ adapter->phy.cable_type = 0;
+ break;
+ }
+ }
+ return status;
+}
+
int lancer_cmd_delete_object(struct be_adapter *adapter, const char *obj_name)
{
struct lancer_cmd_req_delete_object *req;
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index f05f1fb..e86a5ef 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -1014,8 +1014,16 @@ enum {
TR_PAGE_A2 = 0xa2
};
+/* From SFF-8436 QSFP+ spec */
+#define QSFP_PLUS_CABLE_TYPE_OFFSET 0x83
+#define QSFP_PLUS_CR4_CABLE 0x8
+#define QSFP_PLUS_SR4_CABLE 0x4
+#define QSFP_PLUS_LR4_CABLE 0x2
+
/* From SFF-8472 spec */
-#define SFP_PLUS_SFF_8472_COMP 0x5E
+#define SFP_PLUS_SFF_8472_COMP 0x5E
+#define SFP_PLUS_CABLE_TYPE_OFFSET 0x8
+#define SFP_PLUS_COPPER_CABLE 0x4
#define PAGE_DATA_LEN 256
struct be_cmd_resp_port_type {
@@ -1355,6 +1363,9 @@ enum {
PHY_TYPE_BASET_1GB,
PHY_TYPE_BASEX_1GB,
PHY_TYPE_SGMII,
+ PHY_TYPE_QSFP,
+ PHY_TYPE_KR4_40GB,
+ PHY_TYPE_KR2_20GB,
PHY_TYPE_DISABLED = 255
};
@@ -1363,6 +1374,7 @@ enum {
#define BE_SUPPORTED_SPEED_100MBPS 2
#define BE_SUPPORTED_SPEED_1GBPS 4
#define BE_SUPPORTED_SPEED_10GBPS 8
+#define BE_SUPPORTED_SPEED_40GBPS 0x20
#define BE_AN_EN 0x2
#define BE_PAUSE_SYM_EN 0x80
@@ -2056,6 +2068,7 @@ int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num,
u32 *state);
int be_cmd_read_port_transceiver_data(struct be_adapter *adapter,
u8 page_num, u8 *data);
+int be_cmd_query_cable_type(struct be_adapter *adapter);
int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
u32 flash_oper, u32 flash_opcode, u32 buf_size);
int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index a28013f..43b5595 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -475,18 +475,27 @@ static int be_get_sset_count(struct net_device *netdev, int stringset)
}
}
-static u32 be_get_port_type(u32 phy_type, u32 dac_cable_len)
+static u32 be_get_port_type(struct be_adapter *adapter)
{
u32 port;
- switch (phy_type) {
+ switch (adapter->phy.interface_type) {
case PHY_TYPE_BASET_1GB:
case PHY_TYPE_BASEX_1GB:
case PHY_TYPE_SGMII:
port = PORT_TP;
break;
case PHY_TYPE_SFP_PLUS_10GB:
- port = dac_cable_len ? PORT_DA : PORT_FIBRE;
+ if (adapter->phy.cable_type & SFP_PLUS_COPPER_CABLE)
+ port = PORT_DA;
+ else
+ port = PORT_FIBRE;
+ break;
+ case PHY_TYPE_QSFP:
+ if (adapter->phy.cable_type & QSFP_PLUS_CR4_CABLE)
+ port = PORT_DA;
+ else
+ port = PORT_FIBRE;
break;
case PHY_TYPE_XFP_10GB:
case PHY_TYPE_SFP_1GB:
@@ -502,11 +511,11 @@ static u32 be_get_port_type(u32 phy_type, u32 dac_cable_len)
return port;
}
-static u32 convert_to_et_setting(u32 if_type, u32 if_speeds)
+static u32 convert_to_et_setting(struct be_adapter *adapter, u32 if_speeds)
{
u32 val = 0;
- switch (if_type) {
+ switch (adapter->phy.interface_type) {
case PHY_TYPE_BASET_1GB:
case PHY_TYPE_BASEX_1GB:
case PHY_TYPE_SGMII:
@@ -529,6 +538,20 @@ static u32 convert_to_et_setting(u32 if_type, u32 if_speeds)
val |= SUPPORTED_Backplane |
SUPPORTED_10000baseKR_Full;
break;
+ case PHY_TYPE_QSFP:
+ if (if_speeds & BE_SUPPORTED_SPEED_40GBPS) {
+ switch (adapter->phy.cable_type) {
+ case QSFP_PLUS_CR4_CABLE:
+ val |= SUPPORTED_40000baseCR4_Full;
+ break;
+ case QSFP_PLUS_LR4_CABLE:
+ val |= SUPPORTED_40000baseLR4_Full;
+ break;
+ default:
+ val |= SUPPORTED_40000baseSR4_Full;
+ break;
+ }
+ }
case PHY_TYPE_SFP_PLUS_10GB:
case PHY_TYPE_XFP_10GB:
case PHY_TYPE_SFP_1GB:
@@ -569,8 +592,6 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
int status;
u32 auto_speeds;
u32 fixed_speeds;
- u32 dac_cable_len;
- u16 interface_type;
if (adapter->phy.link_speed < 0) {
status = be_cmd_link_status_query(adapter, &link_speed,
@@ -581,21 +602,19 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
status = be_cmd_get_phy_info(adapter);
if (!status) {
- interface_type = adapter->phy.interface_type;
auto_speeds = adapter->phy.auto_speeds_supported;
fixed_speeds = adapter->phy.fixed_speeds_supported;
- dac_cable_len = adapter->phy.dac_cable_len;
+
+ be_cmd_query_cable_type(adapter);
ecmd->supported =
- convert_to_et_setting(interface_type,
+ convert_to_et_setting(adapter,
auto_speeds |
fixed_speeds);
ecmd->advertising =
- convert_to_et_setting(interface_type,
- auto_speeds);
+ convert_to_et_setting(adapter, auto_speeds);
- ecmd->port = be_get_port_type(interface_type,
- dac_cable_len);
+ ecmd->port = be_get_port_type(adapter);
if (adapter->phy.auto_speeds_supported) {
ecmd->supported |= SUPPORTED_Autoneg;
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 1/8] be2net: fix some log messages
From: Sathya Perla @ 2014-09-12 12:09 UTC (permalink / raw)
To: netdev
In-Reply-To: <1410523761-1744-1-git-send-email-sathya.perla@emulex.com>
From: Vasundhara Volam <vasundhara.volam@emulex.com>
This patch fixes the following minor issues with log messages in be2net:
1) Period is not required at the end of log message.
2) Remove "Unknown grp5 event" logs to reduce noise. The driver can safely
ignore async events from FW it's not interested in.
3) Reword a log message for better readability to say that SRIOV
"is disabled" rather than "not supported".
Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_cmds.c | 2 --
drivers/net/ethernet/emulex/benet/be_ethtool.c | 2 +-
drivers/net/ethernet/emulex/benet/be_main.c | 17 ++++++++---------
3 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 5be100d..d6685ab 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -309,8 +309,6 @@ static void be_async_grp5_evt_process(struct be_adapter *adapter,
be_async_grp5_pvid_state_process(adapter, compl);
break;
default:
- dev_warn(&adapter->pdev->dev, "Unknown grp5 event 0x%x!\n",
- event_type);
break;
}
}
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index 2fd3826..ee565be 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -676,7 +676,7 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
status = be_cmd_set_flow_control(adapter,
adapter->tx_fc, adapter->rx_fc);
if (status)
- dev_warn(&adapter->pdev->dev, "Pause param set failed.\n");
+ dev_warn(&adapter->pdev->dev, "Pause param set failed\n");
return be_cmd_status(status);
}
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 5b26c4c..f059b62 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1093,6 +1093,7 @@ static int be_change_mtu(struct net_device *netdev, int new_mtu)
*/
static int be_vid_config(struct be_adapter *adapter)
{
+ struct device *dev = &adapter->pdev->dev;
u16 vids[BE_NUM_VLANS_SUPPORTED];
u16 num = 0, i = 0;
int status = 0;
@@ -1114,16 +1115,15 @@ static int be_vid_config(struct be_adapter *adapter)
if (addl_status(status) ==
MCC_ADDL_STATUS_INSUFFICIENT_RESOURCES)
goto set_vlan_promisc;
- dev_err(&adapter->pdev->dev,
- "Setting HW VLAN filtering failed.\n");
+ dev_err(dev, "Setting HW VLAN filtering failed\n");
} else {
if (adapter->flags & BE_FLAGS_VLAN_PROMISC) {
/* hw VLAN filtering re-enabled. */
status = be_cmd_rx_filter(adapter,
BE_FLAGS_VLAN_PROMISC, OFF);
if (!status) {
- dev_info(&adapter->pdev->dev,
- "Disabling VLAN Promiscuous mode.\n");
+ dev_info(dev,
+ "Disabling VLAN Promiscuous mode\n");
adapter->flags &= ~BE_FLAGS_VLAN_PROMISC;
}
}
@@ -1137,11 +1137,10 @@ set_vlan_promisc:
status = be_cmd_rx_filter(adapter, BE_FLAGS_VLAN_PROMISC, ON);
if (!status) {
- dev_info(&adapter->pdev->dev, "Enable VLAN Promiscuous mode\n");
+ dev_info(dev, "Enable VLAN Promiscuous mode\n");
adapter->flags |= BE_FLAGS_VLAN_PROMISC;
} else
- dev_err(&adapter->pdev->dev,
- "Failed to enable VLAN Promiscuous mode.\n");
+ dev_err(dev, "Failed to enable VLAN Promiscuous mode\n");
return status;
}
@@ -3387,7 +3386,7 @@ static int be_get_sriov_config(struct be_adapter *adapter)
if (!be_max_vfs(adapter)) {
if (num_vfs)
- dev_warn(dev, "device doesn't support SRIOV\n");
+ dev_warn(dev, "SRIOV is disabled. Ignoring num_vfs\n");
adapter->num_vfs = 0;
return 0;
}
@@ -3661,7 +3660,7 @@ static int be_setup(struct be_adapter *adapter)
dev_info(dev, "FW version is %s\n", adapter->fw_ver);
if (BE2_chip(adapter) && fw_major_num(adapter->fw_ver) < 4) {
- dev_err(dev, "Firmware on card is old(%s), IRQs may not work.",
+ dev_err(dev, "Firmware on card is old(%s), IRQs may not work",
adapter->fw_ver);
dev_err(dev, "Please upgrade firmware to version >= 4.0\n");
}
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 4/8] be2net: use v1 of SET_FLOW_CONTROL command
From: Sathya Perla @ 2014-09-12 12:09 UTC (permalink / raw)
To: netdev
In-Reply-To: <1410523761-1744-1-git-send-email-sathya.perla@emulex.com>
From: Suresh Reddy <Suresh.Reddy@emulex.com>
In some configurations the FW doesn't allow changing flow control settings
of a link. Unless a v1 version of the SET_FLOW_CONTROL cmd is used, the FW
doesn't report an error to the driver.
Signed-off-by: Suresh Reddy <Suresh.Reddy@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_cmds.c | 5 +++++
drivers/net/ethernet/emulex/benet/be_cmds.h | 3 ++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 8bb6fd9..5d8016c 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -1948,6 +1948,7 @@ int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc)
OPCODE_COMMON_SET_FLOW_CONTROL, sizeof(*req),
wrb, NULL);
+ req->hdr.version = 1;
req->tx_flow_control = cpu_to_le16((u16)tx_fc);
req->rx_flow_control = cpu_to_le16((u16)rx_fc);
@@ -1955,6 +1956,10 @@ int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc)
err:
spin_unlock_bh(&adapter->mcc_lock);
+
+ if (base_status(status) == MCC_STATUS_FEATURE_NOT_SUPPORTED)
+ return -EOPNOTSUPP;
+
return status;
}
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index 0e11868..3b1606c 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -57,7 +57,8 @@ enum mcc_base_status {
MCC_STATUS_ILLEGAL_FIELD = 3,
MCC_STATUS_INSUFFICIENT_BUFFER = 4,
MCC_STATUS_UNAUTHORIZED_REQUEST = 5,
- MCC_STATUS_NOT_SUPPORTED = 66
+ MCC_STATUS_NOT_SUPPORTED = 66,
+ MCC_STATUS_FEATURE_NOT_SUPPORTED = 68
};
/* Additional status */
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 2/8] be2net: replace strcpy with strlcpy
From: Sathya Perla @ 2014-09-12 12:09 UTC (permalink / raw)
To: netdev
In-Reply-To: <1410523761-1744-1-git-send-email-sathya.perla@emulex.com>
From: Vasundhara Volam <vasundhara.volam@emulex.com>
Replace strcpy with strlcpy, as it avoids a possible buffer overflow.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_cmds.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index d6685ab..8bb6fd9 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -1770,8 +1770,10 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter)
if (!status) {
struct be_cmd_resp_get_fw_version *resp = embedded_payload(wrb);
- strcpy(adapter->fw_ver, resp->firmware_version_string);
- strcpy(adapter->fw_on_flash, resp->fw_on_flash_version_string);
+ strlcpy(adapter->fw_ver, resp->firmware_version_string,
+ sizeof(adapter->fw_ver));
+ strlcpy(adapter->fw_on_flash, resp->fw_on_flash_version_string,
+ sizeof(adapter->fw_on_flash));
}
err:
spin_unlock_bh(&adapter->mcc_lock);
@@ -2209,7 +2211,7 @@ int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
be_dws_cpu_to_le(ctxt, sizeof(req->context));
req->write_offset = cpu_to_le32(data_offset);
- strcpy(req->object_name, obj_name);
+ strlcpy(req->object_name, obj_name, sizeof(req->object_name));
req->descriptor_count = cpu_to_le32(1);
req->buf_len = cpu_to_le32(data_size);
req->addr_low = cpu_to_le32((cmd->dma +
@@ -2262,7 +2264,7 @@ int lancer_cmd_delete_object(struct be_adapter *adapter, const char *obj_name)
OPCODE_COMMON_DELETE_OBJECT,
sizeof(*req), wrb, NULL);
- strcpy(req->object_name, obj_name);
+ strlcpy(req->object_name, obj_name, sizeof(req->object_name));
status = be_mcc_notify_wait(adapter);
err:
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 0/8] be2net: patch set
From: Sathya Perla @ 2014-09-12 12:09 UTC (permalink / raw)
To: netdev
Patch 1 fixes some minor issues with log messages in be2net.
Patch 2 replaces strcpy() calls with strlcpy() to avoid possible buffer
overflow.
Patch 3 improves the RX buffer posting scheme for jumbo frames.
Patch 4 replaces the use of v0 of SET_FLOW_CONTROL cmd with v1 to receive
a definitive completion status from FW.
Patch 5 adds support for ethtool "-m" ethtool option.
Patch 6 fixes port-type reporting via ethtool get_settings for QSFP/SFP+
interfaces.
Patch 7 fixes the usage of MODIFY_EQD FW cmd to target a max of 8 EQs on
Lancer chip.
Patch 8 enables PCIe error reporting even for VFs.
Pls consider applying this patch set to net-next. Thanks.
Kalesh AP (3):
be2net: fix RX fragment posting for jumbo frames
be2net: send a max of 8 EQs to be_cmd_modify_eqd() on Lancer
be2net: enable PCIe error reporting on VFs too
Mark Leonard (1):
be2net: add ethtool "-m" option support
Ravikumar Nelavelli (1):
be2net: fix port-type reporting in get_settings
Suresh Reddy (1):
be2net: use v1 of SET_FLOW_CONTROL command
Vasundhara Volam (2):
be2net: fix some log messages
be2net: replace strcpy with strlcpy
drivers/net/ethernet/emulex/benet/be.h | 2 +-
drivers/net/ethernet/emulex/benet/be_cmds.c | 112 ++++++++++++++++++++++--
drivers/net/ethernet/emulex/benet/be_cmds.h | 41 +++++----
drivers/net/ethernet/emulex/benet/be_ethtool.c | 105 +++++++++++++++++++----
drivers/net/ethernet/emulex/benet/be_main.c | 47 ++++++-----
5 files changed, 242 insertions(+), 65 deletions(-)
^ permalink raw reply
* [PATCH net-next v2] net: filter: constify detection of pkt_type_offset
From: Hannes Frederic Sowa @ 2014-09-12 12:04 UTC (permalink / raw)
To: netdev
Cc: Eric Dumazet, Markos Chandras, Martin Schwidefsky,
Daniel Borkmann, Alexei Starovoitov, Denis Kirjanov
In-Reply-To: <5412D9B9.2020300@redhat.com>
Currently we have 2 pkt_type_offset functions doing the same thing and
spread across the architecture files. Remove those and replace them
with a PKT_TYPE_OFFSET macro helper which gets the constant value from a
zero sized sk_buff member right in front of the bitfield with offsetof.
This new offset marker does not change size of struct sk_buff.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Daniel Borkmann <dborkman@redhat.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
v2) Incorporated Daniel's feedback. I first misinterpreted the feedback
as something not related to pkt_type_offset.
arch/mips/net/bpf_jit.c | 27 +--------------------------
arch/s390/net/bpf_jit_comp.c | 35 +----------------------------------
include/linux/skbuff.h | 10 ++++++++++
net/core/filter.c | 31 ++-----------------------------
4 files changed, 14 insertions(+), 89 deletions(-)
diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
index 0e97ccd..7edc083 100644
--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -765,27 +765,6 @@ static u64 jit_get_skb_w(struct sk_buff *skb, unsigned offset)
return (u64)err << 32 | ntohl(ret);
}
-#ifdef __BIG_ENDIAN_BITFIELD
-#define PKT_TYPE_MAX (7 << 5)
-#else
-#define PKT_TYPE_MAX 7
-#endif
-static int pkt_type_offset(void)
-{
- struct sk_buff skb_probe = {
- .pkt_type = ~0,
- };
- u8 *ct = (u8 *)&skb_probe;
- unsigned int off;
-
- for (off = 0; off < sizeof(struct sk_buff); off++) {
- if (ct[off] == PKT_TYPE_MAX)
- return off;
- }
- pr_err_once("Please fix pkt_type_offset(), as pkt_type couldn't be found\n");
- return -1;
-}
-
static int build_body(struct jit_ctx *ctx)
{
void *load_func[] = {jit_get_skb_b, jit_get_skb_h, jit_get_skb_w};
@@ -1332,11 +1311,7 @@ jmp_cmp:
case BPF_ANC | SKF_AD_PKTTYPE:
ctx->flags |= SEEN_SKB;
- off = pkt_type_offset();
-
- if (off < 0)
- return -1;
- emit_load_byte(r_tmp, r_skb, off, ctx);
+ emit_load_byte(r_tmp, r_skb, PKT_TYPE_OFFSET(), ctx);
/* Keep only the last 3 bits */
emit_andi(r_A, r_tmp, PKT_TYPE_MAX, ctx);
#ifdef __BIG_ENDIAN_BITFIELD
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 555f5c7..c52ac77 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -227,37 +227,6 @@ static void bpf_jit_epilogue(struct bpf_jit *jit)
EMIT2(0x07fe);
}
-/* Helper to find the offset of pkt_type in sk_buff
- * Make sure its still a 3bit field starting at the MSBs within a byte.
- */
-#define PKT_TYPE_MAX 0xe0
-static int pkt_type_offset;
-
-static int __init bpf_pkt_type_offset_init(void)
-{
- struct sk_buff skb_probe = {
- .pkt_type = ~0,
- };
- char *ct = (char *)&skb_probe;
- int off;
-
- pkt_type_offset = -1;
- for (off = 0; off < sizeof(struct sk_buff); off++) {
- if (!ct[off])
- continue;
- if (ct[off] == PKT_TYPE_MAX)
- pkt_type_offset = off;
- else {
- /* Found non matching bit pattern, fix needed. */
- WARN_ON_ONCE(1);
- pkt_type_offset = -1;
- return -1;
- }
- }
- return 0;
-}
-device_initcall(bpf_pkt_type_offset_init);
-
/*
* make sure we dont leak kernel information to user
*/
@@ -757,12 +726,10 @@ call_fn: /* lg %r1,<d(function)>(%r13) */
}
break;
case BPF_ANC | SKF_AD_PKTTYPE:
- if (pkt_type_offset < 0)
- goto out;
/* lhi %r5,0 */
EMIT4(0xa7580000);
/* ic %r5,<d(pkt_type_offset)>(%r2) */
- EMIT4_DISP(0x43502000, pkt_type_offset);
+ EMIT4_DISP(0x43502000, PKT_TYPE_OFFSET());
/* srl %r5,5 */
EMIT4_DISP(0x88500000, 5);
break;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 07c9fdd..756e3d0 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -548,6 +548,16 @@ struct sk_buff {
ip_summed:2,
nohdr:1,
nfctinfo:3;
+
+/* if you move pkt_type around you also must adapt those constants */
+#ifdef __BIG_ENDIAN_BITFIELD
+#define PKT_TYPE_MAX (7 << 5)
+#else
+#define PKT_TYPE_MAX 7
+#endif
+#define PKT_TYPE_OFFSET() offsetof(struct sk_buff, __pkt_type_offset)
+
+ __u8 __pkt_type_offset[0];
__u8 pkt_type:3,
fclone:2,
ipvs_property:1,
diff --git a/net/core/filter.c b/net/core/filter.c
index dfc716f..601f28d 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -87,30 +87,6 @@ int sk_filter(struct sock *sk, struct sk_buff *skb)
}
EXPORT_SYMBOL(sk_filter);
-/* Helper to find the offset of pkt_type in sk_buff structure. We want
- * to make sure its still a 3bit field starting at a byte boundary;
- * taken from arch/x86/net/bpf_jit_comp.c.
- */
-#ifdef __BIG_ENDIAN_BITFIELD
-#define PKT_TYPE_MAX (7 << 5)
-#else
-#define PKT_TYPE_MAX 7
-#endif
-static unsigned int pkt_type_offset(void)
-{
- struct sk_buff skb_probe = { .pkt_type = ~0, };
- u8 *ct = (u8 *) &skb_probe;
- unsigned int off;
-
- for (off = 0; off < sizeof(struct sk_buff); off++) {
- if (ct[off] == PKT_TYPE_MAX)
- return off;
- }
-
- pr_err_once("Please fix %s, as pkt_type couldn't be found!\n", __func__);
- return -1;
-}
-
static u64 __skb_get_pay_offset(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
{
return skb_get_poff((struct sk_buff *)(unsigned long) ctx);
@@ -190,11 +166,8 @@ static bool convert_bpf_extensions(struct sock_filter *fp,
break;
case SKF_AD_OFF + SKF_AD_PKTTYPE:
- *insn = BPF_LDX_MEM(BPF_B, BPF_REG_A, BPF_REG_CTX,
- pkt_type_offset());
- if (insn->off < 0)
- return false;
- insn++;
+ *insn++ = BPF_LDX_MEM(BPF_B, BPF_REG_A, BPF_REG_CTX,
+ PKT_TYPE_OFFSET());
*insn = BPF_ALU32_IMM(BPF_AND, BPF_REG_A, PKT_TYPE_MAX);
#ifdef __BIG_ENDIAN_BITFIELD
insn++;
--
1.9.3
^ permalink raw reply related
* Re: PTP_PEROUT_REQUEST and clock stepping
From: Daniel Glöckner @ 2014-09-12 11:40 UTC (permalink / raw)
To: Richard Cochran, Christian Riesch; +Cc: netdev@vger.kernel.org
In-Reply-To: <20140912063310.GA6198@netboy>
On 09/12/14 08:33, Richard Cochran wrote:
> On Fri, Sep 12, 2014 at 08:24:49AM +0200, Christian Riesch wrote:
>> Ok, I got it now. So you are suggesting to change the behavior of
>> PTP_PEROUT_REQUEST, aren't you? And break existing applications?
>> Christian
I don't want to change the API. I would just have preferred a slightly
different one.
> I think he wants the periodic output to continue at the same phase and
> frequency, even when you reset the clock time.
>
> However, this is impossible to acheive because the hardware does not
> support it.
You mean the hardware that you know of that currently exists.
I just think it is wrong to place the burden of stopping and starting
the periodic output on the PTP demon. The kernel knows when clock_adjtime
and clock_settime are called and it also knows which periodic outputs
are enabled and how they are configured. We just have to decide on the
correct behavior (respect .start vs. ignore .start once running) to be
implemented.
Taking the Intel i210 as an example, the third option (doing nothing)
would lead to the following behavior:
- If the clock is stepped back, the periodic output stops until the
clock reaches the point when it was adjusted.
- If the clock is stepped forward, the periodic output oscillates at
62,5 MHz to catch up.
Best regards,
Daniel
--
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11,
Bertha-von-Suttner-Straße 9, 37085 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführer: Dr. Uwe Kracke, Ust-IdNr.: DE 205 198 055
emlix - your embedded linux partner
^ permalink raw reply
* Re: [PATCH net-next] net: filter: constify detection of pkt_type_offset
From: Daniel Borkmann @ 2014-09-12 11:32 UTC (permalink / raw)
To: Hannes Frederic Sowa
Cc: netdev, Eric Dumazet, Markos Chandras, Martin Schwidefsky,
Alexei Starovoitov, Denis Kirjanov
In-Reply-To: <1410520696.2793.1.camel@localhost>
On 09/12/2014 01:18 PM, Hannes Frederic Sowa wrote:
> On Fr, 2014-09-12 at 12:55 +0200, Daniel Borkmann wrote:
>> On 09/12/2014 12:22 PM, Hannes Frederic Sowa wrote:
>>> Currently we have 2 pkt_type_offset functions doing the same thing and
>>> spread across the architecture files. Remove those and replace them
>>> with a PKT_TYPE_OFFSET macro helper which gets the constant value from a
>>> zero sized sk_buff member right in front of the bitfield with offsetof.
>>> This new offset marker does not change size of struct sk_buff.
>>>
>>> Cc: Eric Dumazet <eric.dumazet@gmail.com>
>>> Cc: Markos Chandras <markos.chandras@imgtec.com>
>>> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
>>> Cc: Daniel Borkmann <dborkman@redhat.com>
>>> Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
>>> Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
>>> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
>>
>> Thanks for doing this, Hannes!
>> ...
>>> static u64 __skb_get_pay_offset(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
>>> {
>>> return skb_get_poff((struct sk_buff *)(unsigned long) ctx);
>>> @@ -191,7 +167,7 @@ static bool convert_bpf_extensions(struct sock_filter *fp,
>>>
>>> case SKF_AD_OFF + SKF_AD_PKTTYPE:
>>> *insn = BPF_LDX_MEM(BPF_B, BPF_REG_A, BPF_REG_CTX,
>>> - pkt_type_offset());
>>> + PKT_TYPE_OFFSET());
>>> if (insn->off < 0)
>>> return false;
>>> insn++;
>>
>> I think this can now be rewritten as ...
>>
>> case SKF_AD_OFF + SKF_AD_PKTTYPE:
>> *insn++ = BPF_LDX_MEM(BPF_B, BPF_REG_A, BPF_REG_CTX,
>> PKT_TYPE_OFFSET());
>> *insn = BPF_ALU32_IMM(BPF_AND, BPF_REG_A, PKT_TYPE_MAX);
>>
>> ... since we are guaranteed to have always >0 insn->off and despite the
>> __s16 type in off we might be able to safely assume that sk_buff will
>> never get extended so far w/o fist fights first, where this could wrap
>> around. ;) Alternatively, perhaps a BUILD_BUG_ON() for really being
>> paranoid?
>
> Ok, but in a follow-up patch?
I'm fine if you want to propose that in a follow-up, sure.
^ permalink raw reply
* Re: [PATCH net-next] net: filter: constify detection of pkt_type_offset
From: Hannes Frederic Sowa @ 2014-09-12 11:18 UTC (permalink / raw)
To: Daniel Borkmann
Cc: netdev, Eric Dumazet, Markos Chandras, Martin Schwidefsky,
Alexei Starovoitov, Denis Kirjanov
In-Reply-To: <5412D113.6000700@redhat.com>
On Fr, 2014-09-12 at 12:55 +0200, Daniel Borkmann wrote:
> On 09/12/2014 12:22 PM, Hannes Frederic Sowa wrote:
> > Currently we have 2 pkt_type_offset functions doing the same thing and
> > spread across the architecture files. Remove those and replace them
> > with a PKT_TYPE_OFFSET macro helper which gets the constant value from a
> > zero sized sk_buff member right in front of the bitfield with offsetof.
> > This new offset marker does not change size of struct sk_buff.
> >
> > Cc: Eric Dumazet <eric.dumazet@gmail.com>
> > Cc: Markos Chandras <markos.chandras@imgtec.com>
> > Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> > Cc: Daniel Borkmann <dborkman@redhat.com>
> > Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
> > Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
>
> Thanks for doing this, Hannes!
> ...
> > static u64 __skb_get_pay_offset(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
> > {
> > return skb_get_poff((struct sk_buff *)(unsigned long) ctx);
> > @@ -191,7 +167,7 @@ static bool convert_bpf_extensions(struct sock_filter *fp,
> >
> > case SKF_AD_OFF + SKF_AD_PKTTYPE:
> > *insn = BPF_LDX_MEM(BPF_B, BPF_REG_A, BPF_REG_CTX,
> > - pkt_type_offset());
> > + PKT_TYPE_OFFSET());
> > if (insn->off < 0)
> > return false;
> > insn++;
>
> I think this can now be rewritten as ...
>
> case SKF_AD_OFF + SKF_AD_PKTTYPE:
> *insn++ = BPF_LDX_MEM(BPF_B, BPF_REG_A, BPF_REG_CTX,
> PKT_TYPE_OFFSET());
> *insn = BPF_ALU32_IMM(BPF_AND, BPF_REG_A, PKT_TYPE_MAX);
>
> ... since we are guaranteed to have always >0 insn->off and despite the
> __s16 type in off we might be able to safely assume that sk_buff will
> never get extended so far w/o fist fights first, where this could wrap
> around. ;) Alternatively, perhaps a BUILD_BUG_ON() for really being
> paranoid?
Ok, but in a follow-up patch?
Thanks,
Hannes
^ permalink raw reply
* Re: [PATCH net-next] net: filter: constify detection of pkt_type_offset
From: Daniel Borkmann @ 2014-09-12 10:55 UTC (permalink / raw)
To: Hannes Frederic Sowa
Cc: netdev, Eric Dumazet, Markos Chandras, Martin Schwidefsky,
Alexei Starovoitov, Denis Kirjanov
In-Reply-To: <09acea1aba100a62551605ba52ae8541e816d1e6.1410517225.git.hannes@stressinduktion.org>
On 09/12/2014 12:22 PM, Hannes Frederic Sowa wrote:
> Currently we have 2 pkt_type_offset functions doing the same thing and
> spread across the architecture files. Remove those and replace them
> with a PKT_TYPE_OFFSET macro helper which gets the constant value from a
> zero sized sk_buff member right in front of the bitfield with offsetof.
> This new offset marker does not change size of struct sk_buff.
>
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Markos Chandras <markos.chandras@imgtec.com>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Daniel Borkmann <dborkman@redhat.com>
> Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
> Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Thanks for doing this, Hannes!
...
> static u64 __skb_get_pay_offset(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
> {
> return skb_get_poff((struct sk_buff *)(unsigned long) ctx);
> @@ -191,7 +167,7 @@ static bool convert_bpf_extensions(struct sock_filter *fp,
>
> case SKF_AD_OFF + SKF_AD_PKTTYPE:
> *insn = BPF_LDX_MEM(BPF_B, BPF_REG_A, BPF_REG_CTX,
> - pkt_type_offset());
> + PKT_TYPE_OFFSET());
> if (insn->off < 0)
> return false;
> insn++;
I think this can now be rewritten as ...
case SKF_AD_OFF + SKF_AD_PKTTYPE:
*insn++ = BPF_LDX_MEM(BPF_B, BPF_REG_A, BPF_REG_CTX,
PKT_TYPE_OFFSET());
*insn = BPF_ALU32_IMM(BPF_AND, BPF_REG_A, PKT_TYPE_MAX);
... since we are guaranteed to have always >0 insn->off and despite the
__s16 type in off we might be able to safely assume that sk_buff will
never get extended so far w/o fist fights first, where this could wrap
around. ;) Alternatively, perhaps a BUILD_BUG_ON() for really being
paranoid?
^ permalink raw reply
* Tool: netperf-wrapper and qdisc bulking
From: Jesper Dangaard Brouer @ 2014-09-12 10:40 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: Rick Jones, Eric Dumazet, Tom Herbert, Jamal Hadi Salim,
Alex Duyck, John Fastabend, Florian Westphal, Daniel Borkmann,
Hannes Frederic Sowa, David Miller
I going to use the tool called: "netperf-wrapper", for testing my qdisc
bulking patches. It is very useful for network measurements, that
involves running multiple concurrent instances of testing tools
(primarily netperf and ping)
For others to get easily started using this tool, I've written a mini-tutorial:
http://netoptimizer.blogspot.dk/2014/09/mini-tutorial-for-netperf-wrapper-setup.html
I'm currently using it for testing the Head-of-Line blocking issues
that bulking packets from the qdisc layer can possibly cause.
For that I've added an extra test called "tcp_upload_prio":
https://github.com/tohojo/netperf-wrapper/commit/1e6b755e8051b6
More detail on these test results will follow (likely next week)
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* [PATCH net-next] net: filter: constify detection of pkt_type_offset
From: Hannes Frederic Sowa @ 2014-09-12 10:22 UTC (permalink / raw)
To: netdev
Cc: Eric Dumazet, Markos Chandras, Martin Schwidefsky,
Daniel Borkmann, Alexei Starovoitov, Denis Kirjanov
Currently we have 2 pkt_type_offset functions doing the same thing and
spread across the architecture files. Remove those and replace them
with a PKT_TYPE_OFFSET macro helper which gets the constant value from a
zero sized sk_buff member right in front of the bitfield with offsetof.
This new offset marker does not change size of struct sk_buff.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Daniel Borkmann <dborkman@redhat.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
arch/mips/net/bpf_jit.c | 27 +--------------------------
arch/s390/net/bpf_jit_comp.c | 35 +----------------------------------
include/linux/skbuff.h | 10 ++++++++++
net/core/filter.c | 26 +-------------------------
4 files changed, 13 insertions(+), 85 deletions(-)
diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
index 0e97ccd..7edc083 100644
--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -765,27 +765,6 @@ static u64 jit_get_skb_w(struct sk_buff *skb, unsigned offset)
return (u64)err << 32 | ntohl(ret);
}
-#ifdef __BIG_ENDIAN_BITFIELD
-#define PKT_TYPE_MAX (7 << 5)
-#else
-#define PKT_TYPE_MAX 7
-#endif
-static int pkt_type_offset(void)
-{
- struct sk_buff skb_probe = {
- .pkt_type = ~0,
- };
- u8 *ct = (u8 *)&skb_probe;
- unsigned int off;
-
- for (off = 0; off < sizeof(struct sk_buff); off++) {
- if (ct[off] == PKT_TYPE_MAX)
- return off;
- }
- pr_err_once("Please fix pkt_type_offset(), as pkt_type couldn't be found\n");
- return -1;
-}
-
static int build_body(struct jit_ctx *ctx)
{
void *load_func[] = {jit_get_skb_b, jit_get_skb_h, jit_get_skb_w};
@@ -1332,11 +1311,7 @@ jmp_cmp:
case BPF_ANC | SKF_AD_PKTTYPE:
ctx->flags |= SEEN_SKB;
- off = pkt_type_offset();
-
- if (off < 0)
- return -1;
- emit_load_byte(r_tmp, r_skb, off, ctx);
+ emit_load_byte(r_tmp, r_skb, PKT_TYPE_OFFSET(), ctx);
/* Keep only the last 3 bits */
emit_andi(r_A, r_tmp, PKT_TYPE_MAX, ctx);
#ifdef __BIG_ENDIAN_BITFIELD
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 555f5c7..c52ac77 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -227,37 +227,6 @@ static void bpf_jit_epilogue(struct bpf_jit *jit)
EMIT2(0x07fe);
}
-/* Helper to find the offset of pkt_type in sk_buff
- * Make sure its still a 3bit field starting at the MSBs within a byte.
- */
-#define PKT_TYPE_MAX 0xe0
-static int pkt_type_offset;
-
-static int __init bpf_pkt_type_offset_init(void)
-{
- struct sk_buff skb_probe = {
- .pkt_type = ~0,
- };
- char *ct = (char *)&skb_probe;
- int off;
-
- pkt_type_offset = -1;
- for (off = 0; off < sizeof(struct sk_buff); off++) {
- if (!ct[off])
- continue;
- if (ct[off] == PKT_TYPE_MAX)
- pkt_type_offset = off;
- else {
- /* Found non matching bit pattern, fix needed. */
- WARN_ON_ONCE(1);
- pkt_type_offset = -1;
- return -1;
- }
- }
- return 0;
-}
-device_initcall(bpf_pkt_type_offset_init);
-
/*
* make sure we dont leak kernel information to user
*/
@@ -757,12 +726,10 @@ call_fn: /* lg %r1,<d(function)>(%r13) */
}
break;
case BPF_ANC | SKF_AD_PKTTYPE:
- if (pkt_type_offset < 0)
- goto out;
/* lhi %r5,0 */
EMIT4(0xa7580000);
/* ic %r5,<d(pkt_type_offset)>(%r2) */
- EMIT4_DISP(0x43502000, pkt_type_offset);
+ EMIT4_DISP(0x43502000, PKT_TYPE_OFFSET());
/* srl %r5,5 */
EMIT4_DISP(0x88500000, 5);
break;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 07c9fdd..756e3d0 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -548,6 +548,16 @@ struct sk_buff {
ip_summed:2,
nohdr:1,
nfctinfo:3;
+
+/* if you move pkt_type around you also must adapt those constants */
+#ifdef __BIG_ENDIAN_BITFIELD
+#define PKT_TYPE_MAX (7 << 5)
+#else
+#define PKT_TYPE_MAX 7
+#endif
+#define PKT_TYPE_OFFSET() offsetof(struct sk_buff, __pkt_type_offset)
+
+ __u8 __pkt_type_offset[0];
__u8 pkt_type:3,
fclone:2,
ipvs_property:1,
diff --git a/net/core/filter.c b/net/core/filter.c
index dfc716f..6cdc303 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -87,30 +87,6 @@ int sk_filter(struct sock *sk, struct sk_buff *skb)
}
EXPORT_SYMBOL(sk_filter);
-/* Helper to find the offset of pkt_type in sk_buff structure. We want
- * to make sure its still a 3bit field starting at a byte boundary;
- * taken from arch/x86/net/bpf_jit_comp.c.
- */
-#ifdef __BIG_ENDIAN_BITFIELD
-#define PKT_TYPE_MAX (7 << 5)
-#else
-#define PKT_TYPE_MAX 7
-#endif
-static unsigned int pkt_type_offset(void)
-{
- struct sk_buff skb_probe = { .pkt_type = ~0, };
- u8 *ct = (u8 *) &skb_probe;
- unsigned int off;
-
- for (off = 0; off < sizeof(struct sk_buff); off++) {
- if (ct[off] == PKT_TYPE_MAX)
- return off;
- }
-
- pr_err_once("Please fix %s, as pkt_type couldn't be found!\n", __func__);
- return -1;
-}
-
static u64 __skb_get_pay_offset(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
{
return skb_get_poff((struct sk_buff *)(unsigned long) ctx);
@@ -191,7 +167,7 @@ static bool convert_bpf_extensions(struct sock_filter *fp,
case SKF_AD_OFF + SKF_AD_PKTTYPE:
*insn = BPF_LDX_MEM(BPF_B, BPF_REG_A, BPF_REG_CTX,
- pkt_type_offset());
+ PKT_TYPE_OFFSET());
if (insn->off < 0)
return false;
insn++;
--
1.9.3
^ permalink raw reply related
* [PATCH net] net: fix sysfs symlinks of adjacent devices
From: Alexander Fomichev @ 2014-09-12 10:13 UTC (permalink / raw)
To: netdev
Cc: David Miller, Cong Wang, Vlad Yasevich, Andres Freund,
Alexander Y. Fomichev
From: "Alexander Y. Fomichev" <git.user@gmail.com>
__netdev_adjacent_dev_insert may add adjacent device from another
namespace. Without proper check it leads to emergence of broken
symlink from/to device not existing in current namespace.
Fix: check net_ns is the same before netdev_adjacent_sysfs_add/del
related to: 4c75431ac3520631f1d9e74aa88407e6374dbbc4
Signed-off-by: Alexander Y. Fomichev <git.user@gmail.com>
---
net/core/dev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index ab9a16530c36..887784b2dcde 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4841,7 +4841,8 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
pr_debug("dev_hold for %s, because of link added from %s to %s\n",
adj_dev->name, dev->name, adj_dev->name);
- if (netdev_adjacent_is_neigh_list(dev, dev_list)) {
+ if (netdev_adjacent_is_neigh_list(dev, dev_list) &&
+ net_eq(dev_net(dev), dev_net(adj_dev))) {
ret = netdev_adjacent_sysfs_add(dev, adj_dev, dev_list);
if (ret)
goto free_adj;
@@ -4862,7 +4863,8 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
return 0;
remove_symlinks:
- if (netdev_adjacent_is_neigh_list(dev, dev_list))
+ if (netdev_adjacent_is_neigh_list(dev, dev_list) &&
+ net_eq(dev_net(dev), dev_net(adj_dev)))
netdev_adjacent_sysfs_del(dev, adj_dev->name, dev_list);
free_adj:
kfree(adj);
--
2.1.0
^ permalink raw reply related
* Re: [BUG REPORT] Unencrypted packets after SNAT, allthough IPSEC-Policies are present
From: Steffen Klassert @ 2014-09-12 9:31 UTC (permalink / raw)
To: Konstantinos Kolelis
Cc: netdev, davem, kuznet, jmorris, yoshfuji, kaber, herbert
In-Reply-To: <54119F75.8090305@sirrix.com>
On Thu, Sep 11, 2014 at 03:11:17PM +0200, Konstantinos Kolelis wrote:
> Am 11.09.2014 13:54, schrieb Steffen Klassert:
> > On Wed, Sep 10, 2014 at 07:26:53PM +0200, Konstantinos Kolelis wrote:
> >> Hi all,
> >>
> >> i' ve observed a problem with xfrm lookups, SNAT, blackhole route and
> >> missing SAs.
> >> The problem occures with all Kernels above 3.6.x and might has to do
> >> with the changes in
> >> ip4_blackhole_route() function in net/route.c.
> >
> > Thanks for the report!
> >
> > Is kernel v3.6 the first kernel with this issue? It seems that
> > we have this problem already longer, at least if my analysis
> > is correct.
> >
>
> It worked until Kernel 3.4.103, i did not check with v3.5 though.
Hm. I thought the problem exists already for longer, so I did
a bisect. To my surprise, the following commit introduced the bug:
commit a263b3093641fb1ec377582c90986a7fd0625184
Author: David S. Miller <davem@davemloft.net>
Date: Mon Jul 2 02:02:15 2012 -0700
ipv4: Make neigh lookups directly in output packet path.
Do not use the dst cached neigh, we'll be getting rid of that.
Signed-off-by: David S. Miller <davem@davemloft.net>
But this is not really the offending commit. As I said, the problem
was introduced by git commit 2774c131 ("xfrm: Handle blackhole route
creation via afinfo.") because the assumption that dst_output() is
called always after a xfrm_lookup() is wrong. On postrouting nat,
dst_output() is not called for blackholed packets. But we were in luck
because ip_finish_output2() tried to use a dst cached neigh entry.
On blackhole routes we did not cache neigh entries, so the packets
were dropped in the last moment. The above commit finally opened the
door by replacing the usage of a dst cached neigh entry by a direct
lookup.
So we need to ensure that a blackhole route is generated only by the
route lookup functions.
>
> >>
> >> Let say you have two network interfaces:
> >> eth0 with ip 172.16.0.10/24
> >> and
> >> eth1 with ip 192.168.0.1/24
> >>
> >> and you have done the following configuration:
> >>
> >> iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to-source
> >> 172.16.0.10
> >>
> >> and
> >>
> >> ip xfrm policy add dir out src 172.16.0.10 dst 0.0.0.0/0 tmpl proto esp
> >> src 172.16.0.10 dst 172.31.0.10 mode tunnel
> >>
> >> with the following routes:
> >> default via 172.16.0.1 dev eth0 proto static
> >> 172.16.0.0/24 dev eth0 proto kernel scope link src 172.16.0.10
> >> 192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.1
> >>
> >> If for what ever reason IPSEC-SAs can not be established, maybe because
> >> 172.31.0.10 is down,
> >> the traffic comming from 192.168.0.0/24 will leave unencrypted the
> >> external (eth0) interface.
> >
> > I can reproduce it with SNAT and MASQUERADE. Looks like this was
> > introduced back in 2011 with git commit 2774c131 ("xfrm: Handle
> > blackhole route creation via afinfo.").
> >
> > Before that commit, xfrm_lookup() and __xfrm_lookup() returned
> > an error if we have a matching policy but no states. The route
> > lookup functions used __xfrm_lookup() and generated a blackhole
> > route if __xfrm_lookup() returned -EREMOTE. All other functions
> > used xfrm_lookup() which returned -EAGAIN. This was treated as
> > as an error and the packet was dropped immediately.
> >
> > After this commit all callers to xfrm_lookup() rely that
> > dst_output() is called afterwards. This seems to be not the
> > case, at least when postrouting nat is used.
> >
> > Maybe we should go back to let only the route lookup functions
> > genarate a blackhole route. Everyone else should better drop
> > the packets immediately.
> >
> > I'll try to do a patch.
> >
>
> You should also check what happens if xfrm_larval_drop is false.
> Allthough blackhole route was not used, you could still run into the
> same problem. It just took a while longer.
>
Yes, I'm aware of that. Thanks for the hint!
^ permalink raw reply
* Re: [PATCH v2 net-next] net: filter: export pkt_type_offset() helper
From: Hannes Frederic Sowa @ 2014-09-12 8:25 UTC (permalink / raw)
To: Denis Kirjanov, Alexei Starovoitov
Cc: Eric Dumazet, David Laight, Denis Kirjanov, Daniel Borkmann,
Eric Dumazet, netdev, Markos Chandras, Martin Schwidefsky
In-Reply-To: <CAOJe8K2eQ9ejhBTk7MzJJK5EB4D62U4uKDiFFQFh+T16E7=S3A@mail.gmail.com>
Hi,
On Fri, Sep 12, 2014, at 09:09, Denis Kirjanov wrote:
> Hi guys, sorry, I was on vacation and didn't notice you. I'll continue to
> work on that.
I have the patch still in my pipeline but just wanted to hear from you
again (or you time out), if you would still like to work on it.
Otherwise will send it out later today.
Bye,
Hannes
^ permalink raw reply
* [PATCH firmware] rtl_nic: add firmware for RTL8168H and RTL8107E
From: Hayes Wang @ 2014-09-12 6:54 UTC (permalink / raw)
To: dwmw2, ben; +Cc: netdev, linux-kernel, hau, ivecera, Hayes Wang
File: rtl_nic/rtl8168h-1.fw
Version: 0.0.1
File: rtl_nic/rtl8168h-2.fw
Version: 0.0.1
File: rtl_nic/rtl8107e-1.fw
Version: 0.0.1
File: rtl_nic/rtl8107e-2.fw
Version: 0.0.1
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
WHENCE | 12 ++++++++++++
rtl_nic/rtl8107e-1.fw | Bin 0 -> 2496 bytes
rtl_nic/rtl8107e-2.fw | Bin 0 -> 2464 bytes
rtl_nic/rtl8168h-1.fw | Bin 0 -> 2496 bytes
rtl_nic/rtl8168h-2.fw | Bin 0 -> 2464 bytes
5 files changed, 12 insertions(+)
create mode 100644 rtl_nic/rtl8107e-1.fw
create mode 100644 rtl_nic/rtl8107e-2.fw
create mode 100644 rtl_nic/rtl8168h-1.fw
create mode 100644 rtl_nic/rtl8168h-2.fw
diff --git a/WHENCE b/WHENCE
index 26cabf4..3ffc68e 100644
--- a/WHENCE
+++ b/WHENCE
@@ -2149,6 +2149,18 @@ Version: 0.0.1
File: rtl_nic/rtl8168g-3.fw
Version: 0.0.1
+File: rtl_nic/rtl8168h-1.fw
+Version: 0.0.1
+
+File: rtl_nic/rtl8168h-2.fw
+Version: 0.0.1
+
+File: rtl_nic/rtl8107e-1.fw
+Version: 0.0.1
+
+File: rtl_nic/rtl8107e-2.fw
+Version: 0.0.1
+
Licence:
* Copyright © 2011-2013, Realtek Semiconductor Corporation
*
diff --git a/rtl_nic/rtl8107e-1.fw b/rtl_nic/rtl8107e-1.fw
new file mode 100644
index 0000000000000000000000000000000000000000..5ac3d62bcd6adb9a28bc84dcccbccd99a0dab290
GIT binary patch
literal 2496
zcmY+`aY$8J9tZH#8`lw6?5({q$7vb~2?^JE&%|{l<k3V(NQ6j4L^+P@NJxlCL_~YW
ziHK+%iHL{@S0o~$iHMMB#F5sG2x%iCB;p|w5z$0MM1;E^o!MpPzW3qxJ?Fl2&b{~i
z@ooqq^!4{NWYT~6+n+PL(lzOtOhx*ypJ!@6&(t}$aJ18w2;uLcwWWS-eeJH^FZ;jh
z-c_5<)TNE9`Ks&dicDSO+Dv0+ZTN1qa$(G`WoStV*~z7!#SjW8q=;gYl#rq{eh@+~
z`dvXT#HG1J{8KJ3F3aV|k8%ZZd9E;ioGXf-<ci~m|1$2=k~sTaD*n`58WaC4i{Z!e
zI2TsLiQG!<3hh;~G*Kz9maELaMy{4?<aA6-)y6PhC)djja-+OXZj!U|dU=DqQEp}v
zEo^2Bt+cU~ZER-;J87qbPP*u3H$Cj3mp=O0%RcsVfP+K^IK*L&aFk;VGQ@FCaFSD;
z<_u>UW`t4Bah?lY<Pw*;!d0#@#&vEm&IFU(WQtqd<_^=`<sSEWz(Zzu#A9;IGRG61
z@{H%a;3cnk%^TkGj`z$Hz6l{g9{ChdND;*(DIrBEWt6jml~k~bN>)?F8mg%wO)YiQ
z(?BEZXd=scHn5RqHqpXnw$Mr&TiM2TcCeFnI_RW}Zg$hd9(w7cpS|p3KL<ESWPn2)
z<_JeQ#vnr+=L9D?#c9rPmSIL1<s9d^z(p=`nJZl78e?4N2IEXH$xWuX#cl2|&0X$s
zp9ef-hDSUm$1HO^;VI8}&I?}hir2j1E$?{GJYm58lSe)U6jDSnNlHjjN*U#>U?ml-
zqLS5Av4(1DNK;E4^)%4PI-1C`o(*iInN75?nJu)^##XkmogM6?oenzbqMP0Hu!mmy
z=w~nc*v|nD5*gqShdIJgjxop($2q}CPH~zuoMo61MmfiME^v`cT;>W_xyBgRxxqLS
zOmdScZgHDCOmmle+~)xgnc)$S$uY|uPk72Rp7Vm2yy7))c*{H9Gf()|{*y;O1r$<5
zF-b~DQA!!*tY9S-tfG?DRI!F?YDiN{9rZNO$U2(HvYriWq?t{$u$e8i(#BS{v7H_4
zq@4~r>7tw6^st9s`simb``FI`4iXvQ5QjO!QI0Xl5XU*eNltN^Gn{3Z5k@)3c`k5~
zOI+p(SGmR**SWzs6HIcGDQ<C_J4|zzd)(&%51HW+kI6C198Y-4GoJH;m%QRNZ+Oc)
z-ZTI0;=4l3kF(wvl8M6jK`2}JPsk4Zap4^z>9hEqh>PveyTpPEU0EBS4T<4S4=98`
zq`xTqELO#3F?6J2&DgTIB&6a(UxhrBNX3$2=k%r2yy{d;{?<q;F8PPP=~V2^rDAre
z_78lYicMwu2jy?nfmEESO2zVD=gL=?n=?=SNKL5A)S&*`xP`To)?T=d5Pn(zm-|{C
e=Km8aLRdcW|LZpHfA{?J;<@BRc5z(z-SJ;Ub$cHG
literal 0
HcmV?d00001
diff --git a/rtl_nic/rtl8107e-2.fw b/rtl_nic/rtl8107e-2.fw
new file mode 100644
index 0000000000000000000000000000000000000000..949ca670fa31242940caa9f2222c0e268274ae0c
GIT binary patch
literal 2464
zcmYk;aY$8J9tZH#8^>`RF~{DR>$HtD5)!UGO&nJu-nb@ixDgT(5$QUPE3Jr#L`1|H
zCnBN=iHL{@35kd{A|fPOainn~A|fIpA|4_U5p6_7MA&|GnxXsNhu`<yd(S!d-Sfvg
zA%rk6*jrbX`sVw;RJW%pQ<YVvslTqQs$N-D<J#QO!9Nlqd>dL@YFE`(H?%jl{=IE&
zYkU7c2fyoSZ|eJguzl^?wUys>|EsjBrhZjbebqPNr_r*xz6(M~PcHl_hLA%pdE`?-
zAxVnjM<HaQ`*JcNF3cq2=b5ayD3cw($mGPuncVoNOkVsllOI3%Rlh$M#_6Au@#p5E
znE0hQhX0ntnXn{IWR_}|YA=gLi86V)TyFdoa)n$er($BNI)?EYxmK=|>*dw*8aXXD
z$c=K7+{`*!SkDGp*+?6k*vuBT(m^L(bkoB&dg-H|0S4L54tBDO-9(1i!(R5Wp936Z
zm_r=q2uC@_aZWJ8Nk%!vY0hw#bDZY_7rDe3m$||?6HIcIDXwvy8{Fg;x4FYz?s1<7
zJS4+3Gd$ukPk72Rp7Vm2yy7))c*`u|hY%8EkxdS{<dIJSg(NAWm=cz-lv0*a#&XJ8
zK?RkhsHTQm>ZoTmYe>^TBTY23juzIlfmSxs#wIqig{^eZNf+Jpu#H~&=x2aIwzGqs
z>|!^OA@;DBeeCA|2N~uNhdIJgj&Yn5jBt`sPH~zuoaG$nxxhs(F~()CFwO*%TxE)D
zT;~Qixy5bnaF=`B=K&ANFwG2)c+3-?@{H%a;3cnk%^Th_OBk~LWRXn{x#W>g0fi(f
zqL>nvu#{4kQO0u0SwRJrq^PEbTI#50HET%IKqE~wvyK+lvw>DN(#9q>vxTj6&`B5F
z^stRy`sinXLAJAlo$O*aks<c5mwoK#00$Z75QjO!QI2t(6O3?@QBHB1Go0ld=efW|
zE-}Vst}xC7lU!wrYh33BH@U@a?r@iT+~)xg$uP|fk9f=zp7M<6yx=9Tc+DH$GE4Z;
z`jbUAIpmT@J_Qt#q=;flSi(|DSw<PlDQ5*0RFa~a8fvMdp4F@&O#_WI(abtpSkDGp
z*+?6k*vuBT(m^L(bkoB&dg-H|0S4L54tBDO-9(1i!(R5Wp936Zm_r=q2uC@_aZWJ8
zNk%!vY0hw#bDZY_7rDe3m$||?6HIcIDXwvy8{Fg;x4FYz?s1<7JS4+3Gd$ukPk72R
zp7Vm2yy7))c+2dM^LvGu9jEOV3KF^Tqfk8epO7B<Y;F%x;4}Z7i1Y2xzrciZr_vTa
z9TFp5UQh@hr~a1vRV<H-;)2d(tQ=EAGR~bVm4_3_SU9rCc*&SlvnrDD(+@28PcnX}
z_v>UVd4GSl`fgz|X1%Y8_cf^hUX+|4zrgr&bA|BR9KSvL;xPLzl!mZ);`e8poB#LU
Q^}qRR1rzD{e&LVf|B-EW9{>OV
literal 0
HcmV?d00001
diff --git a/rtl_nic/rtl8168h-1.fw b/rtl_nic/rtl8168h-1.fw
new file mode 100644
index 0000000000000000000000000000000000000000..4bdd3825e3bdc9a15ddd87c199636bda4afb4169
GIT binary patch
literal 2496
zcmY+`aY$8J9tZH#8^;k>?2Wz5b=pQkLc+19<2tT{JlY5ei4cj1D8~^;LPSI&BI1k_
z5z)935fKrtNJK;%5h2ltBaIUg(nLf^#6u(^qK$}%2zNhPyX@ZgKK#Dt+;`5o_ntrA
z4IzZS{_gtfy85oKs&}WW(pA-E>A$S2u31-I>)gW8Mr$I3p3u@<_jO&(?%r?vzw6pv
zldi5!SEs+J`mXc)vg+D~uhR{G{wDl1TD~ymV;Nc!LS}O5mobDq@+qK@Bt@hsj-P~(
zjeeJx4RL8U5kJr7#AVssxICK|S7h_!AF~DVi)>;1>^I~7R1{}_O2uEAieuu}k{Et2
zjdNjToXD=yF4JBeixcJY8o9#!YvoG0N>0bbR80)ywQ`+YFE_~R<wiLpZ;&_2o8%@o
z)65pO(n2fS*v<}ivWqs_>7bJ?_Rviaz4Xz~UiPt{0~{nWz#$HEgrgi|kRgt9f|H!$
zG-o)=Fe8j|j`LjLBA2+#6|QoPF|KoiaVD7LCR5zvHg}ljF88?410FKNBOa4wmN}mA
zlxIBW1uuEUYu@mdcf4nw@Iwd*a>yl*d<rNeNf9ZEDWQ~=tfGw7l(U8k)>26oX=<pY
zj(QqcPa_#Nu#rtPv6*JJu$2~C*~WHuu#;W1(M|`Qbg_qSdg!H(e)h7D{T$#RkpT{I
zm?IqJ7=sLPoD-bn6sI}ES%w*5lyjWt0vEZ&Wv+0QYm9N78;mo-BsZDj7Pq;>G<Uhj
zeID?T86NSNEVIn<gr_{?IWKt0D_--4x4h#$^MnEWPY$`{kxv1IBq<_AF(s6;l2w$k
znsU}q!CES*B25jo)KO0Z>uDsz1~#&ZCN|T|7PittE8E!44tBDOHrnZ+lP>nqO%J{F
z(a&D?v7ZARBr?Du4s(Q~9Al6nj&p*OoZ>WRILk02jB<|iT;L*?xXcx<a*Z*rbAxdv
znB*o?+~PKOnC33`xX%L~GQ%StlVz4Up74}sJm&>3dBtnq@RoPHXP)q*{U?W9^2n!v
zLXs4bqL>m&S;;EOSWP)=s9-IXRFS5JTI#5$f%P<!VFMf4L=&57W(!+sp_OfHX9qjk
zMH}sO&`B42=%$BW`simb``FI`4iXvQ5QjO!QI0Xl5XU*eNltN^Gn{3Z5k@)3c`k5~
zOI+p(SGmR**SWzs6HIcGDQ<C_J4|zzd)(&%51HW+kI6F298Y-4GoJH;m%QRNZ+Oc)
z-ZTH>;=4l3jkDetl8OBINhn$PPsj}XVc{Jj>9hEqh>PveyTpPET^Spn35nqj4=99B
z(|^tXGFHT8F|?;*)!4GQB&6a(Uzt3VNX4RI=k%r2oXS*8{;!c#T=I8))2Y~-O~uSo
z?SJsMRBSBKKPdm84y58tMJkqloGVvdVa^<NxtdUysX_hSxP`To)?T=d5I(H`;l5Uc
e`G1A75LQh5_qvVy&prQh@mz8uvp6pN-|=rm*n1xU
literal 0
HcmV?d00001
diff --git a/rtl_nic/rtl8168h-2.fw b/rtl_nic/rtl8168h-2.fw
new file mode 100644
index 0000000000000000000000000000000000000000..949bacc1614d6e1014736611bd371ef30a3e8daf
GIT binary patch
literal 2464
zcmYk;aY&Wt9tZHJGp}<_%-NYaZ)?&dB)oQXB2HQyoQVq;At4cw&N;6%5fO=qi08V9
zh!zqN5fKs+5iKGjB)a02<{}~@A|fIVA`uZSA|fJeA6>ibJ?F#k`@HY_JkNXH=a2J*
z5W>J<Z(UVwUC+O&+f$XP%Bs@Tmn*BPS60=yHg|OJZ6buPLTgLy7q!(5?TxM9w5@4v
z@BeP_`=0iuz8?nL*Q{An`F;1lORH+?zo@EDRfnHP%jWtn2q8VW@Us{~4!Pu!PXUD_
zDT?ofkcsZg$%MEtlZYQ>vf`plcKkS#6BlQ4<0qNC_|Hs!eE&E7J}r#XKPTh=nu}uM
z*WwudTM}o&k~ooBs$HtREEXlo<mGa?@mI(da;2P#iK*%s#%ttSxlXQ^SIMj8wA>&!
z%1v@JYiVH}>uF^JZER!{o7qAKopjMn4_oP_kA4OiWE<Pr!A^D&8Dckk*vmflbAVwE
za)`qm;V8#A&Il(M<s_##%^A*ej`LjLB4b?QGUH4z$rYx!$~CTYgPYvqHg~woJ?`^>
z4Aac;kVib`2~T;(b6)V0SG?v8vxNVIkRXd}a>yl*d<rNeNfE`Au!N<QvWzm8Q_c!1
zs3b)-HPli^J*!wvng$waqM5a{u#WY#vVk@>vWd-Xp@UAk=%$CQ^wLK^0}Qf_?d)JD
zyNC?2n?3AhANx7LFb6rrVUBQ=V;pCM6O3|_Q=H}uXF11tE^v`CE^(Q0CYa<3Q(Wa5
z*SWz>ZgHDC+~pqkc|e9~W_ZXW9`l5!JmWbpc*!eX^M+Z%ko6~vY;wpYk9-O!BuNp)
zl(2-Ql(LL6mQ&6ODySqyH8s>yM?I@pO_~N8X`-36w6Ko#w6cLVHnNG$Y@vfry6C2d
zt@P4IKLZT1jqU7UC%cFYv70^YWgq)Fz%U0n#9@wblw%xcgcFQ%l2e@K3}-pVc`k5~
zF)neLaVD7L3R7I=8rQkOO>S|UJKW_S_jy2uX=ZrHBOddFr#$01FL=o-Uh{@o!cW$p
zEV9WVmpt+*ppYa*6jQ<ymQu<x%2-Z0E2yB76xGyFOC9yBVl`<RXrzf|*3!Z{*3-%c
z+Ste@HnW8eI_aXD9=6g;AN>q4$TqgKgPrUmGQ@87u$O)8=K#YT<Pe8B!cmTKoDohi
z%1KUfnlqf`9Ot>fMaH<qWyYCck}FJcm1|t*1~<9IZSHWFd)(&%8K#-xA&+>>6Q1&n
z=e*!0uXxQHW`COBE5z(LZNE^E$c^uX;<^8X^w5WMdx!#``R_!WZ-@Q`CY(E!w(#kY
z80qqYLik7O>)g*`d0Z41bS7ivm>QCC?p&!noJhvPkwwN!#-y56k&GYw&4OQ&@$Y&+
zPsWmW_h+kb7bauYyP9}cgZks5<ox&r#-E!jgg@u_^Vt`N*|(uIgvAqoJ=@&;fBmlC
P=dTq^r04sE{~vz<lf`x)
literal 0
HcmV?d00001
--
1.9.3
^ permalink raw reply related
* Re: [PATCH] net/phy: micrel: Disable asymmetric pause for KSZ9031
From: Mike Looijmans @ 2014-09-12 6:54 UTC (permalink / raw)
To: Florian Fainelli, netdev; +Cc: linux-kernel
In-Reply-To: <5411ECE9.8050600@gmail.com>
On 09/11/2014 08:41 PM, Florian Fainelli wrote:
> On 09/11/2014 06:45 AM, Mike Looijmans wrote:
>> Our KSZ9031 appears to suffer from the same hardware bug as described
>> for the KSZ9021 in commit 32fcafbcd1c9f6c7013016a22a5369b4acb93577,
>> you have to unplug the cable and plug it back to get it to work.
>>
>> Remove the SUPPORTED_Asym_Pause flag for the KSZ9031 to fix this.
>
> Can you resend this patch specifying the commit subject in parenthesis
> like this:
>
> commit 32fcafbcd1c9f6c7013016a22a5369b4acb93577 ("net/phy: micrel:
> Disable asymmetric pause for KSZ9021")
I'll amend the text body and resend the patch.
> since this is a bugfix, it should probably be targeting the 'net' tree,
> rather than the 'net-next' tree, though the patch applies to both cleanly.
I assume this does not require any action on my side? I actually based
this patch on a 3.14 kernel.
> Other than that:
>
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
>
>>
>> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
>> ---
>> drivers/net/phy/micrel.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
>> index 5a8993b..a932a35 100644
>> --- a/drivers/net/phy/micrel.c
>> +++ b/drivers/net/phy/micrel.c
>> @@ -425,8 +425,7 @@ static struct phy_driver ksphy_driver[] = {
>> .phy_id = PHY_ID_KSZ9031,
>> .phy_id_mask = 0x00fffff0,
>> .name = "Micrel KSZ9031 Gigabit PHY",
>> - .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause
>> - | SUPPORTED_Asym_Pause),
>> + .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause),
>> .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
>> .config_init = kszphy_config_init,
>> .config_aneg = genphy_config_aneg,
>>
>
--
Mike Looijmans
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox