* Re: [PATCH net-next] tcp: Remove use of inet6_sk and add IPv6 checks to tracepoint
From: Song Liu @ 2017-10-18 16:27 UTC (permalink / raw)
To: Eric Dumazet
Cc: David Ahern, netdev@vger.kernel.org, xiyou.wangcong@gmail.com,
davem@davemloft.net
In-Reply-To: <1508340503.31614.120.camel@edumazet-glaptop3.roam.corp.google.com>
> On Oct 18, 2017, at 8:28 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> On Wed, 2017-10-18 at 08:17 -0700, David Ahern wrote:
>> 386fd5da401d ("tcp: Check daddr_cache before use in tracepoint") was the
>> second version of the tracepoint fixup patch. This patch is the delta
>> between v2 and v3. Specifically, remove the use of inet6_sk and check
>> sk_family as requested by Eric and add IS_ENABLED(CONFIG_IPV6) around
>> the use of sk_v6_rcv_saddr and sk_v6_daddr as done in sock_common (noted
>> by Cong).
>>
>> Signed-off-by: David Ahern <dsahern@gmail.com>
>> ---
>
> Reviewed-by: Eric Dumazet <edumazet@google.com>
>
> Thanks !
>
Tested-by: Song Liu <songliubraving@fb.com>
^ permalink raw reply
* [net-next] dsa: slave: support phy devices on external MII bus
From: Andrew Lunn @ 2017-10-18 16:21 UTC (permalink / raw)
To: mnhu; +Cc: netdev, Florian Fainelli
Hi Martin
Sorry for starting a new thread. I deleted the patchset from my mailbox.
Florian said:
> The logic goes like this:
>
> - try to connect to the PHY via phy-handle
> - if we have a PHY we are connecting via phy-handle but we need to
> divert MDIO reads/writes connect using its address on the diverted
> bus
> - connect using a fixed PHY
> - finally try using the DSA slave MII bus which would connect to the switch internal PHYs
This is not quite correct. Looking at the code:
phy_dn = of_parse_phandle(port_dn, "phy-handle", 0);
...
if (phy_dn) {
int phy_id = of_mdio_parse_addr(&slave_dev->dev, phy_dn);
/* If this PHY address is part of phys_mii_mask, which means
* that we need to divert reads and writes to/from it, then we
* want to bind this device using the slave MII bus created by
* DSA to make that happen.
*/
if (!phy_is_fixed && phy_id >= 0 &&
(ds->phys_mii_mask & (1 << phy_id))) {
ret = dsa_slave_phy_connect(p, slave_dev, phy_id);
if (ret) {
netdev_err(slave_dev, "failed to connect to phy%d: %d\n", phy_id, ret);
of_node_put(phy_dn);
return ret;
}
} else {
p->phy = of_phy_connect(slave_dev, phy_dn,
The first point really is:
- try to connect to the PHY via phy-handle, if the phy_id is not
valid, or if the phy_id does not map to a phy that the switch says
does not exist.
In your case, all these points are true, so it uses
dsa_slave_phy_connect(). But we actually want it to use
of_phy_connect(), which will use the correct bus.
For some Marvell chips, you cannot actually go on ds->phys_mii_mask.
These devices can have in built PHYs and SERDES interfaces which can
be assigned to ports. These SERDES interfaces could have external PHYs
connected to them, and be on the external MDIO bus. So
ds->phys_mii_mask indicates there is a PHY, but the phy-handle points
to a different phy.
So i think this code block needs to change. If we have a phy-handle,
use it. i.e. what Florian _thinks_ it should be doing. If not, then
use dsa_slave_phy_connect().
Andrew
^ permalink raw reply
* RE: [PATCH] lib/dynamic_queue_limits.c: relax BUG_ON to WARN_ON in dql_complete()
From: David Laight @ 2017-10-18 16:11 UTC (permalink / raw)
To: 'Ard Biesheuvel', linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, davem@davemloft.net
In-Reply-To: <20171018154515.16751-1-ard.biesheuvel@linaro.org>
From: Ard Biesheuvel
> Sent: 18 October 2017 16:45
> Even though calling dql_completed() with a count that exceeds the
> queued count is a serious error, it still does not justify bringing
> down the entire kernel with a BUG_ON(). So relax it to a WARN_ON()
> instead.
>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> lib/dynamic_queue_limits.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c
> index f346715e2255..24ce495d78f3 100644
> --- a/lib/dynamic_queue_limits.c
> +++ b/lib/dynamic_queue_limits.c
> @@ -23,7 +23,7 @@ void dql_completed(struct dql *dql, unsigned int count)
> num_queued = ACCESS_ONCE(dql->num_queued);
>
> /* Can't complete more than what's in queue */
> - BUG_ON(count > num_queued - dql->num_completed);
> + WARN_ON(count > num_queued - dql->num_completed);
>
> completed = dql->num_completed + count;
Don't you need to bound 'count' so that horrid things don't
happen further down the code?
David
^ permalink raw reply
* Re: [PATCH net-next 12/13] s390/qeth: support GRO flush timer
From: Eric Dumazet @ 2017-10-18 16:08 UTC (permalink / raw)
To: Julian Wiedmann
Cc: David Miller, netdev, linux-s390, Martin Schwidefsky,
Heiko Carstens, Stefan Raspl, Ursula Braun
In-Reply-To: <20171018154025.73630-13-jwi@linux.vnet.ibm.com>
On Wed, 2017-10-18 at 17:40 +0200, Julian Wiedmann wrote:
> Switch to napi_complete_done(), and thus enable delayed GRO flushing.
> The timeout is configured via /sys/class/net/<if>/gro_flush_timeout.
>
> Default timeout is 0, so no change in behaviour.
>
> Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
> ---
Reviewed-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply
* Re: [PATCH v2 02/15] usb: gadget: make config_item_type structures const
From: Laurent Pinchart @ 2017-10-18 16:05 UTC (permalink / raw)
To: Bhumika Goyal
Cc: julia.lawall-L2FTfq7BK8M, rjw-LthD3rsA81gm4RdzfppkhA,
lenb-DgEjT+Ai2ygdnm+yROfE0A,
alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
jic23-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w, hch-jcswGhMUV9g,
sagi-NQWnxTmZq1alnMjI0IkVqw, kishon-l0cyMroinI0,
bhelgaas-hpIqsD4AKlfQT0dZR+AlfA, nab-IzHhD5pYlfBP7FQvKIMDCQ,
balbi-DgEjT+Ai2ygdnm+yROfE0A,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
jlbec-aKy9MeLSZ9dg9hUCZPvPmw, ccaulfie-H+wXaHxf7aLQT0dZR+AlfA,
teigland-H+wXaHxf7aLQT0dZR+AlfA, mfasheh-rOS7oXVqrJRBDgjK7y7TUQ,
linux-acpi-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-pci-u79uwXL29TY76Z2rM5mHXA,
linux-scsi-u79uwXL29TY76Z2rM5mHXA,
target-devel-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
cluster-devel-H+wXaHxf7aLQT0dZR+AlfA,
ocfs2-devel-N0ozoZBvEnrZJqsBc5GL+g
In-Reply-To: <1508167134-6243-3-git-send-email-bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Hi Bhumika,
Thank you for the patch.
On Monday, 16 October 2017 18:18:41 EEST Bhumika Goyal wrote:
> Make these structures const as they are only passed to the const
> argument of the functions config_{group/item}_init_type_name.
>
> Signed-off-by: Bhumika Goyal <bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> * Changes in v2- Combine all the followup patches and the constification
> patches into a series.
>
> drivers/usb/gadget/function/f_acm.c | 2 +-
> drivers/usb/gadget/function/f_ecm.c | 2 +-
> drivers/usb/gadget/function/f_eem.c | 2 +-
> drivers/usb/gadget/function/f_fs.c | 2 +-
> drivers/usb/gadget/function/f_hid.c | 2 +-
> drivers/usb/gadget/function/f_loopback.c | 2 +-
> drivers/usb/gadget/function/f_mass_storage.c | 4 +--
> drivers/usb/gadget/function/f_midi.c | 2 +-
> drivers/usb/gadget/function/f_ncm.c | 2 +-
> drivers/usb/gadget/function/f_obex.c | 2 +-
> drivers/usb/gadget/function/f_phonet.c | 2 +-
> drivers/usb/gadget/function/f_printer.c | 2 +-
> drivers/usb/gadget/function/f_rndis.c | 2 +-
> drivers/usb/gadget/function/f_serial.c | 2 +-
> drivers/usb/gadget/function/f_sourcesink.c | 2 +-
> drivers/usb/gadget/function/f_subset.c | 2 +-
> drivers/usb/gadget/function/f_tcm.c | 2 +-
> drivers/usb/gadget/function/f_uac1.c | 2 +-
> drivers/usb/gadget/function/f_uac1_legacy.c | 2 +-
> drivers/usb/gadget/function/f_uac2.c | 2 +-
> drivers/usb/gadget/function/uvc_configfs.c | 50 ++++++++++++------------
> 21 files changed, 46 insertions(+), 46 deletions(-)
[snip]
> diff --git a/drivers/usb/gadget/function/uvc_configfs.c
> b/drivers/usb/gadget/function/uvc_configfs.c index 844cb73..f76619f 100644
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -127,7 +127,7 @@ static struct uvcg_control_header
> *to_uvcg_control_header(struct config_item *it NULL,
> };
>
> -static struct config_item_type uvcg_control_header_type = {
> +static const struct config_item_type uvcg_control_header_type = {
> .ct_attrs = uvcg_control_header_attrs,
> .ct_owner = THIS_MODULE,
> };
> @@ -170,7 +170,7 @@ static void uvcg_control_header_drop(struct config_group
> *group, .drop_item = uvcg_control_header_drop,
> };
>
> -static struct config_item_type uvcg_control_header_grp_type = {
> +static const struct config_item_type uvcg_control_header_grp_type = {
> .ct_group_ops = &uvcg_control_header_grp_ops,
> .ct_owner = THIS_MODULE,
> };
> @@ -265,7 +265,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> NULL,
> };
>
> -static struct config_item_type uvcg_default_processing_type = {
> +static const struct config_item_type uvcg_default_processing_type = {
> .ct_attrs = uvcg_default_processing_attrs,
> .ct_owner = THIS_MODULE,
> };
> @@ -277,7 +277,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> struct config_group group;
> } uvcg_processing_grp;
>
> -static struct config_item_type uvcg_processing_grp_type = {
> +static const struct config_item_type uvcg_processing_grp_type = {
> .ct_owner = THIS_MODULE,
> };
>
> @@ -382,7 +382,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
> NULL,
> };
>
> -static struct config_item_type uvcg_default_camera_type = {
> +static const struct config_item_type uvcg_default_camera_type = {
> .ct_attrs = uvcg_default_camera_attrs,
> .ct_owner = THIS_MODULE,
> };
> @@ -394,7 +394,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
> struct config_group group;
> } uvcg_camera_grp;
>
> -static struct config_item_type uvcg_camera_grp_type = {
> +static const struct config_item_type uvcg_camera_grp_type = {
> .ct_owner = THIS_MODULE,
> };
>
> @@ -460,7 +460,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
> NULL,
> };
>
> -static struct config_item_type uvcg_default_output_type = {
> +static const struct config_item_type uvcg_default_output_type = {
> .ct_attrs = uvcg_default_output_attrs,
> .ct_owner = THIS_MODULE,
> };
> @@ -472,7 +472,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
> struct config_group group;
> } uvcg_output_grp;
>
> -static struct config_item_type uvcg_output_grp_type = {
> +static const struct config_item_type uvcg_output_grp_type = {
> .ct_owner = THIS_MODULE,
> };
>
> @@ -481,7 +481,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
> struct config_group group;
> } uvcg_terminal_grp;
>
> -static struct config_item_type uvcg_terminal_grp_type = {
> +static const struct config_item_type uvcg_terminal_grp_type = {
> .ct_owner = THIS_MODULE,
> };
>
> @@ -586,7 +586,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, .drop_link = uvcg_control_class_drop_link,
> };
>
> -static struct config_item_type uvcg_control_class_type = {
> +static const struct config_item_type uvcg_control_class_type = {
> .ct_item_ops = &uvcg_control_class_item_ops,
> .ct_owner = THIS_MODULE,
> };
> @@ -596,7 +596,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group group;
> } uvcg_control_class_grp;
>
> -static struct config_item_type uvcg_control_class_grp_type = {
> +static const struct config_item_type uvcg_control_class_grp_type = {
> .ct_owner = THIS_MODULE,
> };
>
> @@ -605,7 +605,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group group;
> } uvcg_control_grp;
>
> -static struct config_item_type uvcg_control_grp_type = {
> +static const struct config_item_type uvcg_control_grp_type = {
> .ct_owner = THIS_MODULE,
> };
>
> @@ -857,7 +857,7 @@ static void uvcg_streaming_header_drop_link(struct
> config_item *src, NULL,
> };
>
> -static struct config_item_type uvcg_streaming_header_type = {
> +static const struct config_item_type uvcg_streaming_header_type = {
> .ct_item_ops = &uvcg_streaming_header_item_ops,
> .ct_attrs = uvcg_streaming_header_attrs,
> .ct_owner = THIS_MODULE,
> @@ -901,7 +901,7 @@ static void uvcg_streaming_header_drop(struct
> config_group *group, .drop_item = uvcg_streaming_header_drop,
> };
>
> -static struct config_item_type uvcg_streaming_header_grp_type = {
> +static const struct config_item_type uvcg_streaming_header_grp_type = {
> .ct_group_ops = &uvcg_streaming_header_grp_ops,
> .ct_owner = THIS_MODULE,
> };
> @@ -1150,7 +1150,7 @@ static ssize_t
> uvcg_frame_dw_frame_interval_store(struct config_item *item, NULL,
> };
>
> -static struct config_item_type uvcg_frame_type = {
> +static const struct config_item_type uvcg_frame_type = {
> .ct_attrs = uvcg_frame_attrs,
> .ct_owner = THIS_MODULE,
> };
> @@ -1419,7 +1419,7 @@ static ssize_t
> uvcg_uncompressed_guid_format_store(struct config_item *item, NULL,
> };
>
> -static struct config_item_type uvcg_uncompressed_type = {
> +static const struct config_item_type uvcg_uncompressed_type = {
> .ct_group_ops = &uvcg_uncompressed_group_ops,
> .ct_attrs = uvcg_uncompressed_attrs,
> .ct_owner = THIS_MODULE,
> @@ -1469,7 +1469,7 @@ static void uvcg_uncompressed_drop(struct config_group
> *group, .drop_item = uvcg_uncompressed_drop,
> };
>
> -static struct config_item_type uvcg_uncompressed_grp_type = {
> +static const struct config_item_type uvcg_uncompressed_grp_type = {
> .ct_group_ops = &uvcg_uncompressed_grp_ops,
> .ct_owner = THIS_MODULE,
> };
> @@ -1619,7 +1619,7 @@ static struct uvcg_mjpeg *to_uvcg_mjpeg(struct
> config_item *item) NULL,
> };
>
> -static struct config_item_type uvcg_mjpeg_type = {
> +static const struct config_item_type uvcg_mjpeg_type = {
> .ct_group_ops = &uvcg_mjpeg_group_ops,
> .ct_attrs = uvcg_mjpeg_attrs,
> .ct_owner = THIS_MODULE,
> @@ -1663,7 +1663,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, .drop_item = uvcg_mjpeg_drop,
> };
>
> -static struct config_item_type uvcg_mjpeg_grp_type = {
> +static const struct config_item_type uvcg_mjpeg_grp_type = {
> .ct_group_ops = &uvcg_mjpeg_grp_ops,
> .ct_owner = THIS_MODULE,
> };
> @@ -1728,7 +1728,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, NULL,
> };
>
> -static struct config_item_type uvcg_default_color_matching_type = {
> +static const struct config_item_type uvcg_default_color_matching_type = {
> .ct_attrs = uvcg_default_color_matching_attrs,
> .ct_owner = THIS_MODULE,
> };
> @@ -1740,7 +1740,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, struct config_group group;
> } uvcg_color_matching_grp;
>
> -static struct config_item_type uvcg_color_matching_grp_type = {
> +static const struct config_item_type uvcg_color_matching_grp_type = {
> .ct_owner = THIS_MODULE,
> };
>
> @@ -2085,7 +2085,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, .drop_link = uvcg_streaming_class_drop_link,
> };
>
> -static struct config_item_type uvcg_streaming_class_type = {
> +static const struct config_item_type uvcg_streaming_class_type = {
> .ct_item_ops = &uvcg_streaming_class_item_ops,
> .ct_owner = THIS_MODULE,
> };
> @@ -2095,7 +2095,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group group;
> } uvcg_streaming_class_grp;
>
> -static struct config_item_type uvcg_streaming_class_grp_type = {
> +static const struct config_item_type uvcg_streaming_class_grp_type = {
> .ct_owner = THIS_MODULE,
> };
>
> @@ -2104,7 +2104,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group group;
> } uvcg_streaming_grp;
>
> -static struct config_item_type uvcg_streaming_grp_type = {
> +static const struct config_item_type uvcg_streaming_grp_type = {
> .ct_owner = THIS_MODULE,
> };
Now we have 9 const instances of the config_item_type structure that are
identical, with only the .ct_owner field set. Should they be all merged into a
single structure ?
> @@ -2190,7 +2190,7 @@ static void uvc_attr_release(struct config_item *item)
> NULL,
> };
>
> -static struct config_item_type uvc_func_type = {
> +static const struct config_item_type uvc_func_type = {
> .ct_item_ops = &uvc_item_ops,
> .ct_attrs = uvc_attrs,
> .ct_owner = THIS_MODULE,
--
Regards,
Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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:
From: Mrs. Marie Angèle O @ 2017-10-18 15:57 UTC (permalink / raw)
--
I solicit for your partnership to claim $11 million. You will be
entitled to 40% of the sum reply for more details.
^ permalink raw reply
* Re: Linux 4.12+ memory leak on router with i40e NICs
From: Paweł Staszewski @ 2017-10-18 15:44 UTC (permalink / raw)
To: Alexander Duyck
Cc: Pavlos Parissis, Anders K. Pedersen | Cohaesio,
netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
alexander.h.duyck@intel.com
In-Reply-To: <d79df7f2-5de4-cc37-baf0-5603f025155e@itcare.pl>
W dniu 2017-10-17 o 16:08, Paweł Staszewski pisze:
>
>
> W dniu 2017-10-17 o 13:52, Paweł Staszewski pisze:
>>
>>
>> W dniu 2017-10-17 o 13:05, Paweł Staszewski pisze:
>>>
>>>
>>> W dniu 2017-10-17 o 12:59, Paweł Staszewski pisze:
>>>>
>>>>
>>>> W dniu 2017-10-17 o 12:51, Paweł Staszewski pisze:
>>>>>
>>>>>
>>>>> W dniu 2017-10-17 o 12:20, Paweł Staszewski pisze:
>>>>>>
>>>>>>
>>>>>> W dniu 2017-10-17 o 11:48, Paweł Staszewski pisze:
>>>>>>>
>>>>>>>
>>>>>>> W dniu 2017-10-17 o 02:44, Paweł Staszewski pisze:
>>>>>>>>
>>>>>>>>
>>>>>>>> W dniu 2017-10-17 o 01:56, Alexander Duyck pisze:
>>>>>>>>> On Mon, Oct 16, 2017 at 4:34 PM, Paweł Staszewski
>>>>>>>>> <pstaszewski@itcare.pl> wrote:
>>>>>>>>>>
>>>>>>>>>> W dniu 2017-10-16 o 18:26, Paweł Staszewski pisze:
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> W dniu 2017-10-16 o 13:20, Pavlos Parissis pisze:
>>>>>>>>>>>> On 15/10/2017 02:58 πμ, Alexander Duyck wrote:
>>>>>>>>>>>>> Hi Pawel,
>>>>>>>>>>>>>
>>>>>>>>>>>>> To clarify is that Dave Miller's tree or Linus's that you
>>>>>>>>>>>>> are talking
>>>>>>>>>>>>> about? If it is Dave's tree how long ago was it you pulled
>>>>>>>>>>>>> it since I
>>>>>>>>>>>>> think the fix was just pushed by Jeff Kirsher a few days ago.
>>>>>>>>>>>>>
>>>>>>>>>>>>> The issue should be fixed in the following commit:
>>>>>>>>>>>>>
>>>>>>>>>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/drivers/net/ethernet/intel/i40e/i40e_txrx.c?id=2b9478ffc550f17c6cd8c69057234e91150f5972
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> Do you know when it is going to be available on net-next
>>>>>>>>>>>> and linux-stable
>>>>>>>>>>>> repos?
>>>>>>>>>>>>
>>>>>>>>>>>> Cheers,
>>>>>>>>>>>> Pavlos
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> I will make some tests today night with "net" git tree where
>>>>>>>>>>> this patch is
>>>>>>>>>>> included.
>>>>>>>>>>> Starting from 0:00 CET
>>>>>>>>>>> :)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> Upgraded and looks like problem is not solved with that patch
>>>>>>>>>> Currently running system with
>>>>>>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/
>>>>>>>>>> kernel
>>>>>>>>>>
>>>>>>>>>> Still about 0.5GB of memory is leaking somewhere
>>>>>>>>>>
>>>>>>>>>> Also can confirm that the latest kernel where memory is not
>>>>>>>>>> leaking (with
>>>>>>>>>> use i40e driver intel 710 cards) is 4.11.12
>>>>>>>>>> With kernel 4.11.12 - after hour no change in memory usage.
>>>>>>>>>>
>>>>>>>>>> also checked that with ixgbe instead of i40e with same
>>>>>>>>>> net.git kernel there
>>>>>>>>>> is no memleak - after hour same memory usage - so for 100%
>>>>>>>>>> this is i40e
>>>>>>>>>> driver problem.
>>>>>>>>> So how long was the run to get the .5GB of memory leaking?
>>>>>>>> 1 hour
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Also is there any chance of you being able to bisect to determine
>>>>>>>>> where the memory leak was introduced since as you pointed out it
>>>>>>>>> didn't exist in 4.11.12 so odds are it was introduced somewhere
>>>>>>>>> between 4.11 and the latest kernel release.
>>>>>>>> Can be hard cause currently need to back to 4.11.12 - this is
>>>>>>>> production host/router
>>>>>>>> Will try to find some free/test router for tests/bicects with
>>>>>>>> i40e driver (intel 710 cards)
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>>
>>>>>>>>> - Alex
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> Also forgoto to add errors for i40e when driver initialize:
>>>>>>> [ 15.760569] i40e 0000:02:00.1: Error I40E_AQ_RC_ENOSPC adding
>>>>>>> RX filters on PF, promiscuous mode forced on
>>>>>>> [ 16.365587] i40e 0000:03:00.3: Error I40E_AQ_RC_ENOSPC adding
>>>>>>> RX filters on PF, promiscuous mode forced on
>>>>>>> [ 16.367686] i40e 0000:02:00.2: Error I40E_AQ_RC_ENOSPC adding
>>>>>>> RX filters on PF, promiscuous mode forced on
>>>>>>> [ 16.368816] i40e 0000:03:00.0: Error I40E_AQ_RC_ENOSPC adding
>>>>>>> RX filters on PF, promiscuous mode forced on
>>>>>>> [ 16.369877] i40e 0000:03:00.2: Error I40E_AQ_RC_ENOSPC adding
>>>>>>> RX filters on PF, promiscuous mode forced on
>>>>>>> [ 16.370941] i40e 0000:02:00.3: Error I40E_AQ_RC_ENOSPC adding
>>>>>>> RX filters on PF, promiscuous mode forced on
>>>>>>> [ 16.372005] i40e 0000:02:00.0: Error I40E_AQ_RC_ENOSPC adding
>>>>>>> RX filters on PF, promiscuous mode forced on
>>>>>>> [ 16.373029] i40e 0000:03:00.1: Error I40E_AQ_RC_ENOSPC adding
>>>>>>> RX filters on PF, promiscuous mode forced on
>>>>>>>
>>>>>>> some params that are set for this nic's
>>>>>>> ip link set up dev $i
>>>>>>> ethtool -A $i autoneg off rx off tx off
>>>>>>> ethtool -G $i rx 1024 tx 2048
>>>>>>> ip link set $i txqueuelen 1000
>>>>>>> ethtool -C $i adaptive-rx off adaptive-tx off rx-usecs
>>>>>>> 512 tx-usecs 128
>>>>>>> ethtool -L $i combined 6
>>>>>>> #ethtool -N $i rx-flow-hash udp4 sdfn
>>>>>>> ethtool -K $i ntuple on
>>>>>>> ethtool -K $i gro off
>>>>>>> ethtool -K $i tso off
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> Also after TSO/GRO on there is memory usage change - and leaking
>>>>>> faster
>>>>>> Below image from memory usage before change with TSO/GRO OFF and
>>>>>> after enabling TSO/GRO
>>>>>>
>>>>>> https://ibb.co/dTqBY6
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>> Pawel
>>>>>>
>>>>>>
>>>>>>
>>>>> With settings like this:
>>>>> ifc='enp2s0f0 enp2s0f1 enp2s0f2 enp2s0f3 enp3s0f0 enp3s0f1
>>>>> enp3s0f2 enp3s0f3'
>>>>> for i in $ifc
>>>>> do
>>>>> ethtool -C $i adaptive-rx off adaptive-tx off rx-usecs 512
>>>>> tx-usecs 128
>>>>> ethtool -K $i gro on
>>>>> ethtool -K $i tso on
>>>>>
>>>>> done
>>>>>
>>>>> Server is leaking about 4-6MB per each 10 seconds
>>>>> MEMLEAK:
>>>>> 5 MB/10sec
>>>>> 6 MB/10sec
>>>>> 4 MB/10sec
>>>>> 4 MB/10sec
>>>>>
>>>>>
>>>>> Other settings TSO/GRO off
>>>>> ifc='enp2s0f0 enp2s0f1 enp2s0f2 enp2s0f3 enp3s0f0 enp3s0f1
>>>>> enp3s0f2 enp3s0f3'
>>>>> for i in $ifc
>>>>> do
>>>>> ethtool -C $i adaptive-rx off adaptive-tx off rx-usecs 512
>>>>> tx-usecs 128
>>>>> ethtool -K $i gro off
>>>>> ethtool -K $i tso off
>>>>>
>>>>> done
>>>>>
>>>>> Same leak about 5MB per 10 seconds
>>>>> MEMLEAK:
>>>>> 5 MB/10sec
>>>>> 5 MB/10sec
>>>>> 5 MB/10sec
>>>>>
>>>>>
>>>>> Other settings rx-usecs change from 512 to 1024:
>>>>> ifc='enp2s0f0 enp2s0f1 enp2s0f2 enp2s0f3 enp3s0f0 enp3s0f1
>>>>> enp3s0f2 enp3s0f3'
>>>>> for i in $ifc
>>>>> do
>>>>> ethtool -C $i adaptive-rx off adaptive-tx off rx-usecs
>>>>> 1024 tx-usecs 128
>>>>> ethtool -K $i gro off
>>>>> ethtool -K $i tso off
>>>>>
>>>>> done
>>>>>
>>>>> MEMLEAK:
>>>>> 4 MB/10sec
>>>>> 3 MB/10sec
>>>>> 4 MB/10sec
>>>>> 4 MB/10sec
>>>>>
>>>>>
>>>>> So memleak have something to do with rx-usecs (less interrupts but
>>>>> bigger latency for traffic)
>>>>>
>>>>>
>>>>> But also enabling TSO/GRO making leak about 1MB bigger for each 10
>>>>> seconds
>>>>>
>>>>>
>>>>>
>>>> So far best config is:
>>>> ifc='enp2s0f0 enp2s0f1 enp2s0f2 enp2s0f3 enp3s0f0 enp3s0f1 enp3s0f2
>>>> enp3s0f3'
>>>> for i in $ifc
>>>> do
>>>> ethtool -C $i adaptive-rx off adaptive-tx off rx-usecs 64
>>>> tx-usecs 512
>>>> ethtool -K $i gro off
>>>> ethtool -K $i tso on
>>>>
>>>> done
>>>>
>>>> MEMLEAK - about 2MB/10secs
>>>> 2 MB/10sec
>>>> 2 MB/10sec
>>>> 2 MB/10sec
>>>>
>>>>
>>>> With - rx-usecs set to 256 (about 7-9MB/10secs memleak)
>>>> ifc='enp2s0f0 enp2s0f1 enp2s0f2 enp2s0f3 enp3s0f0 enp3s0f1 enp3s0f2
>>>> enp3s0f3'
>>>> for i in $ifc
>>>> do
>>>> ethtool -C $i adaptive-rx off adaptive-tx off rx-usecs 256
>>>> tx-usecs 512
>>>> ethtool -K $i gro off
>>>> ethtool -K $i tso on
>>>>
>>>> done
>>>>
>>>> MEMLEAK:
>>>> 7 MB/10sec
>>>> 7 MB/10sec
>>>> 8 MB/10sec
>>>> 9 MB/10sec
>>>>
>>>>
>>>
>>> And even less memleak with rx-usecs set to 32
>>> ifc='enp2s0f0 enp2s0f1 enp2s0f2 enp2s0f3 enp3s0f0 enp3s0f1 enp3s0f2
>>> enp3s0f3'
>>> for i in $ifc
>>> do
>>> ethtool -C $i adaptive-rx off adaptive-tx off rx-usecs 32
>>> tx-usecs 512
>>> ethtool -K $i gro off
>>> ethtool -K $i tso on
>>>
>>> done
>>>
>>>
>>> MEMLEAK - about 0-2MB for each 10 seconds
>>> 0 MB/10sec
>>> 1 MB/10sec
>>> 0 MB/10sec
>>> 2 MB/10sec
>>> 1 MB/10sec
>>>
>>>
>>>
>>
>>
>> So best settings - to have as less leak as possible for now (rx-usecs
>> set to 16):
>> ifc='enp2s0f0 enp2s0f1 enp2s0f2 enp2s0f3 enp3s0f0 enp3s0f1 enp3s0f2
>> enp3s0f3'
>> for i in $ifc
>> do
>> ethtool -C $i adaptive-rx off adaptive-tx off rx-usecs 16
>> tx-usecs 768
>> ethtool -K $i gro on
>> ethtool -K $i tso on
>>
>> done
>>
>>
>> MEMLEAK: (0-1MB/10seconds)
>> 0 MB/10sec
>> 0 MB/10sec
>> 0 MB/10sec
>> 1 MB/10sec
>> 1 MB/10sec
>> -1 MB/10sec
>> 1 MB/10sec
>> 1 MB/10sec
>> 0 MB/10sec
>>
>> (there are some memory recycles - so this is good :) )
>>
>>
>>
>> Compared to(rx-usecs 512):
>>
>> ifc='enp2s0f0 enp2s0f1 enp2s0f2 enp2s0f3 enp3s0f0 enp3s0f1 enp3s0f2
>> enp3s0f3'
>> for i in $ifc
>> do
>> ethtool -C $i adaptive-rx off adaptive-tx off rx-usecs 512
>> tx-usecs 128
>> ethtool -K $i gro on
>> ethtool -K $i tso on
>>
>> done
>>
>> Server is leaking about 4-6MB per each 10 seconds
>> MEMLEAK:
>> 5 MB/10sec
>> 6 MB/10sec
>> 4 MB/10sec
>> 4 MB/10sec
>>
>>
>
> And graph where all changes for rx-usecs was done over some time:
> https://ibb.co/nrRfbR
>
>
>
>
>
Cant eliminate the problem with settings - memleak is bigger or less
visible with rx-usecs set to low values - but then have 100% cpu load -
cant have rx-usecs set to 16
Cant find also other host with same cards or that are using i40e driver
for tests with bisecting
So will just replace to mellanox :)
^ permalink raw reply
* Re: [PATCH 1/7] devlink: Add permanent config parameter get/set operations
From: Steve Lin @ 2017-10-18 15:46 UTC (permalink / raw)
To: Or Gerlitz
Cc: Linux Netdev List, Jiri Pirko, David Miller, Michael Chan,
John Linville, Andy Gospodarek
In-Reply-To: <CAJ3xEMgzy+hm5zeOEHGewpQoxc_3t2z3O49rFOC7hLhUa9Rt-Q@mail.gmail.com>
On Wed, Oct 18, 2017 at 11:22 AM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
> On Tue, Oct 17, 2017 at 11:44 PM, Steve Lin <steven.lin1@broadcom.com>
> wrote:
>>
>> Add support for permanent config parameter get/set commands. Used
>> for parameters held in NVRAM, persistent device configuration.
>> The config_get() and config_set() operations operate as expected, but
>> note that the driver implementation of the config_set() operation can
>> indicate whether a restart is necessary for the setting to take
>> effect. This indication of a necessary restart is passed via the
>> DEVLINK_ATTR_PERM_CFG_RESTART_REQUIRED attribute.
>>
>> First set of parameters defined are PCI SR-IOV and per-VF
>> configuration:
>>
>> DEVLINK_ATTR_PERM_CFG_SRIOV_ENABLED: Enable SR-IOV capability.
>> DEVLINK_ATTR_PERM_CFG_NUM_VF_PER_PF: Maximum number of VFs per PF, in
>> SR-IOV mode.
>> DEVLINK_ATTR_PERM_CFG_MAX_NUM_PF_MSIX_VECT: Maximum number of
>> MSI-X vectors assigned per PF.
>> DEVLINK_ATTR_PERM_CFG_MSIX_VECTORS_PER_VF: Number of MSI-X vectors
>> allocated per VF.
>>
>> Signed-off-by: Steve Lin <steven.lin1@broadcom.com>
>> Acked-by: Andy Gospodarek <gospo@broadcom.com>
>> ---
>> include/net/devlink.h | 4 +
>> include/uapi/linux/devlink.h | 20 ++++
>> net/core/devlink.c | 266
>> +++++++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 290 insertions(+)
>>
>> diff --git a/include/net/devlink.h b/include/net/devlink.h
>> index b9654e1..952966c 100644
>> --- a/include/net/devlink.h
>> +++ b/include/net/devlink.h
>> @@ -270,6 +270,10 @@ struct devlink_ops {
>> int (*eswitch_inline_mode_set)(struct devlink *devlink, u8
>> inline_mode);
>> int (*eswitch_encap_mode_get)(struct devlink *devlink, u8
>> *p_encap_mode);
>> int (*eswitch_encap_mode_set)(struct devlink *devlink, u8
>> encap_mode);
>> + int (*config_get)(struct devlink *devlink, enum devlink_attr attr,
>> + u32 *value);
>> + int (*config_set)(struct devlink *devlink, enum devlink_attr attr,
>> + u32 value, u8 *restart_reqd);
>> };
>>
>> static inline void *devlink_priv(struct devlink *devlink)
>> diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
>> index 0cbca96..34de44d 100644
>> --- a/include/uapi/linux/devlink.h
>> +++ b/include/uapi/linux/devlink.h
>> @@ -70,6 +70,9 @@ enum devlink_command {
>> DEVLINK_CMD_DPIPE_HEADERS_GET,
>> DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET,
>>
>> + DEVLINK_CMD_CONFIG_GET,
>> + DEVLINK_CMD_CONFIG_SET,
>> +
>> /* add new commands above here */
>> __DEVLINK_CMD_MAX,
>> DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
>> @@ -202,6 +205,23 @@ enum devlink_attr {
>>
>> DEVLINK_ATTR_ESWITCH_ENCAP_MODE, /* u8 */
>>
>> + /* Permanent Configuration Parameters */
>> + DEVLINK_ATTR_PERM_CFG, /* nested */
>> +
>> + /* When config doesn't take effect until next reboot (config
>> + * just changed NVM which isn't read until boot, for example),
>> + * this attribute should be set by the driver.
>> + */
>> + DEVLINK_ATTR_PERM_CFG_RESTART_REQUIRED, /* u8 */
>> + DEVLINK_ATTR_PERM_CFG_SRIOV_ENABLED, /* u8 */
>> + DEVLINK_ATTR_PERM_CFG_FIRST = DEVLINK_ATTR_PERM_CFG_SRIOV_ENABLED,
>
>
> ??? can you explain / document this one?
I attempted to explain in the patch commit message, but I will try to
add more detail when I resubmit, with each attribute in a separate
patch.
>
> I would join Jiri's request to have patch #1 not defining any attributes,
> review will be much
> easier and robust.
Ok, I'll do that when I resubmit.
>
> Talking on attributes... what is your plan for vendor specific attributes?
>
They will be added just like common attributes, any given driver
doesn't have to support all attributes.
Steve
^ permalink raw reply
* [PATCH] lib/dynamic_queue_limits.c: relax BUG_ON to WARN_ON in dql_complete()
From: Ard Biesheuvel @ 2017-10-18 15:45 UTC (permalink / raw)
To: linux-kernel, netdev, davem; +Cc: Ard Biesheuvel
Even though calling dql_completed() with a count that exceeds the
queued count is a serious error, it still does not justify bringing
down the entire kernel with a BUG_ON(). So relax it to a WARN_ON()
instead.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
lib/dynamic_queue_limits.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c
index f346715e2255..24ce495d78f3 100644
--- a/lib/dynamic_queue_limits.c
+++ b/lib/dynamic_queue_limits.c
@@ -23,7 +23,7 @@ void dql_completed(struct dql *dql, unsigned int count)
num_queued = ACCESS_ONCE(dql->num_queued);
/* Can't complete more than what's in queue */
- BUG_ON(count > num_queued - dql->num_completed);
+ WARN_ON(count > num_queued - dql->num_completed);
completed = dql->num_completed + count;
limit = dql->limit;
--
2.11.0
^ permalink raw reply related
* [PATCH net-next 12/13] s390/qeth: support GRO flush timer
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
Switch to napi_complete_done(), and thus enable delayed GRO flushing.
The timeout is configured via /sys/class/net/<if>/gro_flush_timeout.
Default timeout is 0, so no change in behaviour.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 8855bc8534d2..98b7e1ce0dd1 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -5370,7 +5370,7 @@ int qeth_poll(struct napi_struct *napi, int budget)
}
}
- napi_complete(napi);
+ napi_complete_done(napi, work_done);
if (qdio_start_irq(card->data.ccwdev, 0))
napi_schedule(&card->napi);
out:
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 08/13] s390/qeth: no VLAN support on OSM
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
Instead of silently discarding VLAN registration requests on OSM,
just indicate that this card type doesn't support VLAN.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_l2_main.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 87aa8c2ab5b0..d2537c09126d 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -348,10 +348,6 @@ static int qeth_l2_vlan_rx_add_vid(struct net_device *dev,
QETH_CARD_TEXT_(card, 4, "aid:%d", vid);
if (!vid)
return 0;
- if (card->info.type == QETH_CARD_TYPE_OSM) {
- QETH_CARD_TEXT(card, 3, "aidOSM");
- return 0;
- }
if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
QETH_CARD_TEXT(card, 3, "aidREC");
return 0;
@@ -381,10 +377,6 @@ static int qeth_l2_vlan_rx_kill_vid(struct net_device *dev,
int rc = 0;
QETH_CARD_TEXT_(card, 4, "kid:%d", vid);
- if (card->info.type == QETH_CARD_TYPE_OSM) {
- QETH_CARD_TEXT(card, 3, "kidOSM");
- return 0;
- }
if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
QETH_CARD_TEXT(card, 3, "kidREC");
return 0;
@@ -1010,7 +1002,11 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
} else {
card->dev->ethtool_ops = &qeth_l2_ethtool_ops;
}
- card->dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
+
+ if (card->info.type == QETH_CARD_TYPE_OSM)
+ card->dev->features |= NETIF_F_VLAN_CHALLENGED;
+ else
+ card->dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
if (card->info.type == QETH_CARD_TYPE_OSD && !card->info.guestlan) {
card->dev->hw_features = NETIF_F_SG;
card->dev->vlan_features = NETIF_F_SG;
@@ -1120,8 +1116,7 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
goto out_remove;
}
- if (card->info.type != QETH_CARD_TYPE_OSN &&
- card->info.type != QETH_CARD_TYPE_OSM)
+ if (card->info.type != QETH_CARD_TYPE_OSN)
qeth_l2_process_vlans(card);
netif_tx_disable(card->dev);
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 13/13] s390/qeth: don't dump control cmd twice
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
A few lines down, qeth_prepare_control_data() makes further changes to
the control cmd buffer, and then also writes a trace entry for it.
So the first entry just pollutes the trace file with intermediate data,
drop it.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 98b7e1ce0dd1..457a4b4e8212 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -2073,7 +2073,6 @@ int qeth_send_control_data(struct qeth_card *card, int len,
spin_lock_irqsave(&card->lock, flags);
list_add_tail(&reply->list, &card->cmd_waiter_list);
spin_unlock_irqrestore(&card->lock, flags);
- QETH_DBF_HEX(CTRL, 2, iob->data, QETH_DBF_CTRL_LEN);
while (atomic_cmpxchg(&card->write.irq_pending, 0, 1)) ;
qeth_prepare_control_data(card, len, iob);
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 11/13] s390/qeth: try harder to get packets from RX buffer
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
Current code bails out when two subsequent buffer elements hold
insufficient data to contain a qeth_hdr packet descriptor.
This seems reasonable, but it would be legal for quirky hardware to
leave a few elements empty and then present packets in a subsequent
element. These packets would currently be dropped.
So make sure to check all buffer elements, until we hit the LAST_ENTRY
indication.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 23b439fb5f2c..8855bc8534d2 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -5214,13 +5214,11 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
int use_rx_sg = 0;
/* qeth_hdr must not cross element boundaries */
- if (element->length < offset + sizeof(struct qeth_hdr)) {
+ while (element->length < offset + sizeof(struct qeth_hdr)) {
if (qeth_is_last_sbale(element))
return NULL;
element++;
offset = 0;
- if (element->length < sizeof(struct qeth_hdr))
- return NULL;
}
*hdr = element->addr + offset;
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 09/13] s390/qeth: clean up page frag creation
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
Replace the open-coded skb_add_rx_frag(), and use a fall-through
to remove some duplicated code.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 31 +++++++++++--------------------
1 file changed, 11 insertions(+), 20 deletions(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index acf16fa75c63..1cf4e066955f 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -5172,10 +5172,11 @@ EXPORT_SYMBOL_GPL(qeth_core_hardsetup_card);
static int qeth_create_skb_frag(struct qeth_qdio_buffer *qethbuffer,
struct qdio_buffer_element *element,
- struct sk_buff **pskb, int offset, int *pfrag,
- int data_len)
+ struct sk_buff **pskb, int offset, int data_len)
{
struct page *page = virt_to_page(element->addr);
+ unsigned int next_frag;
+
if (*pskb == NULL) {
if (qethbuffer->rx_skb) {
/* only if qeth_card.options.cq == QETH_CQ_ENABLED */
@@ -5190,28 +5191,19 @@ static int qeth_create_skb_frag(struct qeth_qdio_buffer *qethbuffer,
skb_reserve(*pskb, ETH_HLEN);
if (data_len <= QETH_RX_PULL_LEN) {
skb_put_data(*pskb, element->addr + offset, data_len);
+ return 0;
} else {
- get_page(page);
skb_put_data(*pskb, element->addr + offset,
QETH_RX_PULL_LEN);
- skb_fill_page_desc(*pskb, *pfrag, page,
- offset + QETH_RX_PULL_LEN,
- data_len - QETH_RX_PULL_LEN);
- (*pskb)->data_len += data_len - QETH_RX_PULL_LEN;
- (*pskb)->len += data_len - QETH_RX_PULL_LEN;
- (*pskb)->truesize += data_len - QETH_RX_PULL_LEN;
- (*pfrag)++;
+ data_len -= QETH_RX_PULL_LEN;
+ offset += QETH_RX_PULL_LEN;
+ /* fall through to add page frag for remaining data */
}
- } else {
- get_page(page);
- skb_fill_page_desc(*pskb, *pfrag, page, offset, data_len);
- (*pskb)->data_len += data_len;
- (*pskb)->len += data_len;
- (*pskb)->truesize += data_len;
- (*pfrag)++;
}
-
+ next_frag = skb_shinfo(*pskb)->nr_frags;
+ get_page(page);
+ skb_add_rx_frag(*pskb, next_frag, page, offset, data_len, data_len);
return 0;
}
@@ -5234,7 +5226,6 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
int data_len;
int headroom = 0;
int use_rx_sg = 0;
- int frag = 0;
/* qeth_hdr must not cross element boundaries */
if (element->length < offset + sizeof(struct qeth_hdr)) {
@@ -5286,7 +5277,7 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
if (data_len) {
if (use_rx_sg) {
if (qeth_create_skb_frag(qethbuffer, element,
- &skb, offset, &frag, data_len))
+ &skb, offset, data_len))
goto no_mem;
} else {
skb_put_data(skb, data_ptr, data_len);
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 10/13] s390/qeth: consolidate skb allocation
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
Move the allocation of SG skbs into the main path. This allows for
a little code sharing, and handling ENOMEM from within one place.
As side effect, L2 SG skbs now get the proper amount of additional
headroom (read: zero) instead of the hard-coded ETH_HLEN.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 71 +++++++++++++++++----------------------
1 file changed, 31 insertions(+), 40 deletions(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 1cf4e066955f..23b439fb5f2c 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -5170,41 +5170,27 @@ int qeth_core_hardsetup_card(struct qeth_card *card)
}
EXPORT_SYMBOL_GPL(qeth_core_hardsetup_card);
-static int qeth_create_skb_frag(struct qeth_qdio_buffer *qethbuffer,
- struct qdio_buffer_element *element,
- struct sk_buff **pskb, int offset, int data_len)
+static void qeth_create_skb_frag(struct qdio_buffer_element *element,
+ struct sk_buff *skb, int offset, int data_len)
{
struct page *page = virt_to_page(element->addr);
unsigned int next_frag;
- if (*pskb == NULL) {
- if (qethbuffer->rx_skb) {
- /* only if qeth_card.options.cq == QETH_CQ_ENABLED */
- *pskb = qethbuffer->rx_skb;
- qethbuffer->rx_skb = NULL;
- } else {
- *pskb = dev_alloc_skb(QETH_RX_PULL_LEN + ETH_HLEN);
- if (!(*pskb))
- return -ENOMEM;
- }
+ /* first fill the linear space */
+ if (!skb->len) {
+ unsigned int linear = min(data_len, skb_tailroom(skb));
- skb_reserve(*pskb, ETH_HLEN);
- if (data_len <= QETH_RX_PULL_LEN) {
- skb_put_data(*pskb, element->addr + offset, data_len);
- return 0;
- } else {
- skb_put_data(*pskb, element->addr + offset,
- QETH_RX_PULL_LEN);
- data_len -= QETH_RX_PULL_LEN;
- offset += QETH_RX_PULL_LEN;
- /* fall through to add page frag for remaining data */
- }
+ skb_put_data(skb, element->addr + offset, linear);
+ data_len -= linear;
+ if (!data_len)
+ return;
+ offset += linear;
+ /* fall through to add page frag for remaining data */
}
- next_frag = skb_shinfo(*pskb)->nr_frags;
+ next_frag = skb_shinfo(skb)->nr_frags;
get_page(page);
- skb_add_rx_frag(*pskb, next_frag, page, offset, data_len, data_len);
- return 0;
+ skb_add_rx_frag(skb, next_frag, page, offset, data_len, data_len);
}
static inline int qeth_is_last_sbale(struct qdio_buffer_element *sbale)
@@ -5220,7 +5206,7 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
struct qdio_buffer_element *element = *__element;
struct qdio_buffer *buffer = qethbuffer->buffer;
int offset = *__offset;
- struct sk_buff *skb = NULL;
+ struct sk_buff *skb;
int skb_len = 0;
void *data_ptr;
int data_len;
@@ -5261,27 +5247,32 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
if (((skb_len >= card->options.rx_sg_cb) &&
(!(card->info.type == QETH_CARD_TYPE_OSN)) &&
(!atomic_read(&card->force_alloc_skb))) ||
- (card->options.cq == QETH_CQ_ENABLED)) {
+ (card->options.cq == QETH_CQ_ENABLED))
use_rx_sg = 1;
+
+ if (use_rx_sg && qethbuffer->rx_skb) {
+ /* QETH_CQ_ENABLED only: */
+ skb = qethbuffer->rx_skb;
+ qethbuffer->rx_skb = NULL;
} else {
- skb = dev_alloc_skb(skb_len + headroom);
- if (!skb)
- goto no_mem;
- if (headroom)
- skb_reserve(skb, headroom);
+ unsigned int linear = (use_rx_sg) ? QETH_RX_PULL_LEN : skb_len;
+
+ skb = dev_alloc_skb(linear + headroom);
}
+ if (!skb)
+ goto no_mem;
+ if (headroom)
+ skb_reserve(skb, headroom);
data_ptr = element->addr + offset;
while (skb_len) {
data_len = min(skb_len, (int)(element->length - offset));
if (data_len) {
- if (use_rx_sg) {
- if (qeth_create_skb_frag(qethbuffer, element,
- &skb, offset, data_len))
- goto no_mem;
- } else {
+ if (use_rx_sg)
+ qeth_create_skb_frag(element, skb, offset,
+ data_len);
+ else
skb_put_data(skb, data_ptr, data_len);
- }
}
skb_len -= data_len;
if (skb_len) {
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 07/13] s390/qeth: don't verify device when setting MAC address
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
There's no reason why l2_set_mac_address() should ever be called for
a netdevice that's not owned by qeth. It's certainly not required for
VLAN devices, which have their own netdev_ops.
Also:
1) we don't do such validation for any of the other netdev_ops routines.
2) the code in question clearly has never been actually exercised;
it's broken. After determining that the device is not owned
by qeth, it would still use dev->ml_priv to write a qeth trace entry.
Remove the check, and its helper that walked the global card list.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_l2_main.c | 23 -----------------------
1 file changed, 23 deletions(-)
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 7b61c2ef4c74..87aa8c2ab5b0 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -38,24 +38,6 @@ static void qeth_l2_vnicc_init(struct qeth_card *card);
static bool qeth_l2_vnicc_recover_timeout(struct qeth_card *card, u32 vnicc,
u32 *timeout);
-static int qeth_l2_verify_dev(struct net_device *dev)
-{
- struct qeth_card *card;
- unsigned long flags;
- int rc = 0;
-
- read_lock_irqsave(&qeth_core_card_list.rwlock, flags);
- list_for_each_entry(card, &qeth_core_card_list.list, list) {
- if (card->dev == dev) {
- rc = QETH_REAL_CARD;
- break;
- }
- }
- read_unlock_irqrestore(&qeth_core_card_list.rwlock, flags);
-
- return rc;
-}
-
static struct net_device *qeth_l2_netdev_by_devno(unsigned char *read_dev_no)
{
struct qeth_card *card;
@@ -568,11 +550,6 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
QETH_CARD_TEXT(card, 3, "setmac");
- if (qeth_l2_verify_dev(dev) != QETH_REAL_CARD) {
- QETH_CARD_TEXT(card, 3, "setmcINV");
- return -EOPNOTSUPP;
- }
-
if (card->info.type == QETH_CARD_TYPE_OSN ||
card->info.type == QETH_CARD_TYPE_OSM ||
card->info.type == QETH_CARD_TYPE_OSX) {
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 06/13] s390/qeth: clean up initial MTU determination
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
1. Drop the support for Token Ring,
2. use the ETH_DATA_LEN macro for the default L2 MTU,
3. handle OSM via the default case (as OSM is L2-only), and
4. document why the L3 MTU is reduced.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 735b03cae727..acf16fa75c63 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -2219,18 +2219,12 @@ static int qeth_get_initial_mtu_for_card(struct qeth_card *card)
case QETH_CARD_TYPE_IQD:
return card->info.max_mtu;
case QETH_CARD_TYPE_OSD:
- switch (card->info.link_type) {
- case QETH_LINK_TYPE_HSTR:
- case QETH_LINK_TYPE_LANE_TR:
- return 2000;
- default:
- return card->options.layer2 ? 1500 : 1492;
- }
- case QETH_CARD_TYPE_OSM:
case QETH_CARD_TYPE_OSX:
- return card->options.layer2 ? 1500 : 1492;
+ if (!card->options.layer2)
+ return ETH_DATA_LEN - 8; /* L3: allow for LLC + SNAP */
+ /* fall through */
default:
- return 1500;
+ return ETH_DATA_LEN;
}
}
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 04/13] s390/qeth: use kstrtobool() in qeth_bridgeport_hostnotification_store()
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
The sysfs enabled value is a boolean, so kstrtobool() is a better fit
for parsing the input string since it does the range checking for us.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_l2_sys.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/s390/net/qeth_l2_sys.c b/drivers/s390/net/qeth_l2_sys.c
index 4608daedb204..470a4e5f3c62 100644
--- a/drivers/s390/net/qeth_l2_sys.c
+++ b/drivers/s390/net/qeth_l2_sys.c
@@ -146,18 +146,15 @@ static ssize_t qeth_bridgeport_hostnotification_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct qeth_card *card = dev_get_drvdata(dev);
- int rc = 0;
- int enable;
+ bool enable;
+ int rc;
if (!card)
return -EINVAL;
- if (sysfs_streq(buf, "0"))
- enable = 0;
- else if (sysfs_streq(buf, "1"))
- enable = 1;
- else
- return -EINVAL;
+ rc = kstrtobool(buf, &enable);
+ if (rc)
+ return rc;
mutex_lock(&card->conf_mutex);
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 05/13] s390/qeth: fix early exit from error path
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
When the allocation of the addr buffer fails, we need to free
our refcount on the inetdevice before returning.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_l3_main.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 270ac9515f6b..aadd384316a3 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1553,7 +1553,7 @@ static void qeth_l3_free_vlan_addresses4(struct qeth_card *card,
addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV4);
if (!addr)
- return;
+ goto out;
spin_lock_bh(&card->ip_lock);
@@ -1567,6 +1567,7 @@ static void qeth_l3_free_vlan_addresses4(struct qeth_card *card,
spin_unlock_bh(&card->ip_lock);
kfree(addr);
+out:
in_dev_put(in_dev);
}
@@ -1591,7 +1592,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card,
addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV6);
if (!addr)
- return;
+ goto out;
spin_lock_bh(&card->ip_lock);
@@ -1606,6 +1607,7 @@ static void qeth_l3_free_vlan_addresses6(struct qeth_card *card,
spin_unlock_bh(&card->ip_lock);
kfree(addr);
+out:
in6_dev_put(in6_dev);
#endif /* CONFIG_QETH_IPV6 */
}
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 03/13] s390/qeth: remove duplicated device matching
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
With commit "s390/ccwgroup: tie a ccwgroup driver to its ccw driver",
the ccwgroup core now ensures that a qeth group device only consists of
ccw devices which are supported by qeth. Therefore remove qeth's
internal device matching, and use .driver_info to determine the card
type.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core.h | 14 --------------
drivers/s390/net/qeth_core_main.c | 40 ++++++++-------------------------------
drivers/s390/net/qeth_core_mpc.h | 1 -
drivers/s390/net/qeth_core_sys.c | 4 +---
4 files changed, 9 insertions(+), 50 deletions(-)
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 3b6aa0c48221..dbdf09a1299a 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -231,20 +231,6 @@ static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa,
#define QETH_IDX_FUNC_LEVEL_OSD 0x0101
#define QETH_IDX_FUNC_LEVEL_IQD 0x4108
-#define QETH_MODELLIST_ARRAY \
- {{0x1731, 0x01, 0x1732, QETH_CARD_TYPE_OSD, QETH_MAX_QUEUES, 0}, \
- {0x1731, 0x05, 0x1732, QETH_CARD_TYPE_IQD, QETH_MAX_QUEUES, 0x103}, \
- {0x1731, 0x06, 0x1732, QETH_CARD_TYPE_OSN, QETH_MAX_QUEUES, 0}, \
- {0x1731, 0x02, 0x1732, QETH_CARD_TYPE_OSM, QETH_MAX_QUEUES, 0}, \
- {0x1731, 0x02, 0x1732, QETH_CARD_TYPE_OSX, QETH_MAX_QUEUES, 0}, \
- {0, 0, 0, 0, 0, 0} }
-#define QETH_CU_TYPE_IND 0
-#define QETH_CU_MODEL_IND 1
-#define QETH_DEV_TYPE_IND 2
-#define QETH_DEV_MODEL_IND 3
-#define QETH_QUEUE_NO_IND 4
-#define QETH_MULTICAST_IND 5
-
#define QETH_REAL_CARD 1
#define QETH_VLAN_CARD 2
#define QETH_BUFSIZE 4096
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index e10e5b8d476c..735b03cae727 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -52,7 +52,6 @@ EXPORT_SYMBOL_GPL(qeth_core_header_cache);
static struct kmem_cache *qeth_qdio_outbuf_cache;
static struct device *qeth_core_root_dev;
-static unsigned int known_devices[][6] = QETH_MODELLIST_ARRAY;
static struct lock_class_key qdio_out_skb_queue_key;
static struct mutex qeth_mod_mutex;
@@ -1386,6 +1385,7 @@ static void qeth_init_qdio_info(struct qeth_card *card)
QETH_DBF_TEXT(SETUP, 4, "intqdinf");
atomic_set(&card->qdio.state, QETH_QDIO_UNINITIALIZED);
/* inbound */
+ card->qdio.no_in_queues = 1;
card->qdio.in_buf_size = QETH_IN_BUF_SIZE_DEFAULT;
if (card->info.type == QETH_CARD_TYPE_IQD)
card->qdio.init_pool.buf_count = QETH_IN_BUF_COUNT_HSDEFAULT;
@@ -1519,34 +1519,17 @@ static struct qeth_card *qeth_alloc_card(void)
return NULL;
}
-static int qeth_determine_card_type(struct qeth_card *card)
+static void qeth_determine_card_type(struct qeth_card *card)
{
- int i = 0;
-
QETH_DBF_TEXT(SETUP, 2, "detcdtyp");
card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT;
card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
- while (known_devices[i][QETH_DEV_MODEL_IND]) {
- if ((CARD_RDEV(card)->id.dev_type ==
- known_devices[i][QETH_DEV_TYPE_IND]) &&
- (CARD_RDEV(card)->id.dev_model ==
- known_devices[i][QETH_DEV_MODEL_IND])) {
- card->info.type = known_devices[i][QETH_DEV_MODEL_IND];
- card->qdio.no_out_queues =
- known_devices[i][QETH_QUEUE_NO_IND];
- card->qdio.no_in_queues = 1;
- card->info.is_multicast_different =
- known_devices[i][QETH_MULTICAST_IND];
- qeth_update_from_chp_desc(card);
- return 0;
- }
- i++;
- }
- card->info.type = QETH_CARD_TYPE_UNKNOWN;
- dev_err(&card->gdev->dev, "The adapter hardware is of an "
- "unknown type\n");
- return -ENOENT;
+ card->info.type = CARD_RDEV(card)->id.driver_info;
+ card->qdio.no_out_queues = QETH_MAX_QUEUES;
+ if (card->info.type == QETH_CARD_TYPE_IQD)
+ card->info.is_multicast_different = 0x0103;
+ qeth_update_from_chp_desc(card);
}
static int qeth_clear_channel(struct qeth_channel *channel)
@@ -2233,8 +2216,6 @@ static int qeth_cm_setup(struct qeth_card *card)
static int qeth_get_initial_mtu_for_card(struct qeth_card *card)
{
switch (card->info.type) {
- case QETH_CARD_TYPE_UNKNOWN:
- return 1500;
case QETH_CARD_TYPE_IQD:
return card->info.max_mtu;
case QETH_CARD_TYPE_OSD:
@@ -2279,7 +2260,6 @@ static int qeth_mtu_is_valid(struct qeth_card *card, int mtu)
return ((mtu >= 576) &&
(mtu <= card->info.max_mtu));
case QETH_CARD_TYPE_OSN:
- case QETH_CARD_TYPE_UNKNOWN:
default:
return 1;
}
@@ -5724,11 +5704,7 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
gdev->cdev[1]->handler = qeth_irq;
gdev->cdev[2]->handler = qeth_irq;
- rc = qeth_determine_card_type(card);
- if (rc) {
- QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc);
- goto err_card;
- }
+ qeth_determine_card_type(card);
rc = qeth_setup_card(card);
if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc);
diff --git a/drivers/s390/net/qeth_core_mpc.h b/drivers/s390/net/qeth_core_mpc.h
index 6a7654df6e78..413f0f268b17 100644
--- a/drivers/s390/net/qeth_core_mpc.h
+++ b/drivers/s390/net/qeth_core_mpc.h
@@ -44,7 +44,6 @@ extern unsigned char IPA_PDU_HEADER[];
#define IPA_CMD_PRIM_VERSION_NO 0x01
enum qeth_card_types {
- QETH_CARD_TYPE_UNKNOWN = 0,
QETH_CARD_TYPE_OSD = 1,
QETH_CARD_TYPE_IQD = 5,
QETH_CARD_TYPE_OSN = 6,
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c
index d1ee9e30c68b..b22ed2a57acd 100644
--- a/drivers/s390/net/qeth_core_sys.c
+++ b/drivers/s390/net/qeth_core_sys.c
@@ -475,10 +475,8 @@ static ssize_t qeth_dev_isolation_store(struct device *dev,
return -EINVAL;
mutex_lock(&card->conf_mutex);
- /* check for unknown, too, in case we do not yet know who we are */
if (card->info.type != QETH_CARD_TYPE_OSD &&
- card->info.type != QETH_CARD_TYPE_OSX &&
- card->info.type != QETH_CARD_TYPE_UNKNOWN) {
+ card->info.type != QETH_CARD_TYPE_OSX) {
rc = -EOPNOTSUPP;
dev_err(&card->gdev->dev, "Adapter does not "
"support QDIO data connection isolation\n");
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 01/13] s390/qeth: rely on kernel for feature recovery
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
When recovering a device, qeth needs to re-run the IPA commands that
enable all previously active HW features.
Instead of duplicating qeth_set_features(), let netdev_update_features()
recover the missing HW features from dev->wanted_features.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core.h | 2 +-
drivers/s390/net/qeth_core_main.c | 40 ++++++++++++++++++---------------------
2 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 91fcadbede80..3b6aa0c48221 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -998,7 +998,7 @@ struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *,
__u16, __u16,
enum qeth_prot_versions);
int qeth_set_features(struct net_device *, netdev_features_t);
-int qeth_recover_features(struct net_device *);
+void qeth_recover_features(struct net_device *dev);
netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t);
int qeth_vm_request_mac(struct qeth_card *card);
int qeth_push_hdr(struct sk_buff *skb, struct qeth_hdr **hdr, unsigned int len);
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 68e118f1202e..e10e5b8d476c 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -6403,32 +6403,29 @@ static int qeth_set_ipa_tso(struct qeth_card *card, int on)
return rc;
}
-/* try to restore device features on a device after recovery */
-int qeth_recover_features(struct net_device *dev)
+#define QETH_HW_FEATURES (NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_TSO)
+
+/**
+ * qeth_recover_features() - Restore device features after recovery
+ * @dev: the recovering net_device
+ *
+ * Caller must hold rtnl lock.
+ */
+void qeth_recover_features(struct net_device *dev)
{
+ netdev_features_t features = dev->features;
struct qeth_card *card = dev->ml_priv;
- netdev_features_t recover = dev->features;
-
- if (recover & NETIF_F_IP_CSUM) {
- if (qeth_set_ipa_csum(card, 1, IPA_OUTBOUND_CHECKSUM))
- recover ^= NETIF_F_IP_CSUM;
- }
- if (recover & NETIF_F_RXCSUM) {
- if (qeth_set_ipa_csum(card, 1, IPA_INBOUND_CHECKSUM))
- recover ^= NETIF_F_RXCSUM;
- }
- if (recover & NETIF_F_TSO) {
- if (qeth_set_ipa_tso(card, 1))
- recover ^= NETIF_F_TSO;
- }
- if (recover == dev->features)
- return 0;
+ /* force-off any feature that needs an IPA sequence.
+ * netdev_update_features() will restart them.
+ */
+ dev->features &= ~QETH_HW_FEATURES;
+ netdev_update_features(dev);
+ if (features == dev->features)
+ return;
dev_warn(&card->gdev->dev,
"Device recovery failed to restore all offload features\n");
- dev->features = recover;
- return -EIO;
}
EXPORT_SYMBOL_GPL(qeth_recover_features);
@@ -6485,8 +6482,7 @@ netdev_features_t qeth_fix_features(struct net_device *dev,
/* if the card isn't up, remove features that require hw changes */
if (card->state == CARD_STATE_DOWN ||
card->state == CARD_STATE_RECOVER)
- features = features & ~(NETIF_F_IP_CSUM | NETIF_F_RXCSUM |
- NETIF_F_TSO);
+ features &= ~QETH_HW_FEATURES;
QETH_DBF_HEX(SETUP, 2, &features, sizeof(features));
return features;
}
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 02/13] s390/drivers: use setup_timer
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>
From: Allen Pais <allen.lkml@gmail.com>
Use setup_timer function instead of initializing timer with the
function and data fields.
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/fsm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/s390/net/fsm.c b/drivers/s390/net/fsm.c
index e5dea67f902e..8c14c6c3ad3d 100644
--- a/drivers/s390/net/fsm.c
+++ b/drivers/s390/net/fsm.c
@@ -170,9 +170,7 @@ fsm_addtimer(fsm_timer *this, int millisec, int event, void *arg)
this->fi->name, this, millisec);
#endif
- init_timer(&this->tl);
- this->tl.function = (void *)fsm_expire_timer;
- this->tl.data = (long)this;
+ setup_timer(&this->tl, (void *)fsm_expire_timer, (long)this);
this->expire_event = event;
this->event_arg = arg;
this->tl.expires = jiffies + (millisec * HZ) / 1000;
@@ -191,9 +189,7 @@ fsm_modtimer(fsm_timer *this, int millisec, int event, void *arg)
#endif
del_timer(&this->tl);
- init_timer(&this->tl);
- this->tl.function = (void *)fsm_expire_timer;
- this->tl.data = (long)this;
+ setup_timer(&this->tl, (void *)fsm_expire_timer, (long)this);
this->expire_event = event;
this->event_arg = arg;
this->tl.expires = jiffies + (millisec * HZ) / 1000;
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 00/13] s390/net: updates 2017-10-18
From: Julian Wiedmann @ 2017-10-18 15:40 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
Hi Dave,
please apply some additional robustness fixes and cleanups for 4.15.
Thanks,
Julian
Allen Pais (1):
s390/drivers: use setup_timer
Andy Shevchenko (1):
s390/qeth: use kstrtobool() in
qeth_bridgeport_hostnotification_store()
Julian Wiedmann (11):
s390/qeth: rely on kernel for feature recovery
s390/qeth: remove duplicated device matching
s390/qeth: fix early exit from error path
s390/qeth: clean up initial MTU determination
s390/qeth: don't verify device when setting MAC address
s390/qeth: no VLAN support on OSM
s390/qeth: clean up page frag creation
s390/qeth: consolidate skb allocation
s390/qeth: try harder to get packets from RX buffer
s390/qeth: support GRO flush timer
s390/qeth: don't dump control cmd twice
drivers/s390/net/fsm.c | 8 +-
drivers/s390/net/qeth_core.h | 16 +---
drivers/s390/net/qeth_core_main.c | 187 ++++++++++++++------------------------
drivers/s390/net/qeth_core_mpc.h | 1 -
drivers/s390/net/qeth_core_sys.c | 4 +-
drivers/s390/net/qeth_l2_main.c | 40 ++------
drivers/s390/net/qeth_l2_sys.c | 13 +--
drivers/s390/net/qeth_l3_main.c | 6 +-
8 files changed, 85 insertions(+), 190 deletions(-)
--
2.13.5
^ permalink raw reply
* [PATCH net-next] net/sched: Set the net-device for egress device instance
From: Or Gerlitz @ 2017-10-18 15:38 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, mlxsw, Or Gerlitz
Currently the netdevice field is not set and the egdev instance
is not functional, fix that.
Fixes: 3f55bdda8df ('net: sched: introduce per-egress action device callbacks')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
---
net/sched/act_api.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index ac97db9..c67b820 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -1300,6 +1300,7 @@ tcf_action_egdev_get(const struct net_device *dev)
if (!egdev)
return NULL;
INIT_LIST_HEAD(&egdev->cb_list);
+ egdev->dev = dev;
tan = net_generic(dev_net(dev), tcf_action_net_id);
rhashtable_insert_fast(&tan->egdev_ht, &egdev->ht_node,
tcf_action_egdev_ht_params);
--
2.3.7
^ permalink raw reply related
* Re: [PATCH net 0/3] Fix for BPF devmap percpu allocation splat
From: Daniel Borkmann @ 2017-10-18 15:31 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Tejun Heo, David S. Miller, Alexei Starovoitov, John Fastabend,
Mark Rutland, Richard Weinberger, sp3485, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Dennis Zhou
In-Reply-To: <CAADnVQLk2gu1j3PXjDCfF1hh09-5Ak_8Xd5hq48xTAJNR0Xb=Q@mail.gmail.com>
On 10/18/2017 05:28 PM, Alexei Starovoitov wrote:
> On Wed, Oct 18, 2017 at 7:22 AM, Daniel Borkmann <daniel@iogearbox.net> wrote:
>>
>> Higher prio imo would be to make the allocation itself faster
>> though, I remember we talked about this back in May wrt hashtable,
>> but I kind of lost track whether there was an update on this in
>> the mean time. ;-)
>
> new percpu allocator by Dennis fixed those issues. It's in 4.14
Ah, perfect!
^ 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