* [PATCH v2 03/11] hso: fix memory leak when device disconnects
From: Olivier Sobrie @ 2015-01-30 12:21 UTC (permalink / raw)
To: Jan Dumon, Dan Williams; +Cc: linux-kernel, linux-usb, netdev, Olivier Sobrie
In-Reply-To: <1422620523-15021-3-git-send-email-olivier@sobrie.be>
In the disconnect path, tx_buffer should freed like tx_data to avoid
a memory leak when the device disconnects.
Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
drivers/net/usb/hso.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 3a6c630..470ef9e 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -2253,6 +2253,7 @@ static void hso_serial_common_free(struct hso_serial *serial)
/* unlink and free TX URB */
usb_free_urb(serial->tx_urb);
+ kfree(serial->tx_buffer);
kfree(serial->tx_data);
tty_port_destroy(&serial->port);
}
--
2.2.0
^ permalink raw reply related
* [PATCH v2 04/11] hso: fix memory leak in hso_create_rfkill()
From: Olivier Sobrie @ 2015-01-30 12:21 UTC (permalink / raw)
To: Jan Dumon, Dan Williams; +Cc: linux-kernel, linux-usb, netdev, Olivier Sobrie
In-Reply-To: <1422620523-15021-4-git-send-email-olivier@sobrie.be>
When the rfkill interface was created, a buffer containing the name
of the rfkill node was allocated. This buffer was never freed when the
device disappears.
To fix the problem, we put the name given to rfkill_alloc() in
the hso_net structure.
Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
drivers/net/usb/hso.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 470ef9e..a49ac2e 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -153,6 +153,7 @@ struct hso_net {
struct hso_device *parent;
struct net_device *net;
struct rfkill *rfkill;
+ char name[8];
struct usb_endpoint_descriptor *in_endp;
struct usb_endpoint_descriptor *out_endp;
@@ -2467,27 +2468,20 @@ static void hso_create_rfkill(struct hso_device *hso_dev,
{
struct hso_net *hso_net = dev2net(hso_dev);
struct device *dev = &hso_net->net->dev;
- char *rfkn;
- rfkn = kzalloc(20, GFP_KERNEL);
- if (!rfkn)
- dev_err(dev, "%s - Out of memory\n", __func__);
-
- snprintf(rfkn, 20, "hso-%d",
+ snprintf(hso_net->name, sizeof(hso_net->name), "hso-%d",
interface->altsetting->desc.bInterfaceNumber);
- hso_net->rfkill = rfkill_alloc(rfkn,
+ hso_net->rfkill = rfkill_alloc(hso_net->name,
&interface_to_usbdev(interface)->dev,
RFKILL_TYPE_WWAN,
&hso_rfkill_ops, hso_dev);
if (!hso_net->rfkill) {
dev_err(dev, "%s - Out of memory\n", __func__);
- kfree(rfkn);
return;
}
if (rfkill_register(hso_net->rfkill) < 0) {
rfkill_destroy(hso_net->rfkill);
- kfree(rfkn);
hso_net->rfkill = NULL;
dev_err(dev, "%s - Failed to register rfkill\n", __func__);
return;
--
2.2.0
^ permalink raw reply related
* [PATCH v2 05/11] hso: fix small indentation error
From: Olivier Sobrie @ 2015-01-30 12:21 UTC (permalink / raw)
To: Jan Dumon, Dan Williams; +Cc: linux-kernel, linux-usb, netdev, Olivier Sobrie
In-Reply-To: <1422620523-15021-5-git-send-email-olivier@sobrie.be>
Simply remove the useless extra tab.
Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
drivers/net/usb/hso.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index a49ac2e..2f2343d 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -2206,8 +2206,8 @@ static int hso_stop_serial_device(struct hso_device *hso_dev)
for (i = 0; i < serial->num_rx_urbs; i++) {
if (serial->rx_urb[i]) {
- usb_kill_urb(serial->rx_urb[i]);
- serial->rx_urb_filled[i] = 0;
+ usb_kill_urb(serial->rx_urb[i]);
+ serial->rx_urb_filled[i] = 0;
}
}
serial->curr_rx_urb_idx = 0;
--
2.2.0
^ permalink raw reply related
* [PATCH v2 06/11] hso: rename hso_dev into serial in hso_free_interface()
From: Olivier Sobrie @ 2015-01-30 12:21 UTC (permalink / raw)
To: Jan Dumon, Dan Williams; +Cc: linux-kernel, linux-usb, netdev, Olivier Sobrie
In-Reply-To: <1422620523-15021-6-git-send-email-olivier@sobrie.be>
In other functions of the driver, variables of type "struct hso_serial"
are denoted by "serial" and variables of type "struct hso_device" are
denoted by "hso_dev". This patch makes the hso_free_interface()
consistent with these notations.
Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
drivers/net/usb/hso.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 2f2343d..484e423 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -3115,17 +3115,17 @@ static void hso_serial_ref_free(struct kref *ref)
static void hso_free_interface(struct usb_interface *interface)
{
- struct hso_serial *hso_dev;
+ struct hso_serial *serial;
int i;
for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
if (serial_table[i] &&
(serial_table[i]->interface == interface)) {
- hso_dev = dev2ser(serial_table[i]);
- tty_port_tty_hangup(&hso_dev->port, false);
- mutex_lock(&hso_dev->parent->mutex);
- hso_dev->parent->usb_gone = 1;
- mutex_unlock(&hso_dev->parent->mutex);
+ serial = dev2ser(serial_table[i]);
+ tty_port_tty_hangup(&serial->port, false);
+ mutex_lock(&serial->parent->mutex);
+ serial->parent->usb_gone = 1;
+ mutex_unlock(&serial->parent->mutex);
kref_put(&serial_table[i]->ref, hso_serial_ref_free);
}
}
--
2.2.0
^ permalink raw reply related
* [PATCH v2 07/11] hso: replace reset_device work by usb_queue_reset_device()
From: Olivier Sobrie @ 2015-01-30 12:21 UTC (permalink / raw)
To: Jan Dumon, Dan Williams; +Cc: linux-kernel, linux-usb, netdev, Olivier Sobrie
In-Reply-To: <1422620523-15021-7-git-send-email-olivier@sobrie.be>
There is no need for a dedicated reset work in the hso driver since
there is already a reset work foreseen in usb_interface that does
the same.
Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
drivers/net/usb/hso.c | 25 +------------------------
1 file changed, 1 insertion(+), 24 deletions(-)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 484e423..55074da 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -274,7 +274,6 @@ struct hso_device {
u8 usb_gone;
struct work_struct async_get_intf;
struct work_struct async_put_intf;
- struct work_struct reset_device;
struct usb_device *usb;
struct usb_interface *interface;
@@ -340,7 +339,6 @@ static void async_put_intf(struct work_struct *data);
static int hso_put_activity(struct hso_device *hso_dev);
static int hso_get_activity(struct hso_device *hso_dev);
static void tiocmget_intr_callback(struct urb *urb);
-static void reset_device(struct work_struct *data);
/*****************************************************************************/
/* Helping functions */
/*****************************************************************************/
@@ -696,7 +694,7 @@ static void handle_usb_error(int status, const char *function,
case -ETIMEDOUT:
explanation = "protocol error";
if (hso_dev)
- schedule_work(&hso_dev->reset_device);
+ usb_queue_reset_device(hso_dev->interface);
break;
default:
explanation = "unknown status";
@@ -2347,7 +2345,6 @@ static struct hso_device *hso_create_device(struct usb_interface *intf,
INIT_WORK(&hso_dev->async_get_intf, async_get_intf);
INIT_WORK(&hso_dev->async_put_intf, async_put_intf);
- INIT_WORK(&hso_dev->reset_device, reset_device);
return hso_dev;
}
@@ -3086,26 +3083,6 @@ out:
return result;
}
-static void reset_device(struct work_struct *data)
-{
- struct hso_device *hso_dev =
- container_of(data, struct hso_device, reset_device);
- struct usb_device *usb = hso_dev->usb;
- int result;
-
- if (hso_dev->usb_gone) {
- D1("No reset during disconnect\n");
- } else {
- result = usb_lock_device_for_reset(usb, hso_dev->interface);
- if (result < 0)
- D1("unable to lock device for reset: %d\n", result);
- else {
- usb_reset_device(usb);
- usb_unlock_device(usb);
- }
- }
-}
-
static void hso_serial_ref_free(struct kref *ref)
{
struct hso_device *hso_dev = container_of(ref, struct hso_device, ref);
--
2.2.0
^ permalink raw reply related
* [PATCH v2 08/11] hso: move tty_unregister outside hso_serial_common_free()
From: Olivier Sobrie @ 2015-01-30 12:22 UTC (permalink / raw)
To: Jan Dumon, Dan Williams; +Cc: linux-kernel, linux-usb, netdev, Olivier Sobrie
In-Reply-To: <1422620523-15021-8-git-send-email-olivier@sobrie.be>
The function hso_serial_common_free() is called either by the cleanup
method of the tty or by the usb disconnect method.
In the former case, the usb_disconnect() has been already called
and the sysfs group associated to the device has been removed.
By calling tty_unregister directly from the usb_disconnect() method,
we avoid a warning due to the removal of the sysfs group of the usb
device.
Example of warning:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 778 at fs/sysfs/group.c:225 sysfs_remove_group+0x50/0x94()
sysfs group c0645a88 not found for kobject 'ttyHS5'
Modules linked in:
CPU: 0 PID: 778 Comm: kworker/0:3 Tainted: G W 3.18.0+ #105
Workqueue: events release_one_tty
[<c000dfe4>] (unwind_backtrace) from [<c000c014>] (show_stack+0x14/0x1c)
[<c000c014>] (show_stack) from [<c0016bac>] (warn_slowpath_common+0x5c/0x7c)
[<c0016bac>] (warn_slowpath_common) from [<c0016c60>] (warn_slowpath_fmt+0x30/0x40)
[<c0016c60>] (warn_slowpath_fmt) from [<c00ddd14>] (sysfs_remove_group+0x50/0x94)
[<c00ddd14>] (sysfs_remove_group) from [<c0221e44>] (device_del+0x30/0x190)
[<c0221e44>] (device_del) from [<c0221fb0>] (device_unregister+0xc/0x18)
[<c0221fb0>] (device_unregister) from [<c0221fec>] (device_destroy+0x30/0x3c)
[<c0221fec>] (device_destroy) from [<c01fe1dc>] (tty_unregister_device+0x2c/0x5c)
[<c01fe1dc>] (tty_unregister_device) from [<c029a428>] (hso_serial_common_free+0x2c/0x88)
[<c029a428>] (hso_serial_common_free) from [<c029a4c0>] (hso_serial_ref_free+0x3c/0xb8)
[<c029a4c0>] (hso_serial_ref_free) from [<c01ff430>] (release_one_tty+0x30/0x84)
[<c01ff430>] (release_one_tty) from [<c00271d4>] (process_one_work+0x21c/0x3c8)
[<c00271d4>] (process_one_work) from [<c0027758>] (worker_thread+0x3d8/0x560)
[<c0027758>] (worker_thread) from [<c002be4c>] (kthread+0xc0/0xcc)
[<c002be4c>] (kthread) from [<c0009630>] (ret_from_fork+0x14/0x24)
---[ end trace cb88537fdc8fa208 ]---
Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
drivers/net/usb/hso.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 55074da..5b157ad 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -2234,14 +2234,17 @@ static int hso_stop_serial_device(struct hso_device *hso_dev)
return 0;
}
-static void hso_serial_common_free(struct hso_serial *serial)
+static void hso_serial_tty_unregister(struct hso_serial *serial)
{
- int i;
-
if (serial->parent->dev)
device_remove_file(serial->parent->dev, &dev_attr_hsotype);
tty_unregister_device(tty_drv, serial->minor);
+}
+
+static void hso_serial_common_free(struct hso_serial *serial)
+{
+ int i;
for (i = 0; i < serial->num_rx_urbs; i++) {
/* unlink and free RX URB */
@@ -2323,6 +2326,7 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs,
return 0;
exit:
+ hso_serial_tty_unregister(serial);
hso_serial_common_free(serial);
return -1;
}
@@ -2683,6 +2687,7 @@ static struct hso_device *hso_create_bulk_serial_device(
return hso_dev;
exit2:
+ hso_serial_tty_unregister(serial);
hso_serial_common_free(serial);
exit:
hso_free_tiomget(serial);
@@ -3103,6 +3108,7 @@ static void hso_free_interface(struct usb_interface *interface)
mutex_lock(&serial->parent->mutex);
serial->parent->usb_gone = 1;
mutex_unlock(&serial->parent->mutex);
+ hso_serial_tty_unregister(serial);
kref_put(&serial_table[i]->ref, hso_serial_ref_free);
}
}
--
2.2.0
^ permalink raw reply related
* [PATCH v2 09/11] hso: update serial_table in usb disconnect method
From: Olivier Sobrie @ 2015-01-30 12:22 UTC (permalink / raw)
To: Jan Dumon, Dan Williams; +Cc: linux-kernel, linux-usb, netdev, Olivier Sobrie
In-Reply-To: <1422620523-15021-9-git-send-email-olivier@sobrie.be>
The serial_table is used to map the minor number of the usb serial device
to its associated context. The table is updated in the probe method and
in hso_serial_ref_free() which is called either from the tty cleanup
method or from the usb disconnect method.
This patch ensures that the serial_table is updated in the disconnect
method and no more from the cleanup method to avoid the following
potential race condition.
- hso_disconnect() is called for usb interface "x". Because the serial
port was open and because the cleanup method of the tty_port hasn't
been called yet, hso_serial_ref_free() is not run.
- hso_probe() is called and fails for a new hso serial usb interface
"y". The function hso_free_interface() is called and iterates
over the element of serial_table to find the device associated to
the usb interface context.
If the usb interface context of usb interface "y" has been created
at the same place as for usb interface "x", then the cleanup
functions are called for usb interfaces "x" and "y" and
hso_serial_ref_free() is called for both interfaces.
- release_tty() is called for serial port linked to usb interface "x"
and possibly crash because the tty_port structure contained in the
hso_device structure has been freed.
Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
drivers/net/usb/hso.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 5b157ad..c916ab5 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -2597,7 +2597,6 @@ static void hso_free_serial_device(struct hso_device *hso_dev)
if (!serial)
return;
- set_serial_by_index(serial->minor, NULL);
hso_serial_common_free(serial);
@@ -3110,6 +3109,7 @@ static void hso_free_interface(struct usb_interface *interface)
mutex_unlock(&serial->parent->mutex);
hso_serial_tty_unregister(serial);
kref_put(&serial_table[i]->ref, hso_serial_ref_free);
+ set_serial_by_index(i, NULL);
}
}
--
2.2.0
^ permalink raw reply related
* [PATCH v2 10/11] hso: add missing cancel_work_sync in disconnect()
From: Olivier Sobrie @ 2015-01-30 12:22 UTC (permalink / raw)
To: Jan Dumon, Dan Williams; +Cc: linux-kernel, linux-usb, netdev, Olivier Sobrie
In-Reply-To: <1422620523-15021-10-git-send-email-olivier@sobrie.be>
For hso serial devices, two cancel_work_sync were missing in the
disconnect method.
Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
drivers/net/usb/hso.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index c916ab5..c14fc80 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -3107,6 +3107,8 @@ static void hso_free_interface(struct usb_interface *interface)
mutex_lock(&serial->parent->mutex);
serial->parent->usb_gone = 1;
mutex_unlock(&serial->parent->mutex);
+ cancel_work_sync(&serial_table[i]->async_put_intf);
+ cancel_work_sync(&serial_table[i]->async_get_intf);
hso_serial_tty_unregister(serial);
kref_put(&serial_table[i]->ref, hso_serial_ref_free);
set_serial_by_index(i, NULL);
--
2.2.0
^ permalink raw reply related
* [PATCH v2 11/11] hso: fix rfkill name conflicts
From: Olivier Sobrie @ 2015-01-30 12:22 UTC (permalink / raw)
To: Jan Dumon, Dan Williams; +Cc: linux-kernel, linux-usb, netdev, Olivier Sobrie
In-Reply-To: <1422620523-15021-11-git-send-email-olivier@sobrie.be>
By using only the usb interface number for the rfkill name, we might
have a name conflicts in case two similar hso devices are connected.
In this patch, the name of the hso rfkill interface embed the value
of a counter that is incremented each time a new rfkill interface is
added.
Suggested-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
---
drivers/net/usb/hso.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index c14fc80..d31a165 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -153,7 +153,7 @@ struct hso_net {
struct hso_device *parent;
struct net_device *net;
struct rfkill *rfkill;
- char name[8];
+ char name[24];
struct usb_endpoint_descriptor *in_endp;
struct usb_endpoint_descriptor *out_endp;
@@ -2469,9 +2469,10 @@ static void hso_create_rfkill(struct hso_device *hso_dev,
{
struct hso_net *hso_net = dev2net(hso_dev);
struct device *dev = &hso_net->net->dev;
+ static u32 rfkill_counter;
snprintf(hso_net->name, sizeof(hso_net->name), "hso-%d",
- interface->altsetting->desc.bInterfaceNumber);
+ rfkill_counter++);
hso_net->rfkill = rfkill_alloc(hso_net->name,
&interface_to_usbdev(interface)->dev,
--
2.2.0
^ permalink raw reply related
* RE: [PATCH net-next v2 1/6] skbuff: Add skb_list_linearize()
From: David Laight @ 2015-01-30 12:25 UTC (permalink / raw)
To: 'Pravin Shelar', Alexander Duyck; +Cc: David Miller, netdev
In-Reply-To: <CALnjE+roOJx3seVQ8Jrc-x0FRx-Hdv+x4isfUCHY0rtz8XY+YA@mail.gmail.com>
From: Pravin Shelar
...
> > I'm not completely convinced this is even necessary. Seems like you are
> > wasting cycles copying the frames around when you could probably just
> > pull the header of the first frame and then use page frages to fill in
> > the rest.
> >
>
> This is what is done when possible. But skb merging is not always
> possible, for example when MAX_SKB_FRAGS limit is reached. You can
> have a look at STT implementation.
If MAX_SKB_FRAGS is reached why not just generate two frames?
Except in pathological cases with a log of small fragments
the linearize is likely to be more expensive than the processing.
David
^ permalink raw reply
* Re: Throughput regression with `tcp: refine TSO autosizing`
From: Eric Dumazet @ 2015-01-30 13:19 UTC (permalink / raw)
To: Arend van Spriel
Cc: Michal Kazior, linux-wireless, Network Development,
eyalpe-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb
In-Reply-To: <54CB5D08.2070906-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
On Fri, 2015-01-30 at 11:29 +0100, Arend van Spriel wrote:
> Hi Eric,
>
> Your suggestions are still based on the fact that you consider wireless
> networking to be similar to ethernet, but as Michal indicated there are
> some fundamental differences starting with CSMA/CD versus CSMA/CA. Also
> the medium conditions are far from comparable. There is no shielding so
> it needs to deal with interference and dynamically drops the link rate
> so transmission of packets can take several milliseconds. Then with 11n
> they came up with aggregation with sends up to 64 packets in a single
> transmit over the air at worst case 6.5 Mbps (if I am not mistaken). The
> parameter value for tcp_limit_output_bytes of 131072 means that it
> allows queuing for about 1ms on a 1Gbps link, but I hope you can see
> this is not realistic for dealing with all variances of the wireless
> medium/standard. I suggested this as topic for the wireless workshop in
> Otawa [1], but I can not attend there. Still hope that there will be
> some discussions to get more awareness.
Ever heard about bufferbloat ?
Have you read my suggestions and tried them ?
You can adjust the limit per flow to pretty much you want. If you need
64 packets, just do the math. If in 2018 you need 128 packets, do the
math again.
I am very well aware that wireless wants aggregation, thank you.
131072 bytes of queue on 40Gbit is not 1ms, but 26 usec of queueing, and
we get line rate nevertheless.
We need this level of shallow queues (BQL, TSQ), to get very precise rtt
estimations so that TCP has good entropy for its pacing, even in the 50
usec rtt ranges.
If we allowed 1ms of queueing, then a 40Gbit flow would queue 5 MBytes.
This was terrible, because it increased cwnd and all sender queues to
insane levels.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Throughput regression with `tcp: refine TSO autosizing`
From: Michal Kazior @ 2015-01-30 13:39 UTC (permalink / raw)
To: Eric Dumazet
Cc: linux-wireless, Network Development,
eyalpe-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb
In-Reply-To: <1422537297.21689.15.camel-XN9IlZ5yJG9HTL0Zs8A6p/gx64E7kk8eUsxypvmhUTTZJqsBc5GL+g@public.gmane.org>
On 29 January 2015 at 14:14, Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Thu, 2015-01-29 at 12:48 +0100, Michal Kazior wrote:
>> Hi,
>>
>> I'm not subscribed to netdev list and I can't find the message-id so I
>> can't reply directly to the original thread `BW regression after "tcp:
>> refine TSO autosizing"`.
>>
>> I've noticed a big TCP performance drop with ath10k
>> (drivers/net/wireless/ath/ath10k) on 3.19-rc5. Instead of 500mbps I
>> get 250mbps in my testbed.
>>
>> After bisecting I ended up at `tcp: refine TSO autosizing`. Reverting
>> `tcp: refine TSO autosizing` and `tcp: Do not apply TSO segment limit
>> to non-TSO packets` (for conflict free reverts) fixes the problem.
[...]
>> Any hints/ideas?
>>
>
> Hi Michal
>
> This patch restored original TSQ behavior, because the 1ms worth of data
> per flow had totally destroyed TSQ intent.
>
> vi +630 Documentation/networking/ip-sysctl.txt
[...]
> With this change and the stretch ack fixes, I got 37Gbps of throughput
> on a single flow, on a 40Gbit NIC (mlx4)
>
> If a driver needs to buffer more than tcp_limit_output_bytes=131072 to
> get line rate, I suggest that you either :
>
> 1) tweak tcp_limit_output_bytes, but its not practical from a driver.
I've briefly tried playing with this knob to no avail unfortunately. I
tried 256K, 1M - it didn't improve TCP performance. When I tried to
make it smaller (e.g. 16K) the traffic dropped even more so it does
have an effect. It seems there's some other limiting factor in this
case.
> 2) change the driver, knowing what are its exact requirements, by
> removing a fraction of skb->truesize at ndo_start_xmit() time as in :
>
> if ((skb->destructor == sock_wfree ||
> skb->restuctor == tcp_wfree) &&
> skb->sk) {
> u32 fraction = skb->truesize / 2;
>
> skb->truesize -= fraction;
> atomic_sub(fraction, &skb->sk->sk_wmem_alloc);
> }
tcp_wfree isn't exported so I went and just did a quick hack and used
`if (skb->sk)` as the condition. Didn't help with TCP.
I wonder if this TSO patch is the single thing to blame. Maybe it's
just the trigger and something else is broken? I've been seeing some
UDP performance inconsistencies in 3.19 (I don't recall seeing these
in 3.18) - but maybe my perception is failing on me.
Anyway, thanks for the tips so far.
Michał
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Throughput regression with `tcp: refine TSO autosizing`
From: Arend van Spriel @ 2015-01-30 13:47 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Michal Kazior, linux-wireless, Network Development, eyalpe
In-Reply-To: <1422623975.21689.77.camel@edumazet-glaptop2.roam.corp.google.com>
On 01/30/15 14:19, Eric Dumazet wrote:
> On Fri, 2015-01-30 at 11:29 +0100, Arend van Spriel wrote:
>
>> Hi Eric,
>>
>> Your suggestions are still based on the fact that you consider wireless
>> networking to be similar to ethernet, but as Michal indicated there are
>> some fundamental differences starting with CSMA/CD versus CSMA/CA. Also
>> the medium conditions are far from comparable. There is no shielding so
>> it needs to deal with interference and dynamically drops the link rate
>> so transmission of packets can take several milliseconds. Then with 11n
>> they came up with aggregation with sends up to 64 packets in a single
>> transmit over the air at worst case 6.5 Mbps (if I am not mistaken). The
>> parameter value for tcp_limit_output_bytes of 131072 means that it
>> allows queuing for about 1ms on a 1Gbps link, but I hope you can see
>> this is not realistic for dealing with all variances of the wireless
>> medium/standard. I suggested this as topic for the wireless workshop in
>> Otawa [1], but I can not attend there. Still hope that there will be
>> some discussions to get more awareness.
>
> Ever heard about bufferbloat ?
Sure. I am trying to get awareness about that in our wireless
driver/firmware development teams. So bear with me.
> Have you read my suggestions and tried them ?
>
> You can adjust the limit per flow to pretty much you want. If you need
> 64 packets, just do the math. If in 2018 you need 128 packets, do the
> math again.
>
> I am very well aware that wireless wants aggregation, thank you.
Sorry if I offended you. I was just giving these as example combined
with effective rate usable on the medium to say that the bandwidth is
more dynamic in wireless and as such need dynamic change of queue depth.
Now this can be done by making the fraction size as used in your
suggestion adaptive to these conditions.
> 131072 bytes of queue on 40Gbit is not 1ms, but 26 usec of queueing, and
> we get line rate nevertheless.
I was saying it was about 1ms on *1Gbit* as the wireless TCP rates are
moving into that direction in 11ac.
> We need this level of shallow queues (BQL, TSQ), to get very precise rtt
> estimations so that TCP has good entropy for its pacing, even in the 50
> usec rtt ranges.
>
> If we allowed 1ms of queueing, then a 40Gbit flow would queue 5 MBytes.
>
> This was terrible, because it increased cwnd and all sender queues to
> insane levels.
Indeed and that is what we would like to address in our wireless
drivers. I will setup some experiments using the fraction sizing and
post my findings. Again sorry if I offended you.
Regards,
Arend
^ permalink raw reply
* [PATCH net-next] pkt_sched: fq: better control of DDOS traffic
From: Eric Dumazet @ 2015-01-30 14:06 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
FQ has a fast path for skb attached to a socket, as it does not
have to compute a flow hash. But for other packets, FQ being non
stochastic means that hosts exposed to random Internet traffic
can allocate million of flows structure (104 bytes each) pretty
easily. Not only host can OOM, but lookup in RB trees can take
too much cpu and memory resources.
This patch adds a new attribute, orphan_mask, that is adding
possibility of having a stochastic hash for orphaned skb.
Its default value is 1024 slots.
This patch also handles the specific case of SYNACK messages:
They are attached to the listener socket, and therefore all map
to a single hash bucket. If listener have set SO_MAX_PACING_RATE,
hoping to have new accepted socket inherit this rate, SYNACK
might be paced and even dropped.
This is very similar to an internal patch Google have used more
than one year.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/uapi/linux/pkt_sched.h | 2 ++
net/sched/sch_fq.c | 19 +++++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index d62316baae94..534b84710745 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -774,6 +774,8 @@ enum {
TCA_FQ_FLOW_REFILL_DELAY, /* flow credit refill delay in usec */
+ TCA_FQ_ORPHAN_MASK, /* mask applied to orphaned skb hashes */
+
__TCA_FQ_MAX
};
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index 9b05924cc386..0e7d7b98fc93 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -92,6 +92,7 @@ struct fq_sched_data {
u32 flow_refill_delay;
u32 flow_max_rate; /* optional max rate per flow */
u32 flow_plimit; /* max packets per flow */
+ u32 orphan_mask; /* mask for orphaned skb */
struct rb_root *fq_root;
u8 rate_enable;
u8 fq_trees_log;
@@ -222,11 +223,20 @@ static struct fq_flow *fq_classify(struct sk_buff *skb, struct fq_sched_data *q)
if (unlikely((skb->priority & TC_PRIO_MAX) == TC_PRIO_CONTROL))
return &q->internal;
- if (unlikely(!sk)) {
+ /* SYNACK messages are attached to a listener socket.
+ * 1) They are not part of a 'flow' yet
+ * 2) We do not want to rate limit them (eg SYNFLOOD attack),
+ * especially if the listener set SO_MAX_PACING_RATE
+ * 3) We pretend they are orphaned
+ */
+ if (!sk || sk->sk_state == TCP_LISTEN) {
+ u32 hash = skb_get_hash(skb) & q->orphan_mask;
+
/* By forcing low order bit to 1, we make sure to not
* collide with a local flow (socket pointers are word aligned)
*/
- sk = (struct sock *)(skb_get_hash(skb) | 1L);
+ sk = (struct sock *)(hash | 1L);
+ skb_orphan(skb);
}
root = &q->fq_root[hash_32((u32)(long)sk, q->fq_trees_log)];
@@ -698,6 +708,9 @@ static int fq_change(struct Qdisc *sch, struct nlattr *opt)
q->flow_refill_delay = usecs_to_jiffies(usecs_delay);
}
+ if (tb[TCA_FQ_ORPHAN_MASK])
+ q->orphan_mask = nla_get_u32(tb[TCA_FQ_ORPHAN_MASK]);
+
if (!err) {
sch_tree_unlock(sch);
err = fq_resize(sch, fq_log);
@@ -743,6 +756,7 @@ static int fq_init(struct Qdisc *sch, struct nlattr *opt)
q->delayed = RB_ROOT;
q->fq_root = NULL;
q->fq_trees_log = ilog2(1024);
+ q->orphan_mask = (1024 - 1) << 1;
qdisc_watchdog_init(&q->watchdog, sch);
if (opt)
@@ -772,6 +786,7 @@ static int fq_dump(struct Qdisc *sch, struct sk_buff *skb)
nla_put_u32(skb, TCA_FQ_FLOW_MAX_RATE, q->flow_max_rate) ||
nla_put_u32(skb, TCA_FQ_FLOW_REFILL_DELAY,
jiffies_to_usecs(q->flow_refill_delay)) ||
+ nla_put_u32(skb, TCA_FQ_ORPHAN_MASK, q->orphan_mask) ||
nla_put_u32(skb, TCA_FQ_BUCKETS_LOG, q->fq_trees_log))
goto nla_put_failure;
^ permalink raw reply related
* Re: Throughput regression with `tcp: refine TSO autosizing`
From: Eric Dumazet @ 2015-01-30 14:37 UTC (permalink / raw)
To: Arend van Spriel
Cc: Michal Kazior, linux-wireless, Network Development, eyalpe
In-Reply-To: <54CB8B69.1070807@broadcom.com>
On Fri, 2015-01-30 at 14:47 +0100, Arend van Spriel wrote:
> Indeed and that is what we would like to address in our wireless
> drivers. I will setup some experiments using the fraction sizing and
> post my findings. Again sorry if I offended you.
You did not, but I had no feedback about my suggestions.
Michal sent it now.
Thanks
^ permalink raw reply
* Re: Throughput regression with `tcp: refine TSO autosizing`
From: Eric Dumazet @ 2015-01-30 14:40 UTC (permalink / raw)
To: Michal Kazior
Cc: linux-wireless, Network Development,
eyalpe-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb
In-Reply-To: <CA+BoTQk2xT-8DqPuiiKG+kHAjLPrj8F9dLTb-rcGhvMq0u_2Qw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Fri, 2015-01-30 at 14:39 +0100, Michal Kazior wrote:
> I've briefly tried playing with this knob to no avail unfortunately. I
> tried 256K, 1M - it didn't improve TCP performance. When I tried to
> make it smaller (e.g. 16K) the traffic dropped even more so it does
> have an effect. It seems there's some other limiting factor in this
> case.
Interesting.
Could you take some tcpdump/pcap with various tcp_limit_output_bytes
values ?
echo 131072 >/proc/sys/net/ipv4/tcp_limit_output_bytes
tcpdump -p -i wlanX -s 128 -c 20000 -w 128k.pcap
echo 262144 >/proc/sys/net/ipv4/tcp_limit_output_bytes
tcpdump -p -i wlanX -s 128 -c 20000 -w 256k.pcap
...
Thanks !
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* RE: [PATCH net] hyperv: Fix the error processing in netvsc_send()
From: Haiyang Zhang @ 2015-01-30 15:05 UTC (permalink / raw)
To: Jason Wang
Cc: olaf@aepfle.de, netdev@vger.kernel.org,
driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org, davem@davemloft.net
In-Reply-To: <1422613519.8840.0@smtp.corp.redhat.com>
> -----Original Message-----
> From: Jason Wang [mailto:jasowang@redhat.com]
> Sent: Friday, January 30, 2015 5:25 AM
> > + if (ret != 0) {
> > + if (section_index != NETVSC_INVALID_INDEX)
> > + netvsc_free_send_slot(net_device, section_index);
>
> What if ret is -EINVAL or -ENOSPC? Looks like we need free the skb in
> this case also.
In these cases, skb is freed in netvsc_start_xmit().
> >
> > + } else if (skb) {
> > + dev_kfree_skb_any(skb);
>
> The caller - netvsc_start_xmit() do this also, may be handle this in
> caller is better since netvsc_start_xmit() is the only user that tries
> to send a skb?
When the packet is sent out normally, we frees it in netvsc_send() if it's
copied to send-buffer. The free is done in netvsc_send(), because the copy
is also in this function. If it's not copied, it will be freed in another
function -- netvsc_xmit_completion().
netvsc_start_xmit() only does free skb in error case.
> btw, I find during netvsc_start_xmit(), ret was change to -ENOSPC when
> queue_sends[q_idx] < 1. But non of the caller check -ENOSPC in fact?
In this case, we don't request re-send, so set ret to a value other than
-EAGAIN. It's handled in the same way as errors != -EAGAIN, so we don't
need to check this value specifically.
Thanks,
- Haiyang
^ permalink raw reply
* NetDev 0.1 Preliminary schedule posted
From: Jamal Hadi Salim @ 2015-01-30 15:07 UTC (permalink / raw)
To: netdev, linux-wireless, lwn, netdev01, lartc, netfilter,
netfilter-devel
Cc: info, speakers, attendees
Fellow netheads:
Yours truly posting on behalf of rgb.
The preliminary schedule was published late yesterday.
https://www.netdev01.org/schedule
We wanted to get something out quickly while we make it pretty
afterwards. There will be some minor changes later on.
Talks are all on Mon/Tuesday and Tutorials/BoFs/Workshops are
Sat/Sunday.
There will be a click-able version of the schedule later, for now
please correlate the schedule against the sessions at:
https://www.netdev01.org/sessions
We appologize for the inconvinience (all volunteers are hard at
work to make this a fantastic conference for you).
If you have been waiting for the schedule to register, now is the
time:
https://onlineregistrations.ca/netdev01/
Hotel update:
------------
The hotel has agreed, on a best effort basis to extend the
netdev01 rate of $159.00 or $179.00 (depending on the type of room
required). Please dont procastinate and book now. We are competing
against a few tourist activities for hotel rooms going on around the
area at the same time (example:
http://www.ottawafestivals.ca/events/winterlude-2/).
Avoid disappointment and do your reservations at:
https://www.starwoodmeeting.com/StarGroupsWeb/res?id=1412035802&key=1AC9C1F8
If you dont succeed getting the reservation, send us email at
info at netdev01.org; we will try to bat for you but we cant guarantee
results. We are also putting effort into talking to other local hotels.
Sponsors:
=========
NetDev 0.1 would like to gratefully acknowledge all our sponsors:
https://netdev01.org/sponsors
CENGN http://www.cengn.ca/
Google https://www.google.ca
Qualcomm https://www.qualcomm.com/
Verizon http://www.verizon.com/
Cumulus Networks http://cumulusnetworks.com/
Mojatatu Networks https://mojatatu.com/
Important Dates:
==========================
December 2, 2014 Call for Papers opens
December 10, 2014 Registration opens
January 23, 2015 Hotel discount rates deadline
January 24, 2015 Call for sessions deadline
February 12, 2015 On-line registration closes
February 14-17, 2015 Conference days
-------------------------------------------------------------------------------
THE Technical Conference on Linux Networking, February 14-17, 2015,
Ottawa, Canada
https://netdev01.org/
Contact: info@xxxxxxxxxxxxx
Main site: https://www.netdev01.org/
Announcement: https://www.netdev01.org/announce
CFP: https://www.netdev01.org/cfp
Travel/hotel/weather/clothing: https://www.netdev01.org/travel
RSS feed: https://netdev01.org/atom
Follow us on Twitter: @netdev01 https://twitter.com/netdev01
cheers,
jamal (on behalf of Richard Guy Briggs)
^ permalink raw reply
* Re: [PATCH V2 5/6] rtlwifi: btcoexist: Add routines for RTL8812AE kernel socket communications
From: Larry Finger @ 2015-01-30 15:18 UTC (permalink / raw)
To: Marcel Holtmann, Kalle Valo
Cc: linux-wireless, Troy Tan, netdev, linux-bluetooth
In-Reply-To: <EC423C22-AEA0-4232-A452-7A131C41780A@holtmann.org>
On 01/30/2015 03:57 AM, Marcel Holtmann wrote:
Marcel,
> Hi Kalle,
>
>> I'm adding bluetooth list to the discussion. Full patch is available
>> here:
>>
>> https://patchwork.kernel.org/patch/5712591/
>>
>> Larry Finger <Larry.Finger@lwfinger.net> writes:
>>
>>> From: Troy Tan <troy_tan@realsil.com.cn>
>>>
>>> This patch adds the routines used to communicate between the RTL8812AE (wifi)
>>> device and the RTL8761AU (bluetooth) device that are part of the same chip.
>>> Unlike other similar dual-function devices, this chip does not contain special
>>> hardware that lets the firmware pass coexistence info from one part to the
>>> other. As a result, this driver implements such communication as a kernel
>>> socket.
>>>
>>> Signed-off-by: Troy Tan <troy_tan@realsil.com.cn>
>>> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>>> ---
>>> V2 - Add comments explaining the routine that sends a message via the
>>> socket.
>>
>> The commit log is not still explaining that much about the actual
>> functionality, so I investigated on my own:
>>
>>> +static u8 rtl_btcoex_create_kernel_socket(struct rtl_priv *rtlpriv,
>>> + u8 is_invite)
>>> +{
>>> + struct bt_coex_info *pcoex_info = &rtlpriv->coex_info;
>>> + s8 kernel_socket_err;
>>> +
>>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
>>> + "%s CONNECT_PORT %d\n", __func__, CONNECT_PORT);
>>> +
>>> + if (!pcoex_info) {
>>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL, "coex_info: NULL\n");
>>> + return _FAIL;
>>> + }
>>> +
>>> + kernel_socket_err = sock_create(PF_INET, SOCK_DGRAM, 0,
>>> + &pcoex_info->udpsock);
>>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
>>> + "binding socket, err = %d\n", kernel_socket_err);
>>> +
>>> + if (kernel_socket_err < 0) {
>>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
>>> + "Error during creation of socket error:%d\n",
>>> + kernel_socket_err);
>>> + return _FAIL;
>>> + }
>>> + memset(&pcoex_info->sin, 0, sizeof(pcoex_info->sin));
>>> + pcoex_info->sin.sin_family = AF_INET;
>>> + pcoex_info->sin.sin_port = htons(CONNECT_PORT);
>>> + pcoex_info->sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
>>> +
>>> + memset(&pcoex_info->bt_addr, 0, sizeof(pcoex_info->bt_addr));
>>> + pcoex_info->bt_addr.sin_family = AF_INET;
>>> + pcoex_info->bt_addr.sin_port = htons(CONNECT_PORT_BT);
>>> + pcoex_info->bt_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
>>> +
>>> + pcoex_info->sk_store = NULL;
>>> +
>>> + kernel_socket_err =
>>> + pcoex_info->udpsock->ops->bind(pcoex_info->udpsock,
>>> + (struct sockaddr *)&pcoex_info->sin,
>>> + sizeof(pcoex_info->sin));
>>> + if (kernel_socket_err == 0) {
>>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
>>> + "binding socket success\n");
>>> + pcoex_info->udpsock->sk->sk_data_ready =
>>> + rtl_btcoex_recvmsg_int;
>>> + pcoex_info->sock_open |= KERNEL_SOCKET_OK;
>>> + pcoex_info->bt_attend = false;
>>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
>>> + "WIFI sending attend_req\n");
>>> + rtl_btcoex_sendmsgbysocket(rtlpriv, attend_req,
>>> + sizeof(attend_req), true);
>>> + return _SUCCESS;
>>
>> So the wireless driver communicates with the bluetooth driver (which is
>> not in upstream) via a localhost UDP connection?
>
> I think the first order of business should be to get the Bluetooth driver upstream. Until that has happened this is all kinda pointless discussion.
I agree with this; however, the last time I tried to submit a BT driver for
Realtek, I was told that this driver should use some (as yet included) feature.
I have watched the driver development, and if that feature was ever included, it
was in a form that I did not recognize. I'm sorry that this is vague, but this
happened a long time ago.
--snip--
>> I know there's a general need for something similar like this, but it
>> needs to properly discussed and designed.
>
> This is just insane. Clear NAK.
>
> Two kernel modules will not use UDP ports over the loopback interface to communicate with each other.
I will work on combining the latest BT drivers from Realtek with btusb to see if
I can achieve a patch that will both work with the Realtek hardware, and get
approval from the reviewers.
What would be an approved method of communicating between two kernel modules? Is
there some example in the kernel that I could study?
Larry
^ permalink raw reply
* Re: [PATCH net-next] drivers: net: cpsw: make cpsw_ale.c a module to allow re-use on Keystone
From: Murali Karicheri @ 2015-01-30 15:25 UTC (permalink / raw)
To: Mugunthan V N
Cc: w-kwok2, davem, tony, prabhakar.csengg, grygorii.strashko,
lokeshvutla, mpa, lsorense, netdev, linux-kernel, arnd
In-Reply-To: <54CB5550.1020406@ti.com>
On 01/30/2015 04:56 AM, Mugunthan V N wrote:
> On Friday 30 January 2015 01:48 PM, Mugunthan V N wrote:
>> On Friday 30 January 2015 04:45 AM, Murali Karicheri wrote:
>>> NetCP on Keystone has cpsw ale function similar to other TI SoCs
>>> and this driver is re-used. To allow both ti cpsw and keystone netcp
>>> to re-use the driver, convert the cpsw ale to a module and configure
>>> it through Kconfig option CONFIG_TI_CPSW_ALE. Currently it is statically
>>> linked to both TI CPSW and NetCP and this causes issues when the above
>>> drivers are built as dynamic modules. This patch addresses this issue
>>>
>>> While at it, fix the Makefile and code to build both netcp_core and
>>> netcp_ethss as dynamic modules. This is needed to support arm allmodconfig.
>>> This also requires exporting of API calls provided by netcp_core so that
>>> both the above can be dynamic modules.
>>>
>>> Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
>>
>> Acked-by: Mugunthan V N<mugunthanvnm@ti.com>
>>
>> Will try to test this today/Monday.
>>
>>
>
> I have tested this on DRA7 platform and passed tested ping.
>
> Tested-by: Mugunthan V N<mugunthanvnm@ti.com>
Mugunthan,
Thanks for testing this.
Murali
>
> Regards
> Mugunthan V N
--
Murali Karicheri
Linux Kernel, Texas Instruments
^ permalink raw reply
* Stable inclusion request: recvmsg/sendmsg userspace regression fix
From: Michal Marek @ 2015-01-30 15:28 UTC (permalink / raw)
To: Linux Kernel Network Developers; +Cc: Ani Sinha, David S. Miller, Stable Tree
Hi,
please include
commit 6a2a2b3ae0759843b22c929881cc184b00cc63ff
Author: Ani Sinha <ani@arista.com>
Date: Mon Sep 8 14:49:59 2014 -0700
net:socket: set msg_namelen to 0 if msg_name is passed as NULL in
msghdr struct from userland.
to 3.14.y and older trees, since it fixes a userspace regression caused
by commit dbb490b9 ("net: socket: error on a negative msg_namelen"). The
patch applies cleanly to all trees down to 2.6.32.y.
Thanks,
Michal
^ permalink raw reply
* [PATCH net-next v1] netcp driver fixes to build as dynamic modules
From: Murali Karicheri @ 2015-01-30 15:36 UTC (permalink / raw)
To: w-kwok2, davem, mugunthanvnm, tony, prabhakar.csengg,
grygorii.strashko, lokeshvutla, mpa, lsorense, netdev,
linux-kernel, arnd
Cc: Murali Karicheri
This patch introduce changes to netcp modules and makefile to build
the driver as dynamic modules. This also convert existing cpsw_ale.c
as a module so that it can be re-used across netcp and ti_cpsw drivers.
This also fixes the issue seen when build using arm allmodconfig
I have made an allmodconfig with this patch and the build succeeds.
make allmodconfig
make uImage LOADADDR=0x80008000; make modules
After the build all of the following .ko files are seen
Note: need to verify this on a platform with TI CPSW.
drivers/net/ethernet/ti/cpsw_ale.ko
drivers/net/ethernet/ti/davinci_cpdma.ko
drivers/net/ethernet/ti/davinci_emac.ko
drivers/net/ethernet/ti/davinci_mdio.ko
drivers/net/ethernet/ti/keystone_netcp_ethss.ko
drivers/net/ethernet/ti/keystone_netcp.ko
drivers/net/ethernet/ti/ti_cpsw.ko
drivers/net/ethernet/ti/tlan.ko
This also has dependency on the following patches for netcp :-
[1] https://lkml.org/lkml/2015/1/28/1102
[2] https://lkml.org/lkml/2015/1/29/881
[3] https://lkml.org/lkml/2015/1/29/882
History:
v1: Added Acked-by and Tested-by following:-
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Tested-by: Mugunthan V N <mugunthanvnm@ti.com>
Murali Karicheri (1):
drivers: net: cpsw: make cpsw_ale.c a module to allow re-use on
Keystone
drivers/net/ethernet/ti/Kconfig | 19 +++++++++++++++++--
drivers/net/ethernet/ti/Makefile | 8 +++++---
drivers/net/ethernet/ti/cpsw_ale.c | 26 ++++++++++++++++++++++++--
drivers/net/ethernet/ti/netcp_core.c | 8 ++++++++
drivers/net/ethernet/ti/netcp_ethss.c | 5 +++++
5 files changed, 59 insertions(+), 7 deletions(-)
--
1.7.9.5
^ permalink raw reply
* [PATCH net-next v1] drivers: net: cpsw: make cpsw_ale.c a module to allow re-use on Keystone
From: Murali Karicheri @ 2015-01-30 15:36 UTC (permalink / raw)
To: w-kwok2, davem, mugunthanvnm, tony, prabhakar.csengg,
grygorii.strashko, lokeshvutla, mpa, lsorense, netdev,
linux-kernel, arnd
Cc: Murali Karicheri
In-Reply-To: <1422632203-2531-1-git-send-email-m-karicheri2@ti.com>
NetCP on Keystone has cpsw ale function similar to other TI SoCs
and this driver is re-used. To allow both ti cpsw and keystone netcp
to re-use the driver, convert the cpsw ale to a module and configure
it through Kconfig option CONFIG_TI_CPSW_ALE. Currently it is statically
linked to both TI CPSW and NetCP and this causes issues when the above
drivers are built as dynamic modules. This patch addresses this issue
While at it, fix the Makefile and code to build both netcp_core and
netcp_ethss as dynamic modules. This is needed to support arm allmodconfig.
This also requires exporting of API calls provided by netcp_core so that
both the above can be dynamic modules.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Tested-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
---
drivers/net/ethernet/ti/Kconfig | 19 +++++++++++++++++--
drivers/net/ethernet/ti/Makefile | 8 +++++---
drivers/net/ethernet/ti/cpsw_ale.c | 26 ++++++++++++++++++++++++--
drivers/net/ethernet/ti/netcp_core.c | 8 ++++++++
drivers/net/ethernet/ti/netcp_ethss.c | 5 +++++
5 files changed, 59 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index 4ea1663..3bc992c 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -56,12 +56,18 @@ config TI_CPSW_PHY_SEL
This driver supports configuring of the phy mode connected to
the CPSW.
+config TI_CPSW_ALE
+ tristate "TI CPSW ALE Support"
+ ---help---
+ This driver supports TI's CPSW ALE module.
+
config TI_CPSW
tristate "TI CPSW Switch Support"
depends on ARCH_DAVINCI || ARCH_OMAP2PLUS
select TI_DAVINCI_CPDMA
select TI_DAVINCI_MDIO
select TI_CPSW_PHY_SEL
+ select TI_CPSW_ALE
select MFD_SYSCON
select REGMAP
---help---
@@ -80,15 +86,24 @@ config TI_CPTS
and Layer 2 packets, and the driver offers a PTP Hardware Clock.
config TI_KEYSTONE_NETCP
- tristate "TI Keystone NETCP Ethernet subsystem Support"
+ tristate "TI Keystone NETCP Core Support"
+ select TI_CPSW_ALE
depends on OF
depends on KEYSTONE_NAVIGATOR_DMA && KEYSTONE_NAVIGATOR_QMSS
---help---
- This driver supports TI's Keystone NETCP Ethernet subsystem.
+ This driver supports TI's Keystone NETCP Core.
To compile this driver as a module, choose M here: the module
will be called keystone_netcp.
+config TI_KEYSTONE_NETCP_ETHSS
+ depends on TI_KEYSTONE_NETCP
+ tristate "TI Keystone NETCP Ethernet subsystem Support"
+ ---help---
+
+ To compile this driver as a module, choose M here: the module
+ will be called keystone_netcp_ethss.
+
config TLAN
tristate "TI ThunderLAN support"
depends on (PCI || EISA)
diff --git a/drivers/net/ethernet/ti/Makefile b/drivers/net/ethernet/ti/Makefile
index 0a9813b..02ddad5 100644
--- a/drivers/net/ethernet/ti/Makefile
+++ b/drivers/net/ethernet/ti/Makefile
@@ -8,9 +8,11 @@ obj-$(CONFIG_TI_DAVINCI_EMAC) += davinci_emac.o
obj-$(CONFIG_TI_DAVINCI_MDIO) += davinci_mdio.o
obj-$(CONFIG_TI_DAVINCI_CPDMA) += davinci_cpdma.o
obj-$(CONFIG_TI_CPSW_PHY_SEL) += cpsw-phy-sel.o
+obj-$(CONFIG_TI_CPSW_ALE) += cpsw_ale.o
obj-$(CONFIG_TI_CPSW) += ti_cpsw.o
-ti_cpsw-y := cpsw_ale.o cpsw.o cpts.o
+ti_cpsw-y := cpsw.o cpts.o
obj-$(CONFIG_TI_KEYSTONE_NETCP) += keystone_netcp.o
-keystone_netcp-y := netcp_core.o netcp_ethss.o netcp_sgmii.o \
- netcp_xgbepcsr.o cpsw_ale.o
+keystone_netcp-y := netcp_core.o
+obj-$(CONFIG_TI_KEYSTONE_NETCP_ETHSS) += keystone_netcp_ethss.o
+keystone_netcp_ethss-y := netcp_ethss.o netcp_sgmii.o netcp_xgbepcsr.o
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index 5246b3a..6e927b4 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
#include <linux/kernel.h>
+#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
@@ -146,7 +147,7 @@ static int cpsw_ale_write(struct cpsw_ale *ale, int idx, u32 *ale_entry)
return idx;
}
-int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
+static int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
{
u32 ale_entry[ALE_ENTRY_WORDS];
int type, idx;
@@ -167,7 +168,7 @@ int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
return -ENOENT;
}
-int cpsw_ale_match_vlan(struct cpsw_ale *ale, u16 vid)
+static int cpsw_ale_match_vlan(struct cpsw_ale *ale, u16 vid)
{
u32 ale_entry[ALE_ENTRY_WORDS];
int type, idx;
@@ -265,6 +266,7 @@ int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid)
}
return 0;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_flush_multicast);
static void cpsw_ale_flush_ucast(struct cpsw_ale *ale, u32 *ale_entry,
int port_mask)
@@ -297,6 +299,7 @@ int cpsw_ale_flush(struct cpsw_ale *ale, int port_mask)
}
return 0;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_flush);
static inline void cpsw_ale_set_vlan_entry_type(u32 *ale_entry,
int flags, u16 vid)
@@ -334,6 +337,7 @@ int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port,
cpsw_ale_write(ale, idx, ale_entry);
return 0;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_add_ucast);
int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port,
int flags, u16 vid)
@@ -349,6 +353,7 @@ int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port,
cpsw_ale_write(ale, idx, ale_entry);
return 0;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_del_ucast);
int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
int flags, u16 vid, int mcast_state)
@@ -380,6 +385,7 @@ int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
cpsw_ale_write(ale, idx, ale_entry);
return 0;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_add_mcast);
int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
int flags, u16 vid)
@@ -401,6 +407,7 @@ int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
cpsw_ale_write(ale, idx, ale_entry);
return 0;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_del_mcast);
int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port, int untag,
int reg_mcast, int unreg_mcast)
@@ -430,6 +437,7 @@ int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port, int untag,
cpsw_ale_write(ale, idx, ale_entry);
return 0;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_add_vlan);
int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port_mask)
{
@@ -450,6 +458,7 @@ int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port_mask)
cpsw_ale_write(ale, idx, ale_entry);
return 0;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_del_vlan);
void cpsw_ale_set_allmulti(struct cpsw_ale *ale, int allmulti)
{
@@ -479,6 +488,7 @@ void cpsw_ale_set_allmulti(struct cpsw_ale *ale, int allmulti)
cpsw_ale_write(ale, idx, ale_entry);
}
}
+EXPORT_SYMBOL_GPL(cpsw_ale_set_allmulti);
struct ale_control_info {
const char *name;
@@ -704,6 +714,7 @@ int cpsw_ale_control_set(struct cpsw_ale *ale, int port, int control,
return 0;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_control_set);
int cpsw_ale_control_get(struct cpsw_ale *ale, int port, int control)
{
@@ -727,6 +738,7 @@ int cpsw_ale_control_get(struct cpsw_ale *ale, int port, int control)
tmp = __raw_readl(ale->params.ale_regs + offset) >> shift;
return tmp & BITMASK(info->bits);
}
+EXPORT_SYMBOL_GPL(cpsw_ale_control_get);
static void cpsw_ale_timer(unsigned long arg)
{
@@ -750,6 +762,7 @@ int cpsw_ale_set_ageout(struct cpsw_ale *ale, int ageout)
}
return 0;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_set_ageout);
void cpsw_ale_start(struct cpsw_ale *ale)
{
@@ -769,11 +782,13 @@ void cpsw_ale_start(struct cpsw_ale *ale)
add_timer(&ale->timer);
}
}
+EXPORT_SYMBOL_GPL(cpsw_ale_start);
void cpsw_ale_stop(struct cpsw_ale *ale)
{
del_timer_sync(&ale->timer);
}
+EXPORT_SYMBOL_GPL(cpsw_ale_stop);
struct cpsw_ale *cpsw_ale_create(struct cpsw_ale_params *params)
{
@@ -788,6 +803,7 @@ struct cpsw_ale *cpsw_ale_create(struct cpsw_ale_params *params)
return ale;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_create);
int cpsw_ale_destroy(struct cpsw_ale *ale)
{
@@ -797,6 +813,7 @@ int cpsw_ale_destroy(struct cpsw_ale *ale)
kfree(ale);
return 0;
}
+EXPORT_SYMBOL_GPL(cpsw_ale_destroy);
void cpsw_ale_dump(struct cpsw_ale *ale, u32 *data)
{
@@ -807,3 +824,8 @@ void cpsw_ale_dump(struct cpsw_ale *ale, u32 *data)
data += ALE_ENTRY_WORDS;
}
}
+EXPORT_SYMBOL_GPL(cpsw_ale_dump);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("TI CPSW ALE driver");
+MODULE_AUTHOR("Texas Instruments");
diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
index ba3002e..a31a8c3 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -354,6 +354,7 @@ fail:
netcp_unregister_module(module);
return ret;
}
+EXPORT_SYMBOL_GPL(netcp_register_module);
static void netcp_release_module(struct netcp_device *netcp_device,
struct netcp_module *module)
@@ -414,6 +415,7 @@ void netcp_unregister_module(struct netcp_module *module)
mutex_unlock(&netcp_modules_lock);
}
+EXPORT_SYMBOL_GPL(netcp_unregister_module);
void *netcp_module_get_intf_data(struct netcp_module *module,
struct netcp_intf *intf)
@@ -425,6 +427,7 @@ void *netcp_module_get_intf_data(struct netcp_module *module,
return intf_modpriv->module_priv;
return NULL;
}
+EXPORT_SYMBOL_GPL(netcp_module_get_intf_data);
/* Module TX and RX Hook management */
struct netcp_hook_list {
@@ -459,6 +462,7 @@ int netcp_register_txhook(struct netcp_intf *netcp_priv, int order,
return 0;
}
+EXPORT_SYMBOL_GPL(netcp_register_txhook);
int netcp_unregister_txhook(struct netcp_intf *netcp_priv, int order,
netcp_hook_rtn *hook_rtn, void *hook_data)
@@ -480,6 +484,7 @@ int netcp_unregister_txhook(struct netcp_intf *netcp_priv, int order,
spin_unlock_irqrestore(&netcp_priv->lock, flags);
return -ENOENT;
}
+EXPORT_SYMBOL_GPL(netcp_unregister_txhook);
int netcp_register_rxhook(struct netcp_intf *netcp_priv, int order,
netcp_hook_rtn *hook_rtn, void *hook_data)
@@ -1226,6 +1231,7 @@ int netcp_txpipe_close(struct netcp_tx_pipe *tx_pipe)
}
return 0;
}
+EXPORT_SYMBOL_GPL(netcp_txpipe_close);
int netcp_txpipe_open(struct netcp_tx_pipe *tx_pipe)
{
@@ -1267,6 +1273,7 @@ err:
tx_pipe->dma_channel = NULL;
return ret;
}
+EXPORT_SYMBOL_GPL(netcp_txpipe_open);
int netcp_txpipe_init(struct netcp_tx_pipe *tx_pipe,
struct netcp_device *netcp_device,
@@ -1278,6 +1285,7 @@ int netcp_txpipe_init(struct netcp_tx_pipe *tx_pipe,
tx_pipe->dma_queue_id = dma_queue_id;
return 0;
}
+EXPORT_SYMBOL_GPL(netcp_txpipe_init);
static struct netcp_addr *netcp_addr_find(struct netcp_intf *netcp,
const u8 *addr,
diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index fa1041a..345cd25 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -19,6 +19,7 @@
*/
#include <linux/io.h>
+#include <linux/module.h>
#include <linux/of_mdio.h>
#include <linux/of_address.h>
#include <linux/if_vlan.h>
@@ -2154,3 +2155,7 @@ static void __exit keystone_gbe_exit(void)
netcp_unregister_module(&xgbe_module);
}
module_exit(keystone_gbe_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("TI NETCP ETHSS driver for Keystone SOCs");
+MODULE_AUTHOR("Sandeep Nair <sandeep_n@ti.com");
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH net-next] drivers: net: cpsw: make cpsw_ale.c a module to allow re-use on Keystone
From: Murali Karicheri @ 2015-01-30 15:39 UTC (permalink / raw)
To: Arnd Bergmann
Cc: w-kwok2, davem, mugunthanvnm, tony, prabhakar.csengg,
grygorii.strashko, lokeshvutla, mpa, lsorense, netdev,
linux-kernel
In-Reply-To: <1802322.NDR3d5ZRSA@wuerfel>
On 01/29/2015 06:47 PM, Arnd Bergmann wrote:
> On Thursday 29 January 2015 18:15:51 Murali Karicheri wrote:
>> NetCP on Keystone has cpsw ale function similar to other TI SoCs
>> and this driver is re-used. To allow both ti cpsw and keystone netcp
>> to re-use the driver, convert the cpsw ale to a module and configure
>> it through Kconfig option CONFIG_TI_CPSW_ALE. Currently it is statically
>> linked to both TI CPSW and NetCP and this causes issues when the above
>> drivers are built as dynamic modules. This patch addresses this issue
>>
>> While at it, fix the Makefile and code to build both netcp_core and
>> netcp_ethss as dynamic modules. This is needed to support arm allmodconfig.
>> This also requires exporting of API calls provided by netcp_core so that
>> both the above can be dynamic modules.
>>
>> Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
>> ---
>> drivers/net/ethernet/ti/Kconfig | 19 +++++++++++++++++--
>> drivers/net/ethernet/ti/Makefile | 8 +++++---
>> drivers/net/ethernet/ti/cpsw_ale.c | 26 ++++++++++++++++++++++++--
>> drivers/net/ethernet/ti/netcp_core.c | 8 ++++++++
>> drivers/net/ethernet/ti/netcp_ethss.c | 5 +++++
>> 5 files changed, 59 insertions(+), 7 deletions(-)
>
> I was hoping there would be a way without exporting all those symbols, but
> I also couldn't come up with a better solution. I'm putting this into the
> randconfig build test for now, but I'm guessing it's fine.
>
> Unless you hear something else from me tomorrow after the tests are through:
>
> Acked-by: Arnd Bergmann<arnd@arndb.de>
Arnd,
Oops! I think I have send v1 too soon with your Ack. Sorry for that.
Hope nothing shows up bad in your test.
--
Murali Karicheri
Linux Kernel, Texas Instruments
^ permalink raw reply
* Re: [PATCH net-next] drivers: net: cpsw: make cpsw_ale.c a module to allow re-use on Keystone
From: Murali Karicheri @ 2015-01-30 15:39 UTC (permalink / raw)
To: Lad, Prabhakar
Cc: w-kwok2, David S. Miller, Mugunthan V N, Tony Lindgren,
Grygorii Strashko, lokeshvutla, mpa, lsorense, netdev, LKML,
Arnd Bergmann
In-Reply-To: <CA+V-a8v0SYQtMEXWtivUu=MF-DNuF5n_fBqtABuSrhrxNLYMBw@mail.gmail.com>
On 01/30/2015 03:03 AM, Lad, Prabhakar wrote:
> On Thu, Jan 29, 2015 at 11:15 PM, Murali Karicheri<m-karicheri2@ti.com> wrote:
>> NetCP on Keystone has cpsw ale function similar to other TI SoCs
>> and this driver is re-used. To allow both ti cpsw and keystone netcp
>> to re-use the driver, convert the cpsw ale to a module and configure
>> it through Kconfig option CONFIG_TI_CPSW_ALE. Currently it is statically
>> linked to both TI CPSW and NetCP and this causes issues when the above
>> drivers are built as dynamic modules. This patch addresses this issue
>>
>> While at it, fix the Makefile and code to build both netcp_core and
>> netcp_ethss as dynamic modules. This is needed to support arm allmodconfig.
>> This also requires exporting of API calls provided by netcp_core so that
>> both the above can be dynamic modules.
>>
>> Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
>
> Acked-by: Lad, Prabhakar<prabhakar.csengg@gmail.com>
>
Prabhakar,
Thanks
Mruali
> Regards,
> --Prabhakar Lad
>
>> ---
>> drivers/net/ethernet/ti/Kconfig | 19 +++++++++++++++++--
>> drivers/net/ethernet/ti/Makefile | 8 +++++---
>> drivers/net/ethernet/ti/cpsw_ale.c | 26 ++++++++++++++++++++++++--
>> drivers/net/ethernet/ti/netcp_core.c | 8 ++++++++
>> drivers/net/ethernet/ti/netcp_ethss.c | 5 +++++
>> 5 files changed, 59 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
>> index 4ea1663..3bc992c 100644
>> --- a/drivers/net/ethernet/ti/Kconfig
>> +++ b/drivers/net/ethernet/ti/Kconfig
>> @@ -56,12 +56,18 @@ config TI_CPSW_PHY_SEL
>> This driver supports configuring of the phy mode connected to
>> the CPSW.
>>
>> +config TI_CPSW_ALE
>> + tristate "TI CPSW ALE Support"
>> + ---help---
>> + This driver supports TI's CPSW ALE module.
>> +
>> config TI_CPSW
>> tristate "TI CPSW Switch Support"
>> depends on ARCH_DAVINCI || ARCH_OMAP2PLUS
>> select TI_DAVINCI_CPDMA
>> select TI_DAVINCI_MDIO
>> select TI_CPSW_PHY_SEL
>> + select TI_CPSW_ALE
>> select MFD_SYSCON
>> select REGMAP
>> ---help---
>> @@ -80,15 +86,24 @@ config TI_CPTS
>> and Layer 2 packets, and the driver offers a PTP Hardware Clock.
>>
>> config TI_KEYSTONE_NETCP
>> - tristate "TI Keystone NETCP Ethernet subsystem Support"
>> + tristate "TI Keystone NETCP Core Support"
>> + select TI_CPSW_ALE
>> depends on OF
>> depends on KEYSTONE_NAVIGATOR_DMA&& KEYSTONE_NAVIGATOR_QMSS
>> ---help---
>> - This driver supports TI's Keystone NETCP Ethernet subsystem.
>> + This driver supports TI's Keystone NETCP Core.
>>
>> To compile this driver as a module, choose M here: the module
>> will be called keystone_netcp.
>>
>> +config TI_KEYSTONE_NETCP_ETHSS
>> + depends on TI_KEYSTONE_NETCP
>> + tristate "TI Keystone NETCP Ethernet subsystem Support"
>> + ---help---
>> +
>> + To compile this driver as a module, choose M here: the module
>> + will be called keystone_netcp_ethss.
>> +
>> config TLAN
>> tristate "TI ThunderLAN support"
>> depends on (PCI || EISA)
>> diff --git a/drivers/net/ethernet/ti/Makefile b/drivers/net/ethernet/ti/Makefile
>> index 0a9813b..02ddad5 100644
>> --- a/drivers/net/ethernet/ti/Makefile
>> +++ b/drivers/net/ethernet/ti/Makefile
>> @@ -8,9 +8,11 @@ obj-$(CONFIG_TI_DAVINCI_EMAC) += davinci_emac.o
>> obj-$(CONFIG_TI_DAVINCI_MDIO) += davinci_mdio.o
>> obj-$(CONFIG_TI_DAVINCI_CPDMA) += davinci_cpdma.o
>> obj-$(CONFIG_TI_CPSW_PHY_SEL) += cpsw-phy-sel.o
>> +obj-$(CONFIG_TI_CPSW_ALE) += cpsw_ale.o
>> obj-$(CONFIG_TI_CPSW) += ti_cpsw.o
>> -ti_cpsw-y := cpsw_ale.o cpsw.o cpts.o
>> +ti_cpsw-y := cpsw.o cpts.o
>>
>> obj-$(CONFIG_TI_KEYSTONE_NETCP) += keystone_netcp.o
>> -keystone_netcp-y := netcp_core.o netcp_ethss.o netcp_sgmii.o \
>> - netcp_xgbepcsr.o cpsw_ale.o
>> +keystone_netcp-y := netcp_core.o
>> +obj-$(CONFIG_TI_KEYSTONE_NETCP_ETHSS) += keystone_netcp_ethss.o
>> +keystone_netcp_ethss-y := netcp_ethss.o netcp_sgmii.o netcp_xgbepcsr.o
>> diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
>> index 5246b3a..6e927b4 100644
>> --- a/drivers/net/ethernet/ti/cpsw_ale.c
>> +++ b/drivers/net/ethernet/ti/cpsw_ale.c
>> @@ -13,6 +13,7 @@
>> * GNU General Public License for more details.
>> */
>> #include<linux/kernel.h>
>> +#include<linux/module.h>
>> #include<linux/platform_device.h>
>> #include<linux/seq_file.h>
>> #include<linux/slab.h>
>> @@ -146,7 +147,7 @@ static int cpsw_ale_write(struct cpsw_ale *ale, int idx, u32 *ale_entry)
>> return idx;
>> }
>>
>> -int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
>> +static int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
>> {
>> u32 ale_entry[ALE_ENTRY_WORDS];
>> int type, idx;
>> @@ -167,7 +168,7 @@ int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
>> return -ENOENT;
>> }
>>
>> -int cpsw_ale_match_vlan(struct cpsw_ale *ale, u16 vid)
>> +static int cpsw_ale_match_vlan(struct cpsw_ale *ale, u16 vid)
>> {
>> u32 ale_entry[ALE_ENTRY_WORDS];
>> int type, idx;
>> @@ -265,6 +266,7 @@ int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid)
>> }
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_flush_multicast);
>>
>> static void cpsw_ale_flush_ucast(struct cpsw_ale *ale, u32 *ale_entry,
>> int port_mask)
>> @@ -297,6 +299,7 @@ int cpsw_ale_flush(struct cpsw_ale *ale, int port_mask)
>> }
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_flush);
>>
>> static inline void cpsw_ale_set_vlan_entry_type(u32 *ale_entry,
>> int flags, u16 vid)
>> @@ -334,6 +337,7 @@ int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port,
>> cpsw_ale_write(ale, idx, ale_entry);
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_add_ucast);
>>
>> int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port,
>> int flags, u16 vid)
>> @@ -349,6 +353,7 @@ int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port,
>> cpsw_ale_write(ale, idx, ale_entry);
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_del_ucast);
>>
>> int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
>> int flags, u16 vid, int mcast_state)
>> @@ -380,6 +385,7 @@ int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
>> cpsw_ale_write(ale, idx, ale_entry);
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_add_mcast);
>>
>> int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
>> int flags, u16 vid)
>> @@ -401,6 +407,7 @@ int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
>> cpsw_ale_write(ale, idx, ale_entry);
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_del_mcast);
>>
>> int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port, int untag,
>> int reg_mcast, int unreg_mcast)
>> @@ -430,6 +437,7 @@ int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port, int untag,
>> cpsw_ale_write(ale, idx, ale_entry);
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_add_vlan);
>>
>> int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port_mask)
>> {
>> @@ -450,6 +458,7 @@ int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port_mask)
>> cpsw_ale_write(ale, idx, ale_entry);
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_del_vlan);
>>
>> void cpsw_ale_set_allmulti(struct cpsw_ale *ale, int allmulti)
>> {
>> @@ -479,6 +488,7 @@ void cpsw_ale_set_allmulti(struct cpsw_ale *ale, int allmulti)
>> cpsw_ale_write(ale, idx, ale_entry);
>> }
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_set_allmulti);
>>
>> struct ale_control_info {
>> const char *name;
>> @@ -704,6 +714,7 @@ int cpsw_ale_control_set(struct cpsw_ale *ale, int port, int control,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_control_set);
>>
>> int cpsw_ale_control_get(struct cpsw_ale *ale, int port, int control)
>> {
>> @@ -727,6 +738,7 @@ int cpsw_ale_control_get(struct cpsw_ale *ale, int port, int control)
>> tmp = __raw_readl(ale->params.ale_regs + offset)>> shift;
>> return tmp& BITMASK(info->bits);
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_control_get);
>>
>> static void cpsw_ale_timer(unsigned long arg)
>> {
>> @@ -750,6 +762,7 @@ int cpsw_ale_set_ageout(struct cpsw_ale *ale, int ageout)
>> }
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_set_ageout);
>>
>> void cpsw_ale_start(struct cpsw_ale *ale)
>> {
>> @@ -769,11 +782,13 @@ void cpsw_ale_start(struct cpsw_ale *ale)
>> add_timer(&ale->timer);
>> }
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_start);
>>
>> void cpsw_ale_stop(struct cpsw_ale *ale)
>> {
>> del_timer_sync(&ale->timer);
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_stop);
>>
>> struct cpsw_ale *cpsw_ale_create(struct cpsw_ale_params *params)
>> {
>> @@ -788,6 +803,7 @@ struct cpsw_ale *cpsw_ale_create(struct cpsw_ale_params *params)
>>
>> return ale;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_create);
>>
>> int cpsw_ale_destroy(struct cpsw_ale *ale)
>> {
>> @@ -797,6 +813,7 @@ int cpsw_ale_destroy(struct cpsw_ale *ale)
>> kfree(ale);
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_destroy);
>>
>> void cpsw_ale_dump(struct cpsw_ale *ale, u32 *data)
>> {
>> @@ -807,3 +824,8 @@ void cpsw_ale_dump(struct cpsw_ale *ale, u32 *data)
>> data += ALE_ENTRY_WORDS;
>> }
>> }
>> +EXPORT_SYMBOL_GPL(cpsw_ale_dump);
>> +
>> +MODULE_LICENSE("GPL v2");
>> +MODULE_DESCRIPTION("TI CPSW ALE driver");
>> +MODULE_AUTHOR("Texas Instruments");
>> diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
>> index ba3002e..a31a8c3 100644
>> --- a/drivers/net/ethernet/ti/netcp_core.c
>> +++ b/drivers/net/ethernet/ti/netcp_core.c
>> @@ -354,6 +354,7 @@ fail:
>> netcp_unregister_module(module);
>> return ret;
>> }
>> +EXPORT_SYMBOL_GPL(netcp_register_module);
>>
>> static void netcp_release_module(struct netcp_device *netcp_device,
>> struct netcp_module *module)
>> @@ -414,6 +415,7 @@ void netcp_unregister_module(struct netcp_module *module)
>>
>> mutex_unlock(&netcp_modules_lock);
>> }
>> +EXPORT_SYMBOL_GPL(netcp_unregister_module);
>>
>> void *netcp_module_get_intf_data(struct netcp_module *module,
>> struct netcp_intf *intf)
>> @@ -425,6 +427,7 @@ void *netcp_module_get_intf_data(struct netcp_module *module,
>> return intf_modpriv->module_priv;
>> return NULL;
>> }
>> +EXPORT_SYMBOL_GPL(netcp_module_get_intf_data);
>>
>> /* Module TX and RX Hook management */
>> struct netcp_hook_list {
>> @@ -459,6 +462,7 @@ int netcp_register_txhook(struct netcp_intf *netcp_priv, int order,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(netcp_register_txhook);
>>
>> int netcp_unregister_txhook(struct netcp_intf *netcp_priv, int order,
>> netcp_hook_rtn *hook_rtn, void *hook_data)
>> @@ -480,6 +484,7 @@ int netcp_unregister_txhook(struct netcp_intf *netcp_priv, int order,
>> spin_unlock_irqrestore(&netcp_priv->lock, flags);
>> return -ENOENT;
>> }
>> +EXPORT_SYMBOL_GPL(netcp_unregister_txhook);
>>
>> int netcp_register_rxhook(struct netcp_intf *netcp_priv, int order,
>> netcp_hook_rtn *hook_rtn, void *hook_data)
>> @@ -1226,6 +1231,7 @@ int netcp_txpipe_close(struct netcp_tx_pipe *tx_pipe)
>> }
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(netcp_txpipe_close);
>>
>> int netcp_txpipe_open(struct netcp_tx_pipe *tx_pipe)
>> {
>> @@ -1267,6 +1273,7 @@ err:
>> tx_pipe->dma_channel = NULL;
>> return ret;
>> }
>> +EXPORT_SYMBOL_GPL(netcp_txpipe_open);
>>
>> int netcp_txpipe_init(struct netcp_tx_pipe *tx_pipe,
>> struct netcp_device *netcp_device,
>> @@ -1278,6 +1285,7 @@ int netcp_txpipe_init(struct netcp_tx_pipe *tx_pipe,
>> tx_pipe->dma_queue_id = dma_queue_id;
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(netcp_txpipe_init);
>>
>> static struct netcp_addr *netcp_addr_find(struct netcp_intf *netcp,
>> const u8 *addr,
>> diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
>> index fa1041a..345cd25 100644
>> --- a/drivers/net/ethernet/ti/netcp_ethss.c
>> +++ b/drivers/net/ethernet/ti/netcp_ethss.c
>> @@ -19,6 +19,7 @@
>> */
>>
>> #include<linux/io.h>
>> +#include<linux/module.h>
>> #include<linux/of_mdio.h>
>> #include<linux/of_address.h>
>> #include<linux/if_vlan.h>
>> @@ -2154,3 +2155,7 @@ static void __exit keystone_gbe_exit(void)
>> netcp_unregister_module(&xgbe_module);
>> }
>> module_exit(keystone_gbe_exit);
>> +
>> +MODULE_LICENSE("GPL v2");
>> +MODULE_DESCRIPTION("TI NETCP ETHSS driver for Keystone SOCs");
>> +MODULE_AUTHOR("Sandeep Nair<sandeep_n@ti.com");
>> --
>> 1.7.9.5
>>
--
Murali Karicheri
Linux Kernel, Texas Instruments
^ 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