Re: [tools] tester: Remove hard coded time limit for SIS

2022-07-07 Thread Chris Johns
-1 from me.

On 7/7/2022 4:44 pm, Sebastian Huber wrote:
> Remove the hard coded time limit in the SIS configuration which would overrule
> the general tester settings (for example the --timeout command line option).
> Users can set a SIS time limit in the configuration if necessary.

I would this to be left as is and not to be the other way around.

What is the problem with you having a user config for this?

I am now starting to wonder if you have made some dependencies on this for
reasons I cannot explain.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [tools] tester: Remove hard coded time limit for SIS

2022-07-07 Thread Sebastian Huber

On 07/07/2022 09:29, Chris Johns wrote:

-1 from me.

On 7/7/2022 4:44 pm, Sebastian Huber wrote:

Remove the hard coded time limit in the SIS configuration which would overrule
the general tester settings (for example the --timeout command line option).
Users can set a SIS time limit in the configuration if necessary.

I would this to be left as is and not to be the other way around.

What is the problem with you having a user config for this?

I am now starting to wonder if you have made some dependencies on this for
reasons I cannot explain.


I have no idea way you are so hesitant to remove this default limit. I 
just want to run the tests with a higher timeout defined by the command 
line --timeout option. That's it. I didn't anticipate that this is such 
an issue.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] bsps/arm/stm32f4 Optimize get pin and change from HAL to LL

2022-07-07 Thread Duc Doan
Hello Cedric,

On Wed, 2022-07-06 at 16:41 +0200, Cedric Berger wrote:
> One more detail and one question follows:
> 
> >   static unsigned int EXTIx_IRQn[] = {
> >   EXTI0_IRQn,
> >   EXTI1_IRQn,
> 
> Detail: You should really mark all constants like that "const": on a 
> STM32 with little RAM, the constants stays in FLASH and that makes a 
> difference.
> 

Thanks, I will change that.

> Finally, sorry for my ignorance - I don't know the overall plan on
> that 
> project here - but I'm sure that code is 99.5% compatible with the 
> STM32H7. Do you plan to enable it there too?

Actually my project is focused on STM32F4, but it is nice that the code
could be extensible to H7. However, I can't think of a good way to use
that code with H7 right now; do you think that the code can be copied
and pasted to H7 BSP? Or is there a better way to share the code among
all STM32 BSPs?

Best,

Duc Doan
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] bsps/arm/stm32f4 Optimize get pin and change from HAL to LL

2022-07-07 Thread Cedric Berger

Hello,

On 07.07.22 09:35, Duc Doan wrote:

Actually my project is focused on STM32F4, but it is nice that the code
could be extensible to H7. However, I can't think of a good way to use
that code with H7 right now; do you think that the code can be copied
and pasted to H7 BSP? Or is there a better way to share the code among
all STM32 BSPs?


I've a lot of experience with STM32 dev, but not with RTEMS, so I'm not 
the best person to answer that question.


If you want to expand support for the H7 now, maybe Karel or someone 
else on the list can point you to the right way.


What I can say by reading your "[PATCH 4/4]" file is that I don't see 
what would not work for the H7. If it compiles on H7, it's likely to 
work as is (except for the GPIO port lists, you'd need other ifdefs like 
you do for STM32F429X, or maybe just keep 
stm32f4_gpio_init/stm32f4_gpio_deinit separate for F4 and H7).


Maybe it's as simple as renaming the identifiers from stm32f4_gpio => 
stm32_gpio for clarity for most functions, and declaring these files in 
the H7 scripts.


BTW: by rereading your "[PATCH 4/4]" file I noticed that there is 
something else you need to be careful:


I don't know how the lifecycle of init/deinit is intended to work, but 
the stm32f4_gpio_deinit() function is dangerous:


The problem is that if you disable the clock of, say, GPIOA, it will 
also make all alternate function IPs that uses these pins stop working.


So if you are using the HAL for example for the Ethernet IP, the board 
I'm working with will also call the following functions in it's 
initialization routine:


HAL_ETH_MspInit()
{
    ...
    __HAL_RCC_GPIOG_CLK_ENABLE();
    __HAL_RCC_GPIOC_CLK_ENABLE();
    __HAL_RCC_GPIOA_CLK_ENABLE();
    ...
}

So your "stm32f4_gpio_deinit" routine will make all IPs that share the 
pins with the GPIO port also stop working.


The trivial fix is of course to make "stm32f4_gpio_deinit" do nothing.

Cedric





___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] bsps/arm/stm32f4 Optimize get pin and change from HAL to LL

2022-07-07 Thread Duc Doan
Hello Cedric,

On Thu, 2022-07-07 at 10:32 +0200, Cedric Berger wrote:
> Hello,
> 
> On 07.07.22 09:35, Duc Doan wrote:
> > Actually my project is focused on STM32F4, but it is nice that the
> > code
> > could be extensible to H7. However, I can't think of a good way to
> > use
> > that code with H7 right now; do you think that the code can be
> > copied
> > and pasted to H7 BSP? Or is there a better way to share the code
> > among
> > all STM32 BSPs?
> 
> I've a lot of experience with STM32 dev, but not with RTEMS, so I'm
> not 
> the best person to answer that question.
> 
> If you want to expand support for the H7 now, maybe Karel or someone 
> else on the list can point you to the right way.
> 
> What I can say by reading your "[PATCH 4/4]" file is that I don't see
> what would not work for the H7. If it compiles on H7, it's likely to 
> work as is (except for the GPIO port lists, you'd need other ifdefs
> like 
> you do for STM32F429X, or maybe just keep 
> stm32f4_gpio_init/stm32f4_gpio_deinit separate for F4 and H7).
> 
> Maybe it's as simple as renaming the identifiers from stm32f4_gpio =>
> stm32_gpio for clarity for most functions, and declaring these files
> in 
> the H7 scripts.
> 

I think I will wait for Karel's opinion about that.

> BTW: by rereading your "[PATCH 4/4]" file I noticed that there is 
> something else you need to be careful:
> 
> I don't know how the lifecycle of init/deinit is intended to work,
> but 
> the stm32f4_gpio_deinit() function is dangerous:
> 
> The problem is that if you disable the clock of, say, GPIOA, it will 
> also make all alternate function IPs that uses these pins stop
> working.
> 
> So if you are using the HAL for example for the Ethernet IP, the
> board 
> I'm working with will also call the following functions in it's 
> initialization routine:
> 
> HAL_ETH_MspInit()
> {
>  ...
>  __HAL_RCC_GPIOG_CLK_ENABLE();
>  __HAL_RCC_GPIOC_CLK_ENABLE();
>  __HAL_RCC_GPIOA_CLK_ENABLE();
>  ...
> }
> 
> So your "stm32f4_gpio_deinit" routine will make all IPs that share
> the 
> pins with the GPIO port also stop working.
> 
> The trivial fix is of course to make "stm32f4_gpio_deinit" do
> nothing.
> 
> Cedric
> 

You are right, I forgot that disabling the clock affects the whole
port. I made deinit() do nothing.

Best,

Duc Doan
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH v2 0/4] *** New GPIO API and implementation for STM32F4 BSP ***

2022-07-07 Thread Duc Doan
Hello,

This patch adds a new GPIO API that aims at portability. GPIO of STM32F4 BSP 
has been implemented using this API. The sample application code can be found 
at https://github.com/dtbpkmte/GSoC-2022-RTEMS-Sample-Apps.

v2:

- Made get_gpio_from_base() a macro instead of a function
- Added missing cppflags in spec/build/bsps/arm/grp.yml
- Optimized STM32F4_GET_HAL_GPIO_PIN() and STM32F4_GET_LL_EXTI_LINE()
- Optimized functions by switching from HAL to LL
- Made stm32f4_gpio_deinit() return RTEMS_NOT_IMPLEMENTED, because disabling 
clock might 
affect all pins in a port
- Add const to static helper arrays to make sure they are placed on ROM


Duc Doan (4):
  bsps/stm32f4 Include STM32F4 HAL
  bsps/arm: Integrate and build STM32F4 HAL
  bsps: Add GPIO API
  bsps/stm32f4: Add GPIO implementation for STM32F4

 .gitignore| 1 +
 bsps/arm/include/cmsis_compiler.h |   266 +
 bsps/arm/include/cmsis_gcc.h  |  1152 +-
 bsps/arm/include/cmsis_version.h  |39 +
 bsps/arm/include/core_cm4.h   |  4066 +--
 bsps/arm/include/core_cm7.h   |   582 +-
 bsps/arm/include/legacy/cmsis_gcc.h   |  1375 ++
 bsps/arm/include/legacy/core_cm7.h|  2515 ++
 bsps/arm/include/mpu_armv7.h  |   270 +
 bsps/arm/stm32f4/gpio/gpio.c  |   555 +
 .../stm32f4/hal/Legacy/stm32f4xx_hal_can.c|  1679 ++
 .../stm32f4/hal/Legacy/stm32f4xx_hal_eth.c|  2307 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal.c  |   615 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_adc.c  |  2110 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_adc_ex.c   |  1112 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_can.c  |  2462 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_cec.c  |   996 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_cortex.c   |   502 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_crc.c  |   328 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_cryp.c |  7132 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_cryp_ex.c  |   680 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dac.c  |  1341 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dac_ex.c   |   495 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dcmi.c |  1161 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dcmi_ex.c  |   182 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dfsdm.c|  4423 
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dma.c  |  1305 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dma2d.c|  2126 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dma_ex.c   |   313 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dsi.c  |  2760 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_eth.c  |  3112 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_exti.c |   547 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_flash.c|   775 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_flash_ex.c |  1347 +
 .../stm32f4/hal/stm32f4xx_hal_flash_ramfunc.c |   172 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_fmpi2c.c   |  6864 ++
 .../arm/stm32f4/hal/stm32f4xx_hal_fmpi2c_ex.c |   258 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_fmpsmbus.c |  2749 +++
 .../stm32f4/hal/stm32f4xx_hal_fmpsmbus_ex.c   |   145 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_gpio.c |   533 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_hash.c |  3514 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_hash_ex.c  |  1040 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_hcd.c  |  1728 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_i2c.c  |  7524 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_i2c_ex.c   |   182 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_i2s.c  |  2094 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_i2s_ex.c   |  1135 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_irda.c |  2687 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_iwdg.c |   262 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_lptim.c|  2484 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_ltdc.c |  2215 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_ltdc_ex.c  |   151 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_mmc.c  |  3201 +++
 .../stm32f4/hal/stm32f4xx_hal_msp_template.c  |   100 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_nand.c |  2405 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_nor.c  |  1543 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_pccard.c   |   946 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_pcd.c  |  2387 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_pcd_ex.c   |   341 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_pwr.c  |   571 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_pwr_ex.c   |   600 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_qspi.c |  2915 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_rcc.c  |  1122 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_rcc_ex.c   |  3784 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_rng.c  |   867 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_rtc.c  |  1896 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_rtc_ex.c   |  1878 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_sai.c  |  2554 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_sai_ex.c   |   310 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_sd.c   |  3277 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_sdram.c|  1308 +
 .../arm/stm32f4/hal/stm32f4xx_hal_smartcard.c |  2364 ++
 bsps/arm/stm32

[PATCH v2 1/4] bsps/stm32f4 Include STM32F4 HAL

2022-07-07 Thread Duc Doan
This patch is too large so I cannot send via email. Please find it here: 
https://github.com/dtbpkmte/GSoC-2022-RTEMS/tree/f7ed35b5ce25a5410e72e4950d27ea86afbfe5c4.

---
 .../stm32f4/hal/Legacy/stm32f4xx_hal_can.c| 1679 
 .../stm32f4/hal/Legacy/stm32f4xx_hal_eth.c| 2307 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal.c  |  615 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_adc.c  | 2110 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_adc_ex.c   | 1112 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_can.c  | 2462 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_cec.c  |  996 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_cortex.c   |  502 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_crc.c  |  328 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_cryp.c | 7132 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_cryp_ex.c  |  680 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dac.c  | 1341 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dac_ex.c   |  495 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dcmi.c | 1161 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dcmi_ex.c  |  182 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dfsdm.c| 4423 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dma.c  | 1305 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dma2d.c| 2126 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dma_ex.c   |  313 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_dsi.c  | 2760 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_eth.c  | 3112 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_exti.c |  547 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_flash.c|  775 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_flash_ex.c | 1347 +++
 .../stm32f4/hal/stm32f4xx_hal_flash_ramfunc.c |  172 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_fmpi2c.c   | 6864 +++
 .../arm/stm32f4/hal/stm32f4xx_hal_fmpi2c_ex.c |  258 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_fmpsmbus.c | 2749 ++
 .../stm32f4/hal/stm32f4xx_hal_fmpsmbus_ex.c   |  145 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_gpio.c |  533 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_hash.c | 3514 
 bsps/arm/stm32f4/hal/stm32f4xx_hal_hash_ex.c  | 1040 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_hcd.c  | 1728 
 bsps/arm/stm32f4/hal/stm32f4xx_hal_i2c.c  | 7524 
 bsps/arm/stm32f4/hal/stm32f4xx_hal_i2c_ex.c   |  182 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_i2s.c  | 2094 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_i2s_ex.c   | 1135 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_irda.c | 2687 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_iwdg.c |  262 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_lptim.c| 2484 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_ltdc.c | 2215 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_ltdc_ex.c  |  151 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_mmc.c  | 3201 +++
 .../stm32f4/hal/stm32f4xx_hal_msp_template.c  |  100 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_nand.c | 2405 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_nor.c  | 1543 
 bsps/arm/stm32f4/hal/stm32f4xx_hal_pccard.c   |  946 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_pcd.c  | 2387 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_pcd_ex.c   |  341 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_pwr.c  |  571 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_pwr_ex.c   |  600 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_qspi.c | 2915 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_rcc.c  | 1122 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_rcc_ex.c   | 3784 
 bsps/arm/stm32f4/hal/stm32f4xx_hal_rng.c  |  867 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_rtc.c  | 1896 
 bsps/arm/stm32f4/hal/stm32f4xx_hal_rtc_ex.c   | 1878 
 bsps/arm/stm32f4/hal/stm32f4xx_hal_sai.c  | 2554 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_sai_ex.c   |  310 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_sd.c   | 3277 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_sdram.c| 1308 +++
 .../arm/stm32f4/hal/stm32f4xx_hal_smartcard.c | 2364 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_smbus.c| 2784 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_spdifrx.c  | 1627 
 bsps/arm/stm32f4/hal/stm32f4xx_hal_spi.c  | 3915 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_sram.c | 1110 +++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_tim.c  | 7621 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_tim_ex.c   | 2428 ++
 ...tm32f4xx_hal_timebase_rtc_alarm_template.c |  318 +
 ...m32f4xx_hal_timebase_rtc_wakeup_template.c |  293 +
 .../hal/stm32f4xx_hal_timebase_tim_template.c |  177 +
 bsps/arm/stm32f4/hal/stm32f4xx_hal_uart.c | 3751 
 bsps/arm/stm32f4/hal/stm32f4xx_hal_usart.c| 2838 ++
 bsps/arm/stm32f4/hal/stm32f4xx_hal_wwdg.c |  420 +
 bsps/arm/stm32f4/hal/stm32f4xx_ll_adc.c   |  922 ++
 bsps/arm/stm32f4/hal/stm32f4xx_ll_crc.c   |  103 +
 bsps/arm/stm32f4/hal/stm32f4xx_ll_dac.c   |  280 +
 bsps/arm/stm32f4/hal/stm32f4xx_ll_dma.c   |  423 +
 bsps/arm/stm32f4/hal/stm32f4xx_ll_dma2d.c |  594 ++
 bsps/arm/stm32f4/hal/stm32f4xx_ll_exti.c  |  212 +
 bsps/arm/stm32f4/hal/stm32f4xx_ll_fmc.c   | 1498 
 bsps/arm/stm32f4/hal/stm32f4xx_ll_fm

[PATCH v2 3/4] bsps: Add GPIO API

2022-07-07 Thread Duc Doan
This is the new GPIO API. The header file is
gpio2.h.
---
 bsps/include/bsp/gpio2.h| 538 
 bsps/shared/dev/gpio/gpio.c | 196 +
 spec/build/bsps/obj.yml |   2 +-
 3 files changed, 735 insertions(+), 1 deletion(-)
 create mode 100644 bsps/include/bsp/gpio2.h
 create mode 100644 bsps/shared/dev/gpio/gpio.c

diff --git a/bsps/include/bsp/gpio2.h b/bsps/include/bsp/gpio2.h
new file mode 100644
index 00..e99967cd47
--- /dev/null
+++ b/bsps/include/bsp/gpio2.h
@@ -0,0 +1,538 @@
+/**
+  * @file
+  *
+  * @ingroup rtems_gpio2
+  *
+  * @brief RTEMS GPIO new API definition.
+  */
+
+/*
+*  Copyright (c) 2022 Duc Doan 
+*
+*  The license and distribution terms for this file may be
+*  found in the file LICENSE in this distribution or at
+*  http://www.rtems.org/license/LICENSE.
+*/
+
+#ifndef LIBBSP_BSP_GPIO2_H
+#define LIBBSP_BSP_GPIO2_H
+
+#include 
+#include 
+
+/**
+  * Configure the maximum number of GPIO controllers used in
+  * a application.
+  *
+  * The macro CONFIGURE_GPIO_MAXIMUM_CONTROLLERS can be
+  * defined in application code. If it is not defined,
+  * it will default to BSP_GPIO_NUM_CONTROLLERS. If BSP's
+  * number of controllers is not defined, it will default
+  * to 1.
+  */
+#ifndef CONFIGURE_GPIO_MAXIMUM_CONTROLLERS
+
+#ifndef BSP_GPIO_NUM_CONTROLLERS
+#define CONFIGURE_GPIO_MAXIMUM_CONTROLLERS 1
+#else
+#define CONFIGURE_GPIO_MAXIMUM_CONTROLLERS BSP_GPIO_NUM_CONTROLLERS
+#endif /* BSP_GPIO_NUM_CONTROLLERS */
+
+#endif /* CONFIGURE_GPIO_MAXIMUM_CONTROLLERS */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+  * @name GPIO data structures
+  *
+  * @{
+  */
+
+/**
+  * @brief GPIO bit set and reset enumeration.
+  */
+typedef enum {
+RTEMS_GPIO_PIN_RESET = 0,
+RTEMS_GPIO_PIN_SET = 1
+} rtems_gpio_pin_state;
+
+/**
+  * @brief GPIO pin modes. 
+  */
+typedef enum {
+RTEMS_GPIO_PINMODE_OUTPUT = 0,
+RTEMS_GPIO_PINMODE_OUTPUT_PP = 0,
+RTEMS_GPIO_PINMODE_OUTPUT_OD = 1,
+RTEMS_GPIO_PINMODE_INPUT = 2,
+RTEMS_GPIO_PINMODE_ANALOG = 3,
+RTEMS_GPIO_PINMODE_BSP_SPECIFIC = 4
+} rtems_gpio_pin_mode;
+
+/**
+  * @brief GPIO pull resistor configuration. Defines pull-up or 
+  *pull-down activation.
+  */
+typedef enum {
+RTEMS_GPIO_NOPULL,
+RTEMS_GPIO_PULLUP,
+RTEMS_GPIO_PULLDOWN
+} rtems_gpio_pull;
+
+/**
+  * @brief Interrupt modes enumeration.
+  */
+typedef enum {
+RTEMS_GPIO_INT_TRIG_NONE = 0,
+RTEMS_GPIO_INT_TRIG_FALLING,
+RTEMS_GPIO_INT_TRIG_RISING,
+RTEMS_GPIO_INT_TRIG_BOTH_EDGES,
+RTEMS_GPIO_INT_TRIG_LOW,
+RTEMS_GPIO_INT_TRIG_HIGH
+} rtems_gpio_interrupt_trig;
+
+typedef struct rtems_gpio_handlers rtems_gpio_handlers;
+typedef struct rtems_gpio rtems_gpio;
+/**
+  * @brief Typedef of the function pointer of an ISR.
+  */
+typedef void (*rtems_gpio_isr)(void *);
+
+/**
+  * @brief Structure containing pointers to handlers of a
+  *BSP/driver. Each BSP/driver must define its own 
+  *handlers and create an object of this structure
+  *with pointers to those handlers.
+  */
+struct rtems_gpio_handlers {
+/**
+  * @brief This member is the pointer to an initialize handler. 
+  *
+  * This handler could be used to perform some set up steps for
+  * a GPIO object (which means a pin or a port).
+  */
+rtems_status_code (*init)(rtems_gpio *);
+
+/**
+  * @brief This member is the pointer to a deinitialize handler. 
+  *
+  * This handler could be used to deinitialize a GPIO object.
+  */
+rtems_status_code (*deinit)(rtems_gpio *);
+
+/**
+  * @brief This member is the pointer to a handler for setting 
+  *pin mode. 
+  *
+  * Pin modes are from rtems_gpio_pin_mode enumeration.
+  */
+rtems_status_code (*set_pin_mode)(rtems_gpio *, rtems_gpio_pin_mode);
+
+/**
+  * @brief This member is the pointer to a handler for setting
+  *pull resistor mode. 
+  *
+  * Pull resistor modes are from rtems_gpio_pull enumeration.
+  */
+rtems_status_code (*set_pull)(rtems_gpio *, rtems_gpio_pull);
+
+/**
+  * @brief This member is the pointer to a handler for configuring
+  *interrupt of a pin. 
+  * 
+  * This handler should register ISR and its argument, interrupt
+  * trigger mode, and pull resister mode for the pin.
+  *
+  * @note Enabling interrupt should be done in enable_interrupt()
+  *   handler.
+  */
+rtems_status_code (*configure_interrupt)(rtems_gpio *, rtems_gpio_isr, 
void *, rtems_gpio_interrupt_trig, rtems_gpio_pull);
+
+/**
+  * @brief This member is the pointer to a handler for removing
+  *interrupt settings of a pin. 
+  *
+  * Interrupt settings can be ISR address, pin configuration, etc.
+  */
+rtems_status_code (*remove_interrupt)(rtems_gpio *);
+
+/**
+  * @brief This member is the pointer to a han

[PATCH v2 4/4] bsps/stm32f4: Add GPIO implementation for STM32F4

2022-07-07 Thread Duc Doan
---
 bsps/arm/stm32f4/gpio/gpio.c  | 555 ++
 bsps/arm/stm32f4/include/bsp.h|   4 -
 bsps/arm/stm32f4/include/bsp/stm32f4_gpio.h   |  37 ++
 bsps/arm/stm32f4/include/bsp/stm32f4_hal.h|  17 +
 bsps/arm/stm32f4/start/bspstart.c |   7 +-
 spec/build/bsps/arm/stm32f4/grp.yml   |   4 +-
 spec/build/bsps/arm/stm32f4/obj.yml   |   1 +
 .../build/bsps/arm/stm32f4/optnumgpioctrl.yml |  16 +
 8 files changed, 632 insertions(+), 9 deletions(-)
 create mode 100644 bsps/arm/stm32f4/gpio/gpio.c
 create mode 100644 bsps/arm/stm32f4/include/bsp/stm32f4_gpio.h
 create mode 100644 bsps/arm/stm32f4/include/bsp/stm32f4_hal.h
 create mode 100644 spec/build/bsps/arm/stm32f4/optnumgpioctrl.yml

diff --git a/bsps/arm/stm32f4/gpio/gpio.c b/bsps/arm/stm32f4/gpio/gpio.c
new file mode 100644
index 00..d7cac7fd58
--- /dev/null
+++ b/bsps/arm/stm32f4/gpio/gpio.c
@@ -0,0 +1,555 @@
+/**
+  * @file
+  *
+  * @ingroup rtems_bsp/arm/stm32f4
+  *
+  * @brief RTEMS GPIO new API implementation for STM32F4.
+  *
+  * @note RTEMS_GPIO_PINMODE_BSP_SPECIFIC is Alternate mode for STM32F4 BSP
+  */
+
+/*
+ *  Copyright (c) 2022 Duc Doan 
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.org/license/LICENSE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+/*** Helpers */
+/**
+  * @brief Macro to get stm32f4_gpio object from a base rtems_gpio
+  *object.
+  *
+  * This is a wrapper of RTEMS_CONTAINER_OF macro
+  *
+  * @param base The pointer to a rtems_gpio object
+  * @retval The pointer to the stm32f4_gpio object owning
+  * the specified rtems_gpio object
+  */
+#define get_gpio_from_base(base) \
+RTEMS_CONTAINER_OF(base, stm32f4_gpio, base)
+
+/*** GPIO API ***/
+static rtems_status_code stm32f4_gpio_get(
+uint32_t interm_pin,
+rtems_gpio **out
+);
+
+static rtems_status_code stm32f4_gpio_destroy(
+rtems_gpio *base
+);
+
+static rtems_status_code stm32f4_gpio_init(
+rtems_gpio *base
+);
+
+static rtems_status_code stm32f4_gpio_deinit(
+rtems_gpio *base
+);
+
+static rtems_status_code stm32f4_gpio_set_pin_mode(
+rtems_gpio *base,
+rtems_gpio_pin_mode mode
+);
+
+static rtems_status_code stm32f4_gpio_set_pull(
+rtems_gpio *base,
+rtems_gpio_pull pull
+);
+
+static rtems_status_code stm32f4_gpio_configure_interrupt(
+rtems_gpio *base, 
+rtems_gpio_isr isr,
+void *arg,
+rtems_gpio_interrupt_trig trig,
+rtems_gpio_pull pull
+);
+
+static rtems_status_code stm32f4_gpio_remove_interrupt(
+rtems_gpio *base
+);
+
+static rtems_status_code stm32f4_gpio_enable_interrupt(
+rtems_gpio *base
+);
+
+static rtems_status_code stm32f4_gpio_disable_interrupt(
+rtems_gpio *base
+);
+
+static rtems_status_code stm32f4_gpio_read(
+rtems_gpio *base,
+rtems_gpio_pin_state *value
+);
+
+static rtems_status_code stm32f4_gpio_write(
+rtems_gpio *base,
+rtems_gpio_pin_state value
+);
+
+static rtems_status_code stm32f4_gpio_toggle(
+rtems_gpio *base
+);
+
+/*/
+
+/**
+  * @brief STM32F4 GPIO handlers
+  */
+static const rtems_gpio_handlers stm32f4_gpio_handlers = {
+.init = stm32f4_gpio_init,
+.deinit = stm32f4_gpio_deinit,
+.set_pin_mode = stm32f4_gpio_set_pin_mode,
+.set_pull = stm32f4_gpio_set_pull,
+.configure_interrupt = stm32f4_gpio_configure_interrupt,
+.remove_interrupt = stm32f4_gpio_remove_interrupt,
+.enable_interrupt = stm32f4_gpio_enable_interrupt,
+.disable_interrupt = stm32f4_gpio_disable_interrupt,
+.read = stm32f4_gpio_read,
+.write = stm32f4_gpio_write,
+.toggle = stm32f4_gpio_toggle
+};
+
+static GPIO_TypeDef * const GPIOx[] = {
+GPIOA, GPIOB, GPIOC, GPIOD, GPIOE,
+GPIOF, GPIOG, GPIOH, GPIOI,
+#ifdef STM32F429X
+GPIOJ, GPIOK
+#endif /* STM32F429X */
+};
+
+static unsigned int const EXTIx_IRQn[] = {
+EXTI0_IRQn,
+EXTI1_IRQn,
+EXTI2_IRQn,
+EXTI3_IRQn,
+EXTI4_IRQn,
+EXTI9_5_IRQn,
+EXTI9_5_IRQn,
+EXTI9_5_IRQn,
+EXTI9_5_IRQn,
+EXTI9_5_IRQn,
+EXTI15_10_IRQn,
+EXTI15_10_IRQn,
+EXTI15_10_IRQn,
+EXTI15_10_IRQn,
+EXTI15_10_IRQn,
+EXTI15_10_IRQn
+};
+
+/**
+  * @brief Converts intermediate pin number to port pointer.
+  *
+  * Intermediate pin number is a way of numerically labeling
+  * pins. Pins are labeled incrementally across all ports.
+  * Pins 0-15 from port A are 0-15. Pins 0-15 from port B are
+  * 16-31. And so on.
+  *
+  * @param interm_pin is the intermediate pin number
+  */
+#define STM32F4_GET_PORT(interm_pin) (GPIOx[ ( interm_pin ) / 16 ])
+
+/**
+  * @brief Converts intermediate pin number to 0-15.
+  *
+  * Intermediate pin number is a way of numerically labeling
+  * pins. Pins are labeled incrementally across all ports.
+  * Pins 0-15 fr

[PATCH v2 2/4] bsps/arm: Integrate and build STM32F4 HAL

2022-07-07 Thread Duc Doan
This patch is too large so I cannot send via email. Please find it here:
https://github.com/dtbpkmte/GSoC-2022-RTEMS/tree/2baea7f3ffb178d581b3c6b6b7c1b63f8ac55852

---
 .gitignore| 1 +
 bsps/arm/include/cmsis_compiler.h |   266 +
 bsps/arm/include/cmsis_gcc.h  |  1152 +-
 bsps/arm/include/cmsis_version.h  |39 +
 bsps/arm/include/core_cm4.h   |  4066 +--
 bsps/arm/include/core_cm7.h   |   582 +-
 bsps/arm/include/legacy/cmsis_gcc.h   |  1375 ++
 bsps/arm/include/legacy/core_cm7.h|  2515 ++
 bsps/arm/include/mpu_armv7.h  |   270 +
 bsps/arm/stm32f4/hal/system_stm32f4xx.c   |   747 +
 bsps/arm/stm32f4/include/bsp.h| 4 +
 bsps/arm/stm32f4/include/bsp/io.h | 4 +
 .../stm32f4/include/stm32_assert_template.h   |56 -
 bsps/arm/stm32f4/include/stm32f401xc.h|  8641 +++
 bsps/arm/stm32f4/include/stm32f401xe.h|  8641 +++
 bsps/arm/stm32f4/include/stm32f405xx.h| 14310 +++
 bsps/arm/stm32f4/include/stm32f407xx.h| 15607 
 bsps/arm/stm32f4/include/stm32f410cx.h|  7357 ++
 bsps/arm/stm32f4/include/stm32f410rx.h|  7361 ++
 bsps/arm/stm32f4/include/stm32f410tx.h|  7306 ++
 bsps/arm/stm32f4/include/stm32f411xe.h|  8680 +++
 bsps/arm/stm32f4/include/stm32f412cx.h| 13507 ++
 bsps/arm/stm32f4/include/stm32f412rx.h| 14500 +++
 bsps/arm/stm32f4/include/stm32f412vx.h| 14512 +++
 bsps/arm/stm32f4/include/stm32f412zx.h| 14537 +++
 bsps/arm/stm32f4/include/stm32f413xx.h| 15462 
 bsps/arm/stm32f4/include/stm32f415xx.h| 14595 +++
 bsps/arm/stm32f4/include/stm32f417xx.h| 15887 
 bsps/arm/stm32f4/include/stm32f423xx.h| 15615 
 bsps/arm/stm32f4/include/stm32f427xx.h| 16827 +
 bsps/arm/stm32f4/include/stm32f429xx.h| 17185 +
 bsps/arm/stm32f4/include/stm32f437xx.h| 17129 +
 bsps/arm/stm32f4/include/stm32f439xx.h| 17479 +
 bsps/arm/stm32f4/include/stm32f446xx.h| 15981 
 bsps/arm/stm32f4/include/stm32f469xx.h| 20278 +++
 bsps/arm/stm32f4/include/stm32f479xx.h| 20575 
 bsps/arm/stm32f4/include/stm32f4xx.h  |   305 +
 ...l_conf_template.h => stm32f4xx_hal_conf.h} | 6 +
 bsps/arm/stm32f4/include/system_stm32f4xx.h   |   104 +
 bsps/arm/stm32f4/start/bspstart.c |   202 +-
 bsps/arm/stm32f4/start/bspstart_old.c |   297 +
 spec/build/bsps/arm/grp.yml   | 5 +-
 spec/build/bsps/arm/stm32f4/grp.yml   |12 +-
 spec/build/bsps/arm/stm32f4/obj.yml   |   220 +
 spec/build/bsps/arm/stm32f4/optenhal.yml  |16 +
 spec/build/bsps/arm/stm32f4/opthse.yml|17 +
 spec/build/bsps/arm/stm32f4/optusehse.yml |16 +
 spec/build/bsps/arm/stm32f4/optvariant.yml|24 +
 spec/build/bsps/obj.yml   | 1 +
 49 files changed, 331831 insertions(+), 2443 deletions(-)
 create mode 100644 bsps/arm/include/cmsis_compiler.h
 create mode 100644 bsps/arm/include/cmsis_version.h
 create mode 100644 bsps/arm/include/legacy/cmsis_gcc.h
 create mode 100644 bsps/arm/include/legacy/core_cm7.h
 create mode 100644 bsps/arm/include/mpu_armv7.h
 create mode 100644 bsps/arm/stm32f4/hal/system_stm32f4xx.c
 delete mode 100644 bsps/arm/stm32f4/include/stm32_assert_template.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f401xc.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f401xe.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f405xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f407xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f410cx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f410rx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f410tx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f411xe.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f412cx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f412rx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f412vx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f412zx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f413xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f415xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f417xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f423xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f427xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f429xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f437xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f439xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f446xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f469xx.h
 create mode 100644 bsps/arm/stm32f4/include/stm32f4

[newlib 01/65] RTEMS: Remove FreeBSD version tags

2022-07-07 Thread Sebastian Huber
---
 newlib/libc/sys/rtems/include/arpa/inet.h | 2 +-
 newlib/libc/sys/rtems/include/net/if.h| 2 +-
 newlib/libc/sys/rtems/include/netdb.h | 2 +-
 newlib/libc/sys/rtems/include/netinet/in.h| 2 +-
 newlib/libc/sys/rtems/include/netinet/tcp.h   | 2 +-
 newlib/libc/sys/rtems/include/netinet6/in6.h  | 2 +-
 newlib/libc/sys/rtems/include/semaphore.h | 2 +-
 newlib/libc/sys/rtems/include/sys/_iovec.h| 2 +-
 newlib/libc/sys/rtems/include/sys/_sockaddr_storage.h | 2 +-
 newlib/libc/sys/rtems/include/sys/_termios.h  | 2 +-
 newlib/libc/sys/rtems/include/sys/_uio.h  | 2 +-
 newlib/libc/sys/rtems/include/sys/dirent.h| 2 +-
 newlib/libc/sys/rtems/include/sys/filio.h | 2 +-
 newlib/libc/sys/rtems/include/sys/ioccom.h| 2 +-
 newlib/libc/sys/rtems/include/sys/ioctl.h | 2 +-
 newlib/libc/sys/rtems/include/sys/mman.h  | 2 +-
 newlib/libc/sys/rtems/include/sys/param.h | 2 +-
 newlib/libc/sys/rtems/include/sys/socket.h| 2 +-
 newlib/libc/sys/rtems/include/sys/sockio.h| 2 +-
 newlib/libc/sys/rtems/include/sys/syslog.h| 2 +-
 newlib/libc/sys/rtems/include/sys/ttycom.h| 2 +-
 newlib/libc/sys/rtems/include/sys/ttydefaults.h   | 2 +-
 newlib/libc/sys/rtems/include/sys/uio.h   | 2 +-
 newlib/libc/sys/rtems/include/sys/un.h| 2 +-
 newlib/libc/sys/rtems/include/termios.h   | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/arpa/inet.h 
b/newlib/libc/sys/rtems/include/arpa/inet.h
index e54ea099b..01f3083c3 100644
--- a/newlib/libc/sys/rtems/include/arpa/inet.h
+++ b/newlib/libc/sys/rtems/include/arpa/inet.h
@@ -54,7 +54,7 @@
 /*%
  * @(#)inet.h  8.1 (Berkeley) 6/2/93
  * $Id: inet.h,v 1.3 2005/04/27 04:56:16 sra Exp $
- * $FreeBSD: head/include/arpa/inet.h 326695 2017-12-08 15:57:29Z pfg $
+ * $FreeBSD$
  */
 
 #ifndef _ARPA_INET_H_
diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index c7c5e8669..512a926aa 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  *
  * @(#)if.h8.1 (Berkeley) 6/10/93
- * $FreeBSD: head/sys/net/if.h 352458 2019-09-17 18:49:13Z kib $
+ * $FreeBSD$
  */
 
 #ifndef _NET_IF_H_
diff --git a/newlib/libc/sys/rtems/include/netdb.h 
b/newlib/libc/sys/rtems/include/netdb.h
index f06b96912..731e7f737 100644
--- a/newlib/libc/sys/rtems/include/netdb.h
+++ b/newlib/libc/sys/rtems/include/netdb.h
@@ -53,7 +53,7 @@
 /*
  *  @(#)netdb.h8.1 (Berkeley) 6/2/93
  *  From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $
- * $FreeBSD: head/include/netdb.h 342383 2018-12-23 20:51:13Z pfg $
+ * $FreeBSD$
  */
 
 #ifndef _NETDB_H_
diff --git a/newlib/libc/sys/rtems/include/netinet/in.h 
b/newlib/libc/sys/rtems/include/netinet/in.h
index 1ef4672ba..d98581d87 100644
--- a/newlib/libc/sys/rtems/include/netinet/in.h
+++ b/newlib/libc/sys/rtems/include/netinet/in.h
@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  *
  * @(#)in.h8.3 (Berkeley) 1/3/94
- * $FreeBSD: head/sys/netinet/in.h 350749 2019-08-08 11:43:09Z thj $
+ * $FreeBSD$
  */
 
 #ifndef _NETINET_IN_H_
diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index bce1d59c6..508d4b5fb 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  *
  * @(#)tcp.h   8.1 (Berkeley) 6/10/93
- * $FreeBSD: head/sys/netinet/tcp.h 351522 2019-08-27 00:01:56Z jhb $
+ * $FreeBSD$
  */
 
 #ifndef _NETINET_TCP_H_
diff --git a/newlib/libc/sys/rtems/include/netinet6/in6.h 
b/newlib/libc/sys/rtems/include/netinet6/in6.h
index a9c7cbc00..f6399eed1 100644
--- a/newlib/libc/sys/rtems/include/netinet6/in6.h
+++ b/newlib/libc/sys/rtems/include/netinet6/in6.h
@@ -60,7 +60,7 @@
  * SUCH DAMAGE.
  *
  * @(#)in.h8.3 (Berkeley) 1/3/94
- * $FreeBSD: head/sys/netinet6/in6.h 349369 2019-06-25 11:54:41Z hselasky $
+ * $FreeBSD$
  */
 
 #ifndef __KAME_NETINET_IN_H_INCLUDED_
diff --git a/newlib/libc/sys/rtems/include/semaphore.h 
b/newlib/libc/sys/rtems/include/semaphore.h
index 44ecc58f4..939135fb3 100644
--- a/newlib/libc/sys/rtems/include/semaphore.h
+++ b/newlib/libc/sys/rtems/include/semaphore.h
@@ -24,7 +24,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: head/include/semaphore.h 314424 2017-02-28 21:47:00Z vangyzen $
+ * $FreeBSD$
  */
 
 /* semaphore.h: POSIX 1003.1b semaphores */
diff --git a/newlib/libc/sys/rtems/include/sys/_iovec.h 
b/newlib/libc/sys/rtems/include/sys/_iovec.h
index 7170d2e7e..da9a16a63 100644
--- a/newlib/libc/sys/rtems/includ

[newlib 13/65] Make use of the stats(3) framework in the TCP stack.

2022-07-07 Thread Sebastian Huber
From: Edward Tomasz Napierala 

This makes it possible to retrieve per-connection statistical
information such as the receive window size, RTT, or goodput,
using a newly added TCP_STATS getsockopt(3) option, and extract
them using the stats_voistat_fetch(3) API.

See the net/tcprtt port for an example consumer of this API.

Compared to the existing TCP_INFO system, the main differences
are that this mechanism is easy to extend without breaking ABI,
and provides statistical information instead of raw "snapshots"
of values at a given point in time.  stats(3) is more generic
and can be used in both userland and the kernel.

Reviewed by:thj
Tested by:  thj
Obtained from:  Netflix
Relnotes:   yes
Sponsored by:   Klara Inc, Netflix
Differential Revision:  https://reviews.freebsd.org/D20655
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 125cacb28..4e06c9792 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -168,6 +168,7 @@ struct tcphdr {
 #define TCP_NOOPT  8   /* don't use TCP options */
 #define TCP_MD5SIG 16  /* use MD5 digests (RFC2385) */
 #defineTCP_INFO32  /* retrieve tcp_info structure */
+#defineTCP_STATS   33  /* retrieve stats blob structure */
 #defineTCP_LOG 34  /* configure event logging for 
connection */
 #defineTCP_LOGBUF  35  /* retrieve event log for connection */
 #defineTCP_LOGID   36  /* configure log ID to correlate 
connections */
@@ -364,4 +365,18 @@ struct tcp_function_set {
  */
 #defineTLS_SET_RECORD_TYPE 1
 
+/*
+ * TCP specific variables of interest for tp->t_stats stats(9) accounting.
+ */
+#defineVOI_TCP_TXPB0 /* Transmit payload bytes */
+#defineVOI_TCP_RETXPB  1 /* Retransmit payload bytes */
+#defineVOI_TCP_FRWIN   2 /* Foreign receive window */
+#defineVOI_TCP_LCWIN   3 /* Local congesiton window */
+#defineVOI_TCP_RTT 4 /* Round trip time */
+#defineVOI_TCP_CSIG5 /* Congestion signal */
+#defineVOI_TCP_GPUT6 /* Goodput */
+#defineVOI_TCP_CALCFRWINDIFF   7 /* Congestion avoidance LCWIN - FRWIN 
*/
+#defineVOI_TCP_GPUT_ND 8 /* Goodput normalised delta */
+#defineVOI_TCP_ACKLEN  9 /* Average ACKed bytes per ACK */
+
 #endif /* !_NETINET_TCP_H_ */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 03/65] Add FIOBMAP2 ioctl

2022-07-07 Thread Sebastian Huber
From: Alan Somers 

This ioctl exposes VOP_BMAP information to userland. It can be used by
programs like fragmentation analyzers and optimized cp implementations. But
I'm using it to test fusefs's VOP_BMAP implementation. The "2" in the name
distinguishes it from the similar but incompatible FIBMAP ioctls in NetBSD
and Linux.  FIOBMAP2 differs from FIBMAP in that it uses a 64-bit block
number instead of 32-bit, and it also returns runp and runb.

Reviewed by:mckusick
MFC after:  2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D20705
---
 newlib/libc/sys/rtems/include/sys/filio.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/sys/filio.h 
b/newlib/libc/sys/rtems/include/sys/filio.h
index 868fe53c2..1a3fc4293 100644
--- a/newlib/libc/sys/rtems/include/sys/filio.h
+++ b/newlib/libc/sys/rtems/include/sys/filio.h
@@ -62,6 +62,13 @@ struct fiodgname_arg {
 /* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */
 #defineFIOSEEKDATA _IOWR('f', 97, off_t)   /* SEEK_DATA */
 #defineFIOSEEKHOLE _IOWR('f', 98, off_t)   /* SEEK_HOLE */
+struct fiobmap2_arg {
+   int64_t bn;
+   int runp;
+   int runb;
+};
+/* Get the file's bmap info for the logical block bn */
+#define FIOBMAP2   _IOWR('f', 99, struct fiobmap2_arg)
 
 #ifdef _KERNEL
 #ifdef COMPAT_FREEBSD32
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 04/65] #include from sys/filio.h

2022-07-07 Thread Sebastian Huber
From: Alan Somers 

This fixes world build after r349231

Reported by:Jenkins
MFC after:  2 weeks
MFC-With:   349231
Sponsored by:   The FreeBSD Foundation
---
 newlib/libc/sys/rtems/include/sys/filio.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/sys/filio.h 
b/newlib/libc/sys/rtems/include/sys/filio.h
index 1a3fc4293..e85db9cff 100644
--- a/newlib/libc/sys/rtems/include/sys/filio.h
+++ b/newlib/libc/sys/rtems/include/sys/filio.h
@@ -40,6 +40,7 @@
 #ifndef_SYS_FILIO_H_
 #define_SYS_FILIO_H_
 
+#include 
 #include 
 
 /* Generic file-descriptor ioctl's. */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 02/65] Move 32-bit compat support for FIODGNAME to the right place.

2022-07-07 Thread Sebastian Huber
From: Brooks Davis 

ioctl(2) commands only have meaning in the context of a file descriptor
so translating them in the syscall layer is incorrect.

The new handler users an accessor to retrieve/construct a pointer from
the last member of the passed structure and relies on type punning to
access the other member which requires no translation.

Unlike r339174 this change supports both places FIODGNAME is handled.

Reviewed by:kib
Obtained from:  CheriBSD
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D17475
---
 newlib/libc/sys/rtems/include/sys/filio.h | 12 
 1 file changed, 12 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/sys/filio.h 
b/newlib/libc/sys/rtems/include/sys/filio.h
index 7899791f7..868fe53c2 100644
--- a/newlib/libc/sys/rtems/include/sys/filio.h
+++ b/newlib/libc/sys/rtems/include/sys/filio.h
@@ -63,4 +63,16 @@ struct fiodgname_arg {
 #defineFIOSEEKDATA _IOWR('f', 97, off_t)   /* SEEK_DATA */
 #defineFIOSEEKHOLE _IOWR('f', 98, off_t)   /* SEEK_HOLE */
 
+#ifdef _KERNEL
+#ifdef COMPAT_FREEBSD32
+struct fiodgname_arg32 {
+   int len;
+   uint32_tbuf;/* (void *) */
+};
+#defineFIODGNAME_32_IOC_NEWTYPE(FIODGNAME, struct fiodgname_arg32)
+#endif
+
+void   *fiodgname_buf_get_ptr(void *fgnp, u_long com);
+#endif
+
 #endif /* !_SYS_FILIO_H_ */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 00/65] Update FreeBSD baseline

2022-07-07 Thread Sebastian Huber
This patch set updates the header files imported from FreeBSD to the current
FreeBSD head:

commit 3bf66365129a13933f77d1f4421d5136861cffb4
Author: Brooks Davis 
Date:   Wed Jul 6 14:03:48 2022 +0100

cddl/*: add a WITH(OUT)_DTRACE option

Add an option to enable/disable DTrace without disabling ZFS.  New
architectures such as CHERI may support ZFS before they support DTrace
and the old model of WITHOUT_CDDL disabling both wasn't helpful.

For compatiblity, the CDDL option remains and WITHOUT_CDDL implies
WITHOUT_DTRACE.  WITHOUT_DTRACE also implies WITHOUT_CTF.

As part of this change, largely convert cddl/*/Makefile to using the
more compact SUBDIR.${MK_}+= form rather than using intermediate
variables.

Reviewed by:markj
Obtained from:  CheriBSD
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D35718

The patch set and the following patch sets for RTEMS and libbsd are required to
be able to update the FreeBSD baseline of libbsd branches.

Alan Somers (3):
  Add FIOBMAP2 ioctl
  #include  from sys/filio.h
  Reduce namespace pollution from r349233

Alexander V. Chernikov (5):
  Introduce nexthop objects and new routing KPI.
  Convert route caching to nexthop caching.
  Introduce scalable route multipath.
  SO_RERROR indicates that receive buffer overflows
  Revert "SO_RERROR indicates that receive buffer overflows"

Andrew Gallatin (1):
  Filter TCP connections to SO_REUSEPORT_LB listen sockets by NUMA
domain

Andrey V. Elsukov (1):
  Implement SIOCGIFALIAS.

Bjoern A. Zeeb (1):
  termios: add more speeds

Brooks Davis (2):
  Move 32-bit compat support for FIODGNAME to the right place.
  style(9): Correct whitespace in struct definitions

Conrad Meyer (2):
  unix(4): Add SOL_LOCAL:LOCAL_CREDS_PERSISTENT
  unix(4): Enhance LOCAL_CREDS_PERSISTENT ABI

David Bright (2):
  Add an shm_rename syscall
  Jail and capability mode for shm_rename;

Ed Maste (1):
  add SIOCGIFDATA ioctl

Edward Tomasz Napierala (1):
  Make use of the stats(3) framework in the TCP stack.

Gleb Smirnoff (4):
  Introduce flag IFF_NEEDSEPOCH
  Although most of the NIC drivers are epoch ready,
  Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to
IFCAP_MEXTPG.
  libc/syslog: fully deprecate and don't try to open "/dev/log"

John Baldwin (4):
  Add a TOE KTLS mode and a TOE hook for allocating TLS sessions.
  Initial support for kernel offload of TLS receive.
  Support hardware rate limiting (pacing) with TLS offload.
  Use thunks for compat ioctls using struct ifgroupreq.

Jonathan T. Looney (1):
  Make the path length of UNIX domain sockets

Konrad Sewiłło-Jopek (1):
  arp: Implement sticky ARP mode for interfaces.

Konstantin Belousov (7):
  Add SOL_LOCAL symbolic constant for unix socket option level.
  Support for userspace non-transparent superpages (largepages).
  Fix typo.
  Add tcgetwinsize(3) and tcsetwinsize(3) to termios
  ioccom: define ioctl cmd value that can never be valid
  Kernel-side infrastructure to implement nvlist-based set/get ifcaps
  Add ifcap2 names for RXTLS4 and RXTLS6 interface capabilities

Kristof Provost (1):
  pf: syncookie support

Kyle Evans (4):
  Add a shm_open2 syscall to support upcoming memfd_create
  Add linux-compatible memfd_create
  MFD_*: swap ordering
  shm_open2: Implement SHM_GROW_ON_WRITE

Mark Johnston (1):
  Include the psind in data returned by mincore(2).

Mateusz Guzik (2):
  net: clean up empty lines in .c and .h files
  sys: clean up empty lines in .c and .h files

Michael Tuexen (2):
  Add flags for upcoming patches related to improved ECN handling.
  tcp: add support for TCP over UDP

Mike Karels (1):
  kernel: deprecate Internet Class A/B/C

Navdeep Parhar (1):
  Add two new ifnet capabilities

Peter Lei (1):
  tcp: socket option to get stack alias name

Randall Stewart (7):
  This commit adds BBR (Bottleneck Bandwidth and RTT) congestion
control.
  White space cleanup --
  This change does a small prepratory step
  This brings into sync FreeBSD with the netflix
  tcp: Add a socket option to rack
  tcp: Add support for DSACK based reordering window to rack.
  tcp: Add hystart-plus to cc_newreno and rack.

Richard Scheffenegger (4):
  TCP: send full initial window when timestamps are in use
  Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow.
  tcp: SACK Lost Retransmission Detection (LRD)
  tcp: LRO code to deal with all 12 TCP header flags

Roy Marples (1):
  socket: Implement SO_RERROR

Sebastian Huber (1):
  RTEMS: Remove FreeBSD version tags

Thomas Munro (1):
  poll(2): Add POLLRDHUP.

Warner Losh (1):
  Integrate 4.4BSD-Lite2 changes to IOC_* definitions

Wei Hu (1):
  HyperV socket implementation for FreeBSD

 newlib/libc/sys/rtems/include/arpa/inet.h |   2 +-
 newlib/libc/sys/rtems/include/net/if.h|  87 +++
 newlib/libc/sys/rtems/include/netdb.h |   2 +-
 newlib/libc/sys/rtems/include/netinet/in.h|  34 --
 new

[newlib 40/65] unix(4): Enhance LOCAL_CREDS_PERSISTENT ABI

2022-07-07 Thread Sebastian Huber
From: Conrad Meyer 

As this ABI is still fresh (r367287), let's correct some mistakes now:

- Version the structure to allow for future changes
- Include sender's pid in control message structure
- Use a distinct control message type from the cmsgcred / sockcred mess

Discussed with: kib, markj, trasz
Differential Revision:  https://reviews.freebsd.org/D27084
---
 newlib/libc/sys/rtems/include/sys/socket.h | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/sys/socket.h 
b/newlib/libc/sys/rtems/include/sys/socket.h
index 0be6879de..4079b3e91 100644
--- a/newlib/libc/sys/rtems/include/sys/socket.h
+++ b/newlib/libc/sys/rtems/include/sys/socket.h
@@ -495,7 +495,7 @@ struct cmsgcred {
 };
 
 /*
- * Socket credentials.
+ * Socket credentials (LOCAL_CREDS).
  */
 struct sockcred {
uid_t   sc_uid; /* real user id */
@@ -512,6 +512,22 @@ struct sockcred {
 #defineSOCKCREDSIZE(ngrps) \
(sizeof(struct sockcred) + (sizeof(gid_t) * ((ngrps) - 1)))
 
+/*
+ * Socket credentials (LOCAL_CREDS_PERSISTENT).
+ */
+struct sockcred2 {
+   int sc_version; /* version of this structure */
+   pid_t   sc_pid; /* PID of sending process */
+   uid_t   sc_uid; /* real user id */
+   uid_t   sc_euid;/* effective user id */
+   gid_t   sc_gid; /* real group id */
+   gid_t   sc_egid;/* effective group id */
+   int sc_ngroups; /* number of supplemental groups */
+   gid_t   sc_groups[1];   /* variable length */
+};
+#defineSOCKCRED2SIZE(ngrps) \
+   (sizeof(struct sockcred2) + (sizeof(gid_t) * ((ngrps) - 1)))
+
 #endif /* __BSD_VISIBLE */
 
 /* given pointer to struct cmsghdr, return pointer to data */
@@ -552,6 +568,7 @@ struct sockcred {
 #defineSCM_REALTIME0x05/* timestamp (struct timespec) 
*/
 #defineSCM_MONOTONIC   0x06/* timestamp (struct timespec) 
*/
 #defineSCM_TIME_INFO   0x07/* timestamp info */
+#defineSCM_CREDS2  0x08/* process creds (struct 
sockcred2) */
 
 struct sock_timestamp_info {
__uint32_t  st_info_flags;
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 31/65] TCP: send full initial window when timestamps are in use

2022-07-07 Thread Sebastian Huber
From: Richard Scheffenegger 

The fastpath in tcp_output tries to send out
full segments, and avoid sending partial segments by
comparing against the static t_maxseg variable.
That value does not consider tcp options like timestamps,
while the initial window calculation is using
the correct dynamic tcp_maxseg() function.

Due to this interaction, the last, full size segment
is considered too short and not sent out immediately.

Reviewed by:tuexen
MFC after:  2 weeks
Sponsored by:   NetApp, Inc.
Differential Revision:  https://reviews.freebsd.org/D26478
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 0a5226836..faf142959 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -80,6 +80,8 @@ struct tcphdr {
u_short th_urp; /* urgent pointer */
 };
 
+#definePADTCPOLEN(len) len) / 4) + !!((len) % 4)) * 4)
+
 #defineTCPOPT_EOL  0
 #define   TCPOLEN_EOL  1
 #defineTCPOPT_PAD  0   /* padding after EOL */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 41/65] style(9): Correct whitespace in struct definitions

2022-07-07 Thread Sebastian Huber
From: Brooks Davis 

struct ifconf and struct ifreq use the odd style "structfoo".
struct ifdrv seems to have tried to follow this but was committed with
spaces in place of most tabs resulting in "structifdrv".

MFC after:  3 days
---
 newlib/libc/sys/rtems/include/net/if.h | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index 4147cd0f4..23d6cc756 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -393,7 +393,7 @@ struct ifreq_buffer {
  * definitions which begin with ifr_name.  The
  * remainder may be interface specific.
  */
-struct ifreq {
+struct ifreq {
charifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
union {
struct  sockaddr ifru_addr;
@@ -467,11 +467,11 @@ struct ifmediareq {
int *ifm_ulist; /* media words */
 };
 
-struct  ifdrv {
-   charifd_name[IFNAMSIZ]; /* if name, e.g. "en0" */
-   unsigned long   ifd_cmd;
-   size_t  ifd_len;
-   void*ifd_data;
+struct ifdrv {
+   charifd_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+   unsigned long   ifd_cmd;
+   size_t  ifd_len;
+   void*ifd_data;
 };
 
 /* 
@@ -493,7 +493,7 @@ struct ifstat {
  * for machine (useful for programs which
  * must know all networks accessible).
  */
-struct ifconf {
+struct ifconf {
int ifc_len;/* size of associated buffer */
union {
caddr_t ifcu_buf;
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 38/65] Integrate 4.4BSD-Lite2 changes to IOC_* definitions

2022-07-07 Thread Sebastian Huber
From: Warner Losh 

Bring in the long-overdue 4.4BSD-Lite2 rev 8.3 by cgd of
sys/ioccom.h. This uses UL suffix for the IOC_* constants so they
don't sign extend. Also bring in the handy diagram from NetBSD's
version of this file. This alters the 4.4BSD-Lite2 code slightly
in a way that's semantically the same but more compact.

This should stop the warnings from Chrome for bogus sign extension.

Reviewed by: kib@, jhb@
Differential Revision: https://reviews.freebsd.org/D26423
---
 newlib/libc/sys/rtems/include/sys/ioccom.h | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/sys/ioccom.h 
b/newlib/libc/sys/rtems/include/sys/ioccom.h
index a0117245b..adaa30797 100644
--- a/newlib/libc/sys/rtems/include/sys/ioccom.h
+++ b/newlib/libc/sys/rtems/include/sys/ioccom.h
@@ -28,7 +28,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * @(#)ioccom.h8.2 (Berkeley) 3/28/94
+ * @(#)ioccom.h8.3 (Berkeley) 1/9/95
  * $FreeBSD$
  */
 
@@ -43,6 +43,11 @@ typedef unsigned long ioctl_command_t;
  * Ioctl's have the command encoded in the lower word, and the size of
  * any in or out parameters in the upper word.  The high 3 bits of the
  * upper word are used to encode the in/out status of the parameter.
+ *
+ *  31 29 28 16 158 7 0
+ * +---+
+ * | I/O | Parameter Length| Command Group | Command   |
+ * +---+
  */
 #defineIOCPARM_SHIFT   13  /* number of bits for ioctl 
size */
 #defineIOCPARM_MASK((1 << IOCPARM_SHIFT) - 1) /* parameter length 
mask */
@@ -51,11 +56,11 @@ typedef unsigned long ioctl_command_t;
 #defineIOCGROUP(x) (((x) >> 8) & 0xff)
 
 #defineIOCPARM_MAX (1 << IOCPARM_SHIFT) /* max size of ioctl */
-#defineIOC_VOID0x2000  /* no parameters */
-#defineIOC_OUT 0x4000  /* copy out parameters */
-#defineIOC_IN  0x8000  /* copy in parameters */
-#defineIOC_INOUT   (IOC_IN|IOC_OUT)
-#defineIOC_DIRMASK (IOC_VOID|IOC_OUT|IOC_IN)
+#defineIOC_VOID0x2000UL/* no parameters */
+#defineIOC_OUT 0x4000UL/* copy out parameters */
+#defineIOC_IN  0x8000UL/* copy in parameters */
+#defineIOC_INOUT   (IOC_IN|IOC_OUT)/* copy parameters in and out */
+#defineIOC_DIRMASK (IOC_VOID|IOC_OUT|IOC_IN)/* mask for 
IN/OUT/VOID */
 
 #define_IOC(inout,group,num,len)   
\
 ((ioctl_command_t)((ioctl_command_t)(inout) | (((ioctl_command_t)(len) & \
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 44/65] Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG.

2022-07-07 Thread Sebastian Huber
From: Gleb Smirnoff 

Originally IFCAP_NOMAP meant that the mbuf has external storage pointer
that points to unmapped address.  Then, this was extended to array of
such pointers.  Then, such mbufs were augmented with header/trailer.
Basically, extended mbufs are extended, and set of features is subject
to change.  The new name should be generic enough to avoid further
renaming.
---
 newlib/libc/sys/rtems/include/net/if.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index 23d6cc756..a469a1f60 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -245,7 +245,7 @@ struct if_data {
 #defineIFCAP_HWSTATS   0x80 /* manages counters internally 
*/
 #defineIFCAP_TXRTLMT   0x100 /* hardware supports TX rate 
limiting */
 #defineIFCAP_HWRXTSTMP 0x200 /* hardware rx timestamping */
-#defineIFCAP_NOMAP 0x400 /* can TX unmapped mbufs */
+#defineIFCAP_MEXTPG0x400 /* understands M_EXTPG mbufs 
*/
 #defineIFCAP_TXTLS40x800 /* can do TLS encryption and 
segmentation for TCP */
 #defineIFCAP_TXTLS60x1000 /* can do TLS encryption and 
segmentation for TCP6 */
 #defineIFCAP_VXLAN_HWCSUM  0x2000 /* can do IFCAN_HWCSUM on 
VXLANs */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 23/65] HyperV socket implementation for FreeBSD

2022-07-07 Thread Sebastian Huber
From: Wei Hu 

This change adds Hyper-V socket feature in FreeBSD. New socket address
family AF_HYPERV and its kernel support are added.

Submitted by:   Wei Hu 
Reviewed by:Dexuan Cui 
Relnotes:   yes
Sponsored by:   Microsoft
Differential Revision:  https://reviews.freebsd.org/D24061
---
 newlib/libc/sys/rtems/include/sys/socket.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/sys/socket.h 
b/newlib/libc/sys/rtems/include/sys/socket.h
index 3431947cf..d0d31a2b0 100644
--- a/newlib/libc/sys/rtems/include/sys/socket.h
+++ b/newlib/libc/sys/rtems/include/sys/socket.h
@@ -257,7 +257,8 @@ struct accept_filter_arg {
 #defineAF_IEEE8021137  /* IEEE 802.11 protocol */
 #defineAF_INET_SDP 40  /* OFED Socket Direct Protocol 
ipv4 */
 #defineAF_INET6_SDP42  /* OFED Socket Direct Protocol 
ipv6 */
-#defineAF_MAX  42
+#defineAF_HYPERV   43  /* HyperV sockets */
+#defineAF_MAX  43
 /*
  * When allocating a new AF_ constant, please only allocate
  * even numbered constants for FreeBSD until 134 as odd numbered AF_
@@ -265,7 +266,6 @@ struct accept_filter_arg {
  */
 #define AF_VENDOR00 39
 #define AF_VENDOR01 41
-#define AF_VENDOR02 43
 #define AF_VENDOR03 45
 #define AF_VENDOR04 47
 #define AF_VENDOR05 49
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 06/65] This commit adds BBR (Bottleneck Bandwidth and RTT) congestion control.

2022-07-07 Thread Sebastian Huber
From: Randall Stewart 

This is a completely separate TCP stack (tcp_bbr.ko) that will be built only if
you add the make options WITH_EXTRA_TCP_STACKS=1 and also include the option
TCPHPTS.  You can also include the RATELIMIT option if you have a NIC interface
that supports hardware pacing, BBR understands how to use such a feature.

Note that this commit also adds in a general purpose time-filter which
allows you to have a min-filter or max-filter. A filter allows you to
have a low (or high) value for some period of time and degrade slowly
to another value has time passes. You can find out the details of
BBR by looking at the original paper at:

https://queue.acm.org/detail.cfm?id=3022184

or consult many other web resources you can find on the web
referenced by "BBR congestion control". It should be noted that
BBRv1 (which this is) does tend to unfairness in cases of small
buffered paths, and it will usually get less bandwidth in the case
of large BDP paths(when competing with new-reno or cubic flows). BBR
is still an active research area and we do plan on  implementing V2
of BBR to see if it is an improvement over V1.

Sponsored by:   Netflix Inc.
Differential Revision:  https://reviews.freebsd.org/D21582
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 508d4b5fb..37ba3bb55 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -239,6 +239,7 @@ struct tcphdr {
 #define TCP_BBR_ACK_COMP_ALG   1096/* Not used */
 #define TCP_BBR_TMR_PACE_OH1096/* Recycled in 4.2 */
 #define TCP_BBR_EXTRA_GAIN 1097
+#define TCP_RACK_DO_DETECTION  1097/* Recycle of extra gain for rack, 
attack detection */
 #define TCP_BBR_RACK_RTT_USE   1098/* what RTT should we use 0, 1, or 2? */
 #define TCP_BBR_RETRAN_WTSO1099
 #define TCP_DATA_AFTER_CLOSE   1100
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 26/65] net: clean up empty lines in .c and .h files

2022-07-07 Thread Sebastian Huber
From: Mateusz Guzik 

---
 newlib/libc/sys/rtems/include/net/if.h  | 1 -
 newlib/libc/sys/rtems/include/netinet/tcp.h | 2 --
 2 files changed, 3 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index 78b1654dc..1a3a0e564 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -164,7 +164,6 @@ struct if_data {
 #defineIFF_RENAMING0x40/* (n) interface is being 
renamed */
 #defineIFF_NOGROUP 0x80/* (n) interface is not part of 
any groups */
 
-
 /*
  * Old names for driver flags so that user space tools can continue to use
  * the old (portable) names.
diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 5dc13eca2..0a5226836 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -107,7 +107,6 @@ struct tcphdr {
 #defineMAX_SACK_BLKS   6   /* Max # SACK blocks stored at receiver 
side */
 #defineTCP_MAX_SACK4   /* MAX # SACKs sent in any segment */
 
-
 /*
  * The default maximum segment size (MSS) to be used for new TCP connections
  * when path MTU discovery is not enabled.
@@ -282,7 +281,6 @@ struct tcphdr {
 #define TCP_SHARED_CWND_TIME_LIMIT 1128 /* we should limit to low time values 
the scwnd life */
 #define TCP_RACK_PROFILE 1129  /* Select a profile that sets multiple options 
*/
 
-
 /* Start of reserved space for third-party user-settable options. */
 #defineTCP_VENDOR  SO_VENDOR
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 30/65] Add two new ifnet capabilities

2022-07-07 Thread Sebastian Huber
From: Navdeep Parhar 

for hw checksumming and TSO for VXLAN traffic.

These are similar to the existing VLAN capabilities.

Reviewed by:kib@
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D25873
---
 newlib/libc/sys/rtems/include/net/if.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index 1a3a0e564..863daefde 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -248,6 +248,8 @@ struct if_data {
 #defineIFCAP_NOMAP 0x400 /* can TX unmapped mbufs */
 #defineIFCAP_TXTLS40x800 /* can do TLS encryption and 
segmentation for TCP */
 #defineIFCAP_TXTLS60x1000 /* can do TLS encryption and 
segmentation for TCP6 */
+#defineIFCAP_VXLAN_HWCSUM  0x2000 /* can do IFCAN_HWCSUM on 
VXLANs */
+#defineIFCAP_VXLAN_HWTSO   0x4000 /* can do IFCAP_TSO on 
VXLANs */
 
 #define IFCAP_HWCSUM_IPV6  (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6)
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 39/65] unix(4): Add SOL_LOCAL:LOCAL_CREDS_PERSISTENT

2022-07-07 Thread Sebastian Huber
From: Conrad Meyer 

This option is intended to be semantically identical to Linux's
SOL_SOCKET:SO_PASSCRED.  For now, it is mutually exclusive with the
pre-existing sockopt SOL_LOCAL:LOCAL_CREDS.

Reviewed by:markj (penultimate version)
Differential Revision:  https://reviews.freebsd.org/D27011
---
 newlib/libc/sys/rtems/include/sys/un.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/sys/un.h 
b/newlib/libc/sys/rtems/include/sys/un.h
index 3a011aeef..e02484151 100644
--- a/newlib/libc/sys/rtems/include/sys/un.h
+++ b/newlib/libc/sys/rtems/include/sys/un.h
@@ -67,6 +67,7 @@ struct sockaddr_un {
 /* Socket options. */
 #defineLOCAL_PEERCRED  1   /* retrieve peer credentials */
 #defineLOCAL_CREDS 2   /* pass credentials to receiver 
*/
+#defineLOCAL_CREDS_PERSISTENT  3   /* pass credentials to receiver 
*/
 #defineLOCAL_CONNWAIT  4   /* connects block until 
accepted */
 
 /* Start of reserved space for third-party socket options. */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 50/65] ioccom: define ioctl cmd value that can never be valid

2022-07-07 Thread Sebastian Huber
From: Konstantin Belousov 

Its use is for cases where some filler is needed for cmd, or we need an
indication that there were no cmd supplied, and so on.

Reviewed by:jhb
Sponsored by:   The FreeBSD Foundation
MFC after:  1 week
Differential revision:  https://reviews.freebsd.org/D29935
---
 newlib/libc/sys/rtems/include/sys/ioccom.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/sys/ioccom.h 
b/newlib/libc/sys/rtems/include/sys/ioccom.h
index adaa30797..7b78db8e9 100644
--- a/newlib/libc/sys/rtems/include/sys/ioccom.h
+++ b/newlib/libc/sys/rtems/include/sys/ioccom.h
@@ -84,6 +84,9 @@ typedef unsigned long ioctl_command_t;
 #defineIOCPARM_IVAL(x) ((int)(intptr_t)(void *)*(caddr_t *)(void *)(x))
 #endif
 
+#define_IOC_INVALID(_IOC_VOID|_IOC_INOUT)  /* Never valid cmd 
value,
+  use as filler */
+
 #endif
 
 __BEGIN_DECLS
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 10/65] MFD_*: swap ordering

2022-07-07 Thread Sebastian Huber
From: Kyle Evans 

This API is still young enough that I would expect no one to be dependant on
this yet... Swap the ordering while it's young to match Linux values to
potentially ease implementation of linuxolator syscall, being able to reuse
existing constants.
---
 newlib/libc/sys/rtems/include/sys/mman.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/sys/mman.h 
b/newlib/libc/sys/rtems/include/sys/mman.h
index 89cc4d699..c68efcc15 100644
--- a/newlib/libc/sys/rtems/include/sys/mman.h
+++ b/newlib/libc/sys/rtems/include/sys/mman.h
@@ -193,8 +193,8 @@
 /*
  * Flags for memfd_create().
  */
-#defineMFD_ALLOW_SEALING   0x0001
-#defineMFD_CLOEXEC 0x0002
+#defineMFD_CLOEXEC 0x0001
+#defineMFD_ALLOW_SEALING   0x0002
 
 /* UNSUPPORTED */
 #defineMFD_HUGETLB 0x0004
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 37/65] Support hardware rate limiting (pacing) with TLS offload.

2022-07-07 Thread Sebastian Huber
From: John Baldwin 

- Add a new send tag type for a send tag that supports both rate
  limiting (packet pacing) and TLS offload (mostly similar to D22669
  but adds a separate structure when allocating the new tag type).

- When allocating a send tag for TLS offload, check to see if the
  connection already has a pacing rate.  If so, allocate a tag that
  supports both rate limiting and TLS offload rather than a plain TLS
  offload tag.

- When setting an initial rate on an existing ifnet KTLS connection,
  set the rate in the TCP control block inp and then reset the TLS
  send tag (via ktls_output_eagain) to reallocate a TLS + ratelimit
  send tag.  This allocates the TLS send tag asynchronously from a
  task queue, so the TLS rate limit tag alloc is always sleepable.

- When modifying a rate on a connection using KTLS, look for a TLS
  send tag.  If the send tag is only a plain TLS send tag, assume we
  failed to allocate a TLS ratelimit tag (either during the
  TCP_TXTLS_ENABLE socket option, or during the send tag reset
  triggered by ktls_output_eagain) and ignore the new rate.  If the
  send tag is a ratelimit TLS send tag, change the rate on the TLS tag
  and leave the inp tag alone.

- Lock the inp lock when setting sb_tls_info for a socket send buffer
  so that the routines in tcp_ratelimit can safely dereference the
  pointer without needing to grab the socket buffer lock.

- Add an IFCAP_TXTLS_RTLMT capability flag and associated
  administrative controls in ifconfig(8).  TLS rate limit tags are
  only allocated if this capability is enabled.  Note that TLS offload
  (whether unlimited or rate limited) always requires IFCAP_TXTLS[46].

Reviewed by:gallatin, hselasky
Relnotes:   yes
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D26691
---
 newlib/libc/sys/rtems/include/net/if.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index c9f07eca7..4147cd0f4 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -250,6 +250,7 @@ struct if_data {
 #defineIFCAP_TXTLS60x1000 /* can do TLS encryption and 
segmentation for TCP6 */
 #defineIFCAP_VXLAN_HWCSUM  0x2000 /* can do IFCAN_HWCSUM on 
VXLANs */
 #defineIFCAP_VXLAN_HWTSO   0x4000 /* can do IFCAP_TSO on 
VXLANs */
+#defineIFCAP_TXTLS_RTLMT   0x8000 /* can do TLS with rate 
limiting */
 
 #define IFCAP_HWCSUM_IPV6  (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6)
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 08/65] Add linux-compatible memfd_create

2022-07-07 Thread Sebastian Huber
From: Kyle Evans 

memfd_create is effectively a SHM_ANON shm_open(2) mapping with optional
CLOEXEC and file sealing support. This is used by some mesa parts, some
linux libs, and qemu can also take advantage of it and uses the sealing to
prevent resizing the region.

This reimplements shm_open in terms of shm_open2(2) at the same time.

shm_open(2) will be moved to COMPAT12 shortly.

Reviewed by:markj, kib
Differential Revision:  https://reviews.freebsd.org/D21393
---
 newlib/libc/sys/rtems/include/sys/mman.h | 27 
 1 file changed, 27 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/sys/mman.h 
b/newlib/libc/sys/rtems/include/sys/mman.h
index 6e178d83d..867b68647 100644
--- a/newlib/libc/sys/rtems/include/sys/mman.h
+++ b/newlib/libc/sys/rtems/include/sys/mman.h
@@ -182,6 +182,30 @@
  */
 #defineSHM_ALLOW_SEALING   0x0001
 
+/*
+ * Flags for memfd_create().
+ */
+#defineMFD_ALLOW_SEALING   0x0001
+#defineMFD_CLOEXEC 0x0002
+
+/* UNSUPPORTED */
+#defineMFD_HUGETLB 0x0004
+
+#defineMFD_HUGE_MASK   0xFC00
+#defineMFD_HUGE_SHIFT  26
+#defineMFD_HUGE_64KB   (16 << MFD_HUGE_SHIFT)
+#defineMFD_HUGE_512KB  (19 << MFD_HUGE_SHIFT)
+#defineMFD_HUGE_1MB(20 << MFD_HUGE_SHIFT)
+#defineMFD_HUGE_2MB(21 << MFD_HUGE_SHIFT)
+#defineMFD_HUGE_8MB(23 << MFD_HUGE_SHIFT)
+#defineMFD_HUGE_16MB   (24 << MFD_HUGE_SHIFT)
+#defineMFD_HUGE_32MB   (25 << MFD_HUGE_SHIFT)
+#defineMFD_HUGE_256MB  (28 << MFD_HUGE_SHIFT)
+#defineMFD_HUGE_512MB  (29 << MFD_HUGE_SHIFT)
+#defineMFD_HUGE_1GB(30 << MFD_HUGE_SHIFT)
+#defineMFD_HUGE_2GB(31 << MFD_HUGE_SHIFT)
+#defineMFD_HUGE_16GB   (34 << MFD_HUGE_SHIFT)
+
 #endif /* __BSD_VISIBLE */
 
 /*
@@ -242,6 +266,9 @@ int munlockall(void);
 intshm_open(const char *, int, mode_t);
 intshm_unlink(const char *);
 #endif
+#if __BSD_VISIBLE
+intmemfd_create(const char *, unsigned int);
+#endif
 __END_DECLS
 
 #endif /* !_KERNEL */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 07/65] Add a shm_open2 syscall to support upcoming memfd_create

2022-07-07 Thread Sebastian Huber
From: Kyle Evans 

shm_open2 allows a little more flexibility than the original shm_open.
shm_open2 doesn't enforce CLOEXEC on its callers, and it has a separate
shmflag argument that can be expanded later. Currently the only shmflag is
to allow file sealing on the returned fd.

shm_open and memfd_create will both be implemented in libc to use this new
syscall.

__FreeBSD_version is bumped to indicate the presence.

Reviewed by:kib, markj
Differential Revision:  https://reviews.freebsd.org/D21393
---
 newlib/libc/sys/rtems/include/sys/mman.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/sys/mman.h 
b/newlib/libc/sys/rtems/include/sys/mman.h
index f75490c96..6e178d83d 100644
--- a/newlib/libc/sys/rtems/include/sys/mman.h
+++ b/newlib/libc/sys/rtems/include/sys/mman.h
@@ -176,6 +176,12 @@
  * Anonymous object constant for shm_open().
  */
 #defineSHM_ANON((char *)1)
+
+/*
+ * shmflags for shm_open2()
+ */
+#defineSHM_ALLOW_SEALING   0x0001
+
 #endif /* __BSD_VISIBLE */
 
 /*
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 16/65] White space cleanup --

2022-07-07 Thread Sebastian Huber
From: Randall Stewart 

remove trailing tab's or spaces from any line.

Sponsored by:   Netflix Inc.
---
 newlib/libc/sys/rtems/include/netinet/in.h  | 6 +++---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/netinet/in.h 
b/newlib/libc/sys/rtems/include/netinet/in.h
index d98581d87..749e74eda 100644
--- a/newlib/libc/sys/rtems/include/netinet/in.h
+++ b/newlib/libc/sys/rtems/include/netinet/in.h
@@ -323,8 +323,8 @@ __END_DECLS
  * Default local port range, used by IP_PORTRANGE_DEFAULT
  */
 #define IPPORT_EPHEMERALFIRST  1
-#define IPPORT_EPHEMERALLAST   65535 
- 
+#define IPPORT_EPHEMERALLAST   65535
+
 /*
  * Dynamic port range, used by IP_PORTRANGE_HIGH.
  */
@@ -381,7 +381,7 @@ __END_DECLS
 (((in_addr_t)(i) & 0x) == 0xc0a8))
 
 #defineIN_LOCAL_GROUP(i)   (((in_addr_t)(i) & 0xff00) == 
0xe000)
- 
+
 #defineIN_ANY_LOCAL(i) (IN_LINKLOCAL(i) || IN_LOCAL_GROUP(i))
 
 #defineINADDR_LOOPBACK ((in_addr_t)0x7f01)
diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 528f3cd8d..fe9221a74 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -333,7 +333,7 @@ struct tcp_info {
u_int32_t   tcpi_snd_rexmitpack;/* Retransmitted packets */
u_int32_t   tcpi_rcv_ooopack;   /* Out-of-order packets */
u_int32_t   tcpi_snd_zerowin;   /* Zero-sized windows sent */
-   
+
/* Padding to grow without breaking ABI. */
u_int32_t   __tcpi_pad[26]; /* Padding. */
 };
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 19/65] Make the path length of UNIX domain sockets

2022-07-07 Thread Sebastian Huber
From: "Jonathan T. Looney" 

specified by a #define. Also, add a comment describing the historical context
for this length.

Reviewed by:bz, jhb, kbowling (previous version)
MFC after:  2 weeks
Sponsored by:   Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D24272
---
 newlib/libc/sys/rtems/include/sys/un.h | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/sys/un.h 
b/newlib/libc/sys/rtems/include/sys/un.h
index f83652e07..3c408628c 100644
--- a/newlib/libc/sys/rtems/include/sys/un.h
+++ b/newlib/libc/sys/rtems/include/sys/un.h
@@ -43,13 +43,21 @@ typedef __sa_family_t   sa_family_t;
 #define_SA_FAMILY_T_DECLARED
 #endif
 
+/*
+ * Historically, (struct sockaddr) needed to fit inside an mbuf.
+ * For this reason, UNIX domain sockets were therefore limited to
+ * 104 bytes. While this limit is no longer necessary, it is kept for
+ * binary compatibility reasons.
+ */
+#defineSUNPATHLEN  104
+
 /*
  * Definitions for UNIX IPC domain.
  */
 struct sockaddr_un {
unsigned char   sun_len;/* sockaddr len including null */
sa_family_t sun_family; /* AF_UNIX */
-   charsun_path[104];  /* path name (gag) */
+   charsun_path[SUNPATHLEN];   /* path name (gag) */
 };
 
 #if __BSD_VISIBLE
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 21/65] This change does a small prepratory step

2022-07-07 Thread Sebastian Huber
From: Randall Stewart 

in getting the latest rack and bbr in from the NF repo. When those come in the
OOB data handling will be fixed where Skyzaller crashes.

Differential Revision:  https://reviews.freebsd.org/D24575
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 29 ++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index fe9221a74..b5f01b3bc 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -181,6 +181,9 @@ struct tcphdr {
 #defineTCP_CONGESTION  64  /* get/set congestion control algorithm 
*/
 #defineTCP_CCALGOOPT   65  /* get/set cc algorithm specific 
options */
 #define TCP_DELACK 72  /* socket option for delayed ack */
+#define TCP_FIN_IS_RST 73  /* A fin from the peer is treated has a RST */
+#define TCP_LOG_LIMIT  74  /* Limit to number of records in tcp-log */
+#define TCP_SHARED_CWND_ALLOWED 75 /* Use of a shared cwnd is allowed */
 #defineTCP_KEEPINIT128 /* N, time to establish connection */
 #defineTCP_KEEPIDLE256 /* L,N,X start keeplives after this 
period */
 #defineTCP_KEEPINTVL   512 /* L,N interval between keepalives */
@@ -190,10 +193,11 @@ struct tcphdr {
 #defineTCP_PCAP_IN 4096/* number of input packets to keep */
 #define TCP_FUNCTION_BLK 8192  /* Set the tcp function pointers to the 
specified stack */
 /* Options for Rack and BBR */
+#define TCP_RACK_MBUF_QUEUE   1050 /* Do we allow mbuf queuing if supported */
 #define TCP_RACK_PROP1051 /* RACK proportional rate reduction (bool) */
 #define TCP_RACK_TLP_REDUCE   1052 /* RACK TLP cwnd reduction (bool) */
 #define TCP_RACK_PACE_REDUCE  1053 /* RACK Pacing reduction factor (divisor) */
-#define TCP_RACK_PACE_MAX_SEG 1054 /* Max segments in a pace */
+#define TCP_RACK_PACE_MAX_SEG 1054 /* Max TSO size we will send  */
 #define TCP_RACK_PACE_ALWAYS  1055 /* Use the always pace method */
 #define TCP_RACK_PROP_RATE1056 /* The proportional reduction rate */
 #define TCP_RACK_PRR_SENDALOT 1057 /* Allow PRR to send more than one seg */
@@ -236,7 +240,7 @@ struct tcphdr {
 #define TCP_RACK_IDLE_REDUCE_HIGH 1092  /* Reduce the highest cwnd seen to IW 
on idle */
 #define TCP_RACK_MIN_PACE  1093/* Do we enforce rack min pace time */
 #define TCP_RACK_MIN_PACE_SEG  1094/* If so what is the seg threshould */
-#define TCP_RACK_GP_INCREASE   1094/* After 4.1 its the GP increase */
+#define TCP_RACK_GP_INCREASE   1094/* After 4.1 its the GP increase in 
older rack */
 #define TCP_RACK_TLP_USE   1095
 #define TCP_BBR_ACK_COMP_ALG   1096/* Not used */
 #define TCP_BBR_TMR_PACE_OH1096/* Recycled in 4.2 */
@@ -248,7 +252,8 @@ struct tcphdr {
 #define TCP_BBR_PROBE_RTT_GAIN 1101
 #define TCP_BBR_PROBE_RTT_LEN  1102
 #define TCP_BBR_SEND_IWND_IN_TSO 1103  /* Do we burst out whole iwin size 
chunks at start? */
-#define TCP_BBR_USE_RACK_CHEAT 1104/* Do we use the rack cheat for pacing 
rxt's */
+#define TCP_BBR_USE_RACK_RR 1104   /* Do we use the rack rapid recovery 
for pacing rxt's */
+#define TCP_BBR_USE_RACK_CHEAT TCP_BBR_USE_RACK_RR /* Compat. */
 #define TCP_BBR_HDWR_PACE  1105/* Enable/disable hardware pacing */
 #define TCP_BBR_UTTER_MAX_TSO  1106/* Do we enforce an utter max TSO size 
*/
 #define TCP_BBR_EXTRA_STATE1107/* Special exit-persist catch up */
@@ -256,6 +261,24 @@ struct tcphdr {
 #define TCP_BBR_MIN_TOPACEOUT  1109/* Do we suspend pacing until */
 #define TCP_BBR_TSTMP_RAISES   1110/* Can a timestamp measurement raise 
the b/w */
 #define TCP_BBR_POLICER_DETECT /* Turn on/off google mode policer 
detection */
+#define TCP_BBR_RACK_INIT_RATE 1112/* Set an initial pacing rate for when 
we have no b/w in kbits per sec */
+#define TCP_RACK_RR_CONF   1113 /* Rack rapid recovery configuration 
control*/
+#define TCP_RACK_CHEAT_NOT_CONF_RATE TCP_RACK_RR_CONF
+#define TCP_RACK_GP_INCREASE_CA   1114 /* GP increase for Congestion Avoidance 
*/
+#define TCP_RACK_GP_INCREASE_SS   1115 /* GP increase for Slow Start */
+#define TCP_RACK_GP_INCREASE_REC  1116 /* GP increase for Recovery */
+#define TCP_RACK_FORCE_MSEG1117/* Override to use the user set max-seg 
value */
+#define TCP_RACK_PACE_RATE_CA  1118 /* Pacing rate for Congestion Avoidance */
+#define TCP_RACK_PACE_RATE_SS  1119 /* Pacing rate for Slow Start */
+#define TCP_RACK_PACE_RATE_REC  1120 /* Pacing rate for Recovery */
+#define TCP_NO_PRR 1122 /* If pacing, don't use prr  */
+#define TCP_RACK_NONRXT_CFG_RATE 1123 /* In recovery does a non-rxt use the 
cfg rate */
+#define TCP_SHARED_CWND_ENABLE   1124  /* Use a shared cwnd if allowed */
+#define TCP_TIMELY_DYN_ADJ   1125 /* Do we attempt dynamic multipler 
adjustment with timely. */
+#define TCP_RACK_NO_PUSH_AT_MAX 1126 

[newlib 28/65] Include the psind in data returned by mincore(2).

2022-07-07 Thread Sebastian Huber
From: Mark Johnston 

Currently we use a single bit to indicate whether the virtual page is
part of a superpage.  To support a forthcoming implementation of
non-transparent 1GB superpages, it is useful to provide more detailed
information about large page sizes.

The change converts MINCORE_SUPER into a mask for MINCORE_PSIND(psind)
values, indicating a mapping of size psind, where psind is an index into
the pagesizes array returned by getpagesizes(3), which in turn comes
from the hw.pagesizes sysctl.  MINCORE_PSIND(1) is equal to the old
value of MINCORE_SUPER.

For now, two bits are used to record the page size, permitting values
of MAXPAGESIZES up to 4.

Reviewed by:alc, kib
Sponsored by:   Juniper Networks, Inc.
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D26238
---
 newlib/libc/sys/rtems/include/sys/mman.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/sys/mman.h 
b/newlib/libc/sys/rtems/include/sys/mman.h
index 99c1eb8b3..6d861422d 100644
--- a/newlib/libc/sys/rtems/include/sys/mman.h
+++ b/newlib/libc/sys/rtems/include/sys/mman.h
@@ -179,7 +179,8 @@
 #defineMINCORE_MODIFIED 0x4 /* Page has been modified by us */
 #defineMINCORE_REFERENCED_OTHER 0x8 /* Page has been referenced */
 #defineMINCORE_MODIFIED_OTHER  0x10 /* Page has been modified */
-#defineMINCORE_SUPER   0x20 /* Page is a "super" page */
+#defineMINCORE_SUPER   0x60 /* Page is a "super" page */
+#defineMINCORE_PSIND(i)(((i) << 5) & MINCORE_SUPER) /* Page 
size */
 
 /*
  * Anonymous object constant for shm_open().
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 46/65] Revert "SO_RERROR indicates that receive buffer overflows"

2022-07-07 Thread Sebastian Huber
From: "Alexander V. Chernikov" 

Wrong version of the change was pushed inadvertenly.

This reverts commit 4a01b854ca5c2e5124958363b3326708b913af71.
---
 newlib/libc/sys/rtems/include/sys/socket.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/sys/socket.h 
b/newlib/libc/sys/rtems/include/sys/socket.h
index 54cd0be93..4079b3e91 100644
--- a/newlib/libc/sys/rtems/include/sys/socket.h
+++ b/newlib/libc/sys/rtems/include/sys/socket.h
@@ -139,7 +139,6 @@ typedef __uintptr_t uintptr_t;
 #defineSO_NO_OFFLOAD   0x4000  /* socket cannot be offloaded */
 #defineSO_NO_DDP   0x8000  /* disable direct data 
placement */
 #defineSO_REUSEPORT_LB 0x0001  /* reuse with load balancing */
-#defineSO_RERROR   0x0002  /* keep track of receive errors 
*/
 
 /*
  * Additional options, not kept in so_options.
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 33/65] Introduce scalable route multipath.

2022-07-07 Thread Sebastian Huber
From: "Alexander V. Chernikov" 

This change is based on the nexthop objects landed in D24232.

The change introduces the concept of nexthop groups.
Each group contains the collection of nexthops with their
 relative weights and a dataplane-optimized structure to enable
 efficient nexthop selection.

Simular to the nexthops, nexthop groups are immutable. Dataplane part
 gets compiled during group creation and is basically an array of
 nexthop pointers, compiled w.r.t their weights.

With this change, `rt_nhop` field of `struct rtentry` contains either
 nexthop or nexthop group. They are distinguished by the presense of
 NHF_MULTIPATH flag.
All dataplane lookup functions returns pointer to the nexthop object,
leaving nexhop groups details inside routing subsystem.

User-visible changes:

The change is intended to be backward-compatible: all non-mpath operations
 should work as before with ROUTE_MPATH and net.route.multipath=1.

All routes now comes with weight, default weight is 1, maximum is 2^24-1.

Current maximum multipath group width is statically set to 64.
 This will become sysctl-tunable in the followup changes.

Using functionality:
* Recompile kernel with ROUTE_MPATH
* set net.route.multipath to 1

route add -6 2001:db8::/32 2001:db8::2 -weight 10
route add -6 2001:db8::/32 2001:db8::3 -weight 20

netstat -6On

Nexthop groups data

Internet6:
GrpIdx  NhIdx Weight   Slots Gateway 
Netif  Refcnt
1 --- --- --- --- 
-   1
  13  10   1 2001:db8::2 
vlan2
  14  20   2 2001:db8::3 
vlan2

Next steps:
* Land outbound hashing for locally-originated routes ( D26523 ).
* Fix net/bird multipath (net/frr seems to work fine)
* Add ROUTE_MPATH to GENERIC
* Set net.route.multipath=1 by default

Tested by:  olivier
Reviewed by:glebius
Relnotes:   yes
Differential Revision:  https://reviews.freebsd.org/D26449
---
 newlib/libc/sys/rtems/include/sys/socket.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/sys/socket.h 
b/newlib/libc/sys/rtems/include/sys/socket.h
index 78831a54f..0be6879de 100644
--- a/newlib/libc/sys/rtems/include/sys/socket.h
+++ b/newlib/libc/sys/rtems/include/sys/socket.h
@@ -409,6 +409,7 @@ struct sockproto {
 #defineNET_RT_IFLISTL  5   /* Survey interface list, using 
'l'en
 * versions of msghdr structs. */
 #define NET_RT_NHOP6   /* dump routing nexthops */
+#define NET_RT_NHGRP   7   /* dump routing nexthop groups */
 #endif /* __BSD_VISIBLE */
 
 /*
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 34/65] Fix typo.

2022-07-07 Thread Sebastian Huber
From: Konstantin Belousov 

Sponsored by:   Mellanox Technologies/NVIDIA Networking
MFC after:  3 days
---
 newlib/libc/sys/rtems/include/net/if.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index 863daefde..c9f07eca7 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -209,7 +209,7 @@ struct if_data {
  *   contains the enabled optional feature & capabilites that can be used
  *   individually per packet and are specified in the mbuf pkthdr.csum_flags
  *   field.  IFCAP_* and CSUM_* do not match one to one and CSUM_* may be
- *   more detailed or differenciated than IFCAP_*.
+ *   more detailed or differentiated than IFCAP_*.
  *   Hwassist features are defined CSUM_* in sys/mbuf.h
  *
  * Capabilities that cannot be arbitrarily changed with ifconfig/ioctl
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 05/65] Reduce namespace pollution from r349233

2022-07-07 Thread Sebastian Huber
From: Alan Somers 

Define __daddr_t in _types.h and use it in filio.h

Reported by:ian, bde
Reviewed by:ian, imp, cem
MFC after:  2 weeks
MFC-With:   349233
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D20715
---
 newlib/libc/sys/rtems/include/sys/filio.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/sys/filio.h 
b/newlib/libc/sys/rtems/include/sys/filio.h
index e85db9cff..c5cf3d443 100644
--- a/newlib/libc/sys/rtems/include/sys/filio.h
+++ b/newlib/libc/sys/rtems/include/sys/filio.h
@@ -40,7 +40,7 @@
 #ifndef_SYS_FILIO_H_
 #define_SYS_FILIO_H_
 
-#include 
+#include 
 #include 
 
 /* Generic file-descriptor ioctl's. */
@@ -64,12 +64,12 @@ struct fiodgname_arg {
 #defineFIOSEEKDATA _IOWR('f', 97, off_t)   /* SEEK_DATA */
 #defineFIOSEEKHOLE _IOWR('f', 98, off_t)   /* SEEK_HOLE */
 struct fiobmap2_arg {
-   int64_t bn;
-   int runp;
-   int runb;
+   __daddr_t   bn;
+   int runp;
+   int runb;
 };
-/* Get the file's bmap info for the logical block bn */
-#define FIOBMAP2   _IOWR('f', 99, struct fiobmap2_arg)
+/* Get the file's bmap info for the logical block bn. */
+#defineFIOBMAP2_IOWR('f', 99, struct fiobmap2_arg)
 
 #ifdef _KERNEL
 #ifdef COMPAT_FREEBSD32
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 45/65] SO_RERROR indicates that receive buffer overflows

2022-07-07 Thread Sebastian Huber
From: "Alexander V. Chernikov" 

should be handled as errors. Historically receive buffer overflows have been
ignored and programs could not tell if they missed messages or messages had
been truncated because of overflows. Since programs historically do not expect
to get receive overflow errors, this behavior is not the default.

This is really really important for programs that use route(4) to keep in sync
with the system. If we loose a message then we need to reload the full system
state, otherwise the behaviour from that point is undefined and can lead
to chasing bogus bug reports.
---
 newlib/libc/sys/rtems/include/sys/socket.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/sys/socket.h 
b/newlib/libc/sys/rtems/include/sys/socket.h
index 4079b3e91..54cd0be93 100644
--- a/newlib/libc/sys/rtems/include/sys/socket.h
+++ b/newlib/libc/sys/rtems/include/sys/socket.h
@@ -139,6 +139,7 @@ typedef __uintptr_t uintptr_t;
 #defineSO_NO_OFFLOAD   0x4000  /* socket cannot be offloaded */
 #defineSO_NO_DDP   0x8000  /* disable direct data 
placement */
 #defineSO_REUSEPORT_LB 0x0001  /* reuse with load balancing */
+#defineSO_RERROR   0x0002  /* keep track of receive errors 
*/
 
 /*
  * Additional options, not kept in so_options.
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 15/65] Introduce flag IFF_NEEDSEPOCH

2022-07-07 Thread Sebastian Huber
From: Gleb Smirnoff 

that marks Ethernet interfaces that supposedly may call into ether_input()
without network epoch.

They all need to be reviewed before 13.0-RELEASE.  Some may need
be fixed.  The flag is not planned to be used in the kernel for
a long time.
---
 newlib/libc/sys/rtems/include/net/if.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index 512a926aa..2c1ecdf32 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -144,7 +144,7 @@ struct if_data {
 #defineIFF_DEBUG   0x4 /* (n) turn on debugging */
 #defineIFF_LOOPBACK0x8 /* (i) is a loopback net */
 #defineIFF_POINTOPOINT 0x10/* (i) is a point-to-point link 
*/
-/* 0x20   was IFF_SMART */
+#defineIFF_NEEDSEPOCH  0x20/* (i) calls if_input w/o epoch 
*/
 #defineIFF_DRV_RUNNING 0x40/* (d) resources allocated */
 #defineIFF_NOARP   0x80/* (n) no address resolution 
protocol */
 #defineIFF_PROMISC 0x100   /* (n) receive all packets */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 29/65] Support for userspace non-transparent superpages (largepages).

2022-07-07 Thread Sebastian Huber
From: Konstantin Belousov 

Created with shm_open2(SHM_LARGEPAGE) and then configured with
FIOSSHMLPGCNF ioctl, largepages posix shared memory objects guarantee
that all userspace mappings of it are served by superpage non-managed
mappings.

Only amd64 for now, both 2M and 1G superpages can be requested, the
later requires CPU feature.

Reviewed by:markj
Tested by:  pho
Sponsored by:   The FreeBSD Foundation
MFC after:  1 week
Differential revision:  https://reviews.freebsd.org/D24652
---
 newlib/libc/sys/rtems/include/sys/filio.h |  3 +++
 newlib/libc/sys/rtems/include/sys/mman.h  | 13 -
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/sys/filio.h 
b/newlib/libc/sys/rtems/include/sys/filio.h
index c5cf3d443..3eea7a7ac 100644
--- a/newlib/libc/sys/rtems/include/sys/filio.h
+++ b/newlib/libc/sys/rtems/include/sys/filio.h
@@ -70,6 +70,9 @@ struct fiobmap2_arg {
 };
 /* Get the file's bmap info for the logical block bn. */
 #defineFIOBMAP2_IOWR('f', 99, struct fiobmap2_arg)
+/* POSIX shm largepage set/get config */
+#defineFIOSSHMLPGCNF   _IOW('f', 100, struct shm_largepage_conf)
+#defineFIOGSHMLPGCNF   _IOR('f', 101, struct shm_largepage_conf)
 
 #ifdef _KERNEL
 #ifdef COMPAT_FREEBSD32
diff --git a/newlib/libc/sys/rtems/include/sys/mman.h 
b/newlib/libc/sys/rtems/include/sys/mman.h
index 6d861422d..d726a80d6 100644
--- a/newlib/libc/sys/rtems/include/sys/mman.h
+++ b/newlib/libc/sys/rtems/include/sys/mman.h
@@ -192,6 +192,17 @@
  */
 #defineSHM_ALLOW_SEALING   0x0001
 #defineSHM_GROW_ON_WRITE   0x0002
+#defineSHM_LARGEPAGE   0x0004
+
+#defineSHM_LARGEPAGE_ALLOC_DEFAULT 0
+#defineSHM_LARGEPAGE_ALLOC_NOWAIT  1
+#defineSHM_LARGEPAGE_ALLOC_HARD2
+
+struct shm_largepage_conf {
+   int psind;
+   int alloc_policy;
+   int pad[10];
+};
 
 /*
  * Flags for memfd_create().
@@ -199,7 +210,6 @@
 #defineMFD_CLOEXEC 0x0001
 #defineMFD_ALLOW_SEALING   0x0002
 
-/* UNSUPPORTED */
 #defineMFD_HUGETLB 0x0004
 
 #defineMFD_HUGE_MASK   0xFC00
@@ -279,6 +289,7 @@ int shm_unlink(const char *);
 #endif
 #if __BSD_VISIBLE
 intmemfd_create(const char *, unsigned int);
+intshm_create_largepage(const char *, int, int, int, mode_t);
 intshm_rename(const char *, const char *, int);
 #endif
 __END_DECLS
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 35/65] Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow.

2022-07-07 Thread Sebastian Huber
From: Richard Scheffenegger 

This adds a new IP_PROTO / IPV6_PROTO setsockopt (getsockopt)
option IP(V6)_VLAN_PCP, which can be set to -1 (interface
default), or explicitly to any priority between 0 and 7.

Note that for untagged traffic, explicitly adding a
priority will insert a special 801.1Q vlan header with
vlan ID = 0 to carry the priority setting

Reviewed by:gallatin, rrs
MFC after:  2 weeks
Sponsored by:   NetApp, Inc.
Differential Revision:  https://reviews.freebsd.org/D26409
---
 newlib/libc/sys/rtems/include/netinet/in.h   | 4 
 newlib/libc/sys/rtems/include/netinet6/in6.h | 4 
 2 files changed, 8 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/in.h 
b/newlib/libc/sys/rtems/include/netinet/in.h
index 749e74eda..059f50d9b 100644
--- a/newlib/libc/sys/rtems/include/netinet/in.h
+++ b/newlib/libc/sys/rtems/include/netinet/in.h
@@ -483,6 +483,10 @@ __END_DECLS
 /* The following option is private; do not use it from user applications. */
 #defineIP_MSFILTER 74   /* set/get filter list */
 
+/* The following option deals with the 802.1Q Ethernet Priority Code Point */
+#defineIP_VLAN_PCP 75   /* int; set/get PCP used for 
packet, */
+/*  -1 use interface default */
+
 /* Protocol Independent Multicast API [RFC3678] */
 #defineMCAST_JOIN_GROUP80   /* join an any-source 
group */
 #defineMCAST_LEAVE_GROUP   81   /* leave all sources for 
group */
diff --git a/newlib/libc/sys/rtems/include/netinet6/in6.h 
b/newlib/libc/sys/rtems/include/netinet6/in6.h
index 68d4c3e4e..55be82fed 100644
--- a/newlib/libc/sys/rtems/include/netinet6/in6.h
+++ b/newlib/libc/sys/rtems/include/netinet6/in6.h
@@ -387,6 +387,10 @@ struct route_in6 {
* set/get multicast source filter list.
*/
 
+/* The following option deals with the 802.1Q Ethernet Priority Code Point */
+#defineIPV6_VLAN_PCP   75  /* int; set/get PCP used for 
packet, */
+   /*  -1 use interface default */
+
 /* to define items, should talk with KAME guys first, for *BSD compatibility */
 
 #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old 
spec */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 49/65] poll(2): Add POLLRDHUP.

2022-07-07 Thread Sebastian Huber
From: Thomas Munro 

Teach poll(2) to support Linux-style POLLRDHUP events for sockets, if
requested.  Triggered when the remote peer shuts down writing or closes
its end.

Reviewed by:kib
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D29757
---
 newlib/libc/sys/rtems/include/sys/poll.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/sys/poll.h 
b/newlib/libc/sys/rtems/include/sys/poll.h
index 7cd59..cc6ad49db 100644
--- a/newlib/libc/sys/rtems/include/sys/poll.h
+++ b/newlib/libc/sys/rtems/include/sys/poll.h
@@ -71,6 +71,7 @@ struct pollfd {
 #if __BSD_VISIBLE
 /* General FreeBSD extension (currently only supported for sockets): */
 #definePOLLINIGNEOF0x2000  /* like POLLIN, except ignore 
EOF */
+#definePOLLRDHUP   0x4000  /* half shut down */
 #endif
 
 /*
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 32/65] add SIOCGIFDATA ioctl

2022-07-07 Thread Sebastian Huber
From: Ed Maste 

For interfaces that do not support SIOCGIFMEDIA (for which there are
quite a few) the only fallback is to query the interface for
if_data->ifi_link_state.  While it's possible to get at if_data for an
interface via getifaddrs(3) or sysctl, both are heavy weight mechanisms.

SIOCGIFDATA is a simple ioctl to retrieve this fast with very little
resource use in comparison.  This implementation mirrors that of other
similar ioctls in FreeBSD.

Submitted by:   Roy Marples 
Reviewed by:markj
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D26538
---
 newlib/libc/sys/rtems/include/sys/sockio.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/sys/sockio.h 
b/newlib/libc/sys/rtems/include/sys/sockio.h
index 447e2c884..03502d770 100644
--- a/newlib/libc/sys/rtems/include/sys/sockio.h
+++ b/newlib/libc/sys/rtems/include/sys/sockio.h
@@ -83,6 +83,7 @@
 #defineSIOCSIFDESCR _IOW('i', 41, struct ifreq)/* set ifnet 
descr */ 
 #defineSIOCGIFDESCR_IOWR('i', 42, struct ifreq)/* get ifnet 
descr */ 
 #defineSIOCAIFADDR  _IOW('i', 43, struct ifaliasreq)/* add/chg IF 
alias */
+#defineSIOCGIFDATA  _IOW('i', 44, struct ifreq)/* get if_data 
*/
 
 #defineSIOCADDMULTI _IOW('i', 49, struct ifreq)/* add m'cast 
addr */
 #defineSIOCDELMULTI _IOW('i', 50, struct ifreq)/* del m'cast 
addr */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 42/65] Filter TCP connections to SO_REUSEPORT_LB listen sockets by NUMA domain

2022-07-07 Thread Sebastian Huber
From: Andrew Gallatin 

In order to efficiently serve web traffic on a NUMA
machine, one must avoid as many NUMA domain crossings as
possible. With SO_REUSEPORT_LB, a number of workers can share a
listen socket. However, even if a worker sets affinity to a core
or set of cores on a NUMA domain, it will receive connections
associated with all NUMA domains in the system. This will lead to
cross-domain traffic when the server writes to the socket or
calls sendfile(), and memory is allocated on the server's local
NUMA node, but transmitted on the NUMA node associated with the
TCP connection. Similarly, when the server reads from the socket,
he will likely be reading memory allocated on the NUMA domain
associated with the TCP connection.

This change provides a new socket ioctl, TCP_REUSPORT_LB_NUMA. A
server can now tell the kernel to filter traffic so that only
incoming connections associated with the desired NUMA domain are
given to the server. (Of course, in the case where there are no
servers sharing the listen socket on some domain, then as a
fallback, traffic will be hashed as normal to all servers sharing
the listen socket regardless of domain). This allows a server to
deal only with traffic that is local to its NUMA domain, and
avoids cross-domain traffic in most cases.

This patch, and a corresponding small patch to nginx to use
TCP_REUSPORT_LB_NUMA allows us to serve 190Gb/s of kTLS encrypted
https media content from dual-socket Xeons with only 13% (as
measured by pcm.x) cross domain traffic on the memory controller.

Reviewed by:jhb, bz (earlier version), bcr (man page)
Tested by: gonzo
Sponsored by:   Netfix
Differential Revision:  https://reviews.freebsd.org/D21636
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index faf142959..0b71bd465 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -196,6 +196,7 @@ struct tcphdr {
 #defineTCP_PCAP_IN 4096/* number of input packets to keep */
 #define TCP_FUNCTION_BLK 8192  /* Set the tcp function pointers to the 
specified stack */
 /* Options for Rack and BBR */
+#defineTCP_REUSPORT_LB_NUMA   1026 /* set listen socket numa 
domain */
 #define TCP_RACK_MBUF_QUEUE   1050 /* Do we allow mbuf queuing if supported */
 #define TCP_RACK_PROP1051 /* RACK proportional rate reduction (bool) */
 #define TCP_RACK_TLP_REDUCE   1052 /* RACK TLP cwnd reduction (bool) */
@@ -406,4 +407,7 @@ struct tcp_function_set {
 #defineVOI_TCP_GPUT_ND 8 /* Goodput normalised delta */
 #defineVOI_TCP_ACKLEN  9 /* Average ACKed bytes per ACK */
 
+#define TCP_REUSPORT_LB_NUMA_NODOM (-2) /* remove numa binding */
+#define TCP_REUSPORT_LB_NUMA_CURDOM(-1) /* bind to current domain */
+
 #endif /* !_NETINET_TCP_H_ */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 51/65] Use thunks for compat ioctls using struct ifgroupreq.

2022-07-07 Thread Sebastian Huber
From: John Baldwin 

Reviewed by:brooks, kib
Obtained from:  CheriBSD
Sponsored by:   DARPA
Differential Revision:  https://reviews.freebsd.org/D29893
---
 newlib/libc/sys/rtems/include/net/if.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index a469a1f60..c15013005 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -530,10 +530,8 @@ struct ifgroupreq {
charifgru_group[IFNAMSIZ];
struct  ifg_req *ifgru_groups;
} ifgr_ifgru;
-#ifndef _KERNEL
 #define ifgr_group ifgr_ifgru.ifgru_group
 #define ifgr_groupsifgr_ifgru.ifgru_groups
-#endif
 };
 
 /*
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 53/65] tcp: SACK Lost Retransmission Detection (LRD)

2022-07-07 Thread Sebastian Huber
From: Richard Scheffenegger 

Recover from excessive losses without reverting to a
retransmission timeout (RTO). Disabled by default, enable
with sysctl net.inet.tcp.do_lrd=1

Reviewed By: #transport, rrs, tuexen, #manpages
Sponsored by: Netapp, Inc.
Differential Revision: https://reviews.freebsd.org/D28931
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 50f0811a6..7ba99df51 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -199,6 +199,7 @@ struct tcphdr {
 #define TCP_PROC_ACCOUNTING 76 /* Do accounting on tcp cpu usage and counts */
 #define TCP_USE_CMP_ACKS 77/* The transport can handle the Compressed mbuf 
acks */
 #defineTCP_PERF_INFO   78  /* retrieve accounting counters */
+#defineTCP_LRD 79  /* toggle Lost Retransmission Detection 
for A/B testing */
 #defineTCP_KEEPINIT128 /* N, time to establish connection */
 #defineTCP_KEEPIDLE256 /* L,N,X start keeplives after this 
period */
 #defineTCP_KEEPINTVL   512 /* L,N interval between keepalives */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 11/65] Add a TOE KTLS mode and a TOE hook for allocating TLS sessions.

2022-07-07 Thread Sebastian Huber
From: John Baldwin 

This adds the glue to allocate TLS sessions and invokes it from
the TLS enable socket option handler.  This also adds some counters
for active TOE sessions.

The TOE KTLS mode is returned by getsockopt(TLSTX_TLS_MODE) when
TOE KTLS is in use on a socket, but cannot be set via setsockopt().

To simplify various checks, a TLS session now includes an explicit
'mode' member set to the value returned by TLSTX_TLS_MODE.  Various
places that used to check 'sw_encrypt' against NULL to determine
software vs ifnet (NIC) TLS now check 'mode' instead.

Reviewed by:np, gallatin
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D21891
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 37ba3bb55..125cacb28 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -357,6 +357,7 @@ struct tcp_function_set {
 #defineTCP_TLS_MODE_NONE   0
 #defineTCP_TLS_MODE_SW 1
 #defineTCP_TLS_MODE_IFNET  2
+#defineTCP_TLS_MODE_TOE3
 
 /*
  * TCP Control message types
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 09/65] Add an shm_rename syscall

2022-07-07 Thread Sebastian Huber
From: David Bright 

Add an atomic shm rename operation, similar in spirit to a file
rename. Atomically unlink an shm from a source path and link it to a
destination path. If an existing shm is linked at the destination
path, unlink it as part of the same atomic operation. The caller needs
the same permissions as shm_unlink to the shm being renamed, and the
same permissions for the shm at the destination which is being
unlinked, if it exists. If those fail, EACCES is returned, as with the
other shm_* syscalls.

truss support is included; audit support will come later.

This commit includes only the implementation; the sysent-generated
bits will come in a follow-on commit.

Submitted by:   Matthew Bryan 
Reviewed by:jilles (earlier revision)
Reviewed by:brueffer (manpages, earlier revision)
Relnotes:   yes
Sponsored by:   Dell EMC Isilon
Differential Revision:  https://reviews.freebsd.org/D21423
---
 newlib/libc/sys/rtems/include/sys/mman.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/sys/mman.h 
b/newlib/libc/sys/rtems/include/sys/mman.h
index 867b68647..89cc4d699 100644
--- a/newlib/libc/sys/rtems/include/sys/mman.h
+++ b/newlib/libc/sys/rtems/include/sys/mman.h
@@ -133,6 +133,14 @@
  */
 #define MAP_FAILED ((void *)-1)
 
+/*
+ * Flags provided to shm_rename
+ */
+/* Don't overwrite dest, if it exists */
+#define SHM_RENAME_NOREPLACE   (1 << 0)
+/* Atomically swap src and dest */
+#define SHM_RENAME_EXCHANGE(1 << 1)
+
 /*
  * msync() flags
  */
@@ -264,6 +272,7 @@ int posix_madvise(void *, size_t, int);
 intmlockall(int);
 intmunlockall(void);
 intshm_open(const char *, int, mode_t);
+intshm_rename(const char *, const char *, int);
 intshm_unlink(const char *);
 #endif
 #if __BSD_VISIBLE
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 43/65] Add tcgetwinsize(3) and tcsetwinsize(3) to termios

2022-07-07 Thread Sebastian Huber
From: Konstantin Belousov 

These functions get/set tty winsize respectively, and are trivial wrappers
around corresponding termio ioctls.

The functions are expected to be a part of POSIX.1 issue 8:
https://www.austingroupbugs.net/view.php?id=1151#c3856.
They are currently available in NetBSD and in musl libc.

PR: 251868
Submitted by:   Soumendra Ganguly 
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D27650
---
 newlib/libc/sys/rtems/include/sys/_winsize.h | 49 
 newlib/libc/sys/rtems/include/sys/ttycom.h   | 12 +
 newlib/libc/sys/rtems/include/termios.h  |  6 +++
 3 files changed, 56 insertions(+), 11 deletions(-)
 create mode 100644 newlib/libc/sys/rtems/include/sys/_winsize.h

diff --git a/newlib/libc/sys/rtems/include/sys/_winsize.h 
b/newlib/libc/sys/rtems/include/sys/_winsize.h
new file mode 100644
index 0..78d0b8a6e
--- /dev/null
+++ b/newlib/libc/sys/rtems/include/sys/_winsize.h
@@ -0,0 +1,49 @@
+/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright (c) 1988, 1989, 1993, 1994
+ * The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ttycom.h8.1 (Berkeley) 3/28/94
+ * $FreeBSD$
+ */
+
+#ifndef _SYS__WINSIZE_H_
+#define _SYS__WINSIZE_H_
+
+/*
+ * Window/terminal size structure.  This information is stored by the kernel
+ * in order to provide a consistent interface, but is not used by the kernel.
+ */
+struct winsize {
+   unsigned short  ws_row; /* rows, in characters */
+   unsigned short  ws_col; /* columns, in characters */
+   unsigned short  ws_xpixel;  /* horizontal size, pixels */
+   unsigned short  ws_ypixel;  /* vertical size, pixels */
+};
+
+#endif /* !_SYS__WINSIZE_H_ */
diff --git a/newlib/libc/sys/rtems/include/sys/ttycom.h 
b/newlib/libc/sys/rtems/include/sys/ttycom.h
index 5aabb074a..a7309d4c5 100644
--- a/newlib/libc/sys/rtems/include/sys/ttycom.h
+++ b/newlib/libc/sys/rtems/include/sys/ttycom.h
@@ -41,23 +41,13 @@
 #define_SYS_TTYCOM_H_
 
 #include 
+#include 
 
 /*
  * Tty ioctl's except for those supported only for backwards compatibility
  * with the old tty driver.
  */
 
-/*
- * Window/terminal size structure.  This information is stored by the kernel
- * in order to provide a consistent interface, but is not used by the kernel.
- */
-struct winsize {
-   unsigned short  ws_row; /* rows, in characters */
-   unsigned short  ws_col; /* columns, in characters */
-   unsigned short  ws_xpixel;  /* horizontal size, pixels */
-   unsigned short  ws_ypixel;  /* vertical size, pixels */
-};
-
/* 0-2 compat */
/* 3-7 unused */
/* 8-10 compat */
diff --git a/newlib/libc/sys/rtems/include/termios.h 
b/newlib/libc/sys/rtems/include/termios.h
index ce31d447f..9b808329a 100644
--- a/newlib/libc/sys/rtems/include/termios.h
+++ b/newlib/libc/sys/rtems/include/termios.h
@@ -38,6 +38,9 @@
 #include 
 #include 
 #include 
+#if __BSD_VISIBLE
+#include 
+#endif
 
 #ifndef _PID_T_DECLARED
 typedef__pid_t pid_t;
@@ -92,6 +95,9 @@ int   tcsetsid(int, pid_t);
 void   cfmakeraw(struct termios *);
 void   cfmakesane(struct termios *);
 intcfsetspeed(struct termios *, speed_t);
+
+inttcgetwinsize(int, struct winsize *);
+inttcsetwinsize(int, const 

[newlib 12/65] Jail and capability mode for shm_rename;

2022-07-07 Thread Sebastian Huber
From: David Bright 

add audit support for shm_rename

Co-mingling two things here:

  * Addressing some feedback from Konstantin and Kyle re: jail,
capability mode, and a few other things
  * Adding audit support as promised.

The audit support change includes a partial refresh of OpenBSM from
upstream, where the change to add shm_rename has already been
accepted. Matthew doesn't plan to work on refreshing anything else to
support audit for those new event types.

Submitted by:   Matthew Bryan 
Reviewed by:kib
Relnotes:   Yes
Sponsored by:   Dell EMC Isilon
Differential Revision:  https://reviews.freebsd.org/D22083
---
 newlib/libc/sys/rtems/include/sys/mman.h | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/sys/mman.h 
b/newlib/libc/sys/rtems/include/sys/mman.h
index c68efcc15..7a9b49429 100644
--- a/newlib/libc/sys/rtems/include/sys/mman.h
+++ b/newlib/libc/sys/rtems/include/sys/mman.h
@@ -118,6 +118,15 @@
 #defineMAP_ALIGNMENT_SHIFT 24
 #defineMAP_ALIGNMENT_MASK  MAP_ALIGNED(0xff)
 #defineMAP_ALIGNED_SUPER   MAP_ALIGNED(1) /* align on a superpage 
*/
+
+/*
+ * Flags provided to shm_rename
+ */
+/* Don't overwrite dest, if it exists */
+#define SHM_RENAME_NOREPLACE   (1 << 0)
+/* Atomically swap src and dest */
+#define SHM_RENAME_EXCHANGE(1 << 1)
+
 #endif /* __BSD_VISIBLE */
 
 #if __POSIX_VISIBLE >= 199309
@@ -133,14 +142,6 @@
  */
 #define MAP_FAILED ((void *)-1)
 
-/*
- * Flags provided to shm_rename
- */
-/* Don't overwrite dest, if it exists */
-#define SHM_RENAME_NOREPLACE   (1 << 0)
-/* Atomically swap src and dest */
-#define SHM_RENAME_EXCHANGE(1 << 1)
-
 /*
  * msync() flags
  */
@@ -272,11 +273,11 @@ int   posix_madvise(void *, size_t, int);
 intmlockall(int);
 intmunlockall(void);
 intshm_open(const char *, int, mode_t);
-intshm_rename(const char *, const char *, int);
 intshm_unlink(const char *);
 #endif
 #if __BSD_VISIBLE
 intmemfd_create(const char *, unsigned int);
+intshm_rename(const char *, const char *, int);
 #endif
 __END_DECLS
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 14/65] Add flags for upcoming patches related to improved ECN handling.

2022-07-07 Thread Sebastian Huber
From: Michael Tuexen 

No functional change.

Submitted by: Richard Scheffenegger
Reviewed by: rgrimes@, tuexen@
Differential Revision: https://reviews.freebsd.org/D22429
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 4e06c9792..528f3cd8d 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -71,8 +71,9 @@ struct tcphdr {
 #defineTH_URG  0x20
 #defineTH_ECE  0x40
 #defineTH_CWR  0x80
+#defineTH_AE   0x100   /* maps into th_x2 */
 #defineTH_FLAGS
(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG|TH_ECE|TH_CWR)
-#definePRINT_TH_FLAGS  "\20\1FIN\2SYN\3RST\4PUSH\5ACK\6URG\7ECE\10CWR"
+#definePRINT_TH_FLAGS  
"\20\1FIN\2SYN\3RST\4PUSH\5ACK\6URG\7ECE\10CWR\11AE"
 
u_short th_win; /* window */
u_short th_sum; /* checksum */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 52/65] This brings into sync FreeBSD with the netflix

2022-07-07 Thread Sebastian Huber
From: Randall Stewart 

versions of rack and bbr. This fixes several breakages (panics) since the
tcp_lro code was committed that have been reported. Quite a few new features
are now in rack (prefecting of DGP -- Dynamic Goodput Pacing among the
largest). There is also support for ack-war prevention. Documents comming soon
on rack..

Sponsored by:   Netflix
Reviewed by:rscheff, mtuexen
Differential Revision:  https://reviews.freebsd.org/D30036
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 24 -
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index d2bf1f843..50f0811a6 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -181,13 +181,24 @@ struct tcphdr {
 #defineTCP_TXTLS_MODE  40  /* Transmit TLS mode */
 #defineTCP_RXTLS_ENABLE 41 /* TLS framing and encryption for 
receive */
 #defineTCP_RXTLS_MODE  42  /* Receive TLS mode */
+#defineTCP_IWND_NB 43  /* Override initial window (units: 
bytes) */
+#defineTCP_IWND_NSEG   44  /* Override initial window (units: MSS 
segs) */
+#defineTCP_LOGID_CNT   46  /* get number of connections with the 
same ID */
+#defineTCP_LOG_TAG 47  /* configure tag for grouping logs */
+#defineTCP_USER_LOG48  /* userspace log event */
 #defineTCP_CONGESTION  64  /* get/set congestion control algorithm 
*/
 #defineTCP_CCALGOOPT   65  /* get/set cc algorithm specific 
options */
+#defineTCP_MAXUNACKTIME 68 /* maximum time without making progress 
(sec) */
+#defineTCP_MAXPEAKRATE 69  /* maximum peak rate allowed (kbps) */
+#define TCP_IDLE_REDUCE 70 /* Reduce cwnd on idle input */
 #define TCP_REMOTE_UDP_ENCAPS_PORT 71  /* Enable TCP over UDP tunneling via 
the specified port */
 #define TCP_DELACK 72  /* socket option for delayed ack */
 #define TCP_FIN_IS_RST 73  /* A fin from the peer is treated has a RST */
 #define TCP_LOG_LIMIT  74  /* Limit to number of records in tcp-log */
 #define TCP_SHARED_CWND_ALLOWED 75 /* Use of a shared cwnd is allowed */
+#define TCP_PROC_ACCOUNTING 76 /* Do accounting on tcp cpu usage and counts */
+#define TCP_USE_CMP_ACKS 77/* The transport can handle the Compressed mbuf 
acks */
+#defineTCP_PERF_INFO   78  /* retrieve accounting counters */
 #defineTCP_KEEPINIT128 /* N, time to establish connection */
 #defineTCP_KEEPIDLE256 /* L,N,X start keeplives after this 
period */
 #defineTCP_KEEPINTVL   512 /* L,N interval between keepalives */
@@ -201,7 +212,7 @@ struct tcphdr {
 #define TCP_RACK_MBUF_QUEUE   1050 /* Do we allow mbuf queuing if supported */
 #define TCP_RACK_PROP1051 /* RACK proportional rate reduction (bool) */
 #define TCP_RACK_TLP_REDUCE   1052 /* RACK TLP cwnd reduction (bool) */
-#define TCP_RACK_PACE_REDUCE  1053 /* RACK Pacing reduction factor (divisor) */
+#define TCP_RACK_PACE_REDUCE  1053 /* RACK Pacingv reduction factor (divisor) 
*/
 #define TCP_RACK_PACE_MAX_SEG 1054 /* Max TSO size we will send  */
 #define TCP_RACK_PACE_ALWAYS  1055 /* Use the always pace method */
 #define TCP_RACK_PROP_RATE1056 /* The proportional reduction rate */
@@ -284,6 +295,16 @@ struct tcphdr {
 #define TCP_RACK_PACE_TO_FILL 1127 /* If we are not in recovery, always pace 
to fill the cwnd in 1 RTT */
 #define TCP_SHARED_CWND_TIME_LIMIT 1128 /* we should limit to low time values 
the scwnd life */
 #define TCP_RACK_PROFILE 1129  /* Select a profile that sets multiple options 
*/
+#define TCP_HDWR_RATE_CAP 1130 /* Allow hardware rates to cap pacing rate */
+#define TCP_PACING_RATE_CAP 1131 /* Highest rate allowed in pacing in bytes 
per second (uint64_t) */
+#define TCP_HDWR_UP_ONLY 1132  /* Allow the pacing rate to climb but not 
descend (with the exception of fill-cw */
+#define TCP_RACK_ABC_VAL 1133  /* Set a local ABC value different then the 
system default */
+#define TCP_REC_ABC_VAL 1134   /* Do we use the ABC value for recovery or the 
override one from sysctl  */
+#define TCP_RACK_MEASURE_CNT 1135 /* How many measurements are required in GP 
pacing */
+#define TCP_DEFER_OPTIONS 1136 /* Defer options until the proper number of 
measurements occur, does not defer TCP_RACK_MEASURE_CNT */
+#define TCP_FAST_RSM_HACK 1137 /* Do we do the broken thing where we don't 
twiddle the TLP bits properly in fast_rsm_output? */
+#define TCP_RACK_PACING_BETA 1138  /* Changing the beta for pacing */
+#define TCP_RACK_PACING_BETA_ECN 1139  /* Changing the beta for ecn with 
pacing */
 
 /* Start of reserved space for third-party user-settable options. */
 #defineTCP_VENDOR  SO_VENDOR
@@ -295,6 +316,7 @@ struct tcphdr {
 #defineTCPI_OPT_WSCALE 0x04
 #defineTCPI_OPT_ECN

[newlib 54/65] tcp: Add a socket option to rack

2022-07-07 Thread Sebastian Huber
From: Randall Stewart 

so we can test various changes to the slop value in timers.

Timer_slop, in TCP, has been 200ms for a long time. This value dates back
a long time when delayed ack timers were longer and links were slower. A
200ms timer slop allows 1 MSS to be sent over a 60kbps link. Its possible that
lowering this value to something more in line with todays delayed ack values 
(40ms)
might improve TCP. This bit of code makes it so rack can, via a socket option,
adjust the timer slop.

Reviewed by: mtuexen
Sponsered by: Netflix Inc
Differential Revision:  https://reviews.freebsd.org/D30249
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 7ba99df51..45bece9fa 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -306,6 +306,7 @@ struct tcphdr {
 #define TCP_FAST_RSM_HACK 1137 /* Do we do the broken thing where we don't 
twiddle the TLP bits properly in fast_rsm_output? */
 #define TCP_RACK_PACING_BETA 1138  /* Changing the beta for pacing */
 #define TCP_RACK_PACING_BETA_ECN 1139  /* Changing the beta for ecn with 
pacing */
+#define TCP_RACK_TIMER_SLOP 1140   /* Set or get the timer slop used */
 
 /* Start of reserved space for third-party user-settable options. */
 #defineTCP_VENDOR  SO_VENDOR
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 18/65] Introduce nexthop objects and new routing KPI.

2022-07-07 Thread Sebastian Huber
From: "Alexander V. Chernikov" 

This is the foundational change for the routing subsytem rearchitecture.
 More details and goals are available in https://reviews.freebsd.org/D24141 .

This patch introduces concept of nexthop objects and new nexthop-based
 routing KPI.

Nexthops are objects, containing all necessary information for performing
 the packet output decision. Output interface, mtu, flags, gw address goes
 there. For most of the cases, these objects will serve the same role as
 the struct rtentry is currently serving.
Typically there will be low tens of such objects for the router even with
 multiple BGP full-views, as these objects will be shared between routing
 entries. This allows to store more information in the nexthop.

New KPI:

struct nhop_object *fib4_lookup(uint32_t fibnum, struct in_addr dst,
  uint32_t scopeid, uint32_t flags, uint32_t flowid);
struct nhop_object *fib6_lookup(uint32_t fibnum, const struct in6_addr *dst6,
  uint32_t scopeid, uint32_t flags, uint32_t flowid);

These 2 function are intended to replace all all flavours of
 rtalloc[1]<_ign><_fib>, mpath functions  and the previous
 fib[46]-generation functions.

Upon successful lookup, they return nexthop object which is guaranteed to
 exist within current NET_EPOCH. If longer lifetime is desired, one can
 specify NHR_REF as a flag and get a referenced version of the nexthop.
 Reference semantic closely resembles rtentry one, allowing sed-style 
conversion.

Additionally, another 2 functions are introduced to support uRPF functionality
 inside variety of our firewalls. Their primary goal is to hide the multipath
 implementation details inside the routing subsystem, greatly simplifying
 firewalls implementation:

int fib4_lookup_urpf(uint32_t fibnum, struct in_addr dst, uint32_t scopeid,
  uint32_t flags, const struct ifnet *src_if);
int fib6_lookup_urpf(uint32_t fibnum, const struct in6_addr *dst6, uint32_t 
scopeid,
  uint32_t flags, const struct ifnet *src_if);

All functions have a separate scopeid argument, paving way to eliminating IPv6 
scope
 embedding and allowing to support IPv4 link-locals in the future.

Structure changes:
 * rtentry gets new 'rt_nhop' pointer, slightly growing the overall size.
 * rib_head gets new 'rnh_preadd' callback pointer, slightly growing overall sz.

Old KPI:
During the transition state old and new KPI will coexists. As there are another 
4-5
 decent-sized conversion patches, it will probably take a couple of weeks.
To support both KPIs, fields not required by the new KPI (most of rtentry) has 
to be
 kept, resulting in the temporary size increase.
Once conversion is finished, rtentry will notably shrink.

More details:
* architectural overview: https://reviews.freebsd.org/D24141
* list of the next changes: https://reviews.freebsd.org/D24232

Reviewed by:ae,glebius(initial version)
Differential Revision:  https://reviews.freebsd.org/D24232
---
 newlib/libc/sys/rtems/include/sys/socket.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/sys/socket.h 
b/newlib/libc/sys/rtems/include/sys/socket.h
index 30c606389..3431947cf 100644
--- a/newlib/libc/sys/rtems/include/sys/socket.h
+++ b/newlib/libc/sys/rtems/include/sys/socket.h
@@ -408,6 +408,7 @@ struct sockproto {
 #defineNET_RT_IFMALIST 4   /* return multicast address 
list */
 #defineNET_RT_IFLISTL  5   /* Survey interface list, using 
'l'en
 * versions of msghdr structs. */
+#define NET_RT_NHOP6   /* dump routing nexthops */
 #endif /* __BSD_VISIBLE */
 
 /*
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 25/65] Add SOL_LOCAL symbolic constant for unix socket option level.

2022-07-07 Thread Sebastian Huber
From: Konstantin Belousov 

The constant seems to exists on MacOS X >= 10.8.

Requested by:   swills
Reviewed by:allanjude, kevans
Sponsored by:   The FreeBSD Foundation
MFC after:  1 week
Differential revision:  https://reviews.freebsd.org/D25933
---
 newlib/libc/sys/rtems/include/sys/un.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/sys/un.h 
b/newlib/libc/sys/rtems/include/sys/un.h
index 3c408628c..3a011aeef 100644
--- a/newlib/libc/sys/rtems/include/sys/un.h
+++ b/newlib/libc/sys/rtems/include/sys/un.h
@@ -62,6 +62,8 @@ struct sockaddr_un {
 
 #if __BSD_VISIBLE
 
+#defineSOL_LOCAL   0   /* Options for local socket */
+
 /* Socket options. */
 #defineLOCAL_PEERCRED  1   /* retrieve peer credentials */
 #defineLOCAL_CREDS 2   /* pass credentials to receiver 
*/
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 27/65] sys: clean up empty lines in .c and .h files

2022-07-07 Thread Sebastian Huber
From: Mateusz Guzik 

---
 newlib/libc/sys/rtems/include/sys/_termios.h | 1 -
 newlib/libc/sys/rtems/include/sys/socket.h   | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/sys/_termios.h 
b/newlib/libc/sys/rtems/include/sys/_termios.h
index eaceece9a..355ebbfa3 100644
--- a/newlib/libc/sys/rtems/include/sys/_termios.h
+++ b/newlib/libc/sys/rtems/include/sys/_termios.h
@@ -146,7 +146,6 @@
 #defineCNO_RTSDTR  0x0020  /* Do not assert RTS or DTR 
automatically */
 #endif
 
-
 /*
  * "Local" flags - dumping ground for other state
  *
diff --git a/newlib/libc/sys/rtems/include/sys/socket.h 
b/newlib/libc/sys/rtems/include/sys/socket.h
index d0d31a2b0..78831a54f 100644
--- a/newlib/libc/sys/rtems/include/sys/socket.h
+++ b/newlib/libc/sys/rtems/include/sys/socket.h
@@ -73,7 +73,7 @@ typedef   __sa_family_t   sa_family_t;
 typedef__socklen_t socklen_t;
 #define_SOCKLEN_T_DECLARED
 #endif
- 
+
 #ifndef _SSIZE_T_DECLARED
 typedef__ssize_t   ssize_t;
 #define_SSIZE_T_DECLARED
@@ -600,7 +600,6 @@ struct omsghdr {
 #define PRU_FLUSH_RDWR   SHUT_RDWR
 #endif
 
-
 #if __BSD_VISIBLE
 /*
  * sendfile(2) header/trailer struct
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 36/65] Implement SIOCGIFALIAS.

2022-07-07 Thread Sebastian Huber
From: "Andrey V. Elsukov" 

It is lightweight way to check if an IPv4 address exists.

Submitted by:   Roy Marples
Reviewed by:gnn, melifaro
MFC after:  2 weeks
Differential Revision:  https://reviews.freebsd.org/D26636
---
 newlib/libc/sys/rtems/include/sys/sockio.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/sys/sockio.h 
b/newlib/libc/sys/rtems/include/sys/sockio.h
index 03502d770..93b8af28e 100644
--- a/newlib/libc/sys/rtems/include/sys/sockio.h
+++ b/newlib/libc/sys/rtems/include/sys/sockio.h
@@ -84,6 +84,7 @@
 #defineSIOCGIFDESCR_IOWR('i', 42, struct ifreq)/* get ifnet 
descr */ 
 #defineSIOCAIFADDR  _IOW('i', 43, struct ifaliasreq)/* add/chg IF 
alias */
 #defineSIOCGIFDATA  _IOW('i', 44, struct ifreq)/* get if_data 
*/
+#defineSIOCGIFALIAS_IOWR('i', 45, struct ifaliasreq)/* get IF 
alias */
 
 #defineSIOCADDMULTI _IOW('i', 49, struct ifreq)/* add m'cast 
addr */
 #defineSIOCDELMULTI _IOW('i', 50, struct ifreq)/* del m'cast 
addr */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 57/65] tcp: Add support for DSACK based reordering window to rack.

2022-07-07 Thread Sebastian Huber
From: Randall Stewart 

The rack stack, with respect to the rack bits in it, was originally built based
on an early I-D of rack. In fact at that time the TLP bits were in a separate
I-D. The dynamic reordering window based on DSACK events was not present
in rack at that time. It is now part of the RFC and we need to update our stack
to include these features. However we want to have a way to control the feature
so that we can, if the admin decides, make it stay the same way system wide as
well as via socket option. The new sysctl and socket option has the following
meaning for setting:

00 (0) - Keep the old way, i.e. reordering window is 1 and do not use DSACK 
bytes to add to reorder window
01 (1) - Change the Reordering window to 1/4 of an RTT but do not use DSACK 
bytes to add to reorder window
10 (2) - Keep the reordering window as 1, but do use SACK bytes to add 
additional 1/4 RTT delay to the reorder window
11 (3) - reordering window is 1/4 of an RTT and add additional DSACK bytes to 
increase the reordering window (RFC behavior)

The default currently in the sysctl is 3 so we get standards based behavior.
Reviewed by: tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D31506
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index a79dbeaad..29c1e376c 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -309,6 +309,7 @@ struct tcphdr {
 #define TCP_RACK_PACING_BETA 1138  /* Changing the beta for pacing */
 #define TCP_RACK_PACING_BETA_ECN 1139  /* Changing the beta for ecn with 
pacing */
 #define TCP_RACK_TIMER_SLOP 1140   /* Set or get the timer slop used */
+#define TCP_RACK_DSACK_OPT 1141/* How do we setup rack timer 
DSACK options bit 1/2 */
 
 /* Start of reserved space for third-party user-settable options. */
 #defineTCP_VENDOR  SO_VENDOR
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 55/65] pf: syncookie support

2022-07-07 Thread Sebastian Huber
From: Kristof Provost 

Import OpenBSD's syncookie support for pf. This feature help pf resist
TCP SYN floods by only creating states once the remote host completes
the TCP handshake rather than when the initial SYN packet is received.

This is accomplished by using the initial sequence numbers to encode a
cookie (hence the name) in the SYN+ACK response and verifying this on
receipt of the client ACK.

Reviewed by:kbowling
Obtained from:  OpenBSD
MFC after:  1 week
Sponsored by:   Modirum MDPay
Differential Revision:  https://reviews.freebsd.org/D31138
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 45bece9fa..a79dbeaad 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -105,6 +105,8 @@ struct tcphdr {
 #defineTCPOPT_FAST_OPEN34
 #define   TCPOLEN_FAST_OPEN_EMPTY  2
 
+#defineMAX_TCPOPTLEN   40  /* Absolute maximum TCP options 
len */
+
 /* Miscellaneous constants */
 #defineMAX_SACK_BLKS   6   /* Max # SACK blocks stored at receiver 
side */
 #defineTCP_MAX_SACK4   /* MAX # SACKs sent in any segment */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 60/65] kernel: deprecate Internet Class A/B/C

2022-07-07 Thread Sebastian Huber
From: Mike Karels 

Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined;
define it for user level.  Define IN_MULTICAST separately from IN_CLASSD,
and use it in pf instead of IN_CLASSD.  Stop using class for setting
default masks when not specified; instead, define new default mask
(24 bits).  Warn when an Internet address is set without a mask.

MFC after:  1 month
Reviewed by:cy
Differential Revision: https://reviews.freebsd.org/D32708
---
 newlib/libc/sys/rtems/include/netinet/in.h | 22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/netinet/in.h 
b/newlib/libc/sys/rtems/include/netinet/in.h
index 059f50d9b..4c692b6df 100644
--- a/newlib/libc/sys/rtems/include/netinet/in.h
+++ b/newlib/libc/sys/rtems/include/netinet/in.h
@@ -342,10 +342,15 @@ __END_DECLS
 #defineIPPORT_MAX  65535
 
 /*
- * Definitions of bits in internet address integers.
- * On subnets, the decomposition of addresses to host and net parts
- * is done according to subnet mask, not the masks here.
+ * Historical definitions of bits in internet address integers
+ * (pre-CIDR).  Class A/B/C are long obsolete, and now deprecated.
+ * Hide these definitions from the kernel unless IN_HISTORICAL_NETS
+ * is defined.  Provide the historical definitions to user level for now.
  */
+#ifndef _KERNEL
+#define IN_HISTORICAL_NETS
+#endif
+#ifdef IN_HISTORICAL_NETS
 #defineIN_CLASSA(i)(((in_addr_t)(i) & 0x8000) == 0)
 #defineIN_CLASSA_NET   0xff00
 #defineIN_CLASSA_NSHIFT24
@@ -362,12 +367,17 @@ __END_DECLS
 #defineIN_CLASSC_NET   0xff00
 #defineIN_CLASSC_NSHIFT8
 #defineIN_CLASSC_HOST  0x00ff
+#endif /* IN_HISTORICAL_NETS */
+
+#defineIN_NETMASK_DEFAULT  0xff00  /* mask when forced to 
guess */
 
-#defineIN_CLASSD(i)(((in_addr_t)(i) & 0xf000) == 
0xe000)
+#defineIN_MULTICAST(i) (((in_addr_t)(i) & 0xf000) == 
0xe000)
+#ifdef IN_HISTORICAL_NETS
+#defineIN_CLASSD(i)IN_MULTICAST(i)
 #defineIN_CLASSD_NET   0xf000  /* These ones aren't 
really */
 #defineIN_CLASSD_NSHIFT28  /* net and host fields, 
but */
 #defineIN_CLASSD_HOST  0x0fff  /* routing needn't 
know.*/
-#defineIN_MULTICAST(i) IN_CLASSD(i)
+#endif /* IN_HISTORICAL_NETS */
 
 #defineIN_EXPERIMENTAL(i)  (((in_addr_t)(i) & 0xf000) == 
0xf000)
 #defineIN_BADCLASS(i)  (((in_addr_t)(i) & 0xf000) == 
0xf000)
@@ -398,7 +408,9 @@ __END_DECLS
 #defineINADDR_ALLMDNS_GROUP((in_addr_t)0xe0fb) /* 224.0.0.251 
*/
 #defineINADDR_MAX_LOCAL_GROUP  ((in_addr_t)0xe0ff) /* 224.0.0.255 
*/
 
+#ifdef IN_HISTORICAL_NETS
 #defineIN_LOOPBACKNET  127 /* official! */
+#endif /* IN_HISTORICAL_NETS */
 
 #defineIN_RFC3021_MASK ((in_addr_t)0xfffe)
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 20/65] Convert route caching to nexthop caching.

2022-07-07 Thread Sebastian Huber
From: "Alexander V. Chernikov" 

This change is build on top of nexthop objects introduced in r359823.

Nexthops are separate datastructures, containing all necessary information
 to perform packet forwarding such as gateway interface and mtu. Nexthops
 are shared among the routes, providing more pre-computed cache-efficient
 data while requiring less memory. Splitting the LPM code and the attached
 data solves multiple long-standing problems in the routing layer,
 drastically reduces the coupling with outher parts of the stack and allows
 to transparently introduce faster lookup algorithms.

Route caching was (re)introduced to minimise (slow) routing lookups, allowing
 for notably better performance for large TCP senders. Caching works by
 acquiring rtentry reference, which is protected by per-rtentry mutex.
 If the routing table is changed (checked by comparing the rtable generation id)
 or link goes down, cache record gets withdrawn.

Nexthops have the same reference counting interface, backed by refcount(9).
This change merely replaces rtentry with the actual forwarding nextop as a
 cached object, which is mostly mechanical. Other moving parts like cache
 cleanup on rtable change remains the same.

Differential Revision:  https://reviews.freebsd.org/D24340
---
 newlib/libc/sys/rtems/include/netinet6/in6.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/netinet6/in6.h 
b/newlib/libc/sys/rtems/include/netinet6/in6.h
index f6399eed1..68d4c3e4e 100644
--- a/newlib/libc/sys/rtems/include/netinet6/in6.h
+++ b/newlib/libc/sys/rtems/include/netinet6/in6.h
@@ -265,8 +265,13 @@ extern const struct in6_addr 
in6addr_linklocal_allv2routers;
  * IP6 route structure
  */
 #if __BSD_VISIBLE
+struct nhop_object;
 struct route_in6 {
+#if __FreeBSD_version >= 1300092
+   struct nhop_object *ro_nh;
+#else
struct  rtentry *ro_rt;
+#endif
struct  llentry *ro_lle;
/*
 * ro_prepend and ro_plen are only used for bpf to pass in a
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 22/65] Initial support for kernel offload of TLS receive.

2022-07-07 Thread Sebastian Huber
From: John Baldwin 

- Add a new TCP_RXTLS_ENABLE socket option to set the encryption and
  authentication algorithms and keys as well as the initial sequence
  number.

- When reading from a socket using KTLS receive, applications must use
  recvmsg().  Each successful call to recvmsg() will return a single
  TLS record.  A new TCP control message, TLS_GET_RECORD, will contain
  the TLS record header of the decrypted record.  The regular message
  buffer passed to recvmsg() will receive the decrypted payload.  This
  is similar to the interface used by Linux's KTLS RX except that
  Linux does not return the full TLS header in the control message.

- Add plumbing to the TOE KTLS interface to request either transmit
  or receive KTLS sessions.

- When a socket is using receive KTLS, redirect reads from
  soreceive_stream() into soreceive_generic().

- Note that this interface is currently only defined for TLS 1.1 and
  1.2, though I believe we will be able to reuse the same interface
  and structures for 1.3.
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index b5f01b3bc..5dc13eca2 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -178,6 +178,8 @@ struct tcphdr {
   device */
 #defineTCP_TXTLS_ENABLE 39 /* TLS framing and encryption for 
transmit */
 #defineTCP_TXTLS_MODE  40  /* Transmit TLS mode */
+#defineTCP_RXTLS_ENABLE 41 /* TLS framing and encryption for 
receive */
+#defineTCP_RXTLS_MODE  42  /* Receive TLS mode */
 #defineTCP_CONGESTION  64  /* get/set congestion control algorithm 
*/
 #defineTCP_CCALGOOPT   65  /* get/set cc algorithm specific 
options */
 #define TCP_DELACK 72  /* socket option for delayed ack */
@@ -388,6 +390,7 @@ struct tcp_function_set {
  * TCP Control message types
  */
 #defineTLS_SET_RECORD_TYPE 1
+#defineTLS_GET_RECORD  2
 
 /*
  * TCP specific variables of interest for tp->t_stats stats(9) accounting.
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 61/65] tcp: LRO code to deal with all 12 TCP header flags

2022-07-07 Thread Sebastian Huber
From: Richard Scheffenegger 

TCP per RFC793 has 4 reserved flag bits for future use. One
of those bits may be used for Accurate ECN.
This patch is to include these bits in the LRO code to ease
the extensibility if/when these bits are used.

Reviewed By: hselasky, rrs, #transport
Sponsored by:NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34127
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 6dc7403aa..6a3603287 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -55,12 +55,12 @@ struct tcphdr {
tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */
 #if BYTE_ORDER == LITTLE_ENDIAN
-   u_char  th_x2:4,/* (unused) */
+   u_char  th_x2:4,/* upper 4 (reserved) flags */
th_off:4;   /* data offset */
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
u_char  th_off:4,   /* data offset */
-   th_x2:4;/* (unused) */
+   th_x2:4;/* upper 4 (reserved) flags */
 #endif
u_char  th_flags;
 #defineTH_FIN  0x01
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 58/65] tcp: Add hystart-plus to cc_newreno and rack.

2022-07-07 Thread Sebastian Huber
From: Randall Stewart 

TCP Hystart draft version -03:
https://datatracker.ietf.org/doc/html/draft-ietf-tcpm-hystartplusplus

Is a new version of hystart that allows one to carefully exit slow start if the 
RTT
spikes too much. The newer version has a slower-slow-start so to speak that then
kicks in for five round trips. To see if you exited too early, if not into 
congestion avoidance.
This commit will add that feature to our newreno CC and add the needed bits in 
rack to
be able to enable it.

Reviewed by: tuexen
Sponsored by: Netflix Inc.
Differential Revision:  https://reviews.freebsd.org/D32373
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 29c1e376c..e7c47e85b 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -310,7 +310,7 @@ struct tcphdr {
 #define TCP_RACK_PACING_BETA_ECN 1139  /* Changing the beta for ecn with 
pacing */
 #define TCP_RACK_TIMER_SLOP 1140   /* Set or get the timer slop used */
 #define TCP_RACK_DSACK_OPT 1141/* How do we setup rack timer 
DSACK options bit 1/2 */
-
+#define TCP_RACK_ENABLE_HYSTART 1142   /* Do we allow hystart in the CC 
modules */
 /* Start of reserved space for third-party user-settable options. */
 #defineTCP_VENDOR  SO_VENDOR
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 64/65] arp: Implement sticky ARP mode for interfaces.

2022-07-07 Thread Sebastian Huber
From: Konrad Sewiłło-Jopek 

Provide sticky ARP flag for network interface which marks it as the
"sticky" one similarly to what we have for bridges. Once interface is
marked sticky, any address resolved using the ARP will be saved as a
static one in the ARP table. Such functionality may be used to prevent
ARP spoofing or to decrease latencies in Ethernet networks.

The drawbacks include potential limitations in usage of ARP-based
load-balancers and high-availability solutions such as carp(4).

The implemented option is disabled by default, therefore should not
impact the default behaviour of the networking stack.

Sponsored by:   Conclusive Engineering sp. z o.o.
Reviewed By:melifaro, pauamma_gundo.com
Differential Revision: https://reviews.freebsd.org/D35314
MFC after:  2 weeks
---
 newlib/libc/sys/rtems/include/net/if.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index e90d4d240..3f3b8a3b5 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -160,6 +160,7 @@ struct if_data {
 #defineIFF_PPROMISC0x2 /* (n) user-requested promisc 
mode */
 #defineIFF_MONITOR 0x4 /* (n) user-requested monitor 
mode */
 #defineIFF_STATICARP   0x8 /* (n) static ARP */
+#defineIFF_STICKYARP   0x10/* (n) sticky ARP */
 #defineIFF_DYING   0x20/* (n) interface is winding 
down */
 #defineIFF_RENAMING0x40/* (n) interface is being 
renamed */
 #defineIFF_NOGROUP 0x80/* (n) interface is not part of 
any groups */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[newlib 63/65] Add ifcap2 names for RXTLS4 and RXTLS6 interface capabilities

2022-07-07 Thread Sebastian Huber
From: Konstantin Belousov 

and corresponding nvlist capabilities name strings.

Reviewed by:hselasky, jhb, kp (previous version)
Sponsored by:   NVIDIA Networking
MFC after:  3 weeks
Differential revision:  https://reviews.freebsd.org/D32551
---
 newlib/libc/sys/rtems/include/net/if.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index 7649102c1..e90d4d240 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -252,6 +252,9 @@ struct if_data {
 #defineIFCAP_VXLAN_HWTSO   0x4000 /* can do IFCAP_TSO on 
VXLANs */
 #defineIFCAP_TXTLS_RTLMT   0x8000 /* can do TLS with rate 
limiting */
 
+#defineIFCAP2_RXTLS4   0x1
+#defineIFCAP2_RXTLS6   0x2
+
 #define IFCAP_HWCSUM_IPV6  (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6)
 
 #define IFCAP_HWCSUM   (IFCAP_RXCSUM | IFCAP_TXCSUM)
@@ -259,6 +262,7 @@ struct if_data {
 #defineIFCAP_WOL   (IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | 
IFCAP_WOL_MAGIC)
 #defineIFCAP_TOE   (IFCAP_TOE4 | IFCAP_TOE6)
 #defineIFCAP_TXTLS (IFCAP_TXTLS4 | IFCAP_TXTLS6)
+#defineIFCAP2_RXTLS(IFCAP2_RXTLS4 | IFCAP2_RXTLS6)
 
 #defineIFCAP_CANTCHANGE(IFCAP_NETMAP | IFCAP_NV)
 #defineIFCAP_ALLCAPS   0x
@@ -294,6 +298,8 @@ struct if_data {
 #defineIFCAP_VXLAN_HWCSUM_NAME "VXLAN_HWCSUM"
 #defineIFCAP_VXLAN_HWTSO_NAME  "VXLAN_HWTSO"
 #defineIFCAP_TXTLS_RTLMT_NAME  "TXTLS_RTLMT"
+#defineIFCAP2_RXTLS4_NAME  "RXTLS4"
+#defineIFCAP2_RXTLS6_NAME  "RXTLS6"
 
 #defineIFQ_MAXLEN  50
 #defineIFNET_SLOWHZ1   /* granularity is 1 second */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 65/65] libc/syslog: fully deprecate and don't try to open "/dev/log"

2022-07-07 Thread Sebastian Huber
From: Gleb Smirnoff 

The "/dev/log" socket existed in pre-FreeBSD times.  Later it was
substituted to a compatibility symlink.  The symlink creation was
deprecated in FreeBSD 10.2 and 9-STABLE.

Reviewed by:markj
Differential revision:  https://reviews.freebsd.org/D35304
---
 newlib/libc/sys/rtems/include/sys/syslog.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/sys/syslog.h 
b/newlib/libc/sys/rtems/include/sys/syslog.h
index 071b68427..ff2bd1450 100644
--- a/newlib/libc/sys/rtems/include/sys/syslog.h
+++ b/newlib/libc/sys/rtems/include/sys/syslog.h
@@ -37,7 +37,6 @@
 
 #define_PATH_LOG   "/var/run/log"
 #define_PATH_LOG_PRIV  "/var/run/logpriv"
-#define_PATH_OLDLOG"/dev/log"  /* backward compatibility */
 
 /*
  * priorities/facilities are encoded into a single 32-bit quantity, where the
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 24/65] shm_open2: Implement SHM_GROW_ON_WRITE

2022-07-07 Thread Sebastian Huber
From: Kyle Evans 

Lack of SHM_GROW_ON_WRITE is actively breaking Python's memfd_create tests,
so go ahead and implement it. A future change will make memfd_create always
set SHM_GROW_ON_WRITE, to match Linux behavior and unbreak Python's tests
on -CURRENT.

Reviewed by:kib
Differential Revision:  https://reviews.freebsd.org/D25502
---
 newlib/libc/sys/rtems/include/sys/mman.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/sys/mman.h 
b/newlib/libc/sys/rtems/include/sys/mman.h
index 7a9b49429..99c1eb8b3 100644
--- a/newlib/libc/sys/rtems/include/sys/mman.h
+++ b/newlib/libc/sys/rtems/include/sys/mman.h
@@ -190,6 +190,7 @@
  * shmflags for shm_open2()
  */
 #defineSHM_ALLOW_SEALING   0x0001
+#defineSHM_GROW_ON_WRITE   0x0002
 
 /*
  * Flags for memfd_create().
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 56/65] socket: Implement SO_RERROR

2022-07-07 Thread Sebastian Huber
From: Roy Marples 

SO_RERROR indicates that receive buffer overflows should be handled as
errors. Historically receive buffer overflows have been ignored and
programs could not tell if they missed messages or messages had been
truncated because of overflows. Since programs historically do not
expect to get receive overflow errors, this behavior is not the
default.

This is really really important for programs that use route(4) to keep
in sync with the system. If we loose a message then we need to reload
the full system state, otherwise the behaviour from that point is
undefined and can lead to chasing bogus bug reports.

Reviewed by:philip (network), kbowling (transport), gbe (manpages)
MFC after:  2 weeks
Differential Revision:  https://reviews.freebsd.org/D26652
---
 newlib/libc/sys/rtems/include/sys/socket.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/sys/socket.h 
b/newlib/libc/sys/rtems/include/sys/socket.h
index 4079b3e91..54cd0be93 100644
--- a/newlib/libc/sys/rtems/include/sys/socket.h
+++ b/newlib/libc/sys/rtems/include/sys/socket.h
@@ -139,6 +139,7 @@ typedef __uintptr_t uintptr_t;
 #defineSO_NO_OFFLOAD   0x4000  /* socket cannot be offloaded */
 #defineSO_NO_DDP   0x8000  /* disable direct data 
placement */
 #defineSO_REUSEPORT_LB 0x0001  /* reuse with load balancing */
+#defineSO_RERROR   0x0002  /* keep track of receive errors 
*/
 
 /*
  * Additional options, not kept in so_options.
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 59/65] tcp: socket option to get stack alias name

2022-07-07 Thread Sebastian Huber
From: Peter Lei 

TCP stack sysctl nodes are currently inserted using the stack
name alias. Allow the user to get the current stack's alias to
allow for programatic sysctl access.

Obtained from:  Netflix
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index e7c47e85b..6dc7403aa 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -210,6 +210,7 @@ struct tcphdr {
 #defineTCP_PCAP_OUT2048/* number of output packets to keep */
 #defineTCP_PCAP_IN 4096/* number of input packets to keep */
 #define TCP_FUNCTION_BLK 8192  /* Set the tcp function pointers to the 
specified stack */
+#define TCP_FUNCTION_ALIAS 8193/* Get the current tcp function pointer 
name alias */
 /* Options for Rack and BBR */
 #defineTCP_REUSPORT_LB_NUMA   1026 /* set listen socket numa 
domain */
 #define TCP_RACK_MBUF_QUEUE   1050 /* Do we allow mbuf queuing if supported */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 47/65] termios: add more speeds

2022-07-07 Thread Sebastian Huber
From: "Bjoern A. Zeeb" 

A lot of small arm64 gadgets are using 150 as console speed.
While cu can perfectly deal with this some 3rd party software, e.g.,
comms/conserver-con add speeds based on B being defined.
Having it defined here simplifies enhancing other software.

Obtained-from:  NetBSD sys/sys/termios.h 1.36
MFC-after:  2 weeks
Reviewed-by:philip (,okayed by imp)
Differential Revision:  https://reviews.freebsd.org/D29209
---
 newlib/libc/sys/rtems/include/sys/_termios.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/sys/_termios.h 
b/newlib/libc/sys/rtems/include/sys/_termios.h
index 355ebbfa3..4fb31cc6d 100644
--- a/newlib/libc/sys/rtems/include/sys/_termios.h
+++ b/newlib/libc/sys/rtems/include/sys/_termios.h
@@ -208,7 +208,15 @@
 #defineB115200 115200
 #defineB230400 230400
 #defineB460800 460800
+#define B50 50
 #defineB921600 921600
+#define B100   100U
+#define B150   150U
+#define B200   200U
+#define B250   250U
+#define B300   300U
+#define B350   350U
+#define B400   400U
 #defineEXTA19200
 #defineEXTB38400
 #endif
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 48/65] tcp: add support for TCP over UDP

2022-07-07 Thread Sebastian Huber
From: Michael Tuexen 

Adding support for TCP over UDP allows communication with
TCP stacks which can be implemented in userspace without
requiring special priviledges or specific support by the OS.
This is joint work with rrs.

Reviewed by:rrs
Sponsored by:   Netflix, Inc.
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D29469
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h 
b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 0b71bd465..d2bf1f843 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -183,6 +183,7 @@ struct tcphdr {
 #defineTCP_RXTLS_MODE  42  /* Receive TLS mode */
 #defineTCP_CONGESTION  64  /* get/set congestion control algorithm 
*/
 #defineTCP_CCALGOOPT   65  /* get/set cc algorithm specific 
options */
+#define TCP_REMOTE_UDP_ENCAPS_PORT 71  /* Enable TCP over UDP tunneling via 
the specified port */
 #define TCP_DELACK 72  /* socket option for delayed ack */
 #define TCP_FIN_IS_RST 73  /* A fin from the peer is treated has a RST */
 #define TCP_LOG_LIMIT  74  /* Limit to number of records in tcp-log */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 62/65] Kernel-side infrastructure to implement nvlist-based set/get ifcaps

2022-07-07 Thread Sebastian Huber
From: Konstantin Belousov 

Reviewed by:hselasky, jhb, kp (previous version)
Sponsored by:   NVIDIA Networking
MFC after:  3 weeks
Differential revision:  https://reviews.freebsd.org/D32551
---
 newlib/libc/sys/rtems/include/net/if.h | 48 +-
 newlib/libc/sys/rtems/include/sys/sockio.h |  3 ++
 2 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index c15013005..7649102c1 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -236,7 +236,7 @@ struct if_data {
 #defineIFCAP_TOE4  0x04000 /* interface can offload TCP */
 #defineIFCAP_TOE6  0x08000 /* interface can offload TCP6 */
 #defineIFCAP_VLAN_HWFILTER 0x1 /* interface hw can filter vlan 
tag */
-/* available   0x2 */
+#defineIFCAP_NV0x2 /* can do 
SIOCGIFCAPNV/SIOCSIFCAPNV */
 #defineIFCAP_VLAN_HWTSO0x4 /* can do IFCAP_TSO on VLANs */
 #defineIFCAP_LINKSTATE 0x8 /* the runtime link state is 
dynamic */
 #defineIFCAP_NETMAP0x10 /* netmap mode 
supported/enabled */
@@ -260,7 +260,40 @@ struct if_data {
 #defineIFCAP_TOE   (IFCAP_TOE4 | IFCAP_TOE6)
 #defineIFCAP_TXTLS (IFCAP_TXTLS4 | IFCAP_TXTLS6)
 
-#defineIFCAP_CANTCHANGE(IFCAP_NETMAP)
+#defineIFCAP_CANTCHANGE(IFCAP_NETMAP | IFCAP_NV)
+#defineIFCAP_ALLCAPS   0x
+
+#defineIFCAP_RXCSUM_NAME   "RXCSUM"
+#defineIFCAP_TXCSUM_NAME   "TXCSUM"
+#defineIFCAP_NETCONS_NAME  "NETCONS"
+#defineIFCAP_VLAN_MTU_NAME "VLAN_MTU"
+#defineIFCAP_VLAN_HWTAGGING_NAME "VLAN_HWTAGGING"
+#defineIFCAP_JUMBO_MTU_NAME"JUMBO_MTU"
+#defineIFCAP_POLLING_NAME  "POLLING"
+#defineIFCAP_VLAN_HWCSUM_NAME  "VLAN_HWCSUM"
+#defineIFCAP_TSO4_NAME "TSO4"
+#defineIFCAP_TSO6_NAME "TSO6"
+#defineIFCAP_LRO_NAME  "LRO"
+#defineIFCAP_WOL_UCAST_NAME"WOL_UCAST"
+#defineIFCAP_WOL_MCAST_NAME"WOL_MCAST"
+#defineIFCAP_WOL_MAGIC_NAME"WOL_MAGIC"
+#defineIFCAP_TOE4_NAME "TOE4"
+#defineIFCAP_TOE6_NAME "TOE6"
+#defineIFCAP_VLAN_HWFILTER_NAME "VLAN_HWFILTER"
+#defineIFCAP_VLAN_HWTSO_NAME   "VLAN_HWTSO"
+#defineIFCAP_LINKSTATE_NAME"LINKSTATE"
+#defineIFCAP_NETMAP_NAME   "NETMAP"
+#defineIFCAP_RXCSUM_IPV6_NAME  "RXCSUM_IPV6"
+#defineIFCAP_TXCSUM_IPV6_NAME  "TXCSUM_IPV6"
+#defineIFCAP_HWSTATS_NAME  "HWSTATS"
+#defineIFCAP_TXRTLMT_NAME  "TXRTLMT"
+#defineIFCAP_HWRXTSTMP_NAME"HWRXTSTMP"
+#defineIFCAP_MEXTPG_NAME   "MEXTPG"
+#defineIFCAP_TXTLS4_NAME   "TXTLS4"
+#defineIFCAP_TXTLS6_NAME   "TXTLS6"
+#defineIFCAP_VXLAN_HWCSUM_NAME "VXLAN_HWCSUM"
+#defineIFCAP_VXLAN_HWTSO_NAME  "VXLAN_HWTSO"
+#defineIFCAP_TXTLS_RTLMT_NAME  "TXTLS_RTLMT"
 
 #defineIFQ_MAXLEN  50
 #defineIFNET_SLOWHZ1   /* granularity is 1 second */
@@ -387,6 +420,15 @@ struct ifreq_buffer {
void*buffer;
 };
 
+struct ifreq_nv_req {
+   u_int   buf_length; /* Total size of buffer,
+  u_int for ABI struct ifreq */
+   u_int   length; /* Length of the filled part */
+   void*buffer;/* Buffer itself, containing packed nv */
+};
+
+#defineIFR_CAP_NV_MAXBUFSIZE   (2 * 1024 * 1024)
+
 /*
  * Interface request structure used for socket
  * ioctl's.  All interface ioctl's must have parameter
@@ -411,6 +453,7 @@ struct ifreq {
int ifru_cap[2];
u_int   ifru_fib;
u_char  ifru_vlan_pcp;
+   struct  ifreq_nv_req ifru_nv;
} ifr_ifru;
 #defineifr_addrifr_ifru.ifru_addr  /* address */
 #defineifr_dstaddr ifr_ifru.ifru_dstaddr   /* other end of p-to-p 
link */
@@ -434,6 +477,7 @@ struct ifreq {
 #defineifr_fib ifr_ifru.ifru_fib   /* interface fib */
 #defineifr_vlan_pcpifr_ifru.ifru_vlan_pcp  /* VLAN priority */
 #defineifr_lan_pcp ifr_ifru.ifru_vlan_pcp  /* VLAN priority */
+#defineifr_cap_nv  ifr_ifru.ifru_nv/* nv-based cap 
interface */
 };
 
 #define_SIZEOF_ADDR_IFREQ(ifr) \
diff --git a/newlib/libc/sys/rtems/include/sys/sockio.h 
b/newlib/libc/sys/rtems/include/sys/sockio.h
index 93b8af28e..b9ed4a439 100644
--- a/newlib/libc/sys/rtems/include/sys/sockio.h
+++ b/newlib/libc/sys/rtems/include/sys/sockio.h
@@ -147,4 +147,7 @@
 
 #defineSIOCGIFDOWNREASON   _IOWR('i', 154, struct ifdownreason)
 
+#defineSIOCSIFCAPNV_IOW('i', 155, struct ifreq)/

[PATCH 0/4] Update FreeBSD baseline

2022-07-07 Thread Sebastian Huber
This patch set updates the header files imported from FreeBSD to the current
FreeBSD head:

commit 3bf66365129a13933f77d1f4421d5136861cffb4
Author: Brooks Davis 
Date:   Wed Jul 6 14:03:48 2022 +0100

cddl/*: add a WITH(OUT)_DTRACE option

Add an option to enable/disable DTrace without disabling ZFS.  New
architectures such as CHERI may support ZFS before they support DTrace
and the old model of WITHOUT_CDDL disabling both wasn't helpful.

For compatiblity, the CDDL option remains and WITHOUT_CDDL implies
WITHOUT_DTRACE.  WITHOUT_DTRACE also implies WITHOUT_CTF.

As part of this change, largely convert cddl/*/Makefile to using the
more compact SUBDIR.${MK_}+= form rather than using intermediate
variables.

Reviewed by:markj
Obtained from:  CheriBSD
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D35718

Alexander V. Chernikov (1):
  routing: fix source address selection rules for IPv4 over IPv6.

Gleb Smirnoff (2):
  Use network epoch to protect local IPv4 addresses hash.
  Add in_localip_fib(), in6_localip_fib().

John Baldwin (1):
  Remove copyinfrom() and copyinstrfrom().

 cpukit/include/machine/_kernel_in.h  | 6 ++
 cpukit/include/machine/_kernel_in6.h | 1 +
 cpukit/include/machine/_kernel_uio.h | 4 
 3 files changed, 7 insertions(+), 4 deletions(-)

-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[newlib 17/65] Although most of the NIC drivers are epoch ready,

2022-07-07 Thread Sebastian Huber
From: Gleb Smirnoff 

due to peer pressure switch over to opt-in instead of opt-out for epoch.

Instead of IFF_NEEDSEPOCH, provide IFF_KNOWSEPOCH. If driver marks
itself with IFF_KNOWSEPOCH, then ether_input() would not enter epoch
when processing its packets.

Now this will create recursive entrance in epoch in >90% network
drivers, but will guarantee safeness of the transition.

Mark several tested drivers as IFF_KNOWSEPOCH.

Reviewed by:hselasky, jeff, bz, gallatin
Differential Revision:  https://reviews.freebsd.org/D23674
---
 newlib/libc/sys/rtems/include/net/if.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/net/if.h 
b/newlib/libc/sys/rtems/include/net/if.h
index 2c1ecdf32..78b1654dc 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -144,7 +144,7 @@ struct if_data {
 #defineIFF_DEBUG   0x4 /* (n) turn on debugging */
 #defineIFF_LOOPBACK0x8 /* (i) is a loopback net */
 #defineIFF_POINTOPOINT 0x10/* (i) is a point-to-point link 
*/
-#defineIFF_NEEDSEPOCH  0x20/* (i) calls if_input w/o epoch 
*/
+#defineIFF_KNOWSEPOCH  0x20/* (i) calls if_input in net 
epoch */
 #defineIFF_DRV_RUNNING 0x40/* (d) resources allocated */
 #defineIFF_NOARP   0x80/* (n) no address resolution 
protocol */
 #defineIFF_PROMISC 0x100   /* (n) receive all packets */
@@ -178,7 +178,7 @@ struct if_data {
 #defineIFF_CANTCHANGE \
(IFF_BROADCAST|IFF_POINTOPOINT|IFF_DRV_RUNNING|IFF_DRV_OACTIVE|\
IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_PROMISC|\
-   IFF_DYING|IFF_CANTCONFIG)
+   IFF_DYING|IFF_CANTCONFIG|IFF_KNOWSEPOCH)
 
 /*
  * Values for if_link_state.
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 2/4] routing: fix source address selection rules for IPv4 over IPv6.

2022-07-07 Thread Sebastian Huber
From: "Alexander V. Chernikov" 

Current logic always selects an IFA of the same family from the
 outgoing interfaces. In IPv4 over IPv6 setup there can be just
 single non-127.0.0.1 ifa, attached to the loopback interface.

Create a separate rt_getifa_family() to handle entire ifa selection
 for the IPv4 over IPv6.

Differential Revision: https://reviews.freebsd.org/D31868
MFC after:  1 week
---
 cpukit/include/machine/_kernel_in.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cpukit/include/machine/_kernel_in.h 
b/cpukit/include/machine/_kernel_in.h
index 29a6112e96..69b189cfe0 100644
--- a/cpukit/include/machine/_kernel_in.h
+++ b/cpukit/include/machine/_kernel_in.h
@@ -52,6 +52,7 @@ intin_canforward(struct in_addr);
 int in_localaddr(struct in_addr);
 int in_localip(struct in_addr);
 int in_ifhasaddr(struct ifnet *, struct in_addr);
+struct in_ifaddr *in_findlocal(uint32_t, bool);
 int inet_aton(const char *, struct in_addr *); /* in libkern */
 char   *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */
 char   *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 4/4] Add in_localip_fib(), in6_localip_fib().

2022-07-07 Thread Sebastian Huber
From: Gleb Smirnoff 

Check if given address/FIB exists locally.

Reviewed by:melifaro
Differential revision:  https://reviews.freebsd.org/D32913
---
 cpukit/include/machine/_kernel_in.h  | 1 +
 cpukit/include/machine/_kernel_in6.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/cpukit/include/machine/_kernel_in.h 
b/cpukit/include/machine/_kernel_in.h
index c9dcfbd033..b33283353a 100644
--- a/cpukit/include/machine/_kernel_in.h
+++ b/cpukit/include/machine/_kernel_in.h
@@ -55,6 +55,7 @@ bool   in_localip(struct in_addr);
 #else
 int in_localip(struct in_addr);
 #endif
+boolin_localip_fib(struct in_addr, uint16_t);
 int in_ifhasaddr(struct ifnet *, struct in_addr);
 struct in_ifaddr *in_findlocal(uint32_t, bool);
 int inet_aton(const char *, struct in_addr *); /* in libkern */
diff --git a/cpukit/include/machine/_kernel_in6.h 
b/cpukit/include/machine/_kernel_in6.h
index c2b603fb36..7ec695bd6d 100644
--- a/cpukit/include/machine/_kernel_in6.h
+++ b/cpukit/include/machine/_kernel_in6.h
@@ -167,6 +167,7 @@ int in6_cksum_partial(struct mbuf *, u_int8_t, u_int32_t, 
u_int32_t,
  u_int32_t);
 intin6_localaddr(struct in6_addr *);
 intin6_localip(struct in6_addr *);
+bool   in6_localip_fib(struct in6_addr *, uint16_t);
 intin6_ifhasaddr(struct ifnet *, struct in6_addr *);
 intin6_addrscope(const struct in6_addr *);
 char   *ip6_sprintf(char *, const struct in6_addr *);
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 1/4] Remove copyinfrom() and copyinstrfrom().

2022-07-07 Thread Sebastian Huber
From: John Baldwin 

These functions were added in 2001 and are currently unused.
copyinfrom() looks to have never been used.  copyinstrfrom() was used
for two weeks before the code was refactored to remove it's sole use.

Reviewed by:brooks, kib
Obtained from:  CheriBSD
Sponsored by:   DARPA
Differential Revision:  https://reviews.freebsd.org/D24928
---
 cpukit/include/machine/_kernel_uio.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/cpukit/include/machine/_kernel_uio.h 
b/cpukit/include/machine/_kernel_uio.h
index 7e45a28c16..59929cb03c 100644
--- a/cpukit/include/machine/_kernel_uio.h
+++ b/cpukit/include/machine/_kernel_uio.h
@@ -71,12 +71,8 @@ struct vm_page;
 struct bus_dma_segment;
 
 struct uio *cloneuio(struct uio *uiop);
-intcopyinfrom(const void * __restrict src, void * __restrict dst,
-   size_t len, int seg);
 intcopyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov,
int error);
-intcopyinstrfrom(const void * __restrict src, void * __restrict dst,
-   size_t len, size_t * __restrict copied, int seg);
 intcopyinuio(const struct iovec *iovp, u_int iovcnt, struct uio **uiop);
 intcopyout_map(struct thread *td, vm_offset_t *addr, size_t sz);
 intcopyout_unmap(struct thread *td, vm_offset_t addr, size_t sz);
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 3/4] Use network epoch to protect local IPv4 addresses hash.

2022-07-07 Thread Sebastian Huber
From: Gleb Smirnoff 

The modification to the hash are already naturally locked by
in_control_sx.  Convert the hash lists to CK lists. Remove the
in_ifaddr_rmlock. Assert the network epoch where necessary.

Most cases when the hash lookup is done the epoch is already entered.
Cover a few cases, that need entering the epoch, which mostly is
initial configuration of tunnel interfaces and multicast addresses.

Reviewed by:melifaro
Differential revision:  https://reviews.freebsd.org/D32584
---
 cpukit/include/machine/_kernel_in.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/cpukit/include/machine/_kernel_in.h 
b/cpukit/include/machine/_kernel_in.h
index 69b189cfe0..c9dcfbd033 100644
--- a/cpukit/include/machine/_kernel_in.h
+++ b/cpukit/include/machine/_kernel_in.h
@@ -50,7 +50,11 @@ int   in_broadcast(struct in_addr, struct ifnet *);
 int in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *);
 int in_canforward(struct in_addr);
 int in_localaddr(struct in_addr);
+#if __FreeBSD_version >= 1400039
+boolin_localip(struct in_addr);
+#else
 int in_localip(struct in_addr);
+#endif
 int in_ifhasaddr(struct ifnet *, struct in_addr);
 struct in_ifaddr *in_findlocal(uint32_t, bool);
 int inet_aton(const char *, struct in_addr *); /* in libkern */
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[libbsd 3/7] Widen ifnet_detach_sxlock coverage

2022-07-07 Thread Sebastian Huber
From: Kristof Provost 

Widen the ifnet_detach_sxlock to cover the entire vnet sysuninit code.
This ensures that we can't end up having the vnet_sysuninit free the UDP
pcb while the detach code is running and trying to purge the UDP pcb.

MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D28530
---
 rtemsbsd/include/machine/_kernel_if.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rtemsbsd/include/machine/_kernel_if.h 
b/rtemsbsd/include/machine/_kernel_if.h
index 08086658..f89adc13 100644
--- a/rtemsbsd/include/machine/_kernel_if.h
+++ b/rtemsbsd/include/machine/_kernel_if.h
@@ -41,6 +41,8 @@ MALLOC_DECLARE(M_IFADDR);
 MALLOC_DECLARE(M_IFMADDR);
 #endif
 
+extern struct sx ifnet_detach_sxlock;
+
 #defineifr_buffer  ifr_ifru.ifru_buffer/* user supplied buffer 
with its length */
 #defineifr_dataifr_ifru.ifru_data  /* for use by interface 
*/
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[libbsd 0/7] Update FreeBSD baseline

2022-07-07 Thread Sebastian Huber
This patch set updates the kernel space parts of Newlib provided header files
imported from FreeBSD to the current FreeBSD head:

commit 3bf66365129a13933f77d1f4421d5136861cffb4
Author: Brooks Davis 
Date:   Wed Jul 6 14:03:48 2022 +0100

cddl/*: add a WITH(OUT)_DTRACE option

Add an option to enable/disable DTrace without disabling ZFS.  New
architectures such as CHERI may support ZFS before they support DTrace
and the old model of WITHOUT_CDDL disabling both wasn't helpful.

For compatiblity, the CDDL option remains and WITHOUT_CDDL implies
WITHOUT_DTRACE.  WITHOUT_DTRACE also implies WITHOUT_CTF.

As part of this change, largely convert cddl/*/Makefile to using the
more compact SUBDIR.${MK_}+= form rather than using intermediate
variables.

Reviewed by:markj
Obtained from:  CheriBSD
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D35718

Konstantin Belousov (1):
  Kernel-side infrastructure to implement nvlist-based set/get ifcaps

Kristof Provost (1):
  Widen ifnet_detach_sxlock coverage

Rick Macklem (2):
  Add the MSG_TLSAPPDATA flag to indicate "return ENXIO" for
non-application TLS data records.
  uipc_socket.c: Modify MSG_TLSAPPDATA to only do Alert Records

Sebastian Huber (3):
  CONTRIBUTING.rst: Add FreeBSD baseline update hints
  Define IN_HISTORICAL_NETS for kernel space
  Define IFCAP_NOMAP for Newlib compatibility

 CONTRIBUTING.rst  | 11 +++
 rtemsbsd/include/machine/_kernel_if.h | 14 ++
 rtemsbsd/include/machine/_kernel_socket.h |  1 +
 rtemsbsd/include/machine/rtems-bsd-kernel-space.h |  6 ++
 rtemsbsd/include/machine/rtems-bsd-user-space.h   |  3 +++
 5 files changed, 35 insertions(+)

-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[libbsd 1/7] CONTRIBUTING.rst: Add FreeBSD baseline update hints

2022-07-07 Thread Sebastian Huber
---
 CONTRIBUTING.rst | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index f28f02e1..3b0c09aa 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -386,6 +386,17 @@ In general, provide empty header files and do not guard 
includes.
 For new code use
 `STYLE(9) 
`_.
 
+Update FreeBSD Baseline
+===
+
+Performa the following steps to do a FreeBSD baseline update:
+
+* Update ``__FreeBSD_version`` in 
``rtemsbsd/include/machine/rtems-bsd-version.h``
+
+* Update the namespace header file.
+
+* Review all code blocks with the ``REVIEW-AFTER-FREEBSD-BASELINE-UPDATE`` tag.
+
 Automatically Generated FreeBSD Files
 =
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[libbsd 2/7] Add the MSG_TLSAPPDATA flag to indicate "return ENXIO" for non-application TLS data records.

2022-07-07 Thread Sebastian Huber
From: Rick Macklem 

The kernel RPC cannot process non-application data records when
using TLS. It must to an upcall to a userspace daemon that will
call SSL_read() to process them.

This patch adds a new flag called MSG_TLSAPPDATA that the kernel
RPC can use to tell sorecieve() to return ENXIO instead of a non-application
data record, when that is what is at the top of the receive queue.
I put the code in #ifdef KERN_TLS/#endif, although it will build without
that, so that it is recognized as only useful when KERN_TLS is enabled.
The alternative to doing this is to have the kernel RPC re-queue the
non-application data message after receiving it, but that seems more
complicated and might introduce message ordering issues when there
are multiple non-application data records one after another.

I do not know what, if any, changes will be required to support TLS1.3.

Reviewed by:glebius
Differential Revision:  https://reviews.freebsd.org/D25923
---
 rtemsbsd/include/machine/_kernel_socket.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rtemsbsd/include/machine/_kernel_socket.h 
b/rtemsbsd/include/machine/_kernel_socket.h
index e9acc744..dba4694f 100644
--- a/rtemsbsd/include/machine/_kernel_socket.h
+++ b/rtemsbsd/include/machine/_kernel_socket.h
@@ -46,6 +46,7 @@
 #defineMSG_SOCALLBCK0x0001 /* for use by socket callbacks 
- soreceive (TCP) */
 
 #defineMSG_MORETOCOME   0x0010 /* additional data pending */
+#defineMSG_TLSAPPDATA   0x0020 /* only soreceive() app. data 
(TLS) */
 
 #defineCMSG_ALIGN(n)   _ALIGN(n)
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[libbsd 4/7] uipc_socket.c: Modify MSG_TLSAPPDATA to only do Alert Records

2022-07-07 Thread Sebastian Huber
From: Rick Macklem 

Without this patch, the MSG_TLSAPPDATA flag would cause
soreceive_generic() to return ENXIO for any non-application
data record in a TLS receive stream.

This works ok for TLS1.2, since Alert records appear to be
the only non-application data records received.
However, for TLS1.3, there can be post-handshake handshake
records, such as NewSessionKey sent to the client from the
server. These handshake records cannot be handled by the
upcall which does an SSL_read() with length == 0.

It appears that the client can simply throw away these
NewSessionKey records, but to do so, it needs to receive
them within the kernel.

This patch modifies the semantics of MSG_TLSAPPDATA slightly,
so that it only applies to Alert records and not Handshake
records. It is needed to allow the krpc to work with KTLS1.3.

Reviewed by:hselasky
MFC after:  2 weeks
Differential Revision:  https://reviews.freebsd.org/D35170
---
 rtemsbsd/include/machine/_kernel_socket.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rtemsbsd/include/machine/_kernel_socket.h 
b/rtemsbsd/include/machine/_kernel_socket.h
index dba4694f..3acee460 100644
--- a/rtemsbsd/include/machine/_kernel_socket.h
+++ b/rtemsbsd/include/machine/_kernel_socket.h
@@ -46,7 +46,7 @@
 #defineMSG_SOCALLBCK0x0001 /* for use by socket callbacks 
- soreceive (TCP) */
 
 #defineMSG_MORETOCOME   0x0010 /* additional data pending */
-#defineMSG_TLSAPPDATA   0x0020 /* only soreceive() app. data 
(TLS) */
+#defineMSG_TLSAPPDATA   0x0020 /* do not soreceive() alert 
rec. (TLS) */
 
 #defineCMSG_ALIGN(n)   _ALIGN(n)
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[libbsd 5/7] Kernel-side infrastructure to implement nvlist-based set/get ifcaps

2022-07-07 Thread Sebastian Huber
From: Konstantin Belousov 

Reviewed by:hselasky, jhb, kp (previous version)
Sponsored by:   NVIDIA Networking
MFC after:  3 weeks
Differential revision:  https://reviews.freebsd.org/D32551
---
 rtemsbsd/include/machine/_kernel_if.h | 12 
 1 file changed, 12 insertions(+)

diff --git a/rtemsbsd/include/machine/_kernel_if.h 
b/rtemsbsd/include/machine/_kernel_if.h
index f89adc13..16733fe3 100644
--- a/rtemsbsd/include/machine/_kernel_if.h
+++ b/rtemsbsd/include/machine/_kernel_if.h
@@ -43,6 +43,18 @@ MALLOC_DECLARE(M_IFMADDR);
 
 extern struct sx ifnet_detach_sxlock;
 
+struct nvlist;
+struct ifcap_nv_bit_name;
+int if_capnv_to_capint(const struct nvlist *nv, int *old_cap,
+const struct ifcap_nv_bit_name *nn, bool all);
+void if_capint_to_capnv(struct nvlist *nv,
+const struct ifcap_nv_bit_name *nn, int ifr_cap, int ifr_req);
+struct siocsifcapnv_driver_data {
+   int reqcap;
+   int reqcap2;
+   struct nvlist *nvcap;
+};
+
 #defineifr_buffer  ifr_ifru.ifru_buffer/* user supplied buffer 
with its length */
 #defineifr_dataifr_ifru.ifru_data  /* for use by interface 
*/
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[libbsd 7/7] Define IFCAP_NOMAP for Newlib compatibility

2022-07-07 Thread Sebastian Huber
---
 rtemsbsd/include/machine/rtems-bsd-kernel-space.h | 3 +++
 rtemsbsd/include/machine/rtems-bsd-user-space.h   | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/rtemsbsd/include/machine/rtems-bsd-kernel-space.h 
b/rtemsbsd/include/machine/rtems-bsd-kernel-space.h
index c4c70c75..f2f1b91f 100644
--- a/rtemsbsd/include/machine/rtems-bsd-kernel-space.h
+++ b/rtemsbsd/include/machine/rtems-bsd-kernel-space.h
@@ -58,6 +58,9 @@
 /* REVIEW-AFTER-FREEBSD-BASELINE-UPDATE */
 #define IN_HISTORICAL_NETS
 
+/* REVIEW-AFTER-FREEBSD-BASELINE-UPDATE */
+#define IFCAP_NOMAP 0x400
+
 #include 
 #include 
 
diff --git a/rtemsbsd/include/machine/rtems-bsd-user-space.h 
b/rtemsbsd/include/machine/rtems-bsd-user-space.h
index cc7493d1..93113b9c 100644
--- a/rtemsbsd/include/machine/rtems-bsd-user-space.h
+++ b/rtemsbsd/include/machine/rtems-bsd-user-space.h
@@ -50,6 +50,9 @@
 
 #include 
 
+/* REVIEW-AFTER-FREEBSD-BASELINE-UPDATE */
+#define IFCAP_NOMAP 0x400
+
 #define O_CLOEXEC 0
 
 #define O_DIRECTORY 0
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[libbsd 6/7] Define IN_HISTORICAL_NETS for kernel space

2022-07-07 Thread Sebastian Huber
Required by FreeBSD commit:

Author: Mike Karels 
Date:   Tue Oct 26 22:01:09 2021 -0500

kernel: deprecate Internet Class A/B/C

Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined;
define it for user level.  Define IN_MULTICAST separately from IN_CLASSD,
and use it in pf instead of IN_CLASSD.  Stop using class for setting
default masks when not specified; instead, define new default mask
(24 bits).  Warn when an Internet address is set without a mask.

MFC after:  1 month
Reviewed by:cy
Differential Revision: https://reviews.freebsd.org/D32708
---
 rtemsbsd/include/machine/rtems-bsd-kernel-space.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rtemsbsd/include/machine/rtems-bsd-kernel-space.h 
b/rtemsbsd/include/machine/rtems-bsd-kernel-space.h
index 09bcecf1..c4c70c75 100644
--- a/rtemsbsd/include/machine/rtems-bsd-kernel-space.h
+++ b/rtemsbsd/include/machine/rtems-bsd-kernel-space.h
@@ -55,6 +55,9 @@
 /* General define to activate BSD kernel parts */
 #define _KERNEL 1
 
+/* REVIEW-AFTER-FREEBSD-BASELINE-UPDATE */
+#define IN_HISTORICAL_NETS
+
 #include 
 #include 
 
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [libbsd 1/7] CONTRIBUTING.rst: Add FreeBSD baseline update hints

2022-07-07 Thread Karel Gardas

On 7/7/22 14:02, Sebastian Huber wrote:

+Performa the following steps to do a FreeBSD baseline update:


Small typo here.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH v2 3/4] bsps: Add GPIO API

2022-07-07 Thread Karel Gardas



Hello Duc,

just two notes which bothers me most.

On 7/7/22 13:34, Duc Doan wrote:

This is the new GPIO API. The header file is
gpio2.h.
---
  bsps/include/bsp/gpio2.h| 538 
  bsps/shared/dev/gpio/gpio.c | 196 +
  spec/build/bsps/obj.yml |   2 +-
  3 files changed, 735 insertions(+), 1 deletion(-)
  create mode 100644 bsps/include/bsp/gpio2.h
  create mode 100644 bsps/shared/dev/gpio/gpio.c

diff --git a/bsps/include/bsp/gpio2.h b/bsps/include/bsp/gpio2.h
new file mode 100644
index 00..e99967cd47
--- /dev/null
+++ b/bsps/include/bsp/gpio2.h
@@ -0,0 +1,538 @@
+/**
+  * @file
+  *
+  * @ingroup rtems_gpio2
+  *
+  * @brief RTEMS GPIO new API definition.
+  */
+
+/*
+*  Copyright (c) 2022 Duc Doan 
+*
+*  The license and distribution terms for this file may be
+*  found in the file LICENSE in this distribution or at
+*  http://www.rtems.org/license/LICENSE.
+*/


RTEMS project (Joel & others) perform huge effort in a way on 
relicensing RTEMS to BSD license. Please use new license header instead 
of this one which is old -- from GPL days. Open few random RTEMS files 
and you will see few license headers. Look for example into ... randomly 
picked :-) -- 
bsps/arm/stm32h7/boards/stm/nucleo-h743zi/stm32h7-bspstarthooks.c and 
modify this to your name/email...




+/**
+  * @brief Performs setup for GPIO functionality.
+  *
+  * This function calls bsp_gpio_register_controllers() and may
+  * perform additional initialization steps for GPIO functionality.
+  * It should be called by users before all GPIO operations, ideally
+  * when the application starts.
+  */
+extern void rtems_gpio_begin(
+void
+);


I don't like this _begin mentality here. I think this should be all done 
by BSP code based on actual BSP configuration.

Something like:
STM32F4_ENABLE_GENERIC_GPIO implemented as optengpio.yml in f4 spec and 
then based on its C preprocessor value just calls 
bsp_gpio_register_controllers from probably hook_1 and be done with that.


Sorry about that, 'begin' is too much RDBMS hooked thing here and when I 
see 'begin' I also expect 'commit' or 'rollback' somewhere down the 
line. :-)


Thanks,
Karel



___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] bsps/arm/stm32f4 Optimize get pin and change from HAL to LL

2022-07-07 Thread Karel Gardas

On 7/7/22 13:11, Duc Doan wrote:

Maybe it's as simple as renaming the identifiers from stm32f4_gpio =>
stm32_gpio for clarity for most functions, and declaring these files
in
the H7 scripts.



I think I will wait for Karel's opinion about that.


I just need to catch a bit of breath and then I'll test your driver on 
H7. I need that anyway so better use your API than LL/HAL. I'll see what 
I can do till the end of this week...


Karel

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH v2 3/4] bsps: Add GPIO API

2022-07-07 Thread Duc Doan
Hello Karel,

On Thu, 2022-07-07 at 14:36 +0200, Karel Gardas wrote:
> 
> Hello Duc,
> 
> just two notes which bothers me most.
> 
> On 7/7/22 13:34, Duc Doan wrote:
> > This is the new GPIO API. The header file is
> > gpio2.h.
> > ---
> >   bsps/include/bsp/gpio2.h    | 538
> > 
> >   bsps/shared/dev/gpio/gpio.c | 196 +
> >   spec/build/bsps/obj.yml |   2 +-
> >   3 files changed, 735 insertions(+), 1 deletion(-)
> >   create mode 100644 bsps/include/bsp/gpio2.h
> >   create mode 100644 bsps/shared/dev/gpio/gpio.c
> > 
> > diff --git a/bsps/include/bsp/gpio2.h b/bsps/include/bsp/gpio2.h
> > new file mode 100644
> > index 00..e99967cd47
> > --- /dev/null
> > +++ b/bsps/include/bsp/gpio2.h
> > @@ -0,0 +1,538 @@
> > +/**
> > +  * @file
> > +  *
> > +  * @ingroup rtems_gpio2
> > +  *
> > +  * @brief RTEMS GPIO new API definition.
> > +  */
> > +
> > +/*
> > +*  Copyright (c) 2022 Duc Doan 
> > +*
> > +*  The license and distribution terms for this file may be
> > +*  found in the file LICENSE in this distribution or at
> > +*  http://www.rtems.org/license/LICENSE.
> > +*/
> 
> RTEMS project (Joel & others) perform huge effort in a way on 
> relicensing RTEMS to BSD license. Please use new license header
> instead 
> of this one which is old -- from GPL days. Open few random RTEMS
> files 
> and you will see few license headers. Look for example into ...
> randomly 
> picked :-) -- 
> bsps/arm/stm32h7/boards/stm/nucleo-h743zi/stm32h7-bspstarthooks.c and
> modify this to your name/email...
> 

Thank you for the reminder. I was actually copying from a random source
file before. I will change it in the next version.

> 
> > +/**
> > +  * @brief Performs setup for GPIO functionality.
> > +  *
> > +  * This function calls bsp_gpio_register_controllers() and may
> > +  * perform additional initialization steps for GPIO
> > functionality.
> > +  * It should be called by users before all GPIO operations,
> > ideally
> > +  * when the application starts.
> > +  */
> > +extern void rtems_gpio_begin(
> > +    void
> > +);
> 
> I don't like this _begin mentality here. I think this should be all
> done 
> by BSP code based on actual BSP configuration.
> Something like:
> STM32F4_ENABLE_GENERIC_GPIO implemented as optengpio.yml in f4 spec
> and 
> then based on its C preprocessor value just calls 
> bsp_gpio_register_controllers from probably hook_1 and be done with
> that.
> 
> Sorry about that, 'begin' is too much RDBMS hooked thing here and
> when I 
> see 'begin' I also expect 'commit' or 'rollback' somewhere down the 
> line. :-)
> 
> Thanks,
> Karel
> 

I see, it makes sense to call that function automatically. I actually
tried to do so using RTEMS_SYSINIT_ITEM but failed. I will try putting
it into the hook.

Best,

Duc Doan

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

linkcmds.yml problems

2022-07-07 Thread Sam Price
Was trying to build the latest source builder/rtems/libbsd but ran into a
linker problem.

You ever see this the source linker has

spec/build/bsps/microblaze/microblaze_fpga/linkcmds.yml: RAM : ORIGIN =
_TEXT_START_ADDR, LENGTH = ${BSP_MICROBLAZE_FPGA_RAM_LENGTH}


But the generated linker file is creating

RAM : ORIGIN = _TEXT_START_ADDR, LENGTH =

when building rtems without populating the BSP_MICROBLAZE_FPGA_RAM_LENGTH.



My config.ini has this specified as
configs/config_kcu105_cpu0.ini:BSP_MICROBLAZE_FPGA_RAM_LENGTH=0x1000

Is it possible i have a bad python instance ?


--
Thank you,

Sam Price
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: linkcmds.yml problems

2022-07-07 Thread Alex White
On Thu, Jul 7, 2022 at 10:31 AM Sam Price  wrote:
> Is it possible i have a bad python instance ?

I was able to reproduce the linker problem using the latest RTEMS upstream code.

It looks like it was broken by commit a0aaa394b68727d204904b59514cb0f90840ba6f 
from 6 days ago.

I will submit a fix.

Alex

>
>
> --
> Thank you,
>
> Sam Price
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


From: devel  on behalf of Sam Price 

Sent: Thursday, July 7, 2022 10:30 AM
To: devel@rtems.org
Subject: linkcmds.yml problems

Was trying to build the latest source builder/rtems/libbsd but ran into a 
linker problem.

You ever see this the source linker has

spec/build/bsps/microblaze/microblaze_fpga/linkcmds.yml: RAM : ORIGIN = 
_TEXT_START_ADDR, LENGTH = ${BSP_MICROBLAZE_FPGA_RAM_LENGTH}


But the generated linker file is creating

RAM : ORIGIN = _TEXT_START_ADDR, LENGTH =

when building rtems without populating the BSP_MICROBLAZE_FPGA_RAM_LENGTH.



My config.ini has this specified as
configs/config_kcu105_cpu0.ini:BSP_MICROBLAZE_FPGA_RAM_LENGTH=0x1000

Is it possible i have a bad python instance ?


--
Thank you,

Sam Price
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] bsps/microblaze: Fix build option definition order

2022-07-07 Thread Alex White
The build option definitions were rearranged such that the option
definitions used in the linker script were not available. This caused
linker errors when building.
---
 spec/build/bsps/microblaze/microblaze_fpga/bspkcu105.yml  | 2 --
 spec/build/bsps/microblaze/microblaze_fpga/bspkcu105_qemu.yml | 2 --
 spec/build/bsps/microblaze/microblaze_fpga/grp.yml| 2 ++
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105.yml 
b/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105.yml
index c31ca37e9b..9ec29f49f6 100644
--- a/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105.yml
+++ b/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105.yml
@@ -11,8 +11,6 @@ family: microblaze_fpga
 includes: []
 install: []
 links:
-- role: build-dependency
-  uid: linkcmds
 - role: build-dependency
   uid: tstkcu105_qemu
 - role: build-dependency
diff --git a/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105_qemu.yml 
b/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105_qemu.yml
index 39a5ca35d1..9a1147297a 100644
--- a/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105_qemu.yml
+++ b/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105_qemu.yml
@@ -11,8 +11,6 @@ family: microblaze_fpga
 includes: []
 install: []
 links:
-- role: build-dependency
-  uid: linkcmds
 - role: build-dependency
   uid: tstkcu105_qemu
 - role: build-dependency
diff --git a/spec/build/bsps/microblaze/microblaze_fpga/grp.yml 
b/spec/build/bsps/microblaze/microblaze_fpga/grp.yml
index 2473ab8fe8..5fa21e4fa3 100644
--- a/spec/build/bsps/microblaze/microblaze_fpga/grp.yml
+++ b/spec/build/bsps/microblaze/microblaze_fpga/grp.yml
@@ -60,6 +60,8 @@ links:
   uid: ../../objirq
 - role: build-dependency
   uid: ../../objmem
+- role: build-dependency
+  uid: linkcmds
 - role: build-dependency
   uid: ../../bspopts
 type: build
-- 
2.32.0

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] bsps/microblaze: Fix build option definition order

2022-07-07 Thread Joel Sherrill
I'm ok with this but since you said Sebastian committed something which
broke this, it would be good for him to ack as well.

Are there other BSPs which might have this issue?

On Thu, Jul 7, 2022 at 2:20 PM Alex White  wrote:

> The build option definitions were rearranged such that the option
> definitions used in the linker script were not available. This caused
> linker errors when building.
> ---
>  spec/build/bsps/microblaze/microblaze_fpga/bspkcu105.yml  | 2 --
>  spec/build/bsps/microblaze/microblaze_fpga/bspkcu105_qemu.yml | 2 --
>  spec/build/bsps/microblaze/microblaze_fpga/grp.yml| 2 ++
>  3 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105.yml
> b/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105.yml
> index c31ca37e9b..9ec29f49f6 100644
> --- a/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105.yml
> +++ b/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105.yml
> @@ -11,8 +11,6 @@ family: microblaze_fpga
>  includes: []
>  install: []
>  links:
> -- role: build-dependency
> -  uid: linkcmds
>  - role: build-dependency
>uid: tstkcu105_qemu
>  - role: build-dependency
> diff --git a/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105_qemu.yml
> b/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105_qemu.yml
> index 39a5ca35d1..9a1147297a 100644
> --- a/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105_qemu.yml
> +++ b/spec/build/bsps/microblaze/microblaze_fpga/bspkcu105_qemu.yml
> @@ -11,8 +11,6 @@ family: microblaze_fpga
>  includes: []
>  install: []
>  links:
> -- role: build-dependency
> -  uid: linkcmds
>  - role: build-dependency
>uid: tstkcu105_qemu
>  - role: build-dependency
> diff --git a/spec/build/bsps/microblaze/microblaze_fpga/grp.yml
> b/spec/build/bsps/microblaze/microblaze_fpga/grp.yml
> index 2473ab8fe8..5fa21e4fa3 100644
> --- a/spec/build/bsps/microblaze/microblaze_fpga/grp.yml
> +++ b/spec/build/bsps/microblaze/microblaze_fpga/grp.yml
> @@ -60,6 +60,8 @@ links:
>uid: ../../objirq
>  - role: build-dependency
>uid: ../../objmem
> +- role: build-dependency
> +  uid: linkcmds
>  - role: build-dependency
>uid: ../../bspopts
>  type: build
> --
> 2.32.0
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [tools] tester: Remove hard coded time limit for SIS

2022-07-07 Thread Chris Johns
On 7/7/2022 5:34 pm, Sebastian Huber wrote:
> On 07/07/2022 09:29, Chris Johns wrote:
>> -1 from me.
>>
>> On 7/7/2022 4:44 pm, Sebastian Huber wrote:
>>> Remove the hard coded time limit in the SIS configuration which would 
>>> overrule
>>> the general tester settings (for example the --timeout command line option).
>>> Users can set a SIS time limit in the configuration if necessary.
>> I would this to be left as is and not to be the other way around.
>>
>> What is the problem with you having a user config for this?
>>
>> I am now starting to wonder if you have made some dependencies on this for
>> reasons I cannot explain.
> 
> I have no idea way you are so hesitant to remove this default limit. I just 
> want
> to run the tests with a higher timeout defined by the command line --timeout
> option. That's it. I didn't anticipate that this is such an issue.

You are persistent :) and I am not comfortable removing this setting. I am
frustrated with myself that I cannot seem to clearly explain things. I know this
is complicated and detailed but I will try.

I am happy we are discussing this topic. The stability of simulations running in
parallel has been a problem ever since the tester could do it. Returning to the
topic after a period of time has been good and it has forced me to clarify my
thinking about it.

When Joel pointed out the purpose of the option and he questioned removing it I
saw it was a mistake to remove. I saw the critical factor being the time limit
option is relative to the CPU time and not the host. It is a critical point.

I was happy to see the option exists because it could be part of a solution I
have been searching a long time for with simulations. Now I know it exists with
the SIS simulator you would like to disable it. :) I would rather see us sort
out the timing of tests in a more structured manner.

The period I set is wrong because it needs to be the max period of all tests and
I recognise the validations tests are long complex tests and this means timeouts
in general may now be wrong. I had hoped it could be adjusted to be the max. I
am sorry I did not have the time to tune it correctly.

I would like this setting to stay as a reminder we have work to do to better
manage test run times. I am concerned this change will bury the issue and then
leave users needing to understand a timeout command line option and the problems
it hides to get valid test results.

For projects that depend on formal testing I think disabling the option via a
user config, local patch, etc and using the timeout option is subtly moving an
important configuration item to the metadata of the testing process. That option
is for a moment in time and may not work in the future on different hardware.

The detail:

1. The rtems-test command should be able to run simulators for a supported BSP
on any host with any operating system and achieve the same results we see when a
release is made.

2. An option like --timeout requires detailed knowledge to know it is OK to use
to make the tests pass. You and I have that knowledge and confidence to set and
say the test results are fine, users may not.

3. RTEMS is a deterministic operating system and I think a release's tests
should take the same CPU time.

4. OAR under Joel's guidance has built an awesome regression builder and tester.
They should be congratulated for their leadership here. It is costly,
complicated and difficult. Balancing the tester jobs to get reliable and
consistent test results is not easy. A long time out setting helps however that
increases the testing time because you are left waiting for tests to timeout. As
it is things takes days to run. The need for test runs to be as fast as possible
is important.

5. A CPU realtime clock time limit lets us set an accurate timeout per test or
group of tests and that means we can get timeouts that are consistent across all
hosts running the simulator. It also means we can make the test runs as fast as
they can be and if the simulator on host hardware is faster than real target
hardware that can be a large saving of time.

6. Running ticker on my FreeBSD host takes 0.52s and the CPU saw 35s. This
highlights the disconnect between the host clock, the CPU clock and how setting
a valid --timeout value is pure guess work. The command line timeout appears to
work with the SIS because of the scaling happening but in reality it is just a
guess.

7. QEMU is hard because it is more of a VM system these days than a simulator
and a VM wants to make sure the time in the VM is the same as the time on the
host. It does not match well with what we want.

8. The --timeout was added because of qemu and failing tests because I could not
find a means to manage it internally. The timeout use to be hard coded. It sets
the limit of the exe time and it updated by console output. I was forced to add
it because others running the tests could get the same results I was.

9. I wonder if the follow pins the timeout option to the settin

Re: linkcmds.yml problems

2022-07-07 Thread Sam Price
Thanks i was trying to figure out how to debug this but didnt make much
progress.
Was trying to get waf to generate verbose information of all the calls it
was doing but wasnt sure how to do this.

Also saw these warnings during the compile process.  Have not had a chance
to dig into them to see if the conversion from unsigned int to void * is ok.

../../../bsps/microblaze/include/../../shared/dev/clock/clockimpl.h: In
function '_Clock_Initialize':
../../../bsps/microblaze/include/../../shared/dev/clock/clockimpl.h:235:37:
warning: passing argument 1 of 'microblaze_clock_handler_install' from
incompatible pointer type [-Wincompatible-pointer-types]
  235 |   Clock_driver_support_install_isr( Clock_isr );
  | ^
  | |
  | rtems_isr
(*)(rtems_vector_number) {aka void (*)(unsigned int)}
../../../bsps/microblaze/microblaze_fpga/clock/clock.c:141:37: note: in
definition of macro 'Clock_driver_support_install_isr'
  141 |   microblaze_clock_handler_install( isr )
  | ^~~
../../../bsps/microblaze/microblaze_fpga/clock/clock.c:122:71: note:
expected 'rtems_interrupt_handler' {aka 'void (*)(void *)'} but argument is
of type 'rtems_isr (*)(rtems_vector_number)' {aka 'void (*)(unsigned int)'}
  122 | static void microblaze_clock_handler_install(
rtems_interrupt_handler isr )
  |



On Thu, Jul 7, 2022 at 3:09 PM Alex White  wrote:

> On Thu, Jul 7, 2022 at 10:31 AM Sam Price  wrote:
> > Is it possible i have a bad python instance ?
>
> I was able to reproduce the linker problem using the latest RTEMS upstream
> code.
>
> It looks like it was broken by commit
> a0aaa394b68727d204904b59514cb0f90840ba6f from 6 days ago.
>
> I will submit a fix.
>
> Alex
>
> >
> >
> > --
> > Thank you,
> >
> > Sam Price
> > ___
> > devel mailing list
> > devel@rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
>
> 
> From: devel  on behalf of Sam Price <
> thesampr...@gmail.com>
> Sent: Thursday, July 7, 2022 10:30 AM
> To: devel@rtems.org
> Subject: linkcmds.yml problems
>
> Was trying to build the latest source builder/rtems/libbsd but ran into a
> linker problem.
>
> You ever see this the source linker has
>
> spec/build/bsps/microblaze/microblaze_fpga/linkcmds.yml: RAM : ORIGIN =
> _TEXT_START_ADDR, LENGTH = ${BSP_MICROBLAZE_FPGA_RAM_LENGTH}
>
>
> But the generated linker file is creating
>
> RAM : ORIGIN = _TEXT_START_ADDR, LENGTH =
>
> when building rtems without populating the BSP_MICROBLAZE_FPGA_RAM_LENGTH.
>
>
>
> My config.ini has this specified as
> configs/config_kcu105_cpu0.ini:BSP_MICROBLAZE_FPGA_RAM_LENGTH=0x1000
>
> Is it possible i have a bad python instance ?
>
>
> --
> Thank you,
>
> Sam Price
>


-- 
Thank you,

Sam Price
(707) 742-3726
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] bsps/microblaze: Fix build option definition order

2022-07-07 Thread Chris Johns
On 8/7/2022 5:26 am, Joel Sherrill wrote:
> I'm ok with this but since you said Sebastian committed something which broke
> this, it would be good for him to ack as well.
> 
> Are there other BSPs which might have this issue?

I am also wondering this. There is another patch Duc posted for ARM and compiler
flags that I have not seen.

Would your builder catch any issues?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


  1   2   >