Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp968569imm; Mon, 9 Jul 2018 14:19:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpduAqvssPSjVWWzNyu/MRCHzB0JvlJginNdVB1Kr/3Bs9APaqzHSUKMiz9o57t2e8Ii0YR9 X-Received: by 2002:a63:4283:: with SMTP id p125-v6mr20592838pga.142.1531171146335; Mon, 09 Jul 2018 14:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531171146; cv=none; d=google.com; s=arc-20160816; b=UGhWRj/P1s88PsVUxfvto2C8HFIB7c8gSDPOknTE5y6pEPh4blH/vKM0QQAtFV0keP ZNTWU6ddypiMBX612bsj8GTMFBs+bMuxBD5NKfCnzaeH0qlosT/laz8XNb07Zw7OpFpI tdOK59hASOGe09BokdLuTXjJzTpQw4AmL2Ykbg84KgAivHxugV/1/rDbnf9yaOqjWXhA K5JmyIt9eH1xy2BlBbP4a1jvTZZHZpjw1ZhXpdAlWIEi0ysG+6Cza9sODAKuAF+1ssmN 46f4W+XstwyNnOcuHzvkFMrzdHD7w0ly/zdoboTU//w7sHqFGpoOvHEyu4kwuh8K0q5D lRoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=7Yo4EBSOz2hbXRb22cox2tJc/ZCWlAas5nbC7zP7umU=; b=0wwll2sphRStRNQvM5FhcLSPBXwTI/iBB2wB8a9FVbipF+jbroQZ/UBbZzSuBaXvMt wdb+mEIbtHy8VtKoHe/FBhn5nY7ENdNkdSeO65e+ywQ8LYToneiJN8Am1wk8HjHxdo94 +ZgVnjiP8k3yHb3PTBZU05poA1ezJUeuPG+5V6AR0x87HN7mOZsKvqStD5FH53AQjMOx 6E8JkxW2d/6Yj8pufH5AiW68gOZT7pgtLDGAMnfA08SgiIgovZIyvW4XPMZgyFtxD/vG ns7F+1cA3WpqDX/6O6VJ9MB3p2wtaQBJWoZzgXwqBpjS22PRHP0VS6E3vGPfC2tpsFiq Cuyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mojatatu-com.20150623.gappssmtp.com header.s=20150623 header.b=lYm8bIED; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10-v6si1442141pfh.3.2018.07.09.14.18.49; Mon, 09 Jul 2018 14:19:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mojatatu-com.20150623.gappssmtp.com header.s=20150623 header.b=lYm8bIED; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933236AbeGIVSG (ORCPT + 99 others); Mon, 9 Jul 2018 17:18:06 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:36078 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932928AbeGIVSE (ORCPT ); Mon, 9 Jul 2018 17:18:04 -0400 Received: by mail-it0-f66.google.com with SMTP id j185-v6so28138164ite.1 for ; Mon, 09 Jul 2018 14:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7Yo4EBSOz2hbXRb22cox2tJc/ZCWlAas5nbC7zP7umU=; b=lYm8bIEDb1s53MvqFmwDNEE9wMiWgc3HCd++E4S+N3r2fR9AdDbNtLjdS3mzMKH+V0 geIdCoBVzI5XXyUs+EJ9+lGa+L97rwJ7M1SNENHvLrp+PaEnWBOrg2SMf4nunK4TcndR DuwifUfkUSxpvXHPBkp5zeVS5S1xdrMYF8qG6PAUoQrxj+8sxFXnK5f46HNj1W6R1xn9 tn03DEitqy7sm9IdGlRQyxPSE9z2xU/cPUMX1GniyJUpqszNgtZJF7gO5SI1CFTPXi8H 9ic4wMmQlzl6Ht8FaFFsnS0LWPvE6z0jHiyDM2XIpyafBbxmzJXBqzvmlisYcgWMzeKD SDAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7Yo4EBSOz2hbXRb22cox2tJc/ZCWlAas5nbC7zP7umU=; b=YvUuzPKGYaDXKGAMsvIXlS38rMGxpkU19MZVReysiWwVyo6fu18+K8eNlTmvEGXkz2 cn0rE+OZBcsS1ZCOQXXSB6xr3Pn3Zf06SprmdQGud81oxoyAv0JFLV+8BN683hXGQe5M 7BkDL56xwiP97YYYLxn3AK2Jg7qfEpympUlJaXbkBkIbVKWb/uLVUBwqQCgHYduubz65 MpUrW/+l6JFBdLJ+KYAIu5j9FE+WvSjLwesiF2//imt7y1gLuMgu2klyu+bEJBk0AyFk kB1pm2JZ8WT3b1k5cpPDfiwvdvAPLE9n08zGO8PqaCMzlnv8YxXxLqnvaosial7LY+Oi vQkA== X-Gm-Message-State: APt69E0YlFrG6R/m4NxA7FbAuPI1BCOh0PBUHAAvngeIIBouAzf+L/fr jCDN3ePstb+xvb1idnYmYa60Dg== X-Received: by 2002:a24:c246:: with SMTP id i67-v6mr18319489itg.45.1531171083968; Mon, 09 Jul 2018 14:18:03 -0700 (PDT) Received: from x220t ([64.26.149.125]) by smtp.gmail.com with ESMTPSA id l26-v6sm742909ioh.27.2018.07.09.14.18.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jul 2018 14:18:03 -0700 (PDT) Date: Mon, 9 Jul 2018 17:17:54 -0400 From: Alexander Aring To: Stefan Schmidt Cc: =?utf-8?B?Q2zDqW1lbnQgUMOpcm9u?= , Romuald Cari , linux-wpan@vger.kernel.org, Alexander Aring , Stefan Schmidt , "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?Q?Cl=C3=A9ment?= Peron Subject: Re: [PATCH] ieee802154: add rx LQI from userspace Message-ID: <20180709211754.v2oqe3y77fvdd5qa@x220t> References: <20180607140802.22666-1-peron.clem@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2018 at 10:49:08AM +0200, Stefan Schmidt wrote: > Hello Clement. > > Finally coming to review the patch. Sorry for the delay. .... > > > > + if (ro->want_lqi) { > > + err = put_cmsg(msg, SOL_IEEE802154, WPAN_WANTLQI, > > + sizeof(uint8_t), &(mac_cb(skb)->lqi)); > > + if (err) > > + goto done; > > + } > > + > > I am wondering a bit about the LQI you get back here. Maybe Alex can > also shed some lights on it. The LQI value stored here is always from > the last frame send (to any peer)? Or is it the last frame send to this > specific peer? > LQI is available only for per received frame [0], it's important to store it always when address information are available for the received frame. The peer you get from the socket layer so far I understood. Storing means: maybe with some intelligent logic behind to calculate the average... one LQI value alone don't say anything. With this patch you can do such logic in user space as a LQI to peer database[1]. Otherwise we already talked about a similar handling as wireless does with "iw ... station dump" to have such handling in kernel - out of scope of this discussion. Side notes: [0] Ack frames has no address information but it refers to a transmitted frame with address information... so not always true. But ack handling is offloaded anyhow in the most cases. [1] Getting complicated how to map a short/pan _and_ extended to _ONE_ peer entry. -> MLME assoc()/IPv6 ndisc information are needed here. - Alex