* Fw: [Bug 68821] New: splittcp with tproxy has issues when timestamp is enabled
From: Stephen Hemminger @ 2014-01-16 17:34 UTC (permalink / raw)
To: netdev
Begin forwarded message:
Date: Thu, 16 Jan 2014 05:39:52 -0800
From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
To: "stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: [Bug 68821] New: splittcp with tproxy has issues when timestamp is enabled
https://bugzilla.kernel.org/show_bug.cgi?id=68821
Bug ID: 68821
Summary: splittcp with tproxy has issues when timestamp is
enabled
Product: Networking
Version: 2.5
Kernel Version: 3.2
Hardware: All
OS: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: IPV4
Assignee: shemminger@linux-foundation.org
Reporter: shailendra7479@gmail.com
Regression: No
Hi,
I am having an application which does splittcp with transparency. I have a NAT
box which reuses the 5-tuple frequently. Due to this there is a possibility
that some connections with the same tuple go through our splittcp and some may
go directly to the webserver.
Due to this, the webserver is getting confused and not responding with
SYN-ACKs.
Is there a way to enable transparency in TIMESTAMPs when tproxy is involved for
eg., preserve the incoming timestamp in the outgoing SYN.
Shouldn't the kernel be using the client's timestamp in the outgoing SYNs when
transparency is enabled?
Thanks
Shailendra
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply
* Re: [PATCH net-next v4 1/2] dts: Add a binding for Synopsys emac max-frame-size
From: Ben Hutchings @ 2014-01-16 17:50 UTC (permalink / raw)
To: Vince Bridgers
Cc: devicetree, netdev, peppe.cavallaro, robh+dt, pawel.moll,
mark.rutland, ijc+devicetree, galak, dinguyen, rayagond
In-Reply-To: <1389881155-9758-2-git-send-email-vbridgers2013@gmail.com>
On Thu, 2014-01-16 at 08:05 -0600, Vince Bridgers wrote:
> This change adds a parameter for the Synopsys 10/100/1000
> stmmac Ethernet driver to configure the maximum frame
> size supported by the EMAC driver. Synopsys allows the FIFO
> sizes to be configured when the cores are built for a particular
> device, but do not provide a way for the driver to read
> information from the device about the maximum MTU size
> supported as limited by the device's FIFO size.
>
> Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
> ---
> V4: add comments to explain use of max-frame-size with respect
> to inconsistent definition and use in the ePAPR v1.1 spec
Well, ePAPR does not seem to be consistent with itself. :-)
> V3: change snps,max-frame-size to max-frame-size
> V2: change snps,max-mtu to snps,max-frame-size
> ---
> Documentation/devicetree/bindings/net/stmmac.txt | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
> index eba0e5e..d553be2 100644
> --- a/Documentation/devicetree/bindings/net/stmmac.txt
> +++ b/Documentation/devicetree/bindings/net/stmmac.txt
> @@ -29,7 +29,17 @@ Required properties:
> ignored if force_thresh_dma_mode is set.
>
> Optional properties:
> -- mac-address: 6 bytes, mac address
> +- mac-address: 6 bytes, mac address
> +- max-frame-size: Maximum frame size permitted. This parameter is useful
> + since different implementations of the Synopsys MAC may
> + have different FIFO sizes depending on the selections
> + made in Synopsys Core Consultant. Note that the usage
> + is inconsistent with the definition in the ePAPR v1.1
> + specification, as it defines max-frame-size inclusive
> + of the MAC DA, SA, Ethertype and CRC while usage is
> + consistent with the IEEE definition of MAC Client
> + Data, which is sans the MAC DA, SA, Ethertype and
> + CRC.
[...]
While this is very precise, I fear that it is now so verbose that it
actually becomes confusing. Can this not be condensed to 'the maximum
MTU and MRU, rather than the maximum Ethernet frame size'?
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH net-next v3 5/5] virtio-net: initial rx sysfs support, export mergeable rx buffer size
From: Eric Dumazet @ 2014-01-16 18:04 UTC (permalink / raw)
To: Michael Dalton
Cc: Michael S. Tsirkin, netdev, lf-virt, Eric Dumazet,
David S. Miller
In-Reply-To: <CANJ5vPJi=k1Wk43j+-XjSgnnAS5uO9wrYQuDnrdfA5A+DGxvQg@mail.gmail.com>
On Thu, 2014-01-16 at 09:27 -0800, Michael Dalton wrote:
> Sorry, just realized - I think disabling NAPI is necessary but not
> sufficient. There is also the issue that refill_work() could be
> scheduled. If refill_work() executes, it will re-enable NAPI. We'd need
> to cancel the vi->refill delayed work to prevent this AFAICT, and also
> ensure that no other function re-schedules vi->refill or re-enables NAPI
> (virtnet_open/close, virtnet_set_queues, and virtnet_freeze/restore).
>
> How is the following sequence of operations:
> rtnl_lock();
> cancel_delayed_work_sync(&vi->refill);
> napi_disable(&rq->napi);
> read rq->mrg_avg_pkt_len
> virtnet_enable_napi();
> rtnl_unlock();
>
> Additionally, if we disable NAPI when reading this file, perhaps
> the permissions should be changed to 400 so that an unprivileged
> user cannot temporarily disable network RX processing by reading these
> sysfs files. Does that sound reasonable?
I think all this complexity makes no sense to me.
Who cares of sysfs reading a value that might be updated ?
This is purely a debugging utility.
As soon as you read the value, it might already have changed anyway.
Its a integer, just read it without special care.
atomic_read() has also same 'problem', and we do not care.
Make sure that a recompute (aka ewma_add()) does not store intermediate
wrong values, by using ACCESS_ONCE(), and thats enough. No need for the
seqcount overhead.
diff --git a/lib/average.c b/lib/average.c
index 99a67e662b3c..044e0b7f28a8 100644
--- a/lib/average.c
+++ b/lib/average.c
@@ -53,8 +53,10 @@ EXPORT_SYMBOL(ewma_init);
*/
struct ewma *ewma_add(struct ewma *avg, unsigned long val)
{
- avg->internal = avg->internal ?
- (((avg->internal << avg->weight) - avg->internal) +
+ unsigned long internal = ACCESS_ONCE(avg->internal);
+
+ ACCESS_ONCE(avg->internal) = internal ?
+ (((internal << avg->weight) - internal) +
(val << avg->factor)) >> avg->weight :
(val << avg->factor);
return avg;
^ permalink raw reply related
* Re: [PATCH net-next 1/2] bonding: add sysfs /slave dir for bond slave devices.
From: Scott Feldman @ 2014-01-16 18:04 UTC (permalink / raw)
To: Veaceslav Falico
Cc: Jay Vosburgh, Andy Gospodarek, Netdev, Roopa Prabhu,
Shrijeet Mukherjee
In-Reply-To: <20140116153142.GD1896@redhat.com>
On Jan 16, 2014, at 7:31 AM, Veaceslav Falico <vfalico@redhat.com> wrote:
> On Wed, Jan 15, 2014 at 09:54:34PM -0800, Scott Feldman wrote:
>> Add sub-directory under /sys/class/net/<interface>/slave with
>> read-only attributes for slave. Directory only appears when
>> <interface> is a slave.
>> +static ssize_t state_show(struct slave *slave, char *buf)
>> +{
>> + switch (bond_slave_state(slave)) {
>> + case BOND_STATE_ACTIVE:
>> + return sprintf(buf, "active\n");
>> + case BOND_STATE_BACKUP:
>> + return sprintf(buf, "backup\n");
>> + default:
>> + return sprintf(buf, "UNKONWN\n");
>> + }
>> +}
>> +static SLAVE_ATTR_RO(state);
>
> Am I missing something or does it really completely lacks any locking?
>
> What prevents the slave to be freed in between?
Correct me if I’m wrong, but I think the equivalent question is: is there a race between sysfs_remove_file() and another CPU open on that file trying to read/write the file? I believe the answer is no, but I’ll defer to the experts.
The file removal call path is:
bond_release (ndo_del_slave)
__bond_release_one
bond_sysfs_slave_del
sysfs_remove_file
<...continue freeing slave...>
So slave is freed after sysfs_remove_file. I would expect I/O on sysfs file to fail during sysfs_remove_file.
Does this sound OK? Am I missing anything else?
-scott
^ permalink raw reply
* Re: [Patch net-next] net_sched: act: remove capab from struct tc_action_ops
From: Cong Wang @ 2014-01-16 18:28 UTC (permalink / raw)
To: Jamal Hadi Salim; +Cc: Linux Kernel Network Developers, David S. Miller
In-Reply-To: <52D7DEDF.6050006@mojatatu.com>
On Thu, Jan 16, 2014 at 5:30 AM, Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> On 01/15/14 18:49, Cong Wang wrote:
>>
>> It is not actually implemented.
>
>
> Why dont you do something more useful like allow user to
> query capability?
> If that doesnt make sense - lets talk offline.
>
It does. But who cares? The code was there since the beginning
of git history, no one complains it is not implemented. :)
If you or someone else requests for it, we can definitely keep it.
^ permalink raw reply
* [PATCH net-next 1/2] qlcnic: make local functions static
From: Stephen Hemminger @ 2014-01-16 18:31 UTC (permalink / raw)
To: Himanshu Madhani, Rajesh Borundia, Shahed Shaikh,
Jitendra Kalsaria, Sony Chacko, Sucheta Chakraborty, David Miller
Cc: linux-driver, netdev
Functions only used in one file should be static.
Found by running make namespacecheck
Compile tested only.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 16 -------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 33 +++++++++++----
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | 22 ----------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 11 +++--
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c | 2
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 33 +++++++--------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 10 ++--
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h | 4 -
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 24 ++++++----
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 29 +++++++++----
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h | 3 -
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 9 ++--
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | 4 -
13 files changed, 97 insertions(+), 103 deletions(-)
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c 2014-01-16 09:59:06.005043766 -0800
@@ -13,6 +13,23 @@
#include <linux/interrupt.h>
#include <linux/aer.h>
+static void __qlcnic_83xx_process_aen(struct qlcnic_adapter *);
+static int qlcnic_83xx_clear_lb_mode(struct qlcnic_adapter *, u8);
+static void qlcnic_83xx_configure_mac(struct qlcnic_adapter *, u8 *, u8,
+ struct qlcnic_cmd_args *);
+static int qlcnic_83xx_get_port_config(struct qlcnic_adapter *);
+static irqreturn_t qlcnic_83xx_handle_aen(int, void *);
+static pci_ers_result_t qlcnic_83xx_io_error_detected(struct pci_dev *,
+ pci_channel_state_t);
+static int qlcnic_83xx_set_port_config(struct qlcnic_adapter *);
+static pci_ers_result_t qlcnic_83xx_io_slot_reset(struct pci_dev *);
+static void qlcnic_83xx_io_resume(struct pci_dev *);
+static int qlcnic_83xx_set_lb_mode(struct qlcnic_adapter *, u8);
+static void qlcnic_83xx_set_mac_filter_count(struct qlcnic_adapter *);
+static int qlcnic_83xx_resume(struct qlcnic_adapter *);
+static int qlcnic_83xx_shutdown(struct pci_dev *);
+static void qlcnic_83xx_get_beacon_state(struct qlcnic_adapter *);
+
#define RSS_HASHTYPE_IP_TCP 0x3
#define QLC_83XX_FW_MBX_CMD 0
#define QLC_SKIP_INACTIVE_PCI_REGS 7
@@ -636,7 +653,7 @@ int qlcnic_83xx_get_port_info(struct qlc
return status;
}
-void qlcnic_83xx_set_mac_filter_count(struct qlcnic_adapter *adapter)
+static void qlcnic_83xx_set_mac_filter_count(struct qlcnic_adapter *adapter)
{
struct qlcnic_hardware_context *ahw = adapter->ahw;
u16 act_pci_fn = ahw->total_nic_func;
@@ -871,7 +888,7 @@ static void qlcnic_83xx_handle_idc_comp_
return;
}
-void __qlcnic_83xx_process_aen(struct qlcnic_adapter *adapter)
+static void __qlcnic_83xx_process_aen(struct qlcnic_adapter *adapter)
{
struct qlcnic_hardware_context *ahw = adapter->ahw;
u32 event[QLC_83XX_MBX_AEN_CNT];
@@ -1388,7 +1405,7 @@ out:
netif_device_attach(netdev);
}
-void qlcnic_83xx_get_beacon_state(struct qlcnic_adapter *adapter)
+static void qlcnic_83xx_get_beacon_state(struct qlcnic_adapter *adapter)
{
struct qlcnic_hardware_context *ahw = adapter->ahw;
struct qlcnic_cmd_args cmd;
@@ -1559,7 +1576,7 @@ void qlcnic_83xx_initialize_nic(struct q
qlcnic_free_mbx_args(&cmd);
}
-int qlcnic_83xx_set_port_config(struct qlcnic_adapter *adapter)
+static int qlcnic_83xx_set_port_config(struct qlcnic_adapter *adapter)
{
struct qlcnic_cmd_args cmd;
int err;
@@ -1576,7 +1593,7 @@ int qlcnic_83xx_set_port_config(struct q
return err;
}
-int qlcnic_83xx_get_port_config(struct qlcnic_adapter *adapter)
+static int qlcnic_83xx_get_port_config(struct qlcnic_adapter *adapter)
{
struct qlcnic_cmd_args cmd;
int err;
@@ -1745,7 +1762,7 @@ static void qlcnic_extend_lb_idc_cmpltn_
ahw->extend_lb_time = 0;
}
-int qlcnic_83xx_set_lb_mode(struct qlcnic_adapter *adapter, u8 mode)
+static int qlcnic_83xx_set_lb_mode(struct qlcnic_adapter *adapter, u8 mode)
{
struct qlcnic_hardware_context *ahw = adapter->ahw;
struct net_device *netdev = adapter->netdev;
@@ -1814,7 +1831,7 @@ int qlcnic_83xx_set_lb_mode(struct qlcni
return status;
}
-int qlcnic_83xx_clear_lb_mode(struct qlcnic_adapter *adapter, u8 mode)
+static int qlcnic_83xx_clear_lb_mode(struct qlcnic_adapter *adapter, u8 mode)
{
struct qlcnic_hardware_context *ahw = adapter->ahw;
u32 config = ahw->port_config, max_wait_count;
@@ -3552,7 +3569,7 @@ int qlcnic_83xx_shutdown(struct pci_dev
return 0;
}
-int qlcnic_83xx_resume(struct qlcnic_adapter *adapter)
+static int qlcnic_83xx_resume(struct qlcnic_adapter *adapter)
{
struct qlcnic_hardware_context *ahw = adapter->ahw;
struct qlc_83xx_idc *idc = &ahw->idc;
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h 2014-01-16 09:58:55.213189820 -0800
@@ -544,10 +544,7 @@ void qlcnic_83xx_write_crb(struct qlcnic
void qlcnic_83xx_read_crb(struct qlcnic_adapter *, char *, loff_t, size_t);
int qlcnic_83xx_rd_reg_indirect(struct qlcnic_adapter *, ulong, int *);
int qlcnic_83xx_wrt_reg_indirect(struct qlcnic_adapter *, ulong, u32);
-void qlcnic_83xx_process_rcv_diag(struct qlcnic_adapter *, int, u64 []);
int qlcnic_83xx_nic_set_promisc(struct qlcnic_adapter *, u32);
-int qlcnic_83xx_set_lb_mode(struct qlcnic_adapter *, u8);
-int qlcnic_83xx_clear_lb_mode(struct qlcnic_adapter *, u8);
int qlcnic_83xx_config_hw_lro(struct qlcnic_adapter *, int);
int qlcnic_83xx_config_rss(struct qlcnic_adapter *, int);
int qlcnic_83xx_config_intr_coalesce(struct qlcnic_adapter *);
@@ -561,7 +558,6 @@ void qlcnic_83xx_napi_del(struct qlcnic_
void qlcnic_83xx_napi_enable(struct qlcnic_adapter *);
void qlcnic_83xx_napi_disable(struct qlcnic_adapter *);
int qlcnic_83xx_config_led(struct qlcnic_adapter *, u32, u32);
-void qlcnic_83xx_get_beacon_state(struct qlcnic_adapter *);
void qlcnic_ind_wr(struct qlcnic_adapter *, u32, u32);
int qlcnic_ind_rd(struct qlcnic_adapter *, u32);
int qlcnic_83xx_create_rx_ctx(struct qlcnic_adapter *);
@@ -576,15 +572,12 @@ void qlcnic_83xx_process_rcv_ring_diag(s
int qlcnic_83xx_config_intrpt(struct qlcnic_adapter *, bool);
int qlcnic_83xx_sre_macaddr_change(struct qlcnic_adapter *, u8 *, u16, u8);
int qlcnic_83xx_get_mac_address(struct qlcnic_adapter *, u8 *, u8);
-void qlcnic_83xx_configure_mac(struct qlcnic_adapter *, u8 *, u8,
- struct qlcnic_cmd_args *);
int qlcnic_83xx_alloc_mbx_args(struct qlcnic_cmd_args *,
struct qlcnic_adapter *, u32);
void qlcnic_free_mbx_args(struct qlcnic_cmd_args *);
void qlcnic_set_npar_data(struct qlcnic_adapter *, const struct qlcnic_info *,
struct qlcnic_info *);
void qlcnic_83xx_config_intr_coal(struct qlcnic_adapter *);
-irqreturn_t qlcnic_83xx_handle_aen(int, void *);
int qlcnic_83xx_get_port_info(struct qlcnic_adapter *);
void qlcnic_83xx_enable_mbx_interrupt(struct qlcnic_adapter *);
void qlcnic_83xx_disable_mbx_intr(struct qlcnic_adapter *);
@@ -597,11 +590,7 @@ void qlcnic_83xx_disable_intr(struct qlc
struct qlcnic_host_sds_ring *);
void qlcnic_83xx_check_vf(struct qlcnic_adapter *,
const struct pci_device_id *);
-void __qlcnic_83xx_process_aen(struct qlcnic_adapter *);
-int qlcnic_83xx_get_port_config(struct qlcnic_adapter *);
-int qlcnic_83xx_set_port_config(struct qlcnic_adapter *);
int qlcnic_enable_eswitch(struct qlcnic_adapter *, u8, u8);
-int qlcnic_83xx_get_nic_configuration(struct qlcnic_adapter *);
int qlcnic_83xx_config_default_opmode(struct qlcnic_adapter *);
int qlcnic_83xx_setup_mbx_intr(struct qlcnic_adapter *);
void qlcnic_83xx_free_mbx_intr(struct qlcnic_adapter *);
@@ -623,9 +612,7 @@ int qlcnic_83xx_lockless_flash_read32(st
u32, u8 *, int);
int qlcnic_83xx_init(struct qlcnic_adapter *, int);
int qlcnic_83xx_idc_ready_state_entry(struct qlcnic_adapter *);
-int qlcnic_83xx_check_hw_status(struct qlcnic_adapter *p_dev);
void qlcnic_83xx_idc_poll_dev_state(struct work_struct *);
-int qlcnic_83xx_get_reset_instruction_template(struct qlcnic_adapter *);
void qlcnic_83xx_idc_exit(struct qlcnic_adapter *);
void qlcnic_83xx_idc_request_reset(struct qlcnic_adapter *, u32);
int qlcnic_83xx_lock_driver(struct qlcnic_adapter *);
@@ -633,7 +620,6 @@ void qlcnic_83xx_unlock_driver(struct ql
int qlcnic_83xx_set_default_offload_settings(struct qlcnic_adapter *);
int qlcnic_83xx_ms_mem_write128(struct qlcnic_adapter *, u64, u32 *, u32);
int qlcnic_83xx_idc_vnic_pf_entry(struct qlcnic_adapter *);
-int qlcnic_83xx_enable_vnic_mode(struct qlcnic_adapter *, int);
int qlcnic_83xx_disable_vnic_mode(struct qlcnic_adapter *, int);
int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *);
int qlcnic_83xx_get_vnic_vport_info(struct qlcnic_adapter *,
@@ -661,9 +647,6 @@ int qlcnic_83xx_enable_flash_write(struc
int qlcnic_83xx_disable_flash_write(struct qlcnic_adapter *);
void qlcnic_83xx_enable_mbx_poll(struct qlcnic_adapter *);
void qlcnic_83xx_disable_mbx_poll(struct qlcnic_adapter *);
-void qlcnic_83xx_set_mac_filter_count(struct qlcnic_adapter *);
-int qlcnic_83xx_shutdown(struct pci_dev *);
-int qlcnic_83xx_resume(struct qlcnic_adapter *);
int qlcnic_83xx_idc_init(struct qlcnic_adapter *);
int qlcnic_83xx_idc_reattach_driver(struct qlcnic_adapter *);
int qlcnic_83xx_set_vnic_opmode(struct qlcnic_adapter *);
@@ -671,9 +654,4 @@ int qlcnic_83xx_check_vnic_state(struct
void qlcnic_83xx_aer_stop_poll_work(struct qlcnic_adapter *);
int qlcnic_83xx_aer_reset(struct qlcnic_adapter *);
void qlcnic_83xx_aer_start_poll_work(struct qlcnic_adapter *);
-pci_ers_result_t qlcnic_83xx_io_error_detected(struct pci_dev *,
- pci_channel_state_t);
-pci_ers_result_t qlcnic_83xx_io_slot_reset(struct pci_dev *);
-void qlcnic_83xx_io_resume(struct pci_dev *);
-void qlcnic_83xx_stop_hw(struct qlcnic_adapter *);
#endif
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h 2014-01-16 09:39:11.373055158 -0800
@@ -1473,8 +1473,6 @@ int qlcnic_fw_cmd_get_minidump_temp(stru
int qlcnic_fw_cmd_set_port(struct qlcnic_adapter *adapter, u32 config);
int qlcnic_pci_mem_write_2M(struct qlcnic_adapter *, u64 off, u64 data);
int qlcnic_pci_mem_read_2M(struct qlcnic_adapter *, u64 off, u64 *data);
-void qlcnic_pci_camqm_read_2M(struct qlcnic_adapter *, u64, u64 *);
-void qlcnic_pci_camqm_write_2M(struct qlcnic_adapter *, u64, u64);
#define ADDR_IN_RANGE(addr, low, high) \
(((addr) < (high)) && ((addr) >= (low)))
@@ -1510,16 +1508,11 @@ void qlcnic_pcie_sem_unlock(struct qlcni
#define MAX_CTL_CHECK 1000
-int qlcnic_wol_supported(struct qlcnic_adapter *adapter);
void qlcnic_prune_lb_filters(struct qlcnic_adapter *adapter);
void qlcnic_delete_lb_filters(struct qlcnic_adapter *adapter);
int qlcnic_dump_fw(struct qlcnic_adapter *);
int qlcnic_enable_fw_dump_state(struct qlcnic_adapter *);
bool qlcnic_check_fw_dump_state(struct qlcnic_adapter *);
-pci_ers_result_t qlcnic_82xx_io_error_detected(struct pci_dev *,
- pci_channel_state_t);
-pci_ers_result_t qlcnic_82xx_io_slot_reset(struct pci_dev *);
-void qlcnic_82xx_io_resume(struct pci_dev *);
/* Functions from qlcnic_init.c */
void qlcnic_schedule_work(struct qlcnic_adapter *, work_func_t, int);
@@ -1554,9 +1547,7 @@ int qlcnic_check_fw_status(struct qlcnic
void qlcnic_watchdog_task(struct work_struct *work);
void qlcnic_post_rx_buffers(struct qlcnic_adapter *adapter,
struct qlcnic_host_rds_ring *rds_ring, u8 ring_id);
-int qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int max);
void qlcnic_set_multi(struct net_device *netdev);
-void __qlcnic_set_multi(struct net_device *, u16);
int qlcnic_nic_add_mac(struct qlcnic_adapter *, const u8 *, u16);
int qlcnic_nic_del_mac(struct qlcnic_adapter *, const u8 *);
void qlcnic_82xx_free_mac_list(struct qlcnic_adapter *adapter);
@@ -1569,13 +1560,11 @@ netdev_features_t qlcnic_fix_features(st
netdev_features_t features);
int qlcnic_set_features(struct net_device *netdev, netdev_features_t features);
int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable);
-int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter);
void qlcnic_update_cmd_producer(struct qlcnic_host_tx_ring *);
/* Functions from qlcnic_ethtool.c */
int qlcnic_check_loopback_buff(unsigned char *, u8 []);
int qlcnic_do_lb_test(struct qlcnic_adapter *, u8);
-int qlcnic_loopback_test(struct net_device *, u8);
/* Functions from qlcnic_main.c */
int qlcnic_reset_context(struct qlcnic_adapter *);
@@ -1587,7 +1576,6 @@ void qlcnic_set_sds_ring_count(struct ql
int qlcnic_setup_rings(struct qlcnic_adapter *, u8, u8);
int qlcnic_validate_rings(struct qlcnic_adapter *, __u32, int);
void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter);
-void qlcnic_82xx_set_mac_filter_count(struct qlcnic_adapter *);
int qlcnic_enable_msix(struct qlcnic_adapter *, u32);
void qlcnic_set_drv_version(struct qlcnic_adapter *);
@@ -1616,11 +1604,8 @@ void qlcnic_dump_mbx(struct qlcnic_adapt
void qlcnic_create_sysfs_entries(struct qlcnic_adapter *adapter);
void qlcnic_remove_sysfs_entries(struct qlcnic_adapter *adapter);
-void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter);
-void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter);
void qlcnic_82xx_add_sysfs(struct qlcnic_adapter *adapter);
void qlcnic_82xx_remove_sysfs(struct qlcnic_adapter *adapter);
-int qlcnic_82xx_get_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *, u32);
int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32);
@@ -1643,7 +1628,6 @@ int qlcnic_init_pci_info(struct qlcnic_a
int qlcnic_set_default_offload_settings(struct qlcnic_adapter *);
int qlcnic_reset_npar_config(struct qlcnic_adapter *);
int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *);
-void qlcnic_add_lb_filter(struct qlcnic_adapter *, struct sk_buff *, int, u16);
int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter);
int qlcnic_read_mac_addr(struct qlcnic_adapter *);
int qlcnic_setup_netdev(struct qlcnic_adapter *, struct net_device *, int);
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c 2014-01-16 09:39:11.373055158 -0800
@@ -278,21 +278,8 @@ qlcnic_get_drvinfo(struct net_device *de
sizeof(drvinfo->version));
}
-static int
-qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
-{
- struct qlcnic_adapter *adapter = netdev_priv(dev);
-
- if (qlcnic_82xx_check(adapter))
- return qlcnic_82xx_get_settings(adapter, ecmd);
- else if (qlcnic_83xx_check(adapter))
- return qlcnic_83xx_get_settings(adapter, ecmd);
-
- return -EIO;
-}
-
-int qlcnic_82xx_get_settings(struct qlcnic_adapter *adapter,
- struct ethtool_cmd *ecmd)
+static int qlcnic_82xx_get_settings(struct qlcnic_adapter *adapter,
+ struct ethtool_cmd *ecmd)
{
struct qlcnic_hardware_context *ahw = adapter->ahw;
u32 speed, reg;
@@ -433,6 +420,20 @@ skip:
return 0;
}
+static int qlcnic_get_settings(struct net_device *dev,
+ struct ethtool_cmd *ecmd)
+{
+ struct qlcnic_adapter *adapter = netdev_priv(dev);
+
+ if (qlcnic_82xx_check(adapter))
+ return qlcnic_82xx_get_settings(adapter, ecmd);
+ else if (qlcnic_83xx_check(adapter))
+ return qlcnic_83xx_get_settings(adapter, ecmd);
+
+ return -EIO;
+}
+
+
static int qlcnic_set_port_config(struct qlcnic_adapter *adapter,
struct ethtool_cmd *ecmd)
{
@@ -1055,7 +1056,7 @@ int qlcnic_do_lb_test(struct qlcnic_adap
return 0;
}
-int qlcnic_loopback_test(struct net_device *netdev, u8 mode)
+static int qlcnic_loopback_test(struct net_device *netdev, u8 mode)
{
struct qlcnic_adapter *adapter = netdev_priv(netdev);
int drv_tx_rings = adapter->drv_tx_rings;
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c 2014-01-16 09:39:11.373055158 -0800
@@ -1286,7 +1286,7 @@ void qlcnic_remove_sysfs_entries(struct
device_remove_file(dev, &dev_attr_bridged_mode);
}
-void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter)
+static void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter)
{
struct device *dev = &adapter->pdev->dev;
@@ -1325,7 +1325,7 @@ void qlcnic_create_diag_entries(struct q
dev_info(dev, "failed to create eswitch stats sysfs entry");
}
-void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter)
+static void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter)
{
struct device *dev = &adapter->pdev->dev;
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c 2014-01-16 09:58:21.209651476 -0800
@@ -39,6 +39,9 @@
static int qlcnic_83xx_init_default_driver(struct qlcnic_adapter *adapter);
static int qlcnic_83xx_check_heartbeat(struct qlcnic_adapter *p_dev);
static int qlcnic_83xx_restart_hw(struct qlcnic_adapter *adapter);
+static int qlcnic_83xx_check_hw_status(struct qlcnic_adapter *p_dev);
+static int qlcnic_83xx_get_reset_instruction_template(struct qlcnic_adapter *);
+static void qlcnic_83xx_stop_hw(struct qlcnic_adapter *);
/* Template header */
struct qlc_83xx_reset_hdr {
@@ -1528,7 +1531,7 @@ static int qlcnic_83xx_check_cmd_peg_sta
return -EIO;
}
-int qlcnic_83xx_check_hw_status(struct qlcnic_adapter *p_dev)
+static int qlcnic_83xx_check_hw_status(struct qlcnic_adapter *p_dev)
{
int err;
@@ -1601,7 +1604,7 @@ static int qlcnic_83xx_reset_template_ch
}
}
-int qlcnic_83xx_get_reset_instruction_template(struct qlcnic_adapter *p_dev)
+static int qlcnic_83xx_get_reset_instruction_template(struct qlcnic_adapter *p_dev)
{
struct qlcnic_hardware_context *ahw = p_dev->ahw;
u32 addr, count, prev_ver, curr_ver;
@@ -1945,7 +1948,7 @@ static void qlcnic_83xx_exec_template_cm
p_dev->ahw->reset.seq_index = index;
}
-void qlcnic_83xx_stop_hw(struct qlcnic_adapter *p_dev)
+static void qlcnic_83xx_stop_hw(struct qlcnic_adapter *p_dev)
{
p_dev->ahw->reset.seq_index = 0;
@@ -2028,7 +2031,7 @@ static int qlcnic_83xx_restart_hw(struct
return 0;
}
-int qlcnic_83xx_get_nic_configuration(struct qlcnic_adapter *adapter)
+static int qlcnic_83xx_get_nic_configuration(struct qlcnic_adapter *adapter)
{
int err;
struct qlcnic_info nic_info;
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c 2014-01-16 09:39:11.373055158 -0800
@@ -8,7 +8,7 @@
#include "qlcnic.h"
#include "qlcnic_hw.h"
-int qlcnic_83xx_enable_vnic_mode(struct qlcnic_adapter *adapter, int lock)
+static int qlcnic_83xx_enable_vnic_mode(struct qlcnic_adapter *adapter, int lock)
{
if (lock) {
if (qlcnic_83xx_lock_driver(adapter))
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c 2014-01-16 09:39:11.373055158 -0800
@@ -505,7 +505,7 @@ int qlcnic_nic_add_mac(struct qlcnic_ada
return 0;
}
-void __qlcnic_set_multi(struct net_device *netdev, u16 vlan)
+static void __qlcnic_set_multi(struct net_device *netdev, u16 vlan)
{
struct qlcnic_adapter *adapter = netdev_priv(netdev);
struct qlcnic_hardware_context *ahw = adapter->ahw;
@@ -947,7 +947,7 @@ int qlcnic_82xx_linkevent_request(struct
return rv;
}
-int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter)
+static int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter)
{
struct qlcnic_nic_req req;
u64 word;
@@ -1246,7 +1246,7 @@ static int qlcnic_pci_mem_access_direct(
return 0;
}
-void
+static void
qlcnic_pci_camqm_read_2M(struct qlcnic_adapter *adapter, u64 off, u64 *data)
{
void __iomem *addr = adapter->ahw->pci_base0 +
@@ -1257,7 +1257,7 @@ qlcnic_pci_camqm_read_2M(struct qlcnic_a
mutex_unlock(&adapter->ahw->mem_lock);
}
-void
+static void
qlcnic_pci_camqm_write_2M(struct qlcnic_adapter *adapter, u64 off, u64 data)
{
void __iomem *addr = adapter->ahw->pci_base0 +
@@ -1493,7 +1493,7 @@ int qlcnic_82xx_get_board_info(struct ql
return 0;
}
-int
+static int
qlcnic_wol_supported(struct qlcnic_adapter *adapter)
{
u32 wol_cfg;
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c 2014-01-16 09:39:11.377055105 -0800
@@ -124,8 +124,12 @@
#define qlcnic_83xx_is_ip_align(sts) (((sts) >> 46) & 1)
#define qlcnic_83xx_has_vlan_tag(sts) (((sts) >> 47) & 1)
-struct sk_buff *qlcnic_process_rxbuf(struct qlcnic_adapter *,
- struct qlcnic_host_rds_ring *, u16, u16);
+static int qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring,
+ int max);
+
+static struct sk_buff *qlcnic_process_rxbuf(struct qlcnic_adapter *,
+ struct qlcnic_host_rds_ring *,
+ u16, u16);
static inline void qlcnic_enable_tx_intr(struct qlcnic_adapter *adapter,
struct qlcnic_host_tx_ring *tx_ring)
@@ -210,8 +214,8 @@ static struct qlcnic_filter *qlcnic_find
return NULL;
}
-void qlcnic_add_lb_filter(struct qlcnic_adapter *adapter, struct sk_buff *skb,
- int loopback_pkt, u16 vlan_id)
+static void qlcnic_add_lb_filter(struct qlcnic_adapter *adapter,
+ struct sk_buff *skb, int loopback_pkt, u16 vlan_id)
{
struct ethhdr *phdr = (struct ethhdr *)(skb->data);
struct qlcnic_filter *fil, *tmp_fil;
@@ -1034,9 +1038,9 @@ static void qlcnic_handle_fw_message(int
}
}
-struct sk_buff *qlcnic_process_rxbuf(struct qlcnic_adapter *adapter,
- struct qlcnic_host_rds_ring *ring,
- u16 index, u16 cksum)
+static struct sk_buff *qlcnic_process_rxbuf(struct qlcnic_adapter *adapter,
+ struct qlcnic_host_rds_ring *ring,
+ u16 index, u16 cksum)
{
struct qlcnic_rx_buffer *buffer;
struct sk_buff *skb;
@@ -1255,7 +1259,7 @@ qlcnic_process_lro(struct qlcnic_adapter
return buffer;
}
-int qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int max)
+static int qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int max)
{
struct qlcnic_host_rds_ring *rds_ring;
struct qlcnic_adapter *adapter = sds_ring->adapter;
@@ -2047,8 +2051,8 @@ void qlcnic_83xx_napi_del(struct qlcnic_
qlcnic_free_tx_rings(adapter);
}
-void qlcnic_83xx_process_rcv_diag(struct qlcnic_adapter *adapter,
- int ring, u64 sts_data[])
+static void qlcnic_83xx_process_rcv_diag(struct qlcnic_adapter *adapter,
+ int ring, u64 sts_data[])
{
struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
struct sk_buff *skb;
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h 2014-01-16 09:39:11.377055105 -0800
@@ -162,7 +162,6 @@ struct qlcnic_host_tx_ring;
struct qlcnic_hardware_context;
struct qlcnic_adapter;
-int qlcnic_82xx_start_firmware(struct qlcnic_adapter *);
int qlcnic_82xx_hw_read_wx_2M(struct qlcnic_adapter *adapter, ulong, int *);
int qlcnic_82xx_hw_write_wx_2M(struct qlcnic_adapter *, ulong, u32);
int qlcnic_82xx_config_hw_lro(struct qlcnic_adapter *adapter, int);
@@ -182,9 +181,6 @@ int qlcnic_82xx_clear_lb_mode(struct qlc
int qlcnic_82xx_set_lb_mode(struct qlcnic_adapter *, u8);
void qlcnic_82xx_write_crb(struct qlcnic_adapter *, char *, loff_t, size_t);
void qlcnic_82xx_read_crb(struct qlcnic_adapter *, char *, loff_t, size_t);
-void qlcnic_82xx_dev_request_reset(struct qlcnic_adapter *, u32);
-int qlcnic_82xx_setup_intr(struct qlcnic_adapter *);
-irqreturn_t qlcnic_82xx_clear_legacy_intr(struct qlcnic_adapter *);
int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter,
struct qlcnic_cmd_args *);
int qlcnic_82xx_mq_intrpt(struct qlcnic_adapter *, int);
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c 2014-01-16 09:47:08.638713269 -0800
@@ -81,6 +81,16 @@ static int qlcnicvf_start_firmware(struc
static int qlcnic_vlan_rx_add(struct net_device *, __be16, u16);
static int qlcnic_vlan_rx_del(struct net_device *, __be16, u16);
+static int qlcnic_82xx_setup_intr(struct qlcnic_adapter *);
+static void qlcnic_82xx_dev_request_reset(struct qlcnic_adapter *, u32);
+static irqreturn_t qlcnic_82xx_clear_legacy_intr(struct qlcnic_adapter *);
+static pci_ers_result_t qlcnic_82xx_io_slot_reset(struct pci_dev *);
+static int qlcnic_82xx_start_firmware(struct qlcnic_adapter *);
+static void qlcnic_82xx_io_resume(struct pci_dev *);
+static void qlcnic_82xx_set_mac_filter_count(struct qlcnic_adapter *);
+static pci_ers_result_t qlcnic_82xx_io_error_detected(struct pci_dev *,
+ pci_channel_state_t);
+
static u32 qlcnic_vlan_tx_check(struct qlcnic_adapter *adapter)
{
struct qlcnic_hardware_context *ahw = adapter->ahw;
@@ -722,7 +732,7 @@ static int qlcnic_enable_msi_legacy(stru
return err;
}
-int qlcnic_82xx_setup_intr(struct qlcnic_adapter *adapter)
+static int qlcnic_82xx_setup_intr(struct qlcnic_adapter *adapter)
{
int num_msix, err = 0;
@@ -1486,7 +1496,7 @@ qlcnic_set_mgmt_operations(struct qlcnic
return err;
}
-int qlcnic_82xx_start_firmware(struct qlcnic_adapter *adapter)
+static int qlcnic_82xx_start_firmware(struct qlcnic_adapter *adapter)
{
int err;
@@ -2034,7 +2044,7 @@ qlcnic_reset_context(struct qlcnic_adapt
return err;
}
-void qlcnic_82xx_set_mac_filter_count(struct qlcnic_adapter *adapter)
+static void qlcnic_82xx_set_mac_filter_count(struct qlcnic_adapter *adapter)
{
struct qlcnic_hardware_context *ahw = adapter->ahw;
u16 act_pci_fn = ahw->total_nic_func;
@@ -2793,7 +2803,7 @@ static struct net_device_stats *qlcnic_g
return stats;
}
-irqreturn_t qlcnic_82xx_clear_legacy_intr(struct qlcnic_adapter *adapter)
+static irqreturn_t qlcnic_82xx_clear_legacy_intr(struct qlcnic_adapter *adapter)
{
u32 status;
@@ -3286,7 +3296,8 @@ qlcnic_set_npar_non_operational(struct q
qlcnic_api_unlock(adapter);
}
-void qlcnic_82xx_dev_request_reset(struct qlcnic_adapter *adapter, u32 key)
+static void qlcnic_82xx_dev_request_reset(struct qlcnic_adapter *adapter,
+ u32 key)
{
u32 state, xg_val = 0, gb_val = 0;
@@ -3581,8 +3592,8 @@ static int qlcnic_attach_func(struct pci
return err;
}
-pci_ers_result_t qlcnic_82xx_io_error_detected(struct pci_dev *pdev,
- pci_channel_state_t state)
+static pci_ers_result_t qlcnic_82xx_io_error_detected(struct pci_dev *pdev,
+ pci_channel_state_t state)
{
struct qlcnic_adapter *adapter = pci_get_drvdata(pdev);
struct net_device *netdev = adapter->netdev;
@@ -3612,13 +3623,13 @@ pci_ers_result_t qlcnic_82xx_io_error_de
return PCI_ERS_RESULT_NEED_RESET;
}
-pci_ers_result_t qlcnic_82xx_io_slot_reset(struct pci_dev *pdev)
+static pci_ers_result_t qlcnic_82xx_io_slot_reset(struct pci_dev *pdev)
{
return qlcnic_attach_func(pdev) ? PCI_ERS_RESULT_DISCONNECT :
PCI_ERS_RESULT_RECOVERED;
}
-void qlcnic_82xx_io_resume(struct pci_dev *pdev)
+static void qlcnic_82xx_io_resume(struct pci_dev *pdev)
{
u32 state;
struct qlcnic_adapter *adapter = pci_get_drvdata(pdev);
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h 2014-01-16 09:39:11.377055105 -0800
@@ -188,7 +188,6 @@ void qlcnic_sriov_vf_register_map(struct
int qlcnic_sriov_vf_init(struct qlcnic_adapter *, int);
void qlcnic_sriov_vf_set_ops(struct qlcnic_adapter *);
int qlcnic_sriov_func_to_index(struct qlcnic_adapter *, u8);
-int qlcnic_sriov_channel_cfg_cmd(struct qlcnic_adapter *, u8);
void qlcnic_sriov_handle_bc_event(struct qlcnic_adapter *, u32);
int qlcnic_sriov_cfg_bc_intr(struct qlcnic_adapter *, u8);
void qlcnic_sriov_cleanup_async_list(struct qlcnic_back_channel *);
@@ -198,8 +197,6 @@ int __qlcnic_sriov_add_act_list(struct q
int qlcnic_sriov_get_vf_vport_info(struct qlcnic_adapter *,
struct qlcnic_info *, u16);
int qlcnic_sriov_cfg_vf_guest_vlan(struct qlcnic_adapter *, u16, u8);
-int qlcnic_sriov_vf_shutdown(struct pci_dev *);
-int qlcnic_sriov_vf_resume(struct qlcnic_adapter *);
void qlcnic_sriov_free_vlans(struct qlcnic_adapter *);
void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *);
bool qlcnic_sriov_check_any_vlan(struct qlcnic_vf_info *);
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c 2014-01-16 09:39:09.081085419 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c 2014-01-16 09:39:11.377055105 -0800
@@ -35,7 +35,10 @@ static void qlcnic_sriov_vf_cancel_fw_wo
static void qlcnic_sriov_cleanup_transaction(struct qlcnic_bc_trans *);
static int qlcnic_sriov_issue_cmd(struct qlcnic_adapter *,
struct qlcnic_cmd_args *);
+static int qlcnic_sriov_channel_cfg_cmd(struct qlcnic_adapter *, u8);
static void qlcnic_sriov_process_bc_cmd(struct work_struct *);
+static int qlcnic_sriov_vf_shutdown(struct pci_dev *);
+static int qlcnic_sriov_vf_resume(struct qlcnic_adapter *);
static struct qlcnic_hardware_ops qlcnic_sriov_vf_hw_ops = {
.read_crb = qlcnic_83xx_read_crb,
@@ -1424,7 +1427,7 @@ cleanup_transaction:
return rsp;
}
-int qlcnic_sriov_channel_cfg_cmd(struct qlcnic_adapter *adapter, u8 cmd_op)
+static int qlcnic_sriov_channel_cfg_cmd(struct qlcnic_adapter *adapter, u8 cmd_op)
{
struct qlcnic_cmd_args cmd;
struct qlcnic_vf_info *vf = &adapter->ahw->sriov->vf_info[0];
@@ -2037,7 +2040,7 @@ static void qlcnic_sriov_vf_free_mac_lis
}
-int qlcnic_sriov_vf_shutdown(struct pci_dev *pdev)
+static int qlcnic_sriov_vf_shutdown(struct pci_dev *pdev)
{
struct qlcnic_adapter *adapter = pci_get_drvdata(pdev);
struct net_device *netdev = adapter->netdev;
@@ -2061,7 +2064,7 @@ int qlcnic_sriov_vf_shutdown(struct pci_
return 0;
}
-int qlcnic_sriov_vf_resume(struct qlcnic_adapter *adapter)
+static int qlcnic_sriov_vf_resume(struct qlcnic_adapter *adapter)
{
struct qlc_83xx_idc *idc = &adapter->ahw->idc;
struct net_device *netdev = adapter->netdev;
^ permalink raw reply
* [PATCH net-next 2/2] qlcnic: remove unused code
From: Stephen Hemminger @ 2014-01-16 18:32 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Himanshu Madhani, Rajesh Borundia, Shahed Shaikh,
Jitendra Kalsaria, Sony Chacko, Sucheta Chakraborty, David Miller,
linux-driver, netdev
In-Reply-To: <20140116103127.121855af@nehalam.linuxnetplumber.net>
Remove function qlcnic_enable_eswitch which was defined
but never used in current code.
Compile tested only.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 30 --------------------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | 1
2 files changed, 31 deletions(-)
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c 2014-01-16 09:59:06.005043766 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c 2014-01-16 09:59:20.612876755 -0800
@@ -2196,36 +2196,6 @@ out:
return IRQ_HANDLED;
}
-int qlcnic_enable_eswitch(struct qlcnic_adapter *adapter, u8 port, u8 enable)
-{
- int err = -EIO;
- struct qlcnic_cmd_args cmd;
-
- if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) {
- dev_err(&adapter->pdev->dev,
- "%s: Error, invoked by non management func\n",
- __func__);
- return err;
- }
-
- err = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_TOGGLE_ESWITCH);
- if (err)
- return err;
-
- cmd.req.arg[1] = (port & 0xf) | BIT_4;
- err = qlcnic_issue_cmd(adapter, &cmd);
-
- if (err != QLCNIC_RCODE_SUCCESS) {
- dev_err(&adapter->pdev->dev, "Failed to enable eswitch%d\n",
- err);
- err = -EIO;
- }
- qlcnic_free_mbx_args(&cmd);
-
- return err;
-
-}
-
int qlcnic_83xx_set_nic_info(struct qlcnic_adapter *adapter,
struct qlcnic_info *nic)
{
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h 2014-01-16 09:58:55.213189820 -0800
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h 2014-01-16 09:59:20.612876755 -0800
@@ -590,7 +590,6 @@ void qlcnic_83xx_disable_intr(struct qlc
struct qlcnic_host_sds_ring *);
void qlcnic_83xx_check_vf(struct qlcnic_adapter *,
const struct pci_device_id *);
-int qlcnic_enable_eswitch(struct qlcnic_adapter *, u8, u8);
int qlcnic_83xx_config_default_opmode(struct qlcnic_adapter *);
int qlcnic_83xx_setup_mbx_intr(struct qlcnic_adapter *);
void qlcnic_83xx_free_mbx_intr(struct qlcnic_adapter *);
^ permalink raw reply
* Re: [PATCH] net: introduce SO_BPF_EXTENSIONS
From: Daniel Borkmann @ 2014-01-16 18:34 UTC (permalink / raw)
To: Michal Sekletar; +Cc: netdev, Michael Kerrisk, David Miller, Eric Dumazet
In-Reply-To: <20140116172631.GA5206@loki.brq.redhat.com>
On 01/16/2014 06:26 PM, Michal Sekletar wrote:
> On Thu, Jan 16, 2014 at 05:41:46PM +0100, Daniel Borkmann wrote:
>> On 01/16/2014 05:14 PM, Michal Sekletar wrote:
>>> userspace packet capturing libraries (e.g. libpcap) don't have a way how to find
>>> out which BPF extensions are supported by the kernel, except compiling a filter
>>> which uses extensions and trying to apply filter to the socket. This is very
>>> inconvenient.
>>>
>>> Therefore this commit introduces new option which can be used as an argument for
>>> getsockopt() and allows one to obtain information about which BPF extensions are
>>> supported by the kernel.
>>>
>>> On Tue, Dec 10, 2013 at 1:25 AM, David Miller <davem@davemloft.net> wrote:
>>>
>>>> And therefore, you do not need to define any actual bits yet. The
>>>> socket option will for now just return "0", and that will mean that
>>>> all the extensions Linux implements currently are presnet.
>>>
>>> Signed-off-by: Michal Sekletar <msekleta@redhat.com>
>>> Cc: Michael Kerrisk <mtk.manpages@gmail.com>
>>> Cc: Daniel Borkmann <dborkman@redhat.com>
>>> Cc: David Miller <davem@davemloft.net>
>>> ---
>>> arch/alpha/include/uapi/asm/socket.h | 2 ++
>>> arch/avr32/include/uapi/asm/socket.h | 2 ++
>>> arch/cris/include/uapi/asm/socket.h | 2 ++
>>> arch/frv/include/uapi/asm/socket.h | 2 ++
>>> arch/ia64/include/uapi/asm/socket.h | 2 ++
>>> arch/m32r/include/uapi/asm/socket.h | 2 ++
>>> arch/mips/include/uapi/asm/socket.h | 2 ++
>>> arch/mn10300/include/uapi/asm/socket.h | 2 ++
>>> arch/parisc/include/uapi/asm/socket.h | 2 ++
>>> arch/powerpc/include/uapi/asm/socket.h | 2 ++
>>> arch/s390/include/uapi/asm/socket.h | 2 ++
>>> arch/sparc/include/uapi/asm/socket.h | 2 ++
>>> arch/xtensa/include/uapi/asm/socket.h | 2 ++
>>> include/net/sock.h | 5 +++++
>>> include/uapi/asm-generic/socket.h | 2 ++
>>> net/core/sock.c | 4 ++++
>>> 16 files changed, 37 insertions(+)
>>>
>> ...
>>> --- a/include/net/sock.h
>>> +++ b/include/net/sock.h
>>> @@ -2292,4 +2292,9 @@ extern int sysctl_optmem_max;
>>> extern __u32 sysctl_wmem_default;
>>> extern __u32 sysctl_rmem_default;
>>>
>>> +static inline int bpf_get_extensions(void)
>>> +{
>>> + return 0;
>>> +}
>>> +
>>
>> This should rather be in: include/linux/filter.h
>
> Yes, having that function there makes more sense.
>
>>
>> And then, maybe be renamed into something like bpf_tell_extensions()
>> for example, but that's just nit.
>
> Renamed.
>
>>
>> Also, please add a comment, saying if people add new extensions, they
>> need to enumerate them within this function from now on so that user
>> space who enquires for that can be made aware of.
>
> Let me know if even more explanatory comment is desired.
I think that looks good.
>> Still, grepping through latest libpcap sources, tells me, so far over
>> the years they have included SKF_AD_PROTOCOL and SKF_AD_PKTTYPE, wow!
>>
>> That's very disappointing, so I have high hopes with this getsockopt().
>>
>> ;)
>>
>> Thanks,
>
> Thank you for the review. Btw, what do you think about define for parisc? I am
Yes, saw that in the patch and had similar thoughts.
> not sure I grok 0x4048 for SO_MAX_PACING_RATE and hence not sure about 0x4029
> for SO_BPF_EXTENSIONS.
Hmm, maybe typo; SO_MAX_PACING_RATE should have been a 0x4028 ?
^ permalink raw reply
* Re: [PATCH net-next 1/2] bonding: add sysfs /slave dir for bond slave devices.
From: Veaceslav Falico @ 2014-01-16 18:40 UTC (permalink / raw)
To: Scott Feldman
Cc: Jay Vosburgh, Andy Gospodarek, Netdev, Roopa Prabhu,
Shrijeet Mukherjee
In-Reply-To: <B1B4CB0E-6A3C-4023-9911-D57B5F58D691@cumulusnetworks.com>
On Thu, Jan 16, 2014 at 10:04:31AM -0800, Scott Feldman wrote:
>
>On Jan 16, 2014, at 7:31 AM, Veaceslav Falico <vfalico@redhat.com> wrote:
>
>> On Wed, Jan 15, 2014 at 09:54:34PM -0800, Scott Feldman wrote:
>>> Add sub-directory under /sys/class/net/<interface>/slave with
>>> read-only attributes for slave. Directory only appears when
>>> <interface> is a slave.
>
>>> +static ssize_t state_show(struct slave *slave, char *buf)
>>> +{
>>> + switch (bond_slave_state(slave)) {
>>> + case BOND_STATE_ACTIVE:
>>> + return sprintf(buf, "active\n");
>>> + case BOND_STATE_BACKUP:
>>> + return sprintf(buf, "backup\n");
>>> + default:
>>> + return sprintf(buf, "UNKONWN\n");
>>> + }
>>> +}
>>> +static SLAVE_ATTR_RO(state);
>>
>> Am I missing something or does it really completely lacks any locking?
>>
>> What prevents the slave to be freed in between?
>
>Correct me if I’m wrong, but I think the equivalent question is: is there a race between sysfs_remove_file() and another CPU open on that file trying to read/write the file? I believe the answer is no, but I’ll defer to the experts.
>
>The file removal call path is:
>
>
> bond_release (ndo_del_slave)
> __bond_release_one
> bond_sysfs_slave_del
> sysfs_remove_file
> <...continue freeing slave...>
>
>So slave is freed after sysfs_remove_file. I would expect I/O on sysfs file to fail during sysfs_remove_file.
>
>Does this sound OK? Am I missing anything else?
Yeah, totally, and as they're read-only there's no locking needed indeed.
>
>-scott
>
^ permalink raw reply
* Re: throughput problems with realtek
From: Dmitry Kasatkin @ 2014-01-16 18:47 UTC (permalink / raw)
To: Francois Romieu; +Cc: Rick Jones, nic_swsd, netdev, l.moiseichuk, kernel-team
In-Reply-To: <CACE9dm9s6k+PgkU4hFJvdKr8_fC7SBPiDnQuD4C4pJrUJT1Uiw@mail.gmail.com>
On Thu, Jan 16, 2014 at 9:45 AM, Dmitry Kasatkin
<dmitry.kasatkin@gmail.com> wrote:
> On Thu, Jan 16, 2014 at 1:51 AM, Francois Romieu <romieu@fr.zoreil.com> wrote:
>> Dmitry Kasatkin <dmitry.kasatkin@gmail.com> :
>> [...]
>>> I do not see any link speed changes... it stays the same...
>>> The same problem is visible on absolutely different computers.
>>
>> No netdev watchdog message either ?
>>
>> A serving 8168c does not seem to fluctuate (3.12.5, Intel 82578 client).
>> My hardware is a bit old though. Please send XID message from the r8169
>> driver. It should be seen in dmesg.
>>
>> Thanks.
>>
>> --
>> Ueimor
>
> Hi,
>
> No watchdog messages. I also do not see any changes in the led on the
> switch which indicates changes in the link speed.
>
> Also as you say.. speed drop first to 140MBs so it is still higher than 100MBs
>
> This what I have in dmesg...
>
> [ 2.005555] r8169 0000:03:00.0: irq 45 for MSI/MSI-X
> [ 2.005690] r8169 0000:03:00.0 eth0: RTL8168evl/8111evl at
> 0xffffc90000040000, 18:67:b0:2c:0f:ef, XID 0c900800 IRQ 45
> [ 2.005691] r8169 0000:03:00.0 eth0: jumbo features [frames: 9200
> bytes, tx checksumming: ko]
>
> Is it that XID or something else..
>
> I have a problem on Gygabyte Celleron 1007U integrated board and also
> on Samsung Series 7 laptop.
> My colleague has the same on his Series 7 laptop.
>
> One thing.. I had similar problem with Intel network card. It was
> fixed using module parameter...
>
> modprobe e1000e InterruptThrottleRate=0
>
> Are there any network speed or irq throttling in kernel/driver?
>
> --
> Thanks,
> Dmitry
Hello,
CC: Ubuntu kernel team.
In fact after installing kernel from PPA everything seems to be fine.
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.12.8-trusty/
So the problem is somewhere in Ubuntu 3.11-0.15 kernel...
May be Ubuntu kernel team might test and release "better" default kernel...
--
Thanks,
Dmitry
^ permalink raw reply
* Re: [PATCH net-next 1/2] bonding: add sysfs /slave dir for bond slave devices.
From: Veaceslav Falico @ 2014-01-16 18:44 UTC (permalink / raw)
To: Scott Feldman; +Cc: fubar, andy, netdev, roopa, shm
In-Reply-To: <20140116055434.32220.89883.stgit@monster-03.cumulusnetworks.com>
On Wed, Jan 15, 2014 at 09:54:34PM -0800, Scott Feldman wrote:
...snip...
>+ res = bond_sysfs_slave_add(new_slave);
>+ if (res) {
>+ pr_debug("Error %d calling bond_sysfs_slave_add\n", res);
>+ goto err_upper_unlink;
>+ }
>+
> bond->slave_cnt++;
> bond_compute_features(bond);
> bond_set_carrier(bond);
>@@ -1595,6 +1617,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
> return 0;
>
> /* Undo stages on error */
>+err_upper_unlink:
>+ bond_upper_dev_unlink(bond_dev, slave_dev);
>+
> err_unregister:
> netdev_rx_handler_unregister(slave_dev);
>
In case bond_sysfs_slave_add() creates the kobject, but fails to create the
attributes, we'll end up with a mem leak, as we don't do kobject_put() on
it.
^ permalink raw reply
* Re: [PATCH net-next v4 1/2] dts: Add a binding for Synopsys emac max-frame-size
From: Vince Bridgers @ 2014-01-16 18:48 UTC (permalink / raw)
To: Ben Hutchings
Cc: devicetree, netdev, Giuseppe CAVALLARO, robh+dt, pawel.moll,
mark.rutland, ijc+devicetree, Kumar Gala, Dinh Nguyen,
Rayagond Kokatanur
In-Reply-To: <1389894601.11912.54.camel@bwh-desktop.uk.level5networks.com>
On Thu, Jan 16, 2014 at 11:50 AM, Ben Hutchings
<bhutchings@solarflare.com> wrote:
> On Thu, 2014-01-16 at 08:05 -0600, Vince Bridgers wrote:
>> This change adds a parameter for the Synopsys 10/100/1000
>> stmmac Ethernet driver to configure the maximum frame
>> size supported by the EMAC driver. Synopsys allows the FIFO
>> sizes to be configured when the cores are built for a particular
>> device, but do not provide a way for the driver to read
>> information from the device about the maximum MTU size
>> supported as limited by the device's FIFO size.
>>
>> Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
>> ---
>> V4: add comments to explain use of max-frame-size with respect
>> to inconsistent definition and use in the ePAPR v1.1 spec
>
> Well, ePAPR does not seem to be consistent with itself. :-)
>
>> V3: change snps,max-frame-size to max-frame-size
>> V2: change snps,max-mtu to snps,max-frame-size
>> ---
>> Documentation/devicetree/bindings/net/stmmac.txt | 13 ++++++++++++-
>> 1 file changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
>> index eba0e5e..d553be2 100644
>> --- a/Documentation/devicetree/bindings/net/stmmac.txt
>> +++ b/Documentation/devicetree/bindings/net/stmmac.txt
>> @@ -29,7 +29,17 @@ Required properties:
>> ignored if force_thresh_dma_mode is set.
>>
>> Optional properties:
>> -- mac-address: 6 bytes, mac address
>> +- mac-address: 6 bytes, mac address
>> +- max-frame-size: Maximum frame size permitted. This parameter is useful
>> + since different implementations of the Synopsys MAC may
>> + have different FIFO sizes depending on the selections
>> + made in Synopsys Core Consultant. Note that the usage
>> + is inconsistent with the definition in the ePAPR v1.1
>> + specification, as it defines max-frame-size inclusive
>> + of the MAC DA, SA, Ethertype and CRC while usage is
>> + consistent with the IEEE definition of MAC Client
>> + Data, which is sans the MAC DA, SA, Ethertype and
>> + CRC.
> [...]
>
> While this is very precise, I fear that it is now so verbose that it
> actually becomes confusing. Can this not be condensed to 'the maximum
> MTU and MRU, rather than the maximum Ethernet frame size'?
>
> Ben.
Sure, I'll cut this down and resubmit as V5. How about
"The Maximum Transfer Unit (IEEE defined MTU), rather than the maximum
frame size."
Cheers,
Vince
^ permalink raw reply
* Re: [PATCH] net: introduce SO_BPF_EXTENSIONS
From: Eric Dumazet @ 2014-01-16 18:49 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: Michal Sekletar, netdev, Michael Kerrisk, David Miller
In-Reply-To: <52D82626.5060701@redhat.com>
On Thu, 2014-01-16 at 19:34 +0100, Daniel Borkmann wrote:
> > Thank you for the review. Btw, what do you think about define for parisc? I am
>
> Yes, saw that in the patch and had similar thoughts.
>
> > not sure I grok 0x4048 for SO_MAX_PACING_RATE and hence not sure about 0x4029
> > for SO_BPF_EXTENSIONS.
>
> Hmm, maybe typo; SO_MAX_PACING_RATE should have been a 0x4028 ?
Indeed it was a typo.
I think its time to change this, as this was added for linux-3.13
^ permalink raw reply
* Re: [PATCH net-next 2/2] reciprocal_divide: correction/update of the algorithm
From: Ben Hutchings @ 2014-01-16 18:50 UTC (permalink / raw)
To: Christoph Lameter
Cc: Daniel Borkmann, davem, netdev, linux-kernel,
Hannes Frederic Sowa, Eric Dumazet, Austin S Hemmelgarn,
Jesse Gross, Jamal Hadi Salim, Stephen Hemminger, Matt Mackall,
Pekka Enberg, Andy Gospodarek, Veaceslav Falico, Jay Vosburgh,
Jakub Zawadzki
In-Reply-To: <alpine.DEB.2.10.1401161036110.29778@nuc>
On Thu, 2014-01-16 at 10:37 -0600, Christoph Lameter wrote:
> On Thu, 16 Jan 2014, Daniel Borkmann wrote:
>
> > - * or else the performance is slower than a normal divide.
> > - */
> > -extern u32 reciprocal_value(u32 B);
> > +struct reciprocal_value {
> > + u32 m;
> > + u8 sh1, sh2;
> > +};
> >
> > +#define RECIPROCAL_VALUE_RESULT_TO_ZERO ((struct reciprocal_value){.sh1 = 32})
> >
> > -static inline u32 reciprocal_divide(u32 A, u32 R)
> > +struct reciprocal_value reciprocal_value(u32 d);
>
> A function that returns a struct? That works? Which gcc versions support
> it?
At least since gcc 1.29, given:
Thu Sep 22 15:57:41 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
[...]
* stmt.c (expand_function_start): Set current_function_needs_context
and current_function_returns_struct.
Hope that's not a problem...
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH net-next v3 5/5] virtio-net: initial rx sysfs support, export mergeable rx buffer size
From: Michael S. Tsirkin @ 2014-01-16 18:50 UTC (permalink / raw)
To: Eric Dumazet
Cc: Michael Dalton, netdev, lf-virt, Eric Dumazet, David S. Miller
In-Reply-To: <1389895481.31367.411.camel@edumazet-glaptop2.roam.corp.google.com>
On Thu, Jan 16, 2014 at 10:04:41AM -0800, Eric Dumazet wrote:
> On Thu, 2014-01-16 at 09:27 -0800, Michael Dalton wrote:
> > Sorry, just realized - I think disabling NAPI is necessary but not
> > sufficient. There is also the issue that refill_work() could be
> > scheduled. If refill_work() executes, it will re-enable NAPI. We'd need
> > to cancel the vi->refill delayed work to prevent this AFAICT, and also
> > ensure that no other function re-schedules vi->refill or re-enables NAPI
> > (virtnet_open/close, virtnet_set_queues, and virtnet_freeze/restore).
> >
> > How is the following sequence of operations:
> > rtnl_lock();
> > cancel_delayed_work_sync(&vi->refill);
> > napi_disable(&rq->napi);
> > read rq->mrg_avg_pkt_len
> > virtnet_enable_napi();
> > rtnl_unlock();
> >
> > Additionally, if we disable NAPI when reading this file, perhaps
> > the permissions should be changed to 400 so that an unprivileged
> > user cannot temporarily disable network RX processing by reading these
> > sysfs files. Does that sound reasonable?
>
> I think all this complexity makes no sense to me.
>
> Who cares of sysfs reading a value that might be updated ?
> This is purely a debugging utility.
>
> As soon as you read the value, it might already have changed anyway.
>
> Its a integer, just read it without special care.
That's fine too as far as I'm concerned.
>
> atomic_read() has also same 'problem', and we do not care.
>
> Make sure that a recompute (aka ewma_add()) does not store intermediate
> wrong values, by using ACCESS_ONCE(), and thats enough. No need for the
> seqcount overhead.
>
> diff --git a/lib/average.c b/lib/average.c
> index 99a67e662b3c..044e0b7f28a8 100644
> --- a/lib/average.c
> +++ b/lib/average.c
> @@ -53,8 +53,10 @@ EXPORT_SYMBOL(ewma_init);
> */
> struct ewma *ewma_add(struct ewma *avg, unsigned long val)
> {
> - avg->internal = avg->internal ?
> - (((avg->internal << avg->weight) - avg->internal) +
> + unsigned long internal = ACCESS_ONCE(avg->internal);
> +
> + ACCESS_ONCE(avg->internal) = internal ?
> + (((internal << avg->weight) - internal) +
> (val << avg->factor)) >> avg->weight :
> (val << avg->factor);
> return avg;
>
^ permalink raw reply
* Re: [PATCH] net: introduce SO_BPF_EXTENSIONS
From: Daniel Borkmann @ 2014-01-16 18:52 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Michal Sekletar, netdev, Michael Kerrisk, David Miller
In-Reply-To: <1389898146.31367.413.camel@edumazet-glaptop2.roam.corp.google.com>
On 01/16/2014 07:49 PM, Eric Dumazet wrote:
> On Thu, 2014-01-16 at 19:34 +0100, Daniel Borkmann wrote:
>
>>> Thank you for the review. Btw, what do you think about define for parisc? I am
>>
>> Yes, saw that in the patch and had similar thoughts.
>>
>>> not sure I grok 0x4048 for SO_MAX_PACING_RATE and hence not sure about 0x4029
>>> for SO_BPF_EXTENSIONS.
>>
>> Hmm, maybe typo; SO_MAX_PACING_RATE should have been a 0x4028 ?
>
> Indeed it was a typo.
>
> I think its time to change this, as this was added for linux-3.13
Ok, are you sending out a patch?
Thanks,
Daniel
^ permalink raw reply
* Re: [PATCH net-next v3 4/5] net-sysfs: add support for device-specific rx queue sysfs attributes
From: Ben Hutchings @ 2014-01-16 18:57 UTC (permalink / raw)
To: Michael Dalton
Cc: Michael S. Tsirkin, netdev, virtualization, Eric Dumazet,
David S. Miller
In-Reply-To: <1389865126-26225-4-git-send-email-mwdalton@google.com>
On Thu, 2014-01-16 at 01:38 -0800, Michael Dalton wrote:
[...]
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
[...]
> @@ -2401,6 +2416,23 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
> #endif
> }
>
> +#ifdef CONFIG_SYSFS
> +static inline unsigned int get_netdev_rx_queue_index(
> + struct netdev_rx_queue *queue)
> +{
> + struct net_device *dev = queue->dev;
> + int i;
> +
> + for (i = 0; i < dev->num_rx_queues; i++)
> + if (queue == &dev->_rx[i])
> + break;
Why write a loop when you can do:
i = queue - dev->_rx;
Ben.
> + BUG_ON(i >= dev->num_rx_queues);
> +
> + return i;
> +}
> +#endif
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH net-next v4 1/2] dts: Add a binding for Synopsys emac max-frame-size
From: Ben Hutchings @ 2014-01-16 19:00 UTC (permalink / raw)
To: Vince Bridgers
Cc: devicetree, netdev, Giuseppe CAVALLARO, robh+dt, pawel.moll,
mark.rutland, ijc+devicetree, Kumar Gala, Dinh Nguyen,
Rayagond Kokatanur
In-Reply-To: <CAOwfj2N2p_B-Wq0DTzt76RAbqCu5O088wxWiLEvHCc0qusDq-g@mail.gmail.com>
On Thu, 2014-01-16 at 12:48 -0600, Vince Bridgers wrote:
> On Thu, Jan 16, 2014 at 11:50 AM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
> > On Thu, 2014-01-16 at 08:05 -0600, Vince Bridgers wrote:
> >> This change adds a parameter for the Synopsys 10/100/1000
> >> stmmac Ethernet driver to configure the maximum frame
> >> size supported by the EMAC driver. Synopsys allows the FIFO
> >> sizes to be configured when the cores are built for a particular
> >> device, but do not provide a way for the driver to read
> >> information from the device about the maximum MTU size
> >> supported as limited by the device's FIFO size.
> >>
> >> Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
> >> ---
> >> V4: add comments to explain use of max-frame-size with respect
> >> to inconsistent definition and use in the ePAPR v1.1 spec
> >
> > Well, ePAPR does not seem to be consistent with itself. :-)
> >
> >> V3: change snps,max-frame-size to max-frame-size
> >> V2: change snps,max-mtu to snps,max-frame-size
> >> ---
> >> Documentation/devicetree/bindings/net/stmmac.txt | 13 ++++++++++++-
> >> 1 file changed, 12 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
> >> index eba0e5e..d553be2 100644
> >> --- a/Documentation/devicetree/bindings/net/stmmac.txt
> >> +++ b/Documentation/devicetree/bindings/net/stmmac.txt
> >> @@ -29,7 +29,17 @@ Required properties:
> >> ignored if force_thresh_dma_mode is set.
> >>
> >> Optional properties:
> >> -- mac-address: 6 bytes, mac address
> >> +- mac-address: 6 bytes, mac address
> >> +- max-frame-size: Maximum frame size permitted. This parameter is useful
> >> + since different implementations of the Synopsys MAC may
> >> + have different FIFO sizes depending on the selections
> >> + made in Synopsys Core Consultant. Note that the usage
> >> + is inconsistent with the definition in the ePAPR v1.1
> >> + specification, as it defines max-frame-size inclusive
> >> + of the MAC DA, SA, Ethertype and CRC while usage is
> >> + consistent with the IEEE definition of MAC Client
> >> + Data, which is sans the MAC DA, SA, Ethertype and
> >> + CRC.
> > [...]
> >
> > While this is very precise, I fear that it is now so verbose that it
> > actually becomes confusing. Can this not be condensed to 'the maximum
> > MTU and MRU, rather than the maximum Ethernet frame size'?
> >
> > Ben.
>
> Sure, I'll cut this down and resubmit as V5. How about
>
> "The Maximum Transfer Unit (IEEE defined MTU), rather than the maximum
> frame size."
Sounds good.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH net-next 1/2] bonding: add sysfs /slave dir for bond slave devices.
From: Scott Feldman @ 2014-01-16 19:00 UTC (permalink / raw)
To: Veaceslav Falico
Cc: Jay Vosburgh, Andy Gospodarek, Netdev, Roopa Prabhu,
Shrijeet Mukherjee
In-Reply-To: <20140116184441.GB24396@redhat.com>
On Jan 16, 2014, at 10:44 AM, Veaceslav Falico <vfalico@redhat.com> wrote:
> On Wed, Jan 15, 2014 at 09:54:34PM -0800, Scott Feldman wrote:
> ...snip...
>> + res = bond_sysfs_slave_add(new_slave);
>> + if (res) {
>> + pr_debug("Error %d calling bond_sysfs_slave_add\n", res);
>> + goto err_upper_unlink;
>> + }
>> +
>> bond->slave_cnt++;
>> bond_compute_features(bond);
>> bond_set_carrier(bond);
>> @@ -1595,6 +1617,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
>> return 0;
>>
>> /* Undo stages on error */
>> +err_upper_unlink:
>> + bond_upper_dev_unlink(bond_dev, slave_dev);
>> +
>> err_unregister:
>> netdev_rx_handler_unregister(slave_dev);
>>
>
> In case bond_sysfs_slave_add() creates the kobject, but fails to create the
> attributes, we'll end up with a mem leak, as we don't do kobject_put() on
> it.
I’ll fix this and the other one Ding found and send v2. Thanks for reviewing!
-scott
^ permalink raw reply
* [PATCH net v2] tcp: metrics: Avoid duplicate entries with the same destination-IP
From: Christoph Paasch @ 2014-01-16 19:01 UTC (permalink / raw)
To: netdev; +Cc: David Miller, Eric Dumazet
Because the tcp-metrics is an RCU-list, it may be that two
soft-interrupts are inside __tcp_get_metrics() for the same
destination-IP at the same time. If this destination-IP is not yet part of
the tcp-metrics, both soft-interrupts will end up in tcpm_new and create
a new entry for this IP.
So, we will have two tcp-metrics with the same destination-IP in the list.
This patch checks twice __tcp_get_metrics(). First without holding the
lock, then while holding the lock. The second one is there to confirm
that the entry has not been added by another soft-irq while waiting for
the spin-lock.
Fixes: 51c5d0c4b169b (tcp: Maintain dynamic metrics in local cache.)
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
---
v2: As requested by Eric D.: Check the cache twice. Once without holding the lock,
and then again while holding the lock. That way we avoid taking the lock
needlessly.
net/ipv4/tcp_metrics.c | 51 +++++++++++++++++++++++++++++++-------------------
1 file changed, 32 insertions(+), 19 deletions(-)
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index 06493736fbc8..098b3a29f6f3 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -22,6 +22,9 @@
int sysctl_tcp_nometrics_save __read_mostly;
+static struct tcp_metrics_block *__tcp_get_metrics(const struct inetpeer_addr *addr,
+ struct net *net, unsigned int hash);
+
struct tcp_fastopen_metrics {
u16 mss;
u16 syn_loss:10; /* Recurring Fast Open SYN losses */
@@ -130,16 +133,41 @@ static void tcpm_suck_dst(struct tcp_metrics_block *tm, struct dst_entry *dst,
}
}
+#define TCP_METRICS_TIMEOUT (60 * 60 * HZ)
+
+static void tcpm_check_stamp(struct tcp_metrics_block *tm, struct dst_entry *dst)
+{
+ if (tm && unlikely(time_after(jiffies, tm->tcpm_stamp + TCP_METRICS_TIMEOUT)))
+ tcpm_suck_dst(tm, dst, false);
+}
+
+#define TCP_METRICS_RECLAIM_DEPTH 5
+#define TCP_METRICS_RECLAIM_PTR (struct tcp_metrics_block *) 0x1UL
+
static struct tcp_metrics_block *tcpm_new(struct dst_entry *dst,
struct inetpeer_addr *addr,
- unsigned int hash,
- bool reclaim)
+ unsigned int hash)
{
struct tcp_metrics_block *tm;
struct net *net;
+ bool reclaim = false;
spin_lock_bh(&tcp_metrics_lock);
net = dev_net(dst->dev);
+
+ /* While waiting for the spin-lock the cache might have been populated
+ * with this entry and so we have to check again.
+ */
+ tm = __tcp_get_metrics(addr, net, hash);
+ if (tm == TCP_METRICS_RECLAIM_PTR) {
+ reclaim = true;
+ tm = NULL;
+ }
+ if (tm) {
+ tcpm_check_stamp(tm, dst);
+ goto out_unlock;
+ }
+
if (unlikely(reclaim)) {
struct tcp_metrics_block *oldest;
@@ -169,17 +197,6 @@ out_unlock:
return tm;
}
-#define TCP_METRICS_TIMEOUT (60 * 60 * HZ)
-
-static void tcpm_check_stamp(struct tcp_metrics_block *tm, struct dst_entry *dst)
-{
- if (tm && unlikely(time_after(jiffies, tm->tcpm_stamp + TCP_METRICS_TIMEOUT)))
- tcpm_suck_dst(tm, dst, false);
-}
-
-#define TCP_METRICS_RECLAIM_DEPTH 5
-#define TCP_METRICS_RECLAIM_PTR (struct tcp_metrics_block *) 0x1UL
-
static struct tcp_metrics_block *tcp_get_encode(struct tcp_metrics_block *tm, int depth)
{
if (tm)
@@ -282,7 +299,6 @@ static struct tcp_metrics_block *tcp_get_metrics(struct sock *sk,
struct inetpeer_addr addr;
unsigned int hash;
struct net *net;
- bool reclaim;
addr.family = sk->sk_family;
switch (addr.family) {
@@ -304,13 +320,10 @@ static struct tcp_metrics_block *tcp_get_metrics(struct sock *sk,
hash = hash_32(hash, net->ipv4.tcp_metrics_hash_log);
tm = __tcp_get_metrics(&addr, net, hash);
- reclaim = false;
- if (tm == TCP_METRICS_RECLAIM_PTR) {
- reclaim = true;
+ if (tm == TCP_METRICS_RECLAIM_PTR)
tm = NULL;
- }
if (!tm && create)
- tm = tcpm_new(dst, &addr, hash, reclaim);
+ tm = tcpm_new(dst, &addr, hash);
else
tcpm_check_stamp(tm, dst);
--
1.8.3.2
^ permalink raw reply related
* Re: [PATCH net-next v3 4/5] net-sysfs: add support for device-specific rx queue sysfs attributes
From: Michael Dalton @ 2014-01-16 19:07 UTC (permalink / raw)
To: Ben Hutchings
Cc: Michael S. Tsirkin, netdev, lf-virt, Eric Dumazet,
David S. Miller
In-Reply-To: <1389898650.11912.65.camel@bwh-desktop.uk.level5networks.com>
On Jan 16, 2014 at 10:57 AM, Ben Hutchings <bhutchings@solarflare.com> wrote:
> Why write a loop when you can do:
> i = queue - dev->_rx;
Good point, the loop approach was done in get_netdev_queue_index --
I agree your fix is faster and simpler. I'll fix in next patchset.
Thanks!
Best,
Mike
^ permalink raw reply
* Re: [PATCH] net: introduce SO_BPF_EXTENSIONS
From: Eric Dumazet @ 2014-01-16 19:09 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: Michal Sekletar, netdev, Michael Kerrisk, David Miller
In-Reply-To: <52D82A7A.3090106@redhat.com>
On Thu, 2014-01-16 at 19:52 +0100, Daniel Borkmann wrote:
> On 01/16/2014 07:49 PM, Eric Dumazet wrote:
> > On Thu, 2014-01-16 at 19:34 +0100, Daniel Borkmann wrote:
> >
> >>> Thank you for the review. Btw, what do you think about define for parisc? I am
> >>
> >> Yes, saw that in the patch and had similar thoughts.
> >>
> >>> not sure I grok 0x4048 for SO_MAX_PACING_RATE and hence not sure about 0x4029
> >>> for SO_BPF_EXTENSIONS.
> >>
> >> Hmm, maybe typo; SO_MAX_PACING_RATE should have been a 0x4028 ?
> >
> > Indeed it was a typo.
> >
> > I think its time to change this, as this was added for linux-3.13
>
> Ok, are you sending out a patch?
Yes, I will, thanks !
^ permalink raw reply
* [PATCH net] ipv6: simplify detection of first operational link-local address on interface
From: Hannes Frederic Sowa @ 2014-01-16 19:13 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, fbl
In-Reply-To: <20140116135323.GA7961@minipsycho.orion>
In commit 1ec047eb4751e3 ("ipv6: introduce per-interface counter for
dad-completed ipv6 addresses") I build the detection of the first
operational link-local address much to complex. Additionally this code
now has a race condition.
Replace it with a much simpler variant, which just scans the address
list when duplicate address detection completes, to check if this is
the first valid link local address and send RS and MLD reports then.
Fixes: 1ec047eb4751e3 ("ipv6: introduce per-interface counter for dad-completed ipv6 addresses")
Reported-by: Jiri Pirko <jiri@resnulli.us>
Cc: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
include/net/if_inet6.h | 1 -
net/ipv6/addrconf.c | 38 +++++++++++++++++---------------------
2 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index b58c36c..9650a3f 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -165,7 +165,6 @@ struct inet6_dev {
struct net_device *dev;
struct list_head addr_list;
- int valid_ll_addr_cnt;
struct ifmcaddr6 *mc_list;
struct ifmcaddr6 *mc_tomb;
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 6913a82..f91e107 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3233,6 +3233,22 @@ out:
in6_ifa_put(ifp);
}
+/* ifp->idev must be at least read locked */
+static bool ipv6_lonely_lladdr(struct inet6_ifaddr *ifp)
+{
+ struct inet6_ifaddr *ifpiter;
+ struct inet6_dev *idev = ifp->idev;
+
+ list_for_each_entry(ifpiter, &idev->addr_list, if_list) {
+ if (ifp != ifpiter && ifpiter->scope == IFA_LINK &&
+ (ifpiter->flags & (IFA_F_PERMANENT|IFA_F_TENTATIVE|
+ IFA_F_OPTIMISTIC|IFA_F_DADFAILED)) ==
+ IFA_F_PERMANENT)
+ return false;
+ }
+ return true;
+}
+
static void addrconf_dad_completed(struct inet6_ifaddr *ifp)
{
struct net_device *dev = ifp->idev->dev;
@@ -3252,14 +3268,11 @@ static void addrconf_dad_completed(struct inet6_ifaddr *ifp)
*/
read_lock_bh(&ifp->idev->lock);
- spin_lock(&ifp->lock);
- send_mld = ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL &&
- ifp->idev->valid_ll_addr_cnt == 1;
+ send_mld = ifp->scope == IFA_LINK && ipv6_lonely_lladdr(ifp);
send_rs = send_mld &&
ipv6_accept_ra(ifp->idev) &&
ifp->idev->cnf.rtr_solicits > 0 &&
(dev->flags&IFF_LOOPBACK) == 0;
- spin_unlock(&ifp->lock);
read_unlock_bh(&ifp->idev->lock);
/* While dad is in progress mld report's source address is in6_addrany.
@@ -4598,19 +4611,6 @@ errout:
rtnl_set_sk_err(net, RTNLGRP_IPV6_PREFIX, err);
}
-static void update_valid_ll_addr_cnt(struct inet6_ifaddr *ifp, int count)
-{
- write_lock_bh(&ifp->idev->lock);
- spin_lock(&ifp->lock);
- if (((ifp->flags & (IFA_F_PERMANENT|IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|
- IFA_F_DADFAILED)) == IFA_F_PERMANENT) &&
- (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL))
- ifp->idev->valid_ll_addr_cnt += count;
- WARN_ON(ifp->idev->valid_ll_addr_cnt < 0);
- spin_unlock(&ifp->lock);
- write_unlock_bh(&ifp->idev->lock);
-}
-
static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
{
struct net *net = dev_net(ifp->idev->dev);
@@ -4619,8 +4619,6 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
switch (event) {
case RTM_NEWADDR:
- update_valid_ll_addr_cnt(ifp, 1);
-
/*
* If the address was optimistic
* we inserted the route at the start of
@@ -4636,8 +4634,6 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
ifp->idev->dev, 0, 0);
break;
case RTM_DELADDR:
- update_valid_ll_addr_cnt(ifp, -1);
-
if (ifp->idev->cnf.forwarding)
addrconf_leave_anycast(ifp);
addrconf_leave_solict(ifp->idev, &ifp->addr);
--
1.8.4.2
^ permalink raw reply related
* [PATCH] parisc: fix SO_MAX_PACING_RATE typo
From: Eric Dumazet @ 2014-01-16 19:15 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: Michal Sekletar, netdev, Michael Kerrisk, David Miller
In-Reply-To: <52D82A7A.3090106@redhat.com>
From: Eric Dumazet <edumazet@google.com>
SO_MAX_PACING_RATE definition on parisc got a typo.
Its not too late to fix it, before 3.13 is official.
Fixes: 62748f32d501 ("net: introduce SO_MAX_PACING_RATE")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
arch/parisc/include/uapi/asm/socket.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
index f33113a6141e..70b3674dac4e 100644
--- a/arch/parisc/include/uapi/asm/socket.h
+++ b/arch/parisc/include/uapi/asm/socket.h
@@ -75,6 +75,6 @@
#define SO_BUSY_POLL 0x4027
-#define SO_MAX_PACING_RATE 0x4048
+#define SO_MAX_PACING_RATE 0x4028
#endif /* _UAPI_ASM_SOCKET_H */
^ permalink raw reply related
* Re: [PATCH net v2] tcp: metrics: Avoid duplicate entries with the same destination-IP
From: Eric Dumazet @ 2014-01-16 19:20 UTC (permalink / raw)
To: Christoph Paasch; +Cc: netdev, David Miller
In-Reply-To: <1389898881-11393-1-git-send-email-christoph.paasch@uclouvain.be>
On Thu, 2014-01-16 at 20:01 +0100, Christoph Paasch wrote:
> Because the tcp-metrics is an RCU-list, it may be that two
> soft-interrupts are inside __tcp_get_metrics() for the same
> destination-IP at the same time. If this destination-IP is not yet part of
> the tcp-metrics, both soft-interrupts will end up in tcpm_new and create
> a new entry for this IP.
> So, we will have two tcp-metrics with the same destination-IP in the list.
>
> This patch checks twice __tcp_get_metrics(). First without holding the
> lock, then while holding the lock. The second one is there to confirm
> that the entry has not been added by another soft-irq while waiting for
> the spin-lock.
>
> Fixes: 51c5d0c4b169b (tcp: Maintain dynamic metrics in local cache.)
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
>
> v2: As requested by Eric D.: Check the cache twice. Once without holding the lock,
> and then again while holding the lock. That way we avoid taking the lock
> needlessly.
>
> net/ipv4/tcp_metrics.c | 51 +++++++++++++++++++++++++++++++-------------------
> 1 file changed, 32 insertions(+), 19 deletions(-)
Reviewed-by: Eric Dumazet <edumazet@google.com>
Thanks !
^ 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