Support Layer 4 and below IP fragementation support in APV

Review Request #724 — Created March 17, 2025 and updated

satyendra
APV10
10.7
AE-583
phemadri, pradeep, prajesh, tanya, wli

To support IP fragmented packet in the APV . The IP fragmenat packet will be created based on output interface.

Added command as below to disable/enable IP frag feature .

ip reassembly off .
ip reassembly on
show ip reassembly

The testing is done with traffic of 3KB payload running , which is received as IP fragment as done by router .

Description From Last Updated

remove whitespaces.

prajeshprajesh

can multiple threads use the same array? make it local to the function?

prajeshprajesh

do we need -1?

prajeshprajesh

clean this up.

prajeshprajesh

dont we have to set MF flag in IP header for initial few packets?

prajeshprajesh

IP vs IPv6? Should we handle IPv4 explicitly?

prajeshprajesh

can we not set ip_frag_reass (static variable) directly instead of using sysctl. If we are using sysctl, then CLI may …

prajeshprajesh

You need to print the exact CLI.

prajeshprajesh

Need to print exact CLI.

prajeshprajesh

can you add commands.pm?

prajeshprajesh

Print exact CLI

prajeshprajesh

Not related with CSUM (csum)

prajeshprajesh

though it says unused , it is still used in the code.. pls use a different flag.

prajeshprajesh

Do we need nic_init()?

prajeshprajesh

Enable IP fragmentation and reassembly

prajeshprajesh

Disable IP fragmentation and reassembly.

prajeshprajesh

similar to adding write_func to write table you need to add clear func to clear table. It's in the same …

tanyatanya

caller frees this one?

prajeshprajesh

what happens to the mbuf that we processed until line 1060?

prajeshprajesh
satyendra
prajesh
  1. 
      
  2. can multiple threads use the same array? make it local to the function?

  3. IP vs IPv6? Should we handle IPv4 explicitly?

  4. 
      
prajesh
  1. 
      
    1. frag_plaod_len-1 = "1479" . so if there is any remainder value in pload_len/frag_pload_len which can be vary from 1 to 1479 will be added in the "1479" + (1,1479) , gives needed another packet.

    1. Removed the specified comment

  2. dont we have to set MF flag in IP header for initial few packets?

    1. frag_ip->ip_off = htons((offset >> 3) | (i < (frag_count - 1) ? IP_MF : 0)) . More flag is set in line no 1025

  3. 
      
prajesh
satyendra
satyendra
prajesh
  1. 
      
  2. Not related with CSUM (csum)

  3. 
      
prajesh
prajesh
  1. 
      
  2. though it says unused , it is still used in the code.. pls use a different flag.

    1. not using flags anymore

  3. 
      
prajesh
  1. 
      
  2. can we not set ip_frag_reass (static variable) directly instead of using sysctl. If we are using sysctl, then CLI may not be needed.

    1. Cli added for better user experience . now we have both , For sysctl we need to go test account , That is not very user friendly .

  3. 
      
satyendra
satyendra
prajesh
  1. 
      
  2. Do we need nic_init()?

    1. not required . removed .

  3. Enable IP fragmentation and reassembly

  4. Disable IP fragmentation and reassembly.

  5. 
      
satyendra
tanya
  1. 
      
  2. similar to adding write_func to write table you need to add clear func to clear table. It's in the same file. look for clear_ip_dhcp() as an example. The clear function needs to restore the setting to default, so if our default is on it simply needs to call the on function. The clear table is used when we run "clear config" command, so if we miss adding this the ip frag setting will not be restored when we run clear config.
    thanks

  3. 
      
satyendra
prajesh
  1. 
      
  2. caller frees this one?

    1. Assuming caller frees it, giving a ship it.

    2. caller will free it

  3. 
      
prajesh
  1. Ship It!
  2. 
      
tanya
  1. Ship It!
  2. 
      
satyendra
prajesh
  1. Ship It!
  2. 
      
prajesh
  1. Ship It!
  2. 
      
prajesh
  1. 
      
  2. what happens to the mbuf that we processed until line 1060?

    1. Checking on this . Thsi need to be fixed .

    2. Handled this scenario , in case of buffer overflow , the coressponding frag packet will get free for the packet which cause overflow .
      also fixed return for the no of packet processed

  3. 
      
satyendra
prajesh
  1. Ship It!
  2. 
      
satyendra
Review request changed
pradeep
  1. Ship It!
  2. 
      
Loading...