[PATCH] Enable MACsec HW offload in driver_macsec_linux if supported

Benny Lønstrup Ammitzbøll benny at ammitzboell-consult.dk
Mon Nov 28 05:04:19 PST 2022


On 26.11.2022 11.14, Jouni Malinen wrote:
> On Fri, Oct 28, 2022 at 04:59:56PM +0200, Benny Lønstrup Ammitzbøll wrote:
>
>> +static int macsec_drv_try_enable_hw_offload(void *priv, enum macsec_offload offl)
> This breaks the build with many existing systems since enum
> macsec_offload is not defined. In other words, this would need some kind
> of conditional build mechanism to try to include this only if the needed
> defines are available.
>
>> +	msg = msg_prepare(MACSEC_CMD_UPD_OFFLOAD, ctx, drv->ifi);
> Same applies for these MACSEC*OFFLOAD* values
Since this is the driver code for linux MACsec I assume that those many 
existing systems are older versions of linux from before the 
macsec_offload was added. How do I check for this?
>
>> @@ -1180,7 +1220,28 @@ static int macsec_drv_create_transmit_sc(
>> +	/* Try to enable MACsec hardware offloading */
>> +	err = macsec_drv_try_enable_hw_offload(drv, MACSEC_OFFLOAD_MAC);
>> +	if (err) {
>> +		err = macsec_drv_try_enable_hw_offload(drv, MACSEC_OFFLOAD_PHY);
>> +		if (err) {
>> +			wpa_printf(MSG_INFO, DRV_PREFIX
>> +				   "%s: MACSEC_OFFLOAD_OFF",
>> +				   drv->common.ifname);
>> +		} else {
>> +			wpa_printf(MSG_INFO, DRV_PREFIX
>> +				   "%s: MACSEC_OFFLOAD_PHY",
>> +				   drv->common.ifname);
>> +		}
>> +	} else {
>> +		wpa_printf(MSG_INFO, DRV_PREFIX
>> +			   "%s: MACSEC_OFFLOAD_MAC",
>> +			   drv->common.ifname);
>> +	}
>>   }
> Missing return 0 at the end of the function.
Thank you, I will add it.
>




More information about the Hostap mailing list