Skip to content

Commit b0db7bf

Browse files
committed
Merge branch 'onload-9.1'
2 parents ff2814a + 2136682 commit b0db7bf

File tree

37 files changed

+493
-228
lines changed

37 files changed

+493
-228
lines changed

src/driver/linux_net/drivers/net/ethernet/sfc/net_driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
**************************************************************************/
9393

9494
#ifdef EFX_NOT_UPSTREAM
95-
#define EFX_DRIVER_VERSION "6.1.1.1016"
95+
#define EFX_DRIVER_VERSION "6.2.0.1000"
9696
#endif
9797

9898
#ifdef DEBUG

src/driver/linux_net/drivers/net/ethernet/sfc/rx_common.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,7 @@ void efx_discard_rx_packet(struct efx_channel *channel,
252252
unsigned int n_frags)
253253
{
254254
struct efx_rx_queue *rx_queue = efx_channel_get_rx_queue(channel);
255-
#if !defined(EFX_USE_KCOMPAT) || defined(EFX_HAVE_XDP_SOCK)
256255
struct efx_rx_buffer *_rx_buf = rx_buf;
257-
#endif
258256

259257
if (!rx_queue->efx->rx_buf_page_share) {
260258
#if !defined(EFX_USE_KCOMPAT) || defined(EFX_HAVE_XDP_SOCK)

src/driver/linux_onload/driver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ int oo_fop_open(struct inode* inode, struct file* filp)
297297
priv->fd_flags = 0;
298298
priv->priv_cp = NULL;
299299
ci_dllist_init(&priv->dshm_list);
300+
priv->dshm_used_head = NULL;
300301

301302
filp->private_data = (void*) priv;
302303
filp->f_op = &oo_fops;

src/driver/linux_onload/dshm.c

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ struct oo_dshm_buffer {
5656
};
5757

5858

59+
/* Linked list node for tracking users of a dshm segment */
60+
struct oo_dshm_list {
61+
struct oo_dshm_buffer* buffer;
62+
struct oo_dshm_list* next;
63+
};
64+
65+
5966
static inline int /* bool */
6067
validate_shm_class(ci_int32 shm_class)
6168
{
@@ -248,11 +255,26 @@ oo_dshm_free_handle_list(ci_dllist* list)
248255
}
249256

250257

258+
int oo_dshm_free_used(struct oo_dshm_list* head)
259+
{
260+
/* We don't need to hold the oo_dshm_state.lock here as this list is local to
261+
* this file and if we are shutting down, then we shouldn't be in a context
262+
* that allows new memory maps to be created. */
263+
while( head ) {
264+
struct oo_dshm_list* next = head->next;
265+
dshm_release(head->buffer);
266+
vfree(head);
267+
head = next;
268+
}
269+
270+
return 0;
271+
}
272+
251273

252274
#ifdef OO_MMAP_TYPE_DSHM
253275
/* Maps a dshm segment into a process's address space. */
254276
int
255-
oo_dshm_mmap_impl(struct vm_area_struct* vma)
277+
oo_dshm_mmap_impl(struct vm_area_struct* vma, struct oo_dshm_list** used_head)
256278
{
257279
ci_uint64 map_id = OO_MMAP_OFFSET_TO_MAP_ID(VMA_OFFSET(vma));
258280
ci_int32 buffer_id = OO_MMAP_DSHM_BUFFER_ID(map_id);
@@ -293,8 +315,27 @@ oo_dshm_mmap_impl(struct vm_area_struct* vma)
293315
*/
294316
ci_uint32 num_pages = CI_MIN((unsigned long)buffer->num_pages,
295317
map_length >> PAGE_SHIFT);
318+
struct oo_dshm_list* dshm_node;
296319
ci_uint32 i;
297-
for( i = 0, rc = 0; i < num_pages && rc == 0; ++i ) {
320+
321+
/* Reset rc, to allow the remapping loop to start unless we encounter
322+
* another error before we reach that point. */
323+
rc = 0;
324+
325+
dshm_node = vmalloc(sizeof(*dshm_node));
326+
if( dshm_node == NULL ) {
327+
OO_DEBUG_SHM(ci_log("%s: unable to allocate memory to track dshm",
328+
__FUNCTION__));
329+
/* Setting rc != 0 here will skip the remapping loop below */
330+
rc = -ENOMEM;
331+
dshm_release(buffer);
332+
} else {
333+
dshm_node->buffer = buffer;
334+
dshm_node->next = *used_head;
335+
*used_head = dshm_node;
336+
}
337+
338+
for( i = 0; i < num_pages && rc == 0; ++i ) {
298339
/* vm_insert_page() would have been simpler (and allow core dumps to
299340
* capture these pages), but it fails with anonymous pages */
300341
rc = remap_pfn_range(vma,
@@ -307,8 +348,8 @@ oo_dshm_mmap_impl(struct vm_area_struct* vma)
307348
OO_DEBUG_SHM(ci_log("%s: can't map buffer owned by %u", __FUNCTION__,
308349
buffer->owner_euid));
309350
rc = -EACCES;
351+
dshm_release(buffer);
310352
}
311-
dshm_release(buffer);
312353
}
313354

314355
return rc;

src/driver/linux_onload/mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ oo_fop_mmap(struct file* file, struct vm_area_struct* vma)
524524
return oo_cplane_mmap(file, vma);
525525
#ifdef OO_MMAP_TYPE_DSHM
526526
case OO_MMAP_TYPE_DSHM:
527-
return oo_dshm_mmap_impl(vma);
527+
return oo_dshm_mmap_impl(vma, &priv->dshm_used_head);
528528
#endif
529529
case OO_MMAP_TYPE_UBUF_POST:
530530
return oo_ubuf_post_mmap(file, vma);

src/driver/linux_onload/onloadfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ onload_alloc_file(tcp_helper_resource_t *thr, oo_sp ep_id,
326326
void onload_priv_free(ci_private_t *priv)
327327
{
328328
if( priv->_filp->f_path.mnt != onload_mnt ) {
329+
oo_dshm_free_used(priv->dshm_used_head);
329330
oo_dshm_free_handle_list(&priv->dshm_list);
330331
ci_free(priv);
331332
}

src/driver/linux_onload/shrub_fns.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ MODULE_PARM_DESC(shrub_controller_path,
8686
"Sets the path to the shrub_controller binary. Defaults to "
8787
DEFAULT_SHRUB_CONTROLLER_PATH" if empty.");
8888

89-
static int shrub_spawn_server(char* controller_id, bool debug)
89+
static int shrub_spawn_server(char* controller_id, bool debug,
90+
bool use_interrupts)
9091
{
9192
int rc = 0;
9293
char* path;
@@ -96,19 +97,34 @@ static int shrub_spawn_server(char* controller_id, bool debug)
9697
controller_id,
9798
"-D",
9899
"-K",
99-
debug ? "-d" : NULL,
100+
/* slots for extra args */
101+
NULL,
102+
NULL,
103+
/* terminator */
100104
NULL
101105
};
102106
char* envp_flags = "";
103107
char* envp[] = {
104108
envp_flags,
105109
NULL
106110
};
111+
/* This must be the index of the first NULL slot in the argv array */
112+
int extra_arg_idx = 5;
107113

108114
path = kmalloc(PATH_MAX, GFP_KERNEL);
109115
if ( !path )
110116
return -ENOMEM;
111117

118+
if( debug )
119+
argv[extra_arg_idx++] = "-d";
120+
121+
if( use_interrupts )
122+
argv[extra_arg_idx++] = "-i";
123+
124+
/* We must create enough slots for extra arguments we pass to the shrub
125+
* controller, as otherwise we may not terminate the array correctly. */
126+
BUG_ON(extra_arg_idx >= (sizeof(argv) / sizeof(argv[0])));
127+
112128
spin_lock(&shrub_lock);
113129
strncpy(path, shrub_get_controller_path(), PATH_MAX);
114130
path[PATH_MAX - 1] = '\0';
@@ -149,7 +165,8 @@ int oo_shrub_spawn_server(ci_private_t *priv, void *arg) {
149165
rc = snprintf(controller_id, sizeof(controller_id), "%u", shrub_data->controller_id);
150166
if ( rc < 0 || rc >= sizeof(controller_id) )
151167
return -EINVAL;
152-
return shrub_spawn_server(controller_id, shrub_data->debug);
168+
return shrub_spawn_server(controller_id, shrub_data->debug,
169+
shrub_data->use_interrupts);
153170
}
154171

155172
int oo_shrub_set_sockets(ci_private_t *priv, void* arg) {

src/include/ci/efhw/ef10ct.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ struct ef10ct_shared_kernel_evq {
7777
struct efhw_iopages iopages;
7878
uint32_t irq;
7979
uint32_t channel;
80-
char name[IFNAMSIZ + 6];
80+
char name[IFNAMSIZ + 11];
81+
int overflow;
82+
int tx_flush_evs;
83+
int rx_flush_evs;
84+
int rx_evs;
8185
};
8286

8387
enum ef10ct_queue_handle_type {

src/include/ci/internal/opts_netif_def.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,15 @@ CI_CFG_OPT("EF_SHRUB_DEBUG", shrub_debug, ci_uint32,
17931793
"Output debug logging from shrub controller.",
17941794
1, , 0, 0, 1, yesno)
17951795

1796+
CI_CFG_OPT("EF_SHRUB_USE_INTERRUPTS", shrub_use_interrupts, ci_uint32,
1797+
"Enable interrupt driven mode when using shrub.\n"
1798+
"Setting this option will enable interrupts to be used with shrub. If it is "
1799+
"not set, applications must ensure they are actively polling to ensure that "
1800+
"data can be handled in userspace. If interrupts are not enabled and the "
1801+
"application does not spin, we will fall back to the periodic polling timer "
1802+
"to be woken up.",
1803+
1, , 1, 0, 1, yesno)
1804+
17961805
CI_CFG_OPT("EF_ENABLE_TX_ERROR_RECOVERY", tx_error_recovery, ci_uint32,
17971806
"Recover a broken TXQ after observing a TX error event.\n"
17981807
"If we see a TX error event for any reason, then the interface that saw it "

src/include/etherfabric/ef_vi.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,20 @@ typedef struct {
980980
uint32_t rx_ev_bad_q_label;
981981
/** Gaps in the event queue (empty slot followed by event) */
982982
uint32_t evq_gap;
983+
984+
// EF10CT-specific stats per RXQ
985+
struct {
986+
uint64_t buffers_freed;
987+
uint64_t post_fifo_full;
988+
uint64_t free_list_empty;
989+
uint64_t sw_fifo_empty;
990+
uint64_t hw_fifo_empty;
991+
uint64_t sentinel_wait;
992+
uint64_t acquire_failures;
993+
uint64_t release_count;
994+
uint64_t torn_down_out_of_order;
995+
uint64_t corrupt_rxq_state;
996+
} ef10ct_stats[EF_VI_MAX_EFCT_RXQS];
983997
} ef_vi_stats;
984998

985999
/*! \brief The type of NIC in use

0 commit comments

Comments
 (0)