Re: [Intel-wired-lan] [PATCH net v5 4/9] ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz

2026-03-05 Thread Frank Li
On Thu, Mar 05, 2026 at 05:18:28PM +0200, Vladimir Oltean wrote:
> Hi Frank,
>
> On Thu, Mar 05, 2026 at 10:08:56AM -0500, Frank Li wrote:
> > From: Frank Li (AI-BOT) 
> >
> > >   if (ring->xsk_pool) {
> > > - rx_buf_len =
> > > - xsk_pool_get_rx_frame_size(ring->xsk_pool);
> > > + u32 frag_size =
> > > + xsk_pool_get_rx_frag_step(ring->xsk_pool);
> >
> > AI: Variable declaration should be at the start of the block, not inline.
> > Move `u32 frag_size;` to the top with other declarations.
> >
> > Although it allow declear varible at any place now, still perfer AI's
> > suggest here.
> >
> > Frank
>
> A "block" or a "compound statement" in C is the piece of code encircled
> by { and }. We _do_ have them, so the "u32 frag_size" variable _is_
> declared at the start of that block, as a matter of fact. There is
> nothing wrong here, the variable placement is not arbitrary.

Yes, sorry, I missed think "-" at patch when I am reviewing AI's result.

>
> Which AI tool signalled this?

Cody, backed should claude.

Frank


Re: [Intel-wired-lan] [PATCH net v5 4/9] ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz

2026-03-05 Thread Frank Li
From: Frank Li (AI-BOT) 

>   if (ring->xsk_pool) {
> - rx_buf_len =
> - xsk_pool_get_rx_frame_size(ring->xsk_pool);
> + u32 frag_size =
> + xsk_pool_get_rx_frag_step(ring->xsk_pool);

AI: Variable declaration should be at the start of the block, not inline.
Move `u32 frag_size;` to the top with other declarations.

Although it allow declear varible at any place now, still perfer AI's
suggest here.

Frank

>   err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
>ring->q_index,
>ring->q_vector->napi.napi_id,
> -  rx_buf_len);
> +  frag_size);



Re: [Intel-wired-lan] [PATCH net v5 4/9] ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz

2026-03-05 Thread Vladimir Oltean
Hi Frank,

On Thu, Mar 05, 2026 at 10:08:56AM -0500, Frank Li wrote:
> From: Frank Li (AI-BOT) 
> 
> > if (ring->xsk_pool) {
> > -   rx_buf_len =
> > -   xsk_pool_get_rx_frame_size(ring->xsk_pool);
> > +   u32 frag_size =
> > +   xsk_pool_get_rx_frag_step(ring->xsk_pool);
> 
> AI: Variable declaration should be at the start of the block, not inline.
> Move `u32 frag_size;` to the top with other declarations.
> 
> Although it allow declear varible at any place now, still perfer AI's
> suggest here.
> 
> Frank

A "block" or a "compound statement" in C is the piece of code encircled
by { and }. We _do_ have them, so the "u32 frag_size" variable _is_
declared at the start of that block, as a matter of fact. There is
nothing wrong here, the variable placement is not arbitrary.

Which AI tool signalled this?