* Re: [PATCH net-next 4/6] net: use core MTU range checking in core net infra
From: Jiri Benc @ 2016-10-19 12:17 UTC (permalink / raw)
To: Jarod Wilson
Cc: linux-kernel, netdev, Nicolas Dichtel, Hannes Frederic Sowa,
Tom Herbert, Daniel Borkmann, Alexander Duyck, Paolo Abeni,
WANG Cong, Roopa Prabhu, Pravin B Shelar, Sabrina Dubroca,
Patrick McHardy, Stephen Hemminger, Pravin Shelar
In-Reply-To: <20161019023333.15760-5-jarod@redhat.com>
On Tue, 18 Oct 2016 22:33:31 -0400, Jarod Wilson wrote:
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -2367,43 +2367,31 @@ static void vxlan_set_multicast_list(struct net_device *dev)
> {
> }
>
> -static int __vxlan_change_mtu(struct net_device *dev,
> - struct net_device *lowerdev,
> - struct vxlan_rdst *dst, int new_mtu, bool strict)
> +static int vxlan_change_mtu(struct net_device *dev, int new_mtu)
> {
> - int max_mtu = IP_MAX_MTU;
> -
> - if (lowerdev)
> - max_mtu = lowerdev->mtu;
> + struct vxlan_dev *vxlan = netdev_priv(dev);
> + struct vxlan_rdst *dst = &vxlan->default_dst;
> + struct net_device *lowerdev = __dev_get_by_index(vxlan->net,
> + dst->remote_ifindex);
> + bool use_ipv6 = false;
>
> if (dst->remote_ip.sa.sa_family == AF_INET6)
> - max_mtu -= VXLAN6_HEADROOM;
> - else
> - max_mtu -= VXLAN_HEADROOM;
> -
> - if (new_mtu < 68)
> - return -EINVAL;
> + use_ipv6 = true;
>
> - if (new_mtu > max_mtu) {
> - if (strict)
> + /* We re-check this, because users *could* alter the mtu of the
> + * lower device after we've initialized dev->max_mtu.
> + */
> + if (lowerdev) {
> + dev->max_mtu = lowerdev->mtu -
> + (use_ipv6 ? VXLAN6_HEADROOM : VXLAN_HEADROOM);
> + if (new_mtu > dev->max_mtu)
> return -EINVAL;
> -
> - new_mtu = max_mtu;
> }
>
> dev->mtu = new_mtu;
> return 0;
> }
Sorry for the silly question, how does the min_mtu and max_mtu stuff
works? I noticed your patches but haven't looked in depth into them.
When the ndo_change_mtu callback is defined, is the dev->min_mtu and
dev->max_mtu checked first and if the desired mtu is not within range,
ndo_change_mtu is not called?
Or does ndo_change_mtu override the checks?
In either case, the code does not look correct. In the first case,
increasing of lowerdev MTU wouldn't allow increasing of vxlan MTU
without deleting and recreating the vxlan interface. In the second
case, you're missing check against the min_mtu.
>
> -static int vxlan_change_mtu(struct net_device *dev, int new_mtu)
> -{
> - struct vxlan_dev *vxlan = netdev_priv(dev);
> - struct vxlan_rdst *dst = &vxlan->default_dst;
> - struct net_device *lowerdev = __dev_get_by_index(vxlan->net,
> - dst->remote_ifindex);
> - return __vxlan_change_mtu(dev, lowerdev, dst, new_mtu, true);
> -}
> -
> static int vxlan_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb)
> {
> struct vxlan_dev *vxlan = netdev_priv(dev);
> @@ -2795,6 +2783,10 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev,
> vxlan_ether_setup(dev);
> }
>
> + /* MTU range: 68 - 65535 */
> + dev->min_mtu = 68;
> + dev->max_mtu = IP_MAX_MTU;
> +
> vxlan->net = src_net;
>
> dst->remote_vni = conf->vni;
> @@ -2837,8 +2829,11 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev,
> }
> #endif
>
> - if (!conf->mtu)
> - dev->mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM : VXLAN_HEADROOM);
> + if (!conf->mtu) {
> + dev->mtu = lowerdev->mtu -
> + (use_ipv6 ? VXLAN6_HEADROOM : VXLAN_HEADROOM);
> + dev->max_mtu = dev->mtu;
> + }
>
> needed_headroom = lowerdev->hard_header_len;
> } else if (vxlan_addr_multicast(&dst->remote_ip)) {
> @@ -2847,9 +2842,14 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev,
> }
>
> if (conf->mtu) {
> - err = __vxlan_change_mtu(dev, lowerdev, dst, conf->mtu, false);
> - if (err)
> - return err;
> + if (lowerdev)
> + dev->max_mtu = lowerdev->mtu;
> + dev->max_mtu -= (use_ipv6 ? VXLAN6_HEADROOM : VXLAN_HEADROOM);
> +
> + dev->mtu = conf->mtu;
> +
> + if (conf->mtu > dev->max_mtu)
> + dev->mtu = dev->max_mtu;
> }
You removed the check for min_mtu but it's needed here. The conf->mtu
value comes from the user space and can be anything.
>
> if (use_ipv6 || conf->flags & VXLAN_F_COLLECT_METADATA)
Jiri
^ permalink raw reply
* RE: [PATCH 4/9] ipv6: sr: add core files for SR HMAC support
From: David Laight @ 2016-10-19 14:43 UTC (permalink / raw)
To: 'zhuyj', David Lebrun; +Cc: netdev
In-Reply-To: <CAD=hENedNvTjBqcotySDuKym5VzTXghLYHr_xGEMu3D+5rcxHg@mail.gmail.com>
From: zhuyj
> Sent: 19 October 2016 14:21
> __attribute__((packed)) is potentially unsafe on some systems. The
> symptom probably won't show up on an x86, which just makes the problem
> more insidious; testing on x86 systems won't reveal the problem. (On
> the x86, misaligned accesses are handled in hardware; if you
> dereference an int* pointer that points to an odd address, it will be
> a little slower than if it were properly aligned, but you'll get the
> correct result.)
>
> On some other systems, such as SPARC, attempting to access a
> misaligned int object causes a bus error, crashing the program.
__attribute__((packed)) causes the compiler to generate byte memory
access and shifts to access the unaligned data.
You don't get a fault, just rather more instructions that you had in mind.
You shouldn't really specify 'packed' unless there are real reasons
why the data structure will appear on misaligned addresses.
David
^ permalink raw reply
* Re: net/ipv6: potential deadlock in do_ipv6_setsockopt
From: Baozeng Ding @ 2016-10-19 7:45 UTC (permalink / raw)
To: Cong Wang; +Cc: Linux Kernel Network Developers
In-Reply-To: <ec7e340c-132f-549d-9c30-b6e903cc7666@gmail.com>
It fixes the issue for me.
Tested-by: Baozeng Ding <sploving1@gmail.com>
On 2016/10/17 17:54, Baozeng Ding wrote:
> Applied the patch to my test tree. I will tell you the result a few days later. Thank you.
>
> On 2016/10/17 2:50, Cong Wang wrote:
>> On Sun, Oct 16, 2016 at 6:34 AM, Baozeng Ding <sploving1@gmail.com> wrote:
>>> Possible unsafe locking scenario:
>>>
>>> CPU0 CPU1
>>> ---- ----
>>> lock([ 165.136033] sk_lock-AF_INET6
>>> );
>>> lock([ 165.136033] rtnl_mutex
>>> );
>>> lock([ 165.136033] sk_lock-AF_INET6
>>> );
>>> lock([ 165.136033] rtnl_mutex
>>> );
>>>
>>> *** DEADLOCK ***
>>
>> This is caused by the conditional rtnl locking in do_ipv6_setsockopt().
>> It looks like we miss the case of IPV6_ADDRFORM.
>>
>> Please try the attached patch.
>>
^ permalink raw reply
* Re: net/ipv6: potential deadlock in do_ipv6_setsockopt
From: Baozeng Ding @ 2016-10-19 13:44 UTC (permalink / raw)
To: Cong Wang, sploving1; +Cc: Linux Kernel Network Developers
In-Reply-To: <ec7e340c-132f-549d-9c30-b6e903cc7666@gmail.com>
It fixes the issue for me.
Tested-by: Baozeng Ding <sploving1@gmail.com>
On 2016/10/17 17:54, Baozeng Ding wrote:
> Applied the patch to my test tree. I will tell you the result a few days later. Thank you.
>
> On 2016/10/17 2:50, Cong Wang wrote:
>> On Sun, Oct 16, 2016 at 6:34 AM, Baozeng Ding <sploving1@gmail.com> wrote:
>>> Possible unsafe locking scenario:
>>>
>>> CPU0 CPU1
>>> ---- ----
>>> lock([ 165.136033] sk_lock-AF_INET6
>>> );
>>> lock([ 165.136033] rtnl_mutex
>>> );
>>> lock([ 165.136033] sk_lock-AF_INET6
>>> );
>>> lock([ 165.136033] rtnl_mutex
>>> );
>>>
>>> *** DEADLOCK ***
>>
>> This is caused by the conditional rtnl locking in do_ipv6_setsockopt().
>> It looks like we miss the case of IPV6_ADDRFORM.
>>
>> Please try the attached patch.
>>
^ permalink raw reply
* Re: [RFC 5/6] qedi: Add support for iSCSI session management.
From: Johannes Thumshirn @ 2016-10-19 13:28 UTC (permalink / raw)
To: manish.rangankar
Cc: lduncan, cleech, martin.petersen, jejb, linux-scsi, netdev,
Yuval.Mintz, QLogic-Storage-Upstream, Nilesh Javali,
Adheer Chandravanshi, Chad Dupuis, Saurav Kashyap, Arun Easi
In-Reply-To: <1476853273-22960-6-git-send-email-manish.rangankar@cavium.com>
On Wed, Oct 19, 2016 at 01:01:12AM -0400, manish.rangankar@cavium.com wrote:
> From: Manish Rangankar <manish.rangankar@cavium.com>
>
> This patch adds support for iscsi_transport LLD Login,
> Logout, NOP-IN/NOP-OUT, Async, Reject PDU processing
> and Firmware async event handling support.
>
> Signed-off-by: Nilesh Javali <nilesh.javali@cavium.com>
> Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
> Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
> Signed-off-by: Saurav Kashyap <saurav.kashyap@cavium.com>
> Signed-off-by: Arun Easi <arun.easi@cavium.com>
> Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
> ---
[...]
> +void qedi_iscsi_unmap_sg_list(struct qedi_cmd *cmd)
> +{
> + struct scsi_cmnd *sc = cmd->scsi_cmd;
> +
> + if (cmd->io_tbl.sge_valid && sc) {
> + scsi_dma_unmap(sc);
> + cmd->io_tbl.sge_valid = 0;
> + }
> +}
Maybe set sge_valid to 0 and then call scsi_dma_unmap(). I don't know if it's
really racy but it looks like it is.
[...]
> +static void qedi_process_text_resp(struct qedi_ctx *qedi,
> + union iscsi_cqe *cqe,
> + struct iscsi_task *task,
> + struct qedi_conn *qedi_conn)
> +{
> + struct iscsi_conn *conn = qedi_conn->cls_conn->dd_data;
> + struct iscsi_session *session = conn->session;
> + struct iscsi_task_context *task_ctx;
> + struct iscsi_text_rsp *resp_hdr_ptr;
> + struct iscsi_text_response_hdr *cqe_text_response;
> + struct qedi_cmd *cmd;
> + int pld_len;
> + u32 *tmp;
> +
> + cmd = (struct qedi_cmd *)task->dd_data;
> + task_ctx = (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks,
> + cmd->task_id);
No need to cast here, qedi_get_task_mem() returns void *.
[...]
> + cqe_login_response = &cqe->cqe_common.iscsi_hdr.login_response;
> + task_ctx = (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks,
> + cmd->task_id);
Same here.
[...]
> + }
> +
> + pbl = (struct scsi_bd *)qedi->bdq_pbl;
> + pbl += (qedi->bdq_prod_idx % qedi->rq_num_entries);
> + pbl->address.hi =
> + cpu_to_le32((u32)(((u64)(qedi->bdq[idx].buf_dma)) >> 32));
> + pbl->address.lo =
> + cpu_to_le32(((u32)(((u64)(qedi->bdq[idx].buf_dma)) &
> + 0xffffffff)));
Is this LISP or C?
> + QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN,
> + "pbl [0x%p] pbl->address hi [0x%llx] lo [0x%llx] idx [%d]\n",
> + pbl, pbl->address.hi, pbl->address.lo, idx);
> + pbl->opaque.hi = cpu_to_le32((u32)(((u64)0) >> 32));
Isn't this plain pbl->opaque.hi = 0; ?
> + pbl->opaque.lo = cpu_to_le32(((u32)(((u64)idx) & 0xffffffff)));
> +
[...]
> + switch (comp_type) {
> + case ISCSI_CQE_TYPE_SOLICITED:
> + case ISCSI_CQE_TYPE_SOLICITED_WITH_SENSE:
> + fw_task_ctx =
> + (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks,
> + cqe->cqe_solicited.itid);
Again, no cast needed.
[...]
> + writel(*(u32 *)&dbell, qedi_conn->ep->p_doorbell);
> + /* Make sure fw idx is coherent */
> + wmb();
> + mmiowb();
Isn't either wmb() or mmiowb() enough?
[..]
> +
> + fw_task_ctx =
> + (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks, tid);
Cast again.
[...]
> + fw_task_ctx =
> + (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks, tid);
^^
[...]
> + fw_task_ctx =
> + (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks, tid);
[...]
> + fw_task_ctx =
> + (struct iscsi_task_context *)qedi_get_task_mem(&qedi->tasks, tid);
> +
[...]
> +
> + qedi = (struct qedi_ctx *)iscsi_host_priv(shost);
Same goes for iscsi_host_priv();
[...]
> + ret = wait_event_interruptible_timeout(qedi_ep->ofld_wait,
> + ((qedi_ep->state ==
> + EP_STATE_OFLDCONN_FAILED) ||
> + (qedi_ep->state ==
> + EP_STATE_OFLDCONN_COMPL)),
> + msecs_to_jiffies(timeout_ms));
Maybe:
#define QEDI_OLDCON_STATE(q) ((q)->state == EP_STATE_OFLDCONN_FAILED || \
(q)->state == EP_STATE_OFLDCONN_COMPL)
ret = wait_event_interruptible_timeout(qedi_ep->ofld_wait,
QEDI_OLDCON_STATE(qedi_ep),
msec_to_jiffies(timeout_ms));
But that could be just me hating linewraps.
[...]
Thanks,
Johannes
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply
* [PATCH net] net/sched: act_mirred: Use passed lastuse argument
From: Or Gerlitz @ 2016-10-19 14:42 UTC (permalink / raw)
To: David S. Miller
Cc: Amir Vadai, jakub.kicinski, netdev, Paul Blakey, Or Gerlitz
From: Paul Blakey <paulb@mellanox.com>
stats_update callback is called by NIC drivers doing hardware
offloading of the mirred action. Lastuse is passed as argument
to specify when the stats was actually last updated and is not
always the current time.
Fixes: 9798e6fe4f9b ('net: act_mirred: allow statistic updates from offloaded actions')
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
net/sched/act_mirred.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 667dc38..6b07fba 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -207,8 +207,11 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
static void tcf_stats_update(struct tc_action *a, u64 bytes, u32 packets,
u64 lastuse)
{
- tcf_lastuse_update(&a->tcfa_tm);
+ struct tcf_mirred *m = to_mirred(a);
+ struct tcf_t *tm = &m->tcf_tm;
+
_bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), bytes, packets);
+ tm->lastuse = lastuse;
}
static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind,
--
2.3.7
^ permalink raw reply related
* Re: Need help with mdiobus_register and phy
From: Timur Tabi @ 2016-10-19 12:16 UTC (permalink / raw)
To: Zefir Kurtisi, Andrew Lunn; +Cc: Florian Fainelli, netdev
In-Reply-To: <dfff1abf-f506-bffa-8e09-edeebd753be5@neratec.com>
Zefir Kurtisi wrote:
> Ok then, if you can wait some days, I'll prepare and provide you a more detailed
> failure report to allow you testing if the issue happens with other NICs.
That sounds great.
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.
^ permalink raw reply
* Re: BUG: KASAN: use-after-free in udp_lib_get_port
From: Baozeng Ding @ 2016-10-19 7:36 UTC (permalink / raw)
To: Cong Wang; +Cc: network dev
In-Reply-To: <CAM_iQpVExpqdOXZp0Lw+4Nr2_9W24P2dQFdM=EoYwBkHtwDoPw@mail.gmail.com>
Hello all,
I hit some similiar bugs again:
BUG: KASAN: use-after-free in udp_lib_get_port+0x1573/0x1860 at addr ffff88002f163c60
Write of size 8 by task syz-executor/13510
CPU: 2 PID: 13510 Comm: syz-executor Not tainted 4.8.0+ #41
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
ffff880034ea7a68 ffffffff829f835b ffff88002f488b40 ffff88002f163c40
ffff88002f164350 ffff88003178154a ffff880034ea7a90 ffffffff8174d3cc
ffff880034ea7b20 ffff88002f163c00 ffff88002f488b40 ffff880034ea7b10
Call Trace:
[<ffffffff829f835b>] dump_stack+0xb3/0x118 /lib/dump_stack.c:15
[<ffffffff8174d3cc>] kasan_object_err+0x1c/0x70 /mm/kasan/report.c:156
[< inline >] print_address_description /mm/kasan/report.c:194
[<ffffffff8174d666>] kasan_report_error+0x1f6/0x4d0 /mm/kasan/report.c:283
[< inline >] kasan_report /mm/kasan/report.c:303
[<ffffffff8174db7e>] __asan_report_store8_noabort+0x3e/0x40 /mm/kasan/report.c:329
[< inline >] hlist_add_head_rcu /./include/linux/rculist.h:487
[<ffffffff850866e3>] udp_lib_get_port+0x1573/0x1860 /net/ipv4/udp.c:345
[<ffffffff8508b4f9>] udp_v4_get_port+0x139/0x180 /net/ipv4/udp.c:392
[<ffffffff850b2f7a>] inet_autobind+0xaa/0x180 /net/ipv4/af_inet.c:181
[<ffffffff850b3181>] inet_dgram_connect+0x131/0x1f0 /net/ipv4/af_inet.c:528
[<ffffffff84c4959e>] SYSC_connect+0x23e/0x2e0 /net/socket.c:1533
[<ffffffff84c4bd14>] SyS_connect+0x24/0x30 /net/socket.c:1514
[<ffffffff85e4d6c5>] entry_SYSCALL_64_fastpath+0x23/0xc6
Object at ffff88002f163c40, in cache UDPv6 size: 1496
Allocated:
PID = 13255
[ 1773.470431] [<ffffffff811ddcb6>] save_stack_trace+0x16/0x20
[ 1773.470431] [<ffffffff8174c736>] save_stack+0x46/0xd0
[ 1773.470431] [<ffffffff8174c9ad>] kasan_kmalloc+0xad/0xe0
[ 1773.470431] [<ffffffff8174cee2>] kasan_slab_alloc+0x12/0x20
[ 1773.470431] [< inline >] slab_post_alloc_hook /mm/slab.h:417
[ 1773.470431] [< inline >] slab_alloc_node /mm/slub.c:2708
[ 1773.470431] [< inline >] slab_alloc /mm/slub.c:2716
[ 1773.470431] [<ffffffff817476a8>] kmem_cache_alloc+0xc8/0x2b0 /mm/slub.c:2721
[ 1773.470431] [<ffffffff84c4f6a9>] sk_prot_alloc+0x69/0x2b0 /net/core/sock.c:1326
[ 1773.470431] [<ffffffff84c58ac8>] sk_alloc+0x38/0xae0 /net/core/sock.c:1388
[ 1773.470431] [<ffffffff851ddf77>] inet6_create+0x2d7/0x1000 /net/ipv6/af_inet6.c:182
[ 1773.470431] [<ffffffff84c4af7b>] __sock_create+0x37b/0x640 /net/socket.c:1153
[ 1773.470431] [< inline >] sock_create /net/socket.c:1193
[ 1773.470431] [< inline >] SYSC_socket /net/socket.c:1223
[ 1773.470431] [<ffffffff84c4b46f>] SyS_socket+0xef/0x1b0 /net/socket.c:1203
[ 1773.470431] [<ffffffff85e4d6c5>] entry_SYSCALL_64_fastpath+0x23/0xc6
Freed:
PID = 13261
[ 1773.470431] [<ffffffff811ddcb6>] save_stack_trace+0x16/0x20
[ 1773.470431] [<ffffffff8174c736>] save_stack+0x46/0xd0
[ 1773.470431] [<ffffffff8174cf61>] kasan_slab_free+0x71/0xb0
[ 1773.470431] [< inline >] slab_free_hook /mm/slub.c:1352
[ 1773.470431] [< inline >] slab_free_freelist_hook /mm/slub.c:1374
[ 1773.470431] [< inline >] slab_free /mm/slub.c:2951
[ 1773.470431] [<ffffffff81748b28>] kmem_cache_free+0xc8/0x330 /mm/slub.c:2973
[ 1773.470431] [< inline >] sk_prot_free /net/core/sock.c:1369
[ 1773.470431] [<ffffffff84c541eb>] __sk_destruct+0x32b/0x4f0 /net/core/sock.c:1444
[ 1773.470431] [<ffffffff84c5aca4>] sk_destruct+0x44/0x80 /net/core/sock.c:1452
[ 1773.470431] [<ffffffff84c5ad33>] __sk_free+0x53/0x220 /net/core/sock.c:1460
[ 1773.470431] [<ffffffff84c5af23>] sk_free+0x23/0x30 /net/core/sock.c:1471
[ 1773.470431] [<ffffffff84c5cb6c>] sk_common_release+0x28c/0x3e0 /./include/net/sock.h:1589
[ 1773.470431] [<ffffffff852569f5>] udp_lib_close+0x15/0x20 /./include/net/udp.h:203
[ 1773.470431] [<ffffffff850b2dfd>] inet_release+0xed/0x1c0 /net/ipv4/af_inet.c:415
[ 1773.470431] [<ffffffff851dc5aa>] inet6_release+0x5a/0x80 /net/ipv6/af_inet6.c:424
[ 1773.470431] [<ffffffff84c4581d>] sock_release+0x8d/0x1d0 /net/socket.c:570
[ 1773.470431] [<ffffffff84c45976>] sock_close+0x16/0x20 /net/socket.c:1017
[ 1773.470431] [<ffffffff817a108c>] __fput+0x28c/0x780 /fs/file_table.c:208
[ 1773.470431] [<ffffffff817a1605>] ____fput+0x15/0x20 /fs/file_table.c:244
[ 1773.470431] [<ffffffff813774f9>] task_work_run+0xf9/0x170
[ 1773.470431] [<ffffffff81324aae>] do_exit+0x85e/0x2a00
[ 1773.470431] [<ffffffff81326dc8>] do_group_exit+0x108/0x330
[ 1773.470431] [<ffffffff81348cf7>] get_signal+0x617/0x17a0 /kernel/signal.c:2307
[ 1773.470431] [<ffffffff811b49af>] do_signal+0x7f/0x18f0
[ 1773.470431] [<ffffffff810039bf>] exit_to_usermode_loop+0xbf/0x150 /arch/x86/entry/common.c:156
[ 1773.470431] [< inline >] prepare_exit_to_usermode /arch/x86/entry/common.c:190
[ 1773.470431] [<ffffffff81006060>] syscall_return_slowpath+0x1a0/0x1e0 /arch/x86/entry/common.c:259
[ 1773.470431] [<ffffffff85e4d766>] entry_SYSCALL_64_fastpath+0xc4/0xc6
Memory state around the buggy address:
ffff88002f163b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88002f163b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88002f163c00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
^
ffff88002f163c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88002f163d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Disabling lock debugging due to kernel taint
==================================================================
BUG: KASAN: use-after-free in udp_lib_unhash+0x593/0x660 at addr ffff88002f163c60
Write of size 8 by task syz-executor/13522
CPU: 1 PID: 13522 Comm: syz-executor Tainted: G B 4.8.0+ #41
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
ffff88002e4e77e0 ffffffff829f835b ffff88002f488b40 ffff88002f163c40
ffff88002f164350 ffff880031781540 ffff88002e4e7808 ffffffff8174d3cc
ffff88002e4e7898 ffff88002f163c00 ffff88002f488b40 ffff88002e4e7888
Call Trace:
[<ffffffff829f835b>] dump_stack+0xb3/0x118 /lib/dump_stack.c:15
[<ffffffff8174d3cc>] kasan_object_err+0x1c/0x70 /mm/kasan/report.c:156
[< inline >] print_address_description /mm/kasan/report.c:194
[<ffffffff8174d666>] kasan_report_error+0x1f6/0x4d0 /mm/kasan/report.c:283
[< inline >] kasan_report /mm/kasan/report.c:303
[<ffffffff8174db7e>] __asan_report_store8_noabort+0x3e/0x40 /mm/kasan/report.c:329
[< inline >] hlist_del_init_rcu /./include/linux/list.h:624
[<ffffffff85082c83>] udp_lib_unhash+0x593/0x660 /net/ipv4/udp.c:1391
[<ffffffff84c5c99d>] sk_common_release+0xbd/0x3e0 /net/core/sock.c:2719
[<ffffffff85083f05>] udp_lib_close+0x15/0x20 /./include/net/udp.h:203
[<ffffffff850b2dfd>] inet_release+0xed/0x1c0 /net/ipv4/af_inet.c:415
[<ffffffff84c4581d>] sock_release+0x8d/0x1d0 /net/socket.c:570
[<ffffffff84c45976>] sock_close+0x16/0x20 /net/socket.c:1017
[<ffffffff817a108c>] __fput+0x28c/0x780 /fs/file_table.c:208
[<ffffffff817a1605>] ____fput+0x15/0x20 /fs/file_table.c:244
[<ffffffff813774f9>] task_work_run+0xf9/0x170
[<ffffffff81324aae>] do_exit+0x85e/0x2a00
[<ffffffff81326dc8>] do_group_exit+0x108/0x330
[<ffffffff81348cf7>] get_signal+0x617/0x17a0 /kernel/signal.c:2307
[<ffffffff811b49af>] do_signal+0x7f/0x18f0
[<ffffffff810039bf>] exit_to_usermode_loop+0xbf/0x150 /arch/x86/entry/common.c:156
[< inline >] prepare_exit_to_usermode /arch/x86/entry/common.c:190
[<ffffffff81006060>] syscall_return_slowpath+0x1a0/0x1e0 /arch/x86/entry/common.c:259
[<ffffffff85e4d766>] entry_SYSCALL_64_fastpath+0xc4/0xc6
Object at ffff88002f163c40, in cache UDPv6 size: 1496
Allocated:
PID = 13255
[ 1773.617936] [<ffffffff811ddcb6>] save_stack_trace+0x16/0x20
[ 1773.617936] [<ffffffff8174c736>] save_stack+0x46/0xd0
[ 1773.617936] [<ffffffff8174c9ad>] kasan_kmalloc+0xad/0xe0
[ 1773.617936] [<ffffffff8174cee2>] kasan_slab_alloc+0x12/0x20
[ 1773.617936] [< inline >] slab_post_alloc_hook /mm/slab.h:417
[ 1773.617936] [< inline >] slab_alloc_node /mm/slub.c:2708
[ 1773.617936] [< inline >] slab_alloc /mm/slub.c:2716
[ 1773.617936] [<ffffffff817476a8>] kmem_cache_alloc+0xc8/0x2b0 /mm/slub.c:2721
[ 1773.617936] [<ffffffff84c4f6a9>] sk_prot_alloc+0x69/0x2b0 /net/core/sock.c:1326
[ 1773.617936] [<ffffffff84c58ac8>] sk_alloc+0x38/0xae0 /net/core/sock.c:1388
[ 1773.617936] [<ffffffff851ddf77>] inet6_create+0x2d7/0x1000 /net/ipv6/af_inet6.c:182
[ 1773.617936] [<ffffffff84c4af7b>] __sock_create+0x37b/0x640 /net/socket.c:1153
[ 1773.617936] [< inline >] sock_create /net/socket.c:1193
[ 1773.617936] [< inline >] SYSC_socket /net/socket.c:1223
[ 1773.617936] [<ffffffff84c4b46f>] SyS_socket+0xef/0x1b0 /net/socket.c:1203
[ 1773.617936] [<ffffffff85e4d6c5>] entry_SYSCALL_64_fastpath+0x23/0xc6
Freed:
PID = 13261
[ 1773.617936] [<ffffffff811ddcb6>] save_stack_trace+0x16/0x20
[ 1773.617936] [<ffffffff8174c736>] save_stack+0x46/0xd0
[ 1773.617936] [<ffffffff8174cf61>] kasan_slab_free+0x71/0xb0
[ 1773.617936] [< inline >] slab_free_hook /mm/slub.c:1352
[ 1773.617936] [< inline >] slab_free_freelist_hook /mm/slub.c:1374
[ 1773.617936] [< inline >] slab_free /mm/slub.c:2951
[ 1773.617936] [<ffffffff81748b28>] kmem_cache_free+0xc8/0x330 /mm/slub.c:2973
[ 1773.617936] [< inline >] sk_prot_free /net/core/sock.c:1369
[ 1773.617936] [<ffffffff84c541eb>] __sk_destruct+0x32b/0x4f0 /net/core/sock.c:1444
[ 1773.617936] [<ffffffff84c5aca4>] sk_destruct+0x44/0x80 /net/core/sock.c:1452
[ 1773.617936] [<ffffffff84c5ad33>] __sk_free+0x53/0x220 /net/core/sock.c:1460
[ 1773.617936] [<ffffffff84c5af23>] sk_free+0x23/0x30 /net/core/sock.c:1471
[ 1773.617936] [<ffffffff84c5cb6c>] sk_common_release+0x28c/0x3e0 /./include/net/sock.h:1589
[ 1773.617936] [<ffffffff852569f5>] udp_lib_close+0x15/0x20 /./include/net/udp.h:203
[ 1773.617936] [<ffffffff850b2dfd>] inet_release+0xed/0x1c0 /net/ipv4/af_inet.c:415
[ 1773.617936] [<ffffffff851dc5aa>] inet6_release+0x5a/0x80 /net/ipv6/af_inet6.c:424
[ 1773.617936] [<ffffffff84c4581d>] sock_release+0x8d/0x1d0 /net/socket.c:570
[ 1773.617936] [<ffffffff84c45976>] sock_close+0x16/0x20 /net/socket.c:1017
[ 1773.617936] [<ffffffff817a108c>] __fput+0x28c/0x780 /fs/file_table.c:208
[ 1773.617936] [<ffffffff817a1605>] ____fput+0x15/0x20 /fs/file_table.c:244
[ 1773.617936] [<ffffffff813774f9>] task_work_run+0xf9/0x170
[ 1773.617936] [<ffffffff81324aae>] do_exit+0x85e/0x2a00
[ 1773.617936] [<ffffffff81326dc8>] do_group_exit+0x108/0x330
[ 1773.617936] [<ffffffff81348cf7>] get_signal+0x617/0x17a0 /kernel/signal.c:2307
[ 1773.617936] [<ffffffff811b49af>] do_signal+0x7f/0x18f0
[ 1773.617936] [<ffffffff810039bf>] exit_to_usermode_loop+0xbf/0x150 /arch/x86/entry/common.c:156
[ 1773.617936] [< inline >] prepare_exit_to_usermode /arch/x86/entry/common.c:190
[ 1773.617936] [<ffffffff81006060>] syscall_return_slowpath+0x1a0/0x1e0 /arch/x86/entry/common.c:259
[ 1773.617936] [<ffffffff85e4d766>] entry_SYSCALL_64_fastpath+0xc4/0xc6
Memory state around the buggy address:
ffff88002f163b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88002f163b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88002f163c00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
^
ffff88002f163c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88002f163d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Best Regards,
Baozeng Ding
On 2016/10/17 3:53, Cong Wang wrote:
> On Sun, Oct 16, 2016 at 6:46 AM, Baozeng Ding <sploving1@gmail.com> wrote:
>> Hello all,
>> While running syzkaller fuzzer I have got the following use-after-free
>> bug in udp_lib_get_port. The kernel version is 4.8.0+ (on Oct 7 commit d1f5323370fceaed43a7ee38f4c7bfc7e70f28d0). Unfortunately I failed to find a reproducer for it.
>>
>> BUG: KASAN: use-after-free in udp_lib_get_port+0x1573/0x1860 at addr ffff88000804cb60
>> Write of size 8 by task syz-executor/31190
>> CPU: 0 PID: 31190 Comm: syz-executor Not tainted 4.8.0+ #39
>> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
>> ffff880015ac7a48 ffffffff829f835b ffff880032b531c0 ffff88000804cb40
>> ffff88000804d250 ffff880017415a4a ffff880015ac7a70 ffffffff8174d3cc
>> ffff880015ac7b00 ffff88000804cb00 ffff880032b531c0 ffff880015ac7af0
>> Call Trace:
>> [<ffffffff829f835b>] dump_stack+0xb3/0x118 lib/dump_stack.c:15
>> [<ffffffff8174d3cc>] kasan_object_err+0x1c/0x70 mm/kasan/report.c:156
>> [< inline >] print_address_description mm/kasan/report.c:194
>> [<ffffffff8174d666>] kasan_report_error+0x1f6/0x4d0 mm/kasan/report.c:283
>> [< inline >] kasan_report mm/kasan/report.c:303
>> [<ffffffff8174db7e>] __asan_report_store8_noabort+0x3e/0x40 mm/kasan/report.c:329
>> [< inline >] hlist_add_head_rcu ./include/linux/rculist.h:487
>> [<ffffffff850866e3>] udp_lib_get_port+0x1573/0x1860 net/ipv4/udp.c:345
>> [<ffffffff8525cc27>] udp_v6_get_port+0xa7/0xd0 net/ipv6/udp.c:106
>> [<ffffffff851df52c>] inet6_bind+0x89c/0xfb0 net/ipv6/af_inet6.c:384
>> [<ffffffff84c492fa>] SYSC_bind+0x1ea/0x250 net/socket.c:1367
>> [<ffffffff84c4ba34>] SyS_bind+0x24/0x30 net/socket.c:1353
>> [<ffffffff85e4d685>] entry_SYSCALL_64_fastpath+0x23/0xc6
>
>
> We should have a reference to this sock via fd and its sock->sk too,
> so I fail to see why it could be freed while we holding this reference.
> Maybe a VFS layer bug?
>
I am not sure. should I cc linux kernel dev mailing list?
>> Object at ffff88000804cb40, in cache UDPv6 size: 1496
>> Allocated:
>> PID = 30789
>> [ 378.305168] [<ffffffff811ddcb6>] save_stack_trace+0x16/0x20
>> [ 378.305168] [<ffffffff8174c736>] save_stack+0x46/0xd0
>> [ 378.305168] [<ffffffff8174c9ad>] kasan_kmalloc+0xad/0xe0
>> [ 378.305168] [<ffffffff8174cee2>] kasan_slab_alloc+0x12/0x20
>> [ 378.305168] [< inline >] slab_post_alloc_hook mm/slab.h:417
>> [ 378.305168] [< inline >] slab_alloc_node mm/slub.c:2708
>> [ 378.305168] [< inline >] slab_alloc mm/slub.c:2716
>> [ 378.305168] [<ffffffff817476a8>] kmem_cache_alloc+0xc8/0x2b0 mm/slub.c:2721
>> [ 378.305168] [<ffffffff84c4f6a9>] sk_prot_alloc+0x69/0x2b0 net/core/sock.c:1326
>> [ 378.305168] [<ffffffff84c58ac8>] sk_alloc+0x38/0xae0 net/core/sock.c:1388
>> [ 378.305168] [<ffffffff851ddf67>] inet6_create+0x2d7/0x1000 net/ipv6/af_inet6.c:182
>> [ 378.305168] [<ffffffff84c4af7b>] __sock_create+0x37b/0x640 net/socket.c:1153
>> [ 378.305168] [< inline >] sock_create net/socket.c:1193
>> [ 378.305168] [< inline >] SYSC_socket net/socket.c:1223
>> [ 378.305168] [<ffffffff84c4b46f>] SyS_socket+0xef/0x1b0 net/socket.c:1203
>> [ 378.305168] [<ffffffff85e4d685>] entry_SYSCALL_64_fastpath+0x23/0xc6
>> Freed:
>> PID = 30789
>> [ 378.305168] [<ffffffff811ddcb6>] save_stack_trace+0x16/0x20
>> [ 378.305168] [<ffffffff8174c736>] save_stack+0x46/0xd0
>> [ 378.305168] [<ffffffff8174cf61>] kasan_slab_free+0x71/0xb0
>> [ 378.305168] [< inline >] slab_free_hook mm/slub.c:1352
>> [ 378.305168] [< inline >] slab_free_freelist_hook mm/slub.c:1374
>> [ 378.305168] [< inline >] slab_free mm/slub.c:2951
>> [ 378.305168] [<ffffffff81748b28>] kmem_cache_free+0xc8/0x330 mm/slub.c:2973
>> [ 378.305168] [< inline >] sk_prot_free net/core/sock.c:1369
>> [ 378.305168] [<ffffffff84c541eb>] __sk_destruct+0x32b/0x4f0 net/core/sock.c:1444
>> [ 378.305168] [<ffffffff84c5aca4>] sk_destruct+0x44/0x80 net/core/sock.c:1452
>> [ 378.305168] [<ffffffff84c5ad33>] __sk_free+0x53/0x220 net/core/sock.c:1460
>> [ 378.305168] [<ffffffff84c5af23>] sk_free+0x23/0x30 net/core/sock.c:1471
>> [ 378.305168] [<ffffffff84c5cb6c>] sk_common_release+0x28c/0x3e0 ./include/net/sock.h:1589
>> [ 378.305168] [<ffffffff852569e5>] udp_lib_close+0x15/0x20 ./include/net/udp.h:203
>> [ 378.305168] [<ffffffff850b2dfd>] inet_release+0xed/0x1c0 net/ipv4/af_inet.c:415
>> [ 378.305168] [<ffffffff851dc5a0>] inet6_release+0x50/0x70 net/ipv6/af_inet6.c:422
>> [ 378.305168] [<ffffffff84c4581d>] sock_release+0x8d/0x1d0 net/socket.c:570
>> [ 378.305168] [<ffffffff84c45976>] sock_close+0x16/0x20 net/socket.c:1017
>> [ 378.305168] [<ffffffff817a108c>] __fput+0x28c/0x780 fs/file_table.c:208
>> [ 378.305168] [<ffffffff817a1605>] ____fput+0x15/0x20 fs/file_table.c:244
>> [ 378.305168] [<ffffffff813774f9>] task_work_run+0xf9/0x170
>> [ 378.305168] [<ffffffff81324aae>] do_exit+0x85e/0x2a00
>> [ 378.305168] [<ffffffff81326dc8>] do_group_exit+0x108/0x330
>> [ 378.376437] [<ffffffff81348cf7>] get_signal+0x617/0x17a0 kernel/signal.c:2307
>> [ 378.376437] [<ffffffff811b49af>] do_signal+0x7f/0x18f0
>> [ 378.376437] [<ffffffff810039bf>] exit_to_usermode_loop+0xbf/0x150 arch/x86/entry/common.c:156
>> [ 378.376437] [< inline >] prepare_exit_to_usermode arch/x86/entry/common.c:190
>> [ 378.376437] [<ffffffff81006060>] syscall_return_slowpath+0x1a0/0x1e0 arch/x86/entry/common.c:259
>> [ 378.376437] [<ffffffff85e4d726>] entry_SYSCALL_64_fastpath+0xc4/0xc6
>> Memory state around the buggy address:
>> ffff88000804ca00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>> ffff88000804ca80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>>> ffff88000804cb00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>> ^
>> ffff88000804cb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>> ffff88000804cc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>> ==================================================================
>>
>> Thanks && Best Regards,
>> Baozeng Ding
^ permalink raw reply
* Re: [PATCH net-next 4/6] net: use core MTU range checking in core net infra
From: Jarod Wilson @ 2016-10-19 14:40 UTC (permalink / raw)
To: Sabrina Dubroca
Cc: linux-kernel, netdev, Nicolas Dichtel, Hannes Frederic Sowa,
Tom Herbert, Daniel Borkmann, Alexander Duyck, Paolo Abeni,
Jiri Benc, WANG Cong, Roopa Prabhu, Pravin B Shelar,
Patrick McHardy, Stephen Hemminger, Pravin Shelar
In-Reply-To: <20161019135529.GA11224@bistromath.localdomain>
On Wed, Oct 19, 2016 at 03:55:29PM +0200, Sabrina Dubroca wrote:
> 2016-10-18, 22:33:31 -0400, Jarod Wilson wrote:
> > geneve:
> > - Merge __geneve_change_mtu back into geneve_change_mtu, set max_mtu
> > - This one isn't quite as straight-forward as others, could use some
> > closer inspection and testing
> >
> > macvlan:
> > - set min/max_mtu
> >
> > tun:
> > - set min/max_mtu, remove tun_net_change_mtu
> >
> > vxlan:
> > - Merge __vxlan_change_mtu back into vxlan_change_mtu, set min/max_mtu
> > - This one is also not as straight-forward and could use closer inspection
> > and testing from vxlan folks
> >
> > bridge:
> > - set max_mtu via br_min_mtu()
> >
> > openvswitch:
> > - set min/max_mtu, remove internal_dev_change_mtu
> > - note: max_mtu wasn't checked previously, it's been set to 65535, which
> > is the largest possible size supported
> >
> > sch_teql:
> > - set min/max_mtu (note: max_mtu previously unchecked, used max of 65535)
>
> Nothing for other virtual netdevices? (dummy, veth, bond, etc) Their
> MTU is limited to 1500 now. Also missing macsec and ip_gre, probably
> others that are using ether_setup.
Yeah, I've clearly missed more than I thought. Doing another sweep now.
I'm thinking more and more that we ought to back out the patch that sets
min/max in ether_setup, save it for last, after we're sure everyone that
calls it has been prepared.
> [...]
> > diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
> > index 89a687f..81fc79a 100644
> > --- a/net/bridge/br_device.c
> > +++ b/net/bridge/br_device.c
> > @@ -184,17 +184,15 @@ static struct rtnl_link_stats64 *br_get_stats64(struct net_device *dev,
> >
> > static int br_change_mtu(struct net_device *dev, int new_mtu)
> > {
> > +#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
> > struct net_bridge *br = netdev_priv(dev);
> > - if (new_mtu < 68 || new_mtu > br_min_mtu(br))
> > - return -EINVAL;
> > -
> > - dev->mtu = new_mtu;
> >
> > -#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
> > /* remember the MTU in the rtable for PMTU */
> > dst_metric_set(&br->fake_rtable.dst, RTAX_MTU, new_mtu);
> > #endif
> >
> > + dev->mtu = new_mtu;
> > +
> > return 0;
> > }
> >
> > @@ -390,6 +388,7 @@ void br_dev_setup(struct net_device *dev)
> > dev->hw_features = COMMON_FEATURES | NETIF_F_HW_VLAN_CTAG_TX |
> > NETIF_F_HW_VLAN_STAG_TX;
> > dev->vlan_features = COMMON_FEATURES;
> > + dev->max_mtu = br_min_mtu(br);
>
> br_min_mtu uses br->port_list, which is only initialized a few lines
> later (right after the spin_lock_init() at the end of the context of
> this diff).
Ah, okay, I'd just grouped it with the other dev->foo settings.
> Besides, I don't think this works: br_min_mtu(br) changes when you add
> and remove ports, or when you change the MTU of an enslaved
> device. But this makes the max MTU for the bridge fixed (to 1500).
Okay, how about this: set no max_mtu (or set it to IP_MAX_MTU/65535), and
then retain a check against the possibly ever-changing br_min_mtu(br) in
br_change_mtu()?
> > diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
> > index e7da290..d5d6cae 100644
> > --- a/net/openvswitch/vport-internal_dev.c
> > +++ b/net/openvswitch/vport-internal_dev.c
> > @@ -89,15 +89,6 @@ static const struct ethtool_ops internal_dev_ethtool_ops = {
> > .get_link = ethtool_op_get_link,
> > };
> >
> > -static int internal_dev_change_mtu(struct net_device *netdev, int new_mtu)
> > -{
> > - if (new_mtu < 68)
> > - return -EINVAL;
> > -
> > - netdev->mtu = new_mtu;
> > - return 0;
> > -}
> > -
> > static void internal_dev_destructor(struct net_device *dev)
> > {
> > struct vport *vport = ovs_internal_dev_get_vport(dev);
> > @@ -148,7 +139,6 @@ static const struct net_device_ops internal_dev_netdev_ops = {
> > .ndo_stop = internal_dev_stop,
> > .ndo_start_xmit = internal_dev_xmit,
> > .ndo_set_mac_address = eth_mac_addr,
> > - .ndo_change_mtu = internal_dev_change_mtu,
> > .ndo_get_stats64 = internal_get_stats,
> > .ndo_set_rx_headroom = internal_set_rx_headroom,
> > };
>
> vport-internal uses ether_setup, so the MTU is currently limited to
> 1500, no?
Yeah. Sweep ongoing...
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply
* Re: [PATCH net] net: core: Correctly iterate over lower adjacency list
From: David Miller @ 2016-10-19 14:38 UTC (permalink / raw)
To: idosch; +Cc: netdev, jiri, eladr, yotamg, nogahf, ogerlitz, dsa, idosch
In-Reply-To: <1476885428-5189-1-git-send-email-idosch@idosch.org>
From: idosch@idosch.org
Date: Wed, 19 Oct 2016 16:57:08 +0300
> From: Ido Schimmel <idosch@mellanox.com>
>
> Tamir reported the following trace when processing ARP requests received
> via a vlan device on top of a VLAN-aware bridge:
...
> The problem is that netdev_all_lower_get_next_rcu() never advances the
> iterator, thereby causing the loop over the lower adjacency list to run
> forever.
>
> Fix this by advancing the iterator and avoid the infinite loop.
>
> Fixes: 7ce856aaaf13 ("mlxsw: spectrum: Add couple of lower device helper functions")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Reported-by: Tamir Winetroub <tamirw@mellanox.com>
> Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 6/6] net: use core MTU range checking in misc drivers
From: Robin Holt @ 2016-10-19 14:37 UTC (permalink / raw)
To: Jarod Wilson
Cc: LKML, netdev, Stefan Richter, Faisal Latif, linux-rdma,
Cliff Whickman, Jes Sorensen, Marek Lindner, Simon Wunderlich,
Antonio Quartulli
In-Reply-To: <20161019023333.15760-7-jarod@redhat.com>
On Tue, Oct 18, 2016 at 9:33 PM, Jarod Wilson <jarod@redhat.com> wrote:
> CC: netdev@vger.kernel.org
> CC: Stefan Richter <stefanr@s5r6.in-berlin.de>
> CC: Faisal Latif <faisal.latif@intel.com>
> CC: linux-rdma@vger.kernel.org
> CC: Cliff Whickman <cpw@sgi.com>
Acked-by: Robin Holt <robinmholt@gmail.com>
> CC: Jes Sorensen <jes@trained-monkey.org>
> CC: Marek Lindner <mareklindner@neomailbox.ch>
> CC: Simon Wunderlich <sw@simonwunderlich.de>
> CC: Antonio Quartulli <a@unstable.cc>
> Signed-off-by: Jarod Wilson <jarod@redhat.com>
^ permalink raw reply
* Re: [PATCH] net: fs_enet: Use net_device_stats from struct net_device
From: David Miller @ 2016-10-19 14:37 UTC (permalink / raw)
To: tklauser; +Cc: pantelis.antoniou, vbordug, netdev, linuxppc-dev
In-Reply-To: <20161019092457.15006-1-tklauser@distanz.ch>
From: Tobias Klauser <tklauser@distanz.ch>
Date: Wed, 19 Oct 2016 11:24:57 +0200
> Instead of using a private copy of struct net_device_stats in struct
> fs_enet_private, use stats from struct net_device. Also remove the now
> unnecessary .ndo_get_stats function.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net v2] flow_dissector: Check skb for VLAN only if skb specified.
From: David Miller @ 2016-10-19 14:36 UTC (permalink / raw)
To: e; +Cc: netdev, hadarh
In-Reply-To: <1476736212-21238-1-git-send-email-e@erig.me>
From: Eric Garver <e@erig.me>
Date: Mon, 17 Oct 2016 16:30:12 -0400
> Fixes a panic when calling eth_get_headlen(). Noticed on i40e driver.
>
> Fixes: d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan info from skb->vlan_tci")
> Signed-off-by: Eric Garver <e@erig.me>
Applied, thanks.
^ permalink raw reply
* mlx4: panic during shutdown
From: Sebastian Ott @ 2016-10-19 14:35 UTC (permalink / raw)
To: Tariq Toukan, Yishai Hadas; +Cc: netdev, linux-kernel
Hi,
After a userspace update (fedora 23->24) I reproducibly run into the
following oops during shutdown (on s390):
[ 71.054832] Unable to handle kernel pointer dereference in virtual kernel address space
[ 71.054835] Failing address: 6b6b6b6b6b6b6000 TEID: 6b6b6b6b6b6b6803
[ 71.054838] Fault in home space mode while using kernel ASCE.
[ 71.054847] AS:0000000000f70007 R3:0000000000000024
[ 71.054883] Oops: 0038 ilc:3 [#1] PREEMPT SMP
[ 71.054887] Modules linked in: mlx4_ib ib_core mlx4_en ptp pps_core mlx4_core [...]
[ 71.054912] CPU: 8 PID: 809 Comm: kworker/8:6 Not tainted 4.8.0-02896-g7137af2-dirty #6
[ 71.054913] Hardware name: IBM 2964 N96 704 (LPAR)
[ 71.054919] Workqueue: events linkwatch_event
[ 71.054921] task: 00000000dbea0008 task.stack: 00000000dbea4000
[ 71.054923] Krnl PSW : 0704e00180000000 000003ff8007a496 (mlx4_en_get_phys_port_id+0x66/0xb0 [mlx4_en])
[ 71.054933] R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:2 PM:0 RI:0 EA:3
Krnl GPRS: 0000000000000080 0000000000000268 000000000000004e 00000000001c33e0
[ 71.054937] 000003ff8007a486 0000000000882790 6b6b6b6b6b6b6b6b 0000000000000010
[ 71.054939] 00000000dbea7b18 6b6b6b6b6b6b6b6b 00000000dbea7b18 00000000e72e0000
[ 71.054941] 00000000f15ec900 0000000000000000 000003ff8007a486 00000000dbea79c8
[ 71.054950] Krnl Code: 000003ff8007a486: e310b81c0d14 lgf %r1,55324(%r11)
000003ff8007a48c: a71b004b aghi %r1,75
#000003ff8007a490: eb110003000d sllg %r1,%r1,3
>000003ff8007a496: e31190000002 ltg %r1,0(%r1,%r9)
000003ff8007a49c: a7840015 brc 8,3ff8007a4c6
000003ff8007a4a0: 9208a020 mvi 32(%r10),8
000003ff8007a4a4: 4130a007 la %r3,7(%r10)
000003ff8007a4a8: a7290008 lghi %r2,8
[ 71.054965] Call Trace:
[ 71.054969] ([<000003ff8007a486>] mlx4_en_get_phys_port_id+0x56/0xb0 [mlx4_en])
[ 71.054971] ([<0000000000760b94>] rtnl_fill_ifinfo+0x4ec/0xc90)
[ 71.054974] ([<0000000000764fae>] rtmsg_ifinfo_build_skb+0x96/0xe8)
[ 71.054976] ([<0000000000765038>] rtmsg_ifinfo+0x38/0x78)
[ 71.054978] ([<000000000074150e>] netdev_state_change+0x5e/0x70)
[ 71.054981] ([<0000000000765ca6>] linkwatch_do_dev+0x66/0xc8)
[ 71.054983] ([<0000000000765fd6>] __linkwatch_run_queue+0x13e/0x190)
[ 71.054985] ([<0000000000766070>] linkwatch_event+0x48/0x58)
[ 71.054988] ([<0000000000162a2e>] process_one_work+0x3fe/0x820)
[ 71.054990] ([<00000000001630e6>] worker_thread+0x296/0x460)
[ 71.054992] ([<000000000016b41a>] kthread+0x112/0x120)
[ 71.054996] ([<00000000008762b2>] kernel_thread_starter+0x6/0xc)
[ 71.054998] ([<00000000008762ac>] kernel_thread_starter+0x0/0xc)
[ 71.055000] INFO: lockdep is turned off.
[ 71.055001] Last Breaking-Event-Address:
[ 71.055004] [<0000000000294480>] printk+0xc8/0xd0
[ 71.055006]
[ 71.055008] Kernel panic - not syncing: Fatal exception: panic_on_oops
This was observed with 4.8 but it's also reproducible on 4.9-rc1.
In mlx4_en_get_phys_port_id (which looks like it's called from userspace
via sysfs) the data behind mlx4_en_priv->mdev is already freed.
The problem probably is that the lifetime of mlx4_en_priv->mdev seems to
be shorter than that of struct net_device (and mlx4_en_get_phys_port_id
can be called as long as struct net_device exists).
Regards,
Sebastian
^ permalink raw reply
* Re: [RFC 1/6] qed: Add support for hardware offloaded iSCSI.
From: Johannes Thumshirn @ 2016-10-19 9:09 UTC (permalink / raw)
To: manish.rangankar
Cc: lduncan, cleech, martin.petersen, jejb, linux-scsi, netdev,
Yuval.Mintz, QLogic-Storage-Upstream, Yuval Mintz, Arun Easi
In-Reply-To: <1476853273-22960-2-git-send-email-manish.rangankar@cavium.com>
Hi Manish,
Some initital comments
On Wed, Oct 19, 2016 at 01:01:08AM -0400, manish.rangankar@cavium.com wrote:
> From: Yuval Mintz <Yuval.Mintz@qlogic.com>
>
> This adds the backbone required for the various HW initalizations
> which are necessary for the iSCSI driver (qedi) for QLogic FastLinQ
> 4xxxx line of adapters - FW notification, resource initializations, etc.
>
> Signed-off-by: Arun Easi <arun.easi@cavium.com>
> Signed-off-by: Yuval Mintz <yuval.mintz@cavium.com>
> ---
> drivers/net/ethernet/qlogic/Kconfig | 15 +
> drivers/net/ethernet/qlogic/qed/Makefile | 1 +
> drivers/net/ethernet/qlogic/qed/qed.h | 8 +-
> drivers/net/ethernet/qlogic/qed/qed_dev.c | 15 +
> drivers/net/ethernet/qlogic/qed/qed_int.h | 1 -
> drivers/net/ethernet/qlogic/qed/qed_iscsi.c | 1310 ++++++++++++++++++++++++
> drivers/net/ethernet/qlogic/qed/qed_iscsi.h | 52 +
> drivers/net/ethernet/qlogic/qed/qed_l2.c | 1 -
> drivers/net/ethernet/qlogic/qed/qed_ll2.c | 35 +-
> drivers/net/ethernet/qlogic/qed/qed_main.c | 2 -
> drivers/net/ethernet/qlogic/qed/qed_mcp.h | 6 -
> drivers/net/ethernet/qlogic/qed/qed_reg_addr.h | 2 +
> drivers/net/ethernet/qlogic/qed/qed_spq.c | 15 +
> include/linux/qed/qed_if.h | 2 +
> include/linux/qed/qed_iscsi_if.h | 249 +++++
> 15 files changed, 1692 insertions(+), 22 deletions(-)
> create mode 100644 drivers/net/ethernet/qlogic/qed/qed_iscsi.c
> create mode 100644 drivers/net/ethernet/qlogic/qed/qed_iscsi.h
> create mode 100644 include/linux/qed/qed_iscsi_if.h
>
> diff --git a/drivers/net/ethernet/qlogic/Kconfig b/drivers/net/ethernet/qlogic/Kconfig
> index 0df1391f9..bad4fae 100644
> --- a/drivers/net/ethernet/qlogic/Kconfig
> +++ b/drivers/net/ethernet/qlogic/Kconfig
> @@ -118,4 +118,19 @@ config INFINIBAND_QEDR
> for QLogic QED. This would be replaced by the 'real' option
> once the QEDR driver is added [+relocated].
>
> +config QED_ISCSI
> + bool
> +
> +config QEDI
> + tristate "QLogic QED 25/40/100Gb iSCSI driver"
> + depends on QED
> + select QED_LL2
> + select QED_ISCSI
> + default n
> + ---help---
> + This provides a temporary node that allows the compilation
> + and logical testing of the hardware offload iSCSI support
> + for QLogic QED. This would be replaced by the 'real' option
> + once the QEDI driver is added [+relocated].
> +
> endif # NET_VENDOR_QLOGIC
> diff --git a/drivers/net/ethernet/qlogic/qed/Makefile b/drivers/net/ethernet/qlogic/qed/Makefile
> index cda0af7..b76669c 100644
> --- a/drivers/net/ethernet/qlogic/qed/Makefile
> +++ b/drivers/net/ethernet/qlogic/qed/Makefile
> @@ -6,3 +6,4 @@ qed-y := qed_cxt.o qed_dev.o qed_hw.o qed_init_fw_funcs.o qed_init_ops.o \
> qed-$(CONFIG_QED_SRIOV) += qed_sriov.o qed_vf.o
> qed-$(CONFIG_QED_LL2) += qed_ll2.o
> qed-$(CONFIG_INFINIBAND_QEDR) += qed_roce.o
> +qed-$(CONFIG_QED_ISCSI) += qed_iscsi.o
> diff --git a/drivers/net/ethernet/qlogic/qed/qed.h b/drivers/net/ethernet/qlogic/qed/qed.h
> index 653bb57..a61b1c0 100644
> --- a/drivers/net/ethernet/qlogic/qed/qed.h
> +++ b/drivers/net/ethernet/qlogic/qed/qed.h
> @@ -35,6 +35,7 @@
>
> #define QED_WFQ_UNIT 100
>
> +#define ISCSI_BDQ_ID(_port_id) (_port_id)
This looks a bit odd to me.
[...]
> #endif
> + if (IS_ENABLED(CONFIG_QEDI) &&
> + p_hwfn->hw_info.personality == QED_PCI_ISCSI)
> + qed_iscsi_free(p_hwfn, p_hwfn->p_iscsi_info);
Why not introduce a small helper like:
static inline bool qed_is_iscsi_personality()
{
return IS_ENABLED(CONFIG_QEDI) && p_hwfn->hw_info.personality ==
QED_PCI_ISCSI;
}
> qed_iov_free(p_hwfn);
[...]
> +
> + if (!GET_FIELD(p_ramrod->iscsi.flags,
> + ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B)) {
> + p_tcp = &p_ramrod->tcp;
> + ucval = p_conn->local_mac[1];
> + ((u8 *)(&p_tcp->local_mac_addr_hi))[0] = ucval;
> + ucval = p_conn->local_mac[0];
> + ((u8 *)(&p_tcp->local_mac_addr_hi))[1] = ucval;
> + ucval = p_conn->local_mac[3];
> + ((u8 *)(&p_tcp->local_mac_addr_mid))[0] = ucval;
> + ucval = p_conn->local_mac[2];
> + ((u8 *)(&p_tcp->local_mac_addr_mid))[1] = ucval;
> + ucval = p_conn->local_mac[5];
> + ((u8 *)(&p_tcp->local_mac_addr_lo))[0] = ucval;
> + ucval = p_conn->local_mac[4];
> + ((u8 *)(&p_tcp->local_mac_addr_lo))[1] = ucval;
> + ucval = p_conn->remote_mac[1];
> + ((u8 *)(&p_tcp->remote_mac_addr_hi))[0] = ucval;
> + ucval = p_conn->remote_mac[0];
> + ((u8 *)(&p_tcp->remote_mac_addr_hi))[1] = ucval;
> + ucval = p_conn->remote_mac[3];
> + ((u8 *)(&p_tcp->remote_mac_addr_mid))[0] = ucval;
> + ucval = p_conn->remote_mac[2];
> + ((u8 *)(&p_tcp->remote_mac_addr_mid))[1] = ucval;
> + ucval = p_conn->remote_mac[5];
> + ((u8 *)(&p_tcp->remote_mac_addr_lo))[0] = ucval;
> + ucval = p_conn->remote_mac[4];
> + ((u8 *)(&p_tcp->remote_mac_addr_lo))[1] = ucval;
> +
> + p_tcp->vlan_id = cpu_to_le16(p_conn->vlan_id);
> +
> + p_tcp->flags = p_conn->tcp_flags;
> + p_tcp->ip_version = p_conn->ip_version;
> + for (i = 0; i < 4; i++) {
> + dval = p_conn->remote_ip[i];
> + p_tcp->remote_ip[i] = cpu_to_le32(dval);
> + dval = p_conn->local_ip[i];
> + p_tcp->local_ip[i] = cpu_to_le32(dval);
> + }
> + p_tcp->ka_max_probe_cnt = p_conn->ka_max_probe_cnt;
> + p_tcp->dup_ack_theshold = p_conn->dup_ack_theshold;
> +
> + p_tcp->rcv_next = cpu_to_le32(p_conn->rcv_next);
> + p_tcp->snd_una = cpu_to_le32(p_conn->snd_una);
> + p_tcp->snd_next = cpu_to_le32(p_conn->snd_next);
> + p_tcp->snd_max = cpu_to_le32(p_conn->snd_max);
> + p_tcp->snd_wnd = cpu_to_le32(p_conn->snd_wnd);
> + p_tcp->rcv_wnd = cpu_to_le32(p_conn->rcv_wnd);
> + p_tcp->snd_wl1 = cpu_to_le32(p_conn->snd_wl1);
> + p_tcp->cwnd = cpu_to_le32(p_conn->cwnd);
> + p_tcp->ss_thresh = cpu_to_le32(p_conn->ss_thresh);
> + p_tcp->srtt = cpu_to_le16(p_conn->srtt);
> + p_tcp->rtt_var = cpu_to_le16(p_conn->rtt_var);
> + p_tcp->ts_time = cpu_to_le32(p_conn->ts_time);
> + p_tcp->ts_recent = cpu_to_le32(p_conn->ts_recent);
> + p_tcp->ts_recent_age = cpu_to_le32(p_conn->ts_recent_age);
> + p_tcp->total_rt = cpu_to_le32(p_conn->total_rt);
> + dval = p_conn->ka_timeout_delta;
> + p_tcp->ka_timeout_delta = cpu_to_le32(dval);
> + dval = p_conn->rt_timeout_delta;
> + p_tcp->rt_timeout_delta = cpu_to_le32(dval);
> + p_tcp->dup_ack_cnt = p_conn->dup_ack_cnt;
> + p_tcp->snd_wnd_probe_cnt = p_conn->snd_wnd_probe_cnt;
> + p_tcp->ka_probe_cnt = p_conn->ka_probe_cnt;
> + p_tcp->rt_cnt = p_conn->rt_cnt;
> + p_tcp->flow_label = cpu_to_le32(p_conn->flow_label);
> + p_tcp->ka_timeout = cpu_to_le32(p_conn->ka_timeout);
> + p_tcp->ka_interval = cpu_to_le32(p_conn->ka_interval);
> + p_tcp->max_rt_time = cpu_to_le32(p_conn->max_rt_time);
> + dval = p_conn->initial_rcv_wnd;
> + p_tcp->initial_rcv_wnd = cpu_to_le32(dval);
> + p_tcp->ttl = p_conn->ttl;
> + p_tcp->tos_or_tc = p_conn->tos_or_tc;
> + p_tcp->remote_port = cpu_to_le16(p_conn->remote_port);
> + p_tcp->local_port = cpu_to_le16(p_conn->local_port);
> + p_tcp->mss = cpu_to_le16(p_conn->mss);
> + p_tcp->snd_wnd_scale = p_conn->snd_wnd_scale;
> + p_tcp->rcv_wnd_scale = p_conn->rcv_wnd_scale;
> + dval = p_conn->ts_ticks_per_second;
> + p_tcp->ts_ticks_per_second = cpu_to_le32(dval);
> + wval = p_conn->da_timeout_value;
> + p_tcp->da_timeout_value = cpu_to_le16(wval);
> + p_tcp->ack_frequency = p_conn->ack_frequency;
> + p_tcp->connect_mode = p_conn->connect_mode;
> + } else {
> + p_tcp2 =
> + &((struct iscsi_spe_conn_offload_option2 *)p_ramrod)->tcp;
> + ucval = p_conn->local_mac[1];
> + ((u8 *)(&p_tcp2->local_mac_addr_hi))[0] = ucval;
> + ucval = p_conn->local_mac[0];
> + ((u8 *)(&p_tcp2->local_mac_addr_hi))[1] = ucval;
> + ucval = p_conn->local_mac[3];
> + ((u8 *)(&p_tcp2->local_mac_addr_mid))[0] = ucval;
> + ucval = p_conn->local_mac[2];
> + ((u8 *)(&p_tcp2->local_mac_addr_mid))[1] = ucval;
> + ucval = p_conn->local_mac[5];
> + ((u8 *)(&p_tcp2->local_mac_addr_lo))[0] = ucval;
> + ucval = p_conn->local_mac[4];
> + ((u8 *)(&p_tcp2->local_mac_addr_lo))[1] = ucval;
> +
> + ucval = p_conn->remote_mac[1];
> + ((u8 *)(&p_tcp2->remote_mac_addr_hi))[0] = ucval;
> + ucval = p_conn->remote_mac[0];
> + ((u8 *)(&p_tcp2->remote_mac_addr_hi))[1] = ucval;
> + ucval = p_conn->remote_mac[3];
> + ((u8 *)(&p_tcp2->remote_mac_addr_mid))[0] = ucval;
> + ucval = p_conn->remote_mac[2];
> + ((u8 *)(&p_tcp2->remote_mac_addr_mid))[1] = ucval;
> + ucval = p_conn->remote_mac[5];
> + ((u8 *)(&p_tcp2->remote_mac_addr_lo))[0] = ucval;
> + ucval = p_conn->remote_mac[4];
> + ((u8 *)(&p_tcp2->remote_mac_addr_lo))[1] = ucval;
> +
> + p_tcp2->vlan_id = cpu_to_le16(p_conn->vlan_id);
> + p_tcp2->flags = p_conn->tcp_flags;
> +
> + p_tcp2->ip_version = p_conn->ip_version;
> + for (i = 0; i < 4; i++) {
> + dval = p_conn->remote_ip[i];
> + p_tcp2->remote_ip[i] = cpu_to_le32(dval);
> + dval = p_conn->local_ip[i];
> + p_tcp2->local_ip[i] = cpu_to_le32(dval);
> + }
> +
> + p_tcp2->flow_label = cpu_to_le32(p_conn->flow_label);
> + p_tcp2->ttl = p_conn->ttl;
> + p_tcp2->tos_or_tc = p_conn->tos_or_tc;
> + p_tcp2->remote_port = cpu_to_le16(p_conn->remote_port);
> + p_tcp2->local_port = cpu_to_le16(p_conn->local_port);
> + p_tcp2->mss = cpu_to_le16(p_conn->mss);
> + p_tcp2->rcv_wnd_scale = p_conn->rcv_wnd_scale;
> + p_tcp2->connect_mode = p_conn->connect_mode;
> + wval = p_conn->syn_ip_payload_length;
> + p_tcp2->syn_ip_payload_length = cpu_to_le16(wval);
> + p_tcp2->syn_phy_addr_lo = DMA_LO_LE(p_conn->syn_phy_addr);
> + p_tcp2->syn_phy_addr_hi = DMA_HI_LE(p_conn->syn_phy_addr);
> + }
Is there any chance you could factor out above blocks into own functions so
you have
if (!GET_FIELD(p_ramrod->iscsi.flags,
ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B)) {
qedi_do_stuff_off_chip();
else
qedi_do_stuff_on_chip();
> +
[...]
> +static void __iomem *qed_iscsi_get_db_addr(struct qed_hwfn *p_hwfn, u32 cid)
> +{
> + return (u8 __iomem *)p_hwfn->doorbells +
> + qed_db_addr(cid, DQ_DEMS_LEGACY);
> +}
> +
> +static void __iomem *qed_iscsi_get_primary_bdq_prod(struct qed_hwfn *p_hwfn,
> + u8 bdq_id)
> +{
> + u8 bdq_function_id = ISCSI_BDQ_ID(p_hwfn->port_id);
> +
> + return (u8 __iomem *)p_hwfn->regview + GTT_BAR0_MAP_REG_MSDM_RAM +
> + MSTORM_SCSI_BDQ_EXT_PROD_OFFSET(bdq_function_id,
> + bdq_id);
> +}
> +
> +static void __iomem *qed_iscsi_get_secondary_bdq_prod(struct qed_hwfn *p_hwfn,
> + u8 bdq_id)
> +{
> + u8 bdq_function_id = ISCSI_BDQ_ID(p_hwfn->port_id);
> +
> + return (u8 __iomem *)p_hwfn->regview + GTT_BAR0_MAP_REG_TSDM_RAM +
> + TSTORM_SCSI_BDQ_EXT_PROD_OFFSET(bdq_function_id,
> + bdq_id);
> +}
Why are you casting to u8* here, you're returning void*?
[...]
> +
> + if (tasks) {
> + struct qed_tid_mem *tid_info = kzalloc(sizeof(*tid_info),
> + GFP_KERNEL);
> +
> + if (!tid_info) {
> + DP_NOTICE(cdev,
> + "Failed to allocate tasks information\n");
> + qed_iscsi_stop(cdev);
> + return -ENOMEM;
> + }
> +
> + rc = qed_cxt_get_tid_mem_info(QED_LEADING_HWFN(cdev),
> + tid_info);
> + if (rc) {
> + DP_NOTICE(cdev, "Failed to gather task information\n");
> + qed_iscsi_stop(cdev);
> + kfree(tid_info);
> + return rc;
> + }
> +
> + /* Fill task information */
> + tasks->size = tid_info->tid_size;
> + tasks->num_tids_per_block = tid_info->num_tids_per_block;
> + memcpy(tasks->blocks, tid_info->blocks, MAX_TID_BLOCKS);
> +
> + kfree(tid_info);
> + }
> +
> + return 0;
> +}
Maybe:
struct qed_tid_mem *tid_info;
[...]
if (!tasks)
return 0;
tid_info = kzalloc(sizeof(*tid_info), GFP_KERNEL);
if (!tid_info) {
DP_NOTICE(cdev, "Failed to allocate tasks information\n");
qed_iscsi_stop(cdev);
return -ENOMEM;
}
rc = qed_cxt_get_tid_mem_info(QED_LEADING_HWFN(cdev), tid_info);
if (rc) {
DP_NOTICE(cdev, "Failed to gather task information\n");
qed_iscsi_stop(cdev);
kfree(tid_info);
return rc;
}
/* Fill task information */
tasks->size = tid_info->tid_size;
tasks->num_tids_per_block = tid_info->num_tids_per_block;
memcpy(tasks->blocks, tid_info->blocks, MAX_TID_BLOCKS);
kfree(tid_info);
> +
[...]
> +/**
> + * @brief start iscsi in FW
> + *
> + * @param cdev
> + * @param tasks - qed will fill information about tasks
> + *
Please use proper kerneldoc and not doxygen syntax.
Thanks,
Johannes
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply
* Re: [PATCH] ipv6: fix signedness of tmp_prefered_lft underflow check
From: Jiri Bohac @ 2016-10-19 13:16 UTC (permalink / raw)
To: David Miller
Cc: julia.lawall, kuznet, jmorris, yoshfuji, kaber, netdev,
kbuild-all
In-Reply-To: <20161018.142525.1262217492229127435.davem@davemloft.net>
Hi,
On Tue, Oct 18, 2016 at 02:25:25PM -0400, David Miller wrote:
> Does the check make any sense at all? I'd say just remove it.
The purpose was to guard against the user updating the
temp_prefered_lft sysctl after this:
max_desync_factor = min_t(__u32,
idev->cnf.max_desync_factor,
idev->cnf.temp_prefered_lft - regen_advance);
but before this:
tmp_prefered_lft = idev->cnf.temp_prefered_lft + age -
idev->desync_factor;
With enough bad luck, tmp_prefered_lft could underflow and the resulting
preferred lifetime could be almost infinity.
On the other hand, with this check, this situation will result
with the temporary address not being created at all, which might
be even worse. So if you prefer it, just drop the check.
Patch in a follow-up e-mail.
Thanks,
--
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ
^ permalink raw reply
* Re: [PATCH net] net: core: Correctly iterate over lower adjacency list
From: David Ahern @ 2016-10-19 14:33 UTC (permalink / raw)
To: idosch, davem; +Cc: netdev, jiri, eladr, yotamg, nogahf, ogerlitz, Ido Schimmel
In-Reply-To: <1476885428-5189-1-git-send-email-idosch@idosch.org>
On 10/19/16 7:57 AM, idosch@idosch.org wrote:
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 136ae6bb..465e128 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -3877,7 +3877,7 @@ struct net_device *netdev_all_lower_get_next_rcu(struct net_device *dev,
> ldev = netdev_all_lower_get_next(dev, &(iter)))
>
> #define netdev_for_each_all_lower_dev_rcu(dev, ldev, iter) \
> - for (iter = (dev)->all_adj_list.lower.next, \
> + for (iter = &(dev)->all_adj_list.lower, \
> ldev = netdev_all_lower_get_next_rcu(dev, &(iter)); \
> ldev; \
> ldev = netdev_all_lower_get_next_rcu(dev, &(iter)))
> diff --git a/net/core/dev.c b/net/core/dev.c
> index f1fe26f..b09ac57 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -5511,10 +5511,14 @@ struct net_device *netdev_all_lower_get_next_rcu(struct net_device *dev,
> {
> struct netdev_adjacent *lower;
>
> - lower = list_first_or_null_rcu(&dev->all_adj_list.lower,
> - struct netdev_adjacent, list);
> + lower = list_entry_rcu((*iter)->next, struct netdev_adjacent, list);
> +
> + if (&lower->list == &dev->all_adj_list.lower)
> + return NULL;
> +
> + *iter = &lower->list;
>
> - return lower ? lower->dev : NULL;
> + return lower->dev;
> }
> EXPORT_SYMBOL(netdev_all_lower_get_next_rcu);
When I converted this function in my series I wondered how the current code worked at all. I guess I didn't. This is inline with what I did and matches the form used for the all_upper variant, so for 4.9 and 4.8.x
Acked-by: David Ahern <dsa@cumulusnetworks.com>
I would like to see my series applied to 4.9 at some point.
^ permalink raw reply
* Re: [PATCH net-next 2/6] net: use core MTU range checking in wireless drivers
From: Johannes Berg @ 2016-10-19 14:28 UTC (permalink / raw)
To: Jarod Wilson
Cc: linux-kernel, netdev, linux-wireless, Maya Erez, Simon Kelley,
Stanislav Yakovlev
In-Reply-To: <20161019142706.GE18569@redhat.com>
> > I guess we should do the same in net/mac80211/iface.c?
>
> Yeah. I thought I'd located all places this needed to happen, but
> obviously not. I'll get this added and do another sweep for others I
> might have missed.
No worries. I can also do it if you prefer, just wanted to ask :)
johannes
^ permalink raw reply
* Re: [PATCH net-next 2/6] net: use core MTU range checking in wireless drivers
From: Jarod Wilson @ 2016-10-19 14:27 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-kernel, netdev, linux-wireless, Maya Erez, Simon Kelley,
Stanislav Yakovlev
In-Reply-To: <1476862713.5927.0.camel@sipsolutions.net>
On Wed, Oct 19, 2016 at 09:38:33AM +0200, Johannes Berg wrote:
> On Tue, 2016-10-18 at 22:33 -0400, Jarod Wilson wrote:
> > - set max_mtu in wil6210 driver
> > - set max_mtu in atmel driver
> > - set min/max_mtu in cisco airo driver, remove airo_change_mtu
> > - set min/max_mtu in ipw2100/ipw2200 drivers, remove
> > libipw_change_mtu
> > - set min/max_mtu in p80211netdev, remove wlan_change_mtu
>
> I guess we should do the same in net/mac80211/iface.c?
Yeah. I thought I'd located all places this needed to happen, but
obviously not. I'll get this added and do another sweep for others I might
have missed.
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply
* Re: [patch net-next RFC 4/6] Introduce sample tc action
From: Roopa Prabhu @ 2016-10-19 7:33 UTC (permalink / raw)
To: Yotam Gigi
Cc: Jamal Hadi Salim, Jiri Pirko, netdev@vger.kernel.org,
davem@davemloft.net, Ido Schimmel, Elad Raz, Nogah Frankel,
Or Gerlitz, geert+renesas@glider.be, stephen@networkplumber.org,
xiyou.wangcong@gmail.com, linux@roeck-us.net, Shrijeet Mukherjee,
Yotam Gigi
In-Reply-To: <DB3PR05MB0764DA26C8250B6C8DFD537CACD30@DB3PR05MB0764.eurprd05.prod.outlook.com>
On 10/18/16, 3:58 AM, Yotam Gigi wrote:
> On 16-10-15 12:34 PM, Roopa Prabhu wrote:
[snip]
>> The OVS implementation is a good example, the metadata includes all the
>> actions applied
>>>> to the packet in the kernel data path.
>>>>
>>> Again not sure what the use case would be (and why waste such space
>>> especially when you are sending over the wire with such details).
>> All this is being used currently.., But, this can be other api's sflow uses
>> for monitoring.
>> http://openvswitch.org/support/ovscon2014/17/1400-ovs-sflow.pdf
>>
>> Does not have to be part of the main/basic sampling api...
>> it was just an example.
>>
> I guess that making the API extensible solves this, isn't it?
yes, that might help...
Just wanted to bring up the question/clarification on using mark again
tc qdisc add dev eth1 handle ffff: ingress
tc filter add dev eth1 parent ffff: \
matchall action sample rate 12 mark 17
tc filter add parent ffff: dev eth1 protocol all \
u32 match mark 172 0xff
action mirred egress redirect dev dummy0
Like we discussed @ netdev, mark can be used by other things in the system.
A request to sample on an interface cannot be disruptive.
Does this require mark to be not used elsewhere in the system when sampling is enabled on an interface ?
^ permalink raw reply
* Re: [PATCH 4/9] ipv6: sr: add core files for SR HMAC support
From: zhuyj @ 2016-10-19 13:20 UTC (permalink / raw)
To: David Lebrun; +Cc: netdev
In-Reply-To: <1476715350-18983-5-git-send-email-david.lebrun@uclouvain.be>
__attribute__((packed)) is potentially unsafe on some systems. The
symptom probably won't show up on an x86, which just makes the problem
more insidious; testing on x86 systems won't reveal the problem. (On
the x86, misaligned accesses are handled in hardware; if you
dereference an int* pointer that points to an odd address, it will be
a little slower than if it were properly aligned, but you'll get the
correct result.)
On some other systems, such as SPARC, attempting to access a
misaligned int object causes a bus error, crashing the program.
On Mon, Oct 17, 2016 at 10:42 PM, David Lebrun
<david.lebrun@uclouvain.be> wrote:
> This patch adds the necessary functions to compute and check the HMAC signature
> of an SR-enabled packet. Two HMAC algorithms are supported: hmac(sha1) and
> hmac(sha256).
>
> In order to avoid dynamic memory allocation for each HMAC computation,
> a per-cpu ring buffer is allocated for this purpose.
>
> Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
> ---
> include/linux/seg6_hmac.h | 6 +
> include/net/seg6_hmac.h | 61 ++++++
> include/uapi/linux/seg6_hmac.h | 20 ++
> net/ipv6/seg6_hmac.c | 432 +++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 519 insertions(+)
> create mode 100644 include/linux/seg6_hmac.h
> create mode 100644 include/net/seg6_hmac.h
> create mode 100644 include/uapi/linux/seg6_hmac.h
> create mode 100644 net/ipv6/seg6_hmac.c
>
> diff --git a/include/linux/seg6_hmac.h b/include/linux/seg6_hmac.h
> new file mode 100644
> index 0000000..da437eb
> --- /dev/null
> +++ b/include/linux/seg6_hmac.h
> @@ -0,0 +1,6 @@
> +#ifndef _LINUX_SEG6_HMAC_H
> +#define _LINUX_SEG6_HMAC_H
> +
> +#include <uapi/linux/seg6_hmac.h>
> +
> +#endif
> diff --git a/include/net/seg6_hmac.h b/include/net/seg6_hmac.h
> new file mode 100644
> index 0000000..6e5ee6a
> --- /dev/null
> +++ b/include/net/seg6_hmac.h
> @@ -0,0 +1,61 @@
> +/*
> + * SR-IPv6 implementation
> + *
> + * Author:
> + * David Lebrun <david.lebrun@uclouvain.be>
> + *
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version
> + * 2 of the License, or (at your option) any later version.
> + */
> +
> +#ifndef _NET_SEG6_HMAC_H
> +#define _NET_SEG6_HMAC_H
> +
> +#include <net/flow.h>
> +#include <net/ip6_fib.h>
> +#include <net/sock.h>
> +#include <linux/ip.h>
> +#include <linux/ipv6.h>
> +#include <linux/route.h>
> +#include <net/seg6.h>
> +#include <linux/seg6_hmac.h>
> +
> +#define SEG6_HMAC_MAX_DIGESTSIZE 160
> +#define SEG6_HMAC_RING_SIZE 256
> +
> +struct seg6_hmac_info {
> + struct list_head list;
> +
> + u32 hmackeyid;
> + char secret[SEG6_HMAC_SECRET_LEN];
> + u8 slen;
> + u8 alg_id;
> +};
> +
> +struct seg6_hmac_algo {
> + u8 alg_id;
> + char name[64];
> + struct crypto_shash * __percpu *tfms;
> + struct shash_desc * __percpu *shashs;
> +};
> +
> +extern int seg6_hmac_compute(struct seg6_hmac_info *hinfo,
> + struct ipv6_sr_hdr *hdr, struct in6_addr *saddr,
> + u8 *output);
> +extern struct seg6_hmac_info *seg6_hmac_info_lookup(struct net *net, u32 key);
> +extern int seg6_hmac_info_add(struct net *net, u32 key,
> + struct seg6_hmac_info *hinfo);
> +extern int seg6_hmac_info_del(struct net *net, u32 key,
> + struct seg6_hmac_info *hinfo);
> +extern int seg6_push_hmac(struct net *net, struct in6_addr *saddr,
> + struct ipv6_sr_hdr *srh);
> +extern bool seg6_hmac_validate_skb(struct sk_buff *skb);
> +extern int seg6_hmac_init(void);
> +extern void seg6_hmac_exit(void);
> +extern int seg6_hmac_net_init(struct net *net);
> +extern void seg6_hmac_net_exit(struct net *net);
> +
> +#endif
> diff --git a/include/uapi/linux/seg6_hmac.h b/include/uapi/linux/seg6_hmac.h
> new file mode 100644
> index 0000000..0b5eda7
> --- /dev/null
> +++ b/include/uapi/linux/seg6_hmac.h
> @@ -0,0 +1,20 @@
> +#ifndef _UAPI_LINUX_SEG6_HMAC_H
> +#define _UAPI_LINUX_SEG6_HMAC_H
> +
> +#define SEG6_HMAC_SECRET_LEN 64
> +#define SEG6_HMAC_FIELD_LEN 32
> +
> +struct sr6_tlv_hmac {
> + __u8 type;
> + __u8 len;
> + __u16 reserved;
> + __be32 hmackeyid;
> + __u8 hmac[SEG6_HMAC_FIELD_LEN];
> +} __attribute__((packed));
> +
> +enum {
> + SEG6_HMAC_ALGO_SHA1 = 1,
> + SEG6_HMAC_ALGO_SHA256 = 2,
> +};
> +
> +#endif
> diff --git a/net/ipv6/seg6_hmac.c b/net/ipv6/seg6_hmac.c
> new file mode 100644
> index 0000000..91bd59a
> --- /dev/null
> +++ b/net/ipv6/seg6_hmac.c
> @@ -0,0 +1,432 @@
> +/*
> + * SR-IPv6 implementation -- HMAC functions
> + *
> + * Author:
> + * David Lebrun <david.lebrun@uclouvain.be>
> + *
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version
> + * 2 of the License, or (at your option) any later version.
> + */
> +
> +#include <linux/errno.h>
> +#include <linux/types.h>
> +#include <linux/socket.h>
> +#include <linux/sockios.h>
> +#include <linux/net.h>
> +#include <linux/netdevice.h>
> +#include <linux/in6.h>
> +#include <linux/icmpv6.h>
> +#include <linux/mroute6.h>
> +#include <linux/slab.h>
> +
> +#include <linux/netfilter.h>
> +#include <linux/netfilter_ipv6.h>
> +
> +#include <net/sock.h>
> +#include <net/snmp.h>
> +
> +#include <net/ipv6.h>
> +#include <net/protocol.h>
> +#include <net/transp_v6.h>
> +#include <net/rawv6.h>
> +#include <net/ndisc.h>
> +#include <net/ip6_route.h>
> +#include <net/addrconf.h>
> +#include <net/xfrm.h>
> +
> +#include <linux/cryptohash.h>
> +#include <crypto/hash.h>
> +#include <crypto/sha.h>
> +#include <net/seg6.h>
> +#include <net/genetlink.h>
> +#include <net/seg6_hmac.h>
> +#include <linux/random.h>
> +
> +static char * __percpu *hmac_ring;
> +
> +static struct seg6_hmac_algo hmac_algos[] = {
> + {
> + .alg_id = SEG6_HMAC_ALGO_SHA1,
> + .name = "hmac(sha1)",
> + },
> + {
> + .alg_id = SEG6_HMAC_ALGO_SHA256,
> + .name = "hmac(sha256)",
> + },
> +};
> +
> +static struct seg6_hmac_algo *__hmac_get_algo(u8 alg_id)
> +{
> + int i, alg_count;
> + struct seg6_hmac_algo *algo;
> +
> + alg_count = sizeof(hmac_algos) / sizeof(struct seg6_hmac_algo);
> + for (i = 0; i < alg_count; i++) {
> + algo = &hmac_algos[i];
> + if (algo->alg_id == alg_id)
> + return algo;
> + }
> +
> + return NULL;
> +}
> +
> +static int __do_hmac(struct seg6_hmac_info *hinfo, const char *text, u8 psize,
> + u8 *output, int outlen)
> +{
> + struct crypto_shash *tfm;
> + struct shash_desc *shash;
> + struct seg6_hmac_algo *algo;
> + int ret, dgsize;
> +
> + algo = __hmac_get_algo(hinfo->alg_id);
> + if (!algo)
> + return -ENOENT;
> +
> + tfm = *this_cpu_ptr(algo->tfms);
> +
> + dgsize = crypto_shash_digestsize(tfm);
> + if (dgsize > outlen) {
> + pr_debug("sr-ipv6: __do_hmac: digest size too big (%d / %d)\n",
> + dgsize, outlen);
> + return -ENOMEM;
> + }
> +
> + ret = crypto_shash_setkey(tfm, hinfo->secret, hinfo->slen);
> + if (ret < 0) {
> + pr_debug("sr-ipv6: crypto_shash_setkey failed: err %d\n", ret);
> + goto failed;
> + }
> +
> + shash = *this_cpu_ptr(algo->shashs);
> + shash->tfm = tfm;
> +
> + ret = crypto_shash_digest(shash, text, psize, output);
> + if (ret < 0) {
> + pr_debug("sr-ipv6: crypto_shash_digest failed: err %d\n", ret);
> + goto failed;
> + }
> +
> + return dgsize;
> +
> +failed:
> + return ret;
> +}
> +
> +int seg6_hmac_compute(struct seg6_hmac_info *hinfo, struct ipv6_sr_hdr *hdr,
> + struct in6_addr *saddr, u8 *output)
> +{
> + int plen, i, dgsize, wrsize;
> + char *ring, *off;
> + u8 tmp_out[SEG6_HMAC_MAX_DIGESTSIZE];
> + __be32 hmackeyid = cpu_to_be32(hinfo->hmackeyid);
> +
> + /* a 160-byte buffer for digest output allows to store highest known
> + * hash function (RadioGatun) with up to 1216 bits
> + */
> +
> + /* saddr(16) + first_seg(1) + cleanup(1) + keyid(4) + seglist(16n) */
> + plen = 16 + 1 + 1 + 4 + (hdr->first_segment + 1) * 16;
> +
> + /* this limit allows for 14 segments */
> + if (plen >= SEG6_HMAC_RING_SIZE)
> + return -EMSGSIZE;
> +
> + local_bh_disable();
> + ring = *this_cpu_ptr(hmac_ring);
> + off = ring;
> + memcpy(off, saddr, 16);
> + off += 16;
> + *off++ = hdr->first_segment;
> + *off++ = !!(sr_get_flags(hdr) & SR6_FLAG_CLEANUP) << 7;
> + memcpy(off, &hmackeyid, 4);
> + off += 4;
> +
> + for (i = 0; i < hdr->first_segment + 1; i++) {
> + memcpy(off, hdr->segments + i, 16);
> + off += 16;
> + }
> +
> + dgsize = __do_hmac(hinfo, ring, plen, tmp_out,
> + SEG6_HMAC_MAX_DIGESTSIZE);
> + local_bh_enable();
> +
> + if (dgsize < 0)
> + return dgsize;
> +
> + wrsize = SEG6_HMAC_FIELD_LEN;
> + if (wrsize > dgsize)
> + wrsize = dgsize;
> +
> + memset(output, 0, SEG6_HMAC_FIELD_LEN);
> + memcpy(output, tmp_out, wrsize);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(seg6_hmac_compute);
> +
> +/* checks if an incoming SR-enabled packet's HMAC status matches
> + * the incoming policy.
> + *
> + * called with rcu_read_lock()
> + */
> +bool seg6_hmac_validate_skb(struct sk_buff *skb)
> +{
> + struct inet6_dev *idev;
> + struct ipv6_sr_hdr *srh;
> + struct sr6_tlv_hmac *tlv;
> + struct seg6_hmac_info *hinfo;
> + struct net *net = dev_net(skb->dev);
> + u8 hmac_output[SEG6_HMAC_FIELD_LEN];
> +
> + idev = __in6_dev_get(skb->dev);
> +
> + srh = (struct ipv6_sr_hdr *)skb_transport_header(skb);
> +
> + tlv = seg6_get_tlv_hmac(srh);
> +
> + /* mandatory check but no tlv */
> + if (idev->cnf.seg6_require_hmac > 0 && !tlv)
> + return false;
> +
> + /* no check */
> + if (idev->cnf.seg6_require_hmac < 0)
> + return true;
> +
> + /* check only if present */
> + if (idev->cnf.seg6_require_hmac == 0 && !tlv)
> + return true;
> +
> + /* now, seg6_require_hmac >= 0 && tlv */
> +
> + hinfo = seg6_hmac_info_lookup(net, be32_to_cpu(tlv->hmackeyid));
> + if (!hinfo)
> + return false;
> +
> + if (seg6_hmac_compute(hinfo, srh, &ipv6_hdr(skb)->saddr, hmac_output))
> + return false;
> +
> + if (memcmp(hmac_output, tlv->hmac, SEG6_HMAC_FIELD_LEN) != 0)
> + return false;
> +
> + return true;
> +}
> +
> +/* called with rcu_read_lock() */
> +struct seg6_hmac_info *seg6_hmac_info_lookup(struct net *net, u32 key)
> +{
> + struct seg6_pernet_data *sdata = seg6_pernet(net);
> + struct seg6_hmac_info *hinfo;
> +
> + list_for_each_entry_rcu(hinfo, &sdata->hmac_infos, list) {
> + if (hinfo->hmackeyid == key)
> + return hinfo;
> + }
> +
> + return NULL;
> +}
> +EXPORT_SYMBOL(seg6_hmac_info_lookup);
> +
> +int seg6_hmac_info_add(struct net *net, u32 key, struct seg6_hmac_info *hinfo)
> +{
> + struct seg6_pernet_data *sdata = seg6_pernet(net);
> + struct seg6_hmac_info *old_hinfo;
> +
> + old_hinfo = seg6_hmac_info_lookup(net, key);
> + if (old_hinfo)
> + return -EEXIST;
> +
> + list_add_rcu(&hinfo->list, &sdata->hmac_infos);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(seg6_hmac_info_add);
> +
> +int seg6_hmac_info_del(struct net *net, u32 key, struct seg6_hmac_info *hinfo)
> +{
> + struct seg6_hmac_info *tmp;
> +
> + tmp = seg6_hmac_info_lookup(net, key);
> + if (!tmp)
> + return -ENOENT;
> +
> + /* entry was replaced, ignore deletion */
> + if (tmp != hinfo)
> + return -ENOENT;
> +
> + list_del_rcu(&hinfo->list);
> + synchronize_net();
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(seg6_hmac_info_del);
> +
> +static void seg6_hmac_info_flush(struct net *net)
> +{
> + struct seg6_pernet_data *sdata = seg6_pernet(net);
> + struct seg6_hmac_info *hinfo;
> +
> + seg6_pernet_lock(net);
> + while ((hinfo = list_first_or_null_rcu(&sdata->hmac_infos,
> + struct seg6_hmac_info,
> + list)) != NULL) {
> + list_del_rcu(&hinfo->list);
> + seg6_pernet_unlock(net);
> + synchronize_net();
> + kfree(hinfo);
> + seg6_pernet_lock(net);
> + }
> +
> + seg6_pernet_unlock(net);
> +}
> +
> +int seg6_push_hmac(struct net *net, struct in6_addr *saddr,
> + struct ipv6_sr_hdr *srh)
> +{
> + struct seg6_hmac_info *hinfo;
> + int err = -ENOENT;
> + struct sr6_tlv_hmac *tlv;
> +
> + tlv = seg6_get_tlv(srh, SR6_TLV_HMAC);
> + if (!tlv)
> + return -EINVAL;
> +
> + rcu_read_lock();
> +
> + hinfo = seg6_hmac_info_lookup(net, be32_to_cpu(tlv->hmackeyid));
> + if (!hinfo)
> + goto out;
> +
> + memset(tlv->hmac, 0, SEG6_HMAC_FIELD_LEN);
> + err = seg6_hmac_compute(hinfo, srh, saddr, tlv->hmac);
> +
> +out:
> + rcu_read_unlock();
> + return err;
> +}
> +EXPORT_SYMBOL(seg6_push_hmac);
> +
> +static int seg6_hmac_init_ring(void)
> +{
> + int i;
> +
> + hmac_ring = alloc_percpu(char *);
> +
> + if (!hmac_ring)
> + return -ENOMEM;
> +
> + for_each_possible_cpu(i) {
> + char *ring = kzalloc(SEG6_HMAC_RING_SIZE, GFP_KERNEL);
> +
> + if (!ring)
> + return -ENOMEM;
> +
> + *per_cpu_ptr(hmac_ring, i) = ring;
> + }
> +
> + return 0;
> +}
> +
> +static int seg6_hmac_init_algo(void)
> +{
> + int i, alg_count, cpu;
> + struct seg6_hmac_algo *algo;
> + struct crypto_shash *tfm;
> + struct shash_desc *shash;
> +
> + alg_count = sizeof(hmac_algos) / sizeof(struct seg6_hmac_algo);
> +
> + for (i = 0; i < alg_count; i++) {
> + int shsize;
> + struct crypto_shash **p_tfm;
> +
> + algo = &hmac_algos[i];
> + algo->tfms = alloc_percpu(struct crypto_shash *);
> + if (!algo->tfms)
> + return -ENOMEM;
> +
> + for_each_possible_cpu(cpu) {
> + tfm = crypto_alloc_shash(algo->name, 0, GFP_KERNEL);
> + if (IS_ERR(tfm))
> + return PTR_ERR(tfm);
> + p_tfm = per_cpu_ptr(algo->tfms, cpu);
> + *p_tfm = tfm;
> + }
> +
> + p_tfm = this_cpu_ptr(algo->tfms);
> + tfm = *p_tfm;
> +
> + shsize = sizeof(*shash) + crypto_shash_descsize(tfm);
> +
> + algo->shashs = alloc_percpu(struct shash_desc *);
> + if (!algo->shashs)
> + return -ENOMEM;
> +
> + for_each_possible_cpu(cpu) {
> + shash = kzalloc(shsize, GFP_KERNEL);
> + if (!shash)
> + return -ENOMEM;
> + *per_cpu_ptr(algo->shashs, cpu) = shash;
> + }
> + }
> +
> + return 0;
> +}
> +
> +int __init seg6_hmac_init(void)
> +{
> + int ret;
> +
> + ret = seg6_hmac_init_ring();
> + if (ret < 0)
> + goto out;
> +
> + ret = seg6_hmac_init_algo();
> +
> +out:
> + return ret;
> +}
> +
> +int __net_init seg6_hmac_net_init(struct net *net)
> +{
> + struct seg6_pernet_data *sdata = seg6_pernet(net);
> +
> + INIT_LIST_HEAD(&sdata->hmac_infos);
> + return 0;
> +}
> +
> +void __exit seg6_hmac_exit(void)
> +{
> + int i, alg_count, cpu;
> + struct seg6_hmac_algo *algo = NULL;
> +
> + for_each_possible_cpu(i) {
> + char *ring = *per_cpu_ptr(hmac_ring, i);
> +
> + kfree(ring);
> + }
> + free_percpu(hmac_ring);
> +
> + alg_count = sizeof(hmac_algos) / sizeof(struct seg6_hmac_algo);
> + for (i = 0; i < alg_count; i++) {
> + algo = &hmac_algos[i];
> + for_each_possible_cpu(cpu) {
> + struct crypto_shash *tfm;
> + struct shash_desc *shash;
> +
> + shash = *per_cpu_ptr(algo->shashs, cpu);
> + kfree(shash);
> + tfm = *per_cpu_ptr(algo->tfms, cpu);
> + crypto_free_shash(tfm);
> + }
> + free_percpu(algo->tfms);
> + free_percpu(algo->shashs);
> + }
> +}
> +
> +void __net_exit seg6_hmac_net_exit(struct net *net)
> +{
> + seg6_hmac_info_flush(net);
> +}
> --
> 2.7.3
>
^ permalink raw reply
* Re: [RFC 3/6] qedi: Add QLogic FastLinQ offload iSCSI driver framework.
From: Johannes Thumshirn @ 2016-10-19 10:02 UTC (permalink / raw)
To: manish.rangankar
Cc: lduncan, cleech, martin.petersen, jejb, linux-scsi, netdev,
Yuval.Mintz, QLogic-Storage-Upstream, Nilesh Javali,
Adheer Chandravanshi, Chad Dupuis, Saurav Kashyap, Arun Easi
In-Reply-To: <1476853273-22960-4-git-send-email-manish.rangankar@cavium.com>
On Wed, Oct 19, 2016 at 01:01:10AM -0400, manish.rangankar@cavium.com wrote:
> From: Manish Rangankar <manish.rangankar@cavium.com>
>
> The QLogic FastLinQ Driver for iSCSI (qedi) is the iSCSI specific module
> for 41000 Series Converged Network Adapters by QLogic.
>
> This patch consists of following changes:
> - MAINTAINERS Makefile and Kconfig changes for qedi,
> - PCI driver registration,
> - iSCSI host level initialization,
> - Debugfs and log level infrastructure.
>
> Signed-off-by: Nilesh Javali <nilesh.javali@cavium.com>
> Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
> Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
> Signed-off-by: Saurav Kashyap <saurav.kashyap@cavium.com>
> Signed-off-by: Arun Easi <arun.easi@cavium.com>
> Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
> ---
[...]
> +static inline void *qedi_get_task_mem(struct qed_iscsi_tid *info, u32 tid)
> +{
> + return (void *)(info->blocks[tid / info->num_tids_per_block] +
> + (tid % info->num_tids_per_block) * info->size);
> +}
Unnecessary cast here.
[...]
> +void
> +qedi_dbg_err(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
> + const char *fmt, ...)
> +{
> + va_list va;
> + struct va_format vaf;
> + char nfunc[32];
> +
> + memset(nfunc, 0, sizeof(nfunc));
> + memcpy(nfunc, func, sizeof(nfunc) - 1);
> +
> + va_start(va, fmt);
> +
> + vaf.fmt = fmt;
> + vaf.va = &va;
> +
> + if (likely(qedi) && likely(qedi->pdev))
> + pr_crit("[%s]:[%s:%d]:%d: %pV", dev_name(&qedi->pdev->dev),
> + nfunc, line, qedi->host_no, &vaf);
> + else
> + pr_crit("[0000:00:00.0]:[%s:%d]: %pV", nfunc, line, &vaf);
pr_crit, seriously?
[...]
> +static void qedi_int_fp(struct qedi_ctx *qedi)
> +{
> + struct qedi_fastpath *fp;
> + int id;
> +
> + memset((void *)qedi->fp_array, 0, MIN_NUM_CPUS_MSIX(qedi) *
> + sizeof(*qedi->fp_array));
> + memset((void *)qedi->sb_array, 0, MIN_NUM_CPUS_MSIX(qedi) *
> + sizeof(*qedi->sb_array));
I don't think the cast is necessary here.
[...]
> +static int qedi_setup_cid_que(struct qedi_ctx *qedi)
> +{
> + int i;
> +
> + qedi->cid_que.cid_que_base = kmalloc((qedi->max_active_conns *
> + sizeof(u32)), GFP_KERNEL);
> + if (!qedi->cid_que.cid_que_base)
> + return -ENOMEM;
> +
> + qedi->cid_que.conn_cid_tbl = kmalloc((qedi->max_active_conns *
> + sizeof(struct qedi_conn *)),
> + GFP_KERNEL);
Please use kmalloc_array() here.
[...]
> +/* MSI-X fastpath handler code */
> +static irqreturn_t qedi_msix_handler(int irq, void *dev_id)
> +{
> + struct qedi_fastpath *fp = dev_id;
> + struct qedi_ctx *qedi = fp->qedi;
> + bool wake_io_thread = true;
> +
> + qed_sb_ack(fp->sb_info, IGU_INT_DISABLE, 0);
> +
> +process_again:
> + wake_io_thread = qedi_process_completions(fp);
> + if (wake_io_thread) {
> + QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_DISC,
> + "process already running\n");
> + }
> +
> + if (qedi_fp_has_work(fp) == 0)
> + qed_sb_update_sb_idx(fp->sb_info);
> +
> + /* Check for more work */
> + rmb();
> +
> + if (qedi_fp_has_work(fp) == 0)
> + qed_sb_ack(fp->sb_info, IGU_INT_ENABLE, 1);
> + else
> + goto process_again;
> +
> + return IRQ_HANDLED;
> +}
You might want to consider workqueues here.
[...]
> +static int qedi_alloc_itt(struct qedi_ctx *qedi)
> +{
> + qedi->itt_map = kzalloc((sizeof(struct qedi_itt_map) *
> + MAX_ISCSI_TASK_ENTRIES), GFP_KERNEL);
that screams for kcalloc()
> + if (!qedi->itt_map) {
> + QEDI_ERR(&qedi->dbg_ctx,
> + "Unable to allocate itt map array memory\n");
> + return -ENOMEM;
> + }
> + return 0;
> +}
> +
> +static void qedi_free_itt(struct qedi_ctx *qedi)
> +{
> + kfree(qedi->itt_map);
> +}
> +
> +static struct qed_ll2_cb_ops qedi_ll2_cb_ops = {
> + .rx_cb = qedi_ll2_rx,
> + .tx_cb = NULL,
> +};
> +
> +static int qedi_percpu_io_thread(void *arg)
> +{
> + struct qedi_percpu_s *p = arg;
> + struct qedi_work *work, *tmp;
> + unsigned long flags;
> + LIST_HEAD(work_list);
> +
> + set_user_nice(current, -20);
> +
> + while (!kthread_should_stop()) {
> + spin_lock_irqsave(&p->p_work_lock, flags);
> + while (!list_empty(&p->work_list)) {
> + list_splice_init(&p->work_list, &work_list);
> + spin_unlock_irqrestore(&p->p_work_lock, flags);
> +
> + list_for_each_entry_safe(work, tmp, &work_list, list) {
> + list_del_init(&work->list);
> + qedi_fp_process_cqes(work->qedi, &work->cqe,
> + work->que_idx);
> + kfree(work);
> + }
> + spin_lock_irqsave(&p->p_work_lock, flags);
> + }
> + set_current_state(TASK_INTERRUPTIBLE);
> + spin_unlock_irqrestore(&p->p_work_lock, flags);
> + schedule();
> + }
> + __set_current_state(TASK_RUNNING);
> +
> + return 0;
> +}
A kthread with prio -20 IRQs turned off looping over a list, what could
possibly go wrong here. I bet you your favorite beverage that this will
cause Soft Lockups when running I/O stress tests BTDT.
[...]
> + if (mode != QEDI_MODE_RECOVERY) {
> + if (iscsi_host_add(qedi->shost, &pdev->dev)) {
> + QEDI_ERR(&qedi->dbg_ctx,
> + "Could not add iscsi host\n");
> + rc = -ENOMEM;
> + goto remove_host;
> + }
> +
> + /* Allocate uio buffers */
> + rc = qedi_alloc_uio_rings(qedi);
> + if (rc) {
> + QEDI_ERR(&qedi->dbg_ctx,
> + "UIO alloc ring failed err=%d\n", rc);
> + goto remove_host;
> + }
> +
> + rc = qedi_init_uio(qedi);
> + if (rc) {
> + QEDI_ERR(&qedi->dbg_ctx,
> + "UIO init failed, err=%d\n", rc);
> + goto free_uio;
> + }
> +
> + /* host the array on iscsi_conn */
> + rc = qedi_setup_cid_que(qedi);
> + if (rc) {
> + QEDI_ERR(&qedi->dbg_ctx,
> + "Could not setup cid que\n");
> + goto free_uio;
> + }
> +
> + rc = qedi_cm_alloc_mem(qedi);
> + if (rc) {
> + QEDI_ERR(&qedi->dbg_ctx,
> + "Could not alloc cm memory\n");
> + goto free_cid_que;
> + }
> +
> + rc = qedi_alloc_itt(qedi);
> + if (rc) {
> + QEDI_ERR(&qedi->dbg_ctx,
> + "Could not alloc itt memory\n");
> + goto free_cid_que;
> + }
> +
> + sprintf(host_buf, "host_%d", qedi->shost->host_no);
> + qedi->tmf_thread = create_singlethread_workqueue(host_buf);
> + if (!qedi->tmf_thread) {
> + QEDI_ERR(&qedi->dbg_ctx,
> + "Unable to start tmf thread!\n");
> + rc = -ENODEV;
> + goto free_cid_que;
> + }
> +
> + sprintf(host_buf, "qedi_ofld%d", qedi->shost->host_no);
> + qedi->offload_thread = create_workqueue(host_buf);
> + if (!qedi->offload_thread) {
> + QEDI_ERR(&qedi->dbg_ctx,
> + "Unable to start offload thread!\n");
> + rc = -ENODEV;
> + goto free_cid_que;
> + }
> +
> + /* F/w needs 1st task context memory entry for performance */
> + set_bit(QEDI_RESERVE_TASK_ID, qedi->task_idx_map);
> + atomic_set(&qedi->num_offloads, 0);
> + }
> +
> + QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO,
> + "QLogic FastLinQ iSCSI Module qedi %s, FW %d.%d.%d.%d\n",
> + QEDI_MODULE_VERSION, FW_MAJOR_VERSION, FW_MINOR_VERSION,
> + FW_REVISION_VERSION, FW_ENGINEERING_VERSION);
> + return 0;
Please put the QEDI_INFO() above the if and invert the condition.
Thanks,
Johannes
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply
* Re: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers
From: Jarod Wilson @ 2016-10-19 14:23 UTC (permalink / raw)
To: Haiyang Zhang
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
virtualization@lists.linux-foundation.org, KY Srinivasan,
Michael S. Tsirkin, Shrikrishna Khare, VMware, Inc.
In-Reply-To: <BLUPR03MB141289B9E24503DF35D5AAC3CAD20@BLUPR03MB1412.namprd03.prod.outlook.com>
On Wed, Oct 19, 2016 at 02:07:47PM +0000, Haiyang Zhang wrote:
>
>
> > -----Original Message-----
> > From: Jarod Wilson [mailto:jarod@redhat.com]
> > Sent: Tuesday, October 18, 2016 10:34 PM
> > To: linux-kernel@vger.kernel.org
> > Cc: Jarod Wilson <jarod@redhat.com>; netdev@vger.kernel.org;
> > virtualization@lists.linux-foundation.org; KY Srinivasan
> > <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; Michael S.
> > Tsirkin <mst@redhat.com>; Shrikrishna Khare <skhare@vmware.com>; VMware,
> > Inc. <pv-drivers@vmware.com>
> > Subject: [PATCH net-next 5/6] net: use core MTU range checking in virt
> > drivers
> >
> > hyperv_net:
> > - set min/max_mtu
> >
> > virtio_net:
> > - set min/max_mtu
> > - remove virtnet_change_mtu
> >
> > vmxnet3:
> > - set min/max_mtu
> >
> > CC: netdev@vger.kernel.org
> > CC: virtualization@lists.linux-foundation.org
> > CC: "K. Y. Srinivasan" <kys@microsoft.com>
> > CC: Haiyang Zhang <haiyangz@microsoft.com>
> > CC: "Michael S. Tsirkin" <mst@redhat.com>
> > CC: Shrikrishna Khare <skhare@vmware.com>
> > CC: "VMware, Inc." <pv-drivers@vmware.com>
> > Signed-off-by: Jarod Wilson <jarod@redhat.com>
> > ---
> > drivers/net/hyperv/hyperv_net.h | 4 ++--
> > drivers/net/hyperv/netvsc_drv.c | 14 +++++++-------
> > drivers/net/virtio_net.c | 23 ++++++++++-------------
> > drivers/net/vmxnet3/vmxnet3_drv.c | 7 ++++---
> > 4 files changed, 23 insertions(+), 25 deletions(-)
> >
> > diff --git a/drivers/net/hyperv/hyperv_net.h
> > b/drivers/net/hyperv/hyperv_net.h
> > index f4fbcb5..3958ada 100644
> > --- a/drivers/net/hyperv/hyperv_net.h
> > +++ b/drivers/net/hyperv/hyperv_net.h
> > @@ -606,8 +606,8 @@ struct nvsp_message {
> > } __packed;
> >
> >
> > -#define NETVSC_MTU 65536
> > -#define NETVSC_MTU_MIN 68
> > +#define NETVSC_MTU 65535
>
> Why change it to 65535? For Hyperv host, this should be 65536.
Forgot to call this change out, sorry. That was changed, because of
IP_MAX_MTU being 0xFFFFU -> 65535.
> > @@ -1343,6 +1336,13 @@ static int netvsc_probe(struct hv_device *dev,
> >
> > netif_carrier_off(net);
> >
> > + /* MTU range: 68 - 1500 or 65521 */
> > + net->min_mtu = NETVSC_MTU_MIN;
> > + if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2)
> > + net->max_mtu = NETVSC_MTU - ETH_HLEN;
> > + else
> > + net->max_mtu = ETH_DATA_LEN;
> > +
> > netvsc_init_settings(net);
> >
> > net_device_ctx = netdev_priv(net);
>
> nvdev->nvsp_version is not set until after rndis_filter_device_add()
> is successfully completed.
> You need to move this part to the place just before this line:
> ret = register_netdev(net);
Okay, will fix that up.
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply
* Re: bad commit touching stmmac_ptp.c
From: Giuseppe CAVALLARO @ 2016-10-19 7:16 UTC (permalink / raw)
To: Nicolas Pitre
Cc: Alexandre TORGUE, Rayagond Kokatanur, David S. Miller, netdev
In-Reply-To: <alpine.LFD.2.20.1610182339340.25105@knanqh.ubzr>
Hello Nicolas
I have just sent a new patch to try to fix the problems you
raised.
Please let me know if
[PATCH (net.git)] stmmac: fix and review the ptp registration
actually covers and fixes the points.
FYI, I am trying to review the PTP, especially for
for the GMAC4, in these days so I will send other
patches on top of this if OK.
Thanks for your advice and warning.
Peppe
On 10/19/2016 6:16 AM, Nicolas Pitre wrote:
> Hello,
>
> I noticed a recently added commit 7086605a6a ("stmmac: fix error check
> when init ptp") to the mainline linux tree from you. This commit is
> wrong. The affected code now reads as:
>
> int stmmac_ptp_register(struct stmmac_priv *priv)
> {
> spin_lock_init(&priv->ptp_lock);
> priv->ptp_clock_ops = stmmac_ptp_clock_ops;
>
> priv->ptp_clock = ptp_clock_register(&priv->ptp_clock_ops,
> priv->device);
> if (IS_ERR(priv->ptp_clock)) {
> priv->ptp_clock = NULL;
> return PTR_ERR(priv->ptp_clock);
> }
>
> spin_lock_init(&priv->ptp_lock);
>
> netdev_dbg(priv->dev, "Added PTP HW clock successfully\n");
>
> return 0;
> }
>
> Firstly, you basically reverted the change I did with commit
> efee95f42b ("ptp_clock: future-proofing drivers against PTP subsystem
> becoming optional"). Please have a look at that commit and ponder its
> implications.
>
> Secondly, the error you're actually returning to the caller with your
> patch is actually PTR_ERR(NULL) which is basically a more convoluted way
> to return the same value as what was returned before your patch, which
> is probably not what you intended.
>
> And finally you added a needless initialization of priv->ptp_lock given
> that this was already done a few lines before that addition.
>
> Was this patch actually reviewed?
>
>
> Nicolas
>
^ permalink raw reply
* Re: [PATCH net-next 5/6] net: use core MTU range checking in virt drivers
From: Jarod Wilson @ 2016-10-19 14:17 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: linux-kernel, netdev, virtualization, K. Y. Srinivasan,
Haiyang Zhang, Shrikrishna Khare, VMware, Inc.
In-Reply-To: <20161019170330-mutt-send-email-mst@kernel.org>
On Wed, Oct 19, 2016 at 05:03:43PM +0300, Michael S. Tsirkin wrote:
> On Wed, Oct 19, 2016 at 04:59:46PM +0300, Michael S. Tsirkin wrote:
> > On Tue, Oct 18, 2016 at 10:33:32PM -0400, Jarod Wilson wrote:
> > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > > index fad84f3..4885a42 100644
> > > --- a/drivers/net/virtio_net.c
> > > +++ b/drivers/net/virtio_net.c
> > > @@ -1419,17 +1419,6 @@ static const struct ethtool_ops virtnet_ethtool_ops = {
> > > .set_settings = virtnet_set_settings,
> > > };
> > >
> > > -#define MIN_MTU 68
> > > -#define MAX_MTU 65535
> > > -
> > > -static int virtnet_change_mtu(struct net_device *dev, int new_mtu)
> > > -{
> > > - if (new_mtu < MIN_MTU || new_mtu > MAX_MTU)
> > > - return -EINVAL;
> > > - dev->mtu = new_mtu;
> > > - return 0;
> > > -}
> > > -
> > > static const struct net_device_ops virtnet_netdev = {
> > > .ndo_open = virtnet_open,
> > > .ndo_stop = virtnet_close,
> > > @@ -1437,7 +1426,6 @@ static const struct net_device_ops virtnet_netdev = {
> > > .ndo_validate_addr = eth_validate_addr,
> > > .ndo_set_mac_address = virtnet_set_mac_address,
> > > .ndo_set_rx_mode = virtnet_set_rx_mode,
> > > - .ndo_change_mtu = virtnet_change_mtu,
> > > .ndo_get_stats64 = virtnet_stats,
> > > .ndo_vlan_rx_add_vid = virtnet_vlan_rx_add_vid,
> > > .ndo_vlan_rx_kill_vid = virtnet_vlan_rx_kill_vid,
> > > @@ -1748,6 +1736,9 @@ static bool virtnet_validate_features(struct virtio_device *vdev)
> > > return true;
> > > }
> > >
> > > +#define MIN_MTU ETH_MIN_MTU
> > > +#define MAX_MTU 65535
> > > +
> >
> > Do we need a common macro for this?
>
> I think it's actually IP_MAX_MTU.
Ah, yes, it is. I'm not sure why I didn't use that...
--
Jarod Wilson
jarod@redhat.com
^ 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