From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B973D50 for ; Wed, 29 Nov 2023 19:34:25 -0800 (PST) X-QQ-mid:Yeas43t1701315143t650t15003 Received: from 3DB253DBDE8942B29385B9DFB0B7E889 (jiawenwu@trustnetic.com [183.128.129.197]) X-QQ-SSF:00400000000000F0FSF000000000000 From: =?utf-8?b?Smlhd2VuIFd1?= X-BIZMAIL-ID: 4404046532227934155 To: "'Andrew Lunn'" Cc: , , , , , , , References: <20231122102226.986265-1-jiawenwu@trustnetic.com> <20231122102226.986265-3-jiawenwu@trustnetic.com> <4a36b46d-3f71-430f-8158-da58769ae52a@lunn.ch> In-Reply-To: <4a36b46d-3f71-430f-8158-da58769ae52a@lunn.ch> Subject: RE: [PATCH net-next 2/5] net: wangxun: add ethtool_ops for ring parameters Date: Thu, 30 Nov 2023 11:32:22 +0800 Message-ID: <029601da233d$d4b8a9a0$7e29fce0$@trustnetic.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: zh-cn Thread-Index: AQIZ7m4FfqhO6yXRbjtvxmXj2jKlSQJjneaLAvi6Bwev57q7YA== X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz5a-1 > > +int wx_set_ring(struct wx *wx, u32 new_tx_count, u32 new_rx_count) > > +{ > > + struct wx_ring *temp_ring; > > + int i, err = 0; > > + > > + /* allocate temporary buffer to store rings in */ > > + i = max_t(int, wx->num_tx_queues, wx->num_rx_queues); > > + temp_ring = vmalloc(i * sizeof(struct wx_ring)); > > So it is O.K. for the pages to be scattered around the physical > address space, not contiguous. Does this memory ever get passed to the > hardware? No, this memory is only used to temporarily store ring info. It will be freed after restoring the ring info.