Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp768762ybm; Wed, 27 May 2020 07:36:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzs1KAFnu8vHnr3CraqOrXv1ASPQIGtBHEu/Kw0Lo056GtrszSHrEjxsY8oI4nESqCv+tKN X-Received: by 2002:a17:906:144e:: with SMTP id q14mr6438846ejc.450.1590590196667; Wed, 27 May 2020 07:36:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590590196; cv=none; d=google.com; s=arc-20160816; b=jdeXWDeEgEzKZHOWti3PtH5e+t1vtVKQr5PIS2cUgzmGiDwqMF9J+B8Tb/2kJ4zode AiaQoSOzbiJhx66MuFxLzQE3e6XydoHCUnJCFkQI6qcjH1s52Ua15R46w8l1opk2Nj72 e+ud2Rbzxljaf6EBlm4sK52mw/HqOqKDDlRUHF/JMi+l4bhr659gSNrAv9qssDwtV7+L gpMywj4P7aRdqR7AuZxRY5Y9P0xQsyvyTeb4xJN4vMMy9Nr8Nu0qUq6VNn0oFl0OO5jn qXL9tVbVEImoccFDhypgmNYpC743k+LlxwgAS9wLK1abKHFR2ZMlNgqLYLNDXWq/r7b6 Dnag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=kKODyzllcw2lFIi/cxxqAuc1K5xwQlJL49bGI5qBaNE=; b=xXCpJTDqfNVphWP+8SEB28c2JnLXNsTjo63Y8i9iZQnyWIRzAFUw0Qq8qTYGTKgE/6 VgTl1+s95KkKMjHo1EFv1aeuoFU6l6wdvRliGmlmbfAJecU224nB3XssK7geNk5M6g6o 6Gd0d6whg8B5dSlgT0n+gke5nMzymTdCF/+xcaUpxlHW/ipYjBgIt+bvUsYiELi0vQWq 3iKI+rr9nL1xzeWHR8Iddu7i9vvjgqAfXUwEd52TbD6TMgCoVwP1ebZLRaZW3qDqlRX7 Uk7H1RxPa9qPLdPfr4W3GK+N93jUgYcmUhpC8eASsGjGrMcLGVwxZAeulNANfcoiHnwL Td2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds3si2868429ejc.545.2020.05.27.07.36.11; Wed, 27 May 2020 07:36:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389300AbgE0Ofg (ORCPT + 99 others); Wed, 27 May 2020 10:35:36 -0400 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:58248 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389205AbgE0Ofg (ORCPT ); Wed, 27 May 2020 10:35:36 -0400 Received: from [192.168.178.45] (unknown [87.147.49.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id 33CE3580063; Wed, 27 May 2020 16:35:34 +0200 (CEST) Subject: Re: [PATCH 2/3] nl80211: add control port tx status method To: Johannes Berg Cc: linux-wireless@vger.kernel.org References: <20200508144202.7678-1-markus.theil@tu-ilmenau.de> <20200508144202.7678-3-markus.theil@tu-ilmenau.de> From: Markus Theil Message-ID: <5a3f01a8-45d2-47c6-3e1b-32ef33be4e95@tu-ilmenau.de> Date: Wed, 27 May 2020 16:35:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 5/26/20 3:37 PM, Johannes Berg wrote: >> struct idr ack_status_frames; >> spinlock_t ack_status_lock; >> >> + u64 ctrl_port_cookie_counter; > We have a u64 for other things (remain-on-channel), perhaps should just > share? It's not going to overflow even if shared ... Sounds fair, I'll consolidate to use the roc cookie variable. >> /* disable bottom halves when entering the Tx path */ >> local_bh_disable(); >> - __ieee80211_subif_start_xmit(skb, dev, flags, 0); >> + __ieee80211_subif_start_xmit(skb, dev, flags, 0, NULL); > This is a little awkward, any way to avoid that? Probably not ... I first tried to read out the cookie from the skb, in order to avoid adding this new argument. Problematic with this approach was, that the skb can be deleted in some failure cases. Therefore I went with this additional argument. >> +static u16 ieee80211_store_ack_skb(struct ieee80211_local *local, >> struct sk_buff *skb, >> - u32 *info_flags) >> + u32 *info_flags, >> + bool use_socket, >> + u64 *cookie) >> { >> - struct sk_buff *ack_skb = skb_clone_sk(skb); >> + struct sk_buff *ack_skb; >> u16 info_id = 0; >> >> + if (use_socket) > You can check skb->sk and not need the additional parameter. Thanks for the hint! > >> if (unlikely(!multicast && skb->sk && >> skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) >> - info_id = ieee80211_store_ack_skb(local, skb, &info_flags); >> + info_id = ieee80211_store_ack_skb(local, skb, &info_flags, >> + true, NULL); >> + >> + if (unlikely(!multicast && ctrl_flags & IEEE80211_TX_CTL_REQ_TX_STATUS)) >> + info_id = ieee80211_store_ack_skb(local, skb, &info_flags, >> + false, cookie); > I think this should be rolled into one condition, since you no longer > need the true/false if you check skb->sk. And 'cookie' is already NULL > in those other cases so you can pass it unconditionally. Ok >> @@ -2765,8 +2795,9 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, >> if (skb_shared(skb)) { >> struct sk_buff *tmp_skb = skb; >> >> - /* can't happen -- skb is a clone if info_id != 0 */ >> - WARN_ON(info_id); >> + if (!(ctrl_flags & IEEE80211_TX_CTL_REQ_TX_STATUS)) >> + /* can't happen -- skb is a clone if info_id != 0 */ >> + WARN_ON(info_id); > This I don't understand, but if it really is needed then you should > adjust the comment and roll it into a single WARN_ON(). After adapting my patch with the changes lined out above, I have tested again and the warning did not occur. Therefore I've ommited changing the warning behavior from the updated patch. > Also, please put all the remaining mac80211 changes into one patch - I > already put all the other changes in. > > johannes > Thanks for your feedback! I'll send an updated v2 with a single patch.