From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 639212EB5A9 for ; Tue, 23 Dec 2025 17:26:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.89.44.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766510806; cv=none; b=FKz96WHi6jCqkPsC5kdqpZiWmQH8Fn7XijUNN18DXK1moWGgh+Zc4i+sUVlyGJvUKMqSvntfWb+nBJKlgXX+5y6QfEXfk08WBYO9VJk1xCeJIy6D9kUaDeygrGkAHkJOJWV1rrEMBtUpEmEtiWGhbZvKCxJRauRlsoZXdNOY/GM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766510806; c=relaxed/simple; bh=XSJ3t4H9M1TMfnzN7PD9gX5FxnIN765e9eHeJ49crCs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PSZk0IaPBavFQne3GzHobjwJCuOxquTbp6lPuozwgTQ5oWOyYs+5SwW2SVuUiBPNhZfs6JEVLtTpM9BWAU5XlhS069+jUORtFhbc9hYbto0UI/QEnZl/pxTbgN+9YCLr4dXxCBdICa/DucTxryp6RuK89J57NZXDZ6HP4sOKv1A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=embeddedor.com; spf=pass smtp.mailfrom=embeddedor.com; dkim=pass (2048-bit key) header.d=embeddedor.com header.i=@embeddedor.com header.b=op1mCuoQ; arc=none smtp.client-ip=35.89.44.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=embeddedor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=embeddedor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=embeddedor.com header.i=@embeddedor.com header.b="op1mCuoQ" Received: from eig-obgw-6007b.ext.cloudfilter.net ([10.0.30.166]) by cmsmtp with ESMTPS id Y5hvvXP3LKjfoY69kv6x9Y; Tue, 23 Dec 2025 17:26:44 +0000 Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with ESMTPS id Y69jvrXiCh8QWY69jvDsPR; Tue, 23 Dec 2025 17:26:43 +0000 X-Authority-Analysis: v=2.4 cv=Mcdsu4/f c=1 sm=1 tr=0 ts=694ad0d3 a=1YbLdUo/zbTtOZ3uB5T3HA==:117 a=ujWNxKVE5dX343uAl30YYw==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=7T7KSl7uo7wA:10 a=_Wotqz80AAAA:8 a=VwQbUJbxAAAA:8 a=YmdrnEFYGWStXPIrsUQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=buJP51TR1BpY-zbLSsyS:22 a=2aFnImwKRvkU0tJ3nQRT:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/Jg/tNk1DtHtQi2YwDuRF07lJtJQzeCyZZH5QP628sE=; b=op1mCuoQID2G2HO6UV1iY4uDSu FT/eO0+8M+OgwXxNTKqKfQ140Vajy8e8sg3U6wM24KIc7sWoXHThEazRuIy87ul9ds9P72U/tfkE5 zdroncZRohWy9gHfNbifA42hj3OlKxsH6rTl9ujUbFaVYn2Peud5K48FbzLRwsaaL2Do/rdrve8zY OqdpWUL7dscTkXdemo9LSnvmvailKzUakmCwnBgEZytptsUjrPqWnh9q3kDwDk3pRTF5Qw4Yo9HJ9 x/G6yKkhL+SGVFqeWlNF+BogblxQqs1BauYP+sfCDxoIaMQKQ+JgJEtSohfrMS5UW18izCNuHElE1 Ou+y2RmA==; Received: from i118-18-233-1.s41.a027.ap.plala.or.jp ([118.18.233.1]:60306 helo=[10.242.145.44]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.1) (envelope-from ) id 1vY69i-00000002Rpr-0GJK; Tue, 23 Dec 2025 11:26:42 -0600 Message-ID: <911ba345-7da6-4d05-955a-d33dd4b1e8c8@embeddedor.com> Date: Wed, 24 Dec 2025 02:26:22 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/1] RDMA/rxe: Avoid -Wflex-array-member-not-at-end warnings To: Greg Sword Cc: Zhu Yanjun , zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" References: <20251223044129.6232-1-yanjun.zhu@linux.dev> Content-Language: en-US From: "Gustavo A. R. Silva" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 118.18.233.1 X-Source-L: No X-Exim-ID: 1vY69i-00000002Rpr-0GJK X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: i118-18-233-1.s41.a027.ap.plala.or.jp ([10.242.145.44]) [118.18.233.1]:60306 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 2 X-Org: HG=hgshared;ORG=hostgator; X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfDEGg5ttu/nmRf/WagjDvFAOlSnbxytq5ZFNYX9OAd4r2e30XiLbSYKqZLTT9VZTnmowkR/ZpKfKmhl3R1uDrHFMuKGOuLnbQIp0UyUiIGoaJ7mCb/PR sCHbUqXpFtEA1qI2z9/ig15BkULIODxMJ83zwS43S1ZKW62x6Yja6oFTXDOl3v+jfE3ah+AVrY5PZawp+ftc1P1wID8BAz5hJ3/ho+hug7/m4hDu6jbNODjl On 12/24/25 02:19, Greg Sword wrote: > On Wed, Dec 24, 2025 at 12:59 AM Gustavo A. R. Silva > wrote: >> >> >> >> On 12/24/25 01:38, Greg Sword wrote: >>> On Tue, Dec 23, 2025 at 5:35 PM Gustavo A. R. Silva >>> wrote: >>>> >>>> >>>> >>>> On 12/23/25 13:41, Zhu Yanjun wrote: >>>>> From: "Gustavo A. R. Silva" >>>>> >>>>> -Wflex-array-member-not-at-end was introduced in GCC-14, and we are >>>>> getting ready to enable it, globally. >>>>> >>>>> Use the new TRAILING_OVERLAP() helper to fix the following warning: >>>>> >>>>> 21 drivers/infiniband/sw/rxe/rxe_verbs.h:271:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] >>>>> >>>>> This helper creates a union between a flexible-array member (FAM) and a >>>>> set of MEMBERS that would otherwise follow it. >>>>> >>>>> This overlays the trailing MEMBER struct ib_sge sge[RXE_MAX_SGE]; onto >>>>> the FAM struct rxe_recv_wqe::dma.sge, while keeping the FAM and the >>>>> start of MEMBER aligned. >>>>> >>>>> The static_assert() ensures this alignment remains, and it's >>>>> intentionally placed inmediately after the related structure --no >>>>> blank line in between. >>>>> >>>>> Lastly, move the conflicting declaration struct rxe_resp_info resp; >>>>> to the end of the corresponding structure. >>>>> >>>>> Reviewed-by: Zhu Yanjun >>>>> Signed-off-by: Gustavo A. R. Silva >>>> >>>> NACK. >>> >>> Just a small reminder about community conventions: reviewers can NACK >>> a patch, but authors generally should not NACK their own patches. >> >> It's obvious that you don't understand what's going on here. > > I’ve read through the full discussion and understand how this evolved. > Based on that, I believe there may be a misunderstanding on your side. Okay, thanks for your contribution then. -Gustavo > >> >>>> I didn't write this patch. >> >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> This line should've given you a clue. >> >> -Gustavo >> >>>> >>>> Please, don't ever submit modified patches on my behalf. >>>> >>>>> --- >>>>> V2->V3: Replace struct ib_sge with struct rxe_sge >>>> >>>> Patch granularity is a fundamental thing. Changes addressing different >>>> issues should not be mixed together. Previously existing issues (if any) >>>> must be addressed in separate patches. >>>> >>>> -Gustavo >>>> >>>>> --- >>>>> drivers/infiniband/sw/rxe/rxe_verbs.h | 18 +++++++++++------- >>>>> 1 file changed, 11 insertions(+), 7 deletions(-) >>>>> >>>>> diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h >>>>> index fd48075810dd..3ffd7be8e7b1 100644 >>>>> --- a/drivers/infiniband/sw/rxe/rxe_verbs.h >>>>> +++ b/drivers/infiniband/sw/rxe/rxe_verbs.h >>>>> @@ -219,12 +219,6 @@ struct rxe_resp_info { >>>>> u32 rkey; >>>>> u32 length; >>>>> >>>>> - /* SRQ only */ >>>>> - struct { >>>>> - struct rxe_recv_wqe wqe; >>>>> - struct ib_sge sge[RXE_MAX_SGE]; >>>>> - } srq_wqe; >>>>> - >>>>> /* Responder resources. It's a circular list where the oldest >>>>> * resource is dropped first. >>>>> */ >>>>> @@ -232,7 +226,15 @@ struct rxe_resp_info { >>>>> unsigned int res_head; >>>>> unsigned int res_tail; >>>>> struct resp_res *res; >>>>> + >>>>> + /* SRQ only */ >>>>> + /* Must be last as it ends in a flexible-array member. */ >>>>> + TRAILING_OVERLAP(struct rxe_recv_wqe, wqe, dma.sge, >>>>> + struct rxe_sge sge[RXE_MAX_SGE]; >>>>> + ) srq_wqe; >>>>> }; >>>>> +static_assert(offsetof(struct rxe_resp_info, srq_wqe.wqe.dma.sge) == >>>>> + offsetof(struct rxe_resp_info, srq_wqe.sge)); >>>>> >>>>> struct rxe_qp { >>>>> struct ib_qp ibqp; >>>>> @@ -269,7 +271,6 @@ struct rxe_qp { >>>>> >>>>> struct rxe_req_info req; >>>>> struct rxe_comp_info comp; >>>>> - struct rxe_resp_info resp; >>>>> >>>>> atomic_t ssn; >>>>> atomic_t skb_out; >>>>> @@ -289,6 +290,9 @@ struct rxe_qp { >>>>> spinlock_t state_lock; /* guard requester and completer */ >>>>> >>>>> struct execute_work cleanup_work; >>>>> + >>>>> + /* Must be last as it ends in a flexible-array member. */ >>>>> + struct rxe_resp_info resp; >>>>> }; >>>>> >>>>> enum { >>>> >>>> >>