Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/HARMONIZED_LINUX_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.16
6.17
2 changes: 1 addition & 1 deletion config/PROGRAM_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.0
1.11.0
2 changes: 1 addition & 1 deletion src/kernel/drivers/net/can/dev/calc_bittiming.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void can_calc_tdco(struct can_tdc *tdc, const struct can_tdc_const *tdc_const,
if (!tdc_const || !(ctrlmode_supported & CAN_CTRLMODE_TDC_AUTO))
return;

*ctrlmode &= ~CAN_CTRLMODE_TDC_MASK;
*ctrlmode &= ~CAN_CTRLMODE_FD_TDC_MASK;

/* As specified in ISO 11898-1 section 11.3.3 "Transmitter
* delay compensation" (TDC) is only applicable if data BRP is
Expand Down
6 changes: 3 additions & 3 deletions src/kernel/drivers/net/can/dev/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,16 @@ static int can_changelink(struct net_device *dev,
dev->mtu = CAN_MTU;
memset(&priv->data_bittiming, 0,
sizeof(priv->data_bittiming));
priv->ctrlmode &= ~CAN_CTRLMODE_TDC_MASK;
priv->ctrlmode &= ~CAN_CTRLMODE_FD_TDC_MASK;
memset(&priv->tdc, 0, sizeof(priv->tdc));
}

tdc_mask = cm->mask & CAN_CTRLMODE_TDC_MASK;
tdc_mask = cm->mask & CAN_CTRLMODE_FD_TDC_MASK;
/* CAN_CTRLMODE_TDC_{AUTO,MANUAL} are mutually
* exclusive: make sure to turn the other one off
*/
if (tdc_mask)
priv->ctrlmode &= cm->flags | ~CAN_CTRLMODE_TDC_MASK;
priv->ctrlmode &= cm->flags | ~CAN_CTRLMODE_FD_TDC_MASK;
}

if (user->set_restart_ms) {
Expand Down
9 changes: 5 additions & 4 deletions src/kernel/drivers/net/can/dev/skb.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx,
if (!skb)
return 0;

netif_rx(skb);

kfree_skb(skb);
if (netif_rx(skb) == NET_RX_SUCCESS)
dev_consume_skb_any(skb);
else
dev_kfree_skb_any(skb);

return len;
}
Expand Down Expand Up @@ -198,7 +199,7 @@ void can_free_echo_skb(struct net_device *dev, unsigned int idx,
if (frame_len_ptr)
*frame_len_ptr = can_skb_priv->frame_len;

kfree_skb(skb);
dev_kfree_skb_any(skb);
priv->echo_skb[idx] = NULL;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/kernel/drivers/net/can/sja1000/sja1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,9 @@ struct net_device *alloc_sja1000dev(int sizeof_priv)
priv->dev = dev;
priv->can.bittiming_const = &sja1000_bittiming_const;
priv->can.do_set_bittiming = sja1000_set_bittiming;
priv->can.do_set_btr = sja1000_set_btr; /* Special feature to force btr0 and
* btr1 to specific values needed
* for some applications. */
priv->can.do_set_btr = sja1000_set_btr; /* Special feature to force btr0 and
* btr1 to specific values needed
* for some applications. */
priv->can.do_set_mode = sja1000_set_mode;
priv->can.do_get_berr_counter = sja1000_get_berr_counter;
priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK |
Expand Down
37 changes: 16 additions & 21 deletions src/kernel/include/linux/bits.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,23 @@
#define BIT_ULL_MASK(nr) (ULL(1) << ((nr) % BITS_PER_LONG_LONG))
#define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG)
#define BITS_PER_BYTE 8
#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE)

/*
* Create a contiguous bitmask starting at bit position @l and ending at
* position @h. For example
* GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
*/
#if !defined(__ASSEMBLY__)

/*
* Missing asm support
*
* GENMASK_U*() and BIT_U*() depend on BITS_PER_TYPE() which relies on sizeof(),
* something not available in asm. Nevertheless, fixed width integers is a C
* concept. Assembly code can rely on the long and long long versions instead.
*/

#include <linux/build_bug.h>
#include <linux/compiler.h>
#define GENMASK_INPUT_CHECK(h, l) BUILD_BUG_ON_ZERO(const_true((l) > (h)))
Expand All @@ -57,10 +67,14 @@
(type_max(t) << (l) & \
type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))

#define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
#define GENMASK_ULL(h, l) GENMASK_TYPE(unsigned long long, h, l)

#define GENMASK_U8(h, l) GENMASK_TYPE(u8, h, l)
#define GENMASK_U16(h, l) GENMASK_TYPE(u16, h, l)
#define GENMASK_U32(h, l) GENMASK_TYPE(u32, h, l)
#define GENMASK_U64(h, l) GENMASK_TYPE(u64, h, l)
#define GENMASK_U128(h, l) GENMASK_TYPE(u128, h, l)

/*
* Fixed-type variants of BIT(), with additional checks like GENMASK_TYPE(). The
Expand All @@ -86,28 +100,9 @@
* BUILD_BUG_ON_ZERO is not available in h files included from asm files,
* disable the input check if that is the case.
*/
#define GENMASK_INPUT_CHECK(h, l) 0
#define GENMASK(h, l) __GENMASK(h, l)
#define GENMASK_ULL(h, l) __GENMASK_ULL(h, l)

#endif /* !defined(__ASSEMBLY__) */

#define GENMASK(h, l) \
(GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
#define GENMASK_ULL(h, l) \
(GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l))

#if !defined(__ASSEMBLY__)
/*
* Missing asm support
*
* __GENMASK_U128() depends on _BIT128() which would not work
* in the asm code, as it shifts an 'unsigned __int128' data
* type instead of direct representation of 128 bit constants
* such as long and unsigned long. The fundamental problem is
* that a 128 bit constant will get silently truncated by the
* gcc compiler.
*/
#define GENMASK_U128(h, l) \
(GENMASK_INPUT_CHECK(h, l) + __GENMASK_U128(h, l))
#endif

#endif /* __LINUX_BITS_H */
2 changes: 1 addition & 1 deletion src/kernel/include/linux/can/bittiming.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define CAN_BITRATE_UNSET 0
#define CAN_BITRATE_UNKNOWN (-1U)

#define CAN_CTRLMODE_TDC_MASK \
#define CAN_CTRLMODE_FD_TDC_MASK \
(CAN_CTRLMODE_TDC_AUTO | CAN_CTRLMODE_TDC_MANUAL)

/*
Expand Down
8 changes: 0 additions & 8 deletions src/kernel/include/linux/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,6 @@ static inline void *offset_to_ptr(const int *off)
#define __ADDRESSABLE(sym) \
___ADDRESSABLE(sym, __section(".discard.addressable"))

#define __ADDRESSABLE_ASM(sym) \
.pushsection .discard.addressable,"aw"; \
.align ARCH_SEL(8,4); \
ARCH_SEL(.quad, .long) __stringify(sym); \
.popsection;

#define __ADDRESSABLE_ASM_STR(sym) __stringify(__ADDRESSABLE_ASM(sym))

/*
* This returns a constant expression while determining if an argument is
* a constant expression, most importantly without evaluating the argument.
Expand Down
14 changes: 14 additions & 0 deletions src/kernel/include/linux/log2.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,18 @@ int __bits_per(unsigned long n)
) : \
__bits_per(n) \
)

/**
* max_pow_of_two_factor - return highest power-of-2 factor
* @n: parameter
*
* find highest power-of-2 which is evenly divisible into n.
* 0 is returned for n == 0 or 1.
*/
static inline __attribute__((const))
unsigned int max_pow_of_two_factor(unsigned int n)
{
return n & -n;
}

#endif /* _LINUX_LOG2_H */
65 changes: 59 additions & 6 deletions src/kernel/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ struct net_device_ops {
* @lltx: device supports lockless Tx. Deprecated for real HW
* drivers. Mainly used by logical interfaces, such as
* bonding and tunnels
* @netmem_tx: device support netmem_tx.
*
* @name: This is the first field of the "visible" part of this structure
* (i.e. as seen by users in the "Space.c" file). It is the name
Expand Down Expand Up @@ -594,6 +595,7 @@ struct net_device_ops {
* @addr_len: Hardware address length
* @upper_level: Maximum depth level of upper devices.
* @lower_level: Maximum depth level of lower devices.
* @threaded: napi threaded state.
* @neigh_priv_len: Used in neigh_alloc()
* @dev_id: Used to differentiate devices that share
* the same link layer address
Expand Down Expand Up @@ -675,13 +677,11 @@ struct net_device_ops {
*
* @reg_state: Register/unregister state machine
* @dismantle: Device is going to be freed
* @rtnl_link_state: This enum represents the phases of creating
* a new link
*
* @needs_free_netdev: Should unregister perform free_netdev?
* @priv_destructor: Called from unregister
* @npinfo: XXX: need comments on this one
* @nd_net: Network namespace this network device is inside
* protected by @lock
*
* @ml_priv: Mid-layer private
* @ml_priv_type: Mid-layer private type
Expand Down Expand Up @@ -735,8 +735,6 @@ struct net_device_ops {
* switch driver and used to set the phys state of the
* switch port.
*
* @threaded: napi threaded mode is enabled
*
* @irq_affinity_auto: driver wants the core to store and re-assign the IRQ
* affinity. Set by netif_enable_irq_affinity(), then
* the driver must create a persistent napi by
Expand Down Expand Up @@ -795,6 +793,8 @@ struct net_device_ops {
* @max_pacing_offload_horizon: max EDT offload horizon in nsec.
* @napi_config: An array of napi_config structures containing per-NAPI
* settings.
* @num_napi_configs: number of allocated NAPI config structs,
* always >= max(num_rx_queues, num_tx_queues).
* @gro_flush_timeout: timeout for GRO layer in NAPI
* @napi_defer_hard_irqs: If not zero, provides a counter that would
* allow to avoid NIC hard IRQ, on busy queues.
Expand Down Expand Up @@ -867,6 +867,60 @@ void netif_stop_queue(struct net_device *dev);
*/
int netif_queue_stopped(const struct net_device *dev);

static inline void dev_kfree_skb_irq_reason(struct sk_buff *skb, enum skb_drop_reason reason)
{
// QNX: We can simply kfree_skb().
kfree_skb(skb);
}

static inline void dev_kfree_skb_any_reason(struct sk_buff *skb, enum skb_drop_reason reason)
{
// QNX: We can simply kfree_skb().
kfree_skb(skb);
}

/*
* LINUX ONLY:
* It is not allowed to call kfree_skb() or consume_skb() from hardware
* interrupt context or with hardware interrupts being disabled.
* (in_hardirq() || irqs_disabled())
*
* QNX: We can simply kfree_skb().
*
* We provide four helpers that can be used in following contexts :
*
* dev_kfree_skb_irq(skb) when caller drops a packet from irq context,
* replacing kfree_skb(skb)
*
* dev_consume_skb_irq(skb) when caller consumes a packet from irq context.
* Typically used in place of consume_skb(skb) in TX completion path
*
* dev_kfree_skb_any(skb) when caller doesn't know its current irq context,
* replacing kfree_skb(skb)
*
* dev_consume_skb_any(skb) when caller doesn't know its current irq context,
* and consumed a packet. Used in place of consume_skb(skb)
*/
static inline void dev_kfree_skb_irq(struct sk_buff *skb)
{
dev_kfree_skb_irq_reason(skb, SKB_DROP_REASON_NOT_SPECIFIED);
}

static inline void dev_consume_skb_irq(struct sk_buff *skb)
{
dev_kfree_skb_irq_reason(skb, SKB_CONSUMED);
}

static inline void dev_kfree_skb_any(struct sk_buff *skb)
{
dev_kfree_skb_any_reason(skb, SKB_DROP_REASON_NOT_SPECIFIED);
}

static inline void dev_consume_skb_any(struct sk_buff *skb)
{
dev_kfree_skb_any_reason(skb, SKB_CONSUMED);
}

int netif_rx(struct sk_buff *skb);

/**
Expand All @@ -878,7 +932,6 @@ int netif_rx(struct sk_buff *skb);
bool netif_carrier_ok(const struct net_device *dev);

void netif_carrier_on(struct net_device *dev);

void netif_carrier_off(struct net_device *dev);

/**
Expand Down
3 changes: 3 additions & 0 deletions src/kernel/include/linux/pci_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -2648,6 +2648,9 @@
#define PCI_VENDOR_ID_TEKRAM 0x1de1
#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29

#define PCI_VENDOR_ID_RPI 0x1de4
#define PCI_DEVICE_ID_RPI_RP1_C0 0x0001

#define PCI_VENDOR_ID_ALIBABA 0x1ded

#define PCI_VENDOR_ID_CXL 0x1e98
Expand Down
2 changes: 2 additions & 0 deletions src/kernel/include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <linux/kernel.h>
#include <linux/compiler.h>

#include <net/dropreason-core.h>


/**
* struct sk_buff
Expand Down
20 changes: 20 additions & 0 deletions src/kernel/include/linux/stddef.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,24 @@ enum {
#define DECLARE_FLEX_ARRAY(TYPE, NAME) \
__DECLARE_FLEX_ARRAY(TYPE, NAME)

/**
* TRAILING_OVERLAP() - Overlap a flexible-array member with trailing members.
*
* Creates a union between a flexible-array member (FAM) in a struct and a set
* of additional members that would otherwise follow it.
*
* @TYPE: Flexible structure type name, including "struct" keyword.
* @NAME: Name for a variable to define.
* @FAM: The flexible-array member within @TYPE
* @MEMBERS: Trailing overlapping members.
*/
#define TRAILING_OVERLAP(TYPE, NAME, FAM, MEMBERS) \
union { \
TYPE NAME; \
struct { \
unsigned char __offset_to_##FAM[offsetof(TYPE, FAM)]; \
MEMBERS \
}; \
}

#endif
Loading